I thought we were going to avoid worrying about Python 3.0
compatibility for the tools/dist/ scripts? ie. those only ever used by
the RM (who, in this case, isn't using Python 3.0)
Cheers,
-g
On Sat, Mar 28, 2009 at 16:21, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
> Author: arfrever
> Date: Sat Mar 28 08:21:55 2009
> New Revision: 36821
>
> Log:
> Python 3 compatibility:
> Try to use http.cookiejar.* instead of cookielib.*.
>
> * tools/dist/post-to-tigris.py: Try to use http.cookiejar.* instead of
> cookielib.*.
>
> Modified:
> trunk/tools/dist/post-to-tigris.py
>
> Modified: trunk/tools/dist/post-to-tigris.py
> URL: http://svn.collab.net/viewvc/svn/trunk/tools/dist/post-to-tigris.py?pathrev=36821&r1=36820&r2=36821
> ==============================================================================
> --- trunk/tools/dist/post-to-tigris.py Sat Mar 28 08:19:42 2009 (r36820)
> +++ trunk/tools/dist/post-to-tigris.py Sat Mar 28 08:21:55 2009 (r36821)
> @@ -22,7 +22,13 @@ post-to-tigris.py <username> <password>
> release - the full name of the release, such as 1.5.0-beta1
> '''
>
> -import sys, cookielib, urllib2, urllib, re, socket
> +import sys, urllib2, urllib, re, socket
> +try:
> + # Python >=3.0
> + from http.cookiejar import CookieJar as http_cookiejar_CookieJar
> +except ImportError:
> + # Python <3.0
> + from cookielib import CookieJar as http_cookiejar_CookieJar
>
> # Set the socket timeout so that we don't wait all day for tigris.org to
> # respond
> @@ -32,7 +38,7 @@ socket.setdefaulttimeout(5)
> def login(username, password, folderId):
> '''Login to tigris.org, using the provided username and password.
> Return the OpenDirector object for future use.'''
> - cj = cookielib.CookieJar()
> + cj = http_cookiejar_CookieJar()
> opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
>
> folderURL = 'http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=%d' % folderId,
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1457313
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1458540
Received on 2009-03-28 18:13:03 CET