[issue44896] Issue with unparse in ast module

2021-08-11 Thread Kai Xia
New submission from Kai Xia : I was trying to construct an ast object dynamically and I think I can identify some potential issue. With the following snippet: ``` #!/usr/bin/env python3 import ast import sys print(sys.version) good = ast.Assign( targets=[ast.Name(id="hello&

[issue44473] logging.handlers.QueueHandler acts unexpected

2021-06-21 Thread Kai Müller
New submission from Kai Müller : According to the docstring of logging.handlers.QueueHandler "The base implementation formats the record to merge the message and arguments, and removes unpickleable items from the record in-place." But, if a just a log message is used w/o any argu

[issue37427] sorted() and list.sort() don't accept non-boolean objects with __bool__() as `reverse` parameter

2019-06-27 Thread NODA, Kai
New submission from NODA, Kai : class X: def __bool__(self): return True x = [1, 2, 3] x.sort(reverse=X()) print(x) print(sorted([1, 2, 3], reverse=X())) TypeError: an integer is required (got type X) We can always still do x.sort(reverse=bool(X())) print(sorted([1, 2, 3

[issue32971] Docs on unittest.TestCase.assertRaises() should be improved

2018-02-28 Thread NODA, Kai
Change by NODA, Kai : -- title: unittest.TestCase.assertRaises -> Docs on unittest.TestCase.assertRaises() should be improved ___ Python tracker <https://bugs.python.org/issu

[issue32971] unittest.TestCase.assertRaises

2018-02-28 Thread NODA, Kai
New submission from NODA, Kai : https://docs.python.org/dev/library/unittest.html#unittest.TestCase.assertRaises > If only the exception and possibly the msg arguments are given, return a > context manager so that the code under test can be written inline rather than > as a

[issue29702] Error 0x80070003: Failed to launch elevated child process

2017-05-21 Thread Kai Shen
Kai Shen added the comment: when you perform the installation and choose the "Download debugging symbols" or "Download debug binaries", make sure your internet connection is up and available. -- nosy: +Kai Shen ___ P

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2016-09-11 Thread Kai Groner
Kai Groner added the comment: I agree that there isn't a way to know if a header should be added implicitly, until Generator is called. A possible change to the Generator behavior is to generate the header in the serialized output, without modifying the original. I don't know tha

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2016-09-11 Thread Kai Groner
Kai Groner added the comment: >From https://tools.ietf.org/html/rfc2045#section-4 > Note that the MIME-Version header field is required at the top level > of a message. It is not required for each body part of a multipart > entity. It is required for the embedded headers

[issue26391] Specialized sub-classes of Generic never call __init__

2016-02-19 Thread Kai Wohlfahrt
New submission from Kai Wohlfahrt: A specialized sub-class of a generic type never calls __init__ when it is instantiated. See below for an example: from typing import Generic, TypeVar T = TypeVar('T') class Foo(Generic[T]): def __init__(self, value: T): self.value =

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2015-09-25 Thread Kai Groner
Changes by Kai Groner : Added file: http://bugs.python.org/file40578/test_MIME_Version.patch ___ Python tracker <http://bugs.python.org/issue25235> ___ ___ Python-bug

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2015-09-25 Thread Kai Groner
Kai Groner added the comment: Relatedly EmailMessage.make_mixed(), etc don't set MIME-Version on the multipart (it is only set on the part). Additional tests attached. -- Added file: http://bugs.python.org/file40577/test_add_attachment_does_not_add_MIME_Version_in_attachment.

[issue25235] EmailMessage.add_attachment() creates parts with spurious MIME-Version header.

2015-09-25 Thread Kai Groner
New submission from Kai Groner: Because MIMEPart.add_attachment() creates parts using type(self), EmailMessage.add_attachment() creates parts of type EmailMessage. This results in a MIME-Version header being added to parts where it isn't needed. https://tools.ietf.org/html/rfc2045#sect

[issue24669] inspect.getsource() returns the wrong lines for coroutine functions

2015-07-19 Thread Kai Groner
New submission from Kai Groner: inspect.findsource() looks for lines that start with `def`. This patch adds a clause to the regex so lines starting with `async def` will also be recognized. -- keywords: +patch Added file: http://bugs.python.org/file39950/inspect-getsource

[issue24669] inspect.getsource() returns the wrong lines for coroutine functions

2015-07-19 Thread Kai Groner
Changes by Kai Groner : -- components: Library (Lib) nosy: groner priority: normal severity: normal status: open title: inspect.getsource() returns the wrong lines for coroutine functions type: behavior versions: Python 3.5 ___ Python tracker <h

[issue23355] rsplit duplicates split behavior

2015-01-30 Thread kai keliikuli
New submission from kai keliikuli: 'a b'.split() == 'a b'.rsplit() -- messages: 235080 nosy: kai.keliikuli priority: normal severity: normal status: open title: rsplit duplicates split behavior type: behavior versions: Python 2.7 __

[issue15928] Open url with proxy causes TypeError

2012-09-11 Thread zhang kai
zhang kai added the comment: Well, I do have encoded the params, that is not the problem. Also these code did work for most of the time, I don't know why this bug happen so I don't know any details about the problem. Sorry about that. --

[issue15928] Open url with proxy causes TypeError

2012-09-11 Thread zhang kai
New submission from zhang kai: Here is the code which causes this bug: proxy_handler = urllib2.ProxyHandler({'https': proxy}) opener = urllib2.build_opener(proxy_handler) f = opener.open(url+'?'+params) Here are the traceback information: Traceback (most recent call las

[issue15236] SEGFAULT in visit_decref

2012-07-01 Thread Kai Sterker
Kai Sterker added the comment: To compile against a python version that is not system-default, configure with PYTHON=/usr/bin/python2.7 ../adonthell/configure --with-py-cflags=-I/usr/include/python2.7 --with-py-libs=-lpython2.7 Regardless of that, your hints are proving useful. I compiled

[issue15236] SEGFAULT in visit_decref

2012-07-01 Thread Kai Sterker
New submission from Kai Sterker : Since update to Python 2.7.3 (as distributed by Ubuntu 12.04 64bit), I experience occasional crashes in the application I am developing (which uses Python scripting). The crash either happens at the first key press or it does not happen at all. Smells like a

[issue12075] python3.2 memory leak when setting integer key in dictionary

2011-05-15 Thread kai zhu
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

[issue10756] Error in atexit._run_exitfuncs [...] Exception expected for value, str found

2011-05-15 Thread kai zhu
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

[issue12075] python3.2 memory leak when setting integer key in dictionary

2011-05-14 Thread kai zhu
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

[issue11095] subprocess popen broken for bytes and backslash

2011-02-01 Thread kai zhu
Changes by kai zhu : -- components: +IO, Library (Lib) ___ Python tracker <http://bugs.python.org/issue11095> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11095] subprocess popen broken for bytes and backslash

2011-02-01 Thread kai zhu
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

[issue10953] safely eval serialized dict/list data from arbitrary string over web with no side effects

2011-01-19 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-02 Thread kai zhu
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

[issue10802] python3.2 AFTER b2 release has subprocess.Popen broken under colinux/windows

2011-01-01 Thread kai zhu
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

[issue10756] Error in atexit._run_exitfuncs [...] Exception expected for value, str found

2010-12-21 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-12 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-11 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-11 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-11 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
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

[issue10041] socket.makefile(mode = 'r').readline() silently removes carriage return

2010-10-07 Thread kai zhu
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

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2010-08-12 Thread kai zhu
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

[issue7775] str.rpartition(sep) -> (tail, sep, head)

2010-01-25 Thread kai zhu
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

[issue7775] str.rpartition(sep) -> (tail, sep, head)

2010-01-24 Thread kai zhu
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

[issue3555] Regression: nested exceptions crash (Cannot recover from stack overflow)

2009-11-17 Thread kai zhu
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

[issue7338] recursive __attribute__ -> Fatal Python error: Cannot recover from stack overflow.

2009-11-17 Thread kai zhu
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):

[issue6950] online documentation error: PyObject* PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)

2009-09-19 Thread kai zhu
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

[issue6861] bytearray.__new__ doesn't subclass

2009-09-07 Thread kai zhu
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

[issue6239] c_char_p return value returns string, not bytes

2009-08-22 Thread kai zhu
Changes by kai zhu : Added file: http://bugs.python.org/file14769/_asciiporn.h ___ Python tracker <http://bugs.python.org/issue6239> ___ ___ Python-bugs-list mailin

[issue6239] c_char_p return value returns string, not bytes

2009-08-22 Thread kai zhu
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

[issue6239] c_char_p return value returns string, not bytes

2009-08-21 Thread kai zhu
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 $

[issue6504] infinite recursion from calling builtins.open()

2009-07-18 Thread kai zhu
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

[issue6509] re.py - encounter unexpected str-object

2009-07-17 Thread kai zhu
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

[issue6509] re.py - encounter unexpected str-object

2009-07-17 Thread kai zhu
Changes by kai zhu : -- components: +Regular Expressions ___ Python tracker <http://bugs.python.org/issue6509> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6509] re.py - encounter unexpected str-object

2009-07-17 Thread kai zhu
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

[issue6504] infinite recursion from calling builtins.open()

2009-07-17 Thread kai zhu
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

[issue6504] infinite recursion from calling builtins.open()

2009-07-17 Thread kai zhu
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")

[issue6502] documentation error: missing comma between kwonlyargcount & nlocals

2009-07-17 Thread kai zhu
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

[issue4529] parser module failure on valid try/except/finally blocks

2008-12-04 Thread Kai Willadsen
New submission from Kai Willadsen <[EMAIL PROTECTED]>: Using the parser module to create a parse tree succeeds, but a subsequent tuple2ast fails, when parsing valid try/except/finally (and try/except/else/finally) blocks. parser.tuple2ast fails with: parser.ParserError: Illegal num

[issue4360] SystemError when method has both super() & closure

2008-11-20 Thread kai zhu
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

[issue4360] SystemError when method has both super() & closure

2008-11-20 Thread kai zhu
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

[issue4360] SystemError when method has both super() & closure

2008-11-20 Thread kai zhu
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

[issue4360] SystemError when method has both super() & closure

2008-11-20 Thread kai zhu
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

[issue4324] locale documentation is inconsistent

2008-11-14 Thread Kai Willadsen
New submission from Kai Willadsen <[EMAIL PROTECTED]>: The documentation for locale.getlocale is not consistent with the example given. The docs for getlocale([category]) say: "category may be one of the LC_* values except LC_ALL." but the example at the bottom of the documenta

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-24 Thread kai zhu
Changes by kai zhu <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11875/mario.jpg ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-24 Thread kai zhu
Changes by kai zhu <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11874/img2txt.py ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-24 Thread kai zhu
Changes by kai zhu <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11873/img2txt 3dplot screenshot.gif ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-24 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-21 Thread kai zhu
kai zhu <[EMAIL PROTECTED]> added the comment: k ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3238> ___ ___ Python-bugs-list mailing list

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-20 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-20 Thread kai zhu
Changes by kai zhu <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11844/py3to2.py ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-20 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-10-20 Thread kai zhu
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

[issue3692] improper scope in list comprehension, when used in class declaration

2008-08-26 Thread kai zhu
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)

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-07-13 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-07-13 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-07-13 Thread kai zhu
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: "

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-07-09 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-06-30 Thread kai zhu
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

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-06-29 Thread kai zhu
kai zhu <[EMAIL PROTECTED]> added the comment: ok ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3238> ___ ___ Python-bugs-list mailin

[issue3238] backport python 3.0 language functionality to python 2.6 by adding 7 opcodes to ceval.c

2008-06-29 Thread kai zhu
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

[issue3225] backport python 3.0 language functionality to python 2.5 by adding 8 opcodes to ceval.c

2008-06-28 Thread kai zhu
Changes by kai zhu <[EMAIL PROTECTED]>: ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3225> ___ ___ Python-bugs-list mailing list

[issue3225] backport python 3.0 language functionality to python 2.5 by adding 8 opcodes to ceval.c

2008-06-28 Thread kai zhu
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

[issue1369] Reference to Python24 path in Python 2.5 doc

2007-11-01 Thread Kai
New submission from Kai: In the second paragraph under 2.1 Invoking the Interpreter, it says on Windows Python defaults to C:\Python24 . This should be C:\Python25 for the 2.5 guide. The set path= command also needs to be changed to C:\Python25. http://docs.python.org/tut/node4.html

[issue1368] Bug tracker link in about tutorial page is wrong

2007-11-01 Thread Kai
New submission from Kai: http://docs.python.org/tut/about.html has instructions for submitting a bug doc, but it points to the SourceForge tracker. Change the link to point to http://bugs.pythong.org -- components: Documentation messages: 57008 nosy: ksjohnson severity: minor status