fix: remove "U" move from open(), now universal newline is the default#31
fix: remove "U" move from open(), now universal newline is the default#31sandrotosi wants to merge 1 commit intowolever:mainfrom
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 😆 |
|
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