[issue24250] Optimization for strcpy(..., ) in file 'install.c'

2015-05-21 Thread Paul Moore

Paul Moore added the comment:

The patch looks fine to me, although I don't think you need the comment showing 
the old code. The new code is perfectly clear on its own.

--
nosy: +paul.moore

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



[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PyObject_IsInstance() is used incorrectly for testing if Python object is an 
instance of specified builtin type before direct access to internals of object. 
This is not correct, because PyObject_IsInstance() checks the __class__ 
attribute that can be modified and even can be dynamic property. Correct way is 
to check static type. Proposed patch replaces PyObject_IsInstance() with 
PyObject_TypeCheck() if this is appropriate.

See also similar issues issue24102 and issue24091.

--
components: Extension Modules, Interpreter Core
files: typecheck.patch
keywords: patch
messages: 243739
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Incorrect use of PyObject_IsInstance
type: crash
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file39450/typecheck.patch

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Removed file: http://bugs.python.org/file39448/async_docs_v1.patch

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file39449/async_docs_v1.patch

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



[issue24256] threading.Timer is not a class

2015-05-21 Thread Ned Deily

Ned Deily added the comment:

This is really a duplicate of Issue5831 which ended up being closed as a 
duplicate of Issue10968.  The resolution of the latter issue was to change 
threading.Timer in Python 3.3 to actually be a class, a new feature.  But it 
appears that along the way the issue of correcting the documentation for 2.7 
was never addressed.  Perhaps you could propose wording for a documentation 
patch?

--
nosy: +ned.deily
stage:  - needs patch

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



[issue24237] PEP 479: missing DeprecationWarning when generator_stop is not used

2015-05-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Why the switch to WriteUnraisable? Unlike __del__ methods and similar 
operations that may be invoked at arbitrary points, there's nothing stopping us 
from emitting an exception here - indeed, we're *already* handling an exception.

Getting a hard failure on deprecations is one of the expected consequences of 
using -Wall rather than the default settings.

--

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Yury Selivanov

New submission from Yury Selivanov:

Please find attached a docs patch for PEP 492 changes.

I'd really appreciate if someone can review it / help me with it.  I think it's 
important to have at least some documentation shipped with beta-1, so that 
people start testing the feature.

--
assignee:  - yselivanov
components: +Documentation
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file39448/async_docs_v1.patch

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



[issue24255] Replace debuglevel-related logic with logging

2015-05-21 Thread Demian Brecht

New submission from Demian Brecht:

Far too many times have I wished that changing the logging output in 
http.client was controllable through logging configuration rather than code 
changes modifying a connection's debuglevel.

It would be nice if the http package was brought up to date and had 
debuglevel-related code replaced with logging and sane logging was added 
throughout.

--
components: Library (Lib)
messages: 243734
nosy: demian.brecht
priority: normal
severity: normal
stage: needs patch
status: open
title: Replace debuglevel-related logic with logging
type: enhancement
versions: Python 3.6

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Ned Deily

Ned Deily added the comment:

FWIW, the random segfault seems to be triggered by hash randomization.  If I 
disable randomization, it does not seem to fail:

for i in `seq 1 20`; do PYTHONHASHSEED=1 ./python -m test.regrtest -m 
test_basic test_configparser ; done

Presumably, the --forever option does not vary the hash seed value?

Also, FWIW, clang issues a warning:

../../source/Objects/odictobject.c:550:15: warning: comparison of unsigned 
expression  0
  is always false [-Wtautological-compare]
if (i  0) {
~ ^ ~

for this:

_odict_FOREACH(od, node) {
size_t i = _odict_get_index(od, _odictnode_KEY(node));
if (i  0) {
od-od_size = prev_size;
PyMem_FREE(fast_nodes);
return -1;
}
fast_nodes[i] = node;

I can supply OS X crash tracebacks if they would be of help.

--
nosy: +ned.deily

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



[issue24252] IDLE removes elements from tracebacks.

2015-05-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The two additional entries are the last two.  In this case, they are needed 
because KeyError pertains to the dict lookup in the last line 
self.breaks[filename].

Mistaken in this particular case or not, the deletion is intentional. 
Run.print_exception has these two lines:
exclude = (run.py, rpc.py, threading.py, Queue.py,
   RemoteDebugger.py, bdb.py)
cleanup_traceback(tbe, exclude)
The docstring for cleanup_traceback is Remove excluded traces from 
beginning/end of tb; get cached lines.

The intent of the first 4 excludes is to make the tracebacks displayed in Idle 
for normal (non-debug) code the same as with Python, without Idle.  The intent 
of the last 2 is to continue the equivalence when using the Idle debugger 
(which inherits from bdb.py).

Using pdb with Idle is known to be somewhat problematical because Idle revises 
the execution environment.  In particular, identical tracebacks cannot be 
guaranteed.  (I tried to find the issue bug the buggy tracker search did not 
return the issue.)

A fix for this particular example would be to omit/remove bdb from exclude 
(which could be a set) when the first item contains 'pdb'.  I would consider a 
patch to do that.

--
stage:  - needs patch

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



[issue24256] threading.Timer is not a class

2015-05-21 Thread John Runyon

New submission from John Runyon:

the documentation 
(https://docs.python.org/2/library/threading.html#threading.Timer) lists 
threading.Timer as a class. It is not, which means that (for example) you can 
not use it in isinstance(). threading._Timer is a class. 
threading.Timer(...).__class__ is a class. threading.Timer is a function.

 import threading
 threading.Timer
function Timer at 0x7f99cae23848

--
assignee: docs@python
components: Documentation
messages: 243735
nosy: docs@python, jrunyon
priority: normal
severity: normal
status: open
title: threading.Timer is not a class
versions: Python 2.7

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



[issue24115] Unhandled error results of C API functions

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch adds handling of error results of following functions: 
PyObject_IsTrue(), PyObject_Not(), PyObject_IsInstance(), 
PyObject_RichCompareBool(), _PyDict_Contains(). All these functions usually 
return 0 or 1, but also can return -1 in the case of error, and this case was 
not handled in some places.

--
keywords: +patch
stage: needs patch - patch review
title: PyObject_IsInstance() and PyObject_IsSubclass() can fail - Unhandled 
error results of C API functions
Added file: http://bugs.python.org/file39451/issue24115.patch

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Patch looks worth merging to me. Some minor questions/quibbles:

Asynchronous iterator question: should the typical pattern for those be:

def __aiter__(self):
return self
def __await__(self):
return self

Did we put the ABC's in the right place? question: reviewing the draft docs 
meant I just noticed that collections.abc is quite an odd home for some of 
these. Probably not worth worrying about, given that AsyncIterator and 
AsyncIterable do belong, and the others are building blocks for those.

The What's New entry can be tweaked to replace proposes with added.

--

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



[issue24258] BZ2File objects do not have name attribute

2015-05-21 Thread Jozef Sivek

New submission from Jozef Sivek:

Unlike GzipFile the BZ2File does not have defined name attribute. The reading 
of this attribute results in: AttributeError: 'BZ2File' object has no 
attribute 'name'.

This is truly missing feature and wrong behaviour, compare:
https://hg.python.org/releasing/3.4.3/file/933c3041d548/Lib/gzip.py
and 
https://hg.python.org/releasing/3.4.3/file/933c3041d548/Lib/bz2.py

In addition to that the BZ2File did have name attribute in python 2.7.* .

In attachment there is tar ball with example files, expected results in python 
3 and results in python 2.

--
components: Library (Lib)
files: bz2file.tar
messages: 243743
nosy: jojko.sivek
priority: normal
severity: normal
status: open
title: BZ2File objects do not have name attribute
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file39452/bz2file.tar

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



[issue24254] Make class definition namespace ordered by default

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

Here's a patch that drops adding __definition_order__.  You can get the same 
effect by adding `__definition_order__ = list(locals())` at the bottom of your 
class definition.  The benefit of having `__definition_order__` is that the 
information is automatically available for later use rather than forcing the 
class author to add the above line in order to benefit from external 
introspection/manipulation.  The downside is that every syntax-defined class 
will have the extra attribute with the list of definition order, which might be 
an unnecessary waste, even if not a huge one.

Ultimately, I'd prefer to keep `__definition_order__`.

--
Added file: http://bugs.python.org/file39456/just-default-to-odict.diff

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



[issue20438] inspect: Deprecate getfullargspec?

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Please see the new patch.

So it's time to deprecate getargspec with a warning (was softly deprecated in 
3.0).

getfullargspec() and getcallargs() deprecation is documented.

I also want to deprecate formatargspec() and formatargvalues(), but Signature 
does not provide equivalents. Should we add them?

--
Added file: http://bugs.python.org/file39459/getargspec.diff

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Daniel.

--

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



[issue24237] PEP 479: missing DeprecationWarning when generator_stop is not used

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Nick, I've updated the patch to address all PendingDeprecationWarnings related 
to the PEP 479 in the test suite.

--
Added file: http://bugs.python.org/file39457/gen_stop_warn.patch

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread Tim Golden

Tim Golden added the comment:

Tests failed on Windows probably because of NamedTemporaryFile

--
nosy: +tim.golden

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread arachnegl

arachnegl added the comment:

Thanks Tim for testing on Windows and suggesting the change.

--
nosy: +gregorylo...@gmail.com
versions: +Python 3.4
Added file: http://bugs.python.org/file39458/test_turtle.patch

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread Tim Golden

Tim Golden added the comment:

@RDM I'm sitting with Greg at a London Python session and we've run through 
these tests on 3.4/3.5. I know you were reviewing this code at PyCon. Are you 
happy for me to commit from here?

--

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



[issue23985] Crash when deleting slices from duplicated bytearray

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 274c1b0a2494 by Serhiy Storchaka in branch '2.7':
Issue #23985: Fixed integer overflow in iterator object.  Original patch by
https://hg.python.org/cpython/rev/274c1b0a2494

New changeset 5b86a1abc8c3 by Serhiy Storchaka in branch '3.4':
Issue #23985: Fixed integer overflow in iterator object.  Patch by
https://hg.python.org/cpython/rev/5b86a1abc8c3

New changeset 9f2a1d9d7164 by Serhiy Storchaka in branch 'default':
Issue #23985: Fixed integer overflow in iterator object.  Patch by
https://hg.python.org/cpython/rev/9f2a1d9d7164

--

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-21 Thread Serhiy Storchaka

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


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue22939] integer overflow in iterator object

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Clement.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue23699] Add a macro to ease writing rich comparisons

2015-05-21 Thread Stefan Krah

Stefan Krah added the comment:

NotImplemented is a non-error return value that's used when the
objects cannot be compared, e.g. when the function receives Py_LT
but the objects are unorderable.

Getting a value outside {Py_EQ, ...} is a hard error that cannot
occur in a correct program.

--

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



[issue24250] Optimization for strcpy(..., ) in file 'install.c'

2015-05-21 Thread Serhiy Storchaka

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


--
priority: normal - low
stage:  - patch review
versions: +Python 3.5 -Python 3.4

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



[issue24056] Expose closure generator status in function repr()

2015-05-21 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file39461/issue24056_2.diff

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



[issue24056] Expose closure generator status in function repr()

2015-05-21 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Removed file: http://bugs.python.org/file39460/issue24056_2.diff

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



[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-21 Thread Paul Moore

Paul Moore added the comment:

I'm not sure I follow. Isn't the point of this patch to try again in certain 
cases of a PermissionError, where currently the code breaks out of the loop 
early? How can the result be worse than the current behaviour? Suerly sometimes 
(maybe not always) it works now where it previously failed, but that's a good 
thing?

--

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Hi Berker, thanks for the review. I think all your edits are reasonable, so 
I've just committed your patch as is.

--

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



[issue24260] TabError behavior doesn't match documentation

2015-05-21 Thread Evgeny Kapun

New submission from Evgeny Kapun:

In the documentation, it is said:

Indentation is rejected as inconsistent if a source file mixes tabs and 
spaces in a way that makes the meaning dependent on the worth of a tab in 
spaces; a TabError is raised in that case.

But that's not true. For example, Python thinks that these two indentations are 
consistent:

tab8 spaces
8 spacestab

However, their width would be different for any tab width except 1, 2, 4, and 8.

Actually, it's not easy to check that indentation is consistent as it is 
defined currently, so I think that it is the documentation that should be 
changed. So, I think that the paragraph that I quoted above should be changed 
to match the actual behavior.

--
components: Interpreter Core
messages: 243794
nosy: abacabadabacaba
priority: normal
severity: normal
status: open
title: TabError behavior doesn't match documentation
type: behavior
versions: Python 3.4

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



[issue23898] inspect() changes in Python3.4 are not compatible with objects that implement special __bool__, __eq__

2015-05-21 Thread mike bayer

mike bayer added the comment:

thanks for the merge!

--

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

It looks the patch includes changes for non-relevant files.

--
type:  - enhancement

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



[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-21 Thread Tim Golden

Tim Golden added the comment:

My reluctance to commit the os.access patch is because it will cause 
such a behaviour change in a function which has been pretty stable for a 
long while. It'll certainly be more correct, but at the undoubted 
expense of breaking someone's long-working code.

--

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



[issue24258] BZ2File objects do not have name attribute

2015-05-21 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +nadeem.vawda

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



[issue24250] Optimization for strcpy(..., ) in file 'install.c'

2015-05-21 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I agree with vadmium and also note that many compilers (though I don't know 
about MSVC) can optimize the strcpy call away.

--
nosy: +benjamin.peterson
resolution:  - works for me
status: open - closed

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Berker Peksag

Berker Peksag added the comment:

Hi Yury,

Here is a post commit review. I've mostly removed some additional PEP 492 
mentions and made a couple of trivial changes.

--
nosy: +berker.peksag
Added file: http://bugs.python.org/file39462/issue24180.diff

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5691d2d2d0a4 by Yury Selivanov in branch 'default':
Issue 24180: Fixes by Berker Peksag.
https://hg.python.org/cpython/rev/5691d2d2d0a4

--

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



[issue23973] PEP 484 implementation

2015-05-21 Thread Guido van Rossum

Guido van Rossum added the comment:

New patch.

--
Added file: http://bugs.python.org/file39463/pep484.diff

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-21 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +lars.gustaebel

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



[issue24250] Optimization for strcpy(..., ) in file 'install.c'

2015-05-21 Thread Martin Panter

Martin Panter added the comment:

For the record, the file being patched is PC/bdist_wininst/install.c

My opinion is the original is more readable, and unless this is some inner loop 
bottleneck here it seems like premature optimization.

--
nosy: +vadmium

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2015-05-21 Thread Martin Panter

Martin Panter added the comment:

I left some new comments.

However I remain concerned at how complicated and overloaded the API is 
becoming. It certainly makes it hard to review for correctness. I could easily 
have missed some corner case that is broken by the changes. There are a lot of 
odd body objects apparently permitted, e.g. GzipFile objects can always seek to 
the end but may not be able to go backwards, mmap() objects are both bytes-like 
and file-like.

--

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



[issue24256] threading.Timer is not a class

2015-05-21 Thread John Runyon

John Runyon added the comment:

Concise documentation isn't my forte, but my confusion would've been avoided 
with a note that for historical reasons, threading.Timer is actually a factory 
function for the underlying class threading._Timer or something along those 
lines.

--

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



[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2688655e431a by Serhiy Storchaka in branch 'default':
Issue #22955: Fixed reference leak in attrgetter.repr().
https://hg.python.org/cpython/rev/2688655e431a

--

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-21 Thread Thomas Güttler

New submission from Thomas Güttler:

The Python tarfile library does not detect a broken tar.

user@host$ wc -c good.tar
143360 good.tar

user@host$ head -c 13 good.tar  cut.tar

user@host$ tar -tf cut.tar 
...
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

Very nice, the command line tool recognizes an unexpected EOF.

user@host$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
 import tarfile
 tar=tarfile.open('cut.tar')
 tar.extractall()

Not nice. The Python library decodes the file, but raises no exception.

Is this a bug or feature?

Source: 
http://stackoverflow.com/questions/30302204/tar-extractall-does-not-recognize-unexpected-eof

--
messages: 243755
nosy: Thomas Güttler
priority: normal
severity: normal
status: open
title: tar.extractall() does not recognize unexpected EOF

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



[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 is it the case that if the current check passes incorrectly 
 one will always get a segfauilt or other error?

Yes, that is the case.  All four of these checks precede a reference to an 
structure member that depends on being an exact type or subtype.  So, yes they 
are all necessary to prevent segfaults or other undefined behavior.

--
nosy: +rhettinger

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



[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread R. David Murray

R. David Murray added the comment:

Is there any chance that these changes will break working code, or is it the 
case that if the current check passes incorrectly one will always get a 
segfauilt or other error?

--
nosy: +r.david.murray

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

Cool.  The following gives consistent failures at certain seed values:

  for i in `seq 1 100`; do echo $i; PYTHONHASHSEED=$i ./python -m test.regrtest 
-m test_basic test_configparser ; done

Through 100 I get segfaults with 7, 15, 35, 37, 39, 40, 42, 47, 50, 66, 67, 85, 
87, 88, and 92.  The distribution is probably essentially uniform across the 
full set of seeds, even if the exact pattern of failures isn't precisely 
uniform.  I'll try to see why those hashes are significant here.  If I can't 
figured it out quickly then I'll post about it on python-dev.

My hunch is that the hash randomization impacts either dict/odict resizing or 
dict/odict lookup (or both).  TBH, I've been pretty sure for a while that the 
segfault is coming out of one of those two.

--

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

Thanks for looking into this, Ned.  I've changed that size_t to ssize_t which I 
expect will quiet that clang warning you saw.  I'm glad you pointed it out 
because it means that that branch was never executing!  Unfortunately fixing 
that does not solve all my problems. wink

I'll look into the hash randomization connection.  Thanks for pointing that 
out.  Hopefully it doesn't complicate matters.  My guess is that the segfaults 
only happen for certain seeds, so I'll check that first.

--

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2015-05-21 Thread Rolf Krahl

Rolf Krahl added the comment:

Hi again,

first of all, sorry for not contributing to the discussion for such a long 
time.  I was quite busy lately.

I tested the patch with Python 3.5.0a3.  It works nicely for my use case.  
Thanks a lot!

I have one issue though: urllib's HTTPHandler and HTTPSHandler still try to 
enforce a Content-length to be set (by AbstractHTTPHandler.do_request_()).  But 
for chunked transfer encoding, the Content-length must not be set.  Using to 
this patch, HTTPConnection also checks for the Content-length in 
_send_request() and sets it if missing.  AFAICS, HTTPConnection now does a far 
better job checking this then HTTPHandler and - most importantly - does it in a 
way that is compatible with chunked transfer encoding.  So, I would suggest, 
that there is no need for HTTPHandler to care about the content length and that 
it should just leave this header alone.

E.g., I suggest that the if not request.has_header('Content-length'): [...] 
statement should completely be removed from AbstractHTTPHandler.do_request_() 
in urllib/request.py.

--

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



[issue24255] Replace debuglevel-related logic with logging

2015-05-21 Thread R. David Murray

R. David Murray added the comment:

+1

--
nosy: +r.david.murray

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



[issue24261] Add a command line flag to suppress default signal handlers

2015-05-21 Thread Evgeny Kapun

New submission from Evgeny Kapun:

Currently, Python always changes handling of certain signals on startup: 
SIGPIPE is ignored, and SIGINT is handled by a function that raises 
KeyboardInterrupt exception. As a result, if the user presses Ctrl-C, a 
backtrace is printed to stderr.

Some program may want to change this behavior. For example, they may want to 
print a user-friendly message, or to terminate without printing anything. They 
may do that by two means: either by installing their own handler for SIGINT, or 
by using a try..except block to handle the KeyboardInterrupt exception. 
However, they both have a flaw: if SIGINT is received during startup, before 
the program begins execution, the ugly KeyboardInterrupt backtrace is printed 
nevertheless. So, I propose to add a way to stop Python from installing this 
default SIGINT handler. I think that the most obvious way is to add a command 
line switch.

This switch should prevent Python from installing its SIGINT handler. It may 
also prevent it from ignoring SIGPIPE, so that all signal actions would stay 
the same as when the program was executed. After that, programs may use signal 
module to set up their own handlers, if that is desired.

--
components: Interpreter Core
messages: 243795
nosy: abacabadabacaba
priority: normal
severity: normal
status: open
title: Add a command line flag to suppress default signal handlers
type: enhancement

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



[issue24261] Add a command line flag to suppress default signal handlers

2015-05-21 Thread R. David Murray

R. David Murray added the comment:

See also issue 14228.

--
nosy: +r.david.murray

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



[issue14228] Don't display traceback when import site is interrupted by CTRL+c

2015-05-21 Thread Evgeny Kapun

Changes by Evgeny Kapun abacabadabac...@gmail.com:


--
nosy: +abacabadabacaba

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



[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Serhiy, go ahead and apply your patch.  The existing code is clearly wrong.

--
assignee:  - serhiy.storchaka

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



[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-21 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
nosy: +ethan.furman

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



[issue12319] [http.client] HTTPConnection.request not support chunked Transfer-Encoding to send data

2015-05-21 Thread Martin Panter

Martin Panter added the comment:

This bug and Demian’s patch were originally about changing the low-level 
http.client.HTTPConnection class. I suggest opening a separate issue for 
changing urllib.request.urlopen() or similar, to avoid confusion.

It should actually be possible to support chunking in urlopen() without any new 
support from HTTPConnection; just use the lower-level putrequest(), 
putheader(), endheader(), and send() methods. However, consideration should be 
given to how it interacts with handlers like HTTPBasicAuthHandler that resend 
POST data after getting 401 Unauthorized (similar scenario to Issue 5038).

--
title: [http.client] HTTPConnection.putrequest not support chunked 
Transfer-Encodings to send data - [http.client] HTTPConnection.request not 
support chunked Transfer-Encoding to send data

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

I've spent a bit of time exploring the segfault.  Here's some data that might 
help relative to the configparser test.

I put the following at the beginning of _odict_resize:

Py_ssize_t len = PyObject_Size((PyObject *)od);
if (len == 0)
PySys_FormatStdout(.);
else {
if (((PyDictObject *)od)-ma_keys-dk_size  od-od_size)
PySys_FormatStdout(-);
if (len  10)
PySys_FormatStdout(%d, len);
else
PySys_FormatStdout(+);
}
if (len = 10)
PySys_FormatStdout(%d\n, len);

If the current item count is 0 then it prints a dot.  If the resize is 
shrinking then it prints a - (this did not happen).  Otherwise the odict is 
growing and it prints the current item count.  Multi-digit numbers are preceded 
by + and followed by a newline.

I've included the results of different hash seeds (0/no randomization, 1, and 
7).  You'll notice how the results are subtly different.  In the case of 7, it 
matches no randomization up to the point that it segfaults.  I got the same 
results with 15.  However, 35 fails right after the second +22.

$ PYTHONHASHSEED=0 ./python -m test.regrtest -m test_basic test_configparser
...6+12
+22
6+12
+22
6.6+10
6.6+10
6.6+10
6.6+10
6.6+10
.+10
6.6+10
6.6+10
6.6+10
6.6...6..6+10
6.6.6.6.66.66.6.6.6.6.+12
6.+12
6.6.6.6.6.6.6.6.6.+22
6.+22
6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.+44
6.+44
6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.+86
6.+86
6.6.6.6.6.6.6.6.6.6.6.6.6.6.66.6+10
6.6+10
6.6+10
6.6+10
.6..

$ PYTHONHASHSEED=1 ./python -m test.regrtest -m test_basic test_configparser
...6+12
+22
6+12
+22
6.66.66.66.66.6.+11
6.66.66.66.6...6..66.6.6.6.66.66.6.6.6.6.+12
6.+12
6.6.6.6.6.6.6.6.6.+22
6.+22
6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.+44
6.+44
6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.+86
6.+86
6.6.6.6.6.6.6.6.6.6.6.6.6.6.66.66.66.66.6.6..

$ PYTHONHASHSEED=7 ./python -m test.regrtest -m test_basic test_configparser
...6+12
+22
6+12
+22
6.6+10
6.6+10
6.6+10
6.6+10
6.6+10
.+10
Fatal Python error: Segmentation fault

--

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



[issue24261] Add a command line flag to suppress default signal handlers

2015-05-21 Thread Martin Panter

Martin Panter added the comment:

I have often wished for Python to have two modes:

1. Programming development mode: something like “python -b -Wdefault”, enabling 
warnings, printing full trackbacks for SIGINT and EPIPE errors, etc. Also 
possibly catching SystemExit() when raised inside the interactive interpreter.

2. End-user mode: hide deprecation warnings, no traceback for SIGINT and EPIPE 
errors (just set an exit status or maybe reraise using the default OS signal 
handler to set the right exit signal flag to the parent process).

Among other things, this would allow easily switching between reporting 
KeyboardInterrupt tracebacks (whether triggered at startup or by the main 
code), and hiding them.

--
nosy: +vadmium

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

Here are the last 10 frames from the backtrace (gdb):

#0  0x005b15d0 in odictiter_iternext (di=optimized out) at 
Objects/odictobject.c:1888
#1  0x00453179 in PyIter_Next (iter=optimized out) at 
Objects/abstract.c:2760
#2  0x005881e7 in chain_next (lz=0x72b8d878) at 
./Modules/itertoolsmodule.c:1866
#3  0x00537db6 in PyEval_EvalFrameEx (f=f@entry=0xcab188, 
throwflag=throwflag@entry=0) at Python/ceval.c:2975
#4  0x0053afee in fast_function (func=func@entry=0x72bc88f8, 
pp_stack=pp_stack@entry=0x7fff99f8, n=n@entry=1, na=na@entry=1, 
nk=nk@entry=0) at Python/ceval.c:4752
#5  0x0053b655 in call_function 
(pp_stack=pp_stack@entry=0x7fff99f8, oparg=oparg@entry=0) at 
Python/ceval.c:4679
#6  0x0053891d in PyEval_EvalFrameEx (f=f@entry=0xcbd588, 
throwflag=throwflag@entry=0) at Python/ceval.c:3198
#7  0x0053afee in fast_function (func=func@entry=0x72bc8840, 
pp_stack=pp_stack@entry=0x7fff9bd8, n=n@entry=3, na=na@entry=3, 
nk=nk@entry=0) at Python/ceval.c:4752
#8  0x0053b655 in call_function 
(pp_stack=pp_stack@entry=0x7fff9bd8, oparg=oparg@entry=2) at 
Python/ceval.c:4679
#9  0x0053891d in PyEval_EvalFrameEx (f=f@entry=0xc7d458, 
throwflag=throwflag@entry=0) at Python/ceval.c:3198

and from Python:

Current thread 0x7f3ad9260740 (most recent call first):
  File /home/esnow/projects/cordereddict/Lib/configparser.py, line 1115 in 
_join_multiline_values
  File /home/esnow/projects/cordereddict/Lib/configparser.py, line 1109 in 
_read
  File /home/esnow/projects/cordereddict/Lib/configparser.py, line 716 in 
read_file
  File /home/esnow/projects/cordereddict/Lib/configparser.py, line 721 in 
read_string
  File /home/esnow/projects/cordereddict/Lib/test/test_configparser.py, line 
354 in test_basic
  File /home/esnow/projects/cordereddict/Lib/unittest/case.py, line 597 in run

--

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

As far as I can tell there aren't any patterns that repeat across multiple 
seeds (which makes sense).

--

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

The segfault happens at line 1888 of odictobject.c when it tries to Py_INCREF a 
NULL value.  The problem is that the value that gets looked up for a presumably 
valid key is returned as NULL.  So either the value is messed up, lookup is 
broken, or the wrong key is being used.

--

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



[issue24262] logging.FileHandler.close() is not thread-safe

2015-05-21 Thread Gleb Dubovik

New submission from Gleb Dubovik:

We're using FileHandler in combination with pytest plugin. Every time new test 
starts, new FileHandler is created and attached to the root logger, at the end 
of the test FileHandler is removed. This allows us to create per-test log files.

There are some threads that persist throughout the test session. They may 
perform logging at about the same time when we remove FileHandler. 

Sometimes either thread that performs logging or the thread that closes the 
handler raise an exception:
ValueError: I/O operation on closed file
IOError: close() called during concurrent operation on the same file object.
AttributeError: 'NoneType' object has no attribute 'write'

Before closing the handler we do remove it from the logger.

This happens because operations that access FileHandler.stream (like close() 
and flush()) do not acquire the handler lock that guards emit() method. As a 
result, one thread may start closing the stream while the other freely enters 
emit and tries to write to the file. The race may happen within the file object 
and on the stream field itself (the combination if stream is not None: stream 
= None is not thread-safe).

This issue is related to two other bugs:
https://bugs.python.org/issue1760556
https://bugs.python.org/issue11444

Repro code:
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type help, copyright, credits or license for more information.
 import threading
 import time
 import logging

 root_logger = logging.getLogger()
 root_logger.addHandler(logging.NullHandler())

 def do_logging():
... for _ in xrange(100):
... logging.error(TEST!*100)
...
 threading.Thread(target=do_logging).start()

 for _ in xrange(100):
... handler = logging.FileHandler(/tmp/test)
... root_logger.addHandler(handler)
... time.sleep(6)
... root_logger.removeHandler(handler)
... handler.close()
...
Traceback (most recent call last):
  File /usr/lib/python2.7/logging/__init__.py, line 867, in emit
stream.write(fs % msg)
AttributeError: 'NoneType' object has no attribute 'write'
Logged from file stdin, line 3
Traceback (most recent call last):
  File stdin, line 6, in module
  File /usr/lib/python2.7/logging/__init__.py, line 906, in close
self.stream.close()
IOError: close() called during concurrent operation on the same file object.
 exit()

--
components: Library (Lib)
messages: 243804
nosy: dubglan
priority: normal
severity: normal
status: open
title: logging.FileHandler.close() is not thread-safe
type: behavior
versions: Python 2.7

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



[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-21 Thread eryksun

eryksun added the comment:

Shouldn't it be checking whether `file` (or `filename`) is a directory [1]? For 
example:

except PermissionError:
# This exception is thrown when a directory with
# the chosen name already exists on windows.
if _os.name == 'nt' and _os.path.isdir(file):
continue
# If the directory allows write access, continue 
# trying names. On Windows, currently this test 
# doesn't work. The implementation assumes all 
# directories allow write access, but it really 
# depends on the directory's discretionary and 
# system access control lists (DACL  SACL).
elif _os.access(dir, _os.W_OK):
continue
else:
raise

---

[1]: Windows sets the last error to ERROR_ACCESS_DENIED when a system
 call returns the NTSTATUS code STATUS_FILE_IS_A_DIRECTORY. This
 status code is returned by NtCreateFile and NtOpenFile when the
 target file is a directory, but the caller asked for anything 
 but a directory (i.e. CreateOptions contains 
 FILE_NON_DIRECTORY_FILE).

--
nosy: +eryksun

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Matthew Barnett

Matthew Barnett added the comment:

FTR, in _odict_resize there's this:

size_t i = _odict_get_index(od, _odictnode_KEY(node));
if (i  0) {

Note that i is declared as unsigned and then tested whether it's negative.

--
nosy: +mrabarnett

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



[issue16991] Add OrderedDict written in C

2015-05-21 Thread Eric Snow

Eric Snow added the comment:

Yeah, Ned pointed that one out.  I fixed it but haven't pushed the change.

--

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



[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is a risk of race condition. One process can create a directory `file`, 
then other process fails to create a file with the same name `file`, then the 
first process removes directory `file`, then the second process handles 
PermissionError. The same is possible also with threads.

--

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm making a review.

--
nosy: +serhiy.storchaka

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



[issue24056] Expose closure generator status in function repr()

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Nick, Berker, please find an updated patch attached (with support for 
coroutines).  Big +1 on the idea, BTW.

--
Added file: http://bugs.python.org/file39460/issue24056_2.diff

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



[issue24004] avoid explicit generator type check in asyncio

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

This issue was resolved in 
https://github.com/python/asyncio/commit/3a09a93277afc2cdb43badf92a2c85c2789813f6.

--
resolution:  - fixed
stage:  - resolved
status: open - closed
versions:  -Python 3.4

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



[issue23898] inspect() changes in Python3.4 are not compatible with objects that implement special __bool__, __eq__

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Merged. Thanks for the bug report and patch, Mike!

--
assignee:  - yselivanov
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue22939] integer overflow in iterator object

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6179accca20 by Serhiy Storchaka in branch '2.7':
Fixed issue number for issue #22939.
https://hg.python.org/cpython/rev/d6179accca20

New changeset 7fa2f4afcf5a by Serhiy Storchaka in branch '3.4':
Fixed issue number for issue #22939.
https://hg.python.org/cpython/rev/7fa2f4afcf5a

New changeset f23533fa6afa by Serhiy Storchaka in branch 'default':
Fixed issue number for issue #22939.
https://hg.python.org/cpython/rev/f23533fa6afa

--
nosy: +python-dev

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



[issue23985] Crash when deleting slices from duplicated bytearray

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Sorry, it was related to issue22939.

--

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread R. David Murray

R. David Murray added the comment:

Yes, I don't need to be involved further (unless you need help from me on 
something :)

--

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



[issue23898] inspect() changes in Python3.4 are not compatible with objects that implement special __bool__, __eq__

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb9addfdfc35 by Yury Selivanov in branch '3.4':
Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__
https://hg.python.org/cpython/rev/fb9addfdfc35

New changeset d6a9d225413a by Yury Selivanov in branch 'default':
Issue 23898: Fix inspect.classify_class_attrs() to work with __eq__
https://hg.python.org/cpython/rev/d6a9d225413a

--
nosy: +python-dev

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



[issue21916] Create unit tests for turtle textonly

2015-05-21 Thread Tim Golden

Tim Golden added the comment:

Serhiy's offered a review and we can take it from here. :)

--

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 548d5704fcb3 by Yury Selivanov in branch 'default':
Issue 24180: Documentation for PEP 492 changes.
https://hg.python.org/cpython/rev/548d5704fcb3

--
nosy: +python-dev

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



[issue24257] Incorrect use of PyObject_IsInstance

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, it is the case that if the current check passes incorrectly one will 
always get a segfauilt or other error.

Added tests for types.SimpleNamespace and sqlite3.Cursor. It is not easy to 
reproduce a bug for StopIterator (not sure it is reproducible), but the code 
looks definitely erroneous in any case.

--
Added file: http://bugs.python.org/file39453/typecheck_2.patch

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



[issue24180] PEP 492: Documentation

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks for the review Nick.  I committed the patch with some additional minor 
fixes, including your suggestion.

 Asynchronous iterator question: should the typical pattern for those be:

def __aiter__(self):
return self
def __await__(self):
return self


Well, adding __await__ to asynchronous iterators is the same as adding __call__ 
to regular iterators.  It would be like:

i = iter(iterable)   # __iter__
i = iterable()   # __call__
   
ai = await iterable.__aiter__()  # __aiter__
   # or ai = await aiter(iterable), but we don't have it yet

ai = await iterable  # __await__


 Did we put the ABC's in the right place? question: reviewing the draft docs 
 meant I just noticed that collections.abc is quite an odd home for some of 
 these. Probably not worth worrying about, given that AsyncIterator and 
 AsyncIterable do belong, and the others are building blocks for those.

I had this question too.  My impression is that Guido doesn't want to fix this 
in 3.5.  FWIW, my initial suggestion was to have Coroutine, Awaitable and 
Hashable in the top-level abc module (not ideal by any means).

--

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



[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ff983ee10b3e by Yury Selivanov in branch 'default':
Issue 24017: Use abc.Coroutine in inspect.iscoroutine() function
https://hg.python.org/cpython/rev/ff983ee10b3e

--

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



[issue23863] Fix EINTR Socket Module issues in 2.7

2015-05-21 Thread Jeff McNeil

Jeff McNeil added the comment:

Do we have a decision on this yet?  I'm willing to rework bits that may need 
it, but I'd like to know whether this is going to be a fruitful effort or not. 
Thanks!

--

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



[issue23699] Add a macro to ease writing rich comparisons

2015-05-21 Thread Petr Viktorin

Petr Viktorin added the comment:

Here is a version with PyErr_BadArgument.

--
Added file: http://bugs.python.org/file39455/richcompare-macro-badargument.patch

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



[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-21 Thread Serhiy Storchaka

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


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue24237] PEP 479: missing DeprecationWarning when generator_stop is not used

2015-05-21 Thread Yury Selivanov

Yury Selivanov added the comment:

 Why the switch to WriteUnraisable?

After adding a unittest for the patch it became clear that it was indeed 
unnecessary ;)  Please see the new patch.

--
Added file: http://bugs.python.org/file39454/gen_stop_warn.patch

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-21 Thread Serhiy Storchaka

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


--
assignee: michael.foord - serhiy.storchaka
versions: +Python 2.7

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2015-05-21 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for the report Rolf. I'll look into your suggestion for this patch.

Antoine: Given beta is slated for the 24th and Martin's legitimate concerns, I 
think it might be a little hasty to get this in before feature freeze. Knocking 
it back to 3.6 (obviously feel free to change if you think it should remain for 
any reason).

--
versions: +Python 3.6 -Python 3.5

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



[issue24255] Replace debuglevel-related logic with logging

2015-05-21 Thread Demian Brecht

Changes by Demian Brecht demianbre...@gmail.com:


--
keywords: +easy

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



[issue24223] argparse parsing (mingling --option and optional positional argument)

2015-05-21 Thread Bob Alexander

Bob Alexander added the comment:

Thanks for the note, Martin. I agree that it's a duplicate. (I had done a
brief search for possible dups, but didn't find that one!)

Bob

On Sun, May 17, 2015 at 8:29 PM, Martin Panter rep...@bugs.python.org
wrote:


 Martin Panter added the comment:

 I suggest this is a duplicate of Issue 15112. The same problem also
 happens with nargs=*, and that issue apparently has a patch to handle
 both cases.

 For the record, this is the resulting error, and a demo that it works if
 the option comes before the positional arguments:

  print(test 2:, ap.parse_args([abc, --option, mmm]))
 usage: [-h] [--option] arg_1 [arg_2]
 : error: unrecognized arguments: mmm
 Traceback (most recent call last):
   File stdin, line 1, in module
   File /home/proj/python/cpython/Lib/argparse.py, line 1729, in
 parse_args
 self.error(msg % ' '.join(argv))
   File /home/proj/python/cpython/Lib/argparse.py, line 2385, in error
 self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
   File /home/proj/python/cpython/Lib/argparse.py, line 2372, in exit
 _sys.exit(status)
   File /home/pythonstartup.py, line 345, in exit
 raise SystemExit(code)
 __main__.SystemExit: 2
  ap.parse_args([--option, abc, mmm])
 Namespace(arg_1='abc', arg_2='mmm', option=True)

 --
 nosy: +vadmium
 resolution:  - duplicate
 stage:  - resolved
 status: open - closed
 superseder:  - argparse: nargs='*' positional argument doesn't accept any
 items if preceded by an option and another positional
 title: argparse parsing bug - argparse parsing (mingling --option and
 optional positional argument)

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue24223
 ___


--

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 84d7ec21cc43 by Serhiy Storchaka in branch 'default':
Issue #15836: assertRaises(), assertRaisesRegex(), assertWarns() and
https://hg.python.org/cpython/rev/84d7ec21cc43

--
nosy: +python-dev

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-05-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Applied to 3.5 only, because this issue looks rather as new feature (preventing 
possible user error) and there is minimal chance to break existing tests (see 
issue24134).

--
type: behavior - enhancement
versions:  -Python 2.7, Python 3.4

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