Commit 3c4d7805 authored by Leo Pound Singer's avatar Leo Pound Singer
Browse files

Make safe_netrc class compatible with old versions of Python

In older versions of Python, the `netrc.netrc._parse` class took fewer
arguments. Luckily, we are not using any of the additional arguments,
so we can just pass through any `*args` and `**kwargs`.
parent 46d4dfde
......@@ -241,7 +241,7 @@ class safe_netrc(netrc):
netrc file in the default location (~/.netrc). This subclass applies the
same access safety checks regardless of the path to the netrc file."""
def _parse(self, file, fp, default_netrc):
def _parse(self, file, fp, *args, **kwargs):
# Copied and adapted from netrc.py from Python 2.7
if os.name == 'posix':
prop = os.fstat(fp.fileno())
......@@ -263,4 +263,4 @@ class safe_netrc(netrc):
"~/.netrc access too permissive: access"
" permissions must restrict access to only"
" the owner", file)
return netrc._parse(self, file, fp, default_netrc)
return netrc._parse(self, file, fp, *args, **kwargs)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment