[issue13547] Clean Lib/_sysconfigdata.py and Modules/_testembed

2011-12-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I guess this still needs to be fixed for Visual Studio.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13547
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13560] Add PyUnicode_DecodeLocale and PyUnicode_DecodeLocaleAndSize

2011-12-09 Thread Stefan Krah

Changes by Stefan Krah stefan-use...@bytereef.org:


--
nosy: +skrah

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13560
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 2a2d0872d993 by Victor Stinner in branch 'default':
Issue #13441: Skip some locales (e.g. cs_CZ and hu_HU) on Solaris to workaround
http://hg.python.org/cpython/rev/2a2d0872d993

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12428] functools test coverage

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Brian's patch looks ok to me. There's a missing newline (or two) just before 
test_main() but that can easily be fixed on commit.

--
nosy: +pitrou
stage:  - commit review
versions: +Python 3.3 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12428
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13550] Rewrite logging hack of the threading module

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Tim, do you happen to know what the goal was with the threading._VERBOSE hack 
and the undocumented _Verbose class?

--
nosy: +pitrou, tim_one

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13550
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13563] Make use of with statement in ftplib

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The first hunk of the patch doesn't look right: ntransfercmd() is supposed to 
return the connection but the with statement closes it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13563
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 7ffe3d304487 by Victor Stinner in branch 'default':
Issue #13441: Enable the workaround for Solaris locale bug
http://hg.python.org/cpython/rev/7ffe3d304487

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I collected the locale list triggering the mbstowcs() bug thanks my previous 
commit:

 * hu_HU (ISO8859-2): character U+3020
 * de_AT (ISO8859-1): character U+3076
 * cs_CZ (ISO8859-2): character U+3020
 * sk_SK (ISO8859-2): character U+3020
 * pl_PL (ISO8859-2): character U+3020
 * fr_CA (ISO8859-1): character U+3020

Hum, the bug occurs maybe on all locales... I suppose that all xx_XX locales 
use an encoding different than UTF-8 and that the bug is specific to encodings 
different than UTF-8.

I don't understand why locale.strxfrm('à') doesn't crash anymore.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread Serg Asminog

Serg Asminog akudov...@gmail.com added the comment:

dirname = 'A-Za-z\xc4\xd6\xdc\xe4\xf6\xfc\xdf'

Traceback (most recent call last):
  File D:\temp\python bug\test.py, line 19, in module
file_object, file_path, description = imp.find_module(basename, [dirname])
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: 
invalid character

--
nosy: +Serg.Asminog
Added file: http://bugs.python.org/file23891/test.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

@Serg Asminog: What is your Python version? What is your locale encoding 
(print(sys.getfilesystemencoding())? What is your Windows version?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13565] test_multiprocessing.test_notify_all() hangs on AMD64 Snow Leopard 02 03.x

2011-12-09 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

[333/363] test_multiprocessing
Timeout (1:00:00)!
Thread 0x000112d0b000:
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 411 in _recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 432 in _recv_bytes
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 275 in recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 758 in _callmethod
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 994 in wait
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_multiprocessing.py,
 line 734 in f
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
682 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
729 in _bootstrap_inner
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
702 in _bootstrap

Thread 0x000112908000:
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 411 in _recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 432 in _recv_bytes
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 275 in recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 758 in _callmethod
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 994 in wait
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_multiprocessing.py,
 line 734 in f
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
682 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
729 in _bootstrap_inner
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/threading.py, line 
702 in _bootstrap

Thread 0x7fff7022ccc0:
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 411 in _recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 432 in _recv_bytes
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/connection.py,
 line 275 in recv
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 758 in _callmethod
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/multiprocessing/managers.py,
 line 982 in acquire
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_multiprocessing.py,
 line 833 in test_notify_all
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/case.py, 
line 385 in _executeTestPart
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/case.py, 
line 440 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/case.py, 
line 492 in __call__
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 105 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 67 in __call__
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 105 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 67 in __call__
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 105 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/suite.py, 
line 67 in __call__
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/unittest/runner.py,
 line 168 in run
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/support.py, 
line 1368 in _run_suite
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/support.py, 
line 1402 in run_unittest
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/test_multiprocessing.py,
 line 2392 in test_main
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/regrtest.py, 
line 1221 in runtest_inner
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/regrtest.py, 
line 907 in runtest
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/regrtest.py, 
line 710 in main
  File 
/Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/test/__main__.py, 
line 13 in module
  File /Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/runpy.py, 
line 73 in _run_code
  File /Users/buildbot/buildarea/3.x.parc-snowleopard-1/build/Lib/runpy.py, 
line 160 in _run_module_as_main
make: *** 

[issue11894] test_multiprocessing failure on AMD64 OpenIndiana 3.x: KeyError on id_to_obj[ident] in serve_client()

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I didn't see this failure again since the issue was opened, so I close it as 
invalid.

--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11894
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The Solaris buildbot is green, let's close it. I didn't report the bug 
upstream. Feel free to report it to Oracle!

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13441
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13566] Array objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread sbt

New submission from sbt shibt...@gmail.com:

If you pickle an array object on python 3 the typecode is encoded as a unicode 
string rather than as a byte string.  This makes python 2 reject the pickle.

#

Python 3.3.0a0 (default, Dec  8 2011, 17:56:13) [MSC v.1500 32 bit (Intel)] on 
win32
Type help, copyright, credits or license for more information.
 import pickle, array
 pickle.dumps(array.array('i', [1,2,3]), 2)
b'\x80\x02carray\narray\nq\x00X\x01\x00\x00\x00iq\x01]q\x02(K\x01K\x02K\x03e\x86q\x03Rq\x04.'

#

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on 
win32
Type help, copyright, credits or license for more information.
 import pickle
 pickle.loads(b'\x80\x02carray\narray\nq\x00X\x01\x00\x00\x00iq\x01]q\x02(K\x01K\x02K\x03e\x86q\x03Rq\x04.')
Traceback (most recent call last):
  File stdin, line 1, in module
  File c:\Python27\lib\pickle.py, line 1382, in loads
return Unpickler(file).load()
  File c:\Python27\lib\pickle.py, line 858, in load
dispatch[key](self)
  File c:\Python27\lib\pickle.py, line 1133, in load_reduce
value = func(*args)
TypeError: must be char, not unicode

--
components: Library (Lib)
messages: 149092
nosy: sbt
priority: normal
severity: normal
status: open
title: Array objects pickled in 3.x with protocol =2 are unpickled incorrectly 
in 2.x
type: behavior
versions: Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13566] Array objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +alexandre.vassalotti, pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13505] Bytes objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread sbt

sbt shibt...@gmail.com added the comment:

 sbt, the bug is not that the encoding is inefficient. The problem is we 
 cannot unpickle bytes streams from Python 3 using Python 2.

Ah.  Well you can do it using codecs.encode.

Python 3.3.0a0 (default, Dec  8 2011, 17:56:13) [MSC v.1500 32 bit (Intel)] on 
win32
Type help, copyright, credits or license for more information.
 import pickle, codecs

 class MyBytes(bytes):
... def __reduce__(self):
... return codecs.encode, (self.decode('latin1'), 'latin1')
...
 pickle.dumps(MyBytes(bhello), 2)
b'\x80\x02c_codecs\nencode\nq\x00X\x05\x00\x00\x00helloq\x01X\x06\x00\x00\x00latin1q\x02\x86q\x03Rq\x04.'

Actually, I notice that array objects created by Python 3 are not decodable on 
Python 2.  See Issue 13566.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13505
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2775] Implement PEP 3108

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Brett, issue 2919 had a patch that merges profile/cProfile for a while 
 now but nobody test it yet.

 All I need it someone to download the patch, install it, test it on
 some random script and tell me if it works. I don't need more.

I don't see any patch there, only a .tgz and two Python files.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2775
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13549] Incorrect nested list comprehension documentation

2011-12-09 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

In the first patch I included this example:
+swapped = []
+for i in [0, 1, 2]:
+   ... swapped.append([row[i] for row in mat])
+   ...
+print swapped
+   [[1, 4, 7], [2, 5, 8], [3, 6, 9]]

Because I applied the following transformation without looking at what expr was 
(another listcomp in this case):
res = [expr for elem in seq]
==
   res = []
   for elem in seq:
   res.append(expr)

If the reader does the same he/she wouldn't have any problem figuring out what 
is the order of the `for`s, but the second version of the patch only includes a 
fully expanded example:
+transposed = []
+for i in range(4):
+   ... # the following 3 lines implement the nested listcomp
+   ... transposed_row = []
+   ... for row in matrix:
+   ... transposed_row.append(row[i])
+   ... transposed.append(transposed_row)
+   ...
+transposed

Here it's easier to confuse the two `for` (not because they are similar, but 
because there are two of them, whereas in the previous example there's only 
one).

I added a comment to clarify that the inner loop is the listcomp, but maybe it 
would be better to show the first example too, followed by the fully expanded 
one, i.e.:

+   [[row[i] for row in mat] for i in range(4)]

+transposed = []
+for i in range(4):
+   ... transposed.append([row[i] for row in mat])
+   ...
+transposed

+transposed = []
+for i in range(4):
+   ... # the following 3 lines implement the nested listcomp
+   ... transposed_row = []
+   ... for row in matrix:
+   ... transposed_row.append(row[i])
+   ... transposed.append(transposed_row)
+   ...
+transposed

The step in the middle shows that in order to get to the fully expanded form, 
it's enough to apply the usual listcomp-for+append transformation twice, 
without worrying about left-to-right vs right-to-left.  Do you think it's worth 
adding this?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13549
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13557] exec of list comprehension fails on NameError

2011-12-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This is expected and documented: 
http://docs.python.org/py3k/reference/executionmodel.html#interaction-with-dynamic-features
Free variables are not resolved in the nearest enclosing namespace, but in the 
global namespace., a free variable being a variable used in a code block but 
not defined there.
And yes, a list comprehension defines a code block.

Try using exec(code, locals()). It's a good habit anyway to always pass a 
namespace to exec().

--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread Serg Asminog

Serg Asminog akudov...@gmail.com added the comment:

print(sys.getfilesystemencoding())
print(os.name)
print(sys.version)
print(sys.version_info)
print(sys.platform)

-
mbcs
nt
3.2.2 (default, Sep  4 2011, 09:07:29) [MSC v.1500 64 bit (AMD64)]
sys.version_info(major=3, minor=2, micro=2, releaselevel='final', serial=0)
win32

---
Windows 7 64bit

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread Serg Asminog

Serg Asminog akudov...@gmail.com added the comment:

Also 

Traceback (most recent call last):
  File D:\temp\python bug\test.py, line 20, in module
file_object, file_path, description = imp.find_module(basename, [dirname])
ImportError: No module named mymodule

with python  2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit 
(AMD64)]

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oops, it's not sys.getfilesystemencoding(), but locale.getpreferredencoding() 
which is interesting. Can you give me your locale encoding?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13557] exec of list comprehension fails on NameError

2011-12-09 Thread Stephan R.A. Deibel

Stephan R.A. Deibel sdei...@wingware.com added the comment:

Ah, thanks, there it is... I thought this must be dealt with somewhere but 
couldn't find it.  Maybe should add something to the 'exec' statement docs 
http://docs.python.org/py3k/library/functions.html#exec to reference this (from 
a usability-of-docs standpoint).

BTW, my code already sends the namespaces to exec (from current stack frame; 
it's part of a debugger) and probably would break other cases to alter this.

Well, anyway, sorry for the invalid bug report...

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13566] Array objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread maniram maniram

maniram maniram maniandra...@gmail.com added the comment:

The problem is that pickle is calling array.array(u'i',[1,2,3]) and array.array 
in Python 2 doesn't allow unicode strings as a typecode (typecode is the first 
argument)

The docs in Python 2 and Py3k doesn't specify the type of the typecode argument 
of array.array.
In Python 2 it seems that typecode has to be a bytes string.
In Python 3 it seems that typecode has to be a unicode string.

I suggest that array.array be changed in Python 2 to allow unicode strings as a 
typecode or that pickle detects array.array being called and fixes the call.

--
nosy: +maniram.maniram

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1757072] Zipfile robustness

2011-12-09 Thread James C. Ahlstrom

James C. Ahlstrom jahl...@gmail.com added the comment:

Problem was reported on 2.7.  I will check in detail this weekend.  Please 
stand by.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1757072
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4352] imp.find_module() fails with a UnicodeDecodeError when called with non-ASCII search paths

2011-12-09 Thread Serg Asminog

Serg Asminog akudov...@gmail.com added the comment:

cp1251

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4352
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13566] Array objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread sbt

sbt shibt...@gmail.com added the comment:

 I suggest that array.array be changed in Python 2 to allow unicode strings 
 as a typecode or that pickle detects array.array being called and fixes 
 the call.

Interestingly, py3 does understand arrays pickled by py2.  This appears to be 
because py2 pickles str using BINSTRING or SHORT_BINSTRING which will unpickle 
as str on py2 and py3.  py3 pickles str using BINUNICODE which will unpickle as 
unicode on py2 and str on py3.

I think it would be better to fix this in py3 if possible, but that does not 
look easy: modifying array.__reduce_ex__ alone would not be enough.

The only thing I can think of is for py3 to grow a _binstr type which only 
supports ascii strings and is special-cased by pickle to be pickled using 
BINSTRING.  Then array.__reduce_ex__ could be something like:

  def __reduce_ex__(self, protocol):
if protocol = 2:
  return array.array, (_binstr(self.typecode), list(self))
else:
  ...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13566
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12428] functools test coverage

2011-12-09 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Ezio and I made further minor comments that can be handled by the person doing 
the commit; I’d like to do it.

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12428
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13567] HTTPError interface changes / breaks depending on what was passed to constructor

2011-12-09 Thread Pami Ketolainen

New submission from Pami Ketolainen pami.ketolai...@gmail.com:

In case of authentication error, HTTPError gets initialized without file object 
and constructor of addinfourl is not called. This means that url attribute is 
not set and geturl() (inherited from addinfourl) raises AttributeError.

geturl() is not documented as part of HTTPError interface, so I'm not sure if 
it is correct to expect it to work. And of course this can be worked around by 
using the HTTPError.filename which always contains the url passed to 
constructor.

How ever, I have made a simple patch to fix the missing attribute.


There is also Issue5286 with a patch, which makes the http_error_auth_reqed 
pass the fp to HTTPError making it a file-like object as stated in the 
documentation. So that would probably be the correct solution.

IMHO it's a bit bad design, when objects interface changes depending on how it 
was initialized.

--
components: Library (Lib)
files: httperror-geturl-fix-2.patch
keywords: patch
messages: 149106
nosy: Keto
priority: normal
severity: normal
status: open
title: HTTPError interface changes / breaks depending on what was passed to 
constructor
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file23892/httperror-geturl-fix-2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13567
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13567] HTTPError interface changes / breaks depending on what was passed to constructor

2011-12-09 Thread Pami Ketolainen

Pami Ketolainen pami.ketolai...@gmail.com added the comment:

Patch adapted to 3.3

--
Added file: http://bugs.python.org/file23893/httperror-geturl-fix-3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13567
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3786] _curses, _curses_panel _multiprocessing can't be build in 2.6b3 w/ SunStudio 12

2011-12-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3786
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13547] Clean Lib/_sysconfigdata.py and Modules/_testembed

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

None of these two files is generated under Windows (_sysconfigdata.py by design 
and _testembed because nobody volunteered to do it).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13547
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1757072] Zipfile robustness

2011-12-09 Thread James C. Ahlstrom

James C. Ahlstrom jahl...@gmail.com added the comment:

I grabbed a 2.7.2 zipfile.py, and my original comments stand.  If there is a 
garbage at end of file patch, I can't find it; please provide a line number 
or a hint.  The user at yale.edu reports that the patch works.  Here is a diff 
of my changes.  To test, append some junk to a good zipfile: echo junk  
good.zip, and try reading it.  Let me know if you want me to do anything else; 
maybe look at 3.2; or email me offline.

*** zipfile.py  2011-12-09 11:25:07.0 -0500
--- ../zipfile.py   2011-12-09 05:48:00.0 -0500
***
*** 237,248 
  recData = data[start:start+sizeEndCentDir]
  endrec = list(struct.unpack(structEndArchive, recData))
  comment = data[start+sizeEndCentDir:]
! ## Remove   # check that comment length is correct
! ## Remove   if endrec[_ECD_COMMENT_SIZE] == len(comment):
! # check that the offset to the Central Directory points to a valid 
item
! fpin.seek(endrec[_ECD_OFFSET], 0)
! dat = fpin.read(4)
! if dat == stringCentralDir:
  # Append the archive comment and start offset
  endrec.append(comment)
  endrec.append(maxCommentStart + start)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1757072
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12567] curses implementation of Unicode is wrong in Python 3

2011-12-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Victor, I have these notes I wrote down when I set up the OpenIndiana 
buildbots. Maybe can be useful to you: (compiling from source)


  * ncurses 5.7: Instalación estándar ./configure --with-shared 
--without-normal --enable-widec --without-cxx-binding. Al curses que viene con 
OpenIndiana le faltan un par de funciones: mvwchgat y wchgat.



I installed ncurses because the lack of mvwchgat and wchgat.

When compiling Python, I add export CFLAGS=-I/usr/local/include/ncursesw to 
help it to find the right lib.

Hope to be useful.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12567
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12567] curses implementation of Unicode is wrong in Python 3

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 I wrote down when I set up the OpenIndiana buildbots

Hum, please use the issue #13552 for curses issues on OpenIndiana/Solaris.

 ... de funciones: mvwchgat y wchgat

See issues #3786 and  #13552 for this problem.

 I installed ncurses ... I add export CFLAGS=-I/usr/local/include/ncursesw

The curses module is compiled by setup.py, not Makefile. It looks that setup.py 
ignores CFLAGS. I don't know if setup.py permits to specify such option.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12567
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13547] Clean Lib/_sysconfigdata.py and Modules/_testembed

2011-12-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Excellent, closing then.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13547
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13568] sqlite3 convert_date error with DATE type

2011-12-09 Thread Gianluigi Tiesi

New submission from Gianluigi Tiesi sher...@gmail.com:

When using the 'DATE' datatype in a sqlite3 db and type converters are enabled 
the function in sqlite3/dbapi2.py fails

I'm not sure why sqlite3 returns something like 10-JAN-11, but the function 
expects a ts

example:

import sqlite3
d = sqlite3.connect(:memory:, detect_types=sqlite3.PARSE_DECLTYPES)
c = d.cursor()
c.execute(create table testdate (t1 date))
c.execute(insert into testdate values ('now'))
c.execute(select * from testdate)

--
components: Library (Lib)
messages: 149113
nosy: sherpya
priority: normal
severity: normal
status: open
title: sqlite3 convert_date error with DATE type
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13568
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13505] Bytes objects pickled in 3.x with protocol =2 are unpickled incorrectly in 2.x

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

  sbt, the bug is not that the encoding is inefficient. The problem is we 
  cannot unpickle bytes streams from Python 3 using Python 2.
 
 Ah.  Well you can do it using codecs.encode.

Great. A bit hackish but functional and not too inefficient (50% average
expansion).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13505
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5905] strptime fails in non-UTF locale

2011-12-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 8620e6901e58 by Victor Stinner in branch '3.2':
Issue #5905: time.strftime() is now using the locale encoding, instead of
http://hg.python.org/cpython/rev/8620e6901e58

New changeset bee7694988a4 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #5905: time.strftime() is now using the locale encoding,
http://hg.python.org/cpython/rev/bee7694988a4

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5905
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5905] strptime fails in non-UTF locale

2011-12-09 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5905
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13560] Add PyUnicode_DecodeLocale and PyUnicode_DecodeLocaleAndSize

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I fixed issue #5905 (strptime fails in non-UTF locale). The fix is not enough 
if the locale is changed in Python.

Update the patch to fix time.strftime() (if wcsftime() is not available).

--
Added file: http://bugs.python.org/file23894/pyunicode_decodelocale-2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13560
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6699] IDLE: Warn user about overwriting a file that has a newer version on filesystem

2011-12-09 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

The patch won't apply against 3.3a0 because self.set_saved(1) became 
self.set_saved(True) in r70054 (da7a120c0478)

After correcting this minor point, the patch works as expected.

--
nosy: +serwy
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6699
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2919] Merge profile/cProfile in 3.0

2011-12-09 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2919
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Nikita Pchelin

New submission from Nikita Pchelin nikita.pche...@gmail.com:

I've wrote a little application that uses multiprocessing module:
https://github.com/jango/PC/blob/master/pc/pc-example.py

When I run it in my Linux setup, I get the expected output (Python 2.7.1+):
2011-12-09 14:16:29,014 Started Producer 0.
2011-12-09 14:16:29,076 Started Producer 1.
2011-12-09 14:16:29,076 Producer process (0) exited...
2011-12-09 14:16:29,131 Started Producer 2.
2011-12-09 14:16:29,188 Started Producer 3.
2011-12-09 14:16:29,218 Started Producer 4.
2011-12-09 14:16:29,281 Started Producer 5.
2011-12-09 14:16:29,327 Started Producer 6.
2011-12-09 14:16:29,377 Started Producer 7.
2011-12-09 14:16:29,403 Producer process (1) exited...
2011-12-09 14:16:29,412 Started Producer 8.
2011-12-09 14:16:29,504 Started Producer 9.
2011-12-09 14:16:29,528 Producer process (4) exited...
2011-12-09 14:16:29,570 Started Producer 10.
2011-12-09 14:16:29,615 Started Producer 11.
2011-12-09 14:16:29,622 Producer process (3) exited...
2011-12-09 14:16:29,637 Producer process (7) exited...
2011-12-09 14:16:29,653 Producer process (5) exited...
2011-12-09 14:16:29,692 Started Producer 12.
2011-12-09 14:16:29,731 Producer process (12) exited...
2011-12-09 14:16:29,747 Started Producer 13.
2011-12-09 14:16:29,809 Started Producer 14.
2011-12-09 14:16:29,860 Started Producer 15.
2011-12-09 14:16:29,903 Producer process (2) exited...
2011-12-09 14:16:29,905 Started Producer 16.
2011-12-09 14:16:29,918 Producer process (8) exited...
2011-12-09 14:16:29,970 Started Producer 17.
2011-12-09 14:16:30,001 Started Producer 18.
2011-12-09 14:16:30,070 Started Producer 19.
2011-12-09 14:16:30,090 Producer process (11) exited...
2011-12-09 14:16:30,105 Producer process (10) exited...
2011-12-09 14:16:30,137 Started Producer 20.
2011-12-09 14:16:30,152 Producer process (6) exited...
2011-12-09 14:16:30,183 Producer process (9) exited...
2011-12-09 14:16:30,183 Producer process (17) exited...
2011-12-09 14:16:30,251 Started Producer 21.
2011-12-09 14:16:30,288 Started Producer 22.
2011-12-09 14:16:30,308 Producer process (18) exited...
2011-12-09 14:16:30,308 Producer process (20) exited...
2011-12-09 14:16:30,355 Producer process (16) exited...
2011-12-09 14:16:30,380 Started Producer 23.
2011-12-09 14:16:30,436 Started Producer 24.
2011-12-09 14:16:30,472 Started Producer 25.
2011-12-09 14:16:30,480 Producer process (22) exited...
2011-12-09 14:16:30,509 Started Producer 26.
2011-12-09 14:16:30,554 Started Producer 27.
2011-12-09 14:16:30,609 Started Producer 28.
2011-12-09 14:16:30,620 Producer process (14) exited...
2011-12-09 14:16:30,636 Producer process (15) exited...
2011-12-09 14:16:30,660 Started Producer 29.
2011-12-09 14:16:30,667 Producer process (19) exited...
2011-12-09 14:16:30,667 Producer process (13) exited...
2011-12-09 14:16:30,667 Producer process (27) exited...
2011-12-09 14:16:30,750 Started Consumer 0.
2011-12-09 14:16:30,761 -- 0 produces 0.
2011-12-09 14:16:30,776 Producer process (28) exited...
2011-12-09 14:16:30,770 -- 1 produces 10.
2011-12-09 14:16:30,783 -- 4 produces 40.
2011-12-09 14:16:30,797 Started Consumer 1.
2011-12-09 14:16:30,807 -- 3 produces 30.
2011-12-09 14:16:30,816 -- 5 produces 50.
2011-12-09 14:16:30,817 -- 12 produces 120.
2011-12-09 14:16:30,819 -- 2 produces 20.
2011-12-09 14:16:30,826 -- 8 produces 80.
2011-12-09 14:16:30,835 -- 11 produces 110.
2011-12-09 14:16:30,848 -- 10 produces 100.
2011-12-09 14:16:30,849 -- 6 produces 60.
2011-12-09 14:16:30,852 -- 17 produces 170.
2011-12-09 14:16:30,853 -- 9 produces 90.
2011-12-09 14:16:30,859 -- 18 produces 180.
2011-12-09 14:16:30,860 -- 20 produces 200.
2011-12-09 14:16:30,865 -- 16 produces 160.
2011-12-09 14:16:30,866 -- 22 produces 220.
2011-12-09 14:16:30,867 -- 14 produces 140.
2011-12-09 14:16:30,868 -- 15 produces 150.
2011-12-09 14:16:30,869 -- 19 produces 190.
2011-12-09 14:16:30,874 -- 13 produces 130.
2011-12-09 14:16:30,823 Producer process (21) exited...
2011-12-09 14:16:30,812 -- 7 produces 70.
2011-12-09 14:16:30,893 -- 28 produces 280.
2011-12-09 14:16:30,854 Producer process (25) exited...
2011-12-09 14:16:30,894 Started Consumer 2.
2011-12-09 14:16:30,875 -- 27 produces 270.
2011-12-09 14:16:30,905 -- 25 produces 250.
2011-12-09 14:16:30,917 -- 21 produces 210.
2011-12-09 14:16:30,943 Started Consumer 3.
2011-12-09 14:16:31,002 Started Consumer 4.
2011-12-09 14:16:31,049 Started Consumer 5.
2011-12-09 14:16:31,091 Started Consumer 6.
2011-12-09 14:16:31,137 Started Consumer 7.
2011-12-09 14:16:31,197 Producer process (23) exited...
2011-12-09 14:16:31,213 -- 23 produces 230.
2011-12-09 14:16:31,206 Started Consumer 8.
2011-12-09 14:16:31,263 Started Consumer 9.
2011-12-09 14:16:31,275 Producer process (24) exited...
2011-12-09 14:16:31,307 Started Consumer 10.
2011-12-09 14:16:31,322 -- 24 produces 240.
2011-12-09 14:16:31,357 Started Consumer 11.
2011-12-09 14:16:31,386 Started Consumer 12.
2011-12-09 14:16:31,400 Producer process (26) 

[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Yes, Windows needs to pickle objects which are sent to (or returned from) a 
child process. Now you should wonder why you are sending a threading lock to 
the child. Are you sure this is deliberate?

--
nosy: +pitrou
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11886] test_time.test_tzset() fails on x86 FreeBSD 7.2 3.x: AEST timezone called EST

2011-12-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The FreeBSD 7.2 3.x buildbot is green.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11886
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Nikita Pchelin

Nikita Pchelin nikita.pche...@gmail.com added the comment:

I am not sending locks explicetly (i.e. I am not using locks), but I do
pass a Queue object from PC instance to _Consumer and _Producer instances
that get/put values from/to the queue -- this is done deliberately.

2011/12/9 Antoine Pitrou rep...@bugs.python.org


 Antoine Pitrou pit...@free.fr added the comment:

 Yes, Windows needs to pickle objects which are sent to (or returned from)
 a child process. Now you should wonder why you are sending a threading lock
 to the child. Are you sure this is deliberate?

 --
 nosy: +pitrou
 versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue13569
 ___


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I am not sending locks explicetly (i.e. I am not using locks), but I do
 pass a Queue object from PC instance to _Consumer and _Producer instances
 that get/put values from/to the queue -- this is done deliberately.

Is it a Queue.Queue or a multiprocessing.Queue?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Nikita Pchelin

Nikita Pchelin nikita.pche...@gmail.com added the comment:

It's multiprocessing Queue:

from multiprocessing import Process, Queue, Event

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13570] Expose faster unicode-ascii functions in the C-API

2011-12-09 Thread Stefan Krah

New submission from Stefan Krah stefan-use...@bytereef.org:

I just ran the telco benchmark ...

  http://www.bytereef.org/mpdecimal/quickstart.html#telco-benchmark

... on _decimal to see how the PEP-393 changes affect the module.
The benchmark reads numbers from a binary file, does some calculations
and prints the result strings to a file.


Average results (10 iterations each):

Python 2.7:5.87s
Revision 1726fa560112: 6.07s
Revision 7ffe3d304487: 6.56s


The bottleneck in telco.py is the line that writes a Decimal to the
output file:

  outfil.write(%s\n % t)

The bottleneck in _decimal is (res is ascii):

   PyUnicode_FromString(res);

PyUnicode_DecodeASCII(res) has the same performance.


With this function ...

  static PyObject*
unicode_fromascii(const char* s, Py_ssize_t size)
{
PyObject *res;
res = PyUnicode_New(size, 127);
if (!res)
return NULL;
memcpy(PyUnicode_1BYTE_DATA(res), s, size);
return res;
}

... I get the same performance as with Python 2.7 (5.85s)!


I think it would be really beneficial for C-API users to have
more ascii low level functions that don't do error checking and
are simply as fast as possible.

--
components: Unicode
messages: 149124
nosy: ezio.melotti, haypo, loewis, skrah
priority: normal
severity: normal
status: open
title: Expose faster unicode-ascii functions in the C-API
type: performance
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13570
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10364] IDLE: make .py default added extension on save

2011-12-09 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

This is a duplicate of #4832.

--
nosy: +serwy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10364
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11886] test_time.test_tzset() fails on x86 FreeBSD 7.2 3.x: AEST timezone called EST

2011-12-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

thank you for this fix.
I agree a posteriori.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11886
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I don't think it's the queue. Try removing the logger instead (or creating it 
in the child).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2979] use_builtin_types in xmlrpc.server

2011-12-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b3c1a504ebc1 by Florent Xicluna in branch 'default':
Closes #2979: add parameter 'use_builtin_types' to the SimpleXMLRPCServer.
http://hg.python.org/cpython/rev/b3c1a504ebc1

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2979
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13543] shlex with string ending in space gives ValueError: No closing quotation

2011-12-09 Thread ekorn

ekorn jono...@gmail.com added the comment:

https://github.com/ipython/ipython/issues/1109#issuecomment-3072571
It seems this was an IPython bug due to slight abuse of the shlex module. 
Closing as invalid; thanks for your help.

--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13543
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13502] Documentation for Event.wait return value is either wrong or incomplete

2011-12-09 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

set to True, either before the wait call or after the wait starts

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13502
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13543] shlex with string ending in space gives ValueError: No closing quotation

2011-12-09 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

And just for your information, as far as I know *no one* knows what standard 
(or model) non-posix mode shlex is based on.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13543
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1757072] Zipfile robustness

2011-12-09 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Here's the patch:

http://hg.python.org/cpython/rev/cc3255a707c7/

I thought I remembered getting it in to 2.7.2, but my memory is evidently 
wrong.  It has been applied, but is not yet in the released version of 2.7.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1757072
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Updated with documentation.
Thank you for the review.

I know this does not cover different namespaces in subtree.
But this use case seems very specific. The user could find other means to 
achieve it.

--
stage: patch review - commit review
Added file: 
http://bugs.python.org/file23895/issue13378_non_global_namespaces_v3.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13378
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13528] Rework performance FAQ

2011-12-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset eb30f2becb79 by Antoine Pitrou in branch '3.2':
Issue #13528: rework the performance question in the programming FAQ
http://hg.python.org/cpython/rev/eb30f2becb79

New changeset 9fe28f52eaaa by Antoine Pitrou in branch 'default':
Issue #13528: rework the performance question in the programming FAQ
http://hg.python.org/cpython/rev/9fe28f52eaaa

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13528
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13528] Rework performance FAQ

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Done.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13528
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13570] Expose faster unicode-ascii functions in the C-API

2011-12-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13570
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Nikita Pchelin

Nikita Pchelin nikita.pche...@gmail.com added the comment:

Hi Antoine,

* If I don't pass a logger and do print statements instead, works like a 
charm.

* If I getLogger() in the child instead, example fails with the same trace.

However, according to this ( http://docs.python.org/library/logging.html 
): The logging module is intended to be thread-safe without any special 
work needing to be done by its clients. It achieves this though using 
threading locks; there is one lock to serialize access to the module’s 
shared data, and each handler also creates a lock to serialize access to 
its underlying I/O.

Which is why I assumed I could use logging safely.

Thanks,
Nikita

On 11-12-09 04:30 PM, Antoine Pitrou wrote:
 Antoine Pitroupit...@free.fr  added the comment:

 I don't think it's the queue. Try removing the logger instead (or creating it 
 in the child).

 --

 ___
 Python trackerrep...@bugs.python.org
 http://bugs.python.org/issue13569
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 If I getLogger() in the child instead, example fails with the same trace.

That sounds rather unlikely. Are you sure you don't store the logger in your 
process' __init__ method? The __init__ method is called in the parent and the 
process instance is transfered to the child when you call start() on the 
process.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13569] multiprocessing module: Process.start() fails with EOFError: pickle.PicklingError: Can't pickle type 'thread.lock': it's not found as thread.lock

2011-12-09 Thread Nikita Pchelin

Nikita Pchelin nikita.pche...@gmail.com added the comment:

Are you sure you don't store the logger in your process' __init__ 
method? The __init__ method is called in the parent and the process 
instance is transfered to the child when you call start() on the process.

To make sure we are on the same page, here is what I changed it to:
https://github.com/jango/PC/blob/test/pc/pc.py

- lines 47-50 commented out (init of PC class that initialises threads);
- lines 64, 65, 77, 78 getLogger within the PC class and print some 
messages;
- lines 59, 61 71, 74 -- None is passed to the constructor of _Consumer 
and _Producer;
- lines 135, 203 -- children user logger;

With this code, I still get the exception.

On 11-12-09 07:23 PM, Antoine Pitrou wrote:
 Antoine Pitroupit...@free.fr  added the comment:

 If I getLogger() in the child instead, example fails with the same trace.
 That sounds rather unlikely. Are you sure you don't store the logger in your 
 process' __init__ method? The __init__ method is called in the parent and the 
 process instance is transfered to the child when you call start() on the 
 process.

 --

 ___
 Python trackerrep...@bugs.python.org
 http://bugs.python.org/issue13569
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13569
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1410680] Add 'surgical editing' to ConfigParser

2011-12-09 Thread Mathieu Pasquet

Mathieu Pasquet mathi...@mathieui.net added the comment:

What is the state of that feature, as of today?

--
nosy: +mathieui

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1410680
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13571] Backup files support in IDLE

2011-12-09 Thread maniram maniram

New submission from maniram maniram maniandra...@gmail.com:

Automatically save files in IDLE's editor which are not saved to backup file(s) 
(perhaps in .idlerc) every minute.

If IDLE crashes, save all files that are not saved to backup file(s) and then 
re-raise the error (like a finally statement)

When IDLE detects a backup file make it prompt the user whether (s)he wants to 
move the backup file to the original file and also have a button to view the 
backup file and a button to view the original file (both the buttons are in the 
prompt).

--
components: IDLE
messages: 149140
nosy: maniram.maniram
priority: normal
severity: normal
status: open
title: Backup files support in IDLE

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13571
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13549] Incorrect nested list comprehension documentation

2011-12-09 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Showing both was the intent of my comment. Since I am about 60:40 on that, I 
was and am  willing for you, having grabbed and pushed the issue, to drop the 
half-expanded version if you thought it better. With or without, we have 
improved this section. But I still think showing the intermediate step adds 
sufficient extra clarity to be worth the 5 or 6 extra lines. While nested list 
comps are not scary, they can, as I discovered, be confusing with a rushed 
reading. Anyone who wants to compress nested append loops should also do it in 
two steps.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13549
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10364] IDLE: make .py default added extension on save

2011-12-09 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
resolution:  - duplicate
status: open - closed
superseder:  - idle filename extension

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10364
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13521] Make dict.setdefault() atomic

2011-12-09 Thread John O'Connor

Changes by John O'Connor tehj...@gmail.com:


--
nosy: +jcon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13521
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13521] Make dict.setdefault() atomic

2011-12-09 Thread maniram maniram

maniram maniram maniandra...@gmail.com added the comment:

+1 for atomic and more robust

--
nosy: +maniram.maniram

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13521
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13571] Backup files support in IDLE

2011-12-09 Thread maniram maniram

Changes by maniram maniram maniandra...@gmail.com:


--
type:  - feature request
versions: +Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13571
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Stefan Behnel

Changes by Stefan Behnel sco...@users.sourceforge.net:


--
nosy: +effbot

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13378
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-12-09 Thread Stefan Behnel

Stefan Behnel sco...@users.sourceforge.net added the comment:

Given that this is a major new feature for the serialiser in ElementTree, I 
think it's worth asking Fredrik for any comments.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13378
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com