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

Adapt to Python 3.9 API changes #9105

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

lorenzph
Copy link
Contributor

While attempting to save a project on my machine using Python 3.9 I ran into the following traceback.

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/cura/CuraApplication.py", line 1063, in event
    return super().event(event)
  File "/usr/lib/python3.9/site-packages/UM/Qt/QtApplication.py", line 464, in event
    event._function_event.call()
  File "/usr/lib/python3.9/site-packages/UM/Event.py", line 218, in call
    self._function(*self._args, **self._kwargs)
  File "/usr/lib/python3.9/site-packages/cura/Utils/Threading.py", line 34, in _handle_call
    ico.result = func(*args, **kwargs)
  File "/usr/lib/cura/plugins/3MFWriter/ThreeMFWorkspaceWriter.py", line 57, in write
    self._writeContainerToArchive(container, archive)
  File "/usr/lib/cura/plugins/3MFWriter/ThreeMFWorkspaceWriter.py", line 154, in _writeContainerToArchive
    serialized_data = container.serialize(ignored_metadata_keys = ignore_keys)
  File "/usr/lib/cura/plugins/XmlMaterialProfile/XmlMaterialProfile.py", line 154, in serialize
    builder.start("metadata") # type: ignore
TypeError: start expected 2 arguments, got 1

This was introduced by a fix in Python 3.9 which aligns the C implementation of TreeBuilder with the Python implementation.

Python 3.9 now made the TreeBuilder.start() `attrs` parameter ([1])
mandatory on all implementations. Adapt the plugin accordingly.

[1] https://bugs.python.org/issue39495
@nallath nallath merged commit 828ddd2 into Ultimaker:master Jan 15, 2021
@nallath
Copy link
Member

nallath commented Jan 15, 2021

It doesn't break anything for us, so I we might as well include it. Thanks for the contribution!

@deBugger-
Copy link

@nallath
Hi,
are you so kind to tell us which phyton version works. Better a link to a detail cura precondition documentation.

https://support.ultimaker.com/hc/en-us/articles/360011788040-What-are-the-system-requirements-for-Ultimaker-Cura-
On this page are the details missing.

Thank you

@nallath
Copy link
Member

nallath commented May 3, 2021

The details are missing there because the installer handles that. We don't use any pre-installed python versions if you download it.

If you want to run from source, Python 3.8.6 is what I use

@Ghostkeeper
Copy link
Collaborator

https://support.ultimaker.com/hc/en-us/articles/360011788040-What-are-the-system-requirements-for-Ultimaker-Cura-
On this page are the details missing.

The details are missing there because it is assuming you are using the official distribution of Cura, which comes with its own copy of CPython, rather than using your system's Python installation.

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.

4 participants