[Patches] [ python-Patches-851736 ] urllib2 CacheFTPHandler doesn't
work on multiple dirs
SourceForge.net
noreply at sourceforge.net
Sun May 9 04:58:44 EDT 2004
Patches item #851736, was opened at 2003-12-01 08:51
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=851736&group_id=5470
Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 6
Submitted By: John J Lee (jjlee)
Assigned to: Mark Hammond (mhammond)
Summary: urllib2 CacheFTPHandler doesn't work on multiple dirs
Initial Comment:
This is a fix for bug 738973.
Where are functional tests supposed to go? Is the
__name__ == "__main__" block the official place? The
urllib2 functional tests are quite out of date, thanks to
shifting URLs, so I'd like to fix them, but need to know
where to do it.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2004-05-09 18:58
Message:
Logged In: YES
user_id=14198
Actually, wouldn't it be better to store 'dirs' directly in
the dict?
ie, instead of:
+ key = user, host, port, '/'.join(dirs)
just do:
+ key = user, host, port, dirs
Then the only assumption we make is that it is hashable.
----------------------------------------------------------------------
Comment By: Thomas Heller (theller)
Date: 2004-05-06 04:09
Message:
Logged In: YES
user_id=11105
The problem with test code in the __main__ block is that
py2exe, for example, concludes that the unittest module is
needed.
If that is done, imo it would be better to write the main
block in this way, so that at least this is compiled away
with -O or -OO:
if __name__ == '__main__':
if __debug__:
import unittest
# test code...
----------------------------------------------------------------------
Comment By: John J Lee (jjlee)
Date: 2004-05-06 03:43
Message:
Logged In: YES
user_id=261020
Thanks Mark
FWIW, the idea of having the test in __main__ is that it's a
functional test, not a unit test. But when I raised this issue on
python-dev (thread ends at message whose URL is below), I
left more confused than when I arrived, so feel free to put them
where you like ;-)
http://mail.python.org/pipermail/python-dev/2003-December/040861.html
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2004-05-05 22:23
Message:
Logged In: YES
user_id=14198
The password is being dropped from the cache - I can't see
how this could possibly hurt though. This all looks
reasonable to me, and fails (then works) as described. I
will check this in in a couple of days to make sure noone
objects. I won't check the test code in though - ideally,
it should go in the main test directory, but only if the
'network' resource is enabled - but I don't see that as a
blocking issue.
----------------------------------------------------------------------
Comment By: John J Lee (jjlee)
Date: 2004-05-05 08:13
Message:
Logged In: YES
user_id=261020
For now at least, should probably just stick the test in the
if __name__ == "__main__" block of urllib2 without its
unittest wrapper.
----------------------------------------------------------------------
Comment By: John J Lee (jjlee)
Date: 2003-12-01 08:53
Message:
Logged In: YES
user_id=261020
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=851736&group_id=5470
More information about the Patches
mailing list