Message56969
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 |
|
Date |
User |
Action |
Args |
2007-10-30 18:06:44 | christian.heimes | set | spambayes_score: 0.00363178 -> 0.003631779 recipients:
+ christian.heimes, gvanrossum, nnorwitz, MrJean1 |
2007-10-30 18:06:44 | christian.heimes | link | issue1329 messages |
2007-10-30 18:06:43 | christian.heimes | create | |
|