Skip to content

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())

bundle_version = None

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())

@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