kai zhu added the comment:
explicit gc.collect() doesn't seem to fix the leak in my application.
my current fix is to not re-instantiate the class attribute (which cost ~7mb)
during reload & instead reference one created earlier.
i haven't pinpointed y, but i suspect its a corn
kai zhu added the comment:
should this bug b closed? it seems fixed in python3.2 for me.
--
___
Python tracker
<http://bugs.python.org/issue10756>
___
___
Pytho
New submission from kai zhu :
i'm using the latest debian unstable python3.2 build on colinux (2011, may, 14)
## leak.py
## >>> import imp, leak; imp.reload(leak)
## will leak ~2.5mb per reload
## on i386 debian unstable machine (according to top).
## in my real world app (an a
Changes by kai zhu :
--
components: +IO, Library (Lib)
___
Python tracker
<http://bugs.python.org/issue11095>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from kai zhu :
noticed when trying to call grep w/ backslashes in regexp, in shell mode.
same behavior on python2.5 & python3.2
in shell mode:
1. bytes is broken
2. 1st character after backslash is always silently truncated (with exception
of '\\')
$ python3.2
New submission from kai zhu :
rather than serialize python dicts & list to json / xml / protocol buffer for
web use, its more efficient to just serialize w/ repr() & then use eval(), if
only there was a way to guarantee arbitrary code can't b executed.
this is a very simple pr
kai zhu added the comment:
re-tested under old 2.6.26 kernel using previous foo.py example:
1. unpatched python3.2 broken as expected
2. patched python3.2 now works :)
strace confirms ENOSYS being raised from pipe2() in both cases
--
___
Python
kai zhu added the comment:
hi martin, did an strace & the 'not implemented' system call was pipe2()
pipe2 exists in libc (checked w/ ctypes), but is broken for old linux kernels
as mentioned previously.
--
Added file: http://bugs.python.org/file20
kai zhu added the comment:
the culprit was my colinux kernel (2.6.26.8-co-0.7.7.1) did not have pipe2
support (which libc erronenously assumed). updating the kernel fixed the
problem.
the libc issue is partially discussed @
http://www.0x61.com/forum/linux-kernel-f109/popen2-popen-call
kai zhu added the comment:
i used the same almost vanilla configure for both:
$ ./configure --prefix=$USERPATH; make
--
___
Python tracker
<http://bugs.python.org/issue10
kai zhu added the comment:
tested w/ following debug code. looks like greg is correct - HAVE_PIPE2 should
NOT b defined under colinux.
diff -r 6fa1e3b94d8f Modules/_posixsubprocess.c
--- a/Modules/_posixsubprocess.cSat Jan 01 22:18:46 2011 +0100
+++ b/Modules/_posixsubprocess.c
New submission from kai zhu :
i have 2 debian i386 unstable distros.
1) python3.2 (latest hg) running under vps @ linode.com seems ok
2) python3.2 (latest hg) running under colinux (in windows xp) breaks
*NOTE
3) python3.2 (release b2) works fine under colinux
pub...@colinux: python3.2
Python
New submission from kai zhu :
pub...@colinux 3 ~: python3.2
Python 3.2b2 (py3k, Dec 22 2010, 02:38:55)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import atexit; atexit.register(lambd
kai zhu added the comment:
done ;p
added separate unicode read, write, and readwrite test cases (which all pass)
keep in mind my issue is specific to truncation of carriage return (imo a
priority for py3k migration). i think this can b resolved by python 3.2
more general unicode issues
kai zhu added the comment:
updated unittest patch
--
Added file:
http://bugs.python.org/file19195/socket.makefile.with.unittest.v2.patch
___
Python tracker
<http://bugs.python.org/issue10
kai zhu added the comment:
added unittest to patch
tested test.test_socket on debian colinux running under winxp
i get 2 unrelated errors (in both patched and unpatched version) from testRDM
and testStream about socket.AF_TIPC being unsupported:
pub...@colinux 3 ~/build/py3k.patch
kai zhu added the comment:
np antoine :)
this 2 line patch will match socket.makefile() signature with open().
any chance it can b committed b4 python3.2 beta?
i rely on this patch in order to forward-port redis to python3
--
Added file: http://bugs.python.org/file19193
Changes by kai zhu :
--
keywords: +patch
Added file: http://bugs.python.org/file19156/socket.makefile.newline.kwarg.patch
___
Python tracker
<http://bugs.python.org/issue10
kai zhu added the comment:
my bad again, hacking newline parameter to the correct argument position works
(its in the position where error should b).
a one line patch would be:
socket.py
-text = io.TextIOWrapper(buffer, encoding, newline)
+text = io.TextIOWrapper(buffer
kai zhu added the comment:
my bad for not rtfm, but it seems the newline argument has no effect in
socket.makefile.
the TextIOWrapper signatures don't seem to match. a hack to put newline
parameter in 4th position or making it a keyword arg doesn't work either
(scrat
New submission from kai zhu :
i'm working on an independent py2to3 utility which directly imports py2x
modules, by reverse compiling ast trees
(code.google.com/p/asciiporn/source/browse/stable.py)
while forward porting the python2x redis client, this issue came up.
i kno its bad t
kai zhu added the comment:
python 3.1.2 mimetypes initialization also fails in redhat linux:
>>> import http.server
Traceback (most recent call last):
File
"/home/public/i386-redhat-linux-gnu/python/lib/python3.1/http/server.py", line
588, in
class Simpl
kai zhu added the comment:
documentation bug
should be changed to:
"S.rpartition(sep) -> (head, sep, tail)"
>>> help(str.rpartition)
Help on method_descriptor:
rpartition(...)
S.rpartition(sep) -> (tail, sep, head)
Search for the separator sep in S, star
Changes by kai zhu :
--
assignee: georg.brandl
components: Documentation
nosy: georg.brandl, kaizhu
severity: normal
status: open
title: str.rpartition(sep) -> (tail, sep, head)
versions: Python 3.1
___
Python tracker
<http://bugs.pyth
kai zhu added the comment:
just submitted a nearly identical bug (#7338) b4 checking for this one.
so u think it works correctly up to the 2nd N+50 check. can someone
give a reason y we should crash after that instead of throwing a
fallback RuntimeError?
--
nosy: +kaizhu
New submission from kai zhu :
Python 3.1.1 (r311:74480, Sep 13 2009, 17:17:12)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
... def __getattribute__(self, attr):
New submission from kai zhu :
according to bytearrayobject.c, PyByteArray_Resize should return int (not
PyObject *)
error found @
http://docs.python.org/dev/py3k/c-api/bytearray.html
http://docs.python.org/c-api/bytearray.html
--
assignee: georg.brandl
components: Documentation
New submission from kai zhu :
# a00.py
parent = bytearray # fails
# parent = bytes # works
# parent = str # works
class Foo(parent):
def __new__(klass, x): return parent.__new__(klass, x)
Foo(x = None)
$ python3.1 -c "import a00"
Traceback (most recent call last):
Fil
Changes by kai zhu :
Added file: http://bugs.python.org/file14769/_asciiporn.h
___
Python tracker
<http://bugs.python.org/issue6239>
___
___
Python-bugs-list mailin
kai zhu added the comment:
wrote an extension application which relies on the patch (works after
applying patch to python 3.1.1).
it converts png images to colorized ascii-art on ansi-compatible
terminal. requires the patch b/c a ctype function returns a c-string w/
ansi-escape characters
kai zhu added the comment:
i just found this bug independently, but yes its a bug, which i hope
gets fixed for sake of extension community:
// test.c beg
char s[4] = "ab\xff";
char *foo() { return s; }
// test.c end
$ gcc -fPIC -g -c -Wall test.c
$ gcc -shared test.o -o test.so
$
kai zhu added the comment:
current hack-around, then is to pre-import locale, which is verified to
work:
# beg test.py
class importer(object):
def find_module(self, mname, path = None): open("foo.txt")
import sys, locale; sys.meta_path.append(importer)
import collections # no
kai zhu added the comment:
traced culprit to sre_parse.py (where literal is always str):
...
def parse_template(source, pattern):
# parse 're' replacement string into list of literals and
# group references
s = Tokenizer(source)
sget = s.get
p = []
a = p.appe
Changes by kai zhu :
--
components: +Regular Expressions
___
Python tracker
<http://bugs.python.org/issue6509>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from kai zhu :
>>> import re
>>> compiled = re.compile(b"a(\w)")
>>> s = b"aa"
>>> s = compiled.sub(b"a\\1", s)
Traceback (most recent call last):
File "", line 1, in
File ".../lib/python3.1
kai zhu added the comment:
recursion also goes away if we open as raw bytes: open("foo.txt", "rb"). modes
"r+" & "w" also give infinite recursion, while "rb+" & "wb" do not.
note found another bug:
instance method find_modul
New submission from kai zhu :
# copy this to test.py
# > touch foo.txt
# > python3.1 -c "import test; import collections"
# > ...
# > File "test.py", line 5, in find_module
# > def find_module(self, mname, path = None): open("foo.txt")
New submission from kai zhu :
missing comma between kwonlyargcount & nlocals
class code(object)
| code(argcount, kwonlyargcount nlocals, stacksize, flags, codestring,
|constants, names, varnames, filename, name, firstlineno,
|lnotab[, freevars[, cell
kai zhu <[EMAIL PROTECTED]> added the comment:
oops, sorry reprinted the same code ^^;;; ignore previous post, & use
this: (sorry again for mucking up this page)
# super_ok.py
class A(object):
def foo(self):
return super()
# comment the clo
kai zhu <[EMAIL PROTECTED]> added the comment:
same thing, except w/ closure commented out (& everything is happy)
# super_ok.py
class A(object):
def foo(self):
return super()
# comment the closure below
# & SystemError goes away
kai zhu <[EMAIL PROTECTED]> added the comment:
here's a printout of bytecode from script
>>>
>>> s = open("super_closure.py").read()
>>> c = compile(s, "super_closure.py", "exec")
>>> t = py3to2.codetree(c
New submission from kai zhu <[EMAIL PROTECTED]>:
# super_closure.py
class A(object):
def foo(self):
return super()
# remove the closure below
# & SystemError goes away ???
lambda: self
A().foo()
w
Changes by kai zhu <[EMAIL PROTECTED]>:
Added file: http://bugs.python.org/file11875/mario.jpg
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Changes by kai zhu <[EMAIL PROTECTED]>:
Added file: http://bugs.python.org/file11874/img2txt.py
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Changes by kai zhu <[EMAIL PROTECTED]>:
Added file: http://bugs.python.org/file11873/img2txt 3dplot screenshot.gif
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
kai zhu <[EMAIL PROTECTED]> added the comment:
post fyi:
here's moderately complex python-3.0 script (plus curry extension) i
wrote using numpy, PIL, & scipy.weave 2.6 extensions.
it takes a jpeg, gif... image file & outputs it in colorized ascii art.
the actual purpose i
kai zhu <[EMAIL PROTECTED]> added the comment:
k
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3238>
___
___
Python-bugs-list mailing list
kai zhu <[EMAIL PROTECTED]> added the comment:
hi, i'm happy i got a response on this :)
anyway, can u elaborate on the "reason" y something like this was never
done?
yes, i kno the patch is rough right now (& will never get accepted in
its current state), but its no
Changes by kai zhu <[EMAIL PROTECTED]>:
Added file: http://bugs.python.org/file11844/py3to2.py
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Changes by kai zhu <[EMAIL PROTECTED]>:
--
keywords: +patch
Added file: http://bugs.python.org/file11843/ceval.20081020.diff
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
kai zhu <[EMAIL PROTECTED]> added the comment:
ported to python-2.6 & is a bit more stable (written a few py3k programs
w/ it). the patches have been simplified & consolidated to a single
file: ceval.c
u can also test out scripts generated by 2to3 by adding to them the
mag
New submission from kai zhu <[EMAIL PROTECTED]>:
in 3rd line, list comprehension tries to access class_attribute1 as a
global variable (code is valid in python 2.5)
>>> class Foo(object):
... class_attribute1 = 1
... class_attribute2 = [class_attribute1 for x in range(8)
kai zhu <[EMAIL PROTECTED]> added the comment:
then the 2 can complement each other well ;) i don't c any competition
between them as they have completely different objectives
2to3 -> convert 2x scripts to 3k
py3to2 <- use the newly created 3k scripts in existing 2x environ
kai zhu <[EMAIL PROTECTED]> added the comment:
why not? it allows developers to migrate 2.x scripts one-by-one to
working 3.0 conformant ones while maintaining backwards-compatibility w/
existing 2.x scripts & extension modules (eg. numpy, PIL, zope, ...)
py3to2 can transparently im
kai zhu <[EMAIL PROTECTED]> added the comment:
import/reload now works.
accomplished by adding 5 lines in parse_source_module (import.c) to 1st
check for the hook __builtins__.parse_source_module_py3k.
the hook will automatically compile in py3k format if it finds the magic
comment: "
kai zhu <[EMAIL PROTECTED]> added the comment:
update: these 3k language features have been tested to work in python
2.5.2 w/ the backported opcodes
pep3104 Access to Names in Outer Scopes
pep3105 Make print a function
pep3111 Simple input built-in in Python 3000
pep3113 R
kai zhu <[EMAIL PROTECTED]> added the comment:
ideally that may be true.
but its quite frustrating testing/developing new py3k software when many
modules/extensions we take for granted in 2.x isn't available. in the
meantime, this patch serves as a very convenient stopgap for devel
kai zhu <[EMAIL PROTECTED]> added the comment:
ok
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3238>
___
___
Python-bugs-list mailin
New submission from kai zhu <[EMAIL PROTECTED]>:
this patch touches only Python/ceval.c.
1. the only existing thing it modifies is PyEval_EvalFrameEx (adds 7
extra cases for the new 3.0 opcodes, doesn't mess w/ any of the existing
ones, or anything else as a matter of fact)
2. th
Changes by kai zhu <[EMAIL PROTECTED]>:
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3225>
___
___
Python-bugs-list mailing list
New submission from kai zhu <[EMAIL PROTECTED]>:
this patch touches only Python/ceval.c.
1. the only existing thing it modifies is PyEval_EvalFrameEx (adds 8
extra cases for the new 3.0 opcodes, doesn't mess w/ any of the existing
ones, or anything else as a matter of fact)
2. th
61 matches
Mail list logo