Skip to content

Conversation

@Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Feb 19, 2020

Fixes the follwoing error: "TypeError: code() takes at least 14 arguments (13 given)".

The cause of the issue is a breaking change in CodeType constructor in Python 3.8.
https://bugs.python.org/issue37221
This should have been fixed by python/cpython#13959 and python/cpython#14505, but the code still fails.

Fixes #2952


This change is Reviewable

Fixes the follwoing error: "TypeError: code() takes at least 14 arguments (13 given)".

The cause of the issue is a breaking change in CodeType constructor in Python 3.8.
https://bugs.python.org/issue37221
This should have been fixed by python/cpython#13959 and python/cpython#14505, but the code still fails.
@pablogsal
Copy link

pablogsal commented Feb 19, 2020

This should have been fixed by python/cpython#13959 and python/cpython#14505, but the code still fails.

Hi, CPython core dev here ✋

Those PRs did not intend to change back the CodeType constructor. As I said in python/cpython#12701 (comment):

Also, types.CodeType's constructor is considered private. We now even have this warning in the docs (https://docs.python.org/3.8/library/types.html#standard-interpreter-types):

If you instantiate any of these types, note that signatures may vary between Python versions.

Additionally, you have now available types.CodeType.replace in case you can to create a copy with some fields changed.

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Feb 20, 2020

Hi, CPython core dev here

Those PRs did not intend to change back the CodeType constructor. As I said in python/cpython#12701 (comment):

Also, types.CodeType's constructor is considered private. We now even have this warning in the docs (https://docs.python.org/3.8/library/types.html#standard-interpreter-types):

If you instantiate any of these types, note that signatures may vary between Python versions.

Thank you for the explanation!
I hope in future we'll have a more stable API for dynamic function generation.

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Feb 24, 2020

@numerology Can you please take a look?
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@numerology
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit 2dee255 into kubeflow:master Feb 24, 2020
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
* SDK - Fix SDK on Python 3.8

Fixes the follwoing error: "TypeError: code() takes at least 14 arguments (13 given)".

The cause of the issue is a breaking change in CodeType constructor in Python 3.8.
https://bugs.python.org/issue37221
This should have been fixed by python/cpython#13959 and python/cpython#14505, but the code still fails.

* Simplified the replace call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix SDK on Python 3.8

4 participants