[issue24567] random.choice IndexError due to double-rounding

2015-07-06 Thread Stefan Krah

Stefan Krah added the comment:

 Python-the-language makes no promises about adhering to IEEE 754 arithmetic 
 rule.

Still, I think we could switch to -mfpmath=sse, which would at least
guarantee consistent behavior across different gcc versions.

--

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



[issue24566] Unsigned Integer Overflow in sre_lib.h

2015-07-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, this patch was not applied because it had no visible effect on Linux. No, 
with your report, there is a case on Windows.

--
assignee:  - serhiy.storchaka
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - Pointers point out of array bound in _sre.c
versions: +Python 2.7, Python 3.6

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



[issue24566] Unsigned Integer Overflow in sre_lib.h

2015-07-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, this patch was not applied because it had no visible effect on Linux. Now, 
with your report, there is a case on Windows.

--

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



[issue24566] Unsigned Integer Overflow in sre_lib.h

2015-07-06 Thread Serhiy Storchaka

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


--
Removed message: http://bugs.python.org/msg246353

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24566
___
___
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-07-06 Thread Lars Gustäbel

Changes by Lars Gustäbel l...@gustaebel.de:


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

___
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



[issue24574] ANSI escape sequences breaking string justification

2015-07-06 Thread Krzysztof Słychań

New submission from Krzysztof Słychań:

Strings containing ANSI escape sequences are not justified if the length 
including escape sequences exceeds the field width.

Testcase:
Let's make a string with escape sequences - bold, for example:
 string = '\033[01m' + 'bold' + '\033[0m'

String length will be larger than the length of a displayed string
(should be 4, is 13). Looks like '\03' is counted as escape sequence,
but '3[01m' and '3[0m' are not, and count into the string length.
 len(string)
13

Try to print justified string - should be centered between '|' signs
 print('|' + string.center(10) + '|')
|bold|
Does not work at all...

If field length is larger than len(string), justification works
 print('|' + string.center(30) + '|')
|bold |

--
components: Interpreter Core
messages: 246351
nosy: Krzysztof Słychań
priority: normal
severity: normal
status: open
title: ANSI escape sequences breaking string justification
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24574
___
___
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-07-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 372aa98eb72e by Lars Gustäbel in branch '2.7':
Issue #24259: tarfile now raises a ReadError if an archive is truncated inside 
a data segment.
https://hg.python.org/cpython/rev/372aa98eb72e

New changeset c7f4f61697b7 by Lars Gustäbel in branch '3.4':
Issue #24259: tarfile now raises a ReadError if an archive is truncated inside 
a data segment.
https://hg.python.org/cpython/rev/c7f4f61697b7

New changeset 59cbdc9eb3d9 by Lars Gustäbel in branch '3.5':
Merge with 3.4: Issue #24259: tarfile now raises a ReadError if an archive is 
truncated inside a data segment.
https://hg.python.org/cpython/rev/59cbdc9eb3d9

New changeset 6be8fa47c002 by Lars Gustäbel in branch 'default':
Merge with 3.5: Issue #24259: tarfile now raises a ReadError if an archive is 
truncated inside a data segment.
https://hg.python.org/cpython/rev/6be8fa47c002

--
nosy: +python-dev

___
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



[issue24551] byte conversion

2015-07-06 Thread Padmanabhan Tr

Padmanabhan Tr added the comment:

Dear Mr Steven D'ApranoThanks for your prompt response.I guess that 'b'\x00\x00 
0' is the same as b'\x00\x00\x20\x30' if we take (space) as 20  0 as 30 as 
with ASCII / UTF-8 representation.  But if I go by 'Python Library Reference 
-Release version 3.4.2 (Section 4.4.2) ' there is no room for ASCII / UTF-8 
representation here.  Direct byte conversion is used.Please confirm whether I 
am right.RegardsPadmanabhan

 On Thursday, July 2, 2015 10:20 PM, Steven D'Aprano 
rep...@bugs.python.org wrote:

Steven D'Aprano added the comment:

I don't know, what *is* the problem? What behaviour did you expect? The code 
sample you show seems to be working exactly as it is supposed to.

b'\x00\x00 0' is the same as b'\x00\x00\x20\x30', and that is the same as 
b'\x20\x30' with NUL padding on the left. Written as integers, that is like 
0x2030 == 0x2030 == 8240.

I don't think this demonstrates a bug or problem. If you still believe it does, 
please re-open the issue with a detailed description of what behaviour you 
expected and why you think this is a bug.

--
nosy: +steven.daprano
resolution:  - not a bug
status: open - closed

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

--

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



[issue18684] Pointers point out of array bound in _sre.c

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



[issue18684] Pointers point out of array bound in _sre.c

2015-07-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0007031e0452 by Serhiy Storchaka in branch '2.7':
Issue #18684: Fixed reading out of the buffer in the re module.
https://hg.python.org/cpython/rev/0007031e0452

New changeset 389795b7c703 by Serhiy Storchaka in branch '3.4':
Issue #18684: Fixed reading out of the buffer in the re module.
https://hg.python.org/cpython/rev/389795b7c703

New changeset 5adf995d443f by Serhiy Storchaka in branch '3.5':
Issue #18684: Fixed reading out of the buffer in the re module.
https://hg.python.org/cpython/rev/5adf995d443f

New changeset bb9fc884a838 by Serhiy Storchaka in branch 'default':
Issue #18684: Fixed reading out of the buffer in the re module.
https://hg.python.org/cpython/rev/bb9fc884a838

--
nosy: +python-dev

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



[issue24574] ANSI escape sequences breaking string justification

2015-07-06 Thread Eric V. Smith

Eric V. Smith added the comment:

strings are unaware of any ANSI escape sequences or other structure that is 
being ascribed to their contents.

The '\033' escape character is being counted, as are the rest of the characters 
in that string. Since the string is already at least 10 characters long, 
.center(10) returns the original string.

--
nosy: +eric.smith
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread Timothy Murphy

New submission from Timothy Murphy:

My build of the 3.5 head fails in timemodule.c which results in an interpreter 
that can run but can't import time.

Details:
changeset 96851:bb9fc884a838
on Fedora Linux x86_64 

Output:
/home/tim/build/cpython/Modules/timemodule.c: In function ‘time_strftime’:
/home/tim/build/cpython/Modules/timemodule.c:656:9: error: unknown type name 
‘_Py_BEGIN_SUPPRESS_IPH’
 _Py_BEGIN_SUPPRESS_IPH
 ^
/home/tim/build/cpython/Modules/timemodule.c:656:9: error: ISO C90 forbids 
mixed declarations and code [-Werror=declaration-after-statement]
/home/tim/build/cpython/Modules/timemodule.c:658:9: error: 
‘_Py_END_SUPPRESS_IPH’ undeclared (first use in this function)
 _Py_END_SUPPRESS_IPH
 ^
/home/tim/build/cpython/Modules/timemodule.c:658:9: note: each undeclared 
identifier is reported only once for each function it appears in
/home/tim/build/cpython/Modules/timemodule.c:662:9: error: expected ‘;’ before 
‘if’
 if (buflen  0 || i = 256 * fmtlen) {
 ^
/home/tim/build/cpython/Modules/timemodule.c:657:9: warning: unused variable 
‘buflen’ [-Wunused-variable]
 buflen = format_time(outbuf, i, fmt, buf);
 ^
/home/tim/build/cpython/Modules/timemodule.c:561:20: warning: unused variable 
‘buflen’ [-Wunused-variable]
 size_t fmtlen, buflen;
^
/home/tim/build/cpython/Modules/timemodule.c:561:12: warning: variable ‘fmtlen’ 
set but not used [-Wunused-but-set-variable]
 size_t fmtlen, buflen;
^
cc1: some warnings being treated as errors

Failed to build these modules:
time

--
components: Build, Extension Modules
messages: 246358
nosy: tnmurphy
priority: normal
severity: normal
status: open
title: timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH 
and _Py_END_SUPPRESS_IPH
type: compile error
versions: Python 3.5

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread Timothy Murphy

Timothy Murphy added the comment:

This patch works for me on Linux but it seems clearly wrong for windows.

The problem is that using it on windows introduces a dependency and I don't 
have a windows machine to check if this is ok.  To me it seems that the time 
module must have been built as part of the core somehow in the past. 

diff -r 5adf995d443f Modules/timemodule.c
--- a/Modules/timemodule.c  Mon Jul 06 14:03:01 2015 +0300
+++ b/Modules/timemodule.c  Mon Jul 06 14:15:52 2015 +0100
@@ -30,6 +30,13 @@
 #endif /* MS_WINDOWS */
 #endif /* !__WATCOMC__ || __QNX__ */
 
+#define Py_BUILD_CORE 
+#include pyport.h
+
+#define _Py_BEGIN_SUPPRESS_IPH
+#define _Py_END_SUPPRESS_IPH
+
+
 /* Forward declarations */
 static int pysleep(_PyTime_t);
 static PyObject* floattime(_Py_clock_info_t *info);

--

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



[issue24576] python27 unicode align comments

2015-07-06 Thread 潘新明

New submission from 潘新明:

see patch.

--
components: Unicode
files: python27_unicode_align_comments.patch
keywords: patch
messages: 246360
nosy: ezio.melotti, haypo, 潘新明
priority: normal
severity: normal
status: open
title: python27 unicode align comments
versions: Python 2.7
Added file: 
http://bugs.python.org/file39875/python27_unicode_align_comments.patch

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



[issue18295] Possible integer overflow in PyCode_New()

2015-07-06 Thread Mark Lawrence

Mark Lawrence added the comment:

Could we try and get this closed please, as I'm always a little concerned that 
a code change causes a genuine warning that should be actioned, but it gets 
masked by all the others.

--

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



[issue24573] Using multiprocessing with tkinter frames in Python 3.4.3 crashes in OS X

2015-07-06 Thread R. David Murray

R. David Murray added the comment:

Your test code works for me on linux and python3.3 and 3.4.1.  That is, I can 
click four buttons and get back the prompt, with no segfault.  It is quite 
possible this is a bug in the Mac version of TK, assuming this is even supposed 
to work.

--
nosy: +r.david.murray

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-06 Thread Mark Dickinson

Mark Dickinson added the comment:

 Still, I think we could switch to -mfpmath=sse, which would at least
guarantee consistent behavior across different gcc versions.

... which would fix fsum on 32-bit Linux, too.  (I thought there was an open 
issue for this, but now I can't find it.)

--

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



[issue24576] python27 unicode align comments

2015-07-06 Thread Ned Deily

Ned Deily added the comment:

Thanks for the patch.  However, in general, we don't like to change the source 
files in Python just to improve white-space formatting, in particular with 
older releases like Python 2.7.  If the formatting changes are being done as 
part of a larger change in the area, sure, but otherwise it's a judgement call 
and we usually avoid unnecessary churn in maintenance releases.

--
nosy: +ned.deily
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue24577] Document asyncio behavior (logging and call to connection_lost) on socket TimeoutError

2015-07-06 Thread R. David Murray

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


--
title: Document behavior (logging and call to connection_lost) on socket 
TimeoutError - Document asyncio behavior (logging and call to connection_lost) 
on socket TimeoutError

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



[issue17311] use distutils terminology in PyPI package display section

2015-07-06 Thread sanad

sanad added the comment:

In an attempt to fix this issue on lines of the criteria given by nick, have 
uploaded my patch . Please review it so that If mistake is there ,I can fix and 
upload corrected patch again. Thanks for your time.

--
keywords: +patch
nosy: +sanad
Added file: http://bugs.python.org/file39876/issue17311.patch

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



[issue24571] [RFE] Add asyncio.blocking_call API

2015-07-06 Thread Sven R. Kunze

Sven R. Kunze added the comment:

Thanks for taking the initiative here, Nick. I created a follow-up on this: 
http://bugs.python.org/issue24578

In order to bridge both worlds, projects might need convenient way from and to 
either world (classic and asyncio).

--
components: +asyncio
nosy: +srkunze

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



[issue24571] [RFE] Add asyncio.blocking_call API

2015-07-06 Thread Sven R. Kunze

Sven R. Kunze added the comment:

2 remarks:

1) I would rather go for a more comprehensible name such as 'get_awaitable' 
instead of 'blocking_call'. Later reminds me of the execution of f which is not 
the case.

2) redundant ) in the end of Usage: result = await asyncio.blocking_call(f, 
*args, **kwds))

--

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



[issue24578] [RFE] Add asyncio.wait_for_result API

2015-07-06 Thread Sven R. Kunze

New submission from Sven R. Kunze:

In order to complement http://bugs.python.org/issue24571, this is another 
high-level convenience API for asyncio to treat an awaitable like a usual 
subroutine (credits go to Nick Coghlan):

# Call awaitable from synchronous code
def wait_for_result(awaitable):
Usage: result = asyncio.wait_for_result(awaitable)
return 
asyncio.get_event_loop().run_until_complete(awaitable.__await__())

It may not be that conceptually dense, however, I feel for projects 
transitioning from the classical subroutine world to the asyncio world, this 
functionality might prove useful to bridge both worlds seamlessly when 
necessary.

--
components: asyncio
messages: 246373
nosy: gvanrossum, haypo, srkunze, yselivanov
priority: normal
severity: normal
status: open
title: [RFE] Add asyncio.wait_for_result API
versions: Python 3.5, Python 3.6

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



[issue24578] [RFE] Add asyncio.wait_for_result API

2015-07-06 Thread Sven R. Kunze

Changes by Sven R. Kunze srku...@mail.de:


--
nosy: +giampaolo.rodola, ncoghlan, pitrou -srkunze
type:  - enhancement

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



[issue24578] [RFE] Add asyncio.wait_for_result API

2015-07-06 Thread Sven R. Kunze

Changes by Sven R. Kunze srku...@mail.de:


--
nosy: +srkunze

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



[issue24573] Using multiprocessing with tkinter frames in Python 3.4.3 crashes in OS X

2015-07-06 Thread Ronald Oussoren

Ronald Oussoren added the comment:

This is likely a known issue with using os.fork on OSX: that is unsafe, and 
likely causes crashes, once one of Apple's frameworks has initialized. 

I think it might be better in the long run to make multiprocessing on OSX 
behave the same as on windows, but haven't thought about the consequences of 
this enough to be sure (because there are downsides as well)

BTW. Besides that, the code pattern doesn't match how GUI applications are 
supposed to work on OSX. Applications are basically supposed to be single 
process, even when working with multiple documents. 

--
On the road, hence brief. 

Op 6 jul. 2015 om 15:57 heeft R. David Murray rep...@bugs.python.org het 
volgende geschreven:

 
 R. David Murray added the comment:
 
 Your test code works for me on linux and python3.3 and 3.4.1.  That is, I can 
 click four buttons and get back the prompt, with no segfault.  It is quite 
 possible this is a bug in the Mac version of TK, assuming this is even 
 supposed to work.
 
 --
 nosy: +r.david.murray
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue24573
 ___

--

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



[issue24570] IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18

2015-07-06 Thread Ned Deily

Ned Deily added the comment:

Kevin, I think that Autocomplete is implemented as an IDLE extension in:
Lib/idlelib/AutoComplete.py
Lib/idlelib/AutoCompleteWindow.py

and configured in:
Lib/idlelib/config-extensions.def
- force-open-completions=Control-Key-space

Perhaps someone could try to reduce it to smaller test case; I will likely not 
have time to work on it myself for the immediate future.  Tal, can you 
reproduce this issue when using ActiveTcl 8.5.18?

--
nosy: +taleinat

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



[issue24573] Using multiprocessing with tkinter frames in Python 3.4.3 crashes in OS X

2015-07-06 Thread Ned Deily

Ned Deily added the comment:

A web search will find multiple hits for problems with using Tk (and Tkinter) 
with multiprocess on OS X and elsewhere.  On OS X, there is a well-known and 
documented restriction that impacts Tk-based apps:

When launching separate processes using the fork function, you must always 
follow a call to fork with a call to exec or a similar function. Applications 
that depend on the Core Foundation, Cocoa, or Core Data frameworks (either 
explicitly or implicitly) must make a subsequent call to an exec function or 
those frameworks may behave improperly.

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/AboutThreads/AboutThreads.html

For a specific example of problems using tkinter and multiprocessing see:
http://stackoverflow.com/questions/23599087/multiprocessing-python-core-foundation-error

Some suggest that you *might* be able to get things to work as long as you 
defer importing tkinter (and, thus, initializing Tcl and Tk) until after all of 
the processes are created.  But, in general, it's not a good idea to separate 
tkinter calls across multiple processes.  See Bryan Oakley's advice in the 
above SO link:

You'll need to keep all GUI code in the master process, and have your other 
process communicate with it via a queue.

--
resolution:  - third party
stage:  - resolved
status: open - closed

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



[issue4356] Add key argument to bisect module functions

2015-07-06 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'll add a key= variant for Python 3.6.

--
versions: +Python 3.6 -Python 3.4

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



[issue24136] document PEP 448: unpacking generalization

2015-07-06 Thread Martin Panter

Martin Panter added the comment:

Yes I think it is expected and documented that the leftovers are turned into a 
list. See https://docs.python.org/3.5/reference/simple_stmts.html#index-6. I 
originally had similar confusion, expectating the starred target to become a 
tuple, because people often use tuple-like syntax, but:

 generator_expression = (2**i for i in range(4))
 (one, *a_list, eight) = generator_expression
 a_list  # Not a tuple!
[2, 4]

One thing in the section I linked above that should also be fixed is that the 
assigned object may be any iterable, not just a sequence.

About changing the tutorial, just be careful you don’t add unnecessary 
complication too early. The original * and ** syntax for function parameters is 
not mentioned until 
https://docs.python.org/3.5/tutorial/controlflow.html#more-on-defining-functions.
 Later, argument unpacking: 
https://docs.python.org/3.5/tutorial/controlflow.html#unpacking-argument-lists.
 Assignment unpacking doesn’t seem to mentioned at all (not that I am saying it 
should be). It might be higher priority to update the main reference 
documentation first.

--
title: document PEP 448 - document PEP 448: unpacking generalization

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



[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation

2015-07-06 Thread Martin Panter

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


--
stage: patch review - commit review

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



[issue24578] [RFE] Add asyncio.wait_for_result API

2015-07-06 Thread Martin Panter

Martin Panter added the comment:

I don’t think you need the __await__() call. Just do 
loop.run_until_complete(awaitable).

I understand “asyncio” doesn’t support recursive calls into the same event loop 
on purpose; see Issue 22239. So this code would only be useful from outside of 
the event loop, or if more than one event loop was in use.

--
nosy: +vadmium

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



[issue24579] Additional tests for urllib module

2015-07-06 Thread Craig Northway

New submission from Craig Northway:

Patch containing additional tests for urllib module to increase code coverage 
for url parsing.

Current coverage:

Lib/urllib/parse 51320261%

Updated coverage:

Lib/urllib/parse 51313973%

--
components: Tests
messages: 246386
nosy: craign
priority: normal
severity: normal
status: open
title: Additional tests for urllib module
type: enhancement

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



[issue24579] Additional tests for urllib module

2015-07-06 Thread Craig Northway

Changes by Craig Northway craig.north...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file39877/urllib.patch

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



[issue24573] Using multiprocessing with tkinter frames in Python 3.4.3 crashes in OS X

2015-07-06 Thread Topher Kessler

Topher Kessler added the comment:

Yeah it is a bug in OS X, fixed by setting the python multiprocessing start 
method to 'forkserver' instead of the default fork.

--

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



[issue13456] Providing a custom HTTPResponse class to HTTPConnection

2015-07-06 Thread Martin Panter

Martin Panter added the comment:

Why do people want “response_class” to be part of the API? If so, more details 
about it may need to added, e.g. the following methods and attributes seem to 
be required: _read_status(), fp, close(), isclosed(), begin() and will_close.

The “debuglevel” attribute seems fairly redundant with the existing 
set_debuglevel() method.

Also, what is the point of adding the “default_port” attribute, if it cannot be 
modified? The only use case I can imagine is in a subclass that specifically 
does modify it. But I’m not sure it should be added at all.

So I am sorry, but I don’t see why any of the three additions in the patch 
should be made. IMO it would be better to explain that “response_class” is an 
internal implementation detail, or even drop it entirely from the doc string.

--
nosy: +vadmium

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



[issue24579] Additional tests for urllib module

2015-07-06 Thread Martin Panter

Martin Panter added the comment:

Have you seen the existing test cases in /Lib/test/test_urlparse.py? If not, I 
don’t blame you, because of the odd test file naming and structuring. :) But I 
suspect some of your tests may be redundant.

But you might be in a good position to suggest some comments to add somewhere 
explaining where all the urllib tests are. I understand the test file names 
come from Python 2 (where urlparse is a module). I don’t know if they were not 
renamed just due to laziness, or if it was to make merging patches between 
Python 2 and 3 easier.

--
nosy: +vadmium

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



[issue24579] Additional tests for urllib module

2015-07-06 Thread Craig Northway

Changes by Craig Northway craig.north...@gmail.com:


--
versions: +Python 3.6

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



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-06 Thread Dan Haffey

New submission from Dan Haffey:

Error reporting for recursive backreferences in regexes isn't consistent across 
both types of backref. Here's the exception for a recursive numeric backref:

 import re
 re.compile(r'(\1)')
Traceback (most recent call last):
...
sre_constants.error: cannot refer to an open group at position 1

Here's what I'm seeing on the 3.5 branch for a named backref:

 re.compile(r'(?Pspam(?P=spam))')
Traceback (most recent call last):
...
RecursionError: maximum recursion depth exceeded

Which is an improvement over 3.4 and below, where compilation succeeds and 
appears to treat (?P=spam) as valid but unmatchable.

--
components: Regular Expressions
messages: 246390
nosy: dhaffey, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Wrong or missing exception when compiling regexes with recursive named 
backreferences
type: behavior

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



[issue24579] Additional tests for urllib module

2015-07-06 Thread Craig Northway

Craig Northway added the comment:

Whoops, looks like there is definitely some redundancy. I didn't notice those 
tests at the time I wrote these (PyCon AU last year) and while I have been 
grappling with getting permission to make the contributions it looks like it's 
been worked on a bit.

I'll close this for now.

--
status: open - closed

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



[issue24580] Wrong or missing exception when compiling regexes with recursive named backreferences

2015-07-06 Thread Serhiy Storchaka

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


--
assignee:  - serhiy.storchaka
nosy: +serhiy.storchaka
stage:  - needs patch
versions: +Python 3.5, Python 3.6

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread Timothy Murphy

Timothy Murphy added the comment:

Ok so I see the compiler is including pyport.h (using strace) so that means 
that it can only be a case of  Py_BUILD_CORE not being in CFLAGS for 
timemodule.o.

I suppose that this is a configure problem.  I'll try to work out how/why.

--

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



[issue4356] Add key argument to bisect module functions

2015-07-06 Thread Mark Dickinson

Mark Dickinson added the comment:

I've just encountered another case where the lack of a key on bisect has led to 
more complicated and error-prone code than necessary.

Quick summary: we've got a list containing an ordered collection of 
non-overlapping open intervals on the real line.  (In case anyone wants to 
know, the intervals represent the depths of chunks of interest in a rock core 
sample.)  There's then code for splitting an interval into two pieces at a 
given point, and for merging two adjacent intervals.  Splitting involves (i) 
finding the relevant interval using a bisect search based on the left endpoint 
of each interval, then (ii) replacing that interval with two new intervals in 
the list.

The fact that the list is being modified after every bisect search makes it 
messy to cache the left endpoints, since that cache has to be updated along 
with the list at every stage.  The operations are also relatively rare, which 
makes it feel inefficient to be computing *all* the left endpoints of the 
intervals in the first place.

Adding comparisons to our interval class is doable, but invasive and unnatural, 
since the actual class carries other pieces of data and there are many possible 
meanings for `` with respect to that class: it doesn't make sense to hard-code 
the comparison with respect to depths in that class's `__lt__` method.

So I think there's a strong case for a key argument in some future version of 
Python.

[Of course, for our app we're on Python 2.7, so this issue won't help us 
directly.  We're probably going to go with either reimplementing bisect or 
using a proxy array like the one suggested by Eric Reynolds.]

--

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread Timothy Murphy

Timothy Murphy added the comment:

I'm so sorry. I apologise for mucking up and giving you the wrong changeset :-(

my hg summary output is as follows:

parent: 96850:5adf995d443f 
 Issue #18684: Fixed reading out of the buffer in the re module.
branch: 3.5
commit: 2 unknown (clean)
update: (current)
mq: 1 unapplied

I have no modifications. 

The macros only have meaningful definitions on windows and they come from 
./Include/pyport.h.

I could just include this but they are protected by Py_BUILD_CORE so I'm not 
clear what's really going on and ... hence I leave it to others.

--

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



[issue24577] Document behavior (logging and call to connection_lost) on socket TimeoutError

2015-07-06 Thread R. David Murray

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


--
assignee:  - docs@python
components: +Documentation, asyncio
nosy: +docs@python, gvanrossum, haypo, yselivanov
stage:  - needs patch
type:  - behavior
versions: +Python 3.4, Python 3.5, Python 3.6

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



[issue24577] Document behavior (logging and call to connection_lost) on socket TimeoutError

2015-07-06 Thread R. David Murray

New submission from R. David Murray:

I saw _fatal_error tracebacks in my application log, and thought I had hit an 
asyncio bug, but according to https://github.com/python/asyncio/issues/135 this 
is the correct behavior.  That issue ends with a request to open a 
documentation issue on the python tracker, but I don't think that was done (I 
couldn't find one, anyway), so I'm opening this one.

At this point in time I have no idea where this would go in the docs.  Maybe in 
the docs for connection_lost?

--
messages: 246370
nosy: r.david.murray
priority: normal
severity: normal
status: open
title: Document behavior (logging and call to connection_lost) on socket 
TimeoutError

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-06 Thread Tim Peters

Tim Peters added the comment:

Mark, closest I could find to a substantive SSE-vs-fsum report is here, but it 
was closed (because the fsum tests were changed to ignore the problem ;-) ):

http://bugs.python.org/issue5593

--

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread Steve Dower

Steve Dower added the comment:

Last time this came up the solution was either hg purge or make distclean, 
I don't remember which worked.

timemodule.c should already be built with Py_BUILD_CORE set in CFLAGS, but 
apparently it's possible for that setting to disappear from one of the 
generated build files.

--

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



[issue24574] ANSI escape sequences breaking string justification

2015-07-06 Thread R. David Murray

R. David Murray added the comment:

See issue 12499 for an RFE to textwrap that would at least partially address 
this use case.

--
nosy: +r.david.murray

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



[issue24575] timemodule build fail - missing definitions for _Py_BEGIN_SUPPRESS_IPH and _Py_END_SUPPRESS_IPH

2015-07-06 Thread R. David Murray

R. David Murray added the comment:

It works for us.  I've added Steve Dower to nosy, who I believe added that 
code.  IIUC it should only come into play on Windows.

Are you using a stock checkout, or have you applied local modifications?  The 
changeset id you reference doesn't have IPH in it.

--
nosy: +r.david.murray, steve.dower
versions: +Python 3.6

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