mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
#6623: Add explicit deprecation warning for ftplib.Netrc.
This commit is contained in:
parent
8aa164b395
commit
87632f1a9e
3 changed files with 18 additions and 1 deletions
|
@ -39,6 +39,7 @@ python ftplib.py -d localhost -l -p -l
|
|||
import os
|
||||
import sys
|
||||
import socket
|
||||
import warnings
|
||||
from socket import _GLOBAL_DEFAULT_TIMEOUT
|
||||
|
||||
__all__ = ["FTP","Netrc"]
|
||||
|
@ -953,6 +954,8 @@ class Netrc:
|
|||
__defacct = None
|
||||
|
||||
def __init__(self, filename=None):
|
||||
warnings.warn("This class is deprecated, use the netrc module instead",
|
||||
DeprecationWarning, 2)
|
||||
if filename is None:
|
||||
if "HOME" in os.environ:
|
||||
filename = os.path.join(os.environ["HOME"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue