[issue7821] Command line option -U not documented

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

This switch is intentionally not documented.

--
nosy: +loewis
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7821
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7821] Command line option -U not documented

2010-01-31 Thread Steven D'Aprano

Steven D'Aprano steve+pyt...@pearwood.info added the comment:

If the switch is intentionally not documented, perhaps it should be removed 
from here:

http://docs.python.org/using/cmdline.html#command-line

where it is listed but not explained anywhere. As it stands now, the 
*existence* of the switch is documented, but not the purpose.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7821
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-01-31 Thread Stefan Behnel

Stefan Behnel sco...@users.sourceforge.net added the comment:

I'll add a couple of comments about the relevant parts of the code that appears 
to trigger the crash.

The code runs through the parse tree and applies transformations to it.

1) For node matching, we use a dispatcher (in Visitor.py) that looks up methods 
for node class names (or the nearest matching class in its MRO hierarchy), e.g. 
a plain Node type would be handled by a visit_Node method, whereas an 
ExprNode(Node) type would match visit_ExprNode if it exists and visit_Node 
otherwise. The handler then recursively calls back into the dispatch code to 
visit its children.

For performance reasons, we sometimes reuse existing methods for this through 
assignment, e.g. instead of reimplementing the default fallback visit_Node 
all over the place, we assign an existing superclass method to it as in 
visit_Node = VisitorTransform.recurse_to_children. This may or may not have 
an impact on this problem (it shouldn't - normally).

So far, all of this appears to work perfectly fine also in Py3. It's the next 
step that seems to be required to trigger the crash.

2) To specify assertions in our test suite, we use an XPath-like language for 
node tests (poor man's Schematron, sort-of). The implementation in TreePath.py 
(based on ElementPath in ElementTree 1.3) makes heavy use of generators to 
traverse the tree. It is used by the TreeAssertVisitor in TestUtils.py, which 
is itself a recursive tree visitor (as described above).

So the situation is as follows. Cython traverses the parse tree recursively, 
several times in a pipeline, dispatching to methods that further recurse into 
the tree. One of the pipeline steps is the tree assertion visitor, which, on 
matching functions, applies the generator-based path language to the tree, that 
tries to find nodes by iterating over a chain of generators.

At some point in this process, somehow, sys.exc_info gets corrupted, and the 
doctest/unittest framework crashes the runtime with a segfault when trying to 
print an exception (raised unexpectedly by the pure test).

I hope this makes it clearer a) what happens and b) why it's not easy to cut 
this down into a simple test case. As the previous comments show, it's already 
hard enough to reproduce it reliably with a reduced test setup.

Please do not hesitate to contact me if you need any further information.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7173
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7733] asyncore docs reference is unclear

2010-01-31 Thread Dirkjan Ochtman

Dirkjan Ochtman dirk...@ochtman.nl added the comment:

Yeah, I'll get to it. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7733
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file

2010-01-31 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I wonder if this is technically a bug. The stream is not opened for reading and 
yet you do an fread. I quickly glanced through the
C-Standard and I did not find an _explicit_ paragraph that this is
undefined behavior, but personally I'd expect it to be.

Regarding the last C example. Also here, you do not open using w+.
Now, even if you used w+, by the standard you'd have to do an fflush,
fseek, fsetpos or rewind before reading. I don't see a libc bug.

--
nosy: +skrah

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5677
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5077] 2to3 fixer for the removal of operator functions

2010-01-31 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Attached an updated patch with:
  (1) The two review issues fixed.
  (2) Merged the functionality of the initial patch into the existing
  fixer in 'Lib/lib2to3/fixes/fix_operator.py' + a little 
  refactoring.
  (3) Added matching test cases.
  (4) Updated the documentation.

--
keywords: +patch
nosy: +minge
Added file: http://bugs.python.org/file16070/issue-5077.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5664] 2to3 wont convert Cookie.Cookie properly

2010-01-31 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

There is already a fixer for this in 'Lib/lib2to3/fixes/fix_imports.py'.  It 
was merged to the trunk in r64286.

--
nosy: +minge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4709] Mingw-w64 and python on windows x64

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I have now tried reproducing the problem, and still failed to. I downloaded, 
from http://sourceforge.net/projects/mingw-w64/files/, the distribution 
mingw-w32-bin_i686-mingw_20100123_sezero.zip.

With this, I get

c:\cygwin\mingw64\bin\gcc.exe -mno-cygwin -shared -s 
build\temp.win-amd64-2.6\Release\w64test.o 
build\temp.win-amd64-2.6\Release\w64test.def -LC:\Python26\libs 
-LC:\Python26\PCbuild\amd64 -lpython26 -lmsvcr90 -o 
build\lib.win-amd64-2.6\w64test.pyd
c:/cygwin/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.3/../../../../x86_64-w64
-mingw32/bin/ld.exe: cannot find -lmsvcr90
collect2: ld returned 1 exit status 

How am I supposed to link with this toolchain? If linking with -lmscvr90 is 
incorrect, what should I use instead? If it is correct, where do I get the 
proper import library from?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4709
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file

2010-01-31 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Bug or not, this can be handled since fread sets EBADF on Windows.

--
keywords: +patch
Added file: http://bugs.python.org/file16071/fileread-errno.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5677
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7817] Pythonw.exe fails to start

2010-01-31 Thread Dan

Dan 10equa...@gmail.com added the comment:

Well now I feel really dumb.  I was under the impression that pythonw.exe was a 
GUI version of python.exe, which I though was console-only since up until now I 
had only tried running it from the command prompt.  Problem solved, thanks for 
your help.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7749] pydoc error - No module named tempfile

2010-01-31 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
resolution:  - duplicate
status: open - closed
superseder:  - pydoc doesn't work from the command line

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7749
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7817] Pythonw.exe fails to start

2010-01-31 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7817
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7328] pydoc doesn't work from the command line

2010-01-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +Merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7328
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file

2010-01-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The patch should come with a test.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5677
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3020] doctest should have lib2to3 integration

2010-01-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +Merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3020
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5616] Distutils 2to3 support doesn't have the doctest_only flag.

2010-01-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +Merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5616
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7822] 2to3 does not convert output lines in doctests

2010-01-31 Thread Éric Araujo

New submission from Éric Araujo mer...@netwok.org:

Howdy

I think there is a bug with 2to3’s doctest conversion:

$ echo  u'éric'  test
$ echo u'éric'  test
$ 2to3 -d test -f unicode
--- test (original)
+++ test (refactored)
@@ -1,3 +1,3 @@
- u'éric'
+ 'éric'
 u'éric'
 
RefactoringTool: Files that need to be modified:
RefactoringTool: test


The output should be converted too.

Tested with 2.6.4+ (Debian’s), 2.7a2+ and 3.2a0.

Kind regards

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 98620
nosy: Merwok
severity: normal
status: open
title: 2to3 does not convert output lines in doctests
versions: Python 2.6, Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7822
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7822] 2to3 does not convert output lines in doctests

2010-01-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

The output line can be anything, so it's impossible for 2to3 to know that it is 
a Python expression that needs to be converted.

--
nosy: +benjamin.peterson
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7822
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

I think the test should be in test_pep263.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7820
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7822] 2to3 does not convert output lines in doctests

2010-01-31 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 to know that it is a Python expression that needs to be converted.

Oh, of course. I have made two assumptions here: output lines are not 
always the repr of a Python object, and the repr is not always a valid 
Python expression.

I’ll have to subclass build_2to3 in my setup script. *groans*

Thank you for answering.

Merwok

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7822
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7671] test_popen fails if path contains special char like ;

2010-01-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

These patches cause the Windows buildbot to fail.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7671
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7671] test_popen fails if path contains special char like ;

2010-01-31 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
nosy: +brian.curtin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7671
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7671] test_popen fails if path contains special char like ;

2010-01-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

These patches cause the Windows buildbot to fail.

--
priority:  - normal

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7671
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7821] Command line option -U not documented

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I don't think changing anything is necessary here. Having the option listed 
gives the curious a chance to discover a piece of Python history :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7821
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7818] Improve set().test_c_api(): don't expect a set(abc), modify the content

2010-01-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 The method was supposed to be for internal use only

I found this bug by fuzzing.

 it may be worthwhile to build-out the test to accept many different possible 
 inputs (...)

Yeah, but I just want to avoid an assertion error :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7818
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7823] multiplying a list of dictionaries

2010-01-31 Thread Andrew Hays

New submission from Andrew Hays m...@andrewhays.net:

[{}]*3 should produce a list of dictionaries that are 3 length long, which it 
does.  However, one would expect that if you assign something to the keyword 
'abc' in the first dicitonary (e.g., x[0]['abc'] = 'def') that the other 
dictionaries would remain blank (e.g.,  x = [{'abc': 'def'}, {}, {}].  However, 
it appears that each dictionary is filled (e.g., x = [{'abc':'def'}, 
{'abc':'def'}, {'abc':'def'}]).

Creating a list of dictionaries like this [{}, {}, {}] or appending a 
dictionary to a list like this list.append({}) does NOT produce this same 
effect, it produces the desired effect.

--
components: Build
messages: 98628
nosy: Andrew.Hays
severity: normal
status: open
title: multiplying a list of dictionaries
versions: Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7823
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7823] multiplying a list of dictionaries

2010-01-31 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

This is because multiply the list produces a reference to the same object 3 
times.

--
nosy: +benjamin.peterson
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7823
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 I think the test should be in test_pep263.

Right! I always hesitate when adding a new test.

--
Added file: http://bugs.python.org/file16072/parser_restore_bom-3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7820
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-31 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file16068/parser_restore_bom-2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7820
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7819] sys.call_tracing(): check arguments type

2010-01-31 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This very fix was already done in py3k with issue3661.
Unfortunately it was decided at the time that 2.6 is not affected...
Patch is OK, please apply.

--
nosy: +amaury.forgeotdarc
stage:  - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7819
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6939] shadows around the io truncate() semantics

2010-01-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Your patch lacked a fix for test_largefile (I think it is skipped under 
Windows). I added this and committed it in r77890. Will port to py3k.

--
resolution:  - accepted
versions:  -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7819] sys.call_tracing(): check arguments type

2010-01-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 This very fix was already done in py3k with issue3661.

Oh! My patch is *very* close to this one. I just choosed 10 instead of 2 in the 
unit test :-) (and I added a test to check a valid argument, py3k doesn't check 
it).

 Patch is OK, please apply.

Done:  r77892 (r77893).

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7819
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7819] sys.call_tracing(): check arguments type

2010-01-31 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
resolution:  - fixed
stage: commit review - committed/rejected

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7819
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7824] assertion error in 2to3

2010-01-31 Thread Brian Harring

New submission from Brian Harring ferri...@gmail.com:

Under py3.1, translation of the attached file works fine- under py3.2, goes 
boom however.

Nothing custom in use here in terms of 2to3- there is some compatibility code 
in use w/in the module but that's not affecting the translator in my testing.

assertion error follows-

RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
Traceback (most recent call last):
  File /usr/bin/2to3, line 6, in module
sys.exit(main(lib2to3.fixes))
  File /home/ferringb/python-svn/Lib/lib2to3/main.py, line 165, in main
options.processes)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 613, in 
refactor
items, write, doctests_only)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 273, in 
refactor
self.refactor_file(dir_or_file, write, doctests_only)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 653, in 
refactor_file
*args, **kwargs)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 325, in 
refactor_file
tree = self.refactor_string(input, filename)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 355, in 
refactor_string
self.refactor_tree(tree, name)
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 389, in 
refactor_tree
self.traverse_by(self.post_order_heads, tree.post_order())
  File /home/ferringb/python-svn/Lib/lib2to3/refactor.py, line 415, in 
traverse_by
node.replace(new)
  File /home/ferringb/python-svn/Lib/lib2to3/pytree.py, line 135, in replace
assert self.parent is not None, str(self)
AssertionError:
def __init__(self, get_keys_func, get_val_func):

@param get_keys_func: either a container, or func to call to get keys.
@param get_val_func: a callable that is JIT called
with the key requested.

if not isinstance(get_val_func, collections.Callable):
raise TypeError(get_val_func isn't a callable)
if hasattr(get_keys_func, __iter__):
self._keys = get_keys_func
self._keys_func = None
else:
if not isinstance(get_keys_func, collections.Callable):
raise TypeError(
get_keys_func isn't iterable or callable)
self._keys_func = get_keys_func
self._val_func = get_val_func
self._vals = {}

If y'all need more than just the mappings.py file, this is from 
http://pkgcore.org/trac/pkgcore/browser/ferringb/snakeoil-dev/ , or just grab 
the most recent release at 
http://pkgcore.org/releases/snakeoil/snakeoil-0.3.6.tar.bz2 (both trunk and 
most recent blow up).

--
components: 2to3 (2.x to 3.0 conversion tool)
files: mappings.py
messages: 98634
nosy: ferringb
severity: normal
status: open
title: assertion error in 2to3
versions: Python 3.2
Added file: http://bugs.python.org/file16073/mappings.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7824
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6939] shadows around the io truncate() semantics

2010-01-31 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in py3k (r77895, r77896) and 3.1 (r77897). Thank you Pascal!

--
resolution: accepted - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7825] test_threadsignals leaks references

2010-01-31 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

test_threadsignals leaks references. I'm unable to understand where. Maybe 
somewhere around Py_AddPendingCall()?
-
$ ./python Lib/test/regrtest.py -R 3:2: test_threadsignals
test_threadsignals
beginning 5 repetitions
12345
.
test_threadsignals leaked [8, 8] references, sum=16
1 test failed:
test_threadsignals
-

--
components: Interpreter Core
messages: 98636
nosy: haypo
severity: normal
status: open
title: test_threadsignals leaks references
type: resource usage
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7825
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7544] Fatal error on thread creation in low memory condition

2010-01-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 PyThreadState_Prealloc and PyThreadState_Init should (...) be prefixed with 
 an underscore (...)

done

 _PyThreadState_New should be static (...) so something like new_threadstate

done

 the last change (Py_InitializeEx() calls _PyGILState_Init() before 
 initsite()) should be part of a separate patch (and issue?)

I'm unable to reproduce the bug related to this patch. I keep the patch 
somewhere in my disk, and I will open a new issue if I'm able to reproduce it 
:-)

 you can use the -R option to regrtest to find out if there are any reference 
 leaks (e.g. -R 3:2:)

I tried all test*thread*py. test_threadsignals leaks a reference... even 
without my patch, so I opened a new issue: #7825.

--
Added file: http://bugs.python.org/file16074/thread_prealloc_pystate-4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7544
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7544] Fatal error on thread creation in low memory condition

2010-01-31 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file15888/thread_prealloc_pystate-3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7544
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7478] _sqlite3 doesn't catch PyDict_SetItem error

2010-01-31 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

ghaering I will soon push updates to the version in Python core.

What do you mean by soon?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7478
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-31 Thread Florent Xicluna

Changes by Florent Xicluna la...@yahoo.fr:


Removed file: http://bugs.python.org/file16047/issue7092_Wd_warnings.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-31 Thread Florent Xicluna

Changes by Florent Xicluna la...@yahoo.fr:


Removed file: http://bugs.python.org/file16050/issue7092_py3k_warnings_args.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-31 Thread Florent Xicluna

Changes by Florent Xicluna la...@yahoo.fr:


Removed file: 
http://bugs.python.org/file16051/issue7092_py3k_warnings_noargs.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-31 Thread Florent Xicluna

Changes by Florent Xicluna la...@yahoo.fr:


Added file: 
http://bugs.python.org/file16075/issue7092_py3k_warnings_args_v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-31 Thread Florent Xicluna

Changes by Florent Xicluna la...@yahoo.fr:


Added file: 
http://bugs.python.org/file16076/issue7092_py3k_warnings_noargs_v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Brian Harring

New submission from Brian Harring ferri...@gmail.com:

Bit like unittest, right now it's rather hard to extend 2to3 for caching 
support (and other outputs) w/out duplicating the main function.

Attached is a patch that allows the refactoring tool class to be passed in- at 
the very least, this patch is enough to remove some of the nastier monkey 
patching tricks I had to level to inline caching support into 2to3.

Actual caching patch will follow shortly; roughly what it does is track the md5 
of the original source and use that as a lookup to the transformed version.

That caching support isn't useful to the majority of users, but for developers 
w/ buildslaves it's a very useful reduction in runtime- for example, for 6 
buildslaves I run for pkgcore (a py2k source that we translate upon install to 
py3k if the target is py3k), if the cache is primed this is a reduction of 20s 
to 1.8s.  Two minutes cpu time across the slaves brought down to ~11s.

As said, I understand it's a corner case, so getting the caching into 2to3 
directly may not be possible.

This initial patch however makes it *way* easier to do inline the caching into 
2to3 without having to copy/paste main (or do some heinous monkeypatching).

Patch is against svn trunk; doesn't apply cleanly to 3.1/2.6, but that's  just 
a minor modification to make it so.

--
components: 2to3 (2.x to 3.0 conversion tool)
files: allow_alternate_output_tools.patch
keywords: patch
messages: 98639
nosy: ferringb
severity: normal
status: open
title: support caching for 2to3
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file16077/allow_alternate_output_tools.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7824] assertion error in 2to3

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Thanks for the report. This is now fixed in r77900.

--
nosy: +loewis
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7824
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Brian Harring

Brian Harring ferri...@gmail.com added the comment:

Attached is a derivative of 
http://pkgcore.org/trac/pkgcore/browser/ferringb/snakeoil-dev/snakeoil/caching_2to3.py

As you can see in that function, some nastyness is required right now to slip 
it in w/out duplicating code (hence the first patch).

Patch attached here inlines the support directly into a new module 
lib2to3.caching, and derives on the fly a caching version of the 
RefactoringTool.

The on the fly bit is somewhat fancy I admit, but was done so that anyone using 
an alternate RefactoringTool can get the same benefits.

The sole con to this functionality is that it assumes the transformation will 
always be the same; in other words, it doesn't account for --fix/--nofix, nor 
changes in the transformation algorithms that would result in  differing output.

Personally for my uses this was completely valid- when changing the python 
version (even a minor upgrade) on my buildslaves I'd wipe the caches to be safe 
anyways.

That said, if there *is* interest in getting caching into stdlib for this, I 
can poke through the code and incorporate awareness of nofix/fix/python version 
into the cache key.  I skipped doing that however since I didn't think there 
was a chance in hell of caching going into mainline however ;)

Either way, for folks targeting py2k and using buildslaves to validate their 
code and the translation of said code for py3k, either of these patches really 
is needed to support caching and stop burning cycles.

--
Added file: http://bugs.python.org/file16078/2to3-caching.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Not sure what your use case is, but I always call the refactor method of my 
subclassed RefactoringTool, instead of calling main. See 
distutils.util.run_2to3 for an example (and 
distutils.command.build_py.build_py_2to3 for an application of that).

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2454] sha and md5 fixer

2010-01-31 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Attached a patch that provides a (sha | md5) - hashlib fixer, covering test 
cases, and updated documentation.

--
keywords: +patch
nosy: +minge
Added file: http://bugs.python.org/file16079/issue-2454.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7827] recv_into() argument 1 must be pinned buffer, not bytearray

2010-01-31 Thread Andrew Dalke

New submission from Andrew Dalke da...@dalkescientific.com:

In Python 2.6 and Python 2.7a2+, I can't socket.recv_into(a byte array 
instance).

I get a TypeError which complains about a pinned buffer. I have only an 
inkling of what that means. Since an array.array(b) works there, and  since 
it works in Python 3.1.1, and since I thought the point of a bytearray was to 
make things like recv_into easier, I think this exception is a bug in Python 
2.6 and 2.7.

Here's my reproducibles: 

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin 
Type help, copyright, credits or license for more information. 
 import socket 
 sock = socket.socket() 
 sock.connect( (python.org, 80) ) 
 sock.send(bGET / HTTP/1.0\r\n\r\n) 
18 
 buf = bytearray(b  * 10) 
 sock.recv_into(buf) 

Traceback (most recent call last): 
  File stdin, line 1, in module 
TypeError: recv_into() argument 1 must be pinned buffer, not bytearray 

I expected a bytearray to work there. In fact, I thought the point of 
bytearray was to allow this to work. 
By comparison, an array of bytes does work: 
 import array 
 arr = array.array(b) 
 arr.extend(map(ord, This is a test)) 
 len(arr) 
14 
 sock.recv_into(arr) 
14 
 arr
array('b', [72, 84, 84, 80, 47, 49, 46, 49, 32, 51, 48, 50, 32, 70]) 
 .join(map(chr, arr))
'HTTP/1.1 302 F' 

I don't even know what a pinned buffer means, and searching 
python.org isn't helpful.

Using a bytearray in Python 3.1.1 *does* work: 
Python 3.1.1 (r311:74480, Jan 31 2010, 23:07:16) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin 
Type help, copyright, credits or license for more information. 
 import socket 
 sock = socket.socket() 
 sock.connect( (python.org, 80) ) 
 sock.send(bGET / HTTP/1.0\r\n\r\n) 
18 
 buf = bytearray(b  * 10) 
 sock.recv_into(buf) 
10 
 buf 
bytearray(b'HTTP/1.1 3') 

For reference, here's an example with 2.7a2+ (freshly built out of version 
control) showing that it does not work there.

Python 2.7a2+ (trunk:74969:77901M, Feb  1 2010, 02:44:24) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type help, copyright, credits or license for more information.
 import socket
 sock = socket.socket()
 sock.connect( (python.org, 80)  )
 b = bytearray(b  * 10)
 sock.recv_into(b)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: recv_into() argument 1 must be pinned buffer, not bytearray


--
components: IO
messages: 98644
nosy: dalke
severity: normal
status: open
title: recv_into() argument 1 must be pinned buffer, not bytearray
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1943] improved allocation of PyUnicode objects

2010-01-31 Thread Brian Harring

Changes by Brian Harring ferri...@gmail.com:


--
nosy: +ferringb

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1943
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7827] recv_into() argument 1 must be pinned buffer, not bytearray

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

This is fixed in Python 3.

I think it is (another) bug that it accepts array objects; it should reject 
them with the same error. OTOH, recv_into should use w*.

--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Brian Harring

Brian Harring ferri...@gmail.com added the comment:

@martin:

Yeah... that's probably the better approach, although seperation of processes 
(in terms of setup.py triggering conversion) has some benefits.

The reason I used process seperation and invocation of main was to protect my 
distutils extensions against having to know the innards of lib2to3- either it 
could invoke the normal 2to3 or invoke the caching version for the buildslaves. 
 Essentially I wanted the caching version to behave the same as normal 2to3 
invocations.

Not great I'll admit, but so it goes.  I'd still like to see the caching 
integrated in some form w/in stdlib since it has definite benefits- and folk 
are more likely to use something from stdlib than go raiding from a backwater 
pkg like snakeoil.  That said, we'll see what folks think ;)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2454] sha and md5 fixer

2010-01-31 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
components:  -2to3 (2.x to 3.0 conversion tool)
stage:  - patch review
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
keywords: +needs review
priority:  - normal
stage:  - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7827] recv_into() argument 1 must be pinned buffer, not bytearray

2010-01-31 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
priority:  - normal
stage:  - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7827
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7823] multiplying a list of dictionaries

2010-01-31 Thread Andrew Hays

Andrew Hays m...@andrewhays.net added the comment:

Ah, my apolgogies, I didn't realize that.  I suppose I didn't look deeply 
enough into the situation.  I just realized that it worked that way with 
dictionaries, but by the same right, x=[[]]*3 would create [[], [], []] and if 
I said x[0][0]=1 then it would only do that for the first inner array. (e.g. x 
= [[1], [], []]).  Again, my apologies for not looking into this further.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7823
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7828] chr() and ord() documentation for wide characters

2010-01-31 Thread nudgenudge

New submission from nudgenudge py...@sogetthis.com:

The documentation of chr() and ord() fails to mention that on narrow Unicode 
builds, chr(n) will return a surrogate pair (hence a 2-character string) for 
n=65536 and that ord(s) will accept a 2-character string if it's a surrogate 
pair.

Example:
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on
win32
Type help, copyright, credits or license for more information.
 list(chr(123456))
['\ud838', '\ude40']
 len(chr(123456))
2
 ord(chr(123456))
123456


--
assignee: georg.brandl
components: Documentation
messages: 98648
nosy: georg.brandl, nudgenudge
severity: normal
status: open
title: chr() and ord() documentation for wide characters
versions: Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7828
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6760] patch to subprocess docs to better explain Popen's 'args' argument

2010-01-31 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy: +ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6760
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2454] sha and md5 fixer

2010-01-31 Thread Martin v . Löwis

Changes by Martin v. Löwis mar...@v.loewis.de:


--
components: +2to3 (2.x to 3.0 conversion tool)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7826] support caching for 2to3

2010-01-31 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

If you meant to propose a patch that does caching, you should include the 
actual caching code in the patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7826
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3426] os.path.abspath with unicode argument should call os.getcwdu

2010-01-31 Thread Florent Xicluna

Florent Xicluna la...@yahoo.fr added the comment:

Small note:
 - the unit tests could use assertIsInstance(..., str), assertIsInstance(..., 
unicode) instead of the custom methods.
 - some assertTrue may be replaced by assertEqual

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com