[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-08-13 Thread Simon Sapin

Simon Sapin added the comment:

I just remembered about this. I suppose it is too late for 3.3?

--

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



[issue15634] synchronized decorator for the threading module

2012-08-13 Thread Juan Javier

New submission from Juan Javier:

I think it will be useful to have a decorator like this one on the threading 
module:

def synchronized(func):
A decorator to make a function execution synchronized.

Examples:

@synchronized
def foo():
pass

class Foo:
def __init__(self):
self.__syncdata = None

@property
def syncdata(self):
return self.__syncdata

@syncdata.setter
@synchronized
def syncdata(self, value):
self.__syncdata = value

if not hasattr(func, __lock):
func.__lock = threading.Lock()
def _synchronized(*args, **kwds):
with func.__lock:
func(*args, **kwds)
_synchronized.__doc__ = func.__doc__
return _synchronized

What do you think?

--
components: Library (Lib)
messages: 168071
nosy: jjdominguezm
priority: normal
severity: normal
status: open
title: synchronized decorator for the threading module
type: enhancement
versions: Python 3.4

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



[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna

New submission from Florent Xicluna:

Hello,

I noticed a large memory consumption in my application.
I tracked it down to be a problem with garbage collection of generator locals.

The issue was noticed in 2.6 first. Then I reproduced it in 2.7.
The test case finds some leak in 3.3 too, it seems.

--
components: Interpreter Core
files: testiterbug.py
messages: 168072
nosy: flox
priority: normal
severity: normal
status: open
title: memory leak with generators
type: resource usage
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26779/testiterbug.py

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-13 Thread patrick vrijlandt

patrick vrijlandt added the comment:

I must admit my usage case is a hack, but the summary is: view a page on one 
computer, process it on another computer; like sending the page to a friend, 
with friend - self and send - upload.

I found one other victim in python 
(https://groups.google.com/d/topic/web2py/ixeUUWryZh0/discussion) but only an 
occasional reference to other languages; most posts relate to security issues 
with mht files.

My previous example only served to show that the mime-type is a necessary 
condition for the problem to occur; you are right that this input would be 
expected to throw an exception.

So I went on and created a complete testcase/example (attached). The 
PatchedFieldStorage class parses the mht file correctly into parts. However, 
the names of the parts are in content-location headers inside  
the mht file and get lost. Also the code is ugly.

Trying to better re-use existing code like in ExperimentalFieldStorage was not 
succesful so far: The MIME-prologue is parsed as one of the parts, and the 
outerboundary is not respected, losing a dataelement next to the file. The 
print() calls show that the next line may be valuable (like a header) or not so 
much (like a boundary), but so far the class has no provision for look-ahead I 
think.

email.message_from_binary_file correctly parses my mht-files; so a completely 
different approach might be to more rely on that package for parsing MIME 
encoded data.

--
Added file: http://bugs.python.org/file26780/test_cgi4.py

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



[issue15624] clarify io.TextIOWrapper newline documentation

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

For me input means «reading from» and output — «writing to».

Nevertheless I'm ok with you suggestion.

--

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



[issue15624] clarify newline documentation for open and io.TextIOWrapper.

2012-08-13 Thread Andrew Svetlov

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


--
title: clarify io.TextIOWrapper newline documentation - clarify newline 
documentation for open and io.TextIOWrapper.

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



[issue15624] clarify newline documentation for open and io.TextIOWrapper.

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Close as fixed. Thanks.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.2, Python 3.3

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



[issue15624] clarify newline documentation for open and io.TextIOWrapper.

2012-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5b629e9fde61 by Andrew Svetlov in branch '3.2':
Issue #15624: clarify newline documentation for open and io.TextIOWrapper
http://hg.python.org/cpython/rev/5b629e9fde61

New changeset 9e098890ea2c by Andrew Svetlov in branch 'default':
Issue #15624: clarify newline documentation for open and io.TextIOWrapper
http://hg.python.org/cpython/rev/9e098890ea2c

--
nosy: +python-dev

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



[issue8800] add threading.RWLock

2012-08-13 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

I should add that on Windows, the new SRW that is part of Vista and Windows 7, 
uses locking, that is it favors neither readers or writers.  It appears that 
nowadays the complex semantics of RWLocks have not really proven worthwile.  
See http://msdn.microsoft.com/en-us/magazine/cc163405.aspx

Perhaps this proposed patch is overly complex.

--

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



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-13 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Silence means consent, so I will supply a patch as soon as 3.4 is open.

Meanwhile, I reworded the docs for os.makedirs, the patch is attached. Please 
have a look at it so we can get it in for 3.3.

--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file26781/os-makedirs.diff

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



[issue15624] clarify newline documentation for open and io.TextIOWrapper.

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks a lot, Andrew.

--

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



[issue15636] base64.decodebytes is only available in Python3.1+

2012-08-13 Thread Andrew Scheller

New submission from Andrew Scheller:

According to the documentation ( 
http://docs.python.org/py3k/library/base64.html#base64.decodebytes ) both the 
decodebytes and the deprecated decodestring methods are available in the base64 
module in Python3.x
However in Python3.0 (I'm testing with version 3.0.1 built from source) the 
base64 module only has the decodestring method, it doesn't have decodebytes. 
IMHO the documentation should be updated to reflect this.

It looks like decodebytes was added to Python3.1 by 
http://bugs.python.org/issue3613

--
assignee: docs@python
components: Documentation
messages: 168080
nosy: docs@python, lurchman
priority: normal
severity: normal
status: open
title: base64.decodebytes is only available in Python3.1+
type: enhancement
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Do you mean to mention stdin as well as stdout/stderr? It will be nice.

--

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



[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna

Florent Xicluna added the comment:

I don't mean perlbrew, but homebrew (an OS X package manager to install from 
source).

--

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



[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna

Florent Xicluna added the comment:

Though, I cannot reproduce on Debian Squeeze (2.6.6 deb or 2.7 from source) or 
Ubuntu (2.7.2+ or 3.2).

Someone on OS X might confirm the same issue.
This is python 2.7.3 installed from source (using perlbrew) and GCC 4.2.1.


The output of the script is:

$ python testiterbug.py
2.7.3 (default, May 20 2012, 19:54:58)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]

[row for row in iterit(16777216)]
Memory usage:   9.3 MB

[row for row in iterit(8388608)]
Memory usage: 266.6 MB

--
nosy: +hynek, ned.deily, ronaldoussoren

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



[issue15555] Default newlines of io.TextIOWrapper

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

It doesn't.
_io can be fixed to directly support os.linesep, but I doubt if anybody really 
need it.

--
nosy: +asvetlov

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Yes, that too. :) I am working on it.

--

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



[issue15555] Default newlines of io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I think it can be useful for testing reasons (e.g. testing that os.linesep is 
respected by certain code).

--

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-13 Thread Alberto Milone

New submission from Alberto Milone:

The attached test case works fine in Python 2.7 but causes Pyhton 3.2 to 
segfault.

--
components: ctypes
files: randr_test
messages: 168087
nosy: albertomilone
priority: normal
severity: normal
status: open
title: Segfault reading null VMA (works fine in python 2.x)
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file26782/randr_test

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



[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I can reproduce this on an OSX 10.8 system, both using python 2.7 and python 
3.3. The growth is significantly less using python 3.3.

What's odd is that the growth does not occur when both test_iter calls use 
124 as the argument (or larger values).

If I'd had to guess I'd say that the free implementation doesn't return a 
buffer to the system for smaller blocks and does do it for larger buffers.

--

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



[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren

Ronald Oussoren added the comment:

BTW. I don't think this is a memory leak, the amount of memory used doesn't 
increase when there are more calls to test_iter(123).

--

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



[issue15509] webbrowser.open sometimes passes zero-length argument to the browser.

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Better to fix producer of empty lines than filter those ones.
Keep in mind: there are several places there args list generated, probably you 
fix not all error sources.

--
nosy: +asvetlov

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



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

That's exactly what Georg's suggestion is about.  Sphinx does have a way to 
mark doctest snippets as run this, don't run this.  I believe that requires 
using 'make doctest' as the runner, but I already think that is the way to go, 
as I said before.

--

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The io.TextIOWrapper documentation says that the write_through argument was 
added in version 3.3:

Changed in version 3.3: The write_through argument has been added.

http://docs.python.org/dev/library/io.html#io.TextIOWrapper

However, it seems to be present in 3.2.  Also, the 3.2 documentation does not 
mention the write_through argument.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 168092
nosy: asvetlov, cjerdonek, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: incorrect version info for TextIOWrapper write_through docs
versions: Python 3.2, Python 3.3

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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

Silence doesn't mean consent, but it does mean you can go ahead and see if 
anyone complains :)

I think your proposal is fine, but I'd prefer making the sentinels just 
IGNORE and FAIL.  The module namespace means the names themselves don't 
have to be fully qualified.

--

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

For 3.2 to mention write_through, issue 15638 should probably be fixed first.  
I can create a patch for that first.

--
dependencies: +incorrect version info for TextIOWrapper write_through docs

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



[issue15633] httplib.response is not closed after all data has been read

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

Without a reproducible test case I doubt we are going to be able to solve this, 
but yes please provide what information you can for the record, in case someone 
else runs in to it in a more reproducible situation.

--
nosy: +r.david.murray

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



[issue15639] csv.Error description is incorrectly broad

2012-08-13 Thread Xavier Morel

New submission from Xavier Morel:

In both Python 2.7 and Python 3.x, csv.Error is documented as:

Raised by any of the functions when an error is detected.

As far as I can tell from using the module and looking at the code, this is 
completely incorrect. There is actually a single instance of csv.Error being 
used: the instantiation of csv.Dialect (which converts TypeError raised from 
_csv._Dialect() into csv.Error, a comment notes that this is for compatibility 
with py 2.3).

And the only way to hit that code paths seems to be subclassing `Dialect` and 
putting incorrect values in the various attributes (providing them to 
`csv.reader` raises a TypeError).

I believe the documentation to csv.Error should be changed to:

1. Mark it as effectively deprecated
2. Indicate that the only situation in which it it may be raised is when 
initializing a subclass of csv.Dialect

--
assignee: docs@python
components: Documentation
messages: 168096
nosy: docs@python, xmorel
priority: normal
severity: normal
status: open
title: csv.Error description is incorrectly broad
versions: Python 2.7, Python 3.3

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

_communicate_with_select has the same problem as _communicate_with_poll.

I don't understand why input has encoded if  universal_newlines and passed 
unchanged otherwise.

From my perspective input should be encoded (converted to bytes) if it is str 
regardless of universal_newlines value.

--
nosy: +asvetlov

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



[issue12623] universal newlines subprocess support broken with select- and poll-based communicate()

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue15634] synchronized decorator for the threading module

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

Writing such a decorator is pretty trivial to do.  On the other hand, I've done 
it often enough that I could be convinced it is useful to add.

I think it would be better to have a decorator generator that takes a lock as 
its argument, however, since an application might well want to use the same 
lock for sections that it doesn't make sense to decorate, or use an RLock 
instead of a lock.  If no lock is passed, a default Lock could be created.

--
nosy: +r.david.murray

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



[issue15634] synchronized decorator for the threading module

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

Oh, I misread your code.

The code I'm working on uses the lock to serialize several different functions, 
and your decorator wouldn't work for that.

--

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +asvetlov

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



[issue15635] memory leak with generators

2012-08-13 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

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



[issue15604] PyObject_IsTrue failure checks

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue15557] Tests for webbrowser module

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue15634] synchronized decorator for the threading module

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm not sure how useful that is in practice. Often you want to use the same 
lock accross several functions or methods.
Also, I think it would be more accurate to call this serialized than 
synchronized.

--
nosy: +jyasskin, pitrou

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

If I remember correctly it existed in one of the versions (python vs C) but not 
in both.  Or, it existed but wasn't actually respected by one of the versions.

--
nosy: +pitrou, r.david.murray

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



[issue15571] Python version of TextIOWrapper ignores write_through arg

2012-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba055ccd99ef by Andrew Svetlov in branch 'default':
Issue #15571: comment the fact what python impl of TextIOWrapper always works 
in write_throuth mode
http://hg.python.org/cpython/rev/ba055ccd99ef

--
nosy: +python-dev

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The C version seems to have it in 3.2 as well:

http://hg.python.org/cpython/file/5b629e9fde61/Modules/_io/textio.c#l818

Is it possible you were thinking of issue 15571 (not used in Python version 
but still respected)?

--

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



[issue15571] Python version of TextIOWrapper ignores write_through arg

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Patch applied

--
nosy: +asvetlov
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

See 9144014028f3. It was part of a bugfix in the 3.2 branch, therefore it 
wasn't exposed as a public API.

--

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread Antoine Pitrou

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


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

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 As I can see in subprocess.py TextIOWrapper is applied to stdin also in 
 non-buffered (write_through=True) mode.

In 3.2, I will not mention the write_through argument based on Antoine's 
response to issue 15638.

--

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



[issue15638] incorrect version info for TextIOWrapper write_through docs

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Ah, thank you. I see.

--

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



[issue10224] Build 3.x documentation using python3.x

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 814462492fbd by Andrew Svetlov in branch 'default':
Issue #15151: PEP 362 — document signature and related classes for inspect.py
http://hg.python.org/cpython/rev/814462492fbd

--
nosy: +python-dev

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



[issue15635] memory leak with generators

2012-08-13 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I've added calls to vmmap to the script (using os.system) to check my guesss.

The relevant bit after the call to test_iter(124):

REGION TYPE  VIRTUAL
===  ===
MALLOC405.9Msee MALLOC ZONE table below
MALLOC guard page32K
MALLOC metadata 376K
STACK GUARD56.0M
Stack  8192K
VM_ALLOCATE   4K
__DATA 1720K
__LINKEDIT 53.4M
__TEXT 12.1M
__UNICODE   544K
shared memory 8K
===  ===
TOTAL 538.1M

 VIRTUAL ALLOCATION  BYTES
MALLOC ZONE SIZE  COUNT  ALLOCATED  % FULL
===  ===  =  =  ==
DefaultMallocZone_0x100436000 404.9M 414059 390.6M 96%
DispatchContinuations_0x1007dc000  1024K 17   1056  0%
===  ===  =  =  ==
TOTAL 405.9M 414076 390.6M 96%

Memory usage:  14.3 MB



And after the call to test_iter(113)


REGION TYPE  VIRTUAL
===  ===
MALLOC208.9Msee MALLOC ZONE table below
MALLOC freed, no zone 456.0M
MALLOC guard page32K
MALLOC metadata 392K
STACK GUARD56.0M
Stack  8192K
VM_ALLOCATE   4K
__DATA 1720K
__LINKEDIT 53.4M
__TEXT 12.1M
__UNICODE   544K
shared memory 8K
===  ===
TOTAL 797.1M

 VIRTUAL ALLOCATION  BYTES
MALLOC ZONE SIZE  COUNT  ALLOCATED  % FULL
===  ===  =  =  ==
DefaultMallocZone_0x100436000 207.9M 209467 197.0M 94%
DispatchContinuations_0x1007dc000  1024K 17   1056  0%
===  ===  =  =  ==
TOTAL 208.9M 209484 197.0M 94%


Memory usage: 462.6 MB



The total amount of memory usage is grown by about 450 MBytes  (according to 
psutils). This is explained by the change in MALLOC memory, before:



MALLOC405.9Msee MALLOC ZONE table below
MALLOC guard page32K
MALLOC metadata 376K

Total: about 406 MByte

After:


MALLOC208.9Msee MALLOC ZONE table below
MALLOC freed, no zone 456.0M
MALLOC guard page32K
MALLOC metadata 392K

Total: about 665 MByte.


The difference is about 260 MBytes, which is significant but less than the 
difference according to psutil. But: the psutil difference as calculated by the 
script is the difference in RSS, not VSIZE (which vmmap shows).

If I change the _mem function to use the VSIZE the before and after values are:

Memory usage: 2390.4 MB
Memory usage: 2846.4 MB

Difference: about 456 MByte, which is still higher than the output of vmmap. 

Note that the same behavior can be seen by a much simpler script:

print Large
x = list(range(124))
print _mem()
del x
print _mem()

print

print Small
x = list(range(123))
print _mem()
del x
print _mem()

(where _mem is the same function as in testiterbug.py).

The output is:

Large
Memory usage: 527.3 MB
Memory usage:  19.3 MB

Small
Memory usage: 330.6 MB
Memory usage: 147.6 MB


With this script is see the same pattern with vmmap: with the small list a 
large amount of memory is in regions of type (MALLOC freed, no zone).

All of this clearly points towards malloc not releasing allocated memory to the 
system. This is perfectly fine and not a bug in either Python or the system.

--

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Closing the issue. Feel free to reopen if you have some corrections.

--

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-13 Thread Andrew Svetlov

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


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - enhancement

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Meador Inge

Meador Inge added the comment:

I debugged this a bit by comparing the behavior of 3.3 against 3.2.  For both 
cases I used the following code and debugged it in Python via pdb*:

   import importlib
   importlib.__import__('my_test_package')

ISTM that the difference in behavior is a result of what loader gets chosen for 
the initial `import 'my_test_package'`.

With 3.2 a importlib._bootstrap._SourceFileLoader loader gets created against 
'my_test_package/__init__.py'.  This works fine because _SourceFileLoader fixes 
up sys.modules when it loads.

With 3.3 a _frozen_importlib.ExtensionFileLoader loader gets created against 
'my_test_package/__init__.so'.  This doesn't work because ExtensionFileLoader 
does *not* fixup sys.module when it loads.

I hope that helps some.


* Which was a real pain for 3.3 since you are debugging the frozen importlib.  
You get line numbers at least, but it would be really nice if you could tell 
pdb a source file to use when you are dealing with bytecode only objects and\or 
you could disassemble the bytecode from pdb.

--

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 From my perspective input should be encoded (converted to bytes) if it is str 
 regardless of universal_newlines value.

I don't know the reason, but the limitation is documented:

The optional input argument should be data to be sent to the child process, or 
None, if no data should be sent to the child. The type of input must be bytes 
or, if universal_newlines was True, a string.

http://docs.python.org/dev/library/subprocess.html#subprocess.Popen.communicate

Maybe explicit better than implicit?

--

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-13 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you, Andrew.

One thing: can you please change:

 Print all keyword-only arguments without default values:

to

 Example: print all keyword-only arguments without default values:

?

--

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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-13 Thread Hynek Schlawack

Hynek Schlawack added the comment:

 Silence doesn't mean consent, but it does mean you can go ahead and see if 
 anyone complains :)

Well that's what I meant. :)

 I think your proposal is fine, but I'd prefer making the sentinels just 
 IGNORE and FAIL.  The module namespace means the names themselves don't 
 have to be fully qualified.

I thought about that but found them pretty...generic.

Anyway, that's 3.4-fodder. Could you have a look at the doc fix please?
It applies against 3.2.

--

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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2012-08-13 Thread R. David Murray

R. David Murray added the comment:

English-wise I would drop the Also.

You say differs from the one supplied, but given the rest of the text I would 
expect that it is really differs from the supplied mode masked with the 
current umask, on systems where the mode is respected, which is a mouthful :(. 

Perhaps it would flow better if the discussion of exists_ok came after the 
discussion of mode (that is, as the last thing in the paragraph).

--

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



[issue13742] Add a key parameter (like sorted) to heapq.merge

2012-08-13 Thread Éric Araujo

Éric Araujo added the comment:

Yes, 3.3 is already in beta.

--
keywords: +needs review
stage:  - patch review
versions: +Python 3.4 -Python 3.3

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Done in 843e0da7e91f

--

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Eric Snow

Eric Snow added the comment:

That's helpful, Meador.  With regards to the following, there's more to the 
story:

 With 3.3 a _frozen_importlib.ExtensionFileLoader loader gets created
 against 'my_test_package/__init__.so'.  This doesn't work because
 ExtensionFileLoader does *not* fixup sys.module when it loads.

In the example Stefan provided, look at my_test_package/__init__.c:921.  You'll 
find PyInit_my_test_package().  The module creation code from msg168026 comes 
from that function.  There PyImport_AddModule gets called, which adds the 
module to interp-modules.  I haven't had time to run this through gdb to see 
what's happening sys.modules in this case.

In general, I'm not familiar enough with extension modules to know if they are 
actually responsible for adding themselves to sys.modules.  I do see a number 
of places in Python/import.c and friends that touch sys.modules.

If importlib is in charge of adding it, though, I'd think that 
ExtensionFileLoader.load_module would need the module_for_loader decorator.

--

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Andrew, here is the new patch for 3.2.  3.3 will come shortly after.

--
Added file: http://bugs.python.org/file26783/issue-15561-3-branch-32.patch

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



[issue15635] memory leak with generators

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 The test case finds some leak in 3.3 too, it seems.

3.3 should be much better since it uses mmap() and munmap() to manage the 
object allocator's arenas (unless this is disabled under OS X for some reason, 
that is).

Here under Linux:

$ python3.3 testiterbug.py 
3.3.0b1 (default:1d811e1097ed, Jul 29 2012, 20:20:37) 
[GCC 4.5.2]

[row for row in iterit(16777216)]
Memory usage:   7.8 MB

[row for row in iterit(8388608)]
Memory usage:   7.8 MB

--
nosy: +pitrou

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is the patch for the default/3.3 branch, which for convenience is a diff 
for the branch *after the 3.2 patch has been forward-ported to 3.3*.

I did not think it was necessary to mention write_through specifically since it 
seems more like an implementation detail (though stdin as a whole is now 
documented).

--
Added file: 
http://bugs.python.org/file26784/issue-15561-3-branch-default-delta.patch

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-13 Thread Daniel Ellis

Daniel Ellis added the comment:

I've updated 2.7 with the examples and made changes where backward 
compatibility was an issue.

--
Added file: http://bugs.python.org/file26785/2.7_branch_etree_doc.patch

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-13 Thread Daniel Ellis

Daniel Ellis added the comment:

Fixed typo I made in examples in default branch.

--
Added file: http://bugs.python.org/file26786/default_branch_etree_doc_3.patch

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



[issue15635] memory leak with generators

2012-08-13 Thread Florent Xicluna

Florent Xicluna added the comment:

 All of this clearly points towards malloc not releasing allocated memory to 
 the system.
 This is perfectly fine and not a bug in either Python or the system.

So it means there's no reliable way to measure the memory consumption of the 
program.
Sorry for the wrong report, if this is confirmed.

--

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



[issue15635] memory leak with generators

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

  All of this clearly points towards malloc not releasing allocated memory to 
  the system.
  This is perfectly fine and not a bug in either Python or the system.
 
 So it means there's no reliable way to measure the memory consumption of the 
 program.

What it means is that memory consumption itself is a bit ill-defined.
ps, top and friends will tell you the amount of memory (physical or
virtual) currently assigned by the OS to the process. It doesn't tell
you whether the memory is actually in use by the program.

Note that, in Python 3.3, sys._debugmallocstats() gives you
fined-grained information about the object allocator. This excludes any
blocks bigger than 512 bytes, though, since those are requested directly
using malloc() and free().

--

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I can reproduce, but it's not obvious to me what the test does or why it should 
succeed rather than fail.

For the record, here is the gdb traceback:

#0  0x753c6dc8 in XQueryExtension () from /usr/lib64/libX11.so.6
#1  0x753ba4d4 in XInitExtension () from /usr/lib64/libX11.so.6
#2  0x74959672 in XextAddDisplay () from /usr/lib64/libXext.so.6
#3  0x74b5ea96 in ?? () from /usr/lib64/libXrandr.so.2
#4  0x74b5ee36 in XRRQueryVersion () from /usr/lib64/libXrandr.so.2
#5  0x759274ec in ffi_call_unix64 ()
at /home/antoine/cpython/default/Modules/_ctypes/libffi/src/x86/unix64.S:75
#6  0x75926f5e in ffi_call (cif=0x7fffbd30, fn=0x74b5ee10 
XRRQueryVersion, rvalue=
0x7fffbe10, avalue=0x7fffbde0)
at /home/antoine/cpython/default/Modules/_ctypes/libffi/src/x86/ffi64.c:492
#7  0x7590ed27 in _call_function_pointer (flags=4353, 
pProc=0x74b5ee10 XRRQueryVersion, 
avalues=0x7fffbde0, atypes=0x7fffbdb0, restype=0x75b587e8, 
resmem=0x7fffbe10, argcount=3)
at /home/antoine/cpython/default/Modules/_ctypes/callproc.c:800
#8  0x7590f90c in _ctypes_callproc (pProc=0x74b5ee10 
XRRQueryVersion, argtuple=
(0, CArgObject at remote 0x75b4c120, CArgObject at remote 
0x75b4c350), flags=4353, argtypes=
0x0, restype=_ctypes.PyCSimpleType at remote 0xa171c0, checker=0x0)
at /home/antoine/cpython/default/Modules/_ctypes/callproc.c:1143
#9  0x75908dec in PyCFuncPtr_call (self=0x75b4de60, inargs=
(0, CArgObject at remote 0x75b4c120, CArgObject at remote 
0x75b4c350), kwds=0x0)
at /home/antoine/cpython/default/Modules/_ctypes/_ctypes.c:3804
#10 0x00593e7b in PyObject_Call (func=
_FuncPtr(__name__='XRRQueryVersion') at remote 0x75b4de60, arg=
(0, CArgObject at remote 0x75b4c120, CArgObject at remote 
0x75b4c350), kw=0x0)
at Objects/abstract.c:2083
[...]

--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge, pitrou
versions: +Python 3.3

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This issue may be the bug referenced here:

# BUG: can't give a non-empty stdin because it breaks both the
# select- and poll-based communicate() implementations.
(stdout, stderr) = p.communicate()

http://hg.python.org/cpython/file/843e0da7e91f/Lib/test/test_subprocess.py#l618

The reason is that the above test would fail if stdin were not None since the 
input to communicate is None.

I am preparing a test and patch for this issue.

--

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



[issue12436] Missing items in installation/setup instructions

2012-08-13 Thread Mike Hoy

Mike Hoy added the comment:

Thanks, I will take all contributions and suggestions and propose one patch.

I am able to start working on this issue again, Eric. If you want to give me 
the status of your patch I can either help you finish it up or I can make one 
this week.

--

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Brett Cannon

Brett Cannon added the comment:

So imp.load_dynamic() does add a module to sys.modules (I'm using Python 3.2 
here because that's what I have access to, but I verified this yesterday at 
home)::


Python 3.2.3 (default, May  3 2012, 15:51:42) 
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 import imp
 import sys
 'resource' in sys.modules
False
 mod = imp.load_dynamic('resource', 
 '/usr/lib/python3.2/lib-dynload/resource.cpython-32mu.so')
 mod
module 'resource' from 
'/usr/lib/python3.2/lib-dynload/resource.cpython-32mu.so'
 'resource' in sys.modules
True

IOW it is not needed for ExtensionFileLoader to add the module explicitly to 
sys.modules.

As for Meador's notice that __init__.py was being imported, I believe Stefan is 
saying it should work without that file. So deleting __init__.py and only 
having __init__.so in Python 3.2 should work. If not then this has been a false 
alarm.

--

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Meador Inge

Meador Inge added the comment:

On Mon, Aug 13, 2012 at 12:18 PM, Brett Cannon rep...@bugs.python.org wrote:

 So deleting __init__.py and only having __init__.so in Python 3.2 should work.

It doesn't work:

quicksilver:bugs meadori$ python.exe --version
Python 3.2.3+
quicksilver:bugs meadori$ PYTHON=python.exe ./test.sh
['__main__', '_abcoll', '_bisect', '_codecs', '_collections',
'_functools', '_heapq', '_io', '_locale', '_sre', '_thread',
'_weakref', '_weakrefset', 'abc', 'bisect', 'builtins', 'codecs',
'collections', 'copyreg', 'encodings', 'encodings.aliases',
'encodings.latin_1', 'encodings.utf_8', 'errno', 'functools',
'genericpath', 'heapq', 'io', 'itertools', 'keyword', 'linecache',
'locale', 'my_test_package', 'operator', 'os', 'os.path', 'posix',
'posixpath', 're', 'reprlib', 'signal', 'site', 'sre_compile',
'sre_constants', 'sre_parse', 'stat', 'sys', 'sysconfig', 'token',
'tokenize', 'traceback', 'weakref', 'zipimport']
FILE:  my_test_package/__init__.py
PATH:  ['my_test_package']
Real package file used: my_test_package/__init__.so
[36494 refs]
quicksilver:bugs meadori$ rm my_test_package/__init__.py
quicksilver:bugs meadori$ PYTHON=python.exe ./test.sh
Traceback (most recent call last):
  File string, line 1, in module
ImportError: No module named my_test_package
[36287 refs]

--

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



[issue15637] Segfault reading null VMA (works fine in python 2.x)

2012-08-13 Thread Alberto Milone

Alberto Milone added the comment:

it should just be possible to retrieve major and minor which we pass by 
reference to XRRQueryVersion. Without this pretty much any other call fails.

Also, it works without problems with python 2.7.

--
versions:  -Python 3.3

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Stefan Behnel

Stefan Behnel added the comment:

Interesting. I didn't know that. The .py file is always installed automatically 
next to the .so file by distutils.

Here's what strace gives me:

Python 2.7:

stat(my_test_package, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat(my_test_package/__init__.py, {st_mode=S_IFREG|0664, st_size=557, ...}) = 0
stat(my_test_package/__init__, 0x7fffdc9dd320) = -1 ENOENT (No such file or 
directory)
open(my_test_package/__init__.so, O_RDONLY) = 3
open(my_test_package/__init__.so, O_RDONLY|O_CLOEXEC) = 4

Python 3.2:

stat(my_test_package, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat(my_test_package/__init__.py, {st_mode=S_IFREG|0664, st_size=557, ...}) = 0
stat(my_test_package/__init__, 0x7fff9d99d700) = -1 ENOENT (No such file or 
directory)
stat(my_test_package/__init__.cpython-32mu.so, {st_mode=S_IFREG|0775, 
st_size=82517, ...}) = 0
open(my_test_package/__init__.cpython-32mu.so, O_RDONLY) = 3
open(my_test_package/__init__.cpython-32mu.so, O_RDONLY|O_CLOEXEC) = 4

Python 3.3:

stat(./my_test_package, {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat(./my_test_package/__init__.cpython-33dm.so, {st_mode=S_IFREG|0775, 
st_size=36119, ...}) = 0
open(./my_test_package/__init__.cpython-33dm.so, O_RDONLY|O_CLOEXEC) = 3

That's the difference then.

Ok, I think we'll have to emulate this for older CPython versions as well for 
the case that the .py file is not there. So it's likely best to let Cython 
register the package in sys.modules at init time, right after calling 
AddModule().

Still - can this be implemented in CPython for 3.3? Or 3.4, given that it might 
appear like a new feature? There shouldn't be all that much to change.

--

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



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-13 Thread Brett Cannon

Brett Cannon added the comment:

My guess is import.c is noticing the __init__.py, creating the module for the 
package, and then somehow it cascades into importing __init__.so which 
essentially does a reload on the module object that is already in sys.modules 
and thus doesn't cause the parent module check to fail.

The problem with that is those semantics suck as that assumes cascading 
semantics which would cross the finder/loader barrier. So we can't keep the 
*exact* semantics in Python 3.3.

But I do see three possible solutions to fixing this. One is testing if having 
ExtensionFileLoader insert a practically empty module into sys.modules *before* 
calling imp.load_dynamic(). This would actually be easy to test by using 
importlib.util.module_for_loader on ExtensionFileLoader.load_module(). This 
might be a slight change in semantics (and assumes imp.load_dynamic() will do a 
reload as appropriate instead of blindly creating a new module), but then if 
anyone is going to notice it will be Cython so if it works in this case and 
Cython doesn't fail further it is probably safe.

The second option is to tweak the extension module initialization process to 
make sure the module being initialized is inserted into sys.modules early 
enough and still cleaned up properly. The question, though, is what is it doing 
now as the module is not passed in directly into the PyInit function but by 
PyModule_Create instead and I don't know who handles cleanup of the module if 
something fails and the PyInit returns NULL.

Third is having Cython tweak itself for 3.3 to just directly inject the module 
object into sys.modules before it does any relative imports. It's the least 
graceful solution and puts the onus on Cython for a change in semantics, but I 
don't see why that would break anything.

--

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 381aaf79c254 by Andrew Svetlov in branch '3.2':
Issue #15561: Update subprocess docs to reference io.TextIOWrapper.
http://hg.python.org/cpython/rev/381aaf79c254

New changeset 0cd9423770fa by Andrew Svetlov in branch 'default':
Issue #15561: Update subprocess docs to reference io.TextIOWrapper.
http://hg.python.org/cpython/rev/0cd9423770fa

--
nosy: +python-dev

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fixed.
BTW I prefer to use «stream» as alias to file object it subprocess context. 
«file» can clash with «the real file in filesystem» for documentation reader.

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

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Fixed. BTW I prefer to use «stream» as alias to file object

Thanks a lot, Andrew.  Yes, I agree and actually contemplated doing that myself.

--

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



[issue15497] correct characters in TextWrapper.replace_whitespace docs

2012-08-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +asvetlov
versions: +Python 3.2

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-08-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +asvetlov

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



[issue14167] document return statement in finally blocks

2012-08-13 Thread Andrew Svetlov

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


--
nosy: +asvetlov

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



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-08-13 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15627
___
___
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-08-13 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - brett.cannon

___
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



[issue15628] Add import ABC hierarchy to docs for importlib

2012-08-13 Thread Brett Cannon

Brett Cannon added the comment:

http://hg.python.org/cpython/rev/1c8a6df94602 seems to be commit this.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue15640] Document deprecate importlib.abc.Finder

2012-08-13 Thread Brett Cannon

New submission from Brett Cannon:

importlib.abc.Finder is no longer the proper level of abstraction for either 
meta path finders or path entry finders, so direct inheritance should be 
discouraged by documenting deprecation for the class (actual deprecation will 
need to be avoided as the constructor gets involved and having that error out 
if someone sets warnings to errors would be bad). Should probably also document 
as deprecated importlib.abc.PathEntryFinder.find_module().

Also need to remember to update the inheritance hierarchy now added to the docs 
with a note next to the class about the deprecation (along with PyLoader and 
PyPycLoader).

--
assignee: brett.cannon
components: Documentation
messages: 168138
nosy: barry, brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Document deprecate importlib.abc.Finder
versions: Python 3.3

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



[issue15640] Document importlib.abc.Finder as deprecated

2012-08-13 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
title: Document deprecate importlib.abc.Finder - Document importlib.abc.Finder 
as deprecated

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I like to accept both str and bytes if universal_newlines is False and raise 
explicit exception for bytes if universal_newlines is True.

Looks like universal_newlines for bytes doesn't make sense, also we prefer to 
use str everywhere. Bytes should be used if it is really byte-stream or if 
unicode cannot be passed by some limitations of underlying OS etc.

There are couple dark corners:
1. What to do if stdin doesn't have `encoding` attribute? Convert to bytes 
using filesystemencoding? Raise explicit exception? Adding `encode` parameter 
for .communicate doesn't looks elegant.
2. How .communicate works on Windows? I see completely different implementation 
of this method for win32.

I need some time to investigate before publish proposal to python-dev list.

--

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



[issue15641] Clean up importlib for Python 3.4

2012-08-13 Thread Brett Cannon

New submission from Brett Cannon:

importlib.abc.PyLoader and importlib.abc.PyPycLoader were both deprecated in 
3.2 and slated for removal in Python 3.4. There is also some os2 stuff in 
importlib._bootstrap which can go as PEP 11 has os2 support slated for removal 
in Python 3.4.

--
assignee: brett.cannon
messages: 168140
nosy: brett.cannon, eric.snow, ncoghlan
priority: low
severity: normal
stage: needs patch
status: open
title: Clean up importlib for Python 3.4
versions: Python 3.4

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching a failing test case.

Also, to confirm, this issue does not seem to affect 3.2.

--
keywords: +patch
Added file: http://bugs.python.org/file26787/failing-test-case-1.patch

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
stage: test needed - needs patch

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



[issue15497] correct characters in TextWrapper.replace_whitespace docs

2012-08-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 90a8a462d2f7 by Andrew Svetlov in branch '3.2':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/90a8a462d2f7

New changeset edcbf3edf701 by Andrew Svetlov in branch 'default':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/edcbf3edf701

New changeset 3bddc965e2ea by Andrew Svetlov in branch '2.7':
Issue #15497: Correct characters in TextWrapper.replace_whitespace docs.
http://hg.python.org/cpython/rev/3bddc965e2ea

--
nosy: +python-dev

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



[issue15497] correct characters in TextWrapper.replace_whitespace docs

2012-08-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Done. Thanks, Chris.

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

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-13 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +asvetlov

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



[issue15642] Integrate pickle protocol version 4 GSoC work by Stefan Mihaila

2012-08-13 Thread Alexandre Vassalotti

New submission from Alexandre Vassalotti:

Stefan Mihaila has been working on the implementation of PEP 3154, plus some 
other enhancements. His work is pretty complete and ready to be reviewed. I 
will do my best to finish a thorough review of his changes by the end of next 
week.

--
assignee: alexandre.vassalotti
components: Library (Lib)
hgrepos: 145
keywords: gsoc, patch
messages: 168144
nosy: alexandre.vassalotti, mstefanro, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Integrate pickle protocol version 4 GSoC work by Stefan Mihaila
type: enhancement
versions: Python 3.4

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



[issue15631] Python 3.3 beta 1 installation issue lib/lib64 folders

2012-08-13 Thread Georg Brandl

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


--
nosy: +doko

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching patch.

--
stage: needs patch - patch review
Added file: http://bugs.python.org/file26788/issue-15592-1.patch

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-08-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In msg132312 Nick asked where do we stand in regards to backwards 
compatibility of the AST?

The current ast module chapter, second sentence, says The abstract syntax 
itself might change with each Python release; this module helps to find out 
programmatically what the current grammar looks like.
where 'current grammar' is copied in 30.2.2. Abstract Grammar.

I do not know when that was written, but it clearly implies the the grammark, 
which defines node classes, is x.y version specific. I think this is the 
correct policy just so we can make changes, hopefully improvements, such as the 
one proposed here.

--

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



[issue15633] httplib.response is not closed after all data has been read

2012-08-13 Thread Nikolaus Rath

Nikolaus Rath added the comment:

The problem seems to occur regularly, just with large intervals in between. Is 
there any specific information that might help here? I am not quite sure what 
to save when the problem happens the next time. Can the response object be 
pickled?

--

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



[issue8800] add threading.RWLock

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Perhaps this proposed patch is overly complex.

I don't know. Do you think relaxing the semantics would make the implementation 
significantly faster?
(interesting link, btw)

--

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



[issue15496] harden directory removal for tests on Windows

2012-08-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Brian, Tim, do you think this should be committed?

--
versions:  -Python 3.4

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



[issue15496] harden directory removal for tests on Windows

2012-08-13 Thread Brian Curtin

Brian Curtin added the comment:

The latest patch to test.support looks reasonable. Go for it.

--

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



  1   2   >