Christian Heimes added the comment:

Guido van Rossum wrote:
> Guido van Rossum added the comment:
> 
> OK, thanks.  The closefd part is good, but the stderrprinter part has a
> problem.  On Linux, in a non-debug build, this has the odd side effect
> of subtracting one from sys.maxunicode.  In a debug build, it dies like
> this: 
> 
> $ ./python -S
> python: Modules/gcmodule.c:336: visit_reachable: Assertion `gc_refs > 0
> || gc_refs == (-3) || gc_refs == (-2)' failed.
> Aborted
> $ 
> 
> If I comment out the PySys_SetObject() call everything seems fine, but I
> suspect that the problem is actually in the creation of the stdprinter
> object.

I may have found the problem. I forgot th remove Py_TPFLAGS_HAVE_GC from
tp_flags. It's a relict from my first implementation.

$ ./python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
  File "/home/heimes/dev/python/py3k/Lib/io.py", line 22, in <module>
    test
NameError: name 'test' is not defined
Aborted

$ vi Lib/io.py

$ ./python -S
Python 3.0a1+ (py3k:58715M, Oct 30 2007, 19:02:47)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
>>> import sys
[33116 refs]
>>> sys.maxunicode
1114111
[33127 refs]
>>>
[33128 refs]
[23233 refs]

$ python2.5 -c "import sys; print sys.maxunicode"
1114111

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1329>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to