[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

You are suggesting something like this, I suppose?

--- a/Lib/netrc.py
+++ b/Lib/netrc.py
@@ -105,8 +105,8 @@ class netrc:
 def __repr__(self):
 Dump the class data in the format of a .netrc file.
 rep = 
-for host in self.allhosts.keys():
-for attrs in self.allhosts[host]:
+for (host, attrlist) in self.allhosts.items():
+for attrs in attrlist:
 rep = rep + machine + host + \n\tlogin  + repr(attrs[0]) + 
\n
 if attrs[1]:
 rep = rep + account  + repr(attrs[1])

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Patch slightly updated after Eric's comments.

--
Added file: http://bugs.python.org/file22193/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Patch formatting changed to be more review-friendly (looks like MQ-style patch 
isn't?), otherwise same as 2011-05-30 16:14.

--
Added file: http://bugs.python.org/file22194/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Eric: yes I can look into the asserts, but note I generated and tested my patch 
from a checkout of 2.6 (see my first report), so maybe that's why I didn't see 
any warning.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Here is a patch against 2.7.

--
Added file: http://bugs.python.org/file22195/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-30 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Additional patch for docstrings and documentation. Applies on top of previous 
patch.

--
Added file: http://bugs.python.org/file22204/netrc-doc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-29 Thread Jean-Marc Saffroy

Changes by Jean-Marc Saffroy saff...@gmail.com:


Removed file: http://bugs.python.org/file21443/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-05-29 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Ping? A patch is available for review.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-03-28 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

So I finally cooked a little patch for netrc.py in python 2.6.
The patch extends netrc.authenticators() with an extra parameter to select a 
login name, but otherwise the behaviour remains the same (still returns the 
last entry for a given host).

Lightly tested, works for me.

--
keywords: +patch
Added file: http://bugs.python.org/file21443/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11416] netrc module does not handle multiple entries for a single host

2011-03-28 Thread Jean-Marc Saffroy

Jean-Marc Saffroy saff...@gmail.com added the comment:

Good that you mentioned the official tests, they let me see that netrc.hosts is 
actually part of the API, and my first patch broke it.

Here is an updated patch, with extra tests.

--
Added file: http://bugs.python.org/file21444/netrc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11416
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com