Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: plistlib.loads #696

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

bugfix: plistlib.loads #696

wants to merge 3 commits into from

Conversation

pome-ta
Copy link

@pome-ta pome-ta commented May 1, 2023

#695

plistlib.readPlist -> plistlib.loads
add
read_bytes of from pathlib import Path

plistlib.readPlist -> plistlib.loads
add
read_bytes of from pathlib import Path
Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go all-in on pathlib...

info_plist = plistlib.loads((Path(sys.executable).parent / "Info.plist").read_bytes())

@@ -12,7 +13,8 @@ def get_pythonista_version_info():

try:
plist_path = os.path.abspath(os.path.join(sys.executable, '..', 'Info.plist'))
Copy link
Contributor

@cclauss cclauss May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plist_path = os.path.abspath(os.path.join(sys.executable, '..', 'Info.plist'))

Comment on lines 16 to 17
plist_data = Path(plist_path).read_bytes()
plist = plistlib.loads(plist_data)
Copy link
Contributor

@cclauss cclauss May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plist_data = Path(plist_path).read_bytes()
plist = plistlib.loads(plist_data)
info_plist = plistlib.loads((Path(sys.executable).parent / "Info.plist").read_bytes())

scripts/sysinfo.py Outdated Show resolved Hide resolved
@pome-ta
Copy link
Author

pome-ta commented May 2, 2023

Go all-in on pathlib...

info_plist = plistlib.loads((Path(sys.executable).parent / "Info.plist").read_bytes())

Thank you! Very smart now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants