[ python-Bugs-1281556 ] exception when unpickling array.array objects

2005-09-04 Thread SourceForge.net
Bugs item #1281556, was opened at 2005-09-04 20:19
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=1281556&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: John Machin (sjmachin)
Assigned to: Nobody/Anonymous (nobody)
Summary: exception when unpickling array.array objects

Initial Comment:
Note 1: same error for pickle and cPickle
Note 2: pickle.dumps and cPickle.dumps produce 
different results [see below] -- is this expected?

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import pickle, cPickle, array
>>> ia = array.array('i',[3,2,1])
>>> ia
array('i', [3, 2, 1])
>>> pia = pickle.dumps(ia, -1)
>>> pia
'\x80\x02carray\narray\nq\x00)\x81q\x01.'
>>> cia = cPickle.dumps(ia, -1)
>>> pia == cia
False
>>> cia
'\x80\x02carray\narray\nq\x01)\x81q\x02.'
>>> pickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\pickle.py", line 1394, in loads
return Unpickler(file).load()
  File "C:\Python24\lib\pickle.py", line 872, in load
dispatch[key](self)
  File "C:\Python24\lib\pickle.py", line 1097, in 
load_newobj
obj = cls.__new__(cls, *args)
TypeError: array() takes at least 1 argument (0 given)
>>> pickle.loads(cia)
[same as above]
>>> cPickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: array() takes at least 1 argument (0 given)
>>> cPickle.loads(cia)
[same as above]
>>>

--

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



[ python-Bugs-1281556 ] exception when unpickling array.array objects

2005-09-04 Thread SourceForge.net
Bugs item #1281556, was opened at 2005-09-04 20:19
Message generated for change (Settings changed) made by sjmachin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1281556&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: John Machin (sjmachin)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: exception when unpickling array.array objects

Initial Comment:
Note 1: same error for pickle and cPickle
Note 2: pickle.dumps and cPickle.dumps produce 
different results [see below] -- is this expected?

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import pickle, cPickle, array
>>> ia = array.array('i',[3,2,1])
>>> ia
array('i', [3, 2, 1])
>>> pia = pickle.dumps(ia, -1)
>>> pia
'\x80\x02carray\narray\nq\x00)\x81q\x01.'
>>> cia = cPickle.dumps(ia, -1)
>>> pia == cia
False
>>> cia
'\x80\x02carray\narray\nq\x01)\x81q\x02.'
>>> pickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\pickle.py", line 1394, in loads
return Unpickler(file).load()
  File "C:\Python24\lib\pickle.py", line 872, in load
dispatch[key](self)
  File "C:\Python24\lib\pickle.py", line 1097, in 
load_newobj
obj = cls.__new__(cls, *args)
TypeError: array() takes at least 1 argument (0 given)
>>> pickle.loads(cia)
[same as above]
>>> cPickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: array() takes at least 1 argument (0 given)
>>> cPickle.loads(cia)
[same as above]
>>>

--

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



[ python-Bugs-1281383 ] array.arrays are not unpickleable

2005-09-04 Thread SourceForge.net
Bugs item #1281383, was opened at 2005-09-04 06:16
Message generated for change (Comment added) made by sjmachin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1281383&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: Extension Modules
Group: Python 2.4
Status: Closed
Resolution: Invalid
Priority: 6
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Raymond Hettinger (rhettinger)
Summary: array.arrays are not unpickleable

Initial Comment:
Credits to John Machin for discovering this.

"""
Googling for "pickle array" in comp.lang.python yields
old messages that 
show a PickleError -- plus one message where Alex
Martelli writes "I am 
but an egg" :O)
Looks like arrays are NOW (2.4.1) pickleable but not
unpickleable -- see 
below.
I appreciate that arrays are inherently not pickleable
because of the 
type code.
However:
(1) Anyone know why/when the world changed?
(2) If we had alternative constructors like
array.iarray(contents) in 
parallel to array.array('i', contents), those objects
could be 
pickled/unpickled -- yes/no?

Cheers,
John

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for
more information.
 >>> import pickle, array
 >>> class Foo(object):
...pass
...
 >>> foo = Foo()
 >>> foo.ia = array.array('i', [3,2,1])
 >>> foo.ia
array('i', [3, 2, 1])
 >>> s = pickle.dumps(foo, -1)
 >>> bar = pickle.loads(s)
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\pickle.py", line 1394, in loads
return Unpickler(file).load()
  File "C:\Python24\lib\pickle.py", line 872, in load
dispatch[key](self)
  File "C:\Python24\lib\pickle.py", line 1097, in
load_newobj
obj = cls.__new__(cls, *args)
TypeError: array() takes at least 1 argument (0 given)
===
"""

--

Comment By: John Machin (sjmachin)
Date: 2005-09-04 20:41

Message:
Logged In: YES 
user_id=480138

Please fix the bug in Python 2.4: if array objects are not
pickleable in 2.4, then pickle and cPickle should raise a
PickleError [like they used to in earlier versions] --
instead of guessing wrongly and misleading callers into
thinking that the objects can be pickled.

--

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

Message:
Logged In: YES 
user_id=80475

In Py2.4, array's became copyable, weak-referencable, and
got support for iterator arguments.  Real pickle support
wasn't added until Py2.5.  The above code fragment is a
by-product of pickle making an incorrect guess at how to
pickle arrays before real pickel support was added.  It is
not really a bug; rather, it begs for a feature that wasn't
added to later.

If it weren't a new feature, I would just backport the 2.5
pickle support. 

--

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



[ python-Bugs-1281556 ] exception when unpickling array.array objects

2005-09-04 Thread SourceForge.net
Bugs item #1281556, was opened at 2005-09-04 20:19
Message generated for change (Comment added) made by sjmachin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1281556&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: John Machin (sjmachin)
Assigned to: Raymond Hettinger (rhettinger)
Summary: exception when unpickling array.array objects

Initial Comment:
Note 1: same error for pickle and cPickle
Note 2: pickle.dumps and cPickle.dumps produce 
different results [see below] -- is this expected?

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import pickle, cPickle, array
>>> ia = array.array('i',[3,2,1])
>>> ia
array('i', [3, 2, 1])
>>> pia = pickle.dumps(ia, -1)
>>> pia
'\x80\x02carray\narray\nq\x00)\x81q\x01.'
>>> cia = cPickle.dumps(ia, -1)
>>> pia == cia
False
>>> cia
'\x80\x02carray\narray\nq\x01)\x81q\x02.'
>>> pickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\pickle.py", line 1394, in loads
return Unpickler(file).load()
  File "C:\Python24\lib\pickle.py", line 872, in load
dispatch[key](self)
  File "C:\Python24\lib\pickle.py", line 1097, in 
load_newobj
obj = cls.__new__(cls, *args)
TypeError: array() takes at least 1 argument (0 given)
>>> pickle.loads(cia)
[same as above]
>>> cPickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: array() takes at least 1 argument (0 given)
>>> cPickle.loads(cia)
[same as above]
>>>

--

>Comment By: John Machin (sjmachin)
Date: 2005-09-04 20:46

Message:
Logged In: YES 
user_id=480138

Refer bug report 1281383.

Please fix the bug in Python 2.4: if array objects are not
pickleable in 2.4, then pickle and cPickle should raise a
PickleError [like they used to in earlier versions] --
instead of guessing wrongly and misleading callers into
thinking that the objects can be pickled.

--

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



[ python-Bugs-1281556 ] exception when unpickling array.array objects

2005-09-04 Thread SourceForge.net
Bugs item #1281556, was opened at 2005-09-04 05:19
Message generated for change (Settings changed) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1281556&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: John Machin (sjmachin)
>Assigned to: Nobody/Anonymous (nobody)
Summary: exception when unpickling array.array objects

Initial Comment:
Note 1: same error for pickle and cPickle
Note 2: pickle.dumps and cPickle.dumps produce 
different results [see below] -- is this expected?

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import pickle, cPickle, array
>>> ia = array.array('i',[3,2,1])
>>> ia
array('i', [3, 2, 1])
>>> pia = pickle.dumps(ia, -1)
>>> pia
'\x80\x02carray\narray\nq\x00)\x81q\x01.'
>>> cia = cPickle.dumps(ia, -1)
>>> pia == cia
False
>>> cia
'\x80\x02carray\narray\nq\x01)\x81q\x02.'
>>> pickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\pickle.py", line 1394, in loads
return Unpickler(file).load()
  File "C:\Python24\lib\pickle.py", line 872, in load
dispatch[key](self)
  File "C:\Python24\lib\pickle.py", line 1097, in 
load_newobj
obj = cls.__new__(cls, *args)
TypeError: array() takes at least 1 argument (0 given)
>>> pickle.loads(cia)
[same as above]
>>> cPickle.loads(pia)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: array() takes at least 1 argument (0 given)
>>> cPickle.loads(cia)
[same as above]
>>>

--

Comment By: John Machin (sjmachin)
Date: 2005-09-04 05:46

Message:
Logged In: YES 
user_id=480138

Refer bug report 1281383.

Please fix the bug in Python 2.4: if array objects are not
pickleable in 2.4, then pickle and cPickle should raise a
PickleError [like they used to in earlier versions] --
instead of guessing wrongly and misleading callers into
thinking that the objects can be pickled.

--

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



[ python-Bugs-1281692 ] urllib violates rfc 959

2005-09-04 Thread SourceForge.net
Bugs item #1281692, was opened at 2005-09-04 19:30
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=1281692&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: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib violates rfc 959

Initial Comment:
[forwarded from http://bugs.debian.org/324023]

python's urllib does the following things "on the line"
when retrieving
a file by ftp:
send(3, "PASV\r\n", 6, 0)   = 6
send(3, "NLST ftp-master.debian.org\r\n", 28, 0) = 28

But RFC 959 states:
  This command [NLST] causes a directory listing to be
sent from server
  to user site.  The pathname should specify a
directory or other
  system-specific file group descriptor

So, according to the robustness principle, it is wrong
that python
aborts file transfer if the server refuses to support
NLST on files.


--

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



[ python-Bugs-999042 ] Compiler module doesn't handle global statement correctly

2005-09-04 Thread SourceForge.net
Bugs item #999042, was opened at 2004-07-27 22:15
Message generated for change (Settings changed) made by nascheme
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=999042&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: Jim Fulton (dcjim)
>Assigned to: Neil Schemenauer (nascheme)
Summary: Compiler module doesn't handle global statement correctly

Initial Comment:
If we don't use the compiler module:

>>> code = 'global x\nx=1'
>>> d1={'__builtins__': {}}; d2={}; exec code in d1, d2
>>> d1, d2
({'__builtins__': {}, 'x': 1}, {})

with the compiler module:

>>> code = compiler.compile('global x\nx=1', 'd', 'exec') 
>>> d1={'__builtins__': {}}; d2={}; exec code in d1, d2
>>> d1, d2
({'__builtins__': {}}, {'x': 1})

global is ignored

--

Comment By: Darek Suchojad (dsuch)
Date: 2005-04-29 22:04

Message:
Logged In: YES 
user_id=954779

Hi, I have submitted a simple fix some time ago
python.org/sf/1090482, do you think it is correct?

--

Comment By: Jim Fulton (dcjim)
Date: 2004-07-28 14:01

Message:
Logged In: YES 
user_id=73023

Also in 2.3

--

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



[ python-Bugs-1200686 ] SyntaxError raised on win32 for correct files

2005-09-04 Thread SourceForge.net
Bugs item #1200686, was opened at 2005-05-12 10:19
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1200686&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: Parser/Compiler
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Federico Di Gregorio (fog)
Assigned to: Nobody/Anonymous (nobody)
Summary: SyntaxError raised on win32 for correct files

Initial Comment:
Try to import the attached file (dt.py) on Windows with
Python 2.4 or 2.4.1 and you'll get a SyntaxError (the
file was written a long time ago, and worked perfectly
well on Python 2.1, 2.2 and 2.3.) The same does not
happen when importing the same module on Linux (tested
with 2.4 and 2.4.1). When the module imports fine
you'll get an ImportError (don't want to attach all
dependencies here) but the SyntaxError comes before that.

Also note that compiling the file with
compiler.compileFile("dt.py") generates a perfectly
good .pyc file that can be later imported just fine
(tested with 2.4 and 2.4.1 on Windows).


--

>Comment By: Tim Peters (tim_one)
Date: 2005-09-04 21:15

Message:
Logged In: YES 
user_id=31435

dt.py imports fine (except for the ImportError the OP 
mentioned) under current CVS HEAD and under current 2.4 
maintenance branch, on Windows XP Pro SP2, so closing 
this as fixed.

--

Comment By: Walter Dörwald (doerwalter)
Date: 2005-08-31 12:56

Message:
Logged In: YES 
user_id=89016

Copying codecs.py from current CVS (2.4 branch) over your
codecs.py (making a backup first) should be sufficient to
test this. You can this version from
http://cvs.sourceforge.net/viewcvs.py/*checkout*/python/python/dist/src/Lib/codecs.py?rev=1.35.2.9


--

Comment By: Julien Sagnard (julien_sagnard)
Date: 2005-07-20 05:37

Message:
Logged In: YES 
user_id=1181710

It's ok if I remove coding declaration.
I have no access to current cvs, but if someone send me a
zip with latest version, I can try it.

--

Comment By: Walter Dörwald (doerwalter)
Date: 2005-07-19 12:19

Message:
Logged In: YES 
user_id=89016

This bug should be fixed in the current CVS version. So, can
you retry with current CVS? As a workaround you might also
want to remove the PEP 263 coding declaration if you don't
have any special character in your file.

--

Comment By: Julien Sagnard (julien_sagnard)
Date: 2005-07-19 12:05

Message:
Logged In: YES 
user_id=1181710

I have a similar problem with an other file (log.py).
On my computer ( Windows 2000 ) this 2 files ( log.py and
dt.py ) works with python 2.4 but raise a syntax error on
python 2.4.1 :

D:\dvt\tmp\bug2_4_1>python -c "import log"
Traceback (most recent call last):
  File "", line 1, in ?
  File "D:\dvt\tmp\bug2_4_1\log.py", line 356
  w = 72
   ^
SyntaxError: invalid syntax


--

Comment By: Greg Chapman (glchapman)
Date: 2005-05-18 10:15

Message:
Logged In: YES 
user_id=86307

I'm fairly sure this is caused by the bug described here:
  
   www.python.org/sf/1175396

The module imports without syntax error on my Windows system
(with a patched codecs.py to work around the above bug).

--

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