[issue11344] Add os.path.splitpath(path) function

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue16595] Add resource.prlimit

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue10712] 2to3 fixer for deprecated unittest method names

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue4805] Make python code compilable with a C++ compiler

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue2897] include structmember.h in Python.h

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue16568] allow constructors to be documented separately from class

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue11797] 2to3 does not correct reload

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 f = open(/dev/full, wb, buffering=0)
 f.write(bWrite to full device)
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 28] No space left on device
 f.close()
 f.closed
True
 f = open(/dev/full, wb)
 f.write(bWrite to full device)
20
 f.close()
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [Errno 28] No space left on device
 f.closed
False


Python 2 has the same behavior using io.open.

--
nosy: +serhiy.storchaka
versions: +Python 2.7, Python 3.3, Python 3.4

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The bug only in C implementation.

 import _pyio
 f = _pyio.open(/dev/full, wb)
 f.write(bWrite to full device)
20
 f.close()
Traceback (most recent call last):
  File stdin, line 1, in module
  File /home/serhiy/py/cpython/Lib/_pyio.py, line 732, in close
self.flush()
  File /home/serhiy/py/cpython/Lib/_pyio.py, line 1121, in flush
self._flush_unlocked()
  File /home/serhiy/py/cpython/Lib/_pyio.py, line 1128, in _flush_unlocked
n = self.raw.write(self._write_buf)
OSError: [Errno 28] No space left on device
 f.closed
True

--
components: +Extension Modules

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



[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread anatoly techtonik

New submission from anatoly techtonik:

A common usage pattern is to prevent clean up in tearDown() if the test failed. 
However, it requires a hack: 
http://stackoverflow.com/questions/4414234/getting-pythons-unittest-results-in-a-teardown-method.
 Would be nice to have an officially documented feature.

--
components: Library (Lib), Tests
messages: 176832
nosy: techtonik
priority: normal
severity: normal
status: open
title: unittest: Access test result from tearDown
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue16600] rlcompleter

2012-12-03 Thread Robert McGibbon

New submission from Robert McGibbon:

I'm not really sure how what the format for filing bugs with python is, so I'm 
sorry in advance if I've done something wrong.

There is a very small py3k bug in the readline completer (rlcompleter.py).

Specifically, if you look at line 105 
(http://hg.python.org/cpython/file/03ce83e43e1b/Lib/rlcompleter.py#l105), you 
can see that the rlcompleter module is trying to remove '__builtins__' from the 
list of possible completions that it gives. This made sense in python2.x, but 
sense the name '__bultins__' was changed to 'builtins', perhaps the line should 
be changed?

The same issue applies on line 131-134 of the same file I think.

Thanks!

--
messages: 176833
nosy: rmcgibbo
priority: normal
severity: normal
status: open
title: rlcompleter
type: behavior
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue16600] small py3k bug in rlcompleter

2012-12-03 Thread Robert McGibbon

Changes by Robert McGibbon rmcgi...@gmail.com:


--
title: rlcompleter - small py3k bug in rlcompleter

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



[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
stage:  - needs patch
type:  - enhancement
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue16579] .pyw disturb multiprocessing behavior

2012-12-03 Thread Alex stein

Alex stein added the comment:

It seems like you’re right. 
I redirect the sys.stdout and the problem is solved. 

Thank you for your help.

--
status: open - closed

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c838c9b117f1 by Victor Stinner in branch '3.2':
Issue #16416: On Mac OS X, operating system data are now always
http://hg.python.org/cpython/rev/c838c9b117f1

New changeset 26c4748351cb by Victor Stinner in branch '3.3':
(Merge 3.2) Issue #16416: On Mac OS X, operating system data are now always
http://hg.python.org/cpython/rev/26c4748351cb

--

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



[issue16587] Py_Initialize breaks wprintf on Windows

2012-12-03 Thread STINNER Victor

STINNER Victor added the comment:

 _setmode(self-fd, O_BINARY) change was done in Python 3.2: see the issue 
 #10841

The main reason was to be able to read binary file from sys.stdin
using the CGI module: see the issue #4953. In _O_TEXT mode, 0x0A byte
is replaced with 0x0A 0x0D (or the opposite, I never remember) which
corrupt binary files.

Articles about _setmode() and wprintf():

A confluence of circumstances leaves a stone unturned...
http://blogs.msdn.com/b/michkap/archive/2010/09/23/1000.aspx

Conventional wisdom is retarded, aka What the @#%* is _O_U16TEXT?
http://blogs.msdn.com/b/michkap/archive/2008/03/18/8306597.aspx

See also issue #1602 (Windows console doesn't print or input Unicode).

--

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



[issue16600] small py3k issue in rlcompleter

2012-12-03 Thread Robert McGibbon

Changes by Robert McGibbon rmcgi...@gmail.com:


--
title: small py3k bug in rlcompleter - small py3k issue in rlcompleter

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



[issue16600] small py3k issue in rlcompleter

2012-12-03 Thread Robert McGibbon

Changes by Robert McGibbon rmcgi...@gmail.com:


--
status: open - closed

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



[issue16600] small py3k issue in rlcompleter

2012-12-03 Thread Robert McGibbon

Robert McGibbon added the comment:

nevermind.

--

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which calls close() on underlying stream even if flush() raises 
an exception.

I am not sure that I correctly set a context exception. There is no other 
examples in the code.

--
keywords: +patch
nosy: +benjamin.peterson, pitrou, stutzbach
stage:  - patch review
Added file: http://bugs.python.org/file28196/bufferedio_finally_close.patch

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28196/bufferedio_finally_close.patch

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file28197/bufferedio_finally_close.patch

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af6fd3ca6de9 by Victor Stinner in branch '3.2':
Issue #16416: Fix compilation error
http://hg.python.org/cpython/rev/af6fd3ca6de9

--

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



[issue16416] Mac OS X: don't use the locale encoding but UTF-8 to encode and decode filenames

2012-12-03 Thread STINNER Victor

STINNER Victor added the comment:

The issue should now be fixed in Python 3.2, 3.3 and 3.4.

--
resolution:  - fixed
status: open - closed
versions: +Python 3.2, Python 3.3

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



[issue16582] Tkinter calls SystemExit with string

2012-12-03 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks for report.
The patch is really trivial, but I don't sure if it can be applied to released 
python versions.

--
keywords: +patch
nosy: +asvetlov
Added file: http://bugs.python.org/file28198/issue16582.diff

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



[issue10631] ZipFile and current directory change

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch from issue14099 is intended to fix this issue.

--
nosy: +alanmcintyre

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This issue looks as a duplicate or a superseder of issue10631. See also 
issue16569.

seek() for every read should significantly decrease performance. It may be 
worth to prohibit the simultaneous reading of different files from the archive. 
In any case the children counting in the patch looks doubtful.

--
nosy: +Arfrever, loewis, ocean-city, pitrou, r.david.murray, serhiy.storchaka
versions: +Python 3.4

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



[issue16583] Tkinter nested SystemExit

2012-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b742bbf6b07f by Andrew Svetlov in branch '3.2':
Issue #16583: Prevent nesting SystemExit in tkinter.CallWrapper
http://hg.python.org/cpython/rev/b742bbf6b07f

New changeset 96b6e6522a1d by Andrew Svetlov in branch '3.3':
Merge issue #16583: Prevent nesting SystemExit in tkinter.CallWrapper
http://hg.python.org/cpython/rev/96b6e6522a1d

New changeset 657caf5d3eb1 by Andrew Svetlov in branch 'default':
Merge issue #16583: Prevent nesting SystemExit in tkinter.CallWrapper
http://hg.python.org/cpython/rev/657caf5d3eb1

--
nosy: +python-dev

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



[issue16583] Tkinter nested SystemExit

2012-12-03 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed. Thanks for report.

As tkinter code is not processed via 2to3 tool now, I've fixed 
tkinter/__init__.py and like to close the issue.

If there are problems in 2to3 please open new ticket dedicated to 2to3 tool 
only, not related to tkinter.

--
components:  -2to3 (2.x to 3.x conversion tool)
keywords: +easy
nosy: +asvetlov
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue16582] Tkinter calls SystemExit with string

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The code was changed in the changeset e8a2a5e4c7b0.

 def _exit(code='0'):
-   import sys
-   sys.exit(getint(code))
+   raise SystemExit, code

I think it is a bug and should be fixed.

--
nosy: +gvanrossum, serhiy.storchaka

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



[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue16492] Add a load_parents argument to importlib.find_loader()

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16494] Add a method on importlib.SourceLoader for creating bytecode file format/container

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16495] bytes_decode() unnecessarily examines encoding

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16496] Simplify and optimize random_seed()

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16499] CLI option for isolated mode

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16511] IDLE configuration file: blank height and width fields trip up IDLE

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16531] Allow IPNetwork to take a tuple

2012-12-03 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue5701] ZipFile returns compressed data stream when encountering unsupported compression method

2012-12-03 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka
resolution:  - duplicate
stage: test needed - committed/rejected
status: open - closed
superseder:  - zipfile should raise an exception for unsupported compression 
methods

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



[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also related issue4844 and issue14315 for zipfile.

--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.3

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



[issue16569] Preventing errors of simultaneous access in zipfile

2012-12-03 Thread Stepan Kasal

Stepan Kasal added the comment:

I agree that reading from a file open for write should be forbidden, no matter 
whether ZipFile was called with fp or a name.

Actually, it is not yet forbidden, and two of the tests in the zipfile.py test 
suite do actually rely on this misfeature.
The first chunk in the patch 
http://bugs.python.org/file24624/Proposed-fix-of-issue14099-second.patch 
contains a fix for this bug in test suite.

OTOH, decompressing several files for a given zip file simultaneously does not 
sound that bad.  You know, with all the current file managers, people look at a 
zip as if it were kind of a directory.

--
nosy: +kasal

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



[issue16569] Preventing errors of simultaneous access in zipfile

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test:

http://bugs.python.org/file24624/Proposed-fix-of-issue14099-second.patch

file24624

--

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



[issue16569] Preventing errors of simultaneous access in zipfile

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Test:

file24624/Proposed-fix-of-issue14099-second.patch

--

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



[issue16569] Preventing errors of simultaneous access in zipfile

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Actually, it is not yet forbidden, and two of the tests in the zipfile.py 
 test suite do actually rely on this misfeature.

Indeed. I missed that.

Actually these tests work by accident, due to the fact that the contents of the 
zipfile is placed in the file object buffer.

 OTOH, decompressing several files for a given zip file simultaneously does 
 not sound that bad.  You know, with all the current file managers, people 
 look at a zip as if it were kind of a directory.

I agree, but I'm afraid it's impossible to do without performance regression 
due to seek before every read. And for now ZipFile is not support simultaneous 
reading when external file object used. Also ZipFile is not thread-safe in any 
case. You can open several ZipFiles for simultaneous reading.

--

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Stepan Kasal

Stepan Kasal added the comment:

Re: children counting

You need to know the number of open children and whether the parent ZipFile 
object is still open.
As soon as both all children and the parent ZipFile are closed, the underlying 
fp (corresponding to the file name given initially) shall be closed as well.

The code submitted in the patch ensures that.  But other implementations are 
possible.

In any case, it is necessary to ensure that the children stay usable even if 
the parent ZipFile is closed, because of code like this:

def datafile(self):
with ZipFile(self.datafilezip, r) as f:
return f.open(data.txt)

This idiom currently works and should not be broken.

Re: seek()

The read can interfere not only with a parallel file expansion, but also with a 
ZipFile metadata read (user can list the contents of the zip again).  Both of 
these would have to be forbidden by the documentation, and, ideally, also 
enforced.  (As disscussed issue #16569)

OTOH, zipfile.py is already slow, because the decompression is implemented in 
Python as interpreted code.  I guess that the slowdown by seek() is neglectable 
compared to this.
Also note that we most often seek to the current position; the OS should notice 
that and return swiftly.

--

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



[issue16076] xml.etree.ElementTree.Element is no longer pickleable

2012-12-03 Thread Daniel Shahaf

Daniel Shahaf added the comment:

Attached patch for your consideration.

I've tested pickling/unpickling and comparing the resulting object attribute by 
attribute (.tag, .attrib, .text, .tail for equality; and recursively 
.getchildren()), and 'make test' --- all seems to work.

If the approach is sound, I can submit a revised patch that also updates 
documentation, regression tests, and potententially updates other type objects 
in the same manner as this patch updates _elementtree.Element .

--
components: +Extension Modules
keywords: +patch
nosy: +danielsh
Added file: http://bugs.python.org/file28199/i16076-cpatch.diff

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think some benchmarks will needed to see how it will affect the performance.

Please update your patch to current sources. The module code was changed last 
months.

--

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



[issue16569] Preventing errors of simultaneous access in zipfile

2012-12-03 Thread Stepan Kasal

Stepan Kasal added the comment:

 but I'm afraid it's impossible to do without performance regression due to 
 seek before every read.

I agree that this is key question.

I would hope that the performance hit wouldn't be so bad, unless there are 
actually two decompressions running concurrently.
So we can have an implementation that is generally correct, though some use 
scenarios result in slow execution.

OTOH, if the seek() call were a problem even if the new position is the same as 
the old one, they can be optimized out by a simple wrapper around fp.

--

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Stepan Kasal

Stepan Kasal added the comment:

I'm not sure when I'll get to this, sorry.
Hopefully sometime soon.

--

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 This idiom currently works and should not be broken.

Hmm. This seems doubtful to me, but if it is used, then I agree, it shouldn't 
be broken.

 I guess that the slowdown by seek() is neglectable compared to this.

Even one function call can have effect on performance of short reads 
(issue10376, issue16304). Fortunately in this corner case the read buffer will 
be used.

 Also note that we most often seek to the current position; the OS should 
 notice that and return swiftly.

This may affect the buffered Python file (I did not check). The OS also doesn't 
notice this if the OS is Windows (issue8745).

I want to see and test an updated patch.

--

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



[issue14099] ZipFile.open() should not reopen the underlying file

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, not issue16304, but issue16034. The commit messages were wrong.

--

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



[issue4833] Explicit directories for zipfiles

2012-12-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually now creating directories in zipfile is possible with 
ZipFile.writestr(special_zip_info, b''). However a special method (like 
ZipFile.mkdir(name)) can be useful.

--
nosy: +serhiy.storchaka
stage:  - needs patch
versions: +Python 3.4

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



[issue16582] Tkinter calls SystemExit with string

2012-12-03 Thread Abraham Karplus

Abraham Karplus added the comment:

I'd be fine with having it fixed just in 3.4, as it is easy enough to work 
around for now. (Call deletecommand('exit') and then createcommand('exit', 
working_exit_function) with working_exit function being the patched version of 
_exit.)

--

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



[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2012-12-03 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks! I will try it out shortly.

--

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



[issue9974] tokenizer.untokenize not invariant with line continuations

2012-12-03 Thread Simon Law

Changes by Simon Law sfl...@sfllaw.ca:


--
nosy: +sfllaw

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



[issue16507] Patch selectmodule.c to support WSAPoll on Windows

2012-12-03 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Attached is an alternative patch which only touches selectmodule.c.  It still 
does not support WinXP.

Note that in this version register() and modify() do not ignore the POLLPRI 
flag if it was *explicitly* passed.  But I am not sure how best to deal with 
POLLPRI.

--
nosy: +sbt
Added file: http://bugs.python.org/file28201/miminal-wsapoll.patch

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2012-12-03 Thread Michael Birtwell

New submission from Michael Birtwell:

If you partially iterate over a tarfile then try and restart iteration of that 
tarfile it will continue from where it left off rather than restarting from the 
beginning.

I've only tried this with the tarfile implementation in python 2.7 but the 3.x 
code looks the same in this respect.

I've included a patch with my approach to fixing this.

--
components: Library (Lib)
files: fix-tarfile-restart-iteration.patch
keywords: patch
messages: 176863
nosy: mbirtwell
priority: normal
severity: normal
status: open
title: Restarting iteration over tarfile continues from where it left off.
versions: Python 2.7
Added file: http://bugs.python.org/file28200/fix-tarfile-restart-iteration.patch

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2012-12-03 Thread Michael Birtwell

Michael Birtwell added the comment:

Embarrassingly as soon as I uploaded that patch I found a problem with it. I 
hadn't taken in to account the special case for the first member.

Here's a replacement patch

--
type:  - behavior
Added file: 
http://bugs.python.org/file28202/fix-tarfile-restart-iteration2.patch

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2012-12-03 Thread R. David Murray

R. David Murray added the comment:

Thanks for the patch.

Could you either include a test or post code that demonstrates the problem, 
please?

--
nosy: +r.david.murray

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



[issue16596] Skip stack unwinding when next, until and return pdb commands executed in generator context

2012-12-03 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +georg.brandl

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



[issue16490] inspect.getargspec() and inspect.getcallargs() don't work for builtins

2012-12-03 Thread Larry Hastings

Larry Hastings added the comment:

http://mail.python.org/pipermail/python-dev/2012-December/122920.html

--

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



[issue16601] Restarting iteration over tarfile continues from where it left off.

2012-12-03 Thread Michael Birtwell

Michael Birtwell added the comment:

Here's a patch on the tarfile's unittest module.

--
Added file: 
http://bugs.python.org/file28203/test-tarfile-restart-iteration.patch

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



[issue12268] file readline, readlines readall methods can lose data on EINTR

2012-12-03 Thread Gary Miguel

Changes by Gary Miguel gar...@google.com:


--
nosy: +Gary.Miguel

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



[issue16455] sys.getfilesystemencoding() is not the locale encoding on FreeBSD and OpenSolaris when the locale is not set

2012-12-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c25635b137cc by Victor Stinner in branch 'default':
Issue #16455: On FreeBSD and Solaris, if the locale is C, the
http://hg.python.org/cpython/rev/c25635b137cc

--
nosy: +python-dev

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



[issue16455] Decode command line arguments from ASCII on FreeBSD and Solaris if the locale is C

2012-12-03 Thread STINNER Victor

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


--
title: sys.getfilesystemencoding() is not the locale encoding on FreeBSD and 
OpenSolaris when the locale is not set - Decode command line arguments from 
ASCII on FreeBSD and Solaris if the locale is C

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



[issue16455] Decode command line arguments from ASCII on FreeBSD and Solaris if the locale is C

2012-12-03 Thread STINNER Victor

STINNER Victor added the comment:

 We have two options, I don't know which one is the best (safer).

Force ASCII is safer. Python should announce that it does not understand 
non-ASCII bytes on the command line. I also chose this option because 
isalpha(0xe9) returns 0 (even if mbstowcs(0xe9) returns L\xe9): FreeBSD 
doesn't consider U+00E9 as a letter in the C locale, so Python should also 
consider this byte as raw data.

--

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



[issue16455] Decode command line arguments from ASCII on FreeBSD and Solaris if the locale is C

2012-12-03 Thread STINNER Victor

STINNER Victor added the comment:

 New changeset c25635b137cc by Victor Stinner in branch 'default':
 Issue #16455: On FreeBSD and Solaris, if the locale is C, the
 http://hg.python.org/cpython/rev/c25635b137cc

This changeset should fix #16218 on FreeBSD and Solaris (these OS should now 
decode correctly undecodable command line arguments).

--

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



[issue16218] Python launcher does not support unicode characters

2012-12-03 Thread STINNER Victor

STINNER Victor added the comment:

 New changeset c25635b137cc by Victor Stinner in branch 'default':
 Issue #16455: On FreeBSD and Solaris, if the locale is C, the
 http://hg.python.org/cpython/rev/c25635b137cc

This changeset should fix this issue on FreeBSD and Solaris: see the issue 
#16455 for more information.

--

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



[issue15031] Split .pyc parsing from module loading

2012-12-03 Thread Philip Jenvey

Philip Jenvey added the comment:

From the perspective of Jython we'd want the easiest way to hook into this as 
possible of course, but I think that overriding marshal to handle a $py.class 
or whatever format would be a misappropriation of the marshal module

Jython actually has a slow, preliminary .pyc bytecode interpreter, so it needs 
marshal the way it is. Correct me if I'm wrong but I think the overriding a 
method of a Loader option could allow you to even have the import system 
support .pyc *and* $py.class at the same time in Jython (just by addding 
another Loader into the mix)

I'm not sure anyone would ever want to do that in practice, but it's probably 
worth considering.

Overriding a Loader method is probably the 'most work' for alternative 
implementations, right? But it's still fairly trivial

--
nosy: +pjenvey

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



[issue16602] weakref can return an object with 0 refcount

2012-12-03 Thread Eugene Toder

New submission from Eugene Toder:

An interaction between weakrefs and trashcan can cause weakref to return the 
object it's pointing to after object's refcount is already 0. Given that the 
object is usually increfed and decrefed, this leads to double dealloc and 
crashing or hanging.
Tested 2.6.6, 2.7.2 and 3.3.0 on win7.

In more details. The documentation for Py_TRASHCAN_SAFE_BEGIN tells to put it 
right after PyObject_GC_UnTrack. This means that PyObject_ClearWeakRefs goes 
after it, and, for example, in subtype_dealloc of Objects/typeobject.c this is 
indeed the case. This means that if we get into a long chain of deallocations 
and the trashcan kicks in, we get an object with 0 refcount and without cleared 
weakrefs lying in trash_delete_later until we go PyTrash_UNWIND_LEVEL levels 
up. During that time we can execute arbitrary python code, so all we need is 
some code with an access to the weakref to dereference it.
The current recommendation of clearing weakrefs before clearing attributes 
makes this less likely to happen, but it's still easy enough:

import weakref

class C:
def __init__(self, parent):
if not parent:
return
wself = weakref.ref(self)
def cb(wparent):
o = wself()
self.wparent = weakref.ref(parent, cb)

d = weakref.WeakKeyDictionary()
root = c = C(None)
for n in range(100):
d[c] = c = C(c)

print('deleting')
del root
print('done')

In this case weakref callback in WeakKeyDictionary deletes the reference to the 
next object, causing the next level of destruction, until trashcan kicks in. 
Trashcan delays clearing of weakrefs, allowing the second weakref's (wparent) 
callback to see the dead object via wself that it captured.

Attached is a similar example with less weakrefs using __del__.

--
components: Interpreter Core
files: wr2.py
messages: 176874
nosy: eltoder, pitrou
priority: normal
severity: normal
status: open
title: weakref can return an object with 0 refcount
type: crash
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file28204/wr2.py

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



[issue16602] weakref can return an object with 0 refcount

2012-12-03 Thread Christian Heimes

Christian Heimes added the comment:

Thank you very much for bringing the issue to our attention. I've removed 2.6 
and 3.1 because they are in security fix mode and this issue poses no security 
threat.

--
nosy: +christian.heimes
stage:  - needs patch
versions: +Python 3.4 -Python 2.6, Python 3.1

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



[issue15004] add weakref support to types.SimpleNamespace

2012-12-03 Thread Christian Heimes

Christian Heimes added the comment:

The patch LGTM except for the extra code reformatting. However it's too late 
for 3.3.

--
nosy: +christian.heimes
versions: +Python 3.4 -Python 3.3

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



[issue15004] add weakref support to types.SimpleNamespace

2012-12-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You shouldn't have to export something named __weakref__.
Furthermore, the test should check that weakrefs work, not that an attribute 
exists.

--
nosy: +pitrou

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



[issue14102] argparse: add ability to create a man page

2012-12-03 Thread Christoph Sieghart

Changes by Christoph Sieghart s...@0x2a.at:


--
nosy: +sigi

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