[issue9541] node.pre_order() does not do preorder traversal

2010-08-07 Thread Joe Amenta
Joe Amenta added the comment: Fixed in r83811. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue9541> ___ ___ Python-bugs-list mai

[issue9541] node.pre_order() does not do preorder traversal

2010-08-07 Thread Joe Amenta
New submission from Joe Amenta : In Lib/lib2to3/pytree.py, Node.pre_order() calls the post_order() method of its children, instead of pre_order(). As a result, the only difference between the two orderings is that pre_order() yields the original node first, whereas post_order() yields the

[issue7162] 2to3 does not convert __builtins__.file

2010-03-07 Thread Joe Amenta
Joe Amenta added the comment: Yes, the idea was that it doesn't seem outlandish for someone to do: def file(something): do_stuff() You can use lib2to3.fixer_util.is_probably_builtin for this... modified the patch and attached. -- Added file: http://bugs.python.org/file

[issue767645] incorrect os.path.supports_unicode_filenames

2010-01-12 Thread Joe Amenta
Joe Amenta added the comment: If it is decided to keep supports_unicode_filenames, here is a patch for test_os.py that verifies the value of supports_unicode_filenames against the following line from the documentation: "True if arbitrary Unicode strings can be used as file names (w

[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

2009-12-25 Thread Joe Amenta
Joe Amenta added the comment: To elaborate on my last comment: - touch_import looks for the required import binding in any scope, and it will add a global import if not found, otherwise it leaves it alone - the import added does not have a newline prefix, so if the newlines were left in

[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

2009-12-25 Thread Joe Amenta
Joe Amenta added the comment: I believe that this patch works like you described... Attached a patch with more test cases to show this. (the [1:] parts are to make the test cases readable; they will still pass if all the leading newlines are removed from the triple-quoted strings and all [1

[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

2009-12-24 Thread Joe Amenta
Joe Amenta added the comment: One such weird corner case: from collections import Callable class Spam(object): def __call__(self): return self can_of_spam = Spam() print callable(can_of_spam) == isinstance(can_of_spam, Callable) # True del Spam.__call__ can_of_spam.__call__ = lambda

[issue7162] 2to3 does not convert __builtins__.file

2009-10-17 Thread Joe Amenta
Changes by Joe Amenta : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue7162> ___ ___ Python-bugs-list mailing list Unsubscri

[issue7162] 2to3 does not convert __builtins__.file

2009-10-17 Thread Joe Amenta
New submission from Joe Amenta : Step to reproduce: $ echo 'file("/some/file")' | python `which 2to3` - (replace python with whichever python executable version you wish to use, e.g. ~/python-trunk/python or /usr/local/bin/python3.2 ) Expected result: Anything referring

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Joe Amenta added the comment: Missed a paren in the last one... re-uploading it. -- Added file: http://bugs.python.org/file15062/fix_idioms.patch ___ Python tracker <http://bugs.python.org/issue3

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Changes by Joe Amenta : Removed file: http://bugs.python.org/file15061/fix_idioms.patch ___ Python tracker <http://bugs.python.org/issue3563> ___ ___ Python-bugs-list m

[issue3563] fix_idioms.py generates bad code

2009-10-06 Thread Joe Amenta
Joe Amenta added the comment: Attached a patch that implements more thoroughly what appears to be the intended behavior. -- nosy: +joe.amenta Added file: http://bugs.python.org/file15061/fix_idioms.patch ___ Python tracker <http://bugs.python.

[issue5705] os.getpwent returns unsigned 32bit value, os.setuid refuses it

2009-09-02 Thread Joe Amenta
Changes by Joe Amenta : -- nosy: +joe.amenta ___ Python tracker <http://bugs.python.org/issue5705> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6711] macurl2path has typos that raise AttributeError

2009-08-15 Thread Joe Amenta
New submission from Joe Amenta : In a few spots, "urllib.parse" misses a "." after the package name. e.g., "urllib.parse.quote" is spelled "urllib.parsequote", which generates an AttributeError when run. To reproduce, open up a python3.x interpre

[issue6583] 2to3 fails to fix test.test_support

2009-07-26 Thread Joe Amenta
New submission from Joe Amenta : PEP 3108 states that test.test_support was renamed to test.support as a part of the Standard Library Reorganization process. However... 2to3 does not refactor (or even warn about) test.test_support. Simply adding "test.test_support": "test.sup

[issue6185] 2to3 misses buffer slicing

2009-06-02 Thread Joe Amenta
Joe Amenta added the comment: Patch that will fix the problem (and make the test pass) -- Added file: http://bugs.python.org/file14165/bufferfix.patch ___ Python tracker <http://bugs.python.org/issue6

[issue6185] 2to3 misses buffer slicing

2009-06-02 Thread Joe Amenta
New submission from Joe Amenta : Found this bug while writing the backwards version of this fix for 3to2... there is no test for it, so it went undetected. The PATTERN does not match a buffer() invocation if there is a token after the rparen, i.e. slicing. -- components: 2to3 (2.x to

[issue6174] What's new in 2.6, wrong indentation in code sample

2009-06-01 Thread Joe Amenta
New submission from Joe Amenta : In the final example in the multiprocessing package on http://docs.python.org/3.0/whatsnew/2.6.html#pep-371-the-multiprocessing-package a part of the code is not properly indented. There should be one more level of indentation starting at "#Mark pool as c

[issue6070] Pyhon 2.6 makes .pyc/.pyo bytecode files executable

2009-05-22 Thread Joe Amenta
Joe Amenta added the comment: Python writes compiled files with the same file permissions as the source module. In your specific example: $ python2.6 -c 'import module' This will produce module.pyc with the same attributes as module.py While I am not familiar with modifying C st

[issue6050] zipfile: Extracting a directory that already exists generates an OSError

2009-05-17 Thread Joe Amenta
New submission from Joe Amenta : zipfile.ZipFile.extract() fails if targetpath is a directory that already exists. Bug revealed itself on Ubuntu, using extractall(). Happened on the latest 3.1 and 2.7. Attached a patch that I think will fix this issue. -- components: Library (Lib