This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients MrJean1, christian.heimes, gvanrossum, nnorwitz
Date 2007-10-30.18:06:42
SpamBayes Score 0.003631779
Marked as misclassified No
Message-id <472772AF.7030006@cheimes.de>
In-reply-to <1193764742.0.0.831603326624.issue1329@psf.upfronthosting.co.za>
Content
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
History
Date User Action Args
2007-10-30 18:06:44christian.heimessetspambayes_score: 0.00363178 -> 0.003631779
recipients: + christian.heimes, gvanrossum, nnorwitz, MrJean1
2007-10-30 18:06:44christian.heimeslinkissue1329 messages
2007-10-30 18:06:43christian.heimescreate