[issue11158] Python VM deadlock

2011-02-10 Thread Vinay Sajip

Vinay Sajip  added the comment:

I don't believe that the problem is about threads vs. processes. In the 
following gist:

https://gist.github.com/820132

I modified the script so that the main process uses a listener thread, rather 
than a listener process, to collect the logs. (Basically, I changed 
multiprocessing.Process to threading.Thread, changed the name of the function 
to listener_thread from listener_process, added an import for threading and 
updated the comments. No other changes were made.)

The script in the above gist runs fine on Linux Mint Debian and Windows 7 
(Python 2.6 in both cases). Please run it on Snow Leopard and report your 
findings.

--
resolution:  -> invalid
status: open -> pending

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-10 Thread Marcin Bachry

Marcin Bachry  added the comment:

I think it may be related to this bug: http://bugs.python.org/issue6721

--
nosy: +marcin.bachry
status: pending -> open

___
Python tracker 

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



[issue11167] Overflow in unicode_hash

2011-02-10 Thread Stefan Krah

New submission from Stefan Krah :

Due to an integer overflow in unicode_hash, the python interpreter
crashes if built with -ftrapv:

./configure --with-pydebug CFLAGS="-ftrapv"



Starting program: /home/stefan/svn/py3k/python 
[Thread debugging using libthread_db enabled]

Program received signal SIGABRT, Aborted.
0x771e6a75 in *__GI_raise (sig=) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x771e6a75 in *__GI_raise (sig=) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x771ea5c0 in *__GI_abort () at abort.c:92
#2  0x005e30a0 in __mulvdi3 ()
#3  0x0046304b in unicode_hash (self=0x77fab110) at 
Objects/unicodeobject.c:7600
#4  0x0041a313 in PyObject_Hash (v=0x77fab110) at 
Objects/object.c:762
#5  0x005a9093 in PyDict_GetItem (op=0x8be030, key=0x77fab110) at 
Objects/dictobject.c:715
#6  0x0046d88c in PyUnicode_InternInPlace (p=0x7fffdf38) at 
Objects/unicodeobject.c:10026
#7  0x0046da8b in PyUnicode_InternFromString (cp=0x5e7c99 "__len__") at 
Objects/unicodeobject.c:10065
#8  0x00445eba in init_slotdefs () at Objects/typeobject.c:5801
#9  0x0044633b in add_operators (type=0x846400) at 
Objects/typeobject.c:5955
#10 0x0043e950 in PyType_Ready (type=0x846400) at 
Objects/typeobject.c:3860
#11 0x0043e87e in PyType_Ready (type=0x846000) at 
Objects/typeobject.c:3824
#12 0x0041c786 in _Py_ReadyTypes () at Objects/object.c:1513
#13 0x004c99a6 in Py_InitializeEx (install_sigs=1) at 
Python/pythonrun.c:229
#14 0x004c9d78 in Py_Initialize () at Python/pythonrun.c:321
#15 0x004ead8c in Py_Main (argc=1, argv=0x77fa9040) at 
Modules/main.c:597
#16 0x004187cf in main (argc=1, argv=0x7fffe3c8) at 
./Modules/python.c:59



Breakpoint 1, unicode_hash (self=0x77fab110) at Objects/unicodeobject.c:7594
7594if (self->hash != -1)
(gdb) n
7596len = Py_SIZE(self);
(gdb) n
7597p = self->str;
(gdb) n
7598x = *p << 7;
(gdb) n
7599while (--len >= 0)
(gdb) p x
$1 = 12160
(gdb) n
7600x = (103*x) ^ *p++;
(gdb) n
7599while (--len >= 0)
(gdb) n
7600x = (103*x) ^ *p++;
(gdb) n
7599while (--len >= 0)
(gdb) n
7600x = (103*x) ^ *p++;
(gdb) n

Program received signal SIGABRT, Aborted.
0x771e6a75 in *__GI_raise (sig=) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) quit



This might be related to issue #10156 (unicode initialization is
not clearly defined).

--
components: Interpreter Core
messages: 128270
nosy: georg.brandl, skrah
priority: critical
severity: normal
stage: needs patch
status: open
title: Overflow in unicode_hash
type: crash
versions: Python 3.2

___
Python tracker 

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



[issue11167] Overflow in unicode_hash

2011-02-10 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with distutils

2011-02-10 Thread Scott Tsai

Changes by Scott Tsai :


--
nosy: +scott.tsai
versions:  -3rd party, Python 3.3

___
Python tracker 

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



[issue3871] cross and native build of python for mingw32 with distutils

2011-02-10 Thread Scott Tsai

Scott Tsai  added the comment:

I touched the version field by mistake while trying to add myself to the nosy 
list. My sincere apologies for the SPAM to all involved.

--
versions: +3rd party, Python 3.3

___
Python tracker 

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



[issue11167] Overflow in unicode_hash

2011-02-10 Thread Stefan Krah

Stefan Krah  added the comment:

Ok, this is known, see #1621. Closing.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Do not assume signed integer overflow behavior

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2011-02-10 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +skrah

___
Python tracker 

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



[issue11167] Overflow in unicode_hash

2011-02-10 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Could you try the same in Python 2.7 ?

The overflow is intended (after all, it's a hash function), but we should 
probably add a cast to Py_hash_t to the hash building line in order to make the 
compiler aware of this.

--
nosy: +lemburg

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-10 Thread wrobell

wrobell  added the comment:

> > will this patch support off_t for "mmap.resize" as well?
> > ftruncate uses off_t for the length of a file as well.

> No, it doesn't because resize() resizes the amount mmapped in memory
> which can't be more than ssize_t anyway. However, resizing does work on
> a 12GiB file with a large offset, e.g. 6GiB.

i am bit lost. ftruncate is used to enlarge the file, isn't it?

please consider the script:

-- rr.py ---
import mmap

f = open('test.x', 'w+b')
f.write(b'\x00' * 10)
f.flush()

fm = mmap.mmap(f.fileno(), 0)
fm.resize(5 * 1024 ** 3)
fm.close()

f.close()


the script above resizes file from 10 bytes
to 5 * 1024 ** 3 bytes with mmap.resize (but
not 5 * 1024 ** 3 + 10!)

now, on 32-bit linux (with off_t):

$ python3 rr.py
Traceback (most recent call last):
  File "rr.py", line 8, in 
fm.resize(5 * 1024 ** 3)
OverflowError: Python int too large to convert to C ssize_t

above script works perfectly on 64-bit version of linux
with just 4GB of RAM.

maybe i do not understand some magic here, but clearly one
can mmap.resize to a file size much beyond the amount of memory.

--

___
Python tracker 

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



[issue4709] Mingw-w64 and python on windows x64

2011-02-10 Thread Scott Tsai

Changes by Scott Tsai :


--
nosy: +scott.tsai

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX 5.3

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

There are some unit tests concerning distutils which are currently failing on 
AIX and may be an illustration of the same problem:

==
ERROR: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/unixccompiler.py",
 line 254, in link
self.spawn(linker + ld_args)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/ccompiler.py",
 line 911, in spawn
spawn(cmd, dry_run=self.dry_run)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/spawn.py",
 line 34, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/spawn.py",
 line 138, in _spawn_posix
% (cmd[0], exit_status))
distutils.errors.DistutilsExecError: command './Modules/ld_so_aix' failed with 
exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/tests/test_build_ext.py",
 line 85, in test_build_ext
cmd.run()
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 347, in run
self.build_extensions()
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 456, in build_extensions
self.build_extension(ext)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 543, in build_extension
target_lang=language)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/ccompiler.py",
 line 719, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/unixccompiler.py",
 line 256, in link
raise LinkError(msg)
distutils.errors.LinkError: command './Modules/ld_so_aix' failed with exit 
status 1

==
ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
--
Traceback (most recent call last):
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/unixccompiler.py",
 line 254, in link
self.spawn(linker + ld_args)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/ccompiler.py",
 line 911, in spawn
spawn(cmd, dry_run=self.dry_run)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/spawn.py",
 line 34, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/spawn.py",
 line 138, in _spawn_posix
% (cmd[0], exit_status))
distutils.errors.DistutilsExecError: command './Modules/ld_so_aix' failed with 
exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/tests/test_build_ext.py",
 line 343, in test_get_outputs
cmd.run()
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 347, in run
self.build_extensions()
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 456, in build_extensions
self.build_extension(ext)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/command/build_ext.py",
 line 543, in build_extension
target_lang=language)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/ccompiler.py",
 line 719, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/distutils/unixccompiler.py",
 line 256, in link
raise LinkError(msg)
distutils.errors.LinkError: command './Modules/ld_so_aix' failed with exit 
status 1

I will take a look.

--

___
Python tracker 

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



[issue10694] zipfile.py end of central directory detection not robust

2011-02-10 Thread rep

rep  added the comment:

Xuanji: Patch looks good now with the test cases.

Regarding the other fix suggested by Kevin I think that we should not introduce 
custom behaviour here like appending the eofdata to the comment even though the 
comment size in the record does not say so. In the end we want to make sure 
that correct zip files end up being processed correctly with the specified 
comment size and incorrect zip files with eofdata should not be rejected / 
throw exceptions.

So I agree with Xuanji that his patch (or mine) is the way to go.

You probably agree that we can mark issue 10298 to be superseded by this one 
here.

--

___
Python tracker 

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



[issue10298] zipfile: incorrect comment size will prevent extracting

2011-02-10 Thread rep

Changes by rep :


--
status: open -> languishing

___
Python tracker 

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



[issue10298] zipfile: incorrect comment size will prevent extracting

2011-02-10 Thread rep

Changes by rep :


--
status: languishing -> pending

___
Python tracker 

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



[issue9523] Improve dbm modules

2011-02-10 Thread Ray.Allen

Ray.Allen  added the comment:

Thanks eric for reviewing my patch! And thanks for you suggestions. I'm  
following them.

> I don’t know if you should use a plain set or a collections.ItemsView here.  
> In dict objects, KeysView and ValuesView are set-like objects with added 
> behavior, for example they yield their elements in the same order.

Yes you are right. I think returning a view object is better than returning a 
set.

Here is the updated patch. It updates:
1. Make keys(), values(), items() methods return view object for ndbm, gdbm and 
dumb objects. I following the codes in dictobject.c. The keysview object 
support len(), "in" operator, and iteratable, while valuesview and itemsview 
object only support len() and iteratable.
2. Removing doc changes: 
  The object returned by :func:`.open` supports the same basic functionality as
  -dictionaries
  +:mod:`collection`.MutableMapping
which is mentioned in eric's comment.
3. Remove dumb's keys() method which calls self._index.keys() since it is 
unnecessary.
4. Using more specialized assertXxx methods in test cases.
5. Remove "the values() and items() method are not supported" in 
Doc/library/dbm.rst.


> See #5736 for a patch adding iteration support.  If the patch attached to his 
> report supersedes the other one, I’ll close the other bug as duplicate.

#5736 's patch for adding iteration to ndbm and gdbm modules simple calling 
PyObject_GetIter(dbm_keys(dbm, NULL)) for both gdbm and ndbm, but I feel it's 
better to create a seperate iterator object for gdbm objects.

--
Added file: http://bugs.python.org/file20726/issue_9523.diff

___
Python tracker 

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



[issue10298] zipfile: incorrect comment size will prevent extracting

2011-02-10 Thread rep

rep  added the comment:

superseded by issue 10694

--
resolution:  -> accepted
status: pending -> closed

___
Python tracker 

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



[issue10709] Misc/AIX-NOTES needs updating

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Yes I will do that.
I am currently reinstalling some buildbot environments for Python on AIX 5.3 
and AIX 6.1 and once that is done, I will rewrite the note.

--

___
Python tracker 

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



[issue11148] Crash and error message from Python VM

2011-02-10 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

I think this issue is related to http://bugs.python.org/issue11158, which is in 
turn related to http://bugs.python.org/issue6721 (Locks in python standard 
library should be sanitized on fork).

When  a mutex created by a parent process is used from within a child process, 
this can lead not only to a deadlock, but also to SIGSEGV.

To understand the purpose of pthread_atfork, recall that fork duplicates the 
whole memory space, including mutexes in their current locking state, but only 
the calling thread: other threads are not running in the child process. The 
mutexes are not usable after the fork and must be initialized with 
pthread_mutex_init in the child process. This is a limitation of the current 
implementation and might or might not be present in future versions.

They must be initialized.

Suggesting to close both #11148 and #11158 as dupe of #6721.

--
nosy: +neologix

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError: [u'path']

2011-02-10 Thread Ralf Schmitt

Changes by Ralf Schmitt :


--
nosy: +schmir

___
Python tracker 

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



[issue941346] AIX shared library fix

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Hi Micheal,

I don't remember why "-L\$(srcdir)" was added since it has been quite a long 
time.

I tried to recompile everything after removing it and everything compiled just 
fine, so I guess it can be removed.

regards

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-02-10 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

I'm not sure that releasing the mutex is enough, it can still lead to a 
segfault, as is probably the case in this issue :
http://bugs.python.org/issue11148

Quoting pthread_atfork man page :

To understand the purpose of pthread_atfork, recall that fork duplicates the 
whole memory space, including mutexes in their current locking state, but only 
the calling thread: other threads are not running in the child process. The 
mutexes are not usable after the fork and must be initialized with 
pthread_mutex_init in the child process. This is a limitation of the current 
implementation and might or might not be present in future versions.

To avoid this, install handlers with pthread_atfork as follows: have the 
prepare handler lock the mutexes (in locking order), and the parent handler 
unlock the mutexes. The child handler should reset the mutexes using 
pthread_mutex_init, as well as any other synchronization objects such as 
condition variables.

Locking the global mutexes before the fork ensures that all other threads are 
locked out of the critical regions of code protected by those mutexes. Thus 
when fork takes a snapshot of the parent's address space, that snapshot will 
copy valid, stable data. Resetting the synchronization objects in the child 
process will ensure they are properly cleansed of any artifacts from the 
threading subsystem of the parent process. For example, a mutex may inherit a 
wait queue of threads waiting for the lock; this wait queue makes no sense in 
the child process. Initializing the mutex takes care of this.

pthread_atfork might be worth looking into

--
nosy: +neologix

___
Python tracker 

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



[issue730467] Not detecting AIX_GENUINE_CPLUSPLUS

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Here is a patch that combines the corrections in configure.in and dynload_aix.c.

All recent versions of AIX would benefit from this correction I think (recent 
meaning a version of AIX released in the last 10 years or something).

Could someone apply it?
Thanks in advance

--
keywords: +patch
Added file: http://bugs.python.org/file20727/patch_aix_cxx.diff

___
Python tracker 

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



[issue2228] Imaplib speedup patch

2011-02-10 Thread Aaron Kaplan

Aaron Kaplan  added the comment:

Let me clarify. Offlineimap used to ship a modified version of imaplib in its 
distribution, but eventually the author decided he no longer wanted to maintain 
his imaplib fork, so he dropped it and went with stock imaplib (at a 
significant performance penalty). The patch I submitted here is the difference 
between the forked imaplib circa 2007 and the upstream version it was forked 
from.  The current version of offlineimap is not relevant to this issue, 
because it no longer contains any imaplib code.

--

___
Python tracker 

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



[issue11168] UnicodeEncodeError on recusion limit if the script filename is undecodable

2011-02-10 Thread STINNER Victor

New submission from STINNER Victor :

If the script filename is not decodable from the filesystem encoding, Python 
fails with a UnicodeEncodeError when we reach the recursion limit. The problem 
doesn't come from the user script, but from Python internals. It is difficult 
to understand and the user expects a 


A longer explanation:

test_runpy fails with a pydebug build if the script filename is not encodable 
to UTF-8. In pydebug build only, PyEval_EvalFrameEx() encodes the frame 
filename to UTF-8. If the filename contains a surrogate character (which only 
occurs on UNIX with undecodable filename),the encoding function fails. 
PyEval_EvalFrameEx() ignores the error except if we hit the recusion limit (if 
the overflowed attribute of the thread state if set): in this case, the error 
is not ignored.

To reproduce the problem, change the Python directory (your local repository) 
to an undecodable filename (eg. b'py3k\xe9\xff' with UTF-8 locale encoding) and 
run: ./python Lib/test/regrtest.py test_py.


Solutions :

I propose to remove the filename variable from PyEval_EvalFrameEx() because it 
is only used by the old gdb macros: python-gdb.py doesn't need it anymore.

=> see attached patch

Or if you really want to keep it, tstate->overflowed should be reinitialized. 
But on overflow, other variables are changed, like _Py_CheckRecursionLimit. I 
don't know this code enough to write a correct patch, but the minimal patch is:

--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1234,7 +1234,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
 filename = _PyUnicode_AsString(co->co_filename);
 if (filename == NULL && tstate->overflowed) {
 /* maximum recursion depth exceeded */
-goto exit_eval_frame;
+tstate->overflowed = 0;
 }
 PyErr_Restore(error_type, error_value, error_traceback);
 }

--
components: Unicode
files: ceval_filename.patch
keywords: patch
messages: 128285
nosy: haypo
priority: normal
severity: normal
status: open
title: UnicodeEncodeError on recusion limit if the script filename is 
undecodable
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20728/ceval_filename.patch

___
Python tracker 

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



[issue11158] Python VM deadlock

2011-02-10 Thread Vinay Sajip

Vinay Sajip  added the comment:

Issue 6721 may well be valid - if this is a symptom of the same issue, then 
this issue should be closed. I'd like to know if the gist script I referred to 
works (or not) on Pham Cong Dinh's Snow Leopard machine.

--
status: open -> pending

___
Python tracker 

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



[issue9920] test_cmath on atan fails on AIX

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Mark,

sorry for the late reply; I stopped focusing on AIX for some time.

I ran test_cmath on trunk this morning and got a different error this time:

==
FAIL: test_specific_values (test.test_cmath.CMathTests)
--
Traceback (most recent call last):
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/test/test_cmath.py",
 line 382, in test_specific_values
msg=error_message)
  File 
"/san_cis/home/cis/.buildbot/python-aix6/py3k-aix6-xlc/build/Lib/test/test_cmath.py",
 line 128, in rAssertAlmostEqual
'got {!r}'.format(a, b))
AssertionError: atan1000: atan(complex(-0.0, 0.0))
Expected: complex(-0.0, 0.0)
Received: complex(-0.0, -0.0)
Received value insufficiently close to expected value.

--
Ran 16 tests in 0.086s

FAILED (failures=1, skipped=2)

--

___
Python tracker 

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



[issue11169] compileall doesn't support the PEP 383 (undecodable paths/filenames)

2011-02-10 Thread STINNER Victor

New submission from STINNER Victor :

The compileall uses print("bla", filename, "bla") to write messages to the 
console. But the print fails if the filename cannot be encoded to the console 
encoding. It occurs if the filename is an undecodable filename encoded by the 
PEP 383 using surrogates. For example, UTF-8 cannot encode surrogates.

Attached patch uses repr() to escape surrogates: it adds also quotes to the 
filename. I don't know if it is a problem to add quotes. I prefer quotes, but 
it is more readable if the path or the filename contain spaces.

--
components: Unicode
files: compileall_surrogates.patch
keywords: patch
messages: 128288
nosy: haypo
priority: normal
severity: normal
status: open
title: compileall doesn't support the PEP 383 (undecodable paths/filenames)
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20729/compileall_surrogates.patch

___
Python tracker 

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



[issue11170] (MacOS X) Crash on non-english language keyboard input in Text widget

2011-02-10 Thread didzis

New submission from didzis :

In simple text edit trying to input non-english characters with keyboard ends 
with a crash on MacOS X (10.6).

For example, to input Latvian language characters, apostrophe should be pressed 
followed by some letter (a, e, i, u, k, l, ...)

Tkinter crashes immediately after apostrophe was pressed on keyboard.

Terminal output:

2011-02-10 14:52:29.444 Python[10633:613] An uncaught exception was raised
2011-02-10 14:52:29.448 Python[10633:613] *** -[NSCFString characterAtIndex:]: 
Range or index out of bounds
2011-02-10 14:52:29.450 Python[10633:613] *** Terminating app due to uncaught 
exception 'NSRangeException', reason: '*** -[NSCFString characterAtIndex:]: 
Range or index out of bounds'
*** Call stack at first throw:
(
0   CoreFoundation  0x7fff88d407b4 
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x7fff86f480f3 
objc_exception_throw + 45
2   CoreFoundation  0x7fff88d405d7 
+[NSException raise:format:arguments:] + 103
3   CoreFoundation  0x7fff88d40564 
+[NSException raise:format:] + 148
4   Foundation  0x7fff8384e5e1 -[NSCFString 
characterAtIndex:] + 97
5   Tk  0x0001010b5bcf 
Tk_SetCaretPos + 663
6   Tk  0x0001010bbd94 
Tk_MacOSXSetupTkNotifier + 699
7   Tcl 0x0001007542ae 
Tcl_DoOneEvent + 297
8   _tkinter.so 0x0001006d262d 
Tkapp_MainLoop + 413
9   Python  0x0001000c124d 
PyEval_EvalFrameEx + 22397
10  Python  0x0001000c2f49 
PyEval_EvalCodeEx + 2137
11  Python  0x0001000c0d8a 
PyEval_EvalFrameEx + 21178
12  Python  0x0001000c2f49 
PyEval_EvalCodeEx + 2137
13  Python  0x00010003dd80 
function_call + 176
14  Python  0x0001c9f2 
PyObject_Call + 98
15  Python  0x00010001eebb 
instancemethod_call + 363
16  Python  0x0001c9f2 
PyObject_Call + 98
17  Python  0x0001000ba817 
PyEval_CallObjectWithKeywords + 87
18  Python  0x00010002214e 
PyInstance_New + 126
19  Python  0x0001c9f2 
PyObject_Call + 98
20  Python  0x0001000be813 
PyEval_EvalFrameEx + 11587
21  Python  0x0001000c2f49 
PyEval_EvalCodeEx + 2137
22  Python  0x0001000c3066 
PyEval_EvalCode + 54
23  Python  0x0001000e7b2e 
PyRun_FileExFlags + 174
24  Python  0x0001000e7de9 
PyRun_SimpleFileExFlags + 489
25  Python  0x0001000fe75c Py_Main + 
2940
26  Python  0x00010f14 0x0 + 
4294971156
)
terminate called after throwing an instance of 'NSException'
Abort trap

--
components: Tkinter
messages: 128289
nosy: didzis
priority: normal
severity: normal
status: open
title: (MacOS X) Crash on non-english language keyboard input in Text widget
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue9920] test_cmath on atan fails on AIX

2011-02-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ha, yes.  I commented out the first four tests for zeros of atan in the 
cmath_testcases.txt file, but failed to notice that they're tested again, later 
on.  And the same goes for atanh.

I need to look at this, but I don't have write-access to the Python svn repo at 
the moment (my home machine is ill).  If someone else wants to go through and 
just comment out all the tests of zeros for atan and atanh in 
cmath_testcases.txt, please go ahead.  The zeros are tested independently 
within test_cmath (but skipped on systems like AIX where there are known 
problems with log1p).

--
status: closed -> open

___
Python tracker 

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



[issue11170] (MacOS X) Crash on non-english language keyboard input in Text widget

2011-02-10 Thread R. David Murray

R. David Murray  added the comment:

This looks like a duplicate of issue 10973.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> OS X 10.6 IDLE, tkinter: Cocoa Tk 8.5 crash when composite 
character typed in   textfield

___
Python tracker 

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



[issue7330] PyUnicode_FromFormat segfault

2011-02-10 Thread Ray.Allen

Changes by Ray.Allen :


Removed file: http://bugs.python.org/file19131/issue_7330.diff

___
Python tracker 

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



[issue11171] Python 2.7.1 does not start when "./configure" is used with "--prefix" != "--exec-prefix"

2011-02-10 Thread Berthold Höllmann

New submission from Berthold Höllmann :

I do get (with 2.7.1):

> python
Traceback (most recent call last):
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site.py", line 553, 
in 
main()
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site.py", line 535, 
in main
known_paths = addusersitepackages(known_paths)
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site.py", line 268, 
in addusersitepackages
user_site = getusersitepackages()
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site.py", line 243, 
in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/site.py", line 233, 
in getuserbase
USER_BASE = get_config_var('userbase')
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py", line 
535, in get_config_var
return get_config_vars().get(name)
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py", line 
434, in get_config_vars
_init_posix(_CONFIG_VARS)
  File "/usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py", line 
287, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open 
/usr/local/gltools/python/Python-2.7/lib/python2.7/config/Makefile (No such 
file or directory)

The Makefile is platform dependendent und is located at

/usr/local/gltools/python/Python-2.7/linux_x86_64/lib/python2.7/config/Makefile

This problem is fixed for me by a simple pach:

> diff -c /usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py 
> /usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py~
*** /usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py 
2011-02-10 14:33:34.15000 +0100
--- /usr/local/gltools/python/Python-2.7/lib/python2.7/sysconfig.py~
2011-02-10 14:28:17.001245000 +0100
***
*** 271,277 
  def _get_makefile_filename():
  if _PYTHON_BUILD:
  return os.path.join(_PROJECT_BASE, "Makefile")
! return os.path.join(get_path('platstdlib'), "config", "Makefile")
  
  
  def _init_posix(vars):
--- 271,277 
  def _get_makefile_filename():
  if _PYTHON_BUILD:
  return os.path.join(_PROJECT_BASE, "Makefile")
! return os.path.join(get_path('stdlib'), "config", "Makefile")
  
  
  def _init_posix(vars):

--
components: Installation
messages: 128292
nosy: hoel
priority: normal
severity: normal
status: open
title: Python 2.7.1 does not start when "./configure" is used with  "--prefix" 
!= "--exec-prefix"
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue11172] Avoid '.' as runpath on AIX

2011-02-10 Thread Michael Haubenwallner

New submission from Michael Haubenwallner :

Spotted in issue#941346 msg#128214, the "-L$(srcdir)" should be removed from 
BLDSHARED on AIX:

The problem is that '-L$(srcdir)' adds '$(srcdir)' to the runpath too (as there 
is no '-blibpath' argument), opening a security hole for libpythonX.Y.so as 
well as the modules.so.

As LDLIBRARY points to the immediate file 'libpython$(VERSION).so' instead of 
'-lpython$(VERSION)', I don't see the need for '-L$(srcdir)' at all.

--
components: Build
files: python-2.7.1-aix-safe-runpath.patch
keywords: patch
messages: 128293
nosy: haubi
priority: normal
severity: normal
status: open
title: Avoid '.' as runpath on AIX
type: security
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20730/python-2.7.1-aix-safe-runpath.patch

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg :

Mark Shannon on python-dev:

The following API functions were removed from 3.1.3:

PyAST_Compile
PyCObject_AsVoidPtr
PyCObject_FromVoidPtr
PyCObject_FromVoidPtrAndDesc
PyCObject_GetDesc
PyCObject_Import
PyCObject_SetVoidPtr
PyCode_CheckLineNumber
Py_CompileStringFlags
PyEval_CallObject
PyOS_ascii_atof
PyOS_ascii_formatd
PyOS_ascii_strtod
PyThread_exit_prog
PyThread__PyThread_exit_prog
PyThread__PyThread_exit_thread
PyUnicode_SetDefaultEncoding

And the following were added to 3.2,
of which only 2 are documented:

PyArg_ValidateKeywordArguments
PyAST_CompileEx
Py_CompileString
Py_CompileStringExFlags
PyErr_NewExceptionWithDoc(documented)
PyErr_SyntaxLocationEx
PyErr_WarnFormat
PyFrame_GetLineNumber
PyImport_ExecCodeModuleWithPathnames
PyImport_GetMagicTag
PyLong_AsLongLongAndOverflow(documented)
PyModule_GetFilenameObject
Py_SetPath
PyStructSequence_GetItem
PyStructSequence_NewType
PyStructSequence_SetItem
PySys_AddWarnOptionUnicode
PySys_AddXOption
PySys_FormatStderr
PySys_FormatStdout
PySys_GetXOptions
PyThread_acquire_lock_timed
PyType_FromSpec
PyUnicode_AsUnicodeCopy
PyUnicode_AsWideCharString
PyUnicode_EncodeFSDefault
PyUnicode_FSDecoder
Py_UNICODE_strcat
Py_UNICODE_strncmp
Py_UNICODE_strrchr
PyUnicode_TransformDecimalToASCII

For added confusion PySys_SetArgvEx is documented as
new in 3.2, but exists in 3.1.3

Note that this only include functions.
The API also includes a number of macros such as
Py_False and Py_RETURN_FALSE, types ,
and data like PyBool_Type.

--
assignee: docs@python
components: Documentation
messages: 128294
nosy: docs@python, lemburg
priority: normal
severity: normal
status: open
title: Undocumented public APIs in Python 3.2
versions: Python 3.2

___
Python tracker 

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



[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

On Sat, Feb 5, 2011 at 12:33 AM, Georg Brandl  wrote:
>
> Then let us do that.
>
> Senthil, what about urlencode of bytes values returning a str?
>

Sorry, the late response. I needed some time to look at this one and I
could only do it today.
We have been having str return value from urlencode, due to quote,
quote_plus methods which can take bytes/str but return str. (urlencode
is nothing but quote_plus which acts on two-element sequences like
name,value pairs.

The resultant str is certainly useful when we want to construct a URL
query string. But, when we want to do a POST via urlopen, we need
bytes data. So, I think best to advice through the documentation that,
urlencoded value must be converted to bytes if it is to be used for
POST'ing using urlopen.

(Well, I also think that urllencode could be modified to the effect
that if the key,value pairs are bytes, return the bytes output.
Technically, this would involve overriding some behavior of
quote/quote_plus and the return value will suitable only for POST data
and not for url query construction. I would rather choose to discuss
this before settling on the behavior and I remember that quote's
behavior did take a significant amount discussion).

So, for this issue. A patch would a prevent str data from being posted
with ValueError explaining the reason that bytes and required and a
documentation update in the urlencode method which would inform the
users that the output be converted to bytes before it is POSTed,

Shall we go ahead with this, Georg?  I shall post a patch immediately.

--

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy: +eli.bendersky

___
Python tracker 

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



[issue7330] PyUnicode_FromFormat segfault

2011-02-10 Thread Ray.Allen

Ray.Allen  added the comment:

Thanks haypo!

Here is the updated patch, it add the tests about width modifiers and precision 
modifiers of %S, %R, %A. Besides I don't know how to add tests of %s, since 
when calling through ctypes, I could not get correct result value as python 
object from PyUnicode_FromFormat() with '%s' in format string as argument.

--
Added file: http://bugs.python.org/file20731/issue_7330.diff

___
Python tracker 

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



[issue10523] argparse has problem parsing option files containing empty rows

2011-02-10 Thread Steven Bethard

Steven Bethard  added the comment:

Crashing on an empty line is definitely a bug.

Each line being a single option is documented behavior:

http://docs.python.org/dev/library/argparse.html#fromfile-prefix-chars

--
nosy: +bethard

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

> PyErr_WarnFormat

is already documented in Doc/c-api/exceptions.rst

> PyImport_ExecCodeModuleWithPathnames

is already documented in Doc/c-api/import.rst

> PyModule_GetFilenameObject

is already documented in Doc/c-api/module.rst

> PySys_AddWarnOptionUnicode, PySys_FormatStderr and PySys_FormatStdout

are already documented in Doc/c-api/sys.rst

> PyUnicode_AsUnicodeCopy, PyUnicode_AsWideCharString, 
> PyUnicode_EncodeFSDefault and PyUnicode_FSDecoder

are already documented in Doc/c-api/unicode.rst

Mark Shannon should read the documentation more carefuly.

--
nosy: +haypo

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

> Py_UNICODE_strcat, Py_UNICODE_strncmp, Py_UNICODE_strrchr

See issue #10435 (with a patch) for these functions.

--

___
Python tracker 

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



[issue11174] add argparse formatting option to display type names for metavar

2011-02-10 Thread Steven Bethard

New submission from Steven Bethard :

Suggestion from a personal email:

I generally like my command line arguments that take a
value to specify the type, e.g.,

   --runs int  how many runs to do

Naturally I can do this using the metavars argument in every
add_argument() call, but that can become tedious. So I suggest adding a
metavars argument to the ArgumentParser constructor; default
metavars=None (current behaviour); metavars=type (show type names). And
of course, allow metavars specified in add_argument() calls to override
on a case by case basis.

--
components: Library (Lib)
messages: 128300
nosy: bethard
priority: low
severity: normal
stage: needs patch
status: open
title: add argparse formatting option to display type names for metavar
type: feature request
versions: Python 3.3

___
Python tracker 

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



[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Steven Bethard

New submission from Steven Bethard :

Suggestion from a personal email:

Allow FileType to accept encoding and errors arguments
and pass these as keyword arguments to codecs.open() instead of open().

--
components: Library (Lib)
messages: 128301
nosy: bethard
priority: low
severity: normal
stage: needs patch
status: open
title: allow argparse FileType to accept encoding and errors arguments
type: feature request
versions: Python 3.3

___
Python tracker 

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



[issue11176] give more meaningful argument names in argparse documentation

2011-02-10 Thread Steven Bethard

New submission from Steven Bethard :

Suggestion from a personal email:

I personally am not keen on the foo/bar/baz examples. I
know that you're trying to be generic but IMO it would be much easier to
understand if you used meaningful names. Also, I think that the very
first example you give (which does use meaningful names:-) is too
clever. I'd suggest using something simpler: in fact I'd use exactly the
same example that optparse uses (--file && --quiet) since that is easy
to understand and relate to straight away, and maybe add a --line option
that takes a list of ints (ostensibly line numbers of lines to extract
from the file) if you want to show that argparse leaves optparse in the
dust. And you can always show how to get actual file objects later on.

--
assignee: docs@python
components: Documentation
messages: 128302
nosy: bethard, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: give more meaningful argument names in argparse documentation
type: feature request
versions: Python 3.3

___
Python tracker 

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



[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2011-02-10 Thread Raymond Penners

Changes by Raymond Penners :


--
nosy: +pennersr

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> PyThread_acquire_lock_timed

It's on purpose that I didn't document this one. I'm not sure the PyThread_ 
APIs should be used by third-party extensions; so I'd prefer to hear about 
potential users before starting documenting it (and being tied by compatibility 
issues).

--
nosy: +pitrou

___
Python tracker 

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



[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Here is a patch to resolve this issue. Let me know if it okay to commit.(Or 
feel free to commit too).

--
stage:  -> patch review
Added file: http://bugs.python.org/file20732/issue11082.diff

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-10 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

32-bit computers can address up to 4GiB of memory and 64-bit computers can 
address much more than this. mmap() allows a file to be mapped to a location in 
memory - the actual amount of memory that exists doesn't matter. This is the 
reason why a 5GiB file can be mmaped on 64-bit but not 32-bit.

Also, python uses the ssize_t type for sequences which allows about 2GiB to be 
mapped on a 32-bit platform. The mmap.resize() operation as well as changing 
the size of the underlying file size with ftruncate(), also changes the size of 
the map in memory. Thus in your sample script, this resizing would need to 
ftruncate the file to 5GiB and then map all of it into memory which is not 
possible on 32-bit.

I think the following might be a possible way of doing it:
import mmap

f = open('test.x', 'w+b')
f.write(b'\x00' * 10)
f.flush()

fm = mmap.mmap(f.fileno(), 0)
fm.close()
f.truncate(5 * 1024 ** 3)

# mmap only 1GiB of the 5GiB file
fm = mmap.mmap(f.fileno(), 1024**3)
fm.close()

f.close()

--

___
Python tracker 

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



[issue5833] readline update

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine: do you think it's worth the effort?

As mentioned above, the readline 6 compatibility code was checked in.
The ClassType expansion is 2.x-only, so probably can't go in since it's a 
feature request.
What remains is the filename expansion. However, the problem is that it seems 
to rely on removing '~$-/' from the word break characters, which is IMO wrong 
(at least '-', '/' and '~' are all Python operators which should be considered 
word break characters).

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-02-10 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

fwiw http://bugs.python.org/issue6643 recently fixed on issue where a mutex was 
being closed instead of reinitialized after a fork.  more are likely needed.

Are you suggesting to use pthread_atfork to call pthread_mutex_init on all 
mutexes created by Python in the child after a fork?  I'll have to ponder that 
some more.  Given the mutexes are all useless post fork it does not strike me 
as a bad idea.

--

___
Python tracker 

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



[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

Georg Brandl: can this fix go into Python 3.2? It changes the API.

I like any patch rejecting unicode where unicode is irrevelant (where we don't 
know how to choose the right encoding).

About the patch: you should maybe add a test to ensure that str is rejected 
with a TypeError.

--

___
Python tracker 

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



[issue10882] Add os.sendfile()

2011-02-10 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Patch in attachment removes offset and return just the number of bytes sent as 
an integer.
Tests and documentation are updated accordingly.

--
Added file: http://bugs.python.org/file20733/sendfile_v8.patch

___
Python tracker 

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



[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The encoding and errors arguments are probably useful, but why would you use 
the codecs module?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Are you suggesting to use pthread_atfork to call pthread_mutex_init on > all 
> mutexes created by Python in the child after a fork?  I'll have to > ponder 
> that some more.  Given the mutexes are all useless post fork it > does not 
> strike me as a bad idea.

I don't really understand. It's quite similar to the idea you shot down in 
msg94135. Or am I missing something?

--

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

Le jeudi 10 février 2011 à 16:41 +, Ross Lagerwall a écrit :
> Ross Lagerwall  added the comment:
> 
> 32-bit computers can address up to 4GiB of memory

... at least 4 GB. With PAE (Physical Address Extension), we can address
up to 2^36 bytes. It looks like mmap() do support PAE, I suppose that
you need 64 bits offset on a 32 bits system to be able to use PAE :-)

Victor

--

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le jeudi 10 février 2011 à 17:03 +, STINNER Victor a écrit :
> STINNER Victor  added the comment:
> 
> Le jeudi 10 février 2011 à 16:41 +, Ross Lagerwall a écrit :
> > Ross Lagerwall  added the comment:
> > 
> > 32-bit computers can address up to 4GiB of memory
> 
> ... at least 4 GB. With PAE (Physical Address Extension), we can address
> up to 2^36 bytes. It looks like mmap() do support PAE, I suppose that
> you need 64 bits offset on a 32 bits system to be able to use PAE :-)

We are talking about virtual addresses, not physical addresses. PAE
doesn't magically enlarge your address registers ;)

--

___
Python tracker 

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



[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Victor - It does not change the API. Only that the ValueError message which had 
a confusing message that "for iterable data of type  " is made 
clear that POST should not be a str.
Yes, a TypeError instead of ValueError would be more appropriate here.

--

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX 5.3

2011-02-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

I tried with trunk (python 3.2) on AIX:
./build/configure --with-pydebug --without-computed-gotos
make
and that worked correctly.

Not sure with python 2.7.

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2011-02-10 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Yeah, I'm trying to figure out what I was thinking then or if I was just plain 
wrong. :)

I was clearly wrong about a release being done in the child being the right 
thing to do (issue6643 proved that, the state held by a lock is not usable to 
another process on all platforms such that release even works).

Part of it looks like I wanted a way to detect it was happening as any lock 
that is held during a fork indicates a _potential_ bug (the lock wasn't 
registered anywhere to be released before the fork) but not everything needs to 
care about that.

--
versions: +Python 3.3

___
Python tracker 

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



[issue11076] Iterable argparse Namespace

2011-02-10 Thread Virgil Dupras

Virgil Dupras  added the comment:

Here's a documentation-only patch which adds a section about using vars() to 
convert a namespace to a dict.

If this becomes a documentation issue, can we target Python 3.2.1 instead of 
Python 3.3?

--
Added file: http://bugs.python.org/file20734/issue11076_doc_only.diff

___
Python tracker 

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



[issue11175] allow argparse FileType to accept encoding and errors arguments

2011-02-10 Thread Steven Bethard

Steven Bethard  added the comment:

Probably because the suggestion came from someone thinking about both Python 2 
and 3. But given that this feature request can only target Python 3.3, you're 
absolutely right that there's no need to go through the codecs module.

--

___
Python tracker 

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



[issue5833] readline update

2011-02-10 Thread J. Evans

J. Evans  added the comment:

I have no problem splitting the patch into multiple files.  When I do so, do I 
place them here or open separate tickets for each component?

Or if you guys want to just close out the ticket since the actual bug was 
fixed, I am okay with that too.  We will probably continue to use the patched 
version of tabexpand for our users since the filename expansion is used quite 
heavily.  And since we will not be transitioning to py3k anytime in the next 
several years, we have no issue with what is (or is not) implemented there.

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm. I'm not sure passing a list of platforms is a good idea. People may want 
to write e.g. "'bsd' in platform". Also, there are a lot of platforms we don't 
have access to, so we can't actually maintain a list of platforms.

Also, I really don't like the idea that a missing extension module is a test 
failure. It can be quite annoying to install all build dependencies (why should 
people install tcl/tk if they want to hack on e.g. the logging module?), let's 
not scare people who haven't done so by printing out test failures.

--
keywords:  -easy
nosy: +pitrou

___
Python tracker 

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



[issue11171] Python 2.7.1 does not start when "./configure" is used with "--prefix" != "--exec-prefix"

2011-02-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
assignee:  -> tarek
components: +Distutils, Distutils2 -Installation
nosy: +barry, eric.araujo, tarek
stage:  -> patch review
versions: +Python 3.1, Python 3.2

___
Python tracker 

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



[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Georg Brandl

Georg Brandl  added the comment:

Victor: I don't see an API change here.  A ValueError is raised in both cases, 
and error messages are not part of the API. (And BTW, you may call me Georg.)

Senthil: I'd like the documentation change to be a bit more explicit that a 
string is always returned.  Since the string must be encoded, it would also be 
helpful to mention which encoding to use.

The new exception message looks slightly incorrect to me: the argument can also 
be an iterable of bytes.

--

___
Python tracker 

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



[issue11173] Undocumented public APIs in Python 3.2

2011-02-10 Thread Georg Brandl

Georg Brandl  added the comment:

In fact, most of the functions are documented.  (Mark S. apparently referred to 
the "What's new" document when talking about "documented" functions.)

Missing are:

PyAST_CompileEx (because PyAST_Compile wasn't documented either)
PyStructSequence_*
PyType_FromSpec

and the PyThread one which Antoine already mentioned.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue7284] optparse - display version in usage by default

2011-02-10 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi, optparse is now deprecated, and argparse is the replacement, so I'm closing 
this report.

--
nosy: +sandro.tosi
resolution:  -> wont fix
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue4297] Add error_log attribute to optparse.OptionParser

2011-02-10 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Daniel, did you read Steven suggestions? are you willing to propose a patch 
about your feature request against argparse (optparse is deprecated and no more 
under development in stdlib)?

--
nosy: +sandro.tosi

___
Python tracker 

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



[issue1704474] optparse tests fail under Jython

2011-02-10 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi, since optparse is now deprecated (in favor of argparse) and in a year and 
half there was not progress on this, I'm closing this report.

--
nosy: +sandro.tosi
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

So os.name is also supported. But the point is that if a platform wants to be 
considered supported then they need to give us a patch to update the tests to 
make them acceptable to skip.

As for test_ttk and such, those that have a third-party dependency are still 
optional no matter what. This change is **only** for modules we expect to 
always build on certain platfoms (e.g., winreg under Windows or crypt on UNIX 
systems). I mean do we really think ctypes is optional at this point? In 
general no, only on select platforms where libffi support is lacking. So having 
the test skip because of a build failure under OS X (like I had for LLVM 2.8 
for a while) should not be left behind but instead be considered a failure as 
ctypes is **supposed** to be supported under darwin. Extension build failure 
should not always be considered a non-failure.

--

___
Python tracker 

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



[issue11177] Set asyncore create_socket default argument

2011-02-10 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' :

At the current state asyncore implicitly supports TCP (SOCK_STREAM) sockets 
only, despite UDP support might be added in the future.
For simplicity, create_socket() should assume TCP/IP by default.
This would avoid the user to "import socket" and specify the two constants 
every time, which is annoying.

--
files: asyncore_create_socket.patch
keywords: patch
messages: 128327
nosy: giampaolo.rodola
priority: normal
severity: normal
status: open
title: Set asyncore create_socket default argument
versions: Python 3.3
Added file: http://bugs.python.org/file20735/asyncore_create_socket.patch

___
Python tracker 

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



[issue11177] Set asyncore create_socket default argument

2011-02-10 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

I should also mention that if the idea of whitelisting failures
doesn't fly, it can always be changed to be a blacklist of failures
(i.e., ditch 'optional' and only use 'required_on'). But I did it this
way to force people to clearly state on what platforms a test was
expected to be skipped on reactively instead of letting the list
slowly degrade as it already has (bunch of stuff inconsistently listed
in regrtest as it is).

On Thu, Feb 10, 2011 at 10:20, Brett Cannon  wrote:
>
> Brett Cannon  added the comment:
>
> So os.name is also supported. But the point is that if a platform wants to be 
> considered supported then they need to give us a patch to update the tests to 
> make them acceptable to skip.
>
> As for test_ttk and such, those that have a third-party dependency are still 
> optional no matter what. This change is **only** for modules we expect to 
> always build on certain platfoms (e.g., winreg under Windows or crypt on UNIX 
> systems). I mean do we really think ctypes is optional at this point? In 
> general no, only on select platforms where libffi support is lacking. So 
> having the test skip because of a build failure under OS X (like I had for 
> LLVM 2.8 for a while) should not be left behind but instead be considered a 
> failure as ctypes is **supposed** to be supported under darwin. Extension 
> build failure should not always be considered a non-failure.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-02-10 Thread Dave Malcolm

Dave Malcolm  added the comment:

I spent some time bisecting the SVN history in the py3k branch, and believe 
that r84914 is the commit that introduced this issue.

Details:
  
  Trying on 4-core i386 RHEL 5 box
  $ svn up -r REV
  $ make clean ; make
  (configured --with-pydebug)

Reproducer:

  ./python -c "import multiprocessing.managers ; mpp = multiprocessing.Pool(4); 
sm = multiprocessing.managers.SyncManager(); sm.start()"

  (running it 3 times; each time, at each build I see it either successfully 
completing 3 times, or having the Py_FatalError 3 times)

Bisecting:
  r86720: CRASHES with r86729 --with-pydebug (from when I was investigating 
this before)
  r73573: Runs OK with r73573 --with-pydebug (r73573 was origin for 3.1 tag)

=> somewhere in 73572..86729

  r76195: Runs OK with r76195 --with-pydebug (r76195 added the new GIL)

=> somewhere in 76195..86729

  r80724: Runs OK with r80724 --with-pydebug (changed threading code to "Make 
(most of) Python's tests pass under Thread Sanitizer.")

=> somewhere in 80724..86729

  r83722: Runs OK with r80724 --with-pydebug (touched multiprocessing)

=> somewhere in 83722..86729

  r85222: CRASHES with r85222 --with-pydebug (rough midpoint)

=> somewhere in 83722..85222

  r84472: Runs OK with r84472 --with-pydebug (arbitrary midpoint)

=> somewhere in 84472..85222

  r84847: Runs OK with r84847 --with-pydebug (arbitrary midpoint)

 => somewhere in 84847..85222

  r85033: CRASHES with r85033 --with-pydebug (arbitrary midpoint)

 => somewhere in 84847..85033

  r84938: CRASHES with r84938 --with-pydebug (arbitrary midpoint)

 => somewhere in 84847..84938

  r84892: Runs OK with r84892 --with-pydebug (arbitrary midpoint)

 => somewhere in 84892..84938

  r84915: CRASHES with r84915 --with-pydebug (arbitrary midpoint)

 => somewhere in 84892..84915

  r84903: Runs OK with r84903 --with-pydebug (arbitrary midpoint)

 => somewhere in 84903..84915

  r84914: CRASHES with r84914 --with-pydebug (affects threads)

 => somewhere in 84903..84914

  r84913: Runs OK with r84913 --with-pydebug (previous commit before 84914)

 => r84914 is the commit that triggered this issue

--

___
Python tracker 

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



[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-02-10 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +krisvale

___
Python tracker 

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



[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-02-10 Thread Dave Malcolm

Dave Malcolm  added the comment:

r84914 was the implementation of issue 9786 (Native TLS support for pthreads)

--

___
Python tracker 

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



[issue11167] Overflow in unicode_hash

2011-02-10 Thread Stefan Krah

Stefan Krah  added the comment:

Marc-Andre Lemburg  wrote:
> 
> Marc-Andre Lemburg  added the comment:
> 
> Could you try the same in Python 2.7 ?

It's the same, just in stringobject.c. Many hash functions have this issue.

> The overflow is intended (after all, it's a hash function), but we should
> probably add a cast to Py_hash_t to the hash building line in order to make
> the compiler aware of this.

I think I'd just do the hash calculation in unsigned and cast at the end
of the function. For the conversion from unsigned to signed we'd still
rely on implementation defined behavior [1], but at least the signed
integer overflow would be gone.

[1] Mark Dickinson made an effort to document assumptions for unsigned
to signed conversions. I don't know if this has found its way it into
the developer docs:

http://mail.python.org/pipermail/python-dev/2009-December/094388.html

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> As for test_ttk and such, those that have a third-party dependency are
> still optional no matter what. This change is **only** for modules we
> expect to always build on certain platfoms (e.g., winreg under Windows
> or crypt on UNIX systems).

Ah, thanks for pointing that out to me. That's certainly better than
what I thought :)

> I mean do we really think ctypes is optional at this point?

Why wouldn't it be? It doesn't offer any essential functionality, and
most applications and libraries certainly don't depend on it.
It's far more optional than zlib (which a bunch of stdlib functionality
relies on) IMO.

What's more, standard C isn't enough to compile ctypes (as you witnessed
with LLVM). So, really, making absence of ctypes a failure sounds too
severe to me.

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

Well, ctypes failing because it cannot compile is only when a platform that is 
not listed as optional cannot import it. So if some platform does not support 
ctypes then it gets added to the list, end of story.

We only support so many platforms as it is. And with the hg transition, if 
someone maintains a closed-source fork they can easily patch their own version 
of Python so that test_ctypes is skipped without issue w/o causing us to not 
notice when ctypes stops compiling on a platform we do support **and** expect 
it to be available on.

Anyway, I am going to continue to rip out the (un)expected test skip code 
regardless of how people come down on whether this is too strict or not on a 
per-test basis as I still think the expected skip list is worthless as-is. We 
can then discuss this on python-committers (since we have to maintain the test 
compatibility).

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Well, ctypes failing because it cannot compile is only when a platform
> that is not listed as optional cannot import it. So if some platform
> does not support ctypes then it gets added to the list, end of story.

How do you add "llvm under darwin" (or any similar case, e.g. "Sun CC
under Solaris") to that list of platforms?

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

You don't. ctypes failing under LLVM 2.8 should not be a special case of 
skipping; ctypes not building on darwin regardless of whether it is gcc or 
clang is a failure. If someone uses a compiler we don't support, that's their 
decision.

--

___
Python tracker 

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



[issue4681] mmap offset should be off_t instead of ssize_t, and size calculation needs corrected

2011-02-10 Thread wrobell

wrobell  added the comment:

Ross, you are completely right. thanks for the tips!

--

___
Python tracker 

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



[issue11178] Running tests inside a package by module name fails

2011-02-10 Thread Michael Foord

New submission from Michael Foord :

Reported by a user and verified by me with both Python 2.7 and 3.2.

Trying to run tests by module or package name seems to fail.

directory structure:

project root: C:\Users\hpierson\Projects\pytest
\test
__init__.py (empty)
testfoo.py (sample test file

running test package by name - no tests discovered

C:\Users\hpierson\Projects\pytest
PS» cpy C:\Python31\Scripts\unit2.py test

--
Ran 0 tests in 0.000s

 

running test module by name - can't find module

C:\Users\hpierson\Projects\pytest
PS» cpy C:\Python31\Scripts\unit2.py test.testfoo
Traceback (most recent call last):
  File "C:\Python31\Scripts\unit2.py", line 7, in 
main_()
  File "C:\Python31\lib\site-packages\unittest2\main.py", line 237, in main_
main(module=None)
  File "C:\Python31\lib\site-packages\unittest2\main.py", line 94, in __init__
self.parseArgs(argv)
  File "C:\Python31\lib\site-packages\unittest2\main.py", line 149, in parseArgs
self.createTests()
  File "C:\Python31\lib\site-packages\unittest2\main.py", line 158, in 
createTests
self.module)
  File "C:\Python31\lib\site-packages\unittest2\loader.py", line 133, in 
loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
  File "C:\Python31\lib\site-packages\unittest2\loader.py", line 133, in 

suites = [self.loadTestsFromName(name, module) for name in names]
  File "C:\Python31\lib\site-packages\unittest2\loader.py", line 101, in 
loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'testfoo'

--
assignee: michael.foord
components: Library (Lib)
messages: 128337
nosy: michael.foord
priority: normal
severity: normal
status: open
title: Running tests inside a package by module name fails
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

One other option is to simply have a whitelist of platforms that test.support 
knows of so it only considers it a failure when the platform being run on is 
known (regrtest does this already).

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

I should mention this would act as a nice testing doc for exactly which 
platforms CPython considers supported.

--

___
Python tracker 

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



[issue11116] mailbox and email errors

2011-02-10 Thread R. David Murray

R. David Murray  added the comment:

Upon reflection I don't think my suggested email API change is a good one.  
Currently it is possible to create a Message using non-ASCII headers and 
manipulate that message. The fact that you can't serialize that message is, 
really, a bug: one can and I think should assume utf-8 as the default encoding 
when serializing a message.

So rejecting non-ASCII strings in mailbox may also be a questionable decision, 
but since accepting string at all is really a legacy API (one should use a 
Message or a binary string), I think it is OK to leave it.  (Why should one not 
use string for input to mailbox?  Because the reason to use string is to avoid 
going through Message, but if your message includes non-ASCII it would have to 
be processed through the bug-fixed Message anyway to serialize it 
correctly...so you might as well just use Message for input to mailbox).

I hope to have a patch for the mailbox-corruption-if-traceback error soon 
(before the weekend).

--

___
Python tracker 

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



[issue11177] Set asyncore create_socket default argument

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Your "versionchanged" is misleading. It should be something like "family and 
type can now be omitted".

--
components: +Library (Lib)
nosy: +pitrou
stage:  -> patch review
type:  -> feature request

___
Python tracker 

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



[issue11172] Avoid '.' as runpath on AIX

2011-02-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou, sable

___
Python tracker 

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



[issue11169] compileall doesn't support the PEP 383 (undecodable paths/filenames)

2011-02-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Library (Lib)
nosy: +r.david.murray
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue2228] Imaplib speedup patch

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The part which is replaced by that patch (the readline() method in IMAP4_SSL) 
doesn't exist anymore in current imaplib code. Instead the file-like object 
created by socket.makefile() is used; its readline() method is probably quite 
faster than any pure Python implementation.

--
assignee: pierslauder -> 
nosy: +pitrou
resolution:  -> out of date
status: open -> closed
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Changes by Brett Cannon :


Removed file: http://bugs.python.org/file20725/issue10966.diff

___
Python tracker 

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



[issue10517] test_concurrent_futures crashes with "--with-pydebug" on RHEL5 with "Fatal Python error: Invalid thread state for this thread"

2011-02-10 Thread Dave Malcolm

Dave Malcolm  added the comment:

This appears to be happening in a child process when the parent process is 
running:
  Lib/multiprocessing/util.py, line 255, in _exit_function ()

Liberally adding printf() and getpid() calls in various places, seems to always 
happen when parent process is within "call_py_exitfuncs()" within Py_Finalize; 
error is from the child process that was created last.

Using gdb with a breakpoint on "call_py_exitfuncs" and single-stepping seems to 
confirm a single exitfunc:
  Lib/multiprocessing/util.py, line 255, in _exit_function ()
and that the child dies as that bytecode function is executed.

$ ./python -c "import multiprocessing.managers ; mpp = multiprocessing.Pool(4); 
sm = multiprocessing.managers.SyncManager(); sm.start()"
Py_InitializeEx called for PID 27824
posix_fork called by PID 27824
child of posix_fork has PID 27825
posix_fork called by PID 27824
child of posix_fork has PID 27826
posix_fork called by PID 27824
child of posix_fork has PID 27827
posix_fork called by PID 27824
child of posix_fork has PID 27828
posix_fork called by PID 27824
child of posix_fork has PID 27832
Py_Finalize called for PID 27824
wait_for_thread_shutdown() finished for PID 27824
Fatal Python error for PID 27832: Invalid thread state for this thread
call_py_exitfuncs() finished for PID 27824
PyOS_FiniInterrupts() finished for PID 27824
[64240 refs]

--

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Brett Cannon

Brett Cannon  added the comment:

Here is the completed patch. It adds required_on and 'optional' args to 
test.support.import_module() to help delineate if a test should **not** be 
skipped simply because a module could not be imported. It also changes various 
tests to use the new args. Finally, the entire concept of (un)expected skips is 
removed from regrtest.

--
Added file: http://bugs.python.org/file20736/issue10966.diff

___
Python tracker 

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



[issue9523] Improve dbm modules

2011-02-10 Thread Éric Araujo

Éric Araujo  added the comment:

> 1. Make keys(), values(), items() methods return view object for
> ndbm, gdbm and dumb objects. I following the codes in dictobject.c.
Did you have to copy the code?  Isn’t it possible to somehow reuse it?

> The keysview object support len(), "in" operator, and iteratable,
> while valuesview and itemsview object only support len() and iteratable.
That does not seem to comply with the definition of dict views.  Do the views 
yield elements in the same order?  (In a dict, iteration order is undefined but 
consistent between the various views, IIUC.)

> 3. Remove dumb's keys() method which calls self._index.keys() since it is 
> unnecessary.
Does dumb have no keys method then?

> 4. Using more specialized assertXxx methods in test cases.
See my comments on http://codereview.appspot.com/4185044/

> #5736 's patch for adding iteration to ndbm and gdbm modules simple
> calling PyObject_GetIter(dbm_keys(dbm, NULL)) for both gdbm and ndbm,
> but I feel it's better to create a seperate iterator object for gdbm objects.
Okay, so I shall close the other bug report, indicating it’s superseded by your 
patch.

I can’t judge the C code; maybe Raymond or Daniel will.  They’re also experts 
about collections and ABCs, so they’ll be able to confirm or infirm what I’ve 
said about dict views and the registration stuff (on codereview).

--
nosy: +stutzbach

___
Python tracker 

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



[issue11076] Iterable argparse Namespace

2011-02-10 Thread Éric Araujo

Éric Araujo  added the comment:

+1 for this patch.

Documentation fixes are backported from the development branch to stable 
branches, so yes, this will land in 3.1 too.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
type: feature request -> 
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue10423] s/args/options in arpgarse "Upgrading optparse code"

2011-02-10 Thread Sandro Tosi

Sandro Tosi  added the comment:

Hi Steven, I'm not exactly getting what you're meaning here: are you actually 
saying to replace every occurrence of 'option' with 'argument' in the whole 
argparse module doc, or just make it stronger in the mentioned line that what 
was called previously 'option' is now called 'args' ?

PS: wouldn't it be better to use this form "(options, args) = 
parser.parse_args()" instead of "options, args = parser.parse_args()" ? 
optparse doc uses the former, so it should be easy to recognize for those 
willing to migrate to argparse

--
nosy: +sandro.tosi
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue11071] What's New review comments

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

Another remark. In the "poplib" section, there is a paragraph about asyncore: I 
don't see how both are related.

--

___
Python tracker 

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



[issue7997] http://www.python.org/dev/faq/ doesn't seem to explain how to regenerate "configure"

2011-02-10 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: brett.cannon -> 

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2011-02-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The patch works fine on Linux but breaks test_pipes and test_sqlite on
Windows:

[1/1] test_pipes
testBadAppendOptions (test.test_pipes.SimplePipeTests) ... ok
testBadOpenMode (test.test_pipes.SimplePipeTests) ... ok
testBadPrependOptions (test.test_pipes.SimplePipeTests) ... ok
testClone (test.test_pipes.SimplePipeTests) ... ok
testEmptyPipeline1 (test.test_pipes.SimplePipeTests) ... 'cat' is not
recognized
 as an internal or external command,
operable program or batch file.
FAIL
testEmptyPipeline2 (test.test_pipes.SimplePipeTests) ... ok
testEmptyPipeline3 (test.test_pipes.SimplePipeTests) ... ok
testQuoting (test.test_pipes.SimplePipeTests) ... ok
testReadOpenSink (test.test_pipes.SimplePipeTests) ... ok
testRepr (test.test_pipes.SimplePipeTests) ... ok
testSetDebug (test.test_pipes.SimplePipeTests) ... ok
testSimplePipe1 (test.test_pipes.SimplePipeTests) ... 'tr' is not
recognized as
an internal or external command,
operable program or batch file.
FAIL
testSimplePipe2 (test.test_pipes.SimplePipeTests) ... The system cannot
find the
 file specified.
ERROR
testSimplePipe3 (test.test_pipes.SimplePipeTests) ... The system cannot
find the
 file specified.
FAIL
testWriteOpenSource (test.test_pipes.SimplePipeTests) ... ok

==
ERROR: testSimplePipe2 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "Z:\__svn__\lib\test\test_pipes.py", line 34, in testSimplePipe2
with open(TESTFN2) as f:
IOError: [Errno 2] No such file or directory: '@test_560_tmp2'

==
FAIL: testEmptyPipeline1 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "Z:\__svn__\lib\test\test_pipes.py", line 58, in
testEmptyPipeline1
self.assertEqual(f.read(), d)
AssertionError: '' != 'empty pipeline test COPY'
+ empty pipeline test COPY

==
FAIL: testSimplePipe1 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "Z:\__svn__\lib\test\test_pipes.py", line 26, in testSimplePipe1
self.assertEqual(f.read(), 'HELLO WORLD #1')
AssertionError: '' != 'HELLO WORLD #1'
+ HELLO WORLD #1

==
FAIL: testSimplePipe3 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "Z:\__svn__\lib\test\test_pipes.py", line 44, in testSimplePipe3
self.assertEqual(f.read(), 'HELLO WORLD #2')
AssertionError: '' != 'HELLO WORLD #2'
+ HELLO WORLD #2

--
Ran 15 tests in 0.250s

FAILED (failures=3, errors=1)
test test_pipes failed -- multiple errors occurred

test test_sqlite crashed -- : No module named _sqlite3
Traceback (most recent call last):
  File "Z:\__svn__\lib\test\regrtest.py", line 948, in runtest_inner
the_package = __import__(abstest, globals(), locals(), [])
  File "Z:\__svn__\lib\test\test_sqlite.py", line 4, in 
test.support.import_module('_sqlite3', required_on=['win32'])
  File "Z:\__svn__\lib\test\support.py", line 115, in import_module
return importlib.import_module(name)
  File "Z:\__svn__\lib\importlib\__init__.py", line 124, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "Z:\__svn__\lib\importlib\_bootstrap.py", line 822, in _gcd_import
raise ImportError(_ERR_MSG.format(name))
ImportError: No module named _sqlite3

--

___
Python tracker 

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



[issue11071] What's New review comments

2011-02-10 Thread STINNER Victor

STINNER Victor  added the comment:

In the What's new in 3.2: there is no mention of the PEP 3003 (Python Language 
Moratorium). May we add a section "What is not new in 3.2"? :-) This PEP is 
something specific to Python 3.2.

--

___
Python tracker 

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



  1   2   >