[issue1621] Do not assume signed integer overflow behavior

2016-08-05 Thread Xiang Zhang

Xiang Zhang added the comment:

It's good Martin. Just commit it.

--

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-08-05 Thread Martin Panter

Martin Panter added the comment:

Xiang: regarding your overflow_fix_in_listextend.patch, what do you think about 
adding a comment or debugging assertion instead, something like:

/* It should not be possible to allocate a list large enough to cause an 
overflow on any relevant platform */
assert(m < PY_SSIZE_T_MAX - n);

--

___
Python tracker 

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



[issue21056] csv documentation is incorrect

2016-08-05 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

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



[issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()

2016-08-05 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, thanks! I went with Ezio's suggestion but left 2.7 documentation as 
is.

--
nosy: +berker.peksag
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: enhancement -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()

2016-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0402caa0ef5 by Berker Peksag in branch '3.5':
Issue #18548: Fix unittest.TestSuite() example
https://hg.python.org/cpython/rev/d0402caa0ef5

New changeset e17e3f620709 by Berker Peksag in branch 'default':
Issue #18548: Merge from 3.5
https://hg.python.org/cpython/rev/e17e3f620709

--
nosy: +python-dev

___
Python tracker 

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



[issue15639] csv.Error description is incorrectly broad

2016-08-05 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report.

Most of the csv.Error usages are in Modules/_csv.c. You can search for 
"_csvstate_global->error_obj" in the module's source code. I think the 
documentation is correct as is.

--
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27621] Finish IDLE Query dialog appearance and behavior.

2016-08-05 Thread Mark Roseman

Mark Roseman added the comment:

Looks great Terry - thanks. Only nit is that test_click_help_source fails on 
Mac, courtesy a leading 'file://' added in the last few lines of path_ok

--

___
Python tracker 

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



[issue26981] add compatibility shim for enum34 backport

2016-08-05 Thread Ethan Furman

Ethan Furman added the comment:

Done in issue26988.

--
resolution:  -> fixed
status: open -> closed
superseder:  -> Add AutoNumberedEnum to stdlib

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7ed7d7f58fcd by Ethan Furman in branch 'default':
Add AutoEnum: automatically provides next value if missing.  Issue 26988.
https://hg.python.org/cpython/rev/7ed7d7f58fcd

--
nosy: +python-dev

___
Python tracker 

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



[issue15786] IDLE code completion window can hang or misbehave with mouse

2016-08-05 Thread Mark Roseman

Mark Roseman added the comment:

I've done some playing around... not quite there yet, but I think much closer.

First, I assume the 'freeze' on Mac is not a hard freeze, but where the text 
window is not responding to events, but if you switch to another app and back, 
it works again?

Second, right now (assuming I've got the latest), if you click on the listbox 
it goes away immediately, due to it being included in HIDE_SEQUENCES (meaning 
ButtonPress generates <> which calls the routine to 
hide the autocomplete window. Which obscures any double click event etc. 

Third, and I think this is the key to this, is that all of the event_add, 
event_delete, bind, and unbind are not calling Tkinter routines directly, but 
are going through the multicall module (which allows an event to fire more than 
one binding). When we call hide_window, we're doing several event_delete and 
unbind  calls in multicall to undo the bindings we had set up before. Which 
should leave us back where we started, with the text widget bindings still 
firing when events come in.

So then is it an issue of the events not coming in (indicating a bug in Tkinter 
or how we're calling it), or multicall not correctly dispatching to the text 
widget?

Stick a print() call in multicall.py:_ComplexBinder:__create_handler:handler 
and you'll see the events are being generated by Tk, but multicall isn't 
dispatching them.

When I get a chance again, I can see about digging into multicall to verify if 
it is doing something wrong.

I'll also raise a meta-issue, and that is that using a multicall-like wrapper 
approach may not necessarily be the best approach to doing the multiple 
dispatch. Adding a new (Tk widget) class to the text widget (via the 'bindtags' 
command) and then attaching bindings to that class would I suspect be simpler.

And finally, one simplification for the autocomplete window class... the 
listbox generates a <> virtual event every time its selection 
changes, so you don't need to bind against all the clicks, arrow keys, etc.

--
nosy: +markroseman

___
Python tracker 

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



[issue14594] document imp.load_dynamic()

2016-08-05 Thread Berker Peksag

Berker Peksag added the comment:

The imp module has been deprecated long time ago and the importlib module 
itself doesn't it anymore. However, Cython still use it: 
https://github.com/cython/cython/blob/master/pyximport/pyximport.py#L217

I'm inclined to close this as 'out of date' but feel free to reopen it :)

--
nosy: +berker.peksag
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue3216] Scarce msilib documentation

2016-08-05 Thread Berker Peksag

Berker Peksag added the comment:

All obvious bugs have already been fixed.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22391] MSILIB truncates last character in summary information stream

2016-08-05 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report. This is a duplicate of issue 1104.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue12276] 3.x ignores sys.tracebacklimit=0

2016-08-05 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
type:  -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread STINNER Victor

STINNER Victor added the comment:

FYI my Python reimplementation of the bytecode peephole optimizer doesn't
have this issue. It estimates the size of a**b using exp() and ln()
functions.
http://bytecode.readthedocs.io/en/latest/

--

___
Python tracker 

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



[issue27242] Make the docs for NotImplemented & NotImplementedError unambiguous

2016-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 142f5325af06 by Ethan Furman in branch 'default':
Clarify NotImplemented vs NotImplementedError.  Initial patch by Emmanuel 
Barry.  Closes issue 27242.
https://hg.python.org/cpython/rev/142f5325af06

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue27697] Obscure bug in the int() function

2016-08-05 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27697] Obscure bug in the int() function

2016-08-05 Thread Ammar Askar

Ammar Askar added the comment:

You've ran into a classic floating point number limitation. 
Please read the following doc page: 
https://docs.python.org/2/tutorial/floatingpoint.html

The problem comes when you multiply the number by 100, which is what causes the 
precision loss and drops it by a penny.

>>> 1108431.38 * 100
110843137.
>>> int(110843137.)
110843137

If this is for currency, I would suggest you use the decimal module 
https://docs.python.org/2/library/decimal.html

--
nosy: +ammar2

___
Python tracker 

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



[issue27182] PEP 519 support in the stdlib

2016-08-05 Thread Brett Cannon

Brett Cannon added the comment:

Just a quick update: between the patches for issue #26027 and issue #26667, the 
necessary code to make os.path work with path-like objects is done. At this 
point I'm just waiting for code reviews on those patches.

--

___
Python tracker 

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



[issue27697] Obscure bug in the int() function

2016-08-05 Thread nathan snobelen

New submission from nathan snobelen:

Hi, I've noticed a bug in int() when converting a specific range of numbers it 
will incorrectly round the last digit down.

We have some payment code which formats numbers for processing in our system 
and we noticed that the payment of 1108431.38 was dropped by a penny to 
1108431.37.  I looked into it and found that it is dropped when it is 
multiplied by 100 (to remove the decimal) and then converted back to an int.

Note, this bug only applies to the following range of numbers: 1108431.38 - 
1108431.41.  Any other number I tried was unaffected. 

The following code will replicate the bug:

import math

amount1 = 110843138.0
amount2 = 1108431.38 * 100

print "Orig amount1 " + str(amount1)
print "Orig amount2 " + str(amount2)

print "Converted amount1 " + str(int(amount1))
print "Converted amount2 " + str(int(amount2))

Try it, and you will see that "amount1" remains correct, but "amount2" is 
affected.  Multiplying by 100 seems to trigger it... however note that even 
after it has been multiplied by 100 it is still correct... it's only when you 
then apply the int() function that the penny drops.

So it would appear that something is wrong in the int() function.

Cheers,
Nathan

--
components: Library (Lib)
messages: 272062
nosy: nathan snobelen
priority: normal
severity: normal
status: open
title: Obscure bug in the int() function
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26027] Support Path objects in the posix module

2016-08-05 Thread Brett Cannon

Brett Cannon added the comment:

Here is a version of Jelle's patch but with PyOS_FSPath() inlined.

Serhiy, does this work for you?

--
stage: patch review -> commit review
Added file: http://bugs.python.org/file44029/path_converter.diff

___
Python tracker 

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



[issue27696] win_add2path.py does not add user site directory

2016-08-05 Thread Kyle Altendorf

New submission from Kyle Altendorf:

Since the detected user path has the text `%APPDATA%` replaced into it 
`os.path.isdir()` returns `False`.  As a result, the user site path is not 
added to the `%PATH%` variable.

The patch adds `os.path.expandvars()` to the `isdir()` check to resolve this 
issue.

--
files: win_add2path.patch
keywords: patch
messages: 272060
nosy: altendky
priority: normal
severity: normal
status: open
title: win_add2path.py does not add user site directory
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file44028/win_add2path.patch

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4d33bccb59a8 by Vinay Sajip in branch '3.3':
Issue #20160: Handled passing of large structs to callbacks correctly.
https://hg.python.org/cpython/rev/4d33bccb59a8

New changeset 190ebf99bf45 by Vinay Sajip in branch '3.4':
Issue #20160: Merged fix from 3.3.
https://hg.python.org/cpython/rev/190ebf99bf45

New changeset 24b114d77ec8 by Vinay Sajip in branch '3.5':
Issue #20160: Merged fix from 3.4.
https://hg.python.org/cpython/rev/24b114d77ec8

New changeset ec9b4d93662d by Vinay Sajip in branch 'default':
Closes #20160: Merged fix from 3.5.
https://hg.python.org/cpython/rev/ec9b4d93662d

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

___
Python tracker 

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



[issue8243] curses writing to window's bottom right position raises: `_curses.error: addstr() returned ERR'

2016-08-05 Thread Ned Deily

Ned Deily added the comment:

See also Issue27693 which documents a similar issue using curses.textpad.

--

___
Python tracker 

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



[issue27693] curses.textpad.Textbox(win).edit() won't edit last character

2016-08-05 Thread Ned Deily

Ned Deily added the comment:

Looks like there have been longstanding issues with using curses to write to 
the right-/bottom-most character position of a curses window; see open 
Issue8243 and various discussions elsewhere.  Some of the discussions suggest 
the issues dates back to support of physical terminals where writing to the 
last character position caused an automatic scroll up of the lines on a screen 
and suggest it is best to avoid trying to write in that last position.  I'm not 
a curses expert so whether that advice is still relevant today and whether 
Textbox behavior should be changed are open questions.  The behavior could just 
be added to the proposed documentation changes in Issue8243.  Perhaps @twouters 
has a suggestion.

--
nosy: +ned.deily, twouters
versions: +Python 3.5, Python 3.6 -Python 3.2

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 09475e6135d0 by Vinay Sajip in branch '2.7':
Issue #20160: Handled passing of large structs to callbacks correctly.
https://hg.python.org/cpython/rev/09475e6135d0

--

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

changeset:   102542:f10029fea6ee
tag: tip
parent:  102540:fe189b8bd3ab
parent:  102541:b5403f416836
user:Guido van Rossum 
date:Fri Aug 05 12:57:38 2016 -0700
summary: Add typing.Generator docs, by Michael Lee. (Merge 3.5->3.6)

changeset:   102541:b5403f416836
branch:  3.5
parent:  102539:42d84513c3f0
user:Guido van Rossum 
date:Fri Aug 05 12:56:09 2016 -0700
summary: Add typing.Generator docs, by Michael Lee.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26800] Don't accept bytearray as filenames part 2

2016-08-05 Thread Brett Cannon

Brett Cannon added the comment:

Assigning to Serhiy to apply since Larry doesn't care and I already reviewed 
the patch.

--
assignee: larry -> serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



[issue27184] Support path objects in the ntpath module

2016-08-05 Thread Brett Cannon

Brett Cannon added the comment:

I added support for ntpath as part of issue #27524.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Update os.path for PEP 519/__fspath__()

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Michael Lee

Michael Lee added the comment:

Revision 3 -- I changed the protocol for the example so that you stop the 
generator by sending in a negative number as a sentinel rather then None.

--
Added file: http://bugs.python.org/file44027/document-generators-v3.patch

___
Python tracker 

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



[issue27671] FAQ: len() is still function for good reason.

2016-08-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree. We do not need to semi-apologize for having generic functions be 
builtin generic functions.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread Ammar Askar

Ammar Askar added the comment:

Just in case anyone is wondering why this happens. The compiler's peephole 
optimizer will fold constant expressions like 

x = 5 + 5

into

x = 10

More specifically, this bit here: 
https://github.com/python/cpython/blob/0f21fe6155227d11dc02bd3ef3b061de4ecea445/Python/peephole.c#L240


I'd say the current behavior of the compilation taking a long time is fine 
since at runtime it would run the exact same "2 ** 12345678912345" expression 
and spend a long time/run out of memory.

However I'd say the fact that this happens so silently can be a "gotcha" in 
some very rare cases.

--
nosy: +ammar2

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Michael Lee

Michael Lee added the comment:

Revision two -- I added a brief note mentioning that SendType is contravariant, 
as Ivan suggested.

--
Added file: http://bugs.python.org/file44026/document-generators-v2.patch

___
Python tracker 

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



[issue27688] Expand documentation about Any in the typing module

2016-08-05 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I have reviewed your patch, and it compiles with sphinx. no issue with the 
content, but I am not a native speaker and not an expert of the type hinting of 
python 3.5

--
nosy: +matrixise

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread SilentGhost

SilentGhost added the comment:

On 3.6 it takes a very long time, but it does finish.

time ./python -c "raise ValueError ; 2 ** 12345678912345"
Traceback (most recent call last):
  File "", line 1, in 
ValueError

real1m35.673s
user1m18.952s
sys 0m16.644s

--
nosy: +SilentGhost

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread SilentGhost

Changes by SilentGhost :


--
type: compile error -> resource usage
versions: +Python 2.7

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread SilentGhost

Changes by SilentGhost :


--
components: +Interpreter Core
nosy: +haypo, serhiy.storchaka
versions: +Python 3.6 -Python 2.7

___
Python tracker 

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



[issue27695] Compilation doesnt' end

2016-08-05 Thread Franco Costantini

New submission from Franco Costantini:

Hi, we currently are fuzzing Python programs to find valid code that fails to 
compile. We found this program never finishes its compilation.

$ echo "raise ValueError ; 2 ** 12345678912345" > inf.py
$ python -m py_compile inf.py

We realize the computation is a large one and takes a very long time, in this 
case the compiler consumes more and more memory over time. Perhaps the compiler 
shouldn't try to calculate this indefinitely and just return an error.

Regards

--
messages: 272046
nosy: fcostantini
priority: normal
severity: normal
status: open
title: Compilation doesnt' end
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-08-05 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Sorry, I was busy with a task but here is my patch for 3.5, in fact, it's just 
the same for 3.6

--
Added file: http://bugs.python.org/file44023/issue24658-3.5.diff

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-08-05 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


Added file: http://bugs.python.org/file44024/issue24658-3.5.diff

___
Python tracker 

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



[issue27688] Expand documentation about Any in the typing module

2016-08-05 Thread Michael Lee

Michael Lee added the comment:

Here's revision two. The only change I didn't make was the one about the 
isinstance check. It isn't included in PEP 484, and after talking to Guido, he 
decided it wouldn't be appropriate to document it here.

--
Added file: http://bugs.python.org/file44025/object-vs-any-v2.patch

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-08-05 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


Removed file: http://bugs.python.org/file44023/issue24658-3.5.diff

___
Python tracker 

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



[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-05 Thread SilentGhost

SilentGhost added the comment:

JW, could you submit a minimal reproducer for this?

--

___
Python tracker 

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



[issue27585] asyncio.Lock deadlock after cancellation

2016-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, merged upstream. It'll eventually come down to Python 3.5.3 and 3.6.

On Thu, Aug 4, 2016 at 1:28 PM, sss  wrote:
>
> sss added the comment:
>
> Thank you. This looks good to me
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-05 Thread JW

JW added the comment:

i found that making a change similar to this one in a certain place towards 
then end of my 300 or so long list of strings produces issues further along:

making a change of Latitude=1.1 -> Latitude=111.1 correctly shows as 11 added; 
however subsequent matching lines then incorrectly show as different (please 
see screenshot1)

--
nosy: +jlwing
Added file: http://bugs.python.org/file44022/screenshot1.jpg

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Michael, thank you for the patch. I have only one comment.
Generator is one of the few types in typing.py that behaves contravariantly. 
Maybe you could emphasize that it is contravariant in send type in your patch?

--
nosy: +levkivskyi

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Guido van Rossum

Changes by Guido van Rossum :


--
assignee: docs@python -> gvanrossum

___
Python tracker 

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



[issue27689] Add documentation for typing.Generator

2016-08-05 Thread Guido van Rossum

Guido van Rossum added the comment:

Patch LGTM. I'll apply and merge once your other patches are final.

--

___
Python tracker 

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



[issue27424] Failures in test.test_logging

2016-08-05 Thread Emanuel Barry

Emanuel Barry added the comment:

I'm not home to check, but judging by the error message and previous 
discussions with other developers, it seems indeed like an issue with a 
non-ASCII character in my hostname. I've changed my hostname since then, so I'm 
going to close this as won't fix. If it turns out that the issue is still 
present, I'll re-open it.

More details: I'm 90% sure that the issue is that Windows encodes non-ASCII 
characters as 'cp1252' (at least on my machine); subsequently trying to decode 
as 'ascii' or 'utf-8' doesn't work and throws an error. There's already another 
open issue about this (#26226).

--
resolution:  -> wont fix
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-08-05 Thread earl.chew

earl.chew added the comment:

In the original code, the key to the failure I observed is:

# wait for port to be assigned
n = 1000
while n > 0 and PORT is None:
time.sleep(0.001)
n -= 1

This gives a fixed deadline for the server thread to create the DocXMLRPCServer 
instance and provide the corresponding TCP port on which it is listening.

If the server thread is late (or if an exception is thrown -- but this case 
might work out ok), the TCP port will not be available in the variable PORT. In 
this case, the client thread blunders on, and inadvertently fails because PORT 
== None.

Upon failure, the test case tries to complete by tearing down the test:

 def tearDown(self):
 self.client.close()
 
 self.evt.wait()

The test case waits for self.evt to indicate that the server has completed. 
However, the server thread is running this:

while numrequests > 0:
serv.handle_request()
numrequests -= 1

In other words, the test is deadlocked because the server is waiting to process 
requests (actually it's waiting for a single request) from the client, but the 
client has already given up and is waiting for the server thread to complete.

--

___
Python tracker 

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



[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

2016-08-05 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> resolved

___
Python tracker 

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



[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

2016-08-05 Thread Martin Panter

Martin Panter added the comment:

I am pretty sure it isn’t legal. Python’s inet_aton() just wraps the underlying 
OS call. According to Posix 
, the 
leading zero in 093 would indicate octal notation, but the nine is not a valid 
octal digit.

>>> inet_ntoa(inet_aton("192.168.10.1"))
'192.168.10.1'
>>> inet_ntoa(inet_aton("192.168.010.1"))
'192.168.8.1'

--
nosy: +martin.panter
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue20004] csv.DictReader classic class has a property with setter

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

The comment is still present in python 3 sources at the moment. Shouldn't we 
remove it in python 3 ?

--
nosy: +deronnax

___
Python tracker 

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



[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

2016-08-05 Thread Haaroon Y

New submission from Haaroon Y:

Using the socket library and the method socket.inet_aton(ipAddr) it incorrectly 
states IP address such as 
192.168.093.1 and 192.092.2.1 are not legal when they are.

--
components: Library (Lib)
messages: 272033
nosy: Haaroon Y
priority: normal
severity: normal
status: open
title: Socket incorrectly states IP address that start with a zero after a dot 
are illegal
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

2016-08-05 Thread Haaroon Y

Haaroon Y added the comment:

This seems to occur when a IP value is 078 or higher.

--

___
Python tracker 

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



[issue27692] Clean serveral unnecessary NULL checks in exceptions.c

2016-08-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
stage:  -> commit review

___
Python tracker 

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



[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-05 Thread Emanuel Barry

Emanuel Barry added the comment:

Ack, special cases! I can look into making a patch, but I'm not really 
acquainted with ipaddress or the relevant protocols, so it might not be 
optimal. I'll give it a shot next week if nobody else does.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-08-05 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Here is my patch 3.6, I am going to provide the patch for 3.5

--
nosy: +matrixise
Added file: http://bugs.python.org/file44021/issue24658-3.6.diff

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Patrick Stewart

Patrick Stewart added the comment:

Actually the current released version of libffi (3.2.1) is even more severely 
broken on win64, you can't return structs at all. (patch here 
https://github.com/patstew/MINGW-packages/blob/9c3910fa32c45448826a2241c3fba3bf6abf9428/mingw-w64-libffi/fix_return_size.patch).
 They've rewritten it all in git, so hopefully the next version will work.

--

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Steve Dower

Steve Dower added the comment:

Yeah, it's more a loose end than a real concern. Helps make the case for 
reintegrating current libffi builds, as IIRC they've had the fix for a long 
time, but we don't have anyone willing to do the integration work right now.

--

___
Python tracker 

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



[issue27693] curses.textpad.Textbox(win).edit() won't edit last character

2016-08-05 Thread Dietmar Schindler

New submission from Dietmar Schindler:

curses.textpad.Textbox(win).edit() does not allow to enter a character (or 
change one, if already there) at the very last position in a window (the lower 
right hand corner), though it allows to position the cursor there. This applies 
to the whole screen as well as other windows (also if the window's right margin 
isn't the screen margin). A sample program is attached (try to fill the last 
line completely with some character).

--
components: Library (Lib)
files: edit.py
messages: 272027
nosy: Dietmar Schindler
priority: normal
severity: normal
status: open
title: curses.textpad.Textbox(win).edit() won't edit last character
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file44020/edit.py

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

updated version with SilentGhost's concerns addressed.

--
Added file: http://bugs.python.org/file44019/fromisoformat_regexinclasses2.patch

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Larry Hastings

Larry Hastings added the comment:

3.4 is also in security-fixes-only mode, which also means it's in 
no-binary-installers mode.

Good luck making the case that "this bugfix, which took us more than 2.5 years 
to finalize, is so critical that the release team must immediately issue binary 
installers".

--

___
Python tracker 

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



[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2016-08-05 Thread Vinay Sajip

Vinay Sajip added the comment:

According to PEP 398, we should patch the source for security updates for 3.3 
until September 2017, though no new binary release needs to be made. I'm not 
sure if expedited binary releases are needed for 3.4 and 3.5. I will look at 
applying the patch in 2.7 and 3.3 through to 3.6.

--
versions: +Python 3.3

___
Python tracker 

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



[issue27691] X509 cert with GEN_RID subject alt name causes SytemError

2016-08-05 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
Added file: 
http://bugs.python.org/file44018/0001-Fix-handling-of-GEN_RID-in-X.509-subjectAltName-fiel.patch

___
Python tracker 

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



[issue27692] Clean serveral unnecessary NULL checks in exceptions.c

2016-08-05 Thread Xiang Zhang

New submission from Xiang Zhang:

While studying exceptions.c, find several unnecessary NULL checks that can be 
removed.

--
components: Interpreter Core
files: small_cleanup_exceptions.patch
keywords: patch
messages: 272023
nosy: martin.panter, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Clean serveral unnecessary NULL checks in exceptions.c
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file44017/small_cleanup_exceptions.patch

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-08-05 Thread Martin Panter

Martin Panter added the comment:

Earl: Can you give any more details on your original hang or race condition? 
Was it related to setting PORT, or shutting down the server, or something else? 
It is not clear from your patch. I have tried adding artificial sleep() calls 
at various points but that did not uncover anything.

I’m sorry, but in my enthusiasm for rewriting the test I didn’t properly 
understand your original problem :)

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Changes by Mathieu Dupuy :


Added file: 
http://bugs.python.org/file44016/fromisoformat_strptimesingledispatch.patch

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Changes by Mathieu Dupuy :


Added file: http://bugs.python.org/file44015/fromisoformat_regexinclasses.patch

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I'm back on the issue. I'm currently stuck on the design. We need to store the 
regexes somewhere, and that's what causes problem : I can't really find a good 
place to store them. We basically have two possible designs :
* single dispatch kind, class-type dictionary lookup for regexes, stored in 
_strpime.py. It's minimally invasive, allow a very simple C implementation, and 
allows us to avoid to add a 're' import in datetime.py. Problem : it breaks 
when the given class is not of type date, time or datetime. And it currently 
breaks the tests because tests are doing this, testing using subclasses. We 
could rely on "isinstance" but do we want this ?

* regex stored as classes attributes. More robust, more invasive, 're' import 
in datetime.py, allows subclassing, passes test. C implementation not done yet. 
Since it requires a better understanding of the C API, I will do it only we are 
sure that's the way to go.

I post the two versions of the implementation as patches here. These adress all 
the concerns expressed before (Martin). If we can't decide, I will post a mail 
on the mailing list Martin suggested, python-ideas. By the way, are you sure 
it's the right one to ask ? Wouldn't be python-dev more appropriated ?

--

___
Python tracker 

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



[issue27691] X509 cert with GEN_RID subject alt name causes SytemError

2016-08-05 Thread Christian Heimes

New submission from Christian Heimes:

A X509 cert with a registered id general name in subject alternative name 
causes a SystemError: error return without exception set. This prevents host 
name validation of certs with a registered id.

>>> import _ssl
>>> _ssl._test_decode_cert('rid.pem')
Traceback (most recent call last):
  File "", line 1, in 
SystemError: error return without exception set

The problem is caused by a bug in OpenSSL's print function for general names. 
Python's _get_peer_alt_names() uses GENERAL_NAME_print() to print GEN_IPADD, 
GEN_RID and others into a buffer. The buffer is then split at ':' into two 
strings. This works for all fields except for GEN_RID because OpenSSL doesn't 
put a ':' after 'Registered ID', 
https://github.com/openssl/openssl/blob/master/crypto/x509v3/v3_alt.c#L183 . 
_get_peer_alt_names() fails and returns NULL without setting a proper exception.

It looks like we haven't had tests for GEN_RID as well as some other field 
types.

Related Red Hat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1364268

--
components: Extension Modules
files: rid.pem
messages: 272020
nosy: alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
stage: test needed
status: open
title: X509 cert with GEN_RID subject alt name causes SytemError
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44014/rid.pem

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-08-05 Thread Martin Panter

Martin Panter added the comment:

I backported the patch to 2.7. Now I get no warnings about syntax highlighting 
from 2.7 (there were only a few reported before).

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

___
Python tracker 

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



[issue27688] Expand documentation about Any in the typing module

2016-08-05 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue27389] When a TypeError is raised due to invalid arguments to a method, it should use __qualname__ to identify the class the method is in

2016-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
superseder:  -> Names in function call exception should have class names, if 
they're methods

___
Python tracker 

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



[issue27690] os.path.normcase broken.

2016-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-05 Thread Nick Coghlan

Nick Coghlan added the comment:

As Stephen notes, the underlying problem appears to be a behavioural difference 
between two theoretically equivalent ways of defining a network:

>>> list(ipaddress.IPv4Network(('127.0.0.4', 31)).hosts())
[]
>>> list(ipaddress.IPv4Network(('127.0.0.4/31')).hosts())
[IPv4Address('127.0.0.4'), IPv4Address('127.0.0.5')]

Now, the first case is the documented behaviour: hosts() is *supposed to* 
exclude the network and broadcast address, and those are the only addresses in 
a /31.

If you want to iterate over all the *addresses* in a network (including the 
network and broadcast addresses) then you need to iterate over the network 
object directly:

>>> list(ipaddress.IPv4Network(('127.0.0.4', 31)))
[IPv4Address('127.0.0.4'), IPv4Address('127.0.0.5')]
>>> list(ipaddress.IPv4Network(('127.0.0.4/31')))
[IPv4Address('127.0.0.4'), IPv4Address('127.0.0.5')]

However, as Emanuel found when writing his patch, there's currently an 
undocumented special case for /31 networks: the definition of "hosts" is 
*implicitly changed* for such instances to include the nominal network and 
broadcast address (by setting "self.hosts = self.__iter__"), presumably on the 
assumption that such networks represent a point-to-point link between two 
hosts, so the concepts of "network address" and "broadcast address" don't 
really apply.

That special case seems pragmatically useful, so I think the right fix would be 
to:

- document the special case that for /31 networks, hosts() includes the network 
and broadcast addresses (on the assumption the "network" is actually a 
point-to-point link between two hosts)
- refactor IPv4Network.__init__ to first map the supplied input to a 
"candidate_address" and "candidate_netmask" and then use *common* validation 
logic to determine the actual network address and netmask (this will also 
address the "# fixme" comment for the int/bytes case)
- check whether or not IPv6Network is affected by the same behavioural 
discrepancy

--

___
Python tracker 

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



[issue27690] os.path.normcase broken.

2016-08-05 Thread Lilin Lao

Lilin Lao added the comment:

I Fixed it by uninstall and then reinstall python, thanks

--

___
Python tracker 

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