Skip to content

DeprecationWarning: 'U' mode is deprecated #115

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

Closed
1 of 2 tasks
montefra opened this issue Mar 17, 2017 · 5 comments
Closed
1 of 2 tasks

DeprecationWarning: 'U' mode is deprecated #115

montefra opened this issue Mar 17, 2017 · 5 comments

Comments

@montefra
Copy link
Contributor

montefra commented Mar 17, 2017

From python 3.4 on, the 'U' mode of open has been deprecated.
According to this answer the 'U' has been replaced by the newline argument, that when set to None, the default, uses universal new line.
I have identified only three rU modes. Two in the readline function and one regarding svn.

  • If it's fine with you, for the first two cases I'll do a PR where I set the mode to rU for python 2 and r otherwise.
  • I don't think that I need to touch the svn case, as the mode is never used
@RonnyPfannschmidt
Copy link
Member

Since Python 3.3 is in the support Matrix, does that work the same?

@montefra
Copy link
Contributor Author

It seems so: https://docs.python.org/3.3/library/functions.html#open.

The newline argument is present and

'U' universal newlines mode (for backwards compatibility; should not be used in new code)

@RonnyPfannschmidt
Copy link
Member

The PR you propose is def an enhancement

we will have to follow up with open and read eventially tho

@montefra
Copy link
Contributor Author

I can start with readlines and then work my way through.
I discovered the deprecation through pytest-warnings and I think that I can temporarily enable it to check. I'll start the PR early next week

@RonnyPfannschmidt
Copy link
Member

closed by #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants