[issue24291] Many servers (wsgiref, http.server, etc) can truncate large output blobs

2016-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a57703119f40 by Martin Panter in branch '3.5':
Issue #24291: Avoid WSGIRequestHandler doing partial writes
https://hg.python.org/cpython/rev/a57703119f40

New changeset d8f021944e0b by Martin Panter in branch 'default':
Issue #24291: Merge wsgi partial write fix from 3.5
https://hg.python.org/cpython/rev/d8f021944e0b

--
nosy: +python-dev

___
Python tracker 

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



[issue27219] turtle.fillcolor doesn't accept a tuple of floats

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

_color_triple_to_hexstring() is implementation detail. It would be better to 
test it indirectly using public method (like fillcolor()). Added other comments 
on Rietveld.

--
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

I still not think this is a good idea.

--

___
Python tracker 

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



[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Updated patch attached.

I don't feel strongly about whether this should be in Python, but it seems 
potentially useful at least as a tool to learn more about how re is 
implemented. If I have time I may write a tool using __pattern_code__ and the 
sre_constants module to provide a disassembly for regexes.

--
Added file: http://bugs.python.org/file43232/issue26336-cr2.patch

___
Python tracker 

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



[issue21916] Create unit tests for turtle textonly

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your patches Jelle.

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



[issue21916] Create unit tests for turtle textonly

2016-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5c1befa401ca by Serhiy Storchaka in branch '3.5':
Issue #21916: Added more tests for the turtle module.
https://hg.python.org/cpython/rev/5c1befa401ca

New changeset 41fa38ea46ba by Serhiy Storchaka in branch '2.7':
Issue #21916: Added more tests for the turtle module.
https://hg.python.org/cpython/rev/41fa38ea46ba

New changeset 356f411e8c5c by Serhiy Storchaka in branch 'default':
Issue #21916: Added more tests for the turtle module.
https://hg.python.org/cpython/rev/356f411e8c5c

--

___
Python tracker 

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



[issue27225] Potential refleak in type_new when setting __new__ fails

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  -> commit review
type:  -> resource usage
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue26329] os.path.normpath("//") returns //

2016-06-05 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez added the comment:

I propose to add at least a statement like e.g. "In conformance to IEEE Std 
1003.1™, 2013 Edition; 4.12 Pathname Resolution".

Because I had the same thought of a bug at first view, this because I did not 
find any hint in e.g. docs for 2.7.11. 

The reason to handle this thoroughly in my projects is the application of a 
path-matching library for generic unit tests, e.g. for bash scripts which 
require intensive PATH resolution. This has to be applied by the users of the 
library.

See "https://pypi.python.org/pypi/pyfilesysobjects";, and  
"https://pypi.python.org/pypi/epyunit"; which requires intensive pattern 
matching of application provided pathnames, e.g. when it comes to automatic 
split of actual used PYTHONPATH items for a specific function/method, module, 
or package.

E.g. the user provides an 'intentional casual' pathname for drop-in unit 
tests(see epyunit),
  "os.sep + context.sys.path[x] + os.sep + 'rel-module-path'",
due to mixed relative and absolute paths resulting in leading 
  "os.sep + os.sep".  
The pattern match than fails, but it is not immediately clear for which reason.

--
nosy: +acue

___
Python tracker 

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



[issue27225] Potential refleak in type_new when setting __new__ fails

2016-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 33b53734805b by Serhiy Storchaka in branch '3.5':
Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
https://hg.python.org/cpython/rev/33b53734805b

New changeset 31ad7885e2e5 by Serhiy Storchaka in branch 'default':
Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
https://hg.python.org/cpython/rev/31ad7885e2e5

New changeset db24d51c69d3 by Serhiy Storchaka in branch '2.7':
Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
https://hg.python.org/cpython/rev/db24d51c69d3

--
nosy: +python-dev

___
Python tracker 

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



[issue27225] Potential refleak in type_new when setting __new__ fails

2016-06-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

I would suggest using --optimize=1,2 / -O1,2 for this purpose.

Documentation in this part of Lib/distutils/command/build_py.py and 
Lib/distutils/command/install_lib.py should also be updated:

('optimize=', 'O',
 "also compile with optimization: -O1 for \"python -O\", "
 "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),

--
nosy: +Arfrever
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



[issue25548] Show the address in the repr for class objects

2016-06-05 Thread Nofar Schnider

Nofar Schnider added the comment:

Kushal, you've beat me to it. Great work!

--

___
Python tracker 

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



[issue27227] argparse fails to parse [] when using choices and nargs='*'

2016-06-05 Thread Evan

New submission from Evan:

When using nargs='*' with choices, it is impossible to specify 0 args:

from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('foo', choices=['foo'], nargs='*')
args = parser.parse_args([])  # <-- fails, error message below
assert args.foo == []
# usage: args.py [-h] [{foo} [{foo} ...]]
# args.py: error: argument foo: invalid choice: [] (choose from 'foo')

The problem appears to be this block of code trying to validate `value` 
immediately after it sets it to `[]`:

# when nargs='*' on a positional, if there were no command-line
# args, use the default if it is anything other than None
elif (not arg_strings and action.nargs == ZERO_OR_MORE and
  not action.option_strings):
if action.default is not None:
value = action.default
else:
value = arg_strings
self._check_value(action, value)

The fix seems to be as simple as moving the check under `if action.default is 
not None`.

(NOTE: This would be also adequately solved by patches already attached to 
http://bugs.python.org/issue9625, however the minimal solution to this problem 
is simpler.)

--
components: Library (Lib)
messages: 267404
nosy: evan_
priority: normal
severity: normal
status: open
title: argparse fails to parse [] when using choices and nargs='*'
type: behavior
versions: Python 2.7, 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



[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Xiang Zhang

Xiang Zhang added the comment:

It looks good. I don't think that is a matter since usually I will do a search 
before change. But of course extracting them to a subroutine helps.

--

___
Python tracker 

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



[issue24291] Many servers (wsgiref, http.server, etc) can truncate large output blobs

2016-06-05 Thread Martin Panter

Martin Panter added the comment:

Here is an updated patch with the remaining fixes for other servers.

I considered changing the behaviour of shutil.copyfileobj() to handle partial 
writes better. But I decided against it, because: (a) nobody has complained 
yet, and (b) it could potentially break stuff, e.g. if fsrc.read() returned a 
strange kind of object.

--
Added file: http://bugs.python.org/file43233/wfile-partial.v4.patch

___
Python tracker 

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



[issue27228] just for clearing: os.path.normpath("file://a") returns "file:/a"

2016-06-05 Thread Arno-Can Uestuensoez

New submission from Arno-Can Uestuensoez:

I am currently finishing a file system library and use 'os.path.normpath' for 
canonical input into match-operations.

So already found Issue26329 - IEEE-1003.1-Chap 4.2 and written a comment. But I 
guess this issue should be handled seperately.

Now have to deal by myself with the eventual prefix 'file://' for input, and 
guess it should be supported. I did not found a statement on this case, so 
issue this for clarification. The 'os.path.normpath' call simply replaces 
subsequent os.sep, when they are not leading as 1003.1 states. But how should 
the following examples be handled:

  file:a   => /a OR //a ???

  file:/a  => /a  OK
  file:///a=> /a  OK

--
assignee: docs@python
components: Documentation
messages: 267407
nosy: Fred Rolland, Winterflower, acue, docs@python, ebarry, lemburg, 
serhiy.storchaka
priority: normal
severity: normal
status: open
title: just for clearing: os.path.normpath("file://a") returns "file:/a"
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



[issue27228] just for clearing: os.path.normpath("file://a") returns "file:/a"

2016-06-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

"file://a" is a valid relative file path, for a directory called "file:" and a 
file called "a", so normpath should return "file:/a".

--
nosy: +steven.daprano

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2016-06-05 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The ro.kernel.qemu property is set to 1 on an Android emulator and 0 otherwise. 
I think it should be added to the list.  On some threading tests where the 
switch interval is set to one microsecond, it is necessary to set the switch 
interval to a higher value when running on the qemu emulator, see the three 
issues:
issue #26939: android: test_functools hangs on armv7
issue #26940: android: test_importlib hangs on armv7
issue #26941: android: test_threading hangs on armv7

--

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-06-05 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The problem can be fixed by changing the switch interval to a higher value when 
the test is run on an Android emulator. Issue 26855 can provide a way to know 
when this is the case through the value of the ro.kernel.qemu property.

--
dependencies: +android: add platform.android_ver()

___
Python tracker 

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



[issue26329] os.path.normpath("//") returns //

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you provide a patch Arno-Can?

According to the comment in the configure script of GNU coreutils, the only 
POSIX platforms known for coreutils developers that have two distinct roots / 
and // are Cygwin, z/OS and dead Apollo DomainOS. Yet few exotic platforms are 
mentioned in the topic at 
http://comments.gmane.org/gmane.comp.standards.posix.austin.general/11947 .

--

___
Python tracker 

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



[issue27228] just for clearing: os.path.normpath("file://a") returns "file:/a"

2016-06-05 Thread Georg Brandl

Georg Brandl added the comment:

`os.path` does not handle URIs of any type, so this behavior is correct as 
Steven says.

--
nosy: +georg.brandl
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



[issue26855] android: add platform.android_ver()

2016-06-05 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

I guess ro.kernel.qemu is not generic enough to be an item in android_ver(). In 
tests you can simply use _android_getprop()

--

___
Python tracker 

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



[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-06-05 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The patch is simpler since android/api-level.h is now included in pyport.h by 
changeset 09af54099973.

--
Added file: http://bugs.python.org/file43234/posixmodule_3.patch

___
Python tracker 

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



[issue26855] android: add platform.android_ver()

2016-06-05 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Agreed, and it is not part of the versioning scheme either.

--

___
Python tracker 

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



[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d91b951e676f by Martin Panter in branch '3.5':
Issue #27164: Allow decompressing raw Deflate streams with predefined zdict
https://hg.python.org/cpython/rev/d91b951e676f

New changeset 470954641f3b by Martin Panter in branch 'default':
Issue #27164: Merge raw Deflate zdict support from 3.5
https://hg.python.org/cpython/rev/470954641f3b

--
nosy: +python-dev

___
Python tracker 

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



[issue27229] In tree cross-build fails copying Include/graminit.h to itself

2016-06-05 Thread Alex Willmer

New submission from Alex Willmer:

While trying a cross compile of Python 3.6 I encountered the following

alex@martha:~/src/cpython default☿ hg summary
parent: 101753:31ad7885e2e5 
 Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
branch: default
commit: (clean)
update: (current)

alex@martha:~/src/cpython default☿ ./configure --build=x86_64-linux 
--host=arm-linux-gnueabihf --disable-ipv6 ac_cv_file__dev_ptc=no 
ac_cv_file__dev_ptmx=no
checking for hg... found
...
creating Makefile
alex@martha:~/src/cpython default☿ make
...
arm-linux-gnueabihf-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes   
Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o 
Parser/parser.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o 
Parser/grammar.o Parser/pgen.o Objects/obmalloc.o Python/dynamic_annotations.o 
Python/mysnprintf.o Python/pyctype.o Parser/tokenizer_pgen.o 
Parser/printgrammar.o Parser/parsetok_pgen.o Parser/pgenmain.o -lpthread -ldl  
-lpthread -lutil -o Parser/pgen
if test "yes" != "yes"; then \
Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c; \
else \
cp ./Include/graminit.h Include/graminit.h; \
fi
cp: './Include/graminit.h' and 'Include/graminit.h' are the same file
Makefile:806: recipe for target 'Include/graminit.h' failed
make: *** [Include/graminit.h] Error 1


The attached patch allows me to get past this error. I'm unsure if it's an 
appropriate fix or just a workaround.

--
components: Cross-Build
files: graminit-same-file.patch
keywords: patch
messages: 267417
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: In tree cross-build fails copying  Include/graminit.h to itself
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file43235/graminit-same-file.patch

___
Python tracker 

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



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch no longer applied cleanly. Mark, can you please update your patch?

--

___
Python tracker 

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



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This bug was fixed in issue26881 with similar patch. Sorry, I didn't know about 
this issue. Your patches look good. In any case thank you for your effort.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> modulefinder should reuse the dis module

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-06-05 Thread aixtools

aixtools added the comment:

On 04-Jun-16 16:24, Martin Panter wrote:
> Martin Panter added the comment:
>
> Okay here are some more thoughts about your latest patch:
>
> ## Automatic RTLD_MEMBER ##
>
> I was still uneasy about the automatic setting of RTLD_MEMBER. But I looked 
> for how others handle this, and I found Libtool’s LTDL library, and Apache 
> Portable Runtime (APR). Both have a similar (but stricter) automatic addition 
> based on detecting the archive(member) notation:
>
> http://git.savannah.gnu.org/cgit/libtool.git/commit/libltdl/loaders/dlopen.c?id=8fa719e
> https://github.com/apache/apr/commit/c27f8d2
The "stricter" from libtool is an excellent idea - I should done that as 
well, but I really hate string manipulation :)

I hope that the intent at least more clear, and should anyone ever 
complain about it not opening a file named: libFoo.a(libFOO.so) as a 
filename - by design, not accepted as a filename.
> So I guess I can accept this way, if you think it is better than my other 
> ideas:
>
> # Always uses RTLD_MEMBER, never loads a plain file outside an archive
> name = "libcrypto.a(libcrypto.so.1.0.0)"
>
> # Other options, that could be returned by find_library() and would not 
> conflict with a plain file name
> name = ("libcrypto.a", "libcrypto.so.1.0.0")  # (archive, member)
> name = ("libcrypto.a(libcrypto.so.1.0.0)", RTLD_MEMBER)  # (name, extra-flags)
>
> libcrypto = CDLL(name)
Isn't this more of an API change - name is no longer just a string?
>
> ## find_library() modes ##
>
> In your find_library() function, you still have three parts. Can you confirm 
> that each behaviour is intended:
I have to catch a plane - will get back on these. Short - if I have a 
potential bug, then needs to be improved. More later.
>
> A) If I have a file called "crypto" in the current directory, 
> find_library("crypto") returns "crypto". This does not seem right. On Linux, 
> “gcc [. . .] -lcrypto” does not look for a file exactly called “crypto”.
>
> B) You are still stripping bits off the library name if it contains “lib” or 
> a dot (.), so find_library("glib-2.0") is almost equivalent to 
> find_library("b-2"). Isn’t this a bug?
>
> C) find_library("crypto") will return "/usr/lib/crypto" if such a file 
> exists. Just like in A), this does not seem right to me.
>
> ## Other things ##
>
> * You don’t need to prefix most names with underscores, unless they could be 
> confused with a public API. If you follow my earlier suggestion of renaming 
> the new file to _aixutil.py (so it is obvious it is not a public module), 
> then you can freely write “import re, os, sys”, etc.
>
> * No need to add the internal variable names to the function signatures. Just 
> write find_library(name), and if you need to initialize a variable, do that 
> in the body.
>
> * I suggest to go over all the regular expressions, and either change them to 
> plain string searching, or make sure special characters and external 
> variables are escaped as necessary. A comment explaining what the RE is 
> trying to do might help too.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue21130] equivalent functools.partial instances should compare equal

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I support Jelle's comments and have added other comments.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21130] equivalent functools.partial instances should compare equal

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is a question: should partial(func) be equal to func?

--

___
Python tracker 

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



[issue27219] turtle.fillcolor doesn't accept a tuple of floats

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

New patch

--
Added file: http://bugs.python.org/file43236/issue27219-cr.patch

___
Python tracker 

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



[issue27179] subprocess uses wrong encoding on Windows

2016-06-05 Thread Eryk Sun

Eryk Sun added the comment:

> so if we default to UTF-8 it will be even worse than 
> defaulting to ANSI because there aren't many programs 
> on Windows which would use UTF-8

I didn't say subprocess should default to UTF-8. What I wish is for Python to 
default to using UTF-8 for its own pipe and disk file I/O. The old behavior 
could be selected by setting some hypothetical environment variable, such as 
PYTHONIOUSELOCALE.

If subprocess defaults to the console's current codepage (when available), it 
would be nice to have a way to conveniently select the OEM or ANSI codepage. 
The codecs module could define string constants based on GetOEMCP() and 
GetACP(), such as codecs.CP_OEMCP (e.g. 'cp437') and codecs.CP_ACP (e.g. 
'cp1252'). subprocess could import these constants on Windows.

> for example "cmd /u /c chcp.exe" will return result 
> in UTF-16 because such program doesn't exist and cmd's 
> error message will be outputted.

Yes, that's a problem. The cases where we want UTF-16 from the shell should be 
handled specially instead of enabled generally.

> Also if user have set.exe in %System32% then 
> "cmd /u /c set" won't be in UTF-16 because it will 
> execute that program.

This one's not actually a problem because cmd defaults to parsing `set` as its 
internal command. An external `set` requires quotes (e.g. `"set"` to look for 
set, set.com, set.exe, ...).

> you want to get GetConsoleOutputCP before program's
> exit and not at start (say with CREATE_SUSPENDED) 
> as it might have changed it somewhere in middle of
> program's execution.

You'd have to pass both the process ID and the thread ID to have the monitor 
call OpenProcess to get a waitable handle and OpenThread to call ResumeThread. 
It can be done, but it's not something I'd consider doing in practice. It's too 
fragile and not worth the trouble for something that's rarely required.

--

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I like Stéphane's idea about placing the output for nested code object at the 
same level after the output for the main code object.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue17288] cannot jump from a return after setting f_lineno

2016-06-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue27230] Calculation involving mpmath gives wrong result with Python 3.6 and correct result with 2.7

2016-06-05 Thread Andrew Lyasoff

New submission from Andrew Lyasoff:

A particular numerical expression involving mpmath produces the wrong result 
when evaluated with Python 3.5 and produces the correct result when evaluated 
with Python 2.7. The expression involves the commonly used erf (error) function.

--
components: IO
files: special_f_test.ipynb
messages: 267426
nosy: alyasoff
priority: normal
severity: normal
status: open
title: Calculation involving mpmath gives wrong result with Python 3.6 and 
correct result with 2.7
versions: Python 3.5
Added file: http://bugs.python.org/file43237/special_f_test.ipynb

___
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-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

The patch is obsolete because PEP 519 ended up going with a different approach. 
I submitted a new patch for the path_t converter in issue27186. That patch 
probably fits better here, so I'm resubmitting it.

--
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43238/issue27186-os_path_t.patch

___
Python tracker 

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



[issue27231] Support the fspath protocol in the posixpath module

2016-06-05 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

Various functions in posixpath.py need to accept os.PathLike objects. I will 
submit a patch.

--
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 267428
nosy: Jelle Zijlstra, ethan.furman
priority: normal
severity: normal
status: open
title: Support the fspath protocol in the posixpath module
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



[issue27186] add os.fspath()

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

I moved my patch for the path_t converter to issue26027, which already covers 
posixmodule.c. I'm creating issue27231 to track adding os.fspath() support to 
posixpath.py. With that, I think this issue is done.

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



[issue27230] Calculation involving mpmath gives wrong result with Python 3.6 and correct result with 2.7

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

Mpmath is a separate project, not in the Python Standard Library.  I suggest 
you pursue the issue on its issue tracker, providing more information about 
exactly what results you see with what components (e.g. which OS platform and 
version, which versions of mpmath, etc).

http://mpmath.org

--
nosy: +ned.deily
resolution:  -> third party
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



[issue27229] In tree cross-build fails copying Include/graminit.h to itself

2016-06-05 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



[issue27229] In tree cross-build fails copying Include/graminit.h to itself

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

The culprit appears to be the changes introduced for Issue22359 (c36b9ef8ff39 
and friends).

--
nosy: +martin.panter, ned.deily, xdegaye

___
Python tracker 

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



[issue27232] os.fspath() should not use repr() on error

2016-06-05 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

The current implementation of os.fspath() outputs something like this if you 
call os.fspath(0):

expected str, bytes or os.PathLike object, not 

This patch changes the output to:

expected str, bytes or os.PathLike object, not int

--
components: Library (Lib)
files: fspath-exception.patch
keywords: patch
messages: 267432
nosy: Jelle Zijlstra, ethan.furman
priority: normal
severity: normal
status: open
title: os.fspath() should not use repr() on error
versions: Python 3.6
Added file: http://bugs.python.org/file43239/fspath-exception.patch

___
Python tracker 

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



[issue27233] Missing documentation for PyOS_FSPath

2016-06-05 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

It should be added to the C API documentation. I plan on getting to this today.

--
assignee: Jelle Zijlstra
components: Documentation
messages: 267433
nosy: Jelle Zijlstra, ethan.furman
priority: normal
severity: normal
status: open
title: Missing documentation for PyOS_FSPath
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



[issue27232] os.fspath() should not use repr() on error

2016-06-05 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Added file: http://bugs.python.org/file43240/fspath-exception.patch

___
Python tracker 

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



[issue27232] os.fspath() should not use repr() on error

2016-06-05 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Removed file: http://bugs.python.org/file43239/fspath-exception.patch

___
Python tracker 

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



[issue27234] tuple - single value with comma is assigned as type tuple

2016-06-05 Thread Arno-Can Uestuensoez

New submission from Arno-Can Uestuensoez:

A single value terminated by a comma is assigned to be a tuple, even when 
missing parenthesis.

a=(1)  =>  a=1OK/defined as
a=(1,) =>  a=(1,) OK
a=1,   =>  a=(1,) ???

Is the latter intended?

--
In [4]: a=1,

In [5]: print a
(1,)

In [6]: type(a)
Out[6]: tuple
---

--
components: Interpreter Core
messages: 267434
nosy: acue
priority: normal
severity: normal
status: open
title: tuple - single value with comma is assigned as type tuple
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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

Since this is an addition to the changes made for PEP 488 (Issue23731), nosying 
Brett

--
nosy: +brett.cannon, ned.deily

___
Python tracker 

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



[issue27234] tuple - single value with comma is assigned as type tuple

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Yes, this is intentional. It is documented in 
https://docs.python.org/3/reference/expressions.html#expression-lists: 

"The trailing comma is required only to create a single tuple"

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue21130] equivalent functools.partial instances should compare equal

2016-06-05 Thread shakur shams Mullick

shakur shams Mullick added the comment:

Emanuel Barry if you want to take it over, I will stop and will not modify my 
patch further. Otherwise please let me know.

--

___
Python tracker 

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



[issue27234] tuple - single value with comma is assigned as type tuple

2016-06-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Yes, it is intended. Commas create tuples, not parentheses. (With the exception 
of the empty tuple.) The parens are just for grouping and precedence. `1,` is a 
tuple, regardless of whether you use parens around it or not.

--
nosy: +steven.daprano
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



[issue27156] IDLE: remove unused code

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

> Ned, do you have any objection to removing these now, for 3.6?

No, go right ahead.  Nobody should be using them.  And I concur with keeping 
the others around for the time being.

--

___
Python tracker 

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



[issue27188] sqlite3 execute* methods return value not documented

2016-06-05 Thread Berker Peksag

Berker Peksag added the comment:

Could you also change the function signatures from

.. method:: execute(sql, [parameters])

to

.. method:: execute(sql[, parameters])

and document that parameters should be list (or sequence or iterable -- I'm a 
the airport now so I can't check what is the correct term)?

I'm not a native speaker but this sentence sounds a bit weird to me:

This is a nonstandard shortcut that creates a cursor object by calling the 
cursor method, calls the cursor's :meth:`execute ` [...]

Perhaps it can be changed to


This is a nonstandard shortcut that creates a cursor object by calling the 
cursor's :meth:`execute ` method [...]

Also, please change the following usages

:meth:`execute `

with

:meth:`~Cursor.execute`

--
versions: +Python 3.5

___
Python tracker 

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



[issue21130] equivalent functools.partial instances should compare equal

2016-06-05 Thread Emanuel Barry

Emanuel Barry added the comment:

Shakur - Feel free to take over and work on it.

Serhiy - I don't think that partial(func) == func should be, in the same sense 
that (0, 1, 2), [0, 1, 2] and range(3) aren't equal even though they 
fundamentally represent the same thing.

--

___
Python tracker 

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



[issue27224] IDLE: editor versus grep line number differ

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

FWIW, using an IDLE built from the current top-of-trunk default (on OS X), the 
steps outlined above produce the correct result, 226 and 236, which match up 
with what other tools report.

--
nosy: +ned.deily

___
Python tracker 

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



[issue27111] redundant variables in long_add and long_sub

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oren, could you please sign a Contributor Licensing Agreement?

http://www.python.org/psf/contrib/contrib-form/
http://www.python.org/psf/contrib/

--

___
Python tracker 

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



[issue27231] Support the fspath protocol in the posixpath module

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

This patch adds a number of os.fspath calls to the posixpath.py module. I 
didn't duplicate all tests to check PathLike objects in addition str/bytes, 
because that seemed excessive. Instead I tried to ensure that each function has 
at least one test checking that it accepts PathLike objects.

--
keywords: +patch
Added file: http://bugs.python.org/file43241/issue27231.patch

___
Python tracker 

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



[issue27168] Yury isn't sure comprehensions and await interact correctly

2016-06-05 Thread Ned Deily

Changes by Ned Deily :


--
assignee:  -> yselivanov

___
Python tracker 

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



[issue27151] multiprocessing.Process leaves read pipes open (Process.sentinel)

2016-06-05 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +davin

___
Python tracker 

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



[issue27198] Adding an assertClose() method to unittest.TestCase

2016-06-05 Thread Chris Barker

Chris Barker added the comment:

Thanks Raymond.

Damn! I wrote a nice comprehensive note, and my browser lost it somehow :-(.

Here's a shorter version:

"FWIW, I find assertClose easy to misinterpret.  At first, it looks like an 
assertion that a file is closed."

sure -- we can find a new name -- I only used that because it's called 
"isclose" in the math module -- but no one's likely to think a math module 
function is about files...

"we don't need another way to do it"

Yes, we certainly do -- it was added to the math module (even though a large 
fraction of use cases would be testing), and something like this is in numpy, 
Boost, etc, and as the long debate about the PEP indicates -- it's not obvious 
how to do it -- I'd argue this is more necessary in unitest than most of the 
other asserts

(and, sample size 1: a relatively new user offered to proofread the patch for 
me, and immediately said "hey this is great -- I've been needing this!"

Frankly, the objections to adding new aseert methods are really a critique of 
the unittest API -- it is clearly DESIGNED to have specialized asserts for many 
common use cases. So I think we should either:

Embrace the API and add useful asserts like this one.

or

Make a concerted effort (Primarily through documentation) to move toward a 
different API (or a different way to use the current one, anyway). Robert's 
posts about "matches" are a good start.

In the meantime, maybe the way to go with this is to add it to 
assertAlmostEqual -- it gives folks the functionality, makes it discoverable, 
and doesn't add a new name.

Any objections to that before I take the time to code that up?

-Chris

--

___
Python tracker 

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



[issue27235] Heap overflow occurred due to the int overflow

2016-06-05 Thread Rustemzade Mehemmed

New submission from Rustemzade Mehemmed:

I have tested this vulnerability on the Python 2.7 and it absolutely affected 
:). Integer overflow produce in posix_fdopen function. If an attacker sent 
fdopen mode value larger than max integer value (2*32) to fdopen after integer 
overflow occurred. 

int fd;
char *orgmode = "r";
int bufsize = -1;
FILE *fp;
PyObject *f;
char *mode;
if (!PyArg_ParseTuple(args, "i|si", &fd, &orgmode, &bufsize))
return NULL;

/* Sanitize mode.  See fileobject.c */
mode = PyMem_MALLOC(strlen(orgmode)+3);
...
strcpy(mode, orgmode);

 os.fdopen(fd[, mode[, bufsize]])

fo = os.fdopen(fd, "r"*0x)

   0x5e2595 <+86>:  movedi,eax
=> 0x5e2598 <+89>:  call   0x416e50  
(gdb) print /x $eax
$1 = 0x
after does addition of "add" instruction therefore overflow occured and => 
0x5e259d <+94>:  addeax,0x3
(gdb) print /x $eax
$5 = 0x2
and memory allocate after buffer copy== > 
   0x5e25a1 <+98>:  movedi,eax
   0x5e25a4 <+101>: call   0x48f793 <_PyMem_DebugMalloc>
   0x5e25cb <+140>: movesi,edx
   ...
   0x5e25ce <+143>: movedi,eax
   0x5e25d1 <+146>: call   0x416b80 

copy buffer
strcpy(mode, orgmode); <=== overflow


poc:
#!/usr/bin/python

import os, sys

fd = os.open( "foo.txt", os.O_RDWR|os.O_CREAT )
fo = os.fdopen(fd, "r"*0xff)
print "Closed the file successfully!!"

--
messages: 267447
nosy: madness
priority: normal
severity: normal
status: open
title: Heap overflow occurred due to the int overflow

___
Python tracker 

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



[issue27235] Heap overflow occurred due to the int overflow (Python-2.7.11/Modules/posixmodule.c)

2016-06-05 Thread Rustemzade Mehemmed

Changes by Rustemzade Mehemmed :


--
title: Heap overflow occurred due to the int overflow -> Heap overflow occurred 
due to the int overflow (Python-2.7.11/Modules/posixmodule.c)

___
Python tracker 

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



[issue27233] Missing documentation for PyOS_FSPath

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Patch adds concise documentation

--
keywords: +patch
Added file: http://bugs.python.org/file43242/issue27233.patch

___
Python tracker 

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



[issue27111] redundant variables in long_add and long_sub

2016-06-05 Thread Oren Milman

Oren Milman added the comment:

done.
By the way, I am logging in to bugs.python.org through accounts.google.com, but 
I couldn't see any way to do the same in www.python.org, so I have a native 
account there (with the same email address). I hope that won't be an issue...

--

___
Python tracker 

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



[issue27235] Heap overflow occurred due to the int overflow (Python-2.7.11/Modules/posixmodule.c)

2016-06-05 Thread Rustemzade Mehemmed

Changes by Rustemzade Mehemmed :


--
type:  -> security

___
Python tracker 

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



[issue17500] move PC/icons/source.xar to http://www.python.org/community/logos/

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

LGTM

--
versions: +Python 3.5, Python 3.6 -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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Brett Cannon

Brett Cannon added the comment:

So the reason Python does the right thing at install is because compileall is 
used by the Makefile to do the compilation and it's run twice (it actually 
doesn't use distutils for this).

My question is what did distutils do before PEP 488 since .pyc and .pyo files 
had different names before as well? Did distutils build both previously and so 
this is a regression? Or is this a feature request?

--

___
Python tracker 

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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Michał Górny

Michał Górny added the comment:

Brett, .pyc was controlled by --compile and .pyo by --optimize (either 1 or 2). 
Technically only two variants could be used simultaneously, and distutils 
accounted for that.

Now you have .pyc + .opt-1.pyc + .opt-2.pyc, so three variants instead of two.

--

___
Python tracker 

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



[issue26971] python v3.5.1: sys.paths not respecting DESTDIRS and DESTSHARED

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

Sorry, it is no longer clear to me exactly what problem(s) and solution are 
being proposed here.  When dealing with installation problems like this, we 
have to be *very* precise: here's what I started with on what platform, here 
are the contents of the relevant directories and/or files before I start, here 
are exactly the steps I took, here are the results I expected, and here are the 
results I observed.  Using a downloaded tarball and the steps in @yaro-yaro's 
initial message, I see no change in /usr/lib64; note, there *may* have been 
Python .so files installed there by system packages but that should be 
irrelevant to building and installing your own Python.  I also could not 
reproduce @jojo's recipe as best I understand it and don't see how it could 
produce any change in /usr/lib64.  Changing the value of --libdir is a whole 
different matter and not relevant to the original problem.  Also the title of 
the issue refers to DESTDIR and DESTSHARED but nowhere in the body of the issue 
a
 re these variables directly referenced, so I have to assume they aren't being 
explicitly set.

Unless someone can better demonstrate an actual problem here, I'm going to 
close this issue.

--
status: open -> pending

___
Python tracker 

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



[issue27221] [multiprocessing] Doc is outdated regarding method picklability

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Patch attached. I also checked that this case is tested, and it looks like the 
Bunch object in Lib/test/_test_multiprocessing.py uses a method as its target.

--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43243/issue27233.patch

___
Python tracker 

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



[issue19234] socket.fileno() documentation

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

This looks fixed.

--
nosy: +Jelle Zijlstra
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



[issue27221] [multiprocessing] Doc is outdated regarding method picklability

2016-06-05 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Removed file: http://bugs.python.org/file43243/issue27233.patch

___
Python tracker 

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



[issue27221] [multiprocessing] Doc is outdated regarding method picklability

2016-06-05 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Added file: http://bugs.python.org/file43244/issue27221.patch

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

Since 3.5.2 is almost upon us, I'm setting this to "release blocker" status so 
we can make a decision about whether this should be changed for 3.5.2 or not.  
@haypo, do you have an opinion about the patch?

--
nosy: +ned.deily
priority: normal -> release blocker

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-05 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +larry

___
Python tracker 

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



[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-05 Thread Ned Deily

Changes by Ned Deily :


--
stage:  -> patch review

___
Python tracker 

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



[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

The docstrings (at least in 3.6) say subclasses must override __new__ *or* 
__init__. However, I think this is wrong too. The following is a correct (if 
not very useful) implementation of Sequence:

>>> import collections.abc
>>> class MySequence(collections.abc.Sequence):
... def __getitem__(self, key):
... raise IndexError(key)
... def __len__(self):
... return 0
... 

Other abc docstrings also don't claim that __init__ or __new__ must be 
implemented. The attached patch fixes the docstrings.

--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43245/issue27215.patch

___
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-06-05 Thread Brett Cannon

Brett Cannon added the comment:

Functions that only accept file descriptors should not be updated to work with 
__fspath__() as it will never return an int/fd.

As for Ethan's suggestion, are you saying you want to toss the str/bytes check 
from os.fspath()? If so then you will need to go to python-dev and bring that 
up as the PEP clearly specifies that str/bytes is checked for and specifically 
in the order of the Python code. The thinking behind the current design is that 
since __fspath__() has to be explicitly implemented that people will do so 
properly, versus accidentally passing in some type that isn't str/bytes like 
the pre-PEP 519 world (i.e. trust the __fspath__() implementors to do the right 
thing and only protect against someone passing in something wrong from 
complicated code flow).

There has been discussion about using the ``path.__fspath__() if hasattr(path, 
'__fspath__') else path`` idiom in os.path so that the pre-existing type-checks 
can do their thing instead of checking twice, although that's different from 
how os.fspath() works (then again, since this is all new code we could argue 
that going our own route in os.path is acceptable in the name of performance).

--

___
Python tracker 

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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Brett Cannon

Brett Cannon added the comment:

But distutils still does the right thing with -O2 and --optimize 2, right? If 
that's the case then this is an enhancement request to add support to distutils 
to compile all bytecode levels and not a regression.

--

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

I think the current documentation is correct and doesn't need changes. There is 
also already an example of a working __prepare__ method.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Yes, I don't think we control this, the layout is generated by sphinx.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue25941] Add 'How to Review a Patch' section to devguide

2016-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8b3f4473432e by Ned Deily in branch 'default':
Issue #25941: Add "How To Review A Patch" section to the devguide.
https://hg.python.org/devguide/rev/8b3f4473432e

--
nosy: +python-dev

___
Python tracker 

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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Michał Górny

Michał Górny added the comment:

Yes, you could put it like this.

--

___
Python tracker 

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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Brett Cannon

Changes by Brett Cannon :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue25941] Add 'How to Review a Patch' section to devguide

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

The revised patch looks good to me (other than some trailing whitespace).  
Camilla, thanks for your contribution.  If you haven't already, please sign a 
contributor form to cover this and future contributions as noted elsewhere in 
the Developer's Guide:

https://docs.python.org/devguide/coredev.html#sign-a-contributor-agreement

--
nosy: +ned.deily
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



[issue27226] distutils: unable to compile both .opt-1.pyc and .opt2.pyc simultaneously

2016-06-05 Thread Brett Cannon

Changes by Brett Cannon :


--
versions:  -Python 3.5

___
Python tracker 

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



[issue26582] asyncio documentation links to wrong CancelledError

2016-06-05 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

This patch documents CancelledError in the asyncio documentation.

--
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43246/issue26582.patch

___
Python tracker 

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



[issue27236] Add CHAINED_COMPARE_OP opcode

2016-06-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

For now complex code is generated for chained comparing.

$ echo "x = a < b > c < d" | ./python -m dis
  1   0 LOAD_NAME0 (a)
  2 LOAD_NAME1 (b)
  4 DUP_TOP
  6 ROT_THREE
  8 COMPARE_OP   0 (<)
 10 JUMP_IF_FALSE_OR_POP28
 12 LOAD_NAME2 (c)
 14 DUP_TOP
 16 ROT_THREE
 18 COMPARE_OP   4 (>)
 20 JUMP_IF_FALSE_OR_POP28
 22 LOAD_NAME3 (d)
 24 COMPARE_OP   0 (<)
 26 JUMP_FORWARD 4 (to 32)
>>   28 ROT_TWO
 30 POP_TOP
>>   32 STORE_NAME   4 (x)
 34 LOAD_CONST   0 (None)
 36 RETURN_VALUE

Proposed patch adds CHAINED_COMPARE_OP opcode that does all necessary stack 
manipulatios. Using it the generated code is simpler:

$ echo "x = a < b > c < d" | ./python -m dis
  1   0 LOAD_NAME0 (a)
  2 LOAD_NAME1 (b)
  4 CHAINED_COMPARE_OP   0 (<)
  6 JUMP_IF_FALSE_OR_POP18
  8 LOAD_NAME2 (c)
 10 CHAINED_COMPARE_OP   4 (>)
 12 JUMP_IF_FALSE_OR_POP18
 14 LOAD_NAME3 (d)
 16 COMPARE_OP   0 (<)
>>   18 STORE_NAME   4 (x)
 20 LOAD_CONST   0 (None)
 22 RETURN_VALUE

--
components: Interpreter Core
files: chained_compare_op.patch
keywords: patch
messages: 267466
nosy: Demur Rumed, Mark.Shannon, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add CHAINED_COMPARE_OP opcode
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43247/chained_compare_op.patch

___
Python tracker 

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



[issue27186] add os.fspath()

2016-06-05 Thread Dusty Phillips

Dusty Phillips added the comment:

Ethan: Can you clarify what you mean by "testing the other classes"? 
PureWindowsPath and PurePosixPath are tested by extension of _BasePurePathTest. 
So I think you mean that _BasePathTest also needs testing, but I don't see 
anything in there that would mirror the constructor testing that is happening 
in PurePath.

--

___
Python tracker 

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



[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-06-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I prefer 'rexcode' for the attribute name.

I share Serhiy's  reservations.  When people write code that depends on CPython 
implementation details, even though documented as such, the existence of such 
code becomes a drag on change, especially when details have been stable for 
awhile.  I just saw this used as an argument against one of the proposed 
bytecode/wordcode changes. "It would break current 3rd party code." It also 
came up a few years ago with randomizing hashes (and dict iteration order).

Jelle, can one access the 'rexcode' via ctypes?  Is so, I think an re 
disassembler with docs would be a good pypi module.  Maybe you could also make 
it work with Barnett's regex module.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27127] Never have GET_ITER not followed by FOR_ITER

2016-06-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me this idea is dead.

--

___
Python tracker 

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



[issue27052] Python2.7.11+ as in Debian testing and Ubuntu 16.04 LTS crashes with segfault

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

FWIW, I am also unable to reproduce the crash on OS X with a current top-of-2.7 
debug build.  Since it doesn't seem to be able to be reproduced with stock 
Python 2.7's, perhaps it is time to close the issue here?

--
nosy: +ned.deily

___
Python tracker 

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



[issue24459] Mention PYTHONFAULTHANDLER in the man page

2016-06-05 Thread Joshua Jay Herman

Joshua Jay Herman added the comment:

I have reviewed the comments on Rietveld and made the changes to the patch. 
Attached is the revised version.

--
Added file: 
http://bugs.python.org/file43248/addMissingEnvironmentVariables-review-1.patch

___
Python tracker 

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



[issue26329] os.path.normpath("//") returns //

2016-06-05 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez added the comment:

Hi Serhiy,
I am currently still investigating it for my own project. 

  
https://stackoverflow.com/questions/37646103/posix-path-1003-1-examples-and-behaviour-for-foo-bar

Currently I do not have the build environment, so I can provide the text, but 
because I am a bit under pressure with finishing a larger pack of OpenSource 
projects currently I cannot manage to setup the environment.

So can do this eventually in 2-3Weeks.

--

___
Python tracker 

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



[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-05 Thread Ned Deily

Ned Deily added the comment:

Can we close this as an Ubuntu-specific problem?

--
nosy: +doko, ned.deily

___
Python tracker 

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



[issue27224] IDLE: editor versus grep line number differ

2016-06-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yesterday, I grepped three times and got the same wrong result each time, so I 
know I was not crazy.  But today, starting fresh with no IDLE or TortoiseHg 
running, all is well.  Closing as 'heisenbug' ;-).  Lesson: start fresh before 
reporting weird behavior.  (I should have known.  I occasionally have to reboot 
windows to reset its key mappings.)  Thanks, and sorry for the noise.

--
resolution:  -> not a bug
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



[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2016-06-05 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +davin
versions: +Python 3.5, Python 3.6 -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



[issue27052] Python2.7.11+ as in Debian testing and Ubuntu 16.04 LTS crashes with segfault

2016-06-05 Thread Matthias Klose

Matthias Klose added the comment:

I'm unable to reproduce this with the 2.7 branch 20160603.

--

___
Python tracker 

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



[issue27052] Python2.7.11+ as in Debian testing and Ubuntu 16.04 LTS crashes with segfault

2016-06-05 Thread Matthias Klose

Changes by Matthias Klose :


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

___
Python tracker 

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



[issue27052] Python2.7.11+ as in Debian testing and Ubuntu 16.04 LTS crashes with segfault

2016-06-05 Thread Matthias Klose

Matthias Klose added the comment:

(checked with the recent packages in Debian unstable and Ubuntu yakkety)

--

___
Python tracker 

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



  1   2   >