Comments (6)
@IzzySoft , this has been resolved, no longer using is_relative_to
from magisk-modules-repo-util.
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.
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:
- you establish the path for the downloaded file based on
module_path
, i.e. inside it:
module_folder.joinpath(online_module.changelog_filename)
- 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.
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.
cli.py sync --remove-unused
has been removed because it is useless and unnecessary.
from magisk-modules-repo-util.
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)
- trailing commas in update.json cause JSONDecodeError HOT 4
- quoted versionCode in update.json causes ValueError HOT 13
- sync improvements
- improve handling of logging for disappeared sources
- (temporarily) disable updates for a module
- Questions on updating modules HOT 17
- Bug with updating from GIT HOT 4
- Some modules are updated on each scan despite not having been changed HOT 2
- adjust timestamps when building from git-clone HOT 4
- field names in modules.json HOT 4
- Sources downloaded from the releases page are just crashing HOT 1
- cli.py sync crashes HOT 1
- [FR] Add a check for `max_num` HOT 4
- TypeError: Object of type PosixPath is not JSON serializable HOT 1
- last_update vs last_build HOT 23
- fields in track.json
- Inverted versions array field HOT 1
- Problem with ghproxy in zipUrl HOT 4
- cli.py sync exits with returncode 1 without telling why
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magisk-modules-repo-util.