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

Ubuntu 24.04 noble errors at loading yaml #32

Open
NeroBurner opened this issue Jul 17, 2024 · 0 comments · May be fixed by #34
Open

Ubuntu 24.04 noble errors at loading yaml #32

NeroBurner opened this issue Jul 17, 2024 · 0 comments · May be fixed by #34

Comments

@NeroBurner
Copy link
Contributor

On Ubuntu 24.04 noble the command errors with the following message (both current master and 0.12.12):

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/gc/repos/aptly/python-aptly/aptly/publisher/__main__.py", line 352, in <module>
    main()
  File "/home/gc/repos/aptly/python-aptly/aptly/publisher/__main__.py", line 87, in main
    action_publish(client, publishmgr, config_file=args.config,
  File "/home/gc/repos/aptly/python-aptly/aptly/publisher/__main__.py", line 313, in action_publish
    config = load_config(config_file)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gc/repos/aptly/python-aptly/aptly/publisher/__main__.py", line 23, in load_config
    return yaml.load(fh)
           ^^^^^^^^^^^^^
TypeError: load() missing 1 required positional argument: 'Loader'

Should be related to the deprecation warning issued in Ubuntu 22.04 run:

/home/gc/repos/aptly/python-aptly/aptly/publisher/__main__.py:23: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  return yaml.load(fh)

The python3-aptly and aptly-publisher version 0.12.12-1 from the Ubuntu Repo seems to work. Maybe the Debin/Ubuntu maintainers added a patch we could use here

NeroBurner pushed a commit to NeroBurner/python-aptly that referenced this issue Jul 17, 2024
The `yaml.load()` function without a `Loader` keyword is deprecated
since `pyyaml 5.1` and removed with `pyyaml 6.0`.

Ubuntu 24.04 noble ships with `pyyaml 6.0.1` breaking `python-aptly` and
`aptly-publisher`.

Fix it by using the recommended `yaml.safe_load()` function.

Fixes: tcpcloud#32
NeroBurner added a commit to NeroBurner/python-aptly that referenced this issue Jul 17, 2024
The `yaml.load()` function without a `Loader` keyword is deprecated
since `pyyaml 5.1` and removed with `pyyaml 6.0`.

Ubuntu 24.04 noble ships with `pyyaml 6.0.1` breaking `python-aptly` and
`aptly-publisher`.

Fix it by using the recommended `yaml.safe_load()` function.

Fixes: tcpcloud#32
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 a pull request may close this issue.

1 participant