[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 compatibility.  I think we 
should consider dropping that after this much time, especially for a 
new python version.  Running this code:

from timeit import *
s = """
import heapq
import random
l = [random.random() for i in xrange(1)]
"""

print "heapify", Timer("heapq.heapify(list(l))", s).timeit(100)

s = s + """
heapq.heapify(l)
"""
print "pushpop", Timer("heapq.heappushpop(l,random.random())", s).timeit
(50)


would give 
heapify 0.289102944648
pushpop 0.343299078514
before.  After the patch, we get:
heapify 0.0958507994731
pushpop 0.220800967721

This is "release" code on a snappy windows machine.

--
components: Extension Modules
files: heapq1.patch
keywords: easy, patch, patch
messages: 75224
nosy: krisvale
severity: normal
status: open
title: Remove backwards compatibility in _heapq for performance
type: performance
versions: Python 2.6
Added file: http://bugs.python.org/file11889/heapq1.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[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 effect.  A more typical use of
heaps involves a heap of tuples with the first tuple element being used
as a priority level.  That increases the comparison time and decreases
the relative significance of the dispatch logic.

--
assignee:  -> rhettinger
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

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



[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
pushpop 0.541365033824
replace 2.69348946584
push and pop 3.12545093022

to:

heapify 0.186918030085
pushpop 0.405662172148
replace 1.46039447751
push and pop 1.75253663524

This does look like a large price to pay for this compatibility layer.

___
Python tracker <[EMAIL PROTECTED]>

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



[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 just because
FreeBSD's readline does not have erl_compentry_func_t and Python 2.6
started to use it. When I cp Python-2.5.2/Modules/readline.c
Python-2.6/Modules/readline.c, it built successfully.
Probably this is not a good fix. I would be glad if someone suggests me
a better one.

Lastly, multiprocessing.
First I needed a patch like this to get rid of the warnings.

"""
--- Modules/_multiprocessing/multiprocessing.h.orig Tue Oct 14
14:43:01 2008
+++ Modules/_multiprocessing/multiprocessing.h  Tue Oct 14 14:48:59 2008
@@ -20,7 +20,10 @@
 #  define SEM_VALUE_MAX LONG_MAX
 #else
 #  include  /* O_CREAT and O_EXCL */
+#  include 
 #  include 
+#  include 
+#  include 
 #  include  /* htonl() and ntohl() */
 #  if HAVE_SEM_OPEN
 #include 
"""

With this patch applied, I tried the build again and got the following
error.

"""
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_multiprocessing' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.o
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.c
-o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.o
In file included from
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.c:190:
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h: In
function `connection_new':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h:51:
warning: unknown conversion type character `z' in format
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h: In
function `connection_repr':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/connection.h:401: 
warning:
unknown conversion type character `z' in format
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -DHAVE_SEM_OPEN=1 -DHAVE_FD_TRANSFER=1
-DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing -I.
-I/usr/home/build/dev/Python-2.6/./Include -I. -IInclude -I./Include
-I/usr/local/include -I/usr/home/build/dev/Python-2.6/Include
-I/usr/home/build/dev/Python-2.6 -c
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c -o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.o
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c: In
function `semlock_acquire':
/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.c:314:
warning: implicit declaration of function `sem_timedwait'
gcc -shared
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/multiprocessing.o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/socket_connection.o
build/temp.freebsd-4.11-RELEASE-i386-2.6/usr/home/build/dev/Python-2.6/Modules/_multiprocessing/semaphore.o
-L/usr/local/lib -o
build/lib.freebsd-4.11-RELEASE-i386-2.6/_multiprocessing.so
*** WARNING: renaming "_multiprocessing" since importing it failed:
build/lib.freebsd-4.11-RELEASE-i386-2.6/_multiprocessing.so: Undefined
symbol "sem_timedwait"
"""

Yes, sem_timedwait is not supported on FreeBSD 4.
I would like to find the replacement for that, 
but I'm not sure how I could solve this at this time.

--
components: +Build
keywords: +patch
Added file: http://bugs.python.org/file11890/configure.in.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[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'):
# FreeBSD's P1003.1b semaphore support is very experimental
# and has many known problems. (as of June 2008)
macros = dict(  # FreeBSD
HAVE_SEM_OPEN=0,
HAVE_SEM_TIMEDWAIT=0,
HAVE_FD_TRANSFER=1,
)
libraries = []

--
nosy: +christian.heimes

___
Python tracker <[EMAIL PROTECTED]>

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



[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 multiprocessing
>>> import math
>>> import mmap
>>> import readline
>>>

___
Python tracker <[EMAIL PROTECTED]>

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



[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]>

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



[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 by monkey patching the threading module
of Python 2.4 and 2.5. Other changes are required like using the old
buffer protocol.

--
components: Interpreter Core, Library (Lib)
files: mp_py25_compat.diff
keywords: patch, patch
messages: 75231
nosy: christian.heimes, jnoller, skip.montanaro
priority: low
severity: normal
status: open
title: Make multiprocessing compatible with Python 2.4 and 2.5
type: feature request
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file11891/mp_py25_compat.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[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]>

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



[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]>

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



[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]>

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



[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 the same issues.

--
nosy: +barry
priority:  -> release blocker
versions: +Python 2.7, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[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]>

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



[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: benjamin.peterson
priority: release blocker
severity: normal
status: open
title: from __future__ import unicode_literals, print_function doesn't work
versions: Python 2.6, Python 2.7
Added file: http://bugs.python.org/file11893/fix_multiple_features.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[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 directories on SunOS

___
Python tracker <[EMAIL PROTECTED]>

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



[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 the module-level functions.

Reviewing the code, I have two unrelated remarks:
- METH_NOARGS functions still take two arguments.
- I would drop the double-indirection of the callback list. Instead,
allocate a single block of atexit_callback, and use func==NULL as an
indicator that the block is free.

According to the documentation of the atexit module, it seems clear that
it is a per-interpreter thing.

___
Python tracker <[EMAIL PROTECTED]>

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



[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 is a known issue with Solaris: it allows to call unlink(2) for
directories. This is documented in unlink(2) as

 If the path argument is a directory and the filesystem  sup-
 ports  unlink() and unlinkat() on directories, the directory
 is unlinked from its parent with no cleanup being performed.
 In  UFS,  the  disconnected directory will be found the next
 time the filesystem is checked with fsck(1M).  The  unlink()
 and  unlinkat()  functions  will  not  fail simply because a
 directory is not empty. The user with appropriate privileges
 can orphan a non-empty directory without generating an error
 message.

 If the path argument is a directory and the filesystem  does
 not  support unlink() and unlink() on directories (for exam-
 ple, ZFS), the call will fail with errno set to EPERM.

As os.remove is the same as unlink, and as os.unlink deliberately calls
the system call, this is not a bug in Python.

Closing it as "won't fix, 3rd party".

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed
versions: +3rd party

___
Python tracker <[EMAIL PROTECTED]>

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



[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-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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. The function is cleared
as "static void atexit_callfuncs(void)" so it doesn't get the module
through self. However PyModule_GetDef requires self.

In order to use PEP 3121 we have to add a mechanism to pass the module
instance to atexit_callfuncs().

___
Python tracker <[EMAIL PROTECTED]>

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



[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]>

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



[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]>

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



[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]>

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



[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

___
Python tracker <[EMAIL PROTECTED]>

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



[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_modulestate.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[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]>

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



[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]>

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



[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 standard streams. But I can't
get it to work.

$ rm -f Demo/embed/importexc.o; cd Demo/embed; make; ./importexc; cd ../..
gcc -g -I../../Include -I../..  -c -o importexc.o importexc.c
gcc -Xlinker -export-dynamic importexc.o ../../libpython3.0.a  -lnsl
-ldl -lreadline -ltermcap -lieee -lpthread -lutil -lm -o importexc
Initialize interpreter


Initialize subinterpreter
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/usr/local/lib/python3.0/encodings/__init__.py", line 32, in

ValueError: Cannot encode path item
Aborted

Added file: http://bugs.python.org/file11895/subinterpreter.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[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 /usr/home/build/dev/python-svn.

Anyway, I'll work on this.
Thanks for the support.

___
Python tracker <[EMAIL PROTECTED]>

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



[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://www.python.org/doc/essays/packages.html).

Changing import to put the string in a list is all that is needed to
correct this (although it might break some code relying on the fact that
it has been a string in previous versions).

--
components: Interpreter Core
messages: 75250
nosy: brett.cannon
severity: normal
status: open
title: frozen packages set an improper __path__ value
type: behavior
versions: Python 2.5, Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

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



[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: Library (Lib)
messages: 75251
nosy: brandonbloom
severity: normal
status: open
title: email.LazyImporter does not use absolute imports
type: behavior
versions: Python 2.5.3

___
Python tracker <[EMAIL PROTECTED]>

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