Giter Club home page Giter Club logo

Comments (6)

SanmerDev avatar SanmerDev commented on June 25, 2024 1

@IzzySoft , this has been resolved, no longer using is_relative_to

from magisk-modules-repo-util.

SanmerDev avatar SanmerDev commented on June 25, 2024
AttributeError: 'PosixPath' object has no attribute 'is_relative_to'
  • pathlib.PurePath.is_relative_to was added in version 3.9.

from magisk-modules-repo-util.

IzzySoft avatar IzzySoft commented on June 25, 2024

Well, then we have an issue there: many LTS systems (like mine) are having 3.8 still and no easy upgrade path. Can't you use a different implementation? TBH, I don't even see the reason for that check there:

  1. you establish the path for the downloaded file based on module_path, i.e. inside it:
    module_folder.joinpath(online_module.changelog_filename)
  2. you send it to that method, which then checks whether the new path is inside module_path:
    if not (file.is_relative_to(module_folder))
    – where else should it be if you explicitly created it inside?

So why not reducing if not (file.is_relative_to(module_folder) and file.exists()): to just if not file.exists()? Or, if you insist, how about this:

if not (file.parents[1] == module_folder and file.exists()):

I've just verified: PosixPath.parents is available in Python 3.8. And that would do the job fine, as the downloaded file must reside in <module_path>/<module_id>/. It's even more precise, as any other location (e.g. directly in module_path, or more than one level deeper) would be wrong, without file.is_relative_to() detecting that.

Any chance for an adjustment here, @ya0211?

from magisk-modules-repo-util.

IzzySoft avatar IzzySoft commented on June 25, 2024

Thanks! I'll update ASAP (just performed a git pull so I have the current code here already, will test later). Hopefully that was the last "culprit".

Just for info: I (hopefully) finished updating my framework last night. Still needs some testing, but I'm confident to be "back to normal" on the weekend. The only open question remaining is what happened to cli.py sync --remove-unused, and what replaced it. Can you tell me, please?

from magisk-modules-repo-util.

SanmerDev avatar SanmerDev commented on June 25, 2024

cli.py sync --remove-unused has been removed because it is useless and unnecessary.

from magisk-modules-repo-util.

IzzySoft avatar IzzySoft commented on June 25, 2024

Thanks for confirming! I'll then remove it from my framework as well (admitting I cannot remember ever having used it).

from magisk-modules-repo-util.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.