[issue23781] Add private _PyErr_ReplaceException() in 2.7

2015-03-30 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2015-03-30 Thread Serhiy Storchaka

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


--
resolution:  - fixed
status: open - closed

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



[issue14260] re.groupindex is available for modification and continues to work, having incorrect data inside it

2015-03-30 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue14904] test_unicode_repr_oflw (in test_bigmem) crashes

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5bea08f80e62 by Serhiy Storchaka in branch '2.7':
Issue #14904: Made test_unicode_repr_oflw to use less memory.
https://hg.python.org/cpython/rev/5bea08f80e62

--

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



[issue14904] test_unicode_repr_oflw (in test_bigmem) crashes

2015-03-30 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/issue14904
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23799] Join started threads in tests

2015-03-30 Thread Serhiy Storchaka

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


--
nosy: +ezio.melotti, haypo, michael.foord, pitrou

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:


 Serhiy Storchaka added the comment:

 May be rename _PyTime_AsTimeval_impl() to _PyTime_AsTimeval_noraise() and
 check a result to raise an exception in _PyTime_AsTimeval()?


Ah yes correct, can you modify directly the code please?

--

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



[issue23785] Leak in TextIOWrapper.tell()

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 442ebebad516 by Serhiy Storchaka in branch '3.4':
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
https://hg.python.org/cpython/rev/442ebebad516

New changeset 2fcd99929dba by Serhiy Storchaka in branch 'default':
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
https://hg.python.org/cpython/rev/2fcd99929dba

New changeset 12d3eec72f9e by Serhiy Storchaka in branch '2.7':
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
https://hg.python.org/cpython/rev/12d3eec72f9e

--
nosy: +python-dev

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



[issue23781] Add private _PyErr_ReplaceException() in 2.7

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c76a1a42799c by Serhiy Storchaka in branch '2.7':
Issue #23781: Add private helper function _PyErr_ReplaceException() that
https://hg.python.org/cpython/rev/c76a1a42799c

--
nosy: +python-dev

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



[issue23783] Leak in PyObject_ClearWeakRefs

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 74d766d819a6 by Serhiy Storchaka in branch '3.4':
Issue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
https://hg.python.org/cpython/rev/74d766d819a6

New changeset 6a4b83c56b86 by Serhiy Storchaka in branch 'default':
Issue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
https://hg.python.org/cpython/rev/6a4b83c56b86

New changeset a8d8d16c853e by Serhiy Storchaka in branch '2.7':
Issue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
https://hg.python.org/cpython/rev/a8d8d16c853e

--
nosy: +python-dev

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



[issue23466] PEP 461: Inconsistency between str and bytes formatting of integers

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cb96fd376baa by Serhiy Storchaka in branch 'default':
Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
https://hg.python.org/cpython/rev/cb96fd376baa

--
nosy: +python-dev

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



[issue23171] csv.writer.writerow() does not accept generator (must be coerced to list)

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cf5b62036445 by Serhiy Storchaka in branch 'default':
Issue #23171: csv.Writer.writerow() now supports arbitrary iterables.
https://hg.python.org/cpython/rev/cf5b62036445

--
nosy: +python-dev

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



[issue23500] Argument Clinic: multiple macro definition

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please commit your patch (may be with changes) Larry?

--

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



[issue23171] csv.writer.writerow() does not accept generator (must be coerced to list)

2015-03-30 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/issue23171
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for fixing backported patch and tests Victor.

--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue23783] Leak in PyObject_ClearWeakRefs

2015-03-30 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue23785] Leak in TextIOWrapper.tell()

2015-03-30 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e00b581a65ec by Victor Stinner in branch 'default':
Issue #22117: Try to fix rounding in conversion from Python double to _PyTime_t
https://hg.python.org/cpython/rev/e00b581a65ec

--

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Hum, conversion from Python float to _PyTime_t is not rounded as expected on 
x86 Ubuntu Shared 3.x. Example:

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/11426/steps/test/logs/stdio

==
FAIL: test_FromSecondsObject (test.test_time.TestPyTime_t) (obj=1e-06, 
round=_PyTime.ROUND_FLOOR: 0, timestamp=1000)
--
Traceback (most recent call last):
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_time.py, 
line 779, in test_FromSecondsObject
self.assertEqual(PyTime_FromSecondsObject(obj, rnd), ts)
AssertionError: 999 != 1000

==
FAIL: test_FromSecondsObject (test.test_time.TestPyTime_t) 
(obj=4194304.1, round=_PyTime.ROUND_FLOOR: 0, 
timestamp=41943041)
--
Traceback (most recent call last):
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_time.py, 
line 779, in test_FromSecondsObject
self.assertEqual(PyTime_FromSecondsObject(obj, rnd), ts)
AssertionError: 41943040 != 41943041

--
resolution: fixed - 
status: closed - open

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
 Thank you for fixing backported patch and tests Victor.

No problem, thanks for your enhancement of regrtest ;-) I proposed the
idea and you implemented it, great team work!

--

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



[issue23115] Backport #22585 -- getentropy for urandom to Python 2.7

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 05b96af72805 by Victor Stinner in branch '2.7':
Issue #23115: os.urandom() now releases the GIL when the getentropy() is used
https://hg.python.org/cpython/rev/05b96af72805

--

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



[issue23571] Raise SystemError if a function returns a result with an exception set

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka added the comment:
 The second (exception == NULL) check in _Py_PrintFatalError() looks 
 suspicious. When it is possible? And if it is possible, can it cause leaks?

Sorry, I have no idea. I didn't write this code myself. It comes from
PyErr_PrintEx():

PyErr_Fetch(exception, v, tb);
if (exception == NULL)
return;
PyErr_NormalizeException(exception, v, tb);
if (tb == NULL) {
tb = Py_None;
Py_INCREF(tb);
}
PyException_SetTraceback(v, tb);
if (exception == NULL)
return;

I read again PyErr_NormalizeException(). I'm not sure that the case
can occur in practice. Maybe it can be replaced with an assertion?
Since Py_FatalError() is called in catastrophic cases, I chose to not
try to drop safety checks :-) You can modify PyErr_PrintEx() or even
_Py_PrintFatalError() if you feel more brave than me :-D

--

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



[issue23605] Use the new os.scandir() function in os.walk()

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1ad3d8d82b18 by Victor Stinner in branch 'default':
Issue #23605: Fix typo in an os.walk() comment
https://hg.python.org/cpython/rev/1ad3d8d82b18

--

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



[issue23752] Cleanup io.FileIO

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 128f92ae8bae by Victor Stinner in branch 'default':
Issue #23752: _Py_fstat() is now responsible to raise the Python exception
https://hg.python.org/cpython/rev/128f92ae8bae

--

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



[issue23752] Cleanup io.FileIO

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Hum, _Py_fstat() is not used correctly in _io.FilIO: it uses errno instead of 
GetLastError() to raise the OSError. It's too hard to use the new _Py_fstat() 
function directly, I modified it to raise directly the exception. So the caller 
doesn't have to use #ifdef MS_WINDOWS to raise the exception correctly.

I added _Py_fstat_noraise() when it's not possible to use an exception.

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5978/steps/test/logs/stdio

==
FAIL: test_fdopen (test.test_os.TestInvalidFD)
--
Traceback (most recent call last):
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_os.py, line 
1418, in check
f(support.make_bad_fd(), *args)
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\os.py, line 1028, in 
fdopen
return io.open(fd, *args, **kwargs)
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_os.py, line 
1411, in helper
self.check(getattr(os, f))
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_os.py, line 
1420, in check
self.assertEqual(e.errno, errno.EBADF)
AssertionError: 0 != 9

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

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 28b465d8c519 by Victor Stinner in branch 'default':
Issue #22181: os.urandom() now releases the GIL when the getrandom()
https://hg.python.org/cpython/rev/28b465d8c519

--

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



[issue22585] os.urandom() should use getentropy() of OpenBSD 5.6

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d3013a383eb by Victor Stinner in branch '3.4':
Issue #22585: os.urandom() now releases the GIL when the getentropy() is used
https://hg.python.org/cpython/rev/9d3013a383eb

New changeset 7f1015e4277a by Victor Stinner in branch 'default':
(Merge 3.4) Issue #22585: os.urandom() now releases the GIL when the
https://hg.python.org/cpython/rev/7f1015e4277a

--

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



[issue23752] Cleanup io.FileIO

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Oh, there was another hang before, so it's probably not related:

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/2852/steps/test/logs/stdio

[393/393] test_ssl
Timeout (1:00:00)!
Thread 0x000102d81000 (most recent call first):
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_ssl.py, 
line 2832 in serve
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/threading.py, line 
871 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/threading.py, line 
923 in _bootstrap_inner
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/threading.py, line 
891 in _bootstrap

Thread 0x7fff71296cc0 (most recent call first):
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/ssl.py, 
line 628 in do_handshake
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/ssl.py, 
line 983 in do_handshake
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/ssl.py, 
line 747 in __init__
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/ssl.py, 
line 1064 in wrap_socket
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 162 in handle
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 1238 in assertRaisesRegex
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_ssl.py, 
line 2851 in test_handshake_timeout
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 577 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 625 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 122 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 84 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 122 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 84 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/runner.py,
 line 176 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py,
 line 1773 in _run_suite

--

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



[issue23796] BufferedReader.peek() crashes if closed

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

I confirm the bug on Python 3.5.0a3+.

Is someone interested to fix buffered_peek() to add a check on the closed state?

--
nosy: +haypo
Added file: http://bugs.python.org/file38735/bug.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
___
___
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-03-30 Thread Michael Foord

Michael Foord added the comment:

The change to unittest is fine. I'd prefer the tests tweaking as Ezio suggested.

--

___
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



[issue23799] Join started threads in tests

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

 In this case all started threads left dangling and make MemotyError even more 
 probably

Oh, I didn't know that. Good catch.

test_support_start_threads.patch looks good to me and it looks like a nice 
enhancement.

But would it be possible to emit a warning if a thread hangs?

For example, try to join with a timeout of 60 seconds, and then display a 
warning, and retry with a timeout of 120 seconds, then display a second 
warning, etc.

Maybe we may even give up after a timeout (ex: 5 minutes, or 15 minutes, it's 
up to you). An exception must be raised in this case. You can use 
faulthandler.dump_traceback() to display the traceback of all threads in this 
case.

I hope that my concern is more theorical, but it would reduce the duration of 
tests when the test suite is stuck (which is quite common), and so being able 
to test more changesets per day.

--

I noticed that under low memory condition, some tests hang because Python 
doesn't handle notify the parent thread that the child thread fails to 
start. So the parent thread is stuck and nothing happens. Well, I'm not sure 
that it's related to this issue. At least, test_support_start_threads.patch 
doesn't help.

--

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that adds Decimal support for datetime.fromtimestamp() and 
datetime.utcfromtimestamp(). As side effect Decimal timestamps now are 
supported in few other places, e.g. in os.utime().

--
nosy: +haypo
stage: needs patch - patch review
Added file: 
http://bugs.python.org/file38736/datetime_fromtimestamp_decimal.patch

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



[issue23752] Cleanup io.FileIO

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

The changeset 128f92ae8bae also changed _Py_fstat() to release the GIL when 
calling fstat(), I forgot to mention it in the changeset.

test_socket now hangs on AMD64 Snow Leop 3.x, I don't know yet if it's related:

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/2870/steps/test/logs/stdio

[393/393] test_socket
Timeout (1:00:00)!
Thread 0x000104fef000 (most recent call first):
  File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/socket.py, 
line 288 in _sendfile_use_sendfile
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_socket.py,
 line 5131 in _testOffset
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_socket.py,
 line 278 in clientRun

Thread 0x7fff71296cc0 (most recent call first):
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/threading.py, line 
293 in wait
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/threading.py, line 
556 in wait
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_socket.py,
 line 262 in _tearDown
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 580 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, 
line 625 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 122 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 84 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 122 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, 
line 84 in __call__
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/runner.py,
 line 176 in run
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py,
 line 1773 in _run_suite
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py,
 line 1807 in run_unittest
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_socket.py,
 line 5340 in test_main
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, 
line 1280 in runtest_inner

--

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Oh, test_time now pass on x86 Ubuntu Shared 3.x. It looks like the volatile 
keyword was enough to fix rounding issues, cool :-)

--
resolution:  - fixed
status: open - closed

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

V4 fixes a merge conflict with recent gzip changes.

--
Added file: http://bugs.python.org/file38739/crc-sign.v4.patch

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



[issue23605] Use the new os.scandir() function in os.walk()

2015-03-30 Thread Ben Hoyt

Ben Hoyt added the comment:

Yep, I'm good -- go ahead and close!

--

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



[issue23605] Use the new os.scandir() function in os.walk()

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for your great work Ben! I close the issue. The PEP 471 has already the 
Final status.

--
resolution:  - fixed
status: open - closed

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



[issue23602] Implement __format__ for Fraction

2015-03-30 Thread Stefan Krah

Stefan Krah added the comment:

Regarding Decimal:

  1) The context precision isn't used for formatting.  If you have
 another reason for proposing the optional context argument for
 dec_format(), please open another issue.

  2) There's another problem: The mythical DefaultContext (which
 acts as a template for creating new contexts) affects not only
 new thread-local contexts, but also a new Context()!

 In my opinion this is something we should change: The mechanism
 is fine for thread-local contexts, but Context() should behave
 like a pure function.

  3) The double rounding issues are more tricky than it might seem;
 if we use Decimal for this, perhaps direct support in the module
 would be the cleanest option.

--

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed datetime_fromtimestamp_decimal.patch.

 As side effect Decimal timestamps now are supported in few other places, e.g. 
 in os.utime().

It would be more consistent to support decimal.Decimal nowhere or everywhere. 
IMO the new _PyTime_FromSecondsObject() (very close to 
_PyTime_ObjectToDenominator, but using time_t) should also be patched.

Please add some tests for decimal.Decimal in test_time directly. Usually, I try 
to test rounding and overflow. Testing for overflow is not always possible 
because it may depend on the platform.

--

See also the PEP 410: PEP 410 - Use decimal.Decimal type for timestamps. The 
PEP was rejected. The compromise was a new timestamp format for os.utime(): a 
number of nanoseconds since the UNIX epoch (1970-01-01). I partially 
implemented a private API for this PEP in the issue #22117: the new _PyTime_t 
is a number of timestamp using an arbitrary resolution (currently, it's a 
number of nanoseconds using a 64-bit signed integer type).

--

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



[issue23811] Python py_compile error message inconsistent and missing newline

2015-03-30 Thread Akshet Pandey

New submission from Akshet Pandey:

On the following test file (test.py):

```python
class Solution:
  def repeatedNumber(self, A):
test = 1
  return []
```

Running python -m py_compile test.py return the following error message:
Sorry: IndentationError: unexpected indent (test.py, line 6)

But without a newline on stderr at the end of the message. This causes some 
problems with scripts that expect a newline and new my particular case with 
reading stderr on docker where docker just ignore the line if it doesn't end in 
a newline.

Also, this message differs from the runtime error message:

```
  File test.py, line 6
return []
^
IndentationError: unexpected indent
```

Would it be possible to at least add in a newline and at best, change the 
message to be consistent with the runtime error message?

I will trying to look at the code and see if I can write a patch but it will 
take me some time.

--
components: Interpreter Core
messages: 239598
nosy: akshetp
priority: normal
severity: normal
status: open
title: Python py_compile error message inconsistent and missing newline
type: enhancement
versions: Python 2.7, Python 3.4

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



[issue22341] Python 3 crc32 documentation clarifications

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

Patch v3:

* Reverted to original crc32(bhello) example call with the implicit initial 
CRC
* Added “Changed in version 3.0” notices, restoring a brief version of the 
suggestion to use the bit mask, along with an explanation.

Python 2 compatibility information is generally unprecedented in the Python 3 
documentation though, but hopefully this version should make more sense to 
people not already familiar with the Python 2 odd behaviour.

--
Added file: http://bugs.python.org/file38737/crc-sign.v3.patch

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



[issue23605] Use the new os.scandir() function in os.walk()

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Ben: do you think that we are done with this issue? can I close it?

--

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



[issue2211] Cookie.Morsel interface needs update

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Did you noticed my comments on Rietveld about setdefault() and the :meth: role?

--
assignee: serhiy.storchaka - r.david.murray

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-03-30 Thread Brett Cannon

Brett Cannon added the comment:

Probably need to introduce a new keyword argument just for deprecated imports 
or some helper function in importlib to get the stack depth right (else there 
is a risk of breaking the stack depth in any minor release whenever importlib's 
depth shifts). Something like the following should be enough (obviously done in 
warnings instead of per-file):

try:
level = 1
while True:
frame = sys._getframe(level)
print(frame.f_code.co_filename)
if '_bootstrap' not in frame.f_code.co_filename:
break
level += 1
except ValueError:
pass
print(sys._getframe(2).f_code.co_filename)
warnings.warn(the imp module is deprecated in favour of importlib; 
  see the module's documentation for alternative uses,
  PendingDeprecationWarning, stacklevel=level+1)

Otherwise the depths should just go back to what they were at.

--
nosy: +larry
priority: normal - release blocker
stage:  - test needed
type:  - behavior

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The problem is that the Decimal *was* supported in 2.7. So this issue can be 
considered not as adding new feature, but as fixing a regression. But changes 
are too large for just bugfix.

 It would be more consistent to support decimal.Decimal nowhere or 
 everywhere. IMO the new _PyTime_FromSecondsObject() (very close to 
 _PyTime_ObjectToDenominator, but using time_t) should also be patched.

Will add Decimal support in all functions in Python/pytime.c that support 
floats.

 Please add some tests for decimal.Decimal in test_time directly. Usually, I 
 try to test rounding and overflow. Testing for overflow is not always 
 possible because it may depend on the platform.

Will do.

 Is the patch context insensitive?

No, the patch is context sensitive. I think the end user is responsible to set 
an appropriate context if it want to create a datetime from Decimal timestamp. 
At least until we add functions that return Decimal.

--

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



[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2015-03-30 Thread Paul Moore

Changes by Paul Moore p.f.mo...@gmail.com:


--
nosy: +paul.moore

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



[issue23792] help crash leaves terminal in raw mode

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a5f30babc72 by R David Murray in branch '3.4':
#23792: also catch interrupt around pipe.write.
https://hg.python.org/cpython/rev/7a5f30babc72

New changeset 536c4f4acae1 by R David Murray in branch 'default':
Merge: #23792: also catch interrupt around pipe.write.
https://hg.python.org/cpython/rev/536c4f4acae1

--

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Gustavo J. A. M. Carneiro

Changes by Gustavo J. A. M. Carneiro gjcarne...@gmail.com:


Added file: http://bugs.python.org/file38741/Issue23812.diff

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2015-03-30 Thread Stefan Krah

Stefan Krah added the comment:

I think we should try to avoid depending on global state in
the stdlib, at least in new code.  Also, if something is not
really a decimal computation, Decimal itself tries to ignore
the context (like Decimal.__repr__).

At least I would expect this datetime function to be context
independent.

--

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



[issue23807] Improved test coverage for calendar.py command line

2015-03-30 Thread Brett Cannon

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


--
nosy: +brett.cannon

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Gustavo J. A. M. Carneiro

New submission from Gustavo J. A. M. Carneiro:

I have a pattern where I read from a queue with a timeout, generally like this:

while True:
  reader = asyncio.async(wait_for(queue.get(), 0.1))
  try:
item = (yield from reader)
  except asyncio.TimeoutError:
reader.cancel()
continue

This is to have a loop where we try to get items from the queue with a timeout. 
 Prior to Python 3.5, wait_for() doesn't automatically cancel the reading task, 
so I have to do it explicitly above.

The code has a strange race condition where, if a taks calls put_nowait on a 
reader task that is just about to be cancelled due to timeout, then the item 
that wast put onto the queue gets lost.

In the tests framework, the minimal test case I can come up with is mainly this 
code:


  q = asyncio.Queue(loop=loop)
  reader = loop.create_task(q.get())
  loop.run_until_complete(asyncio.sleep(0.01, loop=loop))

  q.put_nowait(1)
  q.put_nowait(2)
  reader.cancel()

When the reader gets cancelled, the item `1` is lost into the ether, and when 
you create another reader for the same queue, it only gets the second item `2`. 
 I would expect that, if a reader task is cancelled, the item at the head of 
the queue doesn't get lost.  Either the reader succeeds and the item is 
removed, or it doesn't succeed and the item is left alone.

I attach a patch to the tulip tests that reproduces the problem in both Python 
3.4.2 and tulip hg.

--
components: asyncio
files: bug-test.diff
keywords: patch
messages: 239611
nosy: gustavo, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.Queue.put_nowait(), followed get() task cancellation leads to 
item being lost
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38740/bug-test.diff

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



[issue23807] Improved test coverage for calendar.py command line

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, self.assertFailure('-L', 'en') tests this case.

--

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Similar feature is needed for warnings in the re module. Methods of regular 
expression pattern can be called directly or from module-level wrappers. In 
these case the stack level differs by 1. And sometimes warnings are emitted in 
recursive parser, when stack level is variable.

--
nosy: +serhiy.storchaka

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2015-03-30 Thread STINNER Victor

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


--
resolution:  - fixed
status: open - closed

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



[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2015-03-30 Thread Stefan Krah

Stefan Krah added the comment:

I just looked at this very briefly: Is the patch context insensitive?

IOW, do things still work if you change the thread-local context:

from decimal import *
c = getcontext()
c.prec = 1
c.Emax = 1
c.Emin = -1

--
nosy: +skrah

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



[issue23500] Argument Clinic: multiple macro definition

2015-03-30 Thread Larry Hastings

Larry Hastings added the comment:

I want to redo it--it's smelly.  I hope to get it done this week.

--

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



[issue23799] Join started threads in tests

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Something like this?

--
Added file: http://bugs.python.org/file38738/test_support_start_threads_2.patch

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



[issue23605] Use the new os.scandir() function in os.walk()

2015-03-30 Thread Ben Hoyt

Ben Hoyt added the comment:

Thanks for the explanation (and the comment fix).

 What's your point about complexity? Would you like to drop os.scandir
 changes in os.walk(), or do you have a simpler version to propose?

No, not at all! I was just noting it and trying to brainstorm any ways to 
simplify it (while keeping the current behavior). But I'm not sure there is a 
good simplification, so that's fine.

--

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



[issue2211] Cookie.Morsel interface needs update

2015-03-30 Thread R. David Murray

R. David Murray added the comment:

No, sorry, I currently don't always notice reviews unless they are mentioned on 
the tracker.  I will take a look.

--

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



[issue23792] help crash leaves terminal in raw mode

2015-03-30 Thread R. David Murray

R. David Murray added the comment:

Yeah, someone could theoretically manage to hit ctl-c between the time the 
process is started and the call to pipe.write, or between it and the call to 
wait, but I don't think those very-low-probability events are worth worrying 
about.

--

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



[issue23729] Import ElementTree documentation for namespaces and XPath

2015-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


Added file: http://bugs.python.org/file38742/namespace_doc_fixes.diff

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



[issue23326] Remove redundant __ne__ implementations

2015-03-30 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm a little surprised you didn't get pushback from asyncio (i.e. Victor). We 
try to keep the source identical across releases while asyncio is in 
provisional mode (i.e. until 3.5 is released).

--
nosy: +gvanrossum, haypo

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Gustavo J. A. M. Carneiro

Gustavo J. A. M. Carneiro added the comment:

 - Are there other places where a cancellation can have a similar effect? 
 Maybe the same logic in put()?

Hm.. I didn't look, but yes, it does look like it might be affected by the same 
issue.  I'll try to create a test for that to confirm.

 how can the yield-from in get() receive a CancelledError without the waiter 
 being cancelled?

Well, it definitely gets a CancelledError in the return (yield from waiter).  I 
added extensive logging and could confirm this is the case.

What happens is that

1. Test creates a task q.get()
2. The task coroutine, inside Queue.get, blocks on the yield from waiter
3. a couple of items are put in the queue
4. Test code calls task.cancel() (where `task` is running the coroutine q.get)
5. The Queue.get task receives a CancelledError because it was cancelled.  The 
exception appears to come from the `yield from waiter` only because this is the 
place where the Queue.get task was suspended, but waiter itself is not 
cancelled.

--

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



[issue23326] Remove redundant __ne__ implementations

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Should I restore __ne__ in asyncio? The version without __ne__ will work with 
Python 3.4.3 because issue21408 patch was committed in 3.4 too. Explicit __ne__ 
implementation is just redundant.

--

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Make sense. I'll be waiting for your updated patch. Thanks for both the bug 
report and the fix!

--

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



[issue22329] Windows installer can't recover partially installed state

2015-03-30 Thread J. Walter Clark

J. Walter Clark added the comment:

I had the same issue using Python 3.4.2 x64 on Windows 7 x64 and resolved it by 
setting PYTHONHOME and PYTHONPATH environmental variables.

--
nosy: +jwalterclark

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



[issue23640] Enum.from_bytes() is broken

2015-03-30 Thread Bruno Cauet

Bruno Cauet added the comment:

I'm not sure how you can have both, those two seem opposite to me:
- if 'from_bytes' returns the same type as the class it is called on then
the instantiation of the result object should go through its constructor
(patch proposed)
- if the subclass should override base class behaviour then there is no
reason for Enum.from_bytes to return the same type as the class it is
called on, and therefore it should be made a classmethod.

2015-03-30 18:02 GMT+02:00 Ethan Furman rep...@bugs.python.org:


 Ethan Furman added the comment:

 'from_bytes' is a classmethod.  As such, it should return the same type as
 the class it is called on.  If that wasn't the intent it would be a
 staticmethod instead.

 It is the responsibility of the subclass to override base class behavior,
 not the other way around.

 --

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


--

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



[issue2211] Cookie.Morsel interface needs update

2015-03-30 Thread Demian Brecht

Demian Brecht added the comment:

Thanks for following up on this David. The changes you've made all look good to 
me.

--

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Gustavo J. A. M. Carneiro

Gustavo J. A. M. Carneiro added the comment:

I created a codereview issue: https://codereview.appspot.com/222930043

--

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



[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-03-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks like a valid bug report, I like the test you provided, and the fix seems 
on the right track. Comments on the fix:

- I'd really like to see a rietveld diff for both patches.

- Are there other places where a cancellation can have a similar effect? Maybe 
the same logic in put()?

- The fix uses waiter.result() but if waiter itself is cancelled this will 
raise a CancelledError. This is probably fine because in that case no value has 
been put into it. But now this got me thinking -- how can the yield-from in 
get() receive a CancelledError without the waiter being cancelled? IOW how does 
the fix actually work??? (Maybe because the generator has already returned when 
the Task wrapping it is cancelled?)

--

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



[issue23326] Remove redundant __ne__ implementations

2015-03-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, I'd like to see it restored in asyncio. It seems to be just one file
that's currently out of sync with the tulip upstream repo.

On Mon, Mar 30, 2015 at 10:38 AM, Serhiy Storchaka rep...@bugs.python.org
wrote:


 Serhiy Storchaka added the comment:

 Should I restore __ne__ in asyncio? The version without __ne__ will work
 with Python 3.4.3 because issue21408 patch was committed in 3.4 too.
 Explicit __ne__ implementation is just redundant.

 --

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


--

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



[issue23813] RSS and Atom feeds of buildbot results are broken

2015-03-30 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

There are links to Atom and RSS feeds on https://www.python.org/dev/buildbot/:

http://buildbot.python.org/all/rss
http://buildbot.python.org/all/atom

Both referred pages are broken.

web.Server Traceback (most recent call last):
exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 
39: invalid start byte
/usr/lib/python2.7/dist-packages/twisted/web/server.py:189 in process
188self._encoder = encoder
189self.render(resrc)
190except:
/usr/lib/python2.7/dist-packages/twisted/web/server.py:238 in render
237try:
238body = resrc.render(self)
239except UnsupportedMethod as e:
/data/buildbot/lib/python/buildbot/status/web/feeds.py:55 in render
54def render(self, request):
55data = self.content(request)
56request.setHeader(content-type, self.contentType)
/data/buildbot/lib/python/buildbot/status/web/feeds.py:224 in content
223for line in logdata.split('\n')[-30:]:
224unilist.append(unicode(line,'utf-8'))
225log_lines.extend(unilist)
exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 0xfc in position 
39: invalid start byte

--
messages: 239631
nosy: pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: RSS and Atom feeds of buildbot results are broken
type: behavior

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



[issue6650] sre_parse contains a confusing generic error message

2015-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Current (after issue22364) error message is:

 re.match('(?foo.*)', 'foo')
Traceback (most recent call last):
...
sre_constants.error: unknown extension ?f at position 1

Is it good enough or should be improved? In regex this syntax is legal and no 
error is raised.

--

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



[issue23326] Remove redundant __ne__ implementations

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e881444f078f by Serhiy Storchaka in branch 'default':
Partially revert 3603bae63c13 (issue23326) for asyncio.
https://hg.python.org/cpython/rev/e881444f078f

--

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



[issue23326] Remove redundant __ne__ implementations

2015-03-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!

On Mon, Mar 30, 2015 at 12:26 PM, Roundup Robot rep...@bugs.python.org
wrote:


 Roundup Robot added the comment:

 New changeset e881444f078f by Serhiy Storchaka in branch 'default':
 Partially revert 3603bae63c13 (issue23326) for asyncio.
 https://hg.python.org/cpython/rev/e881444f078f

 --

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


--

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-03-30 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag

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



[issue23485] PEP 475: handle EINTR in the select and selectors module

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0ff1090307c7 by Victor Stinner in branch 'default':
Issue #23485: select.select() is now retried automatically with the recomputed
https://hg.python.org/cpython/rev/0ff1090307c7

--
nosy: +python-dev

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



[issue23815] Segmentation fault when create _tkinter objects

2015-03-30 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In 2.7 and 3.3:

 import _tkinter
 _tkinter.Tcl_Obj()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: cannot create '_tkinter.Tcl_Obj' instances
 _tkinter.TkttType()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: cannot create 'tktimertoken' instances

In 3.4+:

 import _tkinter
 _tkinter.Tcl_Obj()
Segmentation fault (core dumped)

And the same for _tkinter.TkttType.

Looks as this is a result of issue15721.

--
components: Extension Modules, Tkinter
messages: 239636
nosy: Robin.Schreiber, amaury.forgeotdarc, asvetlov, loewis, ned.deily, pitrou, 
serhiy.storchaka
priority: normal
severity: normal
status: open
title: Segmentation fault when create _tkinter objects
type: crash
versions: Python 3.4, Python 3.5

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



[issue23648] PEP 475 meta issue

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

inject_signals.patch: Quick-and-dirty patch to send signals (SIGALRM) every 
milliseconds when running unit tests.

On Linux, results are very good. Only multiprocessing fails because of the 
issue #23618 (socket connect) which has a pending patch. I hope that we will 
quickly reach a point where the full test suite completes without failure while 
sending millions of signals to it!

--
Added file: http://bugs.python.org/file38744/inject_signals.patch

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



[issue23485] PEP 475: handle EINTR in the select and selectors module

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0591cf5c9ebd by Victor Stinner in branch 'default':
Issue #23485: Add _PyTime_FromMillisecondsObject() function
https://hg.python.org/cpython/rev/0591cf5c9ebd

New changeset 69b1683ee001 by Victor Stinner in branch 'default':
Issue #23485: select.poll.poll() is now retried when interrupted by a signal
https://hg.python.org/cpython/rev/69b1683ee001

New changeset 5194a84ed9f3 by Victor Stinner in branch 'default':
Issue #23485: select.epoll.poll() is now retried when interrupted by a signal
https://hg.python.org/cpython/rev/5194a84ed9f3

--

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



[issue23814] argparse: Parser level defaults do not always override argument level defaults

2015-03-30 Thread Karl O. Pinc

New submission from Karl O. Pinc:

In the argparse library parser library, contrary to the documentation,
parser-level defaults do not always override argument-level defaults.

https://docs.python.org/3.5/library/argparse.html#argparse.ArgumentParser.set_defaults

says Note that parser-level defaults always override argument-level defaults:

(And so does the python 3.3 docs.)

The docs then provide this example:

   parser = argparse.ArgumentParser()
   parser.add_argument('--foo', default='bar')
   parser.set_defaults(foo='spam')
   parser.parse_args([])
  Namespace(foo='spam')

But it is only true that parser-level defaults override argument-level
defaults when they are established after the argument is added.

The output below shows an argument level default overrideing
a parser level default.

$ python3
Python 3.3.2 (default, Jun  4 2014, 11:36:37) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
Type help, copyright, credits or license for more information.
 import argparse
 parser = argparse.ArgumentParser()
 parser.set_defaults(foo='spam')
 parser.add_argument('--foo', default='bar')
_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, 
default='bar', type=None, choices=None, help=None, metavar=None)
 parser.parse_args([])
Namespace(foo='bar')

It seems that whichever default is set last is the one which is used.
Or perhaps there are not argument level defaults and parser level
defaults, there are just defaults, period.  (It might, possibly,
be nice if there _were_ both argument and parser level defaults
and parser level defaults had priority.  Then this would not be
a documentation bug.)

--
assignee: docs@python
components: Documentation
messages: 239632
nosy: docs@python, kop
priority: normal
severity: normal
status: open
title: argparse: Parser level defaults do not always override argument level 
defaults
type: behavior
versions: Python 3.3

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



[issue23618] PEP 475: handle EINTR in the socket module (connect)

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

test_selectors.patch: Enhance test_selector to test the two kinds of signal 
handlers: one raises an exception, the other one doesn't. I wait until kqueue  
devpoll retry on EINTR to push test_selectors.patch.

--
Added file: http://bugs.python.org/file38743/test_selectors.patch

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



[issue23485] PEP 475: handle EINTR in the select and selectors module

2015-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 17b6d0d7da00 by Victor Stinner in branch 'default':
Issue #23485: Fix test_signal, select.select() now retries the syscall if the
https://hg.python.org/cpython/rev/17b6d0d7da00

--

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



[issue23771] Timeouts on x86 Ubuntu Shared 3.x buildbot

2015-03-30 Thread STINNER Victor

STINNER Victor added the comment:

Last 5 builds of x86 Ubuntu Shared 3.x and AMD64 Debian root 3.x buildbots 
are green (success). The sporadic hang is gone! I close the issue.

--
resolution:  - fixed
status: open - closed

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



[issue23793] Support __add__, __mul__, and __imul__ for deques.

2015-03-30 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I think my first addition example is wrong (should produce [2, 1, 2]), but you 
get the idea.

--

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



[issue23796] BufferedReader.peek() crashes if closed

2015-03-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, John.

 I'm under the impression that the final patch will need to include a test 
 that confirms the patch worked,

Correct. You could convert the reproducers in msg239445 to a test case.

The patch looks good to me. I think you'll also need to add a similar check to 
buffered_read1():

 from io import *
 b = BufferedReader(BytesIO(b12))
 b.read(1)
b'1'
 b.close()
 b.peek()
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: peek of closed file
 b.read1(1)
Segmentation fault (core dumped)

--
nosy: +berker.peksag
stage: needs patch - patch review

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



[issue23729] Import ElementTree documentation for namespaces and XPath

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

The new patch looks good, thanks.

--

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



[issue23816] struct.unpack returns null pascal strings - [first] bug report

2015-03-30 Thread Jon Heiner

New submission from Jon Heiner:

I believe there is an issue with the _struct.c handling of Pascal style strings.

In the _struct.c:s_unpack_internal() function (reading 2.7.6 and 2.7.9 source 
from tgz ball), the size parameter 'n' is clamped to code-size-1.

As far as I can tell, 'n' is set to the correct deserialized value, but the 
code-size value is not set to 255. I could be incorrect, as I'm not running in 
a debugger.

I've attached a short repro case. Note the use of unpack_from() as otherwise 
unpac() will thrown an error. Additionally, I may be using it wrong, but this 
feels correct.

--
components: Library (Lib)
files: unpack_pascal.py
messages: 239644
nosy: jonheiner, mark.dickinson, meador.inge
priority: normal
severity: normal
status: open
title: struct.unpack returns null pascal strings - [first] bug report
versions: Python 2.7
Added file: http://bugs.python.org/file38745/unpack_pascal.py

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



[issue23793] Support __add__, __mul__, and __imul__ for deques.

2015-03-30 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The behavior for multiplying or adding doesn't seem quite so intuitive when you 
allow for a bounded deque. In particular, it doesn't seem obvious that 
multiplying when the deque is bounded, you'll get results like:

 list(deque([1,2], 3) * 2)
[2, 1, 2]

Similarly, when you support non-in-place addition, the bounded-ness of the 
result depends on the order of the values added.

 list(deque([1,2], 3) + deque([1,2], 2))
[1, 2, 1]
 list(deque([1,2], 2) + deque([1,2], 3))
[1, 2]

Not saying these are the wrong behaviors, but it's much more weird than what 
you get with other sequence types (since most sequence types aren't bounded), 
and possibly why deques didn't include these features in the first place; 
trying to act like a generalized sequence when you have features that don't fit 
the model is a titch odd.

--
nosy: +josh.r

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



[issue23796] BufferedReader.peek() crashes if closed

2015-03-30 Thread John Hergenroeder

John Hergenroeder added the comment:

If no-one else wants it, I'd love to tackle this as my first Python (and OSS in 
general) contribution. Attached is a one-line patch that just does a 
CHECK_CLOSED call in buffered_peek and is modeled on the pattern in the 
buffered_flush function just above. I'm under the impression that the final 
patch will need to include a test that confirms the patch worked, but I wanted 
to claim the bug and start the feedback process early :)

--
keywords: +patch
nosy: +jdherg
Added file: http://bugs.python.org/file38746/buffered_reader_closed_peek.patch

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



[issue19100] Use backslashreplace in pprint

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

I agree with Serhiy that using a permissive error handler with pprint() is 
appropriate.

What is the reasoning behind the DecodeWriter case, where the original stream 
has an interesting encoding, but “buffer” is None? Are there any real-world 
cases like that? Your mock test case sets encoding=latin1 with no buffer, but 
that class will also write non-latin1 strings, so there is no problem.

Also I wonder if flushing the stream once or twice for each pprint() call is a 
wise move.

Another way to tackle this might be a function that translates the non-Latin-1 
or whatever characters, allowing the original write() or whatever method to 
still be used. Here is a Python 2 and 3 compatible attempt: 
https://bitbucket.org/Gfy/pyrescene/src/560cafe/rescene/utility.py#cl-426. 
Python 3 only version: 
https://github.com/vadmium/python-iview/commit/68b0559. This function is 
originally used for printing descriptive comments to stdout (alongside other 
text where the “strict” error handler is appropriate). But I think it could be 
generally usable for pprint(), sys.displayhook(), etc as well.

--
nosy: +vadmium

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



[issue23793] Support __add__, __mul__, and __imul__ for deques.

2015-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 The behavior for multiplying or adding doesn't seem quite so 
 intuitive when you allow for a bounded deque.

What would you want it to do?  By design, the key feature of maxlen is pop old 
inputs to make way newer appends -- that is its essence.

It would be surprising if the following invariant didn't hold:

 deque('abc' * 3, maxlen=5) == deque('abc', maxlen=5) * 3
True

That said, I don't expect that people are going to commonly be doing d*=n where 
len(d)  1 and there is a maxlen  len(d)*n.   The normal cases are 
unsurprising.

--

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



[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-03-30 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag
type: behavior - enhancement

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



[issue23779] imaplib authenticate raises TypeError if authenticator tries to abort

2015-03-30 Thread Craig Holmquist

Craig Holmquist added the comment:

New patch is attached.

--
Added file: http://bugs.python.org/file38749/imap_auth2.patch

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



[issue17214] http.client.HTTPConnection.putrequest encode error

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

I think this patch needs a test. I left some comments on Reitveld as well. 
Perhaps there should also be a test to prove that redirects to URLs like 
/spaced%20path/ do not get mangled.

Have a look at the HTTPRedirectHandler.redirect_request() method. Perhaps the 
code translating spaces to %20 could be merged with the fix for this issue.

--
nosy: +vadmium

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



[issue12855] linebreak sequences should be better documented

2015-03-30 Thread Martin Panter

Martin Panter added the comment:

Patch v4 adds back the reference to “universal newlines”. I did not alter the 
doc string, because I don’t think doc strings need to be as detailed as the 
main documentation.

--
Added file: http://bugs.python.org/file38748/linebreakdoc.v4.py3.5.patch

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



[issue23338] PyErr_Format in ctypes uses invalid parameter

2015-03-30 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
stage:  - patch review
type: crash - behavior
versions: +Python 3.4, Python 3.5 -Python 3.6

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



[issue23663] Crash on failure in ctypes on Cygwin

2015-03-30 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
resolution:  - duplicate
stage: patch review - resolved
status: open - closed
superseder:  - PyErr_Format in ctypes uses invalid parameter
type: crash - behavior

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



[issue5714] http.server._url_collapse_path should live elsewhere

2015-03-30 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

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



[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)

2015-03-30 Thread Ned Deily

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


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

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



  1   2   >