[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-28 Thread STINNER Victor

STINNER Victor added the comment:

The PEP 399 requires that the Python implementation behaves like the C
accelerator, no? I didn't check the specific case of this issue.

--

___
Python tracker 

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



[issue27149] Implement socket.sendmsg() for Windows

2016-05-28 Thread Марк Коренберг

New submission from Марк Коренберг:

Please add, but do not emulate, since atomicity of that IO must be kept, as 
said in man-page.

--
components: Library (Lib), Windows
messages: 266586
nosy: mmarkk, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Implement socket.sendmsg() for Windows
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: test needed -> 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



[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c95864a37ee2 by Terry Jan Reedy in branch 'default':
Issue #27117: Make colorizer htest and turtledemo work with dark theme.
https://hg.python.org/cpython/rev/c95864a37ee2

New changeset f383eaf207ca by Terry Jan Reedy in branch '3.5':
Issue #27117: Make ColorDelegator htest and turtledemo work with dark theme.
https://hg.python.org/cpython/rev/f383eaf207ca

--
nosy: +python-dev

___
Python tracker 

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



[issue27117] turtledemo does not work with IDLE's new dark theme.

2016-05-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was wrong about turtledemo's text pane.  Turtledemo only uses textview for 
help.  The text frame contains a plain Text widget.  I moved the text 
color-config code from editor to a function in colorizer, where it is also 
needed for the colorizer test.

--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue27148] Make VENV_DIR relative to Script directory

2016-05-28 Thread Jon Nabozny

New submission from Jon Nabozny:

I would like to see some enhancement where the activate.bat and activate 
scripts allow the script to determine where the python executable resides.

When the executable cannot be found (because the path doesn't exist for some 
reason), the system will ultimately find the installed version of python. This 
can cause side effects that may be non-obvious to users.

Example:
User creates a virtual environment:
python -m venv C:\Location\To\Project venv

 User manually changes location of project:
xcopy /E C:\Location\To\Project C:\New\Project\Location

 User runs activate.bat:
(venv) C:\New\Project\Location

 At this point, the user will get the modified prompt, but will 
 actually be using his/her globally installed python. Therefore,
 running anything like pip will taint their install. Further, if
 they had set up the environment previously, it can cause errors
 because modules won't be found (because it's pointing at the
 wrong Lib\site-packages folder).

Code:
activate.bat
;Replace set "VIRTUAL_ENV=__VENV_DIR__"
set "VIRTUAL_ENV=%~dp0..\"

activate
FILE=$(readlink -f "$0")
FILE_DIR=$(dirname "$FILE")
# Replace VIRTUAL_ENV="__VENV_DIR__"
VIRTUAL_ENV="$FILE_DIR/../"

Somewhat related, I've also found that's it's incredibly convenient to also 
include activate and deactivate files at the root of the venv:

 python -m venv C:\project venv

 # Now, C:\project looks like this:
 .\venv
 .\activate.bat
 .\deactivate.bat

 # activate and deactivate are very simple:
 ;activate.bat
 @ECHO OFF

 pushd env\Scripts
 call activate
 popd

 ;deactivate.bat
 @ECHO OFF

 pushd env\Scripts
 call deactivate
 popd

--
components: Demos and Tools
messages: 266583
nosy: widmo
priority: normal
severity: normal
status: open
title: Make VENV_DIR relative to Script directory
type: enhancement
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

2016-05-28 Thread Martin Panter

Changes by Martin Panter :


--
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



[issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef89ecb6debc by Martin Panter in branch '3.5':
Issue #27124: Fix documentation of exception raised by a2b_hex()
https://hg.python.org/cpython/rev/ef89ecb6debc

New changeset 85e6da63d73f by Martin Panter in branch 'default':
Issue #27124: Merge binascii doc from 3.5
https://hg.python.org/cpython/rev/85e6da63d73f

--
nosy: +python-dev

___
Python tracker 

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



[issue27105] cgi.__all__ is incomplete

2016-05-28 Thread Martin Panter

Martin Panter added the comment:

For this particular case, there is only one existing test class called 
CgiTests, without any special setup or handling. It seems too arbitrary to have 
a second class called MiscTestCase, so I would prefer the new test be added to 
CgiTests.

--

___
Python tracker 

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



[issue27109] plistlib.__all__ list is incomplete

2016-05-28 Thread Martin Panter

Martin Panter added the comment:

I think this patch is okay

--
nosy: +martin.panter

___
Python tracker 

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



[issue27112] tokenize.__all__ list is incomplete

2016-05-28 Thread Martin Panter

Martin Panter added the comment:

Changing the names to tokenize. does solve the problem of the tokenize 
module versus the tokenize() fuction, so I can accept this way since you prefer 
it.

So I think that just leaves what to do with the actual test case. I don’t think 
it matters too much, but I would lean toward ensuring the test fails if someone 
adds a new implementation detail without an underscore prefix. It is also good 
to be explicit that the ISTERMINAL() etc functions are special cases.

On the other hand, neither the original patch nor Jacek’s proposal for 
“expected = token.__all__ + ...” would pick up the fact that the tok_name 
dictionary is another special case copied from the “token” module. (See also 
Issue 25324.)

--

___
Python tracker 

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



[issue9363] data_files are not installed relative to sys.prefix

2016-05-28 Thread Berker Peksag

Berker Peksag added the comment:

Issue 25592 is a duplicate of this and but it has a patch that almost ready to 
commit so I'm closing this one.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> distutils docs: data_files always uses sys.prefix

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2016-05-28 Thread Berker Peksag

Changes by Berker Peksag :


--
components: +Distutils
nosy: +berker.peksag, dstufft, eric.araujo
stage:  -> patch review
type:  -> behavior
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-05-28 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

I've read through this, but haven't applied the patch & run tests (that's what 
buildbots are for).

No objections.

--

___
Python tracker 

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



[issue27122] Hang with contextlib.ExitStack and subprocess.Popen (regression)

2016-05-28 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue26372] Popen.communicate not ignoring BrokenPipeError

2016-05-28 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2016-05-28 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2016-05-28 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-05-28 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3ff84a3eeb6b by Benjamin Peterson in branch '2.7':
Backed out changeset e7062dd9085e (#25731)
https://hg.python.org/cpython/rev/3ff84a3eeb6b

--

___
Python tracker 

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



[issue27146] posixmodule.c needs stdio.h

2016-05-28 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-05-28 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I'll have to think about how to fix this while maintaining compatiblity with 
obscure cases like above.

--

___
Python tracker 

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



[issue27146] posixmodule.c needs stdio.h

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c8e113bf56ae by Gregory P. Smith in branch '3.5':
Fix issue27146 - add stdio.h include to posixmodule.c for ctermid().
https://hg.python.org/cpython/rev/c8e113bf56ae

New changeset 74fcfc29187e by Gregory P. Smith in branch 'default':
Fix issue27146 - add stdio.h include to posixmodule.c for ctermid().
https://hg.python.org/cpython/rev/74fcfc29187e

--
nosy: +python-dev

___
Python tracker 

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



[issue9327] doctest DocFileCase setUp/tearDown asymmetry

2016-05-28 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> doctest.DocTestCase fails when run repeatedly

___
Python tracker 

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



[issue24225] Idlelib: changing file names

2016-05-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I have a new idea for public interfaces: keep most of idlelib private and add a 
new 'interface' module containing public interfaces.  It could be backported to 
3.5 and even 2.7.

This was prompted by working with turtledemo.  It currently imports textview, 
percolator, and colorizer to create a colorized code viewer.  At the moment, 
changing the names in the three imports worked, but that could change if any of 
the files are refactored.  (And what about people who have trouble hooking the 
three components together correctly?)

Instead, lets create, say, class ColorCodeview (or maybe a function) in 
interface and have turtledemo do one import, say 'from idlelib.interface import 
ColorCodeview'.  The internal code code would be slilghtly different in each of 
2.7, 3.5, and 3.6 (and maybe different again sometime after the initial 
commit).  But the import and basic use should be the same.

The only thing I might put in the main idlelib doc would be something like 'See 
the interface module for currently supported external uses of idlelib 
components."

--

___
Python tracker 

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



[issue24225] Idlelib: changing file names

2016-05-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Revision should definitely be tested on Mac by running IDLE from a console to 
check for any Mac-specific warnings and check that the menu looks 'right', 
which is to say, same as with 3.5.

Still to do: news entries, What's New section, README.txt revision with new 
names.

--
stage: test needed -> needs patch

___
Python tracker 

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



[issue24225] Idlelib: changing file names

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6ecd4db71b88 by Terry Jan Reedy in branch 'default':
Issue #24225: Rename many idlelib/*.py and idlelib/idle_test/test_*.py files.
https://hg.python.org/cpython/rev/6ecd4db71b88

New changeset 0c3fdb161901 by Terry Jan Reedy in branch 'default':
Issue #24225: Within idlelib files, update idlelib module names.
https://hg.python.org/cpython/rev/0c3fdb161901

--
nosy: +python-dev

___
Python tracker 

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



[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Serhiy, it seems as though _functools is always required for functools to work 
- heck, tests start to fail all over the place if it isn't available, because 
functools.reduce doesn't exist.

Subclassing _functools.partial is already tested for, so I wouldn't qualify it 
as an implementation detail myself. Moreover, I feel that we should try to 
(somewhat) keep both implementations identical - or close enough.

It seems that _pickle checks for _functools.partial, and that trying to pickle 
the pure Python version triggers the error in msg266530.

This probably doesn't matter for most (if not all) of cases where CPython is 
concerned. But I care about the ability for alternate implementations to work 
the same way.

Compromise: rename the current partial function to partial_func and keep it 
around ;-)

--

___
Python tracker 

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



[issue26083] ValueError: insecure string pickle in subprocess.Popen on Python 2

2016-05-28 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
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



[issue26083] ValueError: insecure string pickle in subprocess.Popen on Python 2

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 184dfef08a93 by Gregory P. Smith in branch '2.7':
issue26083: Avoid duplicate error message string from a subprocess exec 
failure.Avoid a duplicate error message string from a subprocess exec failure.
https://hg.python.org/cpython/rev/184dfef08a93

--

___
Python tracker 

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



[issue3982] support .format for bytes

2016-05-28 Thread Gregory P. Smith

Gregory P. Smith added the comment:

This came up in the language summit today when discussing twisted.  .format() 
is still not supported on bytes though % is in 3.5.

realistically it sounded like twisted needs to support python 3.4 for many 
years so they can't rely on bytes having a .format() method that also works on 
2.7 anyways... but assuming .format() is only useful for text may still have 
been an oversight.  (i'll have to go re-read pep 460 and 461 and discussion 
before commenting further)

--

___
Python tracker 

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



[issue27132] New assert method that checks an error message for a list of strings

2016-05-28 Thread R. David Murray

R. David Murray added the comment:

The complexity of those solutions argues in favor of adding a method, I'd say.

Personally I'd write multiple asserts rather than regex permutations.

--

___
Python tracker 

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



[issue27147] importlib docs do not mention PEP 420

2016-05-28 Thread Eric Snow

Changes by Eric Snow :


--
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



[issue27147] importlib docs do not mention PEP 420

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6f50c04e4a1e by Eric Snow in branch '3.5':
Issue #27147: Mention PEP 420 in the importlib docs.
https://hg.python.org/cpython/rev/6f50c04e4a1e

New changeset 0177af33ce76 by Eric Snow in branch 'default':
Issue #27147: Mention PEP 420 in the importlib docs.
https://hg.python.org/cpython/rev/0177af33ce76

--
nosy: +python-dev

___
Python tracker 

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



[issue27147] importlib docs do not mention PEP 420

2016-05-28 Thread Eric Snow

New submission from Eric Snow:

PEP 420 should be mentioned in the introduction section of the importlib docs.  
I'll push a change to fix this in a minute.

--
assignee: eric.snow
components: Documentation
messages: 266565
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: importlib docs do not mention PEP 420
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue27132] New assert method that checks an error message for a list of strings

2016-05-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The simple way is just write all possible variants 
('ENABLE.*NOAUTH|NOAUTH.*ENABLE').

The general way is to use itertools.permutations():

pattern = '|'.join(map('.*'.join, permutations(map(re.escape, strings

See also similar problem in issue19681. The first my patch used permutations(). 
But there was committed the patch with manually written variants.

--

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think this assert is needed. Nothing bad happens if the asserted 
condition is false. On other side, additional assert can slow down debug build 
(that is already slower than release build).

--

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-28 Thread Oren Milman

Oren Milman added the comment:

And after quadruple checking myself, I found a foolish mistake - in that flow, 
x_add received at least one multiple-digit int (not necessarily two :().

I fixed that mistake in the comment. The updated diff file is attached.

--
Added file: http://bugs.python.org/file43045/issue27073.diff

___
Python tracker 

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



[issue27146] posixmodule.c needs stdio.h

2016-05-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> needs patch

___
Python tracker 

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



[issue27146] posixmodule.c needs stdio.h

2016-05-28 Thread Phil Thompson

New submission from Phil Thompson:

posixmodule.c needs to #include  to get the declaration of ctermid(). 
On most platforms this happens as a side effect of including other .h files but 
does not on Android.

--
components: Library (Lib)
messages: 266561
nosy: philthompson10
priority: normal
severity: normal
status: open
title: posixmodule.c needs stdio.h
type: compile error
versions: Python 3.6

___
Python tracker 

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



[issue27073] redundant checks in long_add and long_sub

2016-05-28 Thread Oren Milman

Oren Milman added the comment:

After giving it some more thought (while working on another, somewhat related 
issue - http://bugs.python.org/issue27145), I realized that that assert in 
long_add could further verify that the int x_add returned is a multiple-digit 
int (as x_add had received two multiple-digit ints to begin with).

The important thing about this updated assert is that it verifies that x_add 
didn't return a reference to an element in small_ints (as small ints must be 
single-digit ints), so negating it in-place is safe.

I have updated the assert and added an appropriate comment. The updated diff 
file is attached.

--
Added file: http://bugs.python.org/file43044/issue27073.diff

___
Python tracker 

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



[issue27132] New assert method that checks an error message for a list of strings

2016-05-28 Thread R. David Murray

R. David Murray added the comment:

Serhiy, how do you spell "match if and only if all of the following substrings 
exist in the target string, in any position" in a regex?  If we aren't going to 
add the method, we should add an example of how to do this to the 
assertMsgRegex docs.

--

___
Python tracker 

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



[issue27143] python 3.5 conflict with Mailman, ebtables and firewalld

2016-05-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

This is definitely not the right place to discuss this.  Please use the Mailman 
3 users mailing list or the Mailman Developers mailing list.

https://lists.mailman3.org/archives/list/mailman-us...@mailman3.org/
https://mail.python.org/mailman/listinfo/mailman-developers

--
status: open -> closed

___
Python tracker 

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



[issue27145] long_add and long_sub might return a new int where &small_ints[x] could be returned

2016-05-28 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file43043/patchedCPythonTestOutput.txt

___
Python tracker 

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



[issue27145] long_add and long_sub might return a new int where &small_ints[x] could be returned

2016-05-28 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file43042/CPythonTestOutput.txt

___
Python tracker 

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



[issue27145] long_add and long_sub might return a new int where &small_ints[x] could be returned

2016-05-28 Thread Oren Milman

New submission from Oren Milman:

 the current state 
>>> if is32BitCPython:
...   PyLong_SHIFT = 15
... elif is64BitCPython:
...   PyLong_SHIFT = 30
...
>>> # case A #
>>> a = 2 ** PyLong_SHIFT - 1
>>> b = 2 ** PyLong_SHIFT - 2
>>> a - b
1
>>> a - b is 1
True
>>> a + (-b) is 1
True
>>>
>>> # case B #
>>> a = 2 ** PyLong_SHIFT
>>> b = 2 ** PyLong_SHIFT - 1
>>> a - b
1
>>> a - b is 1
False
>>> a + (-b) is 1
False
>>>
>>> # case C #
>>> a = 2 ** PyLong_SHIFT + 1
>>> b = 2 ** PyLong_SHIFT
>>> a - b
1
>>> a - b is 1
False
>>> a + (-b) is 1
False
>>>

This behavior is caused by the implementation of long_add and long_sub:
Both long_add and long_sub check whether both a and b are single-digit 
ints, and then do (respectively):
return PyLong_FromLong(MEDIUM_VALUE(a) + MEDIUM_VALUE(b));
or
return PyLong_FromLong(MEDIUM_VALUE(a) - MEDIUM_VALUE(b));
Otherwise, long_add and long_sub call x_add or x_sub to do a calculation on 
the absolute values of a and b.
At last, long_add and long_sub negate the result of the calculation, if 
needed, and return the final result. 

Where both a and b are single-digit ints (e.g. case A), the result of the 
calculation is passed to PyLong_FromLong, which uses CHECK_SMALL_INT, and so a 
reference to an element of small_ints is returned where appropriate.
Where a and/or b are not single-digit ints (e.g. cases B and C), x_add or x_sub 
is called. Both x_add and x_sub don't check whether the result is a small int 
(except for a case in x_sub where the result is zero), and so long_add and 
long_sub might return a new int, even where an element of small_ints could be 
reused.

Due to the way CPython uses them, the issue is relevant to x_sub and not to 
x_add, as the calculation the former performs might result in a small int, 
while that of the latter would always result in a multiple-digit int.
(Except for being called by long_add and long_sub, x_add might be called by 
k_mul, but in that case also the calculation would certainly result in a 
multiple-digit int.)


 Note 
I am not sure whether this is actually an issue that we want to fix.
It seems to me that my proposed changes introduce a slight performance gain (in 
terms of memory, and probably also speed), and a more consistent behavior of 
CPython.
The performance gain would probably be much more relevant if and when greater 
default values are chosen for NSMALLNEGINTS and NSMALLPOSINTS.

Anyway, I guess documenting the issue here, along with a proposal for a fix, is 
better than nothing.
(As far as I know, since the unification of int and long in revision 40626, 
this issue never came up.)


 the proposed changes 
All of the proposed changes are in Objects/longobject.c:
1. in x_sub:
To make sure x_sub returns a small int where appropriate, I simply wrapped 
the return value of x_sub with the function maybe_small_long.

2. in long_sub:
The previous patch alone would create a nasty bug.
In case both a and b are negative, long_sub calls x_sub, and then negates 
the result in-place by doing 'Py_SIZE(z) = -(Py_SIZE(z));'.
If x_sub returned a reference to a statically allocated small int (which is 
not zero), long_sub would actually change that statically allocated small int.

To prevent that, I replaced that in-place negating with a call to 
_PyLong_Negate.

3. in _PyLong_Negate:
The previous patches, along with http://bugs.python.org/issue27073 (another 
issue I have opened recently), would cause long_sub to call _PyLong_Negate for 
a zero int, in case a and b are the same multiple-digit negative int. 
Moreover, in the default CPython branch, in case long_mul receives a 
multiple-digit negative int and zero, long_mul would call _PyLong_Negate for a 
zero int.

To prevent doing 'PyLong_FromLong(-MEDIUM_VALUE(x))' where x is a zero int, 
I have added a check before that (along with a little addition to the function 
comment), so that _PyLong_Negate would do nothing if x is a zero int. 
It should be noted that MEDIUM_VALUE also checks whether x is a zero int 
(for its own reasons), so thanks to the wisdom of nowadays compilers, the check 
I propose to add shouldn't introduce a performance penalty.
(Actually, when comparing the assembly of _PyLong_Negate (for win32) of the 
default CPython branch and the patched one, the latter looks simpler.)

With regard to similar changes made in the past, _PyLong_Negate wasn't 
changed since it replaced the macro NEGATE in revision 84698.

4. in x_sub:
The previous patches made it safe for x_sub to return a reference to a 
statically allocated small int, and thus made it possible to implement the 
following optimization.
In case a and b have the same number of digits, x_sub finds the most 
significant digit where a and b differ. Then, if there is no such digit, it 
means a and b are equal, and so x_sub does 'return (PyLo

[issue27129] Wordcode, part 2

2016-05-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file43040/word-jump-offsets.patch

___
Python tracker 

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



[issue27129] Wordcode, part 2

2016-05-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file43039/word-jump-offsets.patch

___
Python tracker 

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



[issue27101] Compilation of python (modules) for foreign target platform problem.

2016-05-28 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +doko

___
Python tracker 

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



[issue27129] Wordcode, part 2

2016-05-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that implements only the first change -- makes jump offsets be 
in 16-bit units, not bytes. This is minimal change, it doesn't include 
refactoring.

--
Added file: http://bugs.python.org/file43039/word-jump-offsets.patch

___
Python tracker 

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



[issue27139] Increased test coverage for statistics.median_grouped

2016-05-28 Thread Julio C Cardoza

New submission from Julio C Cardoza:

I had signed the contributor agreement.!

--

___
Python tracker 

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



[issue27136] sock_connect fails for bluetooth (and probably others)

2016-05-28 Thread Guido van Rossum

Guido van Rossum added the comment:

> Why validate at all?

Because (at least for the IP 4/6 protocols) when you give a host name
Python's socket code will do a synchronous DNS lookup which would hold
up the entire event loop until it's done. This would be a major
problem in some cases, so we want to disallow it completely.

--

___
Python tracker 

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



[issue27121] imghdr does not support jpg files with Lavc bytes

2016-05-28 Thread SilentGhost

Changes by SilentGhost :


--
components: +Library (Lib)
nosy: +r.david.murray
stage:  -> test needed
type:  -> behavior
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue27139] Increased test coverage for statistics.median_grouped

2016-05-28 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +steven.daprano
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue27144] concurrent.futures.as_completed() memory inefficiency

2016-05-28 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> patch review
versions:  -Python 3.2, 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



[issue27136] sock_connect fails for bluetooth (and probably others)

2016-05-28 Thread pyptr2

pyptr2 added the comment:

Thanks for looking into this. Some comments:

1.
yuri, I haven't tried the github repo. Is that where the development happens? 
The description suggests it is outdated since the adoption, but there are some 
commits that aren't in hg...?
Anyhow, the relevant code looks identical to me.

2.
guido, yes validation would be domain specific.
But, just to understand: why validate at all?
If I give create_connection() or sock_connect() an unresolved address, then I 
would expect some "yield from resolve(domain, name)" to happen, which would be 
getaddrinfo() for IP-domain. If that would hang the event loop on some 
platform, do it in an executor. This is exactly what create_server() already 
does, by the way.

3.
AF_UNPSEC seems to mean (AF_INET or AF_INET6) to a lot of people these days, 
possibly because getaddrinfo() accepts these three AFs. I am not 100% sure, but 
that is why I think it is reasonable that _ipaddr_info() handles AF_UNSPEC in 
the way it does.

4.
For my use case, anything that stops check_resolve() from raising when given a 
resolved non-IP address would be enough for now.

--

___
Python tracker 

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



[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-05-28 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue27144] concurrent.futures.as_completed() memory inefficiency

2016-05-28 Thread Grzegorz Grzywacz

Changes by Grzegorz Grzywacz :


--
keywords: +patch
Added file: http://bugs.python.org/file43038/issue27144.patch

___
Python tracker 

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



[issue27144] concurrent.futures.as_completed() memory inefficiency

2016-05-28 Thread Grzegorz Grzywacz

New submission from Grzegorz Grzywacz:

as_complite generator keeps reference of all passed futures until 
StopIteration. It may lead to serious memory inefficiency.

Solution is to remove reference from lists and yield future ad-hoc.

I have submitted patch and reproduce sample.

I can create backport for older versions if needed.

--
components: Library (Lib)
files: reproduce.py
messages: 266552
nosy: bquinlan, grzgrzgrz3
priority: normal
severity: normal
status: open
title: concurrent.futures.as_completed() memory inefficiency
type: resource usage
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43037/reproduce.py

___
Python tracker 

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



[issue27143] python 3.5 conflict with Mailman, ebtables and firewalld

2016-05-28 Thread Rubén Rivero Capriles

Rubén Rivero Capriles added the comment:

Hi. I decided to reinstall CentOs 7 and already installed Python 3.4 at 
http://www.codeghar.com/blog/install-latest-python-on-centos-7.html

I am downloading the tarball for mailman 3.0.3. I will greatly appreciate if 
you quickly let me know how to install it. I do not wish to use mailman bundler.

--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-05-28 Thread Bar Harel

Bar Harel added the comment:

Added UserDict and UserList tests.
Keep in mind I am currently skipping UserDict's tests until we will implement 
the correct mechanism.
We do not need the same tests or functionality for UserString as UserString is 
immutable.

--
Added file: http://bugs.python.org/file43036/UserObj_tests.patch

___
Python tracker 

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



[issue27138] FileFinder.find_spec() docstring needs to be corrected.

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8a49da84fc1d by Serhiy Storchaka in branch '3.5':
Issue #27138: Regenerate Python/importlib_external.h.
https://hg.python.org/cpython/rev/8a49da84fc1d

New changeset fb965ee44d5e by Serhiy Storchaka in branch 'default':
Issue #27138: Regenerate Python/importlib_external.h.
https://hg.python.org/cpython/rev/fb965ee44d5e

--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-05-28 Thread Bar Harel

Bar Harel added the comment:

I thought about UserDict, but adding this simple patch to UserDict will result 
in infinite recursion (due to how copy is implemented in there). We will have 
to change the implementation of UserDict's copy method.

--

___
Python tracker 

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



[issue25926] Clarify that the itertools pure python equivalents are only approximate.

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 35fa2ec1f237 by Serhiy Storchaka in branch 'default':
Merge heads (issue #25926).
https://hg.python.org/cpython/rev/35fa2ec1f237

--

___
Python tracker 

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



[issue27141] Fix collections.UserList shallow copy

2016-05-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about UserDict?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If the Python implementation is just a rough example, and the functools module 
always require the _functools module, exact behavior of the Python 
implementation is not very important, as well as its performance. If the 
functools module can be used without C implementation, Python implementation is 
just not completely compatible.

--

___
Python tracker 

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



[issue25926] Clarify that the itertools pure python equivalents are only approximate.

2016-05-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Nofar, thanks for the patch.

--
components: +Documentation -Interpreter Core
resolution:  -> fixed
status: open -> closed
title: problems with "times" keyword in itertools.repeat -> Clarify that the 
itertools pure python equivalents are only approximate.

___
Python tracker 

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



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f66c30f66235 by Raymond Hettinger in branch '2.7':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/f66c30f66235

--

___
Python tracker 

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



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 613314c3f9ed by Raymond Hettinger in branch '3.5':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/613314c3f9ed

New changeset e67e970de54a by Raymond Hettinger in branch 'default':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/e67e970de54a

--
nosy: +python-dev

___
Python tracker 

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



[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This kind of feature creep has a cost in tern complexity, maintenance, risk of 
bugs, loss of a clean example for others learn from, and in slower code.

--
assignee: rhettinger -> ncoghlan

___
Python tracker 

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



[issue26083] ValueError: insecure string pickle in subprocess.Popen on Python 2

2016-05-28 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Great point!

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

___
Python tracker 

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