-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Lib/ftplib.py Netrc class should be removed. #50872
Comments
The 'macro_lines' list should probably be emptied upon leaving macro Simplify code by using the 'macro_name' variable as the boolean for Deprecated code probably should be fixed until completely removed |
If the macro_lines is not emptied upon end of parsing a macro The use before definition should also be fixed. Please advise if a better fix would be to completely remove the Netrc |
New changeset acf247d25f17 by R David Murray in branch 'default': |
Thanks for the report. ftplib.Netrc has been deprecated (via its doc string) since at least Python 2.4, and is no longer documented in the library reference. I've added an explicit DeprecationWarning in Python 3.4, and have altered this issue to call for its complete removal in Python 3.5. I am not planning to fix the existing code, because IMO with deprecated code this old the chance of breaking something exceeds the chance that the bad code will do harm. |
Created patch to remove the Netrc class and its unit tests (for Python 3.5). |
This looks good, except that if we are not going to delete that test routine (and we aren't because we didn't deprecate it :) I think we should instead replace the usage of Netrc with the netrc module. |
This patch is the same as my previous one, except instead of removing Netrc usage from the ftplib.test() function, it replaces it with the netrc.netrc object. Note that there are no existing tests for the ftplib.test() function. Also did some very minor cleanups (bare raise is no longer valid) to get rid of warnings/errors in static analyzer. |
Did you hand test it? Also, you could open a new issue to add tests for the ftplib cli, and probably improve and document it? It was designed as a test, but some people may be using it and it might even be actually useful :) |
I've downloaded 'remove_Netrc_class2.patch' and passes the test suite, the examples on the documentation run ok and manually from the command line: $hg tip My test '.netrc' file was: The patch also looks good for me. |
Great. The patch looks good to me, too. Can someone add a What's New removal entry to the patch? (See the 3.4 What's New for a model of what removals look like in What's New.) (It would also be nice if the patch were in hg format so that we get a 'review' link, but that's not critical as I don't think we need a line-by-line review here). |
Here's a patch with a whatsnew entry. |
New changeset ec196a99af8d by Berker Peksag in branch 'default': |
Thanks for the patch, Matt. Have you signed a contributor's agreement? You can find it at https://www.python.org/psf/contrib/contrib-form/ |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: