-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: read_csv/table raising when sys.setprofile used #41105
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
Conversation
good catch. |
thanks @mzeitlin11 |
parser = all_parsers | ||
data = "a b\n0 1" | ||
|
||
sys.setprofile(lambda *a, **k: None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a try/finally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to change - that would be safer
With sys.setprofile, read_csv breaks when the data frame is saved using a different separator such as (sep='µ') df.to_csv('df.csv', index=False, sep='µ') |
sys.setprofile
breaksread_csv
#41069According to https://docs.python.org/3/library/functions.html#locals,
locals()
should not be modified. AFAICT these are the only placeslocals()
is used in this way without copying.