[ python-Bugs-1473560 ] urllib2.Request constructor to urllib.quote the url given

2006-04-20 Thread SourceForge.net
Bugs item #1473560, was opened at 2006-04-20 17:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473560&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nikos Kouremenos (nkour)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2.Request constructor to urllib.quote the url given

Initial Comment:
urllib2.Request('http://www.google.com/search?client=firefox&q=foo
bar', None)


this fails. it shouldn't

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473560&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473625 ] cPickle produces locale-dependent dumps

2006-04-20 Thread SourceForge.net
Bugs item #1473625, was opened at 2006-04-20 17:25
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivan Vilata i Balaguer (ivilata)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle produces locale-dependent dumps

Initial Comment:
Dumping a float with cPickle produces a result which is
locale-dependent.  This causes problems when trying to
load the dump under a different locale (the regular
pickle module is not affected by this bug).  IMHO, the
dump should be locale-independent to ensure
portability. See the attached file for a sample session
log showing the behaviour of both pickle and cPickle
under C and ca_ES.UTF-8 locales (Catalan uses a comma
to separate the integer and decimal part).


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473625 ] cPickle produces locale-dependent dumps

2006-04-20 Thread SourceForge.net
Bugs item #1473625, was opened at 2006-04-20 17:25
Message generated for change (Comment added) made by ivilata
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivan Vilata i Balaguer (ivilata)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle produces locale-dependent dumps

Initial Comment:
Dumping a float with cPickle produces a result which is
locale-dependent.  This causes problems when trying to
load the dump under a different locale (the regular
pickle module is not affected by this bug).  IMHO, the
dump should be locale-independent to ensure
portability. See the attached file for a sample session
log showing the behaviour of both pickle and cPickle
under C and ca_ES.UTF-8 locales (Catalan uses a comma
to separate the integer and decimal part).


--

>Comment By: Ivan Vilata i Balaguer (ivilata)
Date: 2006-04-20 17:28

Message:
Logged In: YES 
user_id=1064183

As a side note, does this have anything to do with PEP 311?
 http://www.python.org/dev/peps/pep-0331/

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473760 ] TempFile can hang on Windows

2006-04-20 Thread SourceForge.net
Bugs item #1473760, was opened at 2006-04-20 14:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473760&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 7
Submitted By: Tim Peters (tim_one)
Assigned to: Nobody/Anonymous (nobody)
Summary: TempFile can hang on Windows

Initial Comment:
Attached is a simple module.  If you try to import it
("import hang"), it prints "asking for temp file", and
hangs there, never returning from its call to
tempfile.TemporaryFile().  It's in fact stuck in
ntpath.py, on the "from nt import _getfullpathname"
line in function `abspath`.

Of course hang.py spawns another thread, and is hung
waiting for the import lock.  That thread isn't doing
any imports the _user_ knows about, and Python's
standard library should be coded more defensively than
this.

The symptom was reported on zodb-dev today, where
Martin Gfeller reported ZEO hanging on Windows for what
appears to be the same reason:

http://mail.zope.org/pipermail/zodb-dev/2006-April/009989.html

As it says there, it looks like this problem was
introduced (indirectly) by patch

http://www.python.org/sf/810914

which appears to have been revision 34396 (October
2003! -- but not backported to 2.3, so nobody would
notice this before 2.4).

I haven't dug deeper than this, and don't know why
nobody noticed ZEO hanging before ;-)



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473760&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473625 ] cPickle produces locale-dependent dumps

2006-04-20 Thread SourceForge.net
Bugs item #1473625, was opened at 2006-04-20 17:25
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivan Vilata i Balaguer (ivilata)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle produces locale-dependent dumps

Initial Comment:
Dumping a float with cPickle produces a result which is
locale-dependent.  This causes problems when trying to
load the dump under a different locale (the regular
pickle module is not affected by this bug).  IMHO, the
dump should be locale-independent to ensure
portability. See the attached file for a sample session
log showing the behaviour of both pickle and cPickle
under C and ca_ES.UTF-8 locales (Catalan uses a comma
to separate the integer and decimal part).


--

>Comment By: Martin v. Löwis (loewis)
Date: 2006-04-20 23:54

Message:
Logged In: YES 
user_id=21627

Right, cPickle should use C locale floating point numbers,
using the PEP 331 API. Would you like to investigate a patch?

--

Comment By: Ivan Vilata i Balaguer (ivilata)
Date: 2006-04-20 17:28

Message:
Logged In: YES 
user_id=1064183

As a side note, does this have anything to do with PEP 311?
 http://www.python.org/dev/peps/pep-0331/

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473625&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473979 ] test test_capi crashed -- thread.error: can't allocate lock

2006-04-20 Thread SourceForge.net
Bugs item #1473979, was opened at 2006-04-21 10:27
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473979&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Threads
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: shashi (shashikala)
Assigned to: Nobody/Anonymous (nobody)
Summary: test test_capi crashed -- thread.error: can't allocate lock

Initial Comment:
Hi ,
 
 This is shashikala . I am building Python 2.4.3 0n HP-
UX 11.23 platform, the building of went smooth buit 
while testing Python using gmake test test_capi is 
failing .
  The Error is "test test_capi crashed -- 
thread.error: can't allocate lock" . Could you please 
help in fixing the above error. I am attaching the 
file which has details of the testing .

Thanks and Regards,
 shashikala




--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473979&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1471938 ] curses mvwgetnstr build problem on Solaris 8

2006-04-20 Thread SourceForge.net
Bugs item #1471938, was opened at 2006-04-17 20:07
Message generated for change (Comment added) made by eggert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471938&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Eggert (eggert)
Assigned to: Nobody/Anonymous (nobody)
Summary: curses mvwgetnstr build problem on Solaris 8

Initial Comment:
The _curses extension doesn't build on Solaris 8
(64-bit) due to the following problem:

building '_curses' extension
cc -O -xarch=v9 -xcode=pic32 -DNDEBUG -O -I.
-I/w/fac.01/cs/eggert/seasnet/Python-2.5a1/./Include
-I/u/cs/fac/eggert/seasnet/prefix/include -I./Include
-I. -I/w/fac.01/cs/eggert/seasnet/Python-2.5a1/Include
-I/w/fac.01/cs/eggert/seasnet/Python-2.5a1 -c
/w/fac.01/cs/eggert/seasnet/Python-2.5a1/Modules/_cursesmodule.c
-o build/temp.solaris-2.8-sun4u-2.5/_cursesmodule.o
"/w/fac.01/cs/eggert/seasnet/Python-2.5a1/Modules/_cursesmodule.c",
line 822: warning: implicit function declaration:
mvwgetnstr
cc -O -xarch=v9 -G
build/temp.solaris-2.8-sun4u-2.5/_cursesmodule.o
-L/u/cs/fac/eggert/seasnet/prefix/lib -lcurses
-ltermcap -o build/lib.solaris-2.8-sun4u-2.5/_curses.so
*** WARNING: renaming "_curses" since importing it
failed: ld.so.1: python: fatal: relocation error: file
build/lib.solaris-2.8-sun4u-2.5/_curses.so: symbol
mvwgetnstr: referenced symbol not found
building '_curses_panel' extension

This problem occurs with both 2.4.3 and 2.5a1.

I'll attach the obvious patch.


--

>Comment By: Paul Eggert (eggert)
Date: 2006-04-21 03:29

Message:
Logged In: YES 
user_id=17848

Sorry, I'm trying again to attach a file now.

--

Comment By: Martin v. Löwis (loewis)
Date: 2006-04-17 22:53

Message:
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471938&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473979 ] test test_capi crashed -- thread.error: can't allocate lock

2006-04-20 Thread SourceForge.net
Bugs item #1473979, was opened at 2006-04-20 23:27
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473979&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Threads
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: shashi (shashikala)
Assigned to: Nobody/Anonymous (nobody)
Summary: test test_capi crashed -- thread.error: can't allocate lock

Initial Comment:
Hi ,
 
 This is shashikala . I am building Python 2.4.3 0n HP-
UX 11.23 platform, the building of went smooth buit 
while testing Python using gmake test test_capi is 
failing .
  The Error is "test test_capi crashed -- 
thread.error: can't allocate lock" . Could you please 
help in fixing the above error. I am attaching the 
file which has details of the testing .

Thanks and Regards,
 shashikala




--

Comment By: Tim Peters (tim_one)
Date: 2006-04-20 23:50

Message:
Logged In: YES 
user_id=31435

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473979&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1473000 ] valgrind detects problems in PyObject_Free

2006-04-20 Thread SourceForge.net
Bugs item #1473000, was opened at 2006-04-19 07:12
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473000&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.4
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Jaime Torres Amate (jtajta2002)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: valgrind detects problems in PyObject_Free

Initial Comment:
I just compiled python 2.4.3 with gcc 4.1.0, using
glibc-2.4, and the COPTS = -g -O2

I just run valgrind (version 3.1.1) python -v
And I get a lot of errors complaying about PyObject_Free:

Conditional jump or move depends on uninitialised value(s)
at 0x40B66A4: PyObject_Free (obmalloc.c:735)
by 0x40B1E71: dictresize (dictobject.c:495)
by 0x40B204D: PyDict_SetItemString (dictobject.c:1988)
by 0x41048E3: Py_InitModule4 (modsupport.c:82)
by 0x4116364: initposix (posixmodule.c:7895)
by 0x40FF281: init_builtin (import.c:1765)
by 0x40FF511: load_module (import.c:1694)
by 0x40FFB3F: import_submodule (import.c:2266)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)

Invalid read of size 4
at 0x40B669F: PyObject_Free (obmalloc.c:735)
by 0x4103B7E: PyMarshal_ReadLastObjectFromFile
(marshal.c:768)
by 0x40FCE53: read_compiled_module (import.c:723)
by 0x40FED89: load_source_module (import.c:891)
by 0x40FFB3F: import_submodule (import.c:2266)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x408BB36: PyObject_Call (abstract.c:1795)
by 0x40E580A: PyEval_CallObjectWithKeywords
(ceval.c:3430)
by 0x40E87D1: PyEval_EvalFrame (ceval.c:2020)
  Address 0x4339010 is 232 bytes inside a block of size
352 free'd
at 0x4022E9D: free (vg_replace_malloc.c:235)
by 0x41FBD1B: __fopen_internal (in /lib/libc-2.4.so)
by 0x41FE569: fopen64 (in /lib/libc-2.4.so)
by 0x40FD626: find_module (import.c:1316)
by 0x40FFC64: import_submodule (import.c:2256)
by 0x40FFFEE: load_next (import.c:2086)
by 0x41001D6: PyImport_ImportModuleEx (import.c:1921)
by 0x40E23AD: builtin___import__ (bltinmodule.c:45)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x408BB36: PyObject_Call (abstract.c:1795)
by 0x40E580A: PyEval_CallObjectWithKeywords
(ceval.c:3430)
by 0x40E87D1: PyEval_EvalFrame (ceval.c:2020)
-

 Invalid read of size 4
at 0x40B669F: PyObject_Free (obmalloc.c:735)
by 0x4085A12: PyGrammar_RemoveAccelerators
(acceler.c:47)
by 0x41070DC: Py_Finalize (pythonrun.c:436)
by 0x410E2C4: Py_Main (main.c:513)
by 0x8048559: main (in /usr/bin/python)
  Address 0x4364010 is 104 bytes inside a block of size
640 free'd
at 0x4022E9D: free (vg_replace_malloc.c:235)
by 0x40B66C0: PyObject_Free (obmalloc.c:798)
by 0x4085BA1: PyGrammar_AddAccelerators (acceler.c:124)
by 0x40866A7: PyParser_New (parser.c:77)
by 0x4086722: parsetok (parsetok.c:109)
by 0x4086C9E: PyParser_ParseStringFlags (parsetok.c:31)
by 0x4105FF3: PyParser_SimpleParseStringFlags
(pythonrun.c:1365)
by 0x410644A: PyRun_StringFlags (pythonrun.c:1222)
by 0x40E1CBA: builtin_eval (bltinmodule.c:527)
by 0x40B2FCC: PyCFunction_Call (methodobject.c:108)
by 0x40EAE9B: PyEval_EvalFrame (ceval.c:3563)
by 0x40EA6AA: PyEval_EvalFrame (ceval.c:3645)


--

ERROR SUMMARY: 9678 errors from 111 contexts
(suppressed: 36 from 1)
malloc/free: in use at exit: 715,180 bytes in 251 blocks.
malloc/free: 1,822 allocs, 1,571 frees, 1,552,763 bytes
allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 251 not-freed blocks.
checked 664,740 bytes.

LEAK SUMMARY:
definitely lost: 10 bytes in 2 blocks.
  possibly lost: 0 bytes in 0 blocks.
still reachable: 715,170 bytes in 249 blocks.
 suppressed: 0 bytes in 0 blocks.


Best regards and many thanks for such an incredible
language.

--

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-04-20 20:59

Message:
Logged In: YES 
user_id=33168

Please read this file: 
http://svn.python.org/projects/python/branches/release24-maint/Misc/README.valgrind

That should explain what's going on and how to fix it.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473000&group_i

[ python-Bugs-1471806 ] IDLE does not start 2.4.3

2006-04-20 Thread SourceForge.net
Bugs item #1471806, was opened at 2006-04-17 08:58
Message generated for change (Comment added) made by josiahcarlson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471806&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Erin (egrimes)
Assigned to: Kurt B. Kaiser (kbk)
Summary: IDLE does not start 2.4.3

Initial Comment:
IDLE does not start. 2.4.3  
Installed Python 2.4.3 on Windows XP SP 2
I shutoff my ZoneAlarm Firewall and Stopped the 
Windows
Firewall, turned off all Anti-Virus services.

Python was 2.4.2 was previously installed on this 
machine and worked fine. Machine was wiped, reloaded 
and Python 2.4.3 was available.

Steps:
1. Click Start -> All Programs -> Python 2.4 -> IDLE 
(Python GUI)
2. pythonw.exe process starts for a few seconds, then 
stops
3. Nothing happens

--

Comment By: Josiah Carlson (josiahcarlson)
Date: 2006-04-20 22:53

Message:
Logged In: YES 
user_id=341410

1. Start up a command line (Start -> Run -> cmd).
2. Change to the directory in which Python is installed (the
following will likely work, if you installed Python using
the default configuration)...
c:
cd \python24
3. Run idle from the command line...
python lib\idlelib\idle.pyw

Tell us what it prints out.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471806&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1471806 ] IDLE does not start 2.4.3

2006-04-20 Thread SourceForge.net
Bugs item #1471806, was opened at 2006-04-17 11:58
Message generated for change (Comment added) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471806&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: IDLE
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Erin (egrimes)
Assigned to: Kurt B. Kaiser (kbk)
Summary: IDLE does not start 2.4.3

Initial Comment:
IDLE does not start. 2.4.3  
Installed Python 2.4.3 on Windows XP SP 2
I shutoff my ZoneAlarm Firewall and Stopped the 
Windows
Firewall, turned off all Anti-Virus services.

Python was 2.4.2 was previously installed on this 
machine and worked fine. Machine was wiped, reloaded 
and Python 2.4.3 was available.

Steps:
1. Click Start -> All Programs -> Python 2.4 -> IDLE 
(Python GUI)
2. pythonw.exe process starts for a few seconds, then 
stops
3. Nothing happens

--

>Comment By: Terry J. Reedy (tjreedy)
Date: 2006-04-21 01:59

Message:
Logged In: YES 
user_id=593130

I have opposite experience.  Winxp home sp2, upgraded 
without uninstall.  Did not turn off Win Firewall or AV.
Idle 1.1.3 starts up nice as can be.  File/Recent File 
list is still there.  Opened one with test code and it 
just reran; all tests pass as did before with, I believe, 
same test report output.

What happens when you open a Python command window?  Have 
you run test/regrtest.py or anything else?



--

Comment By: Josiah Carlson (josiahcarlson)
Date: 2006-04-21 01:53

Message:
Logged In: YES 
user_id=341410

1. Start up a command line (Start -> Run -> cmd).
2. Change to the directory in which Python is installed (the
following will likely work, if you installed Python using
the default configuration)...
c:
cd \python24
3. Run idle from the command line...
python lib\idlelib\idle.pyw

Tell us what it prints out.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1471806&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1472695 ] 32/64bit pickled Random incompatiblity

2006-04-20 Thread SourceForge.net
Bugs item #1472695, was opened at 2006-04-19 01:10
Message generated for change (Comment added) made by pm67nz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1472695&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Maxwell (pm67nz)
Assigned to: Nobody/Anonymous (nobody)
Summary: 32/64bit pickled Random incompatiblity

Initial Comment:
The unsigned long integers which make up the state of a Random 
instance are converted to Python integers via a cast to long in 
_randommodule.c's random_getstate function, so on a 32bit platform 
Random.getstate() returns a mix of postitive and negative integers, while 
on a 64bit platform the negative numbers are replaced by larger positive 
numbers, their 32bit-2s-complement equivalents.

As a result, unpicking a Random instance from a 64bit machine on a 32bit 
platform produces the error "OverflowError: long int too large to convert 
to int".  Unpickling a 32bit Random on a 64bit machine succeeds, but the 
resulting object is in a slightly confused state:

>>> r32 = cPickle.load(open('r32_3.pickle'))
>>> for i in range(3):
... print r64.random(), r32.random()
... 
0.237964627092 4292886520.32
0.544229225296 0.544229225296
0.369955166548 4292886520.19



--

>Comment By: Peter Maxwell (pm67nz)
Date: 2006-04-21 06:03

Message:
Logged In: YES 
user_id=320286

OK, here is a candidate patch, though I don't know if it is the best way to do 
it 
or meets the style guidelines etc.  It makes Random pickles interchangable 
between 32bit and 64bit machines by encoding their states as Python long 
integers.  An old pre-patch 32bit pickle loaded on a 64bit machine still fails 
(OverflowError: can't convert negative value to unsigned long) but I hope that 
combination is rare enough to ignore.  Also on a 32bit machine new Random 
pickles can't be unpickled by a pre-patch python, but again there are limits to 
sane backward compatability.


--

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-04-19 07:02

Message:
Logged In: YES 
user_id=33168

Peter, thanks for the report.  Do you think you could work
up a patch to correct this problem?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1472695&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com