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

Issue with Python 3.11 #15

Open
thevoices opened this issue Oct 30, 2023 · 4 comments
Open

Issue with Python 3.11 #15

thevoices opened this issue Oct 30, 2023 · 4 comments

Comments

@thevoices
Copy link

sw_vers
ProductName: macOS
ProductVersion: 14.2
BuildVersion: 23C5030f
Python 3.11.3 (v3.11.3:f3909b8bc8, Apr 4 2023, 20:12:10) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin

plist-yaml-plist version 0.6.3
Processing plist file...
Traceback (most recent call last):
File "/usr/local/bin/plistyamlplist", line 319, in
main()
File "/usr/local/bin/plistyamlplist", line 311, in main
plist_yaml(in_path, out_path)
File "/usr/local/bin/plistyamlplist_lib/plist_yaml.py", line 104, in plist_yaml
output = convert(normalized)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/plistyamlplist_lib/plist_yaml.py", line 91, in convert
return dump(xml, width=float("inf"), default_flow_style=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/homeuser/Library/Python/3.11/lib/python/site-packages/ruamel/yaml/main.py", line 1237, in dump
error_deprecation('dump', 'dump', arg="typ='unsafe', pure=True")
File "/Users/homeuser/Library/Python/3.11/lib/python/site-packages/ruamel/yaml/main.py", line 1025, in error_deprecation
raise AttributeError(s, name=None)
AttributeError:
"dump()" has been removed, use

yaml = YAML(typ='unsafe', pure=True)
yaml.dump(...)

instead of file "/usr/local/bin/plistyamlplist_lib/plist_yaml.py", line 91

return dump(xml, width=float("inf"), default_flow_style=False)

RecipeOverrides % plistyamlplist -h
plist-yaml-plist version 0.6.3
Traceback (most recent call last):
File "/usr/local/bin/plistyamlplist", line 319, in
main()
File "/usr/local/bin/plistyamlplist", line 303, in main
if check_if_plist(in_path):
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/plistyamlplist", line 62, in check_if_plist
with open(in_path) as fp:
^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '-h'

@bolaussen
Copy link

This is happening for me too

@markkenny
Copy link

Seems to be an issue with ruaml.yaml 0.18 and above. 0.18.0 runs, but fails silently, 0.18.1 and above errors as you are seeing.

Workaround is uninstall any 0.18 version and and install 0.17.40.

python3 -m pip uninstall ruamel.yaml  
python3 -m pip install -U ruamel.yaml==0.17.40 --user

@grahampugh
Copy link
Owner

Hi folks, this should be fixed with https://github.com/grahampugh/plist-yaml-plist/releases/tag/v0.6.4 - you'll need to remove the newer version of ruamel.yaml and the script will then automatically install an older working version. I'll have to take a longer look at how to use the changes in the newer version of ruamel.yaml as it looks completely different to before.

@markkenny
Copy link

Had to downgrade to 0.17.40 again today, and wasn't allowed until I added --break-system-packages

python3 -m pip install --break-system-packages --user ruamel.yaml==0.17.40

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

No branches or pull requests

4 participants