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

execution of module a failed without setting an exception error when using function as function's default args #3191

Open
myrfy001 opened this issue Oct 17, 2019 · 3 comments

Comments

@myrfy001
Copy link

@myrfy001 myrfy001 commented Oct 17, 2019

Although that I know you should not write code like this, but the follow code will cause execution of module a failed without setting an exception with the 3.x beta version (commit id 758aaad), while the 0.29.13 version works fine.

# This is the python file to cythonize, called a.py
import datetime

def func(x=datetime.datetime.now()):
    print(x)
# This is the code to use the compiled module
import a

a.func()
@scoder

This comment has been minimized.

Copy link
Contributor

@scoder scoder commented Oct 18, 2019

Thanks for the report. Seems worth adding this as a test to this test file.

@scoder

This comment has been minimized.

Copy link
Contributor

@scoder scoder commented Oct 18, 2019

Needs further investigation by looking at the generated C code to see where the error originates from.

@da-woods

This comment has been minimized.

Copy link
Contributor

@da-woods da-woods commented Oct 18, 2019

I had a quick look at this and couldn't reproduce this bug under either Python 3.7 or Python 2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.