[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson <[EMAIL PROTECTED]>: Comparing _heapq with our own legacy C implementation, blue.heapq at CCP, I noticed that ours was somewhat faster. I discovered that a lot of effort is being spent to dynamically search for a __lt__ operator, to provide backwards c

[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: The compatability code was just added in Py2.6 and is needed for apps like Twisted that currently rely on __le__ being tested. In 3.0, the compatability code is removed and full speed is restored. Also, the timing suite exaggerates the ef

[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson <[EMAIL PROTECTED]> added the comment: I am sorry for not doing my research about the age of the compatibility fix. However, modifying the test slightly to work with tuples of (random.random(), random.random()) shows a performance increase from: heapify 0.366187741738 pus

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: Attached patch fixes build problem of math and mmap. Apparently, FreeBSD 4 does not make some math functions available when _XOPEN_SOURCE is defined and unlike newer FreeBSD, it cannot be fixed with __BSD_VISIBLE macro. As for readline, it jus

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: The setup.py file in the root directory doesn't have a special case for freebsd4, just for Free BSD 5 to 8. Apparently FreeBSD doesn't support SEM_TIMEDWAIT at all. elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: Thanks Christian, Now all modules are working. $ ./python Python 2.6 (r26:66714, Oct 14 2008, 15:18:41) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessi

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: No, you still have to create a patch for the readline module. ;) ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Christian Heimes
New submission from Christian Heimes <[EMAIL PROTECTED]>: The patch contains all differences between our multiprocessing backport to 2.4 / 2.5 and the release26-maint branch. The patch should NOT be applied yet. I've created the patch to discuss the differences. Several changes could be avoided

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: I'm adding Martin to the nosy list as well. He is the author of PEP 3121 and he might be able to give more insight in the problem. -- nosy: +loewis ___ Python tracker <[EMAIL PROTECTED]>

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: Here's the one. I tested this patch on FreeBSD 4.11 and 6.3. Both worked. :) Added file: http://bugs.python.org/file11892/Modules_readline.c.diff ___ Python tracker <[EMAIL PROTECTED]>

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Jesse Noller
Jesse Noller <[EMAIL PROTECTED]> added the comment: Are you suggesting we apply this to the 2.6/2.7 branch? ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Can you provide a single patch for all three problems (setup.py, configure.in and readline.c)? An update for Misc/NEWS is greatly appreciated, too. Could you test the patch on the Python 3.0 branch, too? I fear the 3.0 branch suffers from t

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Yes, I like to get as much code into 2.6/2.7 as feasible and viable. ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Benjamin Peterson
New submission from Benjamin Peterson <[EMAIL PROTECTED]>: This is because parser.c's future_hack breaks out of the loop when it finds one feature. Patch with test is attached. -- components: Interpreter Core files: fix_multiple_features.patch keywords: patch messages: 75237 nosy: benjam

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' <[EMAIL PROTECTED]>: Done against a SunOS 5.10 equipped with Python 2.4.4. >>> import os >>> os.mkdir('foo') >>> os.remove('foo') >>> -- messages: 75238 nosy: giampaolo.rodola severity: normal status: open title: os.remove can be used to remove dire

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: It would certainly be possible to produce per-interpreter callback lists through the module state. You declare a per-interpreter structure, add its size into atexitmodule, and refer to it through PyModule_GetDef, passing the self argument of

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: I cannot reproduce the behavior that your trace suggests; instead, I get >>> os.remove("foo") Traceback (most recent call last): File "", line 1, in ? OSError: [Errno 1] Not owner: 'foo' Perhaps you were trying to do this as root? This i

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- nosy: +christian.heimes ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: I'm trying to come up with a patch. It's a little bit trickier than I thought. The atexit module registers "atexit_callfuncs()" with _Py_PyAtExit(). The "atexit_callfuncs()" function is called by Python/pythonrun.c when the interpreter exits

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Giampaolo Rodola'
Giampaolo Rodola' <[EMAIL PROTECTED]> added the comment: I didn't know about such unlink behavior and yes, I was root. Thanks for the precious infos. ___ Python tracker <[EMAIL PROTECTED]>

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Christian Heimes wrote: > However PyModule_GetDef requires self. (I actually meant PyModule_GetState). You can use PyState_FindModule to quickly lookup a module. ___ Python tracker <[EMAIL PROTECTED]>

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Ah, thanks. I'll try PyState_FindModule(). ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Looks fine. As a bonus, you can find out why "unicode_literals" doesn't work when used in an exec'd string -- this is why I didn't upload my fix yet. -- nosy: +georg.brandl resolution: -> accepted

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Can you review the patch, Martin? I've moved the three state variables into a module state struct. The patch also fixes the METH_NOARGS functions. -- keywords: +needs review, patch Added file: http://bugs.python.org/file11894/atexit

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Fixed in r67030. -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Changes by Christian Heimes <[EMAIL PROTECTED]>: -- priority: critical -> release blocker ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3723] Py_NewInterpreter does not work

2008-10-26 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: The patch "subinterpreter.patch" is based on Martin's patch "importexc.diff". The patch contains additional code to setup a preliminary stderr object and a call to initstdio(). Amaury is right. I had to add initstdio() to initialize the stan

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: I will. Would it be enough to test on trunk and py3k branch? By the way, trunk seems to have some problem building now. ./Parser/asdl_c.py -h ./Include ./Parser/Python.asdl env: python: No such file or directory *** Error code 127 Stop in /u

[issue4211] frozen packages set an improper __path__ value

2008-10-26 Thread Brett Cannon
New submission from Brett Cannon <[EMAIL PROTECTED]>: If you import a frozen package (e.g. __phello__), __path__ is set to '__phello__'. But this should be a list as specified by both PEP 302 (http://www.python.org/dev/peps/pep-0302/) and the original doc outlining the package mechanism (http://w

[issue4212] email.LazyImporter does not use absolute imports

2008-10-26 Thread Brandon Bloom
New submission from Brandon Bloom <[EMAIL PROTECTED]>: I have a package with a module called "email". If I try to use the standard email package, it fails to load email.Utils because email.LazyImporter is looking in my email module instead of the top- level email package. -- components