[Patches] [ python-Patches-1028908 ] Changes to cookielib.py & friends for 2.4b1

SourceForge.net noreply at sourceforge.net
Sat Feb 5 15:42:20 CET 2005


Patches item #1028908, was opened at 2004-09-15 19:19
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1028908&group_id=5470

Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: John J Lee (jjlee)
Assigned to: Jeremy Hylton (jhylton)
Summary: Changes to cookielib.py & friends for 2.4b1

Initial Comment:
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 :-/


----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-02-05 09:42

Message:
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).

----------------------------------------------------------------------

Comment By: John J Lee (jjlee)
Date: 2005-02-05 07:54

Message:
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)!


----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-02-04 20:43

Message:
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. 

----------------------------------------------------------------------

Comment By: John J Lee (jjlee)
Date: 2004-12-23 07:35

Message:
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?


----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2004-12-22 09:41

Message:
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.


----------------------------------------------------------------------

Comment By: Titus Brown (titus)
Date: 2004-12-19 02:35

Message:
Logged In: YES 
user_id=23486

Applied patch & ran 'make test' under Linux with latest from CVS.  
Everything works.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1028908&group_id=5470


More information about the Patches mailing list