[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread Matthias Klose

New submission from Matthias Klose :

when building without an hg repository present, the build fails with:

./Parser/asdl_c.py -h ../Include ../Parser/Python.asdl
Traceback (most recent call last):
  File "../Parser/asdl_c.py", line 1214, in 
main(args[0])
  File "../Parser/asdl_c.py", line 1158, in main
mod.version = get_file_revision(srcfile)
  File "../Parser/asdl_c.py", line 1142, in get_file_revision
p = subprocess.Popen(args, stdout=subprocess.PIPE)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [../Include/Python-ast.h] Error 1

--
components: Build
messages: 136591
nosy: doko
priority: normal
severity: normal
status: open
title: Parser/asdl_c.py relies on mercurial repository revision
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



[issue6717] Some problem with recursion handling

2011-05-23 Thread Peter Wentworth

Changes by Peter Wentworth :


Removed file: http://bugs.python.org/file22072/drag_bug_is_nesting_events.py

___
Python tracker 

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



[issue6717] Some problem with recursion handling

2011-05-23 Thread Peter Wentworth

Peter Wentworth  added the comment:

Oops, I wish I hadn't asked that silly question about the global declaration!

Here is the tweaked file...

--
Added file: http://bugs.python.org/file22073/drag_bug_is_nesting_events.py

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Ruslan Mstoi  added the comment:

Uploading patch updated according to the review comments.

--
Added file: http://bugs.python.org/file22074/issue12009_patch3.diff

___
Python tracker 

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



[issue12153] Modules/faulthandler.c exports `stack_overflow' symbol

2011-05-23 Thread Matthias Klose

New submission from Matthias Klose :

the exported symbol should either have a prefix, or defined static.

--
components: Extension Modules
messages: 136594
nosy: doko
priority: normal
severity: normal
status: open
title: Modules/faulthandler.c exports `stack_overflow' symbol
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



[issue6560] socket sendmsg(), recvmsg() methods

2011-05-23 Thread Gergely Kálmán

Gergely Kálmán  added the comment:

On 05/22/11 03:14, Brian May wrote:
> Brian May  added the comment:
>
> What needs to happen to get recvmsg() supported in Python?
>
> recvmsg() is required to get get transparent UDP proxies working under Linux 
> using tproxy, the code needs to run recvmsg() to be able to find out what the 
> original destination address was for the the packet.
>
> Thanks
>
> Brian May
>
> --
> nosy: +brian
>
> ___
> Python tracker
> 
> ___

Hello Brian!

It's been a while I had a look at that code. As far as I remember though 
the code is fairly decent not
taking the missing unit tests into account. There are a few todos, and 
also a pretty bad bug that I've fixed
but not committed. The TODOs include better parsing of auxiliary data, 
support for scatter-gather, addressed
messages. If you wish I can send you the latest patch that has the bug 
fixed and applies to 3.2. Do you want
this to be pushed to 3.3?

Gergely Kalman

--

___
Python tracker 

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



[issue12154] PyDoc Partial Functions

2011-05-23 Thread JJeffries

New submission from JJeffries :

PyDoc currently does not support partial functions. It currently just outputs 
the following, treating it as a data member instead of a function.

my_partial_function = 

I think that if the __doc__ it should be treated as a function and the __doc__ 
read.

--
components: Library (Lib)
messages: 136596
nosy: JJeffries
priority: normal
severity: normal
status: open
title: PyDoc Partial Functions
type: feature request
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



[issue12151] test_logging fails sometimes

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Victor, you just did what a recent discussion on python-dev strongly 
recommended not to do: you used ambiguous present tense in your commit message. 
 “test_logging writes debug messages to stderr, not stdout” does not say 
whether it is the buggy behavior (unambiguous example for that: “test_logging 
used to write debug messages to stderr, not stdout”) or the new, fixed behavior 
(“test_logging now writes debug messages to stderr, not stdout”).  You should 
use unambiguous phrasing like “make X do Y”, “fix Y with Z”, “don’t W when Z”.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Added file: http://bugs.python.org/file22075/issue12009_patch4.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Removed file: http://bugs.python.org/file22013/issue12009_patch.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Removed file: http://bugs.python.org/file22019/issue12009_patch2.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Removed file: http://bugs.python.org/file22074/issue12009_patch3.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

+1 to that last patch, modulo removal of an unnecessary docstring on one test 
method (IIRC the test runner would display it in verbose mode and that would 
not be useful output; the test speaks for itself, only a comment with this bug 
number is maybe missing).  Ruslan, you don’t have to edit the patch, David will 
do it before commit if he wants to.  Thanks for your contribution.

--

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Added file: http://bugs.python.org/file22076/issue12009_patch.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Changes by Ruslan Mstoi :


Removed file: http://bugs.python.org/file22075/issue12009_patch4.diff

___
Python tracker 

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



[issue12009] netrc module crashes if netrc file has comment lines

2011-05-23 Thread Ruslan Mstoi

Ruslan Mstoi  added the comment:

Thanks for helping with cleaning up the patch. I already removed that docstring 
too.

--

___
Python tracker 

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



[issue12154] PyDoc Partial Functions

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report.  pydoc recently gained ad-hoc support for named tuples, 
so it could be improved to treat partial objects as functions.  Would you like 
to submit a patch?  If so, guidelines are on http://docs.python.org/devguide

--
nosy: +eric.araujo, rhettinger
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



[issue12153] Modules/faulthandler.c exports `stack_overflow' symbol

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee:  -> haypo
nosy: +haypo

___
Python tracker 

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



[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue12155] queue example doesn't stop worker threads

2011-05-23 Thread STINNER Victor

New submission from STINNER Victor :

The queue doc contains the following example:
--
def worker():
while True:
item = q.get()
do_work(item)
q.task_done()

q = Queue()
for i in range(num_worker_threads):
 t = Thread(target=worker)
 t.daemon = True
 t.start()

for item in source():
q.put(item)

q.join()   # block until all tasks are done
--
http://docs.python.org/library/queue.html

It doesn't define do_work(), num_worker_threads or do_work(), but my concern is 
that it doesn't stop worker threads.

I consider "t.daemon = True" as an hack to not care about stopping threads.

The example should pass a special value to each worker to stop it. For example:



while True:
  job = queue.get()
  if job is None:
 break
  audio.play(*job)
  queue.task_done()

Main thread:

...
threads = []
for i in range(num_worker_threads):
 t = Thread(target=worker)
 threads.append(t)
 t.start()
...
for i in range(num_worker_threads):
 queue.put(None)
queue.join()
for thread in threads:
thread.join()

--
assignee: docs@python
components: Documentation
messages: 136601
nosy: docs@python, haypo, pitrou
priority: normal
severity: normal
status: open
title: queue example doesn't stop worker threads
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12125] test_sysconfig fails on OpenIndiana because of test_packaging

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Removing 2.6, this is not a security bug.

(OT:
> Could someone please fix support for symlinked packages? It's an
> essential feature during development.
If I correctly guess your use case, you could use a pth file during 
development.  See the docs.)

--
nosy: +eric.araujo
versions:  -Python 2.6

___
Python tracker 

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



[issue12153] Modules/faulthandler.c exports `stack_overflow' symbol

2011-05-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ad1ea4961ead by Victor Stinner in branch 'default':
Close #12153: faulthandler, mark stack_overflow() as static
http://hg.python.org/cpython/rev/ad1ea4961ead

--
nosy: +python-dev
resolution:  -> fixed
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



[issue6727] ImportError when package is symlinked on Windows

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

BTW, does this bug occur only with symlinked packages or also with one-file 
modules?

--

___
Python tracker 

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



[issue12128] Allow an abc.abstractproperty to be overridden by an instance data attribute

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
title: Allow `abc.abstractproperty` to be overridden by a data attribute -> 
Allow an abc.abstractproperty to be overridden by an instance data attribute
versions:  -Python 3.4

___
Python tracker 

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



[issue6727] ImportError when package is symlinked on Windows

2011-05-23 Thread Waldemar Kornewald

Waldemar Kornewald  added the comment:

It was only with symlinked packages/folders. Symlinked files worked correctly 
for me.

BTW, pth files won't work for our specific use-case (App Engine).

--

___
Python tracker 

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



[issue12156] test_multiprocessing

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: haypo
priority: normal
severity: normal
status: open
title: test_multiprocessing

___
Python tracker 

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



[issue12156] test_multiprocessing.test_notify_all() timeout (1 hour) on FreeBSD 7.2

2011-05-23 Thread STINNER Victor

New submission from STINNER Victor :

http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%207.2%203.x/builds/1819/steps/test/logs/stdio

[180/355] test_multiprocessing
Timeout (1:00:00)!
Thread 0x28401d00:
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 354 in _send
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 382 in _send_bytes
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 216 in send
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 104 in dispatch
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 746 in _connect
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 758 in _callmethod
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 986 in acquire
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_multiprocessing.py",
 line 659 in f
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/threading.py", 
line 690 in run
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/threading.py", 
line 737 in _bootstrap_inner
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/threading.py", 
line 710 in _bootstrap

Thread 0x28401040:
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 364 in _recv
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 385 in _recv_bytes
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/connection.py",
 line 260 in recv
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 762 in _callmethod
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/multiprocessing/managers.py",
 line 986 in acquire
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_multiprocessing.py",
 line 738 in test_notify_all
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/case.py", line 
407 in _executeTestPart
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/case.py", line 
462 in run
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/case.py", line 
514 in __call__
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
105 in run
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
67 in __call__
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
105 in run
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
67 in __call__
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
105 in run
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py", line 
67 in __call__
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support.py", 
line 1103 in run
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support.py", 
line 1191 in _run_suite
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support.py", 
line 1217 in run_unittest
  File 
"/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_multiprocessing.py",
 line 2164 in test_main
  File "./Lib/test/regrtest.py", line 1048 in runtest_inner
  File "./Lib/test/regrtest.py", line 842 in runtest
  File "./Lib/test/regrtest.py", line 666 in main
  File "./Lib/test/regrtest.py", line 1623 in 
program finished with exit code 1
elapsedTime=7790.461967

Note: many other tests fail on this buildbot (because of file permissions?) 
which looks to be ill.

--
components: +Library (Lib)
nosy: +charles-francois.natali, pitrou
title: test_multiprocessing -> test_multiprocessing.test_notify_all() timeout 
(1 hour) on FreeBSD 7.2
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



[issue12155] queue example doesn't stop worker threads

2011-05-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset bff9265d677d by Victor Stinner in branch 'default':
Issue #12105: test_posix, add the value of O_CLOEXEC in the error message
http://hg.python.org/cpython/rev/bff9265d677d

--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> or just skip the test on Linux kernels older than 2.6.23

I like this solution, but I don't know how to test that the kernel doesn't 
support O_CLOEXEC. My commit bff9265d677d will tell use the value of O_CLOEXEC 
on the 
"Linux-2.6.22-vs2.2.0.7-gentoo-i686-Intel-R-_Xeon-TM-_CPU_2.80GHz-with-gentoo-2.0.1
 little-endian" buildbot.

--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I like this solution, but I don't know how to test that the kernel
> doesn't support O_CLOEXEC. My commit bff9265d677d will tell use the
> value of O_CLOEXEC on the
> "Linux-2.6.22-vs2.2.0.7-gentoo-i686-Intel-R-_Xeon-TM-_CPU_2.80GHz-with-gentoo-2.0.1
>  little-endian" buildbot.

If O_CLOEXEC is a #defined constant in the glibc, it can't be different
from other kernels.

--

___
Python tracker 

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



[issue12140] Crash upon start up

2011-05-23 Thread Philip Drew

Philip Drew  added the comment:

Reinstalling makes no difference- have tried multiple times

--

___
Python tracker 

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



[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, Linux 2.6.27+ has a SOCK_CLOEXEC option: we may use it (but it should be 
done in another issue). See also #12105.

--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Story of O_CLOEXEC in the GNU libc, by Ulrich Drepper: "Secure File Descriptor 
Handling"
http://udrepper.livejournal.com/20407.html

--

> I could either add some voodoo configure checks to ensure
> that O_CLOEXEC is indeed supported

Hum, if I patch tempfile._mkstemp_inner() to use os.O_CLOEXEC if available, 
whereas this flag has no effect, the function will be less secure on Linux 
2.6.22 (if the GNU libc exposes O_CLOEXEC).

Check O_CLOEXEC is configure is not safe if the host compiling Python uses a 
different kernel that the host running Python (e.g. think of Linux distro: 
Python is compiled on a different computer).

We need maybe a flag to indicate that O_CLOEXEC is supported by the running 
kernel or not. Or maybe a function to check it at least?

--

O_CLOEXEC was added to Ruby and then removed because the flag is sometimes 
ignored:
http://redmine.ruby-lang.org/issues/1291
http://redmine.ruby-lang.org/projects/ruby-19/repository/revisions/31643

"because boron chkbuild test result says, An old linux kernel ignore O_CLOEXEC 
silently instead of return an error. It may lead to bring new security risk. 
So, we have to be pending it until finish to implement proper fallback logic."

--

Read also the discussion about O_CLOEXEC on bugs-findutils mailing list:
"it's not a guarantee that the O_CLOEXEC actually had an effect"

Their patch uses :

static int
fd_is_cloexec (int fd)
{
  const int flags = fcntl (fd, F_GETFD);
  return (flags & FD_CLOEXEC) || (fcntl (fd, F_GETFL) & O_CLOEXEC);
}

static bool
o_cloexec_works (void)
{
  bool result = false;
  int fd = open ("/", O_RDONLY|O_CLOEXEC);
  if (fd >= 0)
{
  result = fd_is_cloexec (fd);
  close (fd);
}
  return result;
}

--

Oh, there is also SOCK_CLOEXEC, which may be useful for #5715.

--

___
Python tracker 

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



[issue4600] __class__ assignment: new-style? heap? == confusing

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
versions: +Python 3.3 -Python 3.0

___
Python tracker 

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



[issue4600] __class__ assignment: new-style? heap? == confusing

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee: docs@python -> 
nosy:  -docs@python

___
Python tracker 

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



[issue12157] join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty

2011-05-23 Thread Gökçen Eraslan

New submission from Gökçen Eraslan :

When I use map method Pool object with an empty list parameter and then call 
close and wait methods, join() method hangs. I think this is not intended.

Code to reproduce the bug is attached. 

PS: A similar issue (using map method with an empty list argument) is reported 
here[1], but it was about the chunksize parameter and it's resolved.

[1] http://bugs.python.org/issue6433

--
components: Library (Lib)
files: multi.py
messages: 136613
nosy: Gökçen.Eraslan, jnoller
priority: normal
severity: normal
status: open
title: join method of multiprocessing Pool object hangs if iterable argument of 
pool.map is empty
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file22077/multi.py

___
Python tracker 

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



[issue10115] Support accept4() for atomic setting of flags at socket creation

2011-05-23 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +charles-francois.natali, haypo

___
Python tracker 

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



[issue8898] The email package should defer to the codecs module for all aliases

2011-05-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

R. David Murray wrote:
> 
> R. David Murray  added the comment:
> 
> euc_jp and euc_kr seem to be backward (that is, codecs translates them to the 
> _ version, instead of translating the _ version to the - version).  I worry 
> that there might be other deviations from the standard email names.  I would 
> suggest we pull the list of preferred MIME names from the IANA charset 
> registry and make a test out of them in the email package.  If changing the 
> name returned by codecs is determined to not be acceptable, then those 
> entries will need to remain in the charset module ALIASES table and the 
> codecs-check logic adjusted accordingly.
> 
> Unfortunately the IANA registry does not list MIME names for all of the 
> charsets in common use, and the canonical names are not always the ones 
> commonly used in email.  Hopefully the codecs registry is using the most 
> common name for those, and hopefully if there are differences it won't break 
> any user code, since any reasonable email code should be coping with the 
> aliases in any case.

The way I understand the patch was that the email package will
start to use the encoding aliases for determining the codec
name instead of its own list. That is: only for decoding the
input data, not for creating a correct MIME encoding name in
output data.

--
title: The email package should defer to the codecs module for all aliases -> 
The email package should defer to the codecs module for   all aliases

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Another idea is to write a best-effort function to open a file with CLOEXEC 
flag:
 * use O_CLOEXEC if available
 * use fcntl(fd, F_SETFD, flags | FD_CLOEXEC) if O_CLOEXEC is missing or was 
silently ignored by the kernel (by open)

Attached open_cloexec.py is an implementation.

--

Usage of "CLOEXEC" in the Python standard library:

- subprocess: create pipe. use pipe2() or pipe()+fcntl(FD_CLOEXEC)
- test_socket: create a socket. use SOCK_CLOEXEC. The test is skipped if the 
kernel is Linux < 2.6.28. It has a nice linux_version() which should be moved 
to the platform module.
- test_posix: check open(O_CLOEXEC).
- test_tempfile: test "cloexec" behaviour using os.spawnl()
- xmlrpclib: use FD_CLOEXEC on the socket

You may also add pipe_cloexec() to os, and socket_cloexec() to socket?

--
Added file: http://bugs.python.org/file22078/open_cloexec.py

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> My commit bff9265d677d will tell use the value of O_CLOEXEC on the
> "Linux-2.6.22-vs2.2.0.7-gentoo-..." buildbot.

Here you have:
"AssertionError: 0 is not true : CLOEXEC flag not set (O_CLOEXEC=0x8)"

It's the same value on my Debian Sid. So we cannot test O_CLOEXEC value, we 
have to check the kernel version.

--

___
Python tracker 

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



[issue8796] Deprecate codecs.open()

2011-05-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

If there are use cases of Stream{Reader,Writer} which are not covered by 
TextIOWrapper, it would be nice to know so that we can improve TextIOWrapper. 
After all, there should be one obvious way to do it ;)

By the way, something interesting (probably unintended):

>>> codecs.open("LICENSE", "r")
<_io.TextIOWrapper name='LICENSE' mode='r' encoding='UTF-8'>
>>> codecs.open("LICENSE", "r", encoding="utf-8")


--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

The real issue is that the libc defines O_CLOEXEC, but kernels prior to 2.6.23 
don't support it: instead of returning EINVAL, the socket syscall silently 
ignores the flag (don't know why I made the comment about this flag being 
defined to 0...).
IMHO this is really a distribution packaging bug (kernel/libc mismatch), and a 
quite serious one.
I don't think we should be fixing this in Python, but that we should merely 
skip this test on kernels older than 2.6.23.
People should complain to their distributions vendors instead (I tested this on 
RHEL4, RHEL6 and Debian Squeeze without problem).

I personally don't like the idea of a best-effort O_CLOEXEC implementation: 
providing a O_CLOEXEC flag which is not atomic feels really wrong to me.

--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> The real issue is that the libc defines O_CLOEXEC, but kernels prior 
> to 2.6.23 don't support it: instead of returning EINVAL, the socket
> syscall silently ignores the flag (don't know why I made the comment
> about this flag being defined to 0...).

This is a kernel bug, not a bug in the GNU libc (ask Ulrich if you are not sure 
;-)). An host can have multiple kernel versions (and choose at boot time using 
GRUB/LILO/...), but it has usually only one C library. You cannot change the 
version of the libc depending on the kernel.

If you really want to fix this problem, you will have to patch kernel < 2.6.23. 
Good luck!

Or we can workaround kernel bugs providing a documentation and/or functions for 
that.

--

___
Python tracker 

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



[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()

2011-05-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Oh, Linux 2.6.27+ has a SOCK_CLOEXEC option:

It's not exactly the same thing.
We want to close the socket right after fork, not wait until exec (in the OP 
case there was no exec).

> Patch looks fine to me. Is it easily testable?

Easily, no.

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread STINNER Victor

New submission from STINNER Victor :

Sometimes, we need to know the version of the Linux kernel. Recent examples: 
test if SOCK_CLOEXEC or O_CLOEXEC are supported by the kernel or not. Linux < 
2.6.23 *silently* ignores O_CLOEXEC flag of open().

linux_version() is already implemented in test_socket, but it looks like 
test_posix does also need it.

Attached patch adds platform.linux_version(). It returns (a, b, c) (integers) 
or None (if not Linux).

It raises an error if the version string cannot be parsed.

--
components: Library (Lib)
files: platform_linux_version.patch
keywords: patch
messages: 136621
nosy: charles-francois.natali, haypo, lemburg, pitrou
priority: normal
severity: normal
status: open
title: platform: add linux_version()
versions: Python 3.3
Added file: http://bugs.python.org/file22079/platform_linux_version.patch

___
Python tracker 

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



[issue12140] Crash upon start up

2011-05-23 Thread Tim Golden

Tim Golden  added the comment:

What happens if you try "python -S" (capital S)? In principle this should 
bypass the need to load site.py. Even if that works we still have a problem to 
solve, but at least it might narrow things down.

--
nosy: +tim.golden

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> test_socket: ...has a nice linux_version() which should be moved to 
> the platform module

I created the issue #12158 for that.

--

___
Python tracker 

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



[issue12105] open() does not able to set flags, such as O_CLOEXEC

2011-05-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

> This is a kernel bug, not a bug in the GNU libc (ask Ulrich if you are not 
> sure ;-)).

Kernels prior to 2.6.23 didn't know about the O_CLOEXEC flag: to catch this 
kind of problem, every syscall would have to check every bit when it's passed a 
combination of flags. This would be clumsy, error-prone and slow.
It's not a libc bug either.
The problem is really a distribution issue: using a libc defining a flag 
unsupported by the kernel is really calling for trouble.

> An host can have multiple kernel versions (and choose at boot time using 
> GRUB/LILO/...)

It's possible, but it's definitely a bad idea, because of such API mismatch. 
For example nothing prevents a syscall from being removed/modified from one 
kernel version to another. If your libc doesn't follow, you're up for trouble.
Try using futexes with a kernel not supporting them :-)

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread Ross Lagerwall

Changes by Ross Lagerwall :


--
nosy: +rosslagerwall

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> New submission from STINNER Victor :
> 
> Sometimes, we need to know the version of the Linux kernel. Recent examples: 
> test if SOCK_CLOEXEC or O_CLOEXEC are supported by the kernel or not. Linux < 
> 2.6.23 *silently* ignores O_CLOEXEC flag of open().
> 
> linux_version() is already implemented in test_socket, but it looks like 
> test_posix does also need it.
> 
> Attached patch adds platform.linux_version(). It returns (a, b, c) (integers) 
> or None (if not Linux).
> 
> It raises an error if the version string cannot be parsed.

The APIs in platform generally try not to raise errors, but instead
return a default value you pass in as parameter in case the
data cannot be fetched from the system.

The returned value should be a version string in a fixed
format, not a tuple. I'd suggest to use _norm_version()
for this.

Please also check whether this works on a few Linux systems.

I've checked it on openSUSE, Ubuntu.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com


2011-06-20: EuroPython 2011, Florence, Italy   28 days to go

::: Try our new mxODBC.Connect Python Database Interface for free ! 

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> The returned value should be a version string in a fixed format,
> not a tuple. I'd suggest to use _norm_version() for this.

How do you compare version strings? I prefer tuples, as sys.version_info, 
because the comparaison is more natural:

>>> '2.6.9' > '2.6.20'
True
>>> (2, 6, 9) > (2, 6, 20)
False

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
>> The returned value should be a version string in a fixed format,
>> not a tuple. I'd suggest to use _norm_version() for this.
> 
> How do you compare version strings? I prefer tuples, as sys.version_info, 
> because the comparaison is more natural:
> 
 '2.6.9' > '2.6.20'
> True
 (2, 6, 9) > (2, 6, 20)
> False

The APIs are mostly used for creating textual representations
of system information, hence the use of strings.

You can add an additional linux_version_info() API if you want to
have tuples.

--

___
Python tracker 

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



[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread R. David Murray

R. David Murray  added the comment:

asdl_c.py should not be run during a non-checkout build, since the files it 
builds should already have been (re)built and checked in by the time a release 
is rolled.  IIUC The release building script is supposed to ensure the 
timestamps of the files are such that it won't be called.  What source are you 
doing the non-checkout build from?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue10224] Build 3.x documentation using python3.x

2011-05-23 Thread Sye van der Veen

Sye van der Veen  added the comment:

I ran smack into this while setting up my Doc build for the first time.  In 
trying to fix my build problems, it took me about an hour to find that this was 
a known issue.

I've attached a patch to warn others of the issue, in the documentation and the 
build itself.  Also, I've updated the version of Sphinx in building.rst, and 
made a note reminding others to do the same. I've only tested this patch on 
Windows 7.

--
keywords: +patch
nosy: +syeberman
Added file: http://bugs.python.org/file22080/Issue10224Warnings.patch

___
Python tracker 

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



[issue12151] test_logging fails sometimes

2011-05-23 Thread R. David Murray

R. David Murray  added the comment:

Here's another (unrelated?) failure:

http://www.python.org/dev/buildbot/all/builders/x86%20Gentoo%203.x/builds/173/steps/test/logs/stdio

[ 43/355] test_logging

Traceback (most recent call last):
  File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/socketserver.py", line 
582, in process_request_thread
self.finish_request(request, client_address)
  File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/socketserver.py", line 
323, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/socketserver.py", line 
641, in __init__
self.finish()
  File "/var/lib/buildslave/3.x.murray-gentoo/build/Lib/socketserver.py", line 
713, in finish
self.socket.sendto(self.wfile.getvalue(), self.client_address)
socket.error: [Errno 9] Bad file descriptor
test test_logging failed -- multiple errors occurred; run in verbose mode for 
details

--
nosy: +r.david.murray

___
Python tracker 

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



[issue1625] bz2.BZ2File doesn't support multiple streams

2011-05-23 Thread Nir Aides

Changes by Nir Aides :


--
assignee: niemeyer -> nirai

___
Python tracker 

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



[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Indeed, Include/Python-ast.c and Python/Python-ast.c should be touched to avoid 
this.

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Use "%s.%s.%s" % linux_version() if you would like to format the version. The 
format is well defined. (You should only do that under Linux.)

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
> Use "%s.%s.%s" % linux_version() if you would like to format the version. The 
> format is well defined. (You should only do that under Linux.)

No, please follow the API conventions in that module and use a string.

You can then use linux_version().split('.') in code that want to
do version comparisons.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com


2011-06-20: EuroPython 2011, Florence, Italy   28 days to go

::: Try our new mxODBC.Connect Python Database Interface for free ! 

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

--

___
Python tracker 

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



[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread Matthias Klose

Matthias Klose  added the comment:

I'm building a snapshot package on a buildd, where a checkout is used (without 
the .hg directory). buildds don't have access to the network, and I don't want 
to package the .hg directory. So I assume I have to create a "release" tarball 
on my own, and build from that one. iirc I didn't see this behaviour with 
python3.2 when building pre alpha snapshot packages.

--

___
Python tracker 

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



[issue12152] Parser/asdl_c.py relies on mercurial repository revision

2011-05-23 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It's true that Python use to be the only dependency for asdl_c.py, but now 
Mercurial is, too.

--

___
Python tracker 

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



[issue8898] The email package should defer to the codecs module for all aliases

2011-05-23 Thread R. David Murray

R. David Murray  added the comment:

Well, it turns out that back when I opened this issue I misunderstood what the 
ALIASES table was used for.  it *is* used before doing a codecs lookup, but it 
is also used to convert whatever charset name the programmer specifies into the 
standard MIME name for the codec when generating emails.

Clearly the email module needs to base its transformation on the IANA table.  I 
think the ideal would be to have a program that pulls the IANA table and 
generates the ALIASES table.  On the other hand, codecs should already have all 
of those aliases (this theoretical program could be used to ensure that), so 
another alternative is to use codecs to look up the "python canonical" name for 
the charset, and have the email ALIASES table just map the ones where that 
isn't the preferred MIME name into the MIME name.

--

___
Python tracker 

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



[issue10224] Build 3.x documentation using python3.x

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

I don’t see how the comment “As such, you will need to specify PYTHON 
explicitly” logically follows from the fact that Python 2.x is required.  IMO, 
building the docs require Python 2.x, so you’ll need a “python” executable on 
your PATH that is 2.x.

--

___
Python tracker 

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



[issue12158] platform: add linux_version()

2011-05-23 Thread Charles-François Natali

Charles-François Natali  added the comment:

Do we really need to expose a such Linux-centric and sparingly used
function to the platform module?
Since it's needed by several tests, why not add it to Lib/test/support.py?
That way, we could also make it return a tuple without breaking any
existing convention.

--

___
Python tracker 

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



[issue11729] libffi assembler relocation check is not robust, fails with clang

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

See also #12081.

--
nosy: +eric.araujo

___
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-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

> hasattr(transaction, '__exit__')

http://docs.python.org/dev/reference/datamodel#special-method-names explains 
that magic methods are looked up on the class, not on the instances.  There’s a 
lot of code out there that erroneously checks for __len__ or __call__ on 
instances, and this is the second time to my knowledge that a project abused a 
module-level __enter__ function.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12134] json.dump much slower than dumps

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

I believe Antoine is saying “works as intended”, i.e. not a bug.  I’m not sure 
it’s worth a doc change.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12154] PyDoc Partial Functions

2011-05-23 Thread JJeffries

JJeffries  added the comment:

I have written and tested a patch based on 2.7.1 src distribution (only src I 
have access to at work). I will get the latest code from the repository and 
test against that later.

--

___
Python tracker 

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



[issue12148] Clarify "or-ing together" doctest option flags

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

As a non-native speaker, I found constructs such as “OR-ed” or “syncing” a bit 
non-obvious when I started reading docs.  +1 on adding “bitwise”, +1 on 
changing to “combined with the | operator”.  (Yes, this is an or-ed vote.)

--
nosy: +eric.araujo
versions: +Python 3.1

___
Python tracker 

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



[issue12159] Integer Overflow in __len__

2011-05-23 Thread Peter Fankhaenel

New submission from Peter Fankhaenel :

An OverflowError is emitted in case the return value of __len__
exceeds 2**31-1.

The following code:

class C (object):
def __len__ (self):
   return self.l

c = C()
c.l = 2**31

len (c)

# leads to an OverflowError in the last line. It works flawless for

c.__len__ ()

--
components: Windows
messages: 136644
nosy: peter.fankhaenel
priority: normal
severity: normal
status: open
title: Integer Overflow in __len__
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue12159] Integer Overflow in __len__

2011-05-23 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Yep, len() has to return something less than sys.maxsize.

--
nosy: +benjamin.peterson
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue12159] Integer Overflow in __len__

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

len(obj) is implemented using PyObject_Size() which is stores the result into a 
Py_ssize_t, and so is limited to sys.maxsize (2**31-1 or 2**63-1).

This implementation detail should be documented.

--
nosy: +haypo

___
Python tracker 

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

I find it strange that you propose to make a function public and remove its doc 
:)  Is a negative missing in the bug title?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12086] Tutorial doesn't discourage name mangling

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue12028] threading._get_ident(): remove it in the doc or make it public

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


--
title: threading._get_ident(): remove it in the doc and make it public -> 
threading._get_ident(): remove it in the doc or make it public

___
Python tracker 

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



[issue12101] PEPs should have consecutive revision numbers

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

IOW, invalid?

--
components: +None -Devguide
nosy: +eric.araujo

___
Python tracker 

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



[issue8796] Deprecate codecs.open()

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

deprecate_codecs.patch: "Deprecate open(), StreamReader, StreamWriter, 
StreamReaderWriter, StreamRecord and EncodedFile() of the codec module. Use the 
builtin open() function or io.TextIOWrapper instead."

EncodedFile() and StreamRecord cannot be replaced easily by open() or 
TextIOWrapper. But do we still need this function? In 2002, Martin von Loewis 
wrote "I never found this class useful."
http://mail.python.org/pipermail/python-dev/2002-August/027491.html

It is maybe no more useful with Python 3 which process all text data as 
Unicode, copy/paste of the mail thread:

> In a well-designed designed application, you should not need to say
> this. The inside world should use Unicode objects.

Agreed, but if you want to port an existing application to
the Unicode world, it sometimes helps.


Deprecated in Python 3.3, the related code will be removed in Python 3.4.

--
keywords: +patch
Added file: http://bugs.python.org/file22081/deprecate_codecs.patch

___
Python tracker 

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



[issue8796] Deprecate codecs.open(), codecs.StreamReader and codecs.StreamWriter

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


--
title: Deprecate codecs.open() -> Deprecate codecs.open(), codecs.StreamReader 
and codecs.StreamWriter

___
Python tracker 

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



[issue8796] Deprecate codecs.open(), codecs.StreamReader and codecs.StreamWriter

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


--
status:  -> open

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Fixed by Tarek in 406ba3cdebcb.

--
resolution: accepted -> fixed
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



[issue12077] Harmonizing descriptor protocol documentation

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue1298835] Add a vendor-packages directory for system-supplied modules

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for detailing the rationale.  Separating the “vendor”-controlled space 
(or let’s call it system; not all OSes have vendors :) from the 
sysadmin-controlled location is indeed a real concern, as shown by the 
recent-ish dist-packages invention by doko for Debian.  Maybe you could get 
more feedback from other Python packagers on the distutils-sig, python-dev or 
distributi...@freedesktop.org mailing list?

--
components: +Distutils2
nosy: +alexis, barry, brett.cannon, carljm, doko, eric.araujo
title: vendor-packages directory. -> Add a vendor-packages directory for 
system-supplied modules
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



[issue12055] doctest not working on nested functions

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
stage:  -> needs patch
versions: +Python 3.1, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue12055] doctest not working on nested functions

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

>From http://docs.python.org/dev/library/doctest#which-docstrings-are-examined :

“The module docstring, and all function, class and method docstrings are 
searched. Objects imported into the module are not searched. [...] Any classes 
found are recursively searched similarly, to test docstrings in their contained 
methods and nested classes.”

The doc does not advertise support for nested functions, so this would be a new 
feature, if deemed useful.

--
nosy: +eric.araujo
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



[issue12158] platform: add linux_version()

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

> You can then use linux_version().split('.') in code that want
> to do version comparisons.

It doesn't give the expected result:

>>> ('2', '6', '9') < ('2', '6', '20')
False
>>> ('2', '6', '9') > ('2', '6', '20')
True

By the way, if you would like to *display* the Linux version, it's better to 
use release() which gives more information:

>>> platform.linux_version()
(2, 6, 38)
>>> platform.release()
'2.6.38-2-amd64'

About the name convention: mac_ver() and win32_ver() do return tuples. If you 
prefer linux_version_tuple(), it's as you want. But return a tuple of strings 
is useless: if you would like a string, use release() and parse the string 
yourself.

Note: "info" suffix is not currently used, whereas there are python_version() 
and python_version_tuple().

> Do we really need to expose a such Linux-centric and sparingly
> used function to the platform module?

The platform module has already 2 functions specific to Linux: 
linux_distribution() and libc_ver(). But if my proposed API doesn't fit 
platform conventions, yeah, we can move the function to test.support.

--

___
Python tracker 

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



[issue12073] regrtest: use faulthandler to dump the tracebacks on SIGUSR1

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Thanks for your review, here is an updated patch.

--
Added file: http://bugs.python.org/file22082/regrtest_sigusr1-3.patch

___
Python tracker 

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



[issue12073] regrtest: use faulthandler to dump the tracebacks on SIGUSR1

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file21995/regrtest_sigusr1.patch

___
Python tracker 

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



[issue12073] regrtest: use faulthandler to dump the tracebacks on SIGUSR1

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file22067/regrtest_sigusr1-2.patch

___
Python tracker 

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



[issue12073] regrtest: use faulthandler to dump the tracebacks on SIGUSR1

2011-05-23 Thread STINNER Victor

STINNER Victor  added the comment:

Merwok's review:
<< Looks like a useful feature.


http://bugs.python.org/review/12073/diff/2659/6441
File Lib/test/regrtest.py (right):

http://bugs.python.org/review/12073/diff/2659/6441#newcode164
Lib/test/regrtest.py:164: You can send a SIGUSR1 signal to display the
traceback of the current threads.
“the traceback” (singular) “of the current threads” (plural) sounds a
bit strange to me: There is one traceback for many threads?

http://bugs.python.org/review/12073/diff/2659/6441#newcode165
Lib/test/regrtest.py:165: But send a signal may interrupt the current
system call and so interfer with
“Note that sending a signal may interrupt a system call in progress and
thus interfere with the tests, so only do it if a test hangs and you
want to know where.”

http://bugs.python.org/review/12073/show >>

--

___
Python tracker 

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



[issue12074] regrtest: display the current number of failures

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

+1 on the idea.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue11957] re.sub confusion between count and flags args

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

I’d favor 1) or 2) over 3).  Ints are short and very commonly used for flags.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12042] What's New multiprocessing example error

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

I’m not sure historical whatsnew documents get fixes.  As long as the PEPs and 
docs get fixes, the whatsnew can stay as they are.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12141] sysconfig.get_config_vars('srcdir') fails in specific cases

2011-05-23 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo
versions:  -Python 3.4

___
Python tracker 

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



[issue12081] Remove distributed copy of libffi

2011-05-23 Thread Matthias Klose

Matthias Klose  added the comment:

iirc after merging 3.0.9, we still had to use the internal libffi bits for 
windows and macosx. I didn't check 3.0.10rc8

--
nosy: +doko

___
Python tracker 

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



[issue12154] PyDoc Partial Functions

2011-05-23 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for your work!  Feel free to post the patch so that it won’t get lost.  
It may be that it ports cleanly or with trivial adaptations to 3.x, I can test 
and report if you don’t want to set up a full devel environment.

--

___
Python tracker 

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



[issue12154] PyDoc Partial Functions

2011-05-23 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



[issue12055] doctest not working on nested functions

2011-05-23 Thread Baptiste Carvello

Baptiste Carvello  added the comment:

Hello,

the attached patch adds the requested feature to 3.2 (the patch is based on 
6d67931c63f9), with appropriate doc changes and tests for the new behaviour.

It does not apply to 2.7, so I'll send another patch for that soon.

--
keywords: +patch
nosy: +baptiste.carvello
type: feature request -> 
versions: +Python 2.6, Python 2.7 -Python 3.3
Added file: http://bugs.python.org/file22083/issue12055-32.diff

___
Python tracker 

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



  1   2   >