-
Notifications
You must be signed in to change notification settings - Fork 20
fix: remove "U" move from open(), now universal newline is the default #31
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
base: main
Are you sure you want to change the base?
Conversation
@wolever can you merge this? Otherwise we will have troubles using the pkg with Python 3.11. |
Yes, pprintpp doesn't work with python 3.11. Please merge and release ! |
ping @wolever |
One more friendly ping @wolever 😆 |
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.
Maybe this should use io.open
?
Modern way would be to use simply |
@wolever If you okay with an merging soon I could prepare an update for using |
The thing there is if the library wishes to remain compatible with Python 3.4 or even 2.7. I think. |
Why support a Python version that reached end of life in a new version of a library? |
the fix proposed in this PR wouldn't break compatibility and would at least allow pprintpp to work with modern python versions, however. (beside the fact that both 3.4 and 2.7 have been end-of-life for years by now) |
In python2.7 you needed to specify
mode='U'
to get universal newline: https://docs.python.org/2.7/library/functions.html#open:~:text=universal%20newlines%20support%3B-,supplying%20%27U%27,-opens%20the%20filein python3 this is now the default: https://docs.python.org/3/library/functions.html#open:~:text=if%20newline%20is%20None%2C%20universal%20newlines%20mode%20is%20enabled
but if left there, it now triggers an error with 3.11, so let's remove it