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: Changes to cookielib.py & friends for 2.4b1
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: jhylton, jjlee, loewis, rhettinger, titus
Priority: normal Keywords: patch

Created on 2004-09-16 00:19 by jjlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cookielib_etc.diff jjlee, 2004-09-16 00:19
Messages (9)
msg46899 - (view) Author: John J Lee (jjlee) Date: 2004-09-16 00:19
The patch contains uncontroversial changes to cookielib
and associated modules, documentation and tests.  Would
be unfortunate not to have these in 2.4.0.

1. Changes to keep cookielib in sync with ClientCookie
1.0 release.  This will make life simpler for people
migrating from ClientCookie (the package from whence
cookielib, and some recent urllib2 changes, came).

  a. Moved country-code pseudo-top-level domain (eg.
.co.uk) code into a separate method of
DefaultCookiePolicy to make life easier for subclassers
(.set_ok_countrycode_domain()).

  b. Added Cookie.nonstandard_attr_keys() method.

2. Added a new test.

3. Documentation corrections and clarifications
(including adding a prominent warning about current
lack of thread-safety, and a new example).

4. Small-scale refactoring in cookielib.py (including
moving magic_re to its rightful place in _LWPCookieJar.py).

5. Tiny code clarification in urllib2.py.

6. Removed coding declaration from test_cookielib.py,
in favour of escape sequences, since I discovered that
I don't understand coding declarations :-/
msg46900 - (view) Author: Titus Brown (titus) Date: 2004-12-19 07:35
Logged In: YES 
user_id=23486

Applied patch & ran 'make test' under Linux with latest from CVS.  
Everything works.
msg46901 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2004-12-22 14:41
Logged In: YES 
user_id=31392

Is it safe to add these as bug fixes for 2.4.1?  It looks
okay to me, but I wanted to be sure that wasn't some API
change that was signficant.
msg46902 - (view) Author: John J Lee (jjlee) Date: 2004-12-23 12:35
Logged In: YES 
user_id=261020

Yes, it's safe for 2.4.1.  There's one new method, but I
guess that's OK?
msg46903 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-02-05 01:43
Logged In: YES 
user_id=80475

A new method is not okay for 2.4.1.

The doc changes should be reviewed carefully.  At first
glance, some appear to be unnecessary rewordings that do not
add new new information. 
msg46904 - (view) Author: John J Lee (jjlee) Date: 2005-02-05 12:54
Logged In: YES 
user_id=261020

New method (actually, there are two, I see on re-checking --
(a) and (b) in my list above): understood.  Will submit
revised patch without them, and a separate patch for 2.5
with only the new methods.

Docs: I have verified that none of these are unnecessary
rewordings.  Some are fixes for typos or bad English.  Most
of the rest are of minor clarifications or corrections, but
are solid improvements.  Please point out specific changes
whose value you doubt, and I will explain (or remove if
persuaded, of course)!
msg46905 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-02-05 14:42
Logged In: YES 
user_id=80475

Applied the urllib2 portion as Lib/urllib2.py 1.80.

Leaving the rest for Jeremy to see if he finds sufficient
improvement to warrant API changes.

FWIW, I think the thread-safety comment should be omitted or
reworded positively (i.e. resource locks are needed when
cookielib is used in a multi-threaded environment).
msg46906 - (view) Author: John J Lee (jjlee) Date: 2005-02-06 02:19
Logged In: YES 
user_id=261020

The problem with the thread issue is that -- as I drew
attention to when the module was considered for addition to
stdlib -- there is thread synchronization in there, but it
is untested, and I now strongly suspect is broken.  I'm not
thread-competent enough to be confident in my testing of any
fix I might attempt.

I now regret not simply stripping all the thread
synchronization out from the start.  Perhaps that should be
done now, and a comment like that you suggest added?  Advice
here is most welcome!

Re the rest: As per my last comment, will resubmit API
changes (ie. method additions) as separate patch for 2.5. 
I'll split the rest up into separate patches, too. 
Therefore, I'm unassigning Jeremy and will close this patch
when I've opened the new ones.
msg46907 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-03-03 10:42
Logged In: YES 
user_id=21627

I'm closing the patch right away; please submit new ones.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40917
2004-09-16 00:19:04jjleecreate