-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
bpo-37330: open() no longer accept 'U' in file mode #14204
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
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.
Needed changes in imp.py
and fileinput.py
.
When you're done making the requested changes, leave the comment: |
Line 228 in 5954334
ValueError that "U" is invalid so not sure if it needs to be changed.
Edit: Saw Serhiy's review about |
open(), io.open(), codecs.open() and fileinput.FileInput no longer accept "U" ("universal newline") in the file mode. This flag was deprecated since Python 3.3.
@tirkarthi @serhiy-storchaka: I made requested changes. |
Oh, the Doc job of Travis CI fails with:
Sphinx still uses rU mode. |
Sphinx issue comes from docutils:
Extract of the code, it seems to contain a copy of fileinput.FileInput:
|
I reported the docutils issue to docutils bug tracker with a patch: https://sourceforge.net/p/docutils/bugs/363/ |
This PR cannot be merged because it breaks the Python CI because of docutils: https://bugs.python.org/issue37330#msg346219 I prefer to close this PR right now. I will not be available next weeks, so I prefer to close the PR. I may reopen it later, once docutils is fixed. |
@vstinner docutils 0.15 was released on July 21 which has the patch for 'U' mode. The current build config uses |
Nice. I tried to reopen the issue after I rebased my branch, but I made a mistake and I'm no longer able to open the PR. So I created PR #16959 instead. |
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
https://bugs.python.org/issue37330