This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: misleading comment in urllib2
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.0, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, facundobatista, jhylton, jjlee, orsenthil, r.david.murray
Priority: normal Keywords:

Created on 2008-12-02 21:07 by jjlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg76783 - (view) Author: John J Lee (jjlee) Date: 2008-12-02 21:07
r54137 replaced a comment in urllib2.py with a misleading comment.  The
comment now implies the .insort() in question achieves the goal
specified in the new comment.  That's not true, which was the reason the
original comment was there in the first place.

At least replace the comment with the original comment.  Alternatively,
(correctly) resolve the question in the original comment somehow (for
example by removing the .handlers attribute -- but since .handlers is
misnamed in not having an initial underscore, it may have tempted people
to use it, even though it's undocumented, hence private).
msg76801 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-12-02 23:04
(The change was actually r54138)
It seems that this .handlers attribute was used in older versions, 
before r34922, to close the handlers in-order.
IMO it is no more useful, but may be kept for compatibility reasons.
msg124567 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-23 19:52
It is used in the tests, but I agree that it doesn't appear to be used in the code.  I've removed the misleading comment and marked the self.handlers attribute as backward-compat-only in r87448, r87449, and r87450.

The sorting is based on a 'handler_order' attribute, by the way, and presumably does control the order in which they are applied.
msg124584 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-12-24 02:46
On Thu, Dec 23, 2010 at 07:53:01PM +0000, R. David Murray wrote:

> The sorting is based on a 'handler_order' attribute, by the way, and
> presumably does control the order in which they are applied.

Yes. Exactly.
History
Date User Action Args
2022-04-11 14:56:42adminsetgithub: 48746
2010-12-24 02:46:00orsenthilsetnosy: + orsenthil
messages: + msg124584
2010-12-23 19:52:59r.david.murraysetstatus: open -> closed

nosy: + jhylton, r.david.murray
messages: + msg124567

resolution: fixed
stage: resolved
2008-12-02 23:04:00amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg76801
2008-12-02 21:10:23jjleesetnosy: + facundobatista
components: + Library (Lib)
versions: + Python 3.0, Python 2.7
2008-12-02 21:07:38jjleecreate