[issue27988] email iter_attachments can mutate the payload

2016-09-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

LGTM +1

--

___
Python tracker 

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



[issue12754] Add alternative random number generators

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

I agree with what Nick wrote. It became easy to install a third-party module, 
and we made progress on APIs to get random bytes from the system.

I'm not convinced neither that Mersenne Twister limitations are important 
enough to replace it.

If you want to see enhancements in the domain of RNG, I suggest to reopen a 
more specific issue. This issue looks like a general discussion around RNG, not 
really a concrete change.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-09-06 Thread Steve Dower

Changes by Steve Dower :


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



[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Xiang, if multi-phase initialisation is an area you're interested in, it occurs 
to me you may also want to take a look at Petr's proposal to provide efficient 
access to global module state from methods of extension types: 
https://mail.python.org/pipermail/import-sig/2016-August/001065.html

With the 3.6 feature freeze deadline imminent it's looking like that will be 
deferred to 3.7, but it's still a significant improvement that should encourage 
greater use of the newer more submodule and reloading friendly approach to C 
extension module initialisation.

--

___
Python tracker 

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



[issue27997] ImportError should be raised consistently from import machinery.

2016-09-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue27976] Deprecate building with bundled copy of libffi on non-Darwin POSIX platforms

2016-09-06 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

That's great! issue26942 can be closed after this change is landed. It's caused 
by a libffi bug on Android.

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

1. Returning a list instead of an iterator looks unpythonic to me. Values 
generated sequentially, there are no advantages of returning a list.

2. An implementation lacks optimizations used in my patch.

3. The documentation still contains a receipt for weighted choice. It is 
incompatible with new function.

--

___
Python tracker 

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



[issue27968] test_coroutines generates some warnings

2016-09-06 Thread Xiang Zhang

Xiang Zhang added the comment:

Run hg bisect and get 756c27efe193.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

It may be that the right fix is to build with more recent Linux header files, 
even when running the build on an older kernel, in which case the request would 
be to have a way to indicate that missing those particular headers should fail 
the build, rather than implicitly omitting os.getrandom().

Worst case, yeah, we'll have to patch Fedora's system Python to hardcode the 
necessary constants in order to cope with the way Koji's buildroots are 
currently set up. I hope it doesn't come to that, though.

I'll leave the specifics to Petr, but it would definitely be preferable to have 
a common way of solving this recommended by upstream rather than everyone 
affected needing to figure out how to solve the problem on their own.

--

___
Python tracker 

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



[issue27968] test_coroutines generates some warnings

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Yury this smells of something in async/await?

--
assignee:  -> yselivanov

___
Python tracker 

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



[issue27776] PEP 524: Make os.urandom() blocking on Linux

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

I've reviewed all the open issues that come up when searching for "getrandom" 
on the issue tracker, and closed all the ones that were either out of date or 
rejected based on PEP 524 being accepted and implemented.

For the remainder, I either wasn't clear on whether they could be closed or not 
(in which case I posted a comment asking Victor to take a look at them), or 
else they were clearly still valid and I posted a relevant status update.

Doing a similar search for "urandom", I checked the ones where the titles 
seemed relevant and commented where a status update and possible closure seemed 
appropriate.

--

___
Python tracker 

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



[issue27683] ipaddress subnet slicing iterator malfunction

2016-09-06 Thread Xiang Zhang

Xiang Zhang added the comment:

ping :)

--

___
Python tracker 

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



[issue12754] Add alternative random number generators

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Since this issue was opened, a few relevant changes have been made:

* firstly the random.SystemRandom API and subsequently the "secrets" module 
were added to provide ready access to the operating system's cryptographically 
secure PRNG. This addresses the "At least one of the new generators should be 
cryptographically strong" consideration in Raymond's original proposal
* secondly, the ensurepip module has been added and various other improvements 
to Python's 3rd party software distribution infrastructure have been made, 
lowering the barriers to retrieving alternate modelling and simulation RNGs 
from PyPI for folks that need or want them

Given those changes, would it make sense to close this enhancement proposal as 
out of date?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27968] test_coroutines generates some warnings

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

NM I get the same on Mac after rebuilding from scratch. I can repro this with 
the 3.5 branch too. Wonder if something changed in asyncio?

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



[issue27968] test_coroutines generates some warnings

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

I only have a Mac to test -- does anyone else on this issue have a Linux system 
to try to reproduce this?

--

___
Python tracker 

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



[issue15206] uuid module falls back to unsuitable RNG

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Given the introduction of the secrets module in 3.6, perhaps uuid could be 
updated to fall back to that rather than to the random module and leave older 
versions unmodified?

--
nosy: +ncoghlan
versions: +Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue26970] Replace OpenSSL's CPRNG with system entropy source

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Christian, is this still a change you'd like to make for 3.6?

(I don't recall seeing it in your list of pending ssl modules patches)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27654] [Patch] Use arc4random_buf() on CloudABI

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Victor, Christian - this looks like another interesting platform-specific 
corner case for the system RNG wrapper.

--
nosy: +christian.heimes, haypo, ncoghlan

___
Python tracker 

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



[issue27905] Add documentation for typing.Type

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks again!  Merged to 3.5 and 3.6 (after cleaning up trailing whitespace -- 
again ;-).

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

___
Python tracker 

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



[issue27905] Add documentation for typing.Type

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9fb30d6af6a9 by Guido van Rossum in branch '3.5':
Issue #27905: Docs for typing.Type[C], by Michael Lee.
https://hg.python.org/cpython/rev/9fb30d6af6a9

New changeset 1705cde6266d by Guido van Rossum in branch 'default':
Issue #27905: Docs for typing.Type[C], by Michael Lee. (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/1705cde6266d

--
nosy: +python-dev

___
Python tracker 

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



[issue26826] Expose new copy_file_range() syscall in os module.

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Victor, due to the mention of getrandom() early on, this came up when I was 
looking for issues that could potentially be closed based on the PEP 524 
implementation landing.

Any chance you or someone else could take another look during the pre-beta 
sprint this week?

(Petr, FYI as a possible new feature that could be interesting from a Fedora 
system Python perspective)

--
nosy: +encukou, ncoghlan

___
Python tracker 

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



[issue27398] configure warning for Python 3.5.2 during compilation

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Presumably this also affects Python 3.6, as that includes the same headers 
during configure for the same reasons: to check if the getrandom() syscall is 
likely to be available.

#27990 is somewhat related, in that Linux makes this a bit difficult to do 
correctly on older systems - we may need an explicit "--with-getrandom" and 
corresponding "--without-getrandom" to make it easy for folks to override the 
system inspection logic in the configure script.

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



[issue27955] getrandom() syscall returning EPERM make the system unusable.

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

With #27778 implemented, there's also the question of how os.getrandom() will 
react to security policies that restrict access to the getrandom syscalls (vs 
just not having it available in the kernel).

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27963] null poiter dereference in set_conversion_mode due uncheck _ctypes_conversion_errors

2016-09-06 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27731] Opt-out of MAX_PATH on Windows 10

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 26601191b368 by Steve Dower in branch 'default':
Issue #27731: Opt-out of MAX_PATH on Windows 10
https://hg.python.org/cpython/rev/26601191b368

--
nosy: +python-dev

___
Python tracker 

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



[issue27997] ImportError should be raised consistently from import machinery.

2016-09-06 Thread Eric Snow

New submission from Eric Snow:

As indicated by issue #16384, the import machinery is not consistent in raising 
ImportError.  Some places in _bootstrap.py (and _bootstrap_external.py) raise 
ImportError and others make no effort to wrap errors that get encountered.  I 
would expect the import machinery to always raise ImportError, except that 
errors coming from executing a module to stay unwrapped.

I haven't had a chance yet to catalog the specific cases of inconsistency.  
Regardless, changing to be consistent would introduce backward compatibility.  
However, it should not be a big problem so I think we'd be okay (with an 
appropriate What's New entry).

--
components: Interpreter Core
messages: 274742
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: ImportError should be raised consistently from import machinery.
type: behavior
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



[issue16384] import.c doesn't handle EOFError from PyMarshal_Read*

2016-09-06 Thread Eric Snow

Eric Snow added the comment:

After looking more closely, it looks like we should be ignoring such bogus 
modules.  Here's a patch to do so.

--
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file44424/issue16384.diff

___
Python tracker 

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



[issue27996] Python 3 ssl module can't use a fileno to create a SSLSocket

2016-09-06 Thread SenBin Yu

New submission from SenBin Yu:

In the SSLSocket __init__ function, it's ok to do a socket type check with 
argument sock.But meanwhile the sock argument can't be None, which make the 
SSLSocket socket __init__ way meaningless.Although there are three branch 
conditions as argument sock, fileno and other.

--
components: Library (Lib)
files: SSLSocket_sock.png
messages: 274740
nosy: SenBin Yu
priority: normal
severity: normal
status: open
title: Python 3 ssl module can't use a fileno to create a SSLSocket
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file44423/SSLSocket_sock.png

___
Python tracker 

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



[issue27995] Upgrade Python 3.4 to OpenSSL 1.0.2h on Windows

2016-09-06 Thread Larry Hastings

Changes by Larry Hastings :


--
nosy: +larry
title: Upgrade Python 3.4 to OpenSSL 1.0.2h -> Upgrade Python 3.4 to OpenSSL 
1.0.2h on Windows

___
Python tracker 

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



[issue27995] Upgrade Python 3.4 to OpenSSL 1.0.2h

2016-09-06 Thread Shaun Walbridge

New submission from Shaun Walbridge:

>From the release notes of Python 3.4.5, I see that 3.4 is now in "security 
>fixes only" mode, and no new installers will be created. That said, OpenSSL 
>should be kept up to date so third-parties who build binaries from source will 
>receive upstream patches (there are 18 CVEs against OpenSSL 1.0.2d). This 
>patch upgrades OpenSSL to 1.0.2h for Windows builds.

I initially used the same fix applied in #26930 here, but the relevant 
intermediate OpenSSL headers (crypto/buildinf_amd64.h, crypto/buildinf_x86.h, 
crypto/opensslconf_amd64.h, crypto/opensslconf_x86.h) aren't included in the 
openssl-1.0.2h externals repository [1]. The included patch fixes this by 
forcing the intermediate configuration files to be written, which doesn't seem 
to add much to the compilation time and avoided deeper changes to the OpenSSL 
build process, but there likely is a more elegant solution to this issue.

With this patch applied, Python 3.4.5 compiled and tests ran cleanly locally 
both the x64 and Win32 targets, compiled using Visual Studio 2010. 


1. http://svn.python.org/projects/external/openssl-1.0.2h/

--
components: Build, Windows
files: openssl-upgrade.patch
keywords: patch
messages: 274739
nosy: paul.moore, scw, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Upgrade Python 3.4 to OpenSSL 1.0.2h
type: security
versions: Python 3.4
Added file: http://bugs.python.org/file44422/openssl-upgrade.patch

___
Python tracker 

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



[issue27994] In the argparse help(argparse) prints weird comments instead of good docstrings

2016-09-06 Thread py.user

New submission from py.user:

>>> import argparse
>>> help(argparse)

>>>

Output:

|  add_subparsers(self, **kwargs)
|  # ==
|  # Optional/Positional adding methods
|  # ==
|  
|  convert_arg_line_to_args(self, arg_line)
|  
|  error(self, message)
|  error(message: string)
|  
|  Prints a usage message incorporating the message to stderr and
|  exits.
|  
|  If you override this in a subclass, it should not return -- it
|  should either exit or raise an exception.
|  
|  exit(self, status=0, message=None)
|  # ===
|  # Exiting methods
|  # ===
|  
|  format_help(self)
|  
|  format_usage(self)
|  # ===
|  # Help-formatting methods
|  # ===
|  
|  parse_args(self, args=None, namespace=None)
|  # =
|  # Command line argument parsing methods
|  # =
|  
|  parse_known_args(self, args=None, namespace=None)
|  
|  print_help(self, file=None)
|  
|  print_usage(self, file=None)
|  # =
|  # Help-printing methods
|  # =
|  
|  --
|  Methods inherited from _AttributeHolder:
...


There are no docstrings for methods, hence some internal comments picked up 
instead.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 274738
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse help(argparse) prints weird comments instead of good 
docstrings
type: behavior
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



[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Steve Dower

Steve Dower added the comment:

I also added more tests, specifically for ansi and oem encodings on Windows and 
the errors argument on all platforms.

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



[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 720f0cf580e2 by Steve Dower in branch 'default':
Issue #6135: Adds encoding and errors parameters to subprocess
https://hg.python.org/cpython/rev/720f0cf580e2

--
nosy: +python-dev

___
Python tracker 

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



[issue27993] In the argparse there are typos with endings in plural words

2016-09-06 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/argparse.html#prog
"By default, ArgumentParser objects uses sys.argv[0]"

Should be "objects use" as in all other places in the doc.

https://docs.python.org/3/library/argparse.html#conflict-handler
"By default, ArgumentParser objects raises an exception"

Should be "objects raise" as in all other places in the doc.

Applied a patch to the issue.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_objects_endings.diff
keywords: patch
messages: 274735
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse there are typos with endings in plural words
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44421/argparse_objects_endings.diff

___
Python tracker 

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



[issue27989] incomplete signature with help function using typing

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

It seems the output produced here is generated by inspect.signature(), which is 
called by pydoc in this case (in both versions of docroutine()).

I don't know if the right thing to do is to change inspect.signature() here, or 
to change pydoc to use something else to format the argument list.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Martin Panter

Martin Panter added the comment:

I run Arch Linux, but only update packages when I have to. As a result, I am 
running Linux 3.15 installed and running, but the linux-api-headers has more 
recently been updated to 4.7 (i.e. matching Linux 4.7).

--

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, but I don't have enough information to fix the issue. I don't see how my 
change can break the two failing tests. Could you please try to collect more 
information manually?

--
status: closed -> open

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, I'd missed that Martin was talking about the other way around from #27990.

Yes, I think it's worth documenting that os.getrandom() may raise OSError if 
the running kernel doesn't provide the syscall - that's going to be pretty easy 
to trigger by running a container with Python 3.6 on a container host running 
an older Linux kernel.

--

___
Python tracker 

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



[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

I'm not sure that os.urandom() is correct on OpenBSD. I'm not sure that using 
getentropy() is correct. getentropy() seems to be high quality but I understand 
that there is a low quantity of entropy and it can block.

I don't know if arc4random() is better: it's no more RC4 on recent OpenBSD, and 
it has an efficient implementation.

--
status: pending -> open

___
Python tracker 

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



[issue27992] In the argparse there is a misleading words about %(prog)s value

2016-09-06 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/argparse.html#argumentparser-objects
"prog - The name of the program (default: sys.argv[0])"

It doesn't take all sys.argv[0]. It splits sys.argv[0] and takes only the 
trailing part.

An example:

a.py

#!/usr/bin/env python3

import argparse
import sys

parser = argparse.ArgumentParser()
parser.add_argument("arg", help="The name is %(prog)s, the sys.argv[0] is " + 
sys.argv[0])
args = parser.parse_args()


The output in the console:

[guest@localhost bugs]$ ../bugs/a.py -h
usage: a.py [-h] arg

positional arguments:
  arg The name is a.py and sys.argv[0] is ../bugs/a.py

optional arguments:
  -h, --help  show this help message and exit
[guest@localhost bugs]$


In the output we see that %(prog)s takes only trailing part of sys.argv[0] not 
all.

Applied a patch to the issue that specifies about part of sys.argv[0].

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_sys-argv-0-part.diff
keywords: patch
messages: 274729
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse there is a misleading words about %(prog)s value
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44420/argparse_sys-argv-0-part.diff

___
Python tracker 

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



[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Victor, can this be closed following the changes to os.urandom() in 3.5 and 3.6 
to avoid using a file descriptor in os.urandom() where feasible?

--
nosy: +ncoghlan
status: open -> pending

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

Support for the getrandom() syscall requires syscall(), SYS_getrandom constant, 
GRND_NONBLOCK and GRND_RANDOM constants, linux/random.h header, etc.

I don't understand your request. configure doesn't check getrandom() syscall 
result:

/* ignore the result, Python checks for ENOSYS and EAGAIN at runtime */
(void)syscall(SYS_getrandom, buffer, buflen, flags);

I don't see how you can support getrandom() if the host doesn't have all 
constants to compile the C code. Do you have to hardcode constants?

--
nosy: +haypo

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Larry Hastings

Larry Hastings added the comment:

> FWIW the cipher list (at least the restricted ones for
> ssl.create_default_context()) is explicitly documented
> as being able to be changed at any time without prior deprecation

Yes.  To be specific:  "The protocol, options, cipher and other settings may 
change to more restrictive values anytime without prior deprecation."

https://docs.python.org/3/library/ssl.html#ssl.create_default_context

I've seen no documentation suggesting that we can add new ciphers at any time.

--

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

> HAVE_GETRANDOM_SYSCALL seems to be a compile-time library check, not a 
> runtime check. I compiled and run on Linux 3.15.5, and os.getrandom() exists 
> but raises ENOSYS:

Oh, I'm surprised the configure sees getrandom() as available. But well ok, the 
error can occur if you compile Python on a more recent kernel than the running 
kernel.

I fixed the unit test: skip getrandom() tests if getrandom() fails with ENOSYS.

Do you think that it's worth to document this case?

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



[issue27991] In the argparse howto there is a misleading sentence about store_true

2016-09-06 Thread py.user

New submission from py.user:

https://docs.python.org/3/howto/argparse.html#combining-positional-and-optional-arguments
"And, just like the “store_true” action, if you don’t specify the -v flag, that 
flag is considered to have None value."

This sentence is misleading. It supposes that "store_true" action can save None 
value. But "store_true" action always saves True or False value.

An example:

This code was taken from the argparse howto. I've just added the -f option and 
printed args to the stdout.

a.py

#!/usr/bin/env python3

import argparse

parser = argparse.ArgumentParser()
parser.add_argument("square", type=int,
help="display the square of a given number")
parser.add_argument("-v", "--verbosity", action="count",
help="increase output verbosity")
parser.add_argument("-f", "--flag", action="store_true")
args = parser.parse_args()

print('args:', args)


The output in the console:

[guest@localhost bugs]$ ./a.py 1
args: Namespace(flag=False, square=1, verbosity=None)
[guest@localhost bugs]$ 


In the output we see that the -f option have got the False value not None.

Applied a patch to the issue that just removes words about analogy with 
store_true action.

--
assignee: docs@python
components: Documentation, Library (Lib)
files: argparse_store_true.diff
keywords: patch
messages: 274725
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the argparse howto there is a misleading sentence about store_true
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44419/argparse_store_true.diff

___
Python tracker 

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



[issue27292] Warn users that os.urandom() prior to 3.6 can return insecure values

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

I dislike urandom-doc.v2.patch. There is no need to worry all users. Just be 
explicit and explain that the issue is specific to Linux and explain when it 
occurs: before the entropy pool is filled *and* if the system was not able yet 
to write enough entropy on disk, this thing:
https://www.python.org/dev/peps/pep-0524/#load-entropy-from-disk-at-boot

--

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a243a40b421 by Victor Stinner in branch 'default':
Fix test_os.GetRandomTests()
https://hg.python.org/cpython/rev/7a243a40b421

--

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Larry Hastings

Larry Hastings added the comment:

Here at the core dev sprint we had a discussion about whether adding ChaCha20 
into 3.5 was the right call.  Strictly speaking, of course, it's neither a bug 
fix or a security fix, so that suggests it shouldn't be permitted.  However 
ultimately we concluded it was okay to leave it in.

One thing that bears pointing point out: the Windows binary installers and the 
Mac 64-bit installers are built against OpenSSL versions that don't have 
support for ChaCha20 anyway, so it's not going to change anything for those 
users.  Ned wasn't sure whether or not 32-bit Mac binary installers would or 
not--and it's such an irrelevant platform he couldn't be bothered to find out.

--

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2016-09-06 Thread Martin Panter

Martin Panter added the comment:

Koobs if you can, it would be good to understand where the failure is. My guess 
is that Python doesn’t like running a non-ASCII filename. The following is 
hopefully a simplified version of the test_cmd_line_script test case:

import os, subprocess, sys

script_name = os.fsdecode(b'./\xE7w\xF0.py')
script_file = open(script_name, 'w', encoding='utf-8')
script_file.write('print(ascii(__file__))\n')
script_file.close()

cmd_line = [sys.executable, '-X', 'faulthandler', '-I', script_name]
env = os.environ.copy()
env['TERM'] = ''
proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE, 
stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
out, err = proc.communicate()
print(proc.returncode)  # Should be 0 but Free BSD has 1
print(repr(err))  # Error is about encoding 0xE7 with ASCII
print(repr(out))  # If executed, this would be the file name

Hopefully fixing the above problem will help with the test_readline failure. 
The readline test case does Readline (tab) completions involving non-ASCII 
text, and it seems that the Python completion routine is no longer being called.

--

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Donald Stufft

Donald Stufft added the comment:

> > The difference between a security feature and a security fix
> > is incredibly hard to differentiate.
>
> I'm not buying this argument.

This touches on it http://web.mit.edu/tabbott/www/papers/hotos.pdf but I'm not 
sure how you don't see it... In the hypothetical case we don't backport 
ChaCha20 support and 3DES and AES constructs in TLS are no longer secure... 
what do you do? Do you just plug your fingers in your ears and hope nobody 
attacks you? Do you rush to try and patch it at the last minute as a rush job 
instead of being able to phase it in at a controlled time?

> Future OpenSSLs don't affect Python 3.4, as Python 3.4 won't be upgraded to 
> them.  Anyway we don't ship binary installers for 3.4 anymore.

Well except LibreSSL already supports this just fine, so it doesn't require a 
new OpenSSL at all and I'm not sure what it means that "Python 3.4 won't be 
upgraded to them". Python will forcibly mandate that nobody ever links against 
a newer OpenSSL version?

> Please don't check in support for new cyphers to 3.4.

FWIW the cipher list (at least the restricted ones for 
ssl.create_default_context()) is explicitly documented as being able to be 
changed at any time without prior deprecation (and RC4 for instance was dropped 
in Python 3.4.4).

--

___
Python tracker 

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



[issue27959] Add 'oem' encoding

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 786c34bdc27a by Steve Dower in branch 'default':
Issue #27959: Updates NEWS and whatsnew
https://hg.python.org/cpython/rev/786c34bdc27a

--

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Huh, I thought I'd already filed an issue for that, but it looks like it was 
only a security-sig thread: 
https://mail.python.org/pipermail/security-sig/2016-June/60.html

I've now remedied that omission and filed http://bugs.python.org/issue27990 to 
cover it explicitly.

Since that was a pre-existing problem that also happens to affect this API, 
rather than something new introduced by Victor's patch, closing this again.

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



[issue27959] Add 'oem' encoding

2016-09-06 Thread Steve Dower

Changes by Steve Dower :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue27959] Add 'oem' encoding

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fd0e62300fb7 by Steve Dower in branch 'default':
Issue #27959: Documents new encoding and alias.
https://hg.python.org/cpython/rev/fd0e62300fb7

--

___
Python tracker 

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



[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-06 Thread Nick Coghlan

New submission from Nick Coghlan:

The configure script determines the setting for HAVE_GETRANDOM_SYSCALL at build 
time, which means the dynamic check for getrandom() support in the Linux kernel 
gets disabled when building against an older kernel.

This impacts the implicit use of getrandom() in os.urandom(): 
https://mail.python.org/pipermail/security-sig/2016-June/60.html

And also the new os.getrandom() API added in #27778: 
http://bugs.python.org/issue27778#msg274698

It's desirable to have a way of forcing the inclusion of the dynamic runtime 
check, even if the currently running kernel doesn't provide the syscall itself.

--
messages: 274715
nosy: encukou, martin.panter, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Provide a way to enable getrandom on Linux even when build system runs 
an older kernel
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



[issue27959] Add 'oem' encoding

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c499690f606c by Steve Dower in branch 'default':
Issue #27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec 
lookup
https://hg.python.org/cpython/rev/c499690f606c

--
nosy: +python-dev

___
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-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3417d324cbf9 by Brett Cannon in branch 'default':
Issue #27182: Add support for path-like objects to PyUnicode_FSDecoder().
https://hg.python.org/cpython/rev/3417d324cbf9

--

___
Python tracker 

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



[issue27293] Summarize issues related to urandom, getrandom etc in secrets documentation

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 524 has been implemented for 3.6b1 in #27776, so os.urandom() itself will 
now do the right thing for cryptographic use cases on Linux.

Accordingly, marking this as out of date - with os.urandom() and the secrets 
module both implicitly doing the right thing, the vagaries of operating system 
cryptographic RNG access can be left as obscure arcana of interest only to 
language runtime developers, rather than regular Python users :)

--
nosy: +ncoghlan
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue26667] Update importlib to accept pathlib.Path objects

2016-09-06 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 524 has been implemented for 3.6b1 in #27776, so os.urandom() itself will 
now do the right thing for cryptographic use cases on Linux.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue27292] Warn users that os.urandom() prior to 3.6 can return insecure values

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 524 has been implemented for 3.6b1 in #27776, so os.urandom() itself will 
now do the right thing for cryptographic use cases on Linux. Accordingly, I've 
removed Python 3.6 from the affected versions for this issue.

I've also flagged this as purely a documentation issue, since no behavioural 
changes are currently proposed for older versions.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, ncoghlan
title: Warn users that os.urandom() can return insecure values -> Warn users 
that os.urandom() prior to 3.6 can return insecure values
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



[issue27288] secrets should use getrandom() on Linux

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 524 has been implemented for 3.6b1 in #27776, so os.urandom() itself will 
now do the right thing for cryptographic use cases on Linux.

--
nosy: +ncoghlan
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue27570] Avoid memcpy(. . ., NULL, 0) etc calls

2016-09-06 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Sorry I missed this. The changes which I didn't already make look good. :)

--

___
Python tracker 

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



[issue27776] PEP 524: Make os.urandom() blocking on Linux

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

If /dev/urandom isn't available, Python refusing to start is likely to be one 
of the least of the system's problems, so Py_FatalError sounds reasonable to me 
- my +1 for a fallback above was a matter of "sounds good if you can find a way 
to make it work".

Thanks for all your work on getting this designed and implemented, Victor!

--

___
Python tracker 

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



[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-06 Thread Larry Hastings

Larry Hastings added the comment:

> The difference between a security feature and a security fix
> is incredibly hard to differentiate.

I'm not buying this argument.


> For instance, with 3DES being de-recommended (and removed in future
> OpenSSLs) that leaves basically only AES-GCM and AES-CBC left as a
> secure cipher.

Future OpenSSLs don't affect Python 3.4, as Python 3.4 won't be upgraded to 
them.  Anyway we don't ship binary installers for 3.4 anymore.

Please don't check in support for new cyphers to 3.4.

--

___
Python tracker 

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



[issue16384] import.c doesn't handle EOFError from PyMarshal_Read*

2016-09-06 Thread Eric Snow

Eric Snow added the comment:

I have verified that this is still a problem (basically 3.6b1).

Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
  File "/opt/python3.6/lib/python3.6/encodings/__init__.py", line 99, in 
search_function
  File "", line 979, in _find_and_load
  File "", line 968, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 663, in exec_module
  File "", line 768, in get_code
  File "", line 478, in _compile_bytecode
EOFError: marshal data too short
Aborted (core dumped)

We should be exiting with an error rather than aborting.

--
components: +Interpreter Core -None
stage:  -> test needed
versions: +Python 3.6 -Python 3.2

___
Python tracker 

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



[issue27984] singledispatch register should typecheck its argument

2016-09-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Catching the erroneous registration rather than silently ignoring it sounds 
like the right thing to do here to me as well.

I'm actually surprised that code isn't already throwing an exception later on, 
as "isinstance" itself does fail with non-types:

>>> from enum import Enum
>>> 
>>> IS = Enum("IS", "a, b")
>>> isinstance(IS.a, IS)
True
>>> isinstance(IS.a, IS.a)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: isinstance() arg 2 must be a type or tuple of types

--

___
Python tracker 

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



[issue27350] Compact and ordered dict

2016-09-06 Thread INADA Naoki

INADA Naoki added the comment:

Update the patch to use standard int types instead of adding PY_INT16_T
ref: https://bugs.python.org/issue17884

--
Added file: http://bugs.python.org/file44418/compact-dict.patch

___
Python tracker 

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



[issue27989] incomplete signature with help function using typing

2016-09-06 Thread David E. Franco G.

New submission from David E. Franco G.:

the issue is that when calling help on a function annotated with typing, all 
the relevant information is lost, for example

from typing import List, Any, Iterator, Tuple

def foo(data:List[Any]) -> Iterator[ Tuple[int,Any] ]:
...
 
when calling help on that

>>> help(foo)
Help on function foo in module __main__:

foo(data:typing.List) -> typing.Iterator

>>> 

all the information is lost, the output should look like this

>>> help(foo)
Help on function foo in module __main__:

foo(data:List[Any]) -> Iterator[ Tuple[int, Any] ]:

>>> 

where all the information that I put in the annotation is preserved and the 
typing.* are eliminated since they only add unnecessary noise

while reporting this issue in the typing module 
(https://github.com/python/typing/issues/279) I was told that is a bug with the 
inspect module and that help may need modification.

Thank for your time.

--
components: Library (Lib)
messages: 274702
nosy: David E. Franco G.
priority: normal
severity: normal
status: open
title: incomplete signature with help function using typing
type: behavior
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



[issue27570] Avoid memcpy(. . ., NULL, 0) etc calls

2016-09-06 Thread Martin Panter

Martin Panter added the comment:

Looks like revisions 5f3f6f1fb73a and ec537f9f468f may have fixed the 
listobject cases.

Also 66feda02f2a5 looks relevant. Benjamin, maybe you are interested in other 
bits of my patches :)

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue27988] email iter_attachments can mutate the payload

2016-09-06 Thread R. David Murray

Changes by R. David Murray :


--
components: +email
nosy: +barry

___
Python tracker 

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



[issue27988] email iter_attachments can mutate the payload

2016-09-06 Thread R. David Murray

New submission from R. David Murray:

In the right (wrong) circumstances the iter_attachments function may mutate the 
payload list.  The fix is simple (make a copy before operating on it).  
Attached is a patch with test.

--
files: iter_attachments_mutation.patch
keywords: patch
messages: 274700
nosy: r.david.murray
priority: normal
severity: normal
stage: commit review
status: open
title: email iter_attachments can mutate the payload
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44417/iter_attachments_mutation.patch

___
Python tracker 

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



[issue6135] subprocess seems to use local encoding and give no choice

2016-09-06 Thread Martin Panter

Martin Panter added the comment:

Maybe good to adjust the other mentions of universal_newlines, e.g. for 
check_output(). The Posix version of the multiple-pipe _communicate() method 
probably needs adjusting too. Test case:

>>> check_output(("true",), encoding="ascii", input="")  # Should be text
b''
>>> check_output(("true",), encoding="ascii")  # Correct result
''

--

___
Python tracker 

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



[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Martin Panter

Martin Panter added the comment:

HAVE_GETRANDOM_SYSCALL seems to be a compile-time library check, not a runtime 
check. I compiled and run on Linux 3.15.5, and os.getrandom() exists but raises 
ENOSYS:

==
ERROR: test_getrandom0 (test.test_os.GetRandomTests)
--
Traceback (most recent call last):
  File "/media/disk/home/proj/python/cpython/Lib/test/test_os.py", line 1280, 
in test_getrandom0
empty = os.getrandom(0)
OSError: [Errno 38] Function not implemented

--
nosy: +martin.panter
status: closed -> open

___
Python tracker 

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



[issue27972] Confusing error during cyclic yield

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks for the report. I've never seen this before, so I doubt it is a
common mistake. Yury have you ever seen this?

--Guido (mobile)

--

___
Python tracker 

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



[issue25596] Use scandir() to speed up the glob module

2016-09-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks Serhiy!

--Guido (mobile)

On Sep 6, 2016 12:35 PM, "Roundup Robot"  wrote:

>
> Roundup Robot added the comment:
>
> New changeset cb7ee9d9cddd by Serhiy Storchaka in branch 'default':
> Issue #25596: Optimized glob() and iglob() functions in the
> https://hg.python.org/cpython/rev/cb7ee9d9cddd
>
> --
> nosy: +python-dev
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27985] Implement PEP 526

2016-09-06 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Oops, sorry, forgot to add new files when converting from git to hg, here is 
the full patch.

--
Added file: http://bugs.python.org/file44416/hg-pep-526.diff

___
Python tracker 

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



[issue26307] no PGO for built-in modules with `make profile-opt`

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 75dae0b2ccb3 by Gregory P. Smith in branch '2.7':
Fixes issue26307: The profile-opt build now applys PGO to the built-in modules.
https://hg.python.org/cpython/rev/75dae0b2ccb3

--

___
Python tracker 

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



[issue27985] Implement PEP 526

2016-09-06 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Here is the patch for PEP 526 implementation

--
keywords: +patch
nosy: +levkivskyi
Added file: http://bugs.python.org/file44415/hg-pep-526.diff

___
Python tracker 

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



[issue27938] PyUnicode_AsEncodedString, PyUnicode_Decode: add fast-path for "us-ascii" encoding

2016-09-06 Thread koobs

koobs added the comment:

Re-open and assign for regressions. Observed in all koobs-freebsd* buildbots 
(9/10/11) and build types. Issue is in default branch (add version 3.7)

First failing test run: 
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/110

--
assignee:  -> haypo
nosy: +koobs
resolution: fixed -> 
versions: +Python 3.7

___
Python tracker 

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



[issue27781] Change sys.getfilesystemencoding() on Windows to UTF-8

2016-09-06 Thread Steve Dower

Steve Dower added the comment:

Also see PEP 529 for the latest updates there.

This is likely to be accepted as experimental for 3.6.0b1-3, and we'll commit 
to either the new default or a compatible default for b4.

--
Added file: http://bugs.python.org/file44414/27781_1.patch

___
Python tracker 

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



[issue3100] weakref subclass segfault

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3d8109fe6d82 by Gregory P. Smith in branch 'default':
Correct a comment in the test referencing the wrong issue number (issue3100
https://hg.python.org/cpython/rev/3d8109fe6d82

--
nosy: +python-dev

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2016-09-06 Thread Benjamin Peterson

New submission from Benjamin Peterson:

ubsan complains about unaligned access when structs include "long double". An 
example error:
runtime error: member access within misaligned address 0x7f77dbba9798 for 
type 'struct CDataObject', which requires 16 byte alignment

This is because (on x86 anyway), long double is 16-bytes long and requires that 
alignment, but obmalloc only gives a 8-byte alignment. (glibc malloc() gives 
16-byte alignment.)

I'm attaching a POC patch. I don't know what the impact of increasing the 
alignment is on obmalloc's performance or memory usage. It's also unfortunate 
that this patch increases the size of PyGC_Head to 32 bytes from 24 bytes. One 
can imagine a more middle-ground solution to this by allowing types to specify 
their required alignment.

--
components: Interpreter Core
files: alignment.patch
keywords: patch
messages: 274688
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: obmalloc's 8-byte alignment causes undefined behavior
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44413/alignment.patch

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Brett Cannon

Brett Cannon added the comment:

Leaving this open in case someone wants to backport to 2.7.

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e61cc86df03 by Brett Cannon in branch '3.5':
Issue #26359: Add the --with-optimizations flag.
https://hg.python.org/cpython/rev/1e61cc86df03

New changeset f9b52b31f1b4 by Brett Cannon in branch 'default':
Merge for #26359
https://hg.python.org/cpython/rev/f9b52b31f1b4

--

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-06 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Davin.

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



[issue27986] make distclean clobbers Lib/plat-darwin/*

2016-09-06 Thread Zachary Ware

New submission from Zachary Ware:

I suspect this is related to #23968, but I'm not certain.

--
components: Build, Macintosh
messages: 274685
nosy: doko, ned.deily, ronaldoussoren, zach.ware
priority: low
severity: normal
stage: needs patch
status: open
title: make distclean clobbers Lib/plat-darwin/*
type: behavior
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



[issue18844] allow weights in random.choice

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a5856153d942 by Raymond Hettinger in branch 'default':
Issue #18844: Add random.weighted_choices()
https://hg.python.org/cpython/rev/a5856153d942

--
nosy: +python-dev

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b4b73473ecc6 by Brett Cannon in branch 'default':
Issue #26359: Add the --with-optimizations configure flag.
https://hg.python.org/cpython/rev/b4b73473ecc6

--
nosy: +python-dev

___
Python tracker 

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



[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-06 Thread STINNER Victor

STINNER Victor added the comment:

Since it's almost the 3.6 beta 1, I chose to push the change right now. I'm 
sure that it's faster, I trust your benchmarks ;-)

Thanks Serhiy for this nice enhancement.


> > * Rename WRITECHAR macro to WRITE_ASCII_CHAR()

> This is not correct name. This macro is used for writing non-ascii characters 
> too.

Oh, I fixed this in the pushed change.

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



[issue16334] Faster unicode-escape and raw-unicode-escape codecs

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ad5a28ace615 by Victor Stinner in branch 'default':
Optimize unicode_escape and raw_unicode_escape
https://hg.python.org/cpython/rev/ad5a28ace615

--
nosy: +python-dev

___
Python tracker 

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



[issue27776] PEP 524: Make os.urandom() blocking on Linux

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ebbfc053360a by Victor Stinner in branch 'default':
Issue #27776: include process.h on Windows for getpid()
https://hg.python.org/cpython/rev/ebbfc053360a

--

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Brett Cannon

Changes by Brett Cannon :


Removed file: http://bugs.python.org/file44411/issue26359.diff

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Brett Cannon

Brett Cannon added the comment:

Patch with the missing Makefile.pre.in part :P

--
Added file: http://bugs.python.org/file44412/issue26359.diff

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-09-06 Thread Davin Potts

Davin Potts added the comment:

I've gone through the patch -- looks good to me.

--
nosy: +davin

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-09-06 Thread Brett Cannon

Brett Cannon added the comment:

Here is modification of Greg's patch to turn off LTO under OS X since LTO+PGO 
do not get along under El Capitan.

--
Added file: http://bugs.python.org/file44411/issue26359.diff

___
Python tracker 

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



[issue24277] Take the new email package features out of provisional status

2016-09-06 Thread R. David Murray

R. David Murray added the comment:

It is probably useless to try to review this as a diff.  It maybe better to 
just commit it, and let people report any problems as bugs.

--

___
Python tracker 

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



[issue26307] no PGO for built-in modules with `make profile-opt`

2016-09-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7d9cd4a0d488 by Gregory P. Smith in branch '3.5':
Fixes issue26307: The profile-opt build now applys PGO to the built-in
https://hg.python.org/cpython/rev/7d9cd4a0d488

New changeset bdc7292cf87e by Gregory P. Smith in branch 'default':
Fixes issue26307: The profile-opt build now applys PGO to the built-in modules.
https://hg.python.org/cpython/rev/bdc7292cf87e

--
nosy: +python-dev

___
Python tracker 

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



[issue24277] Take the new email package features out of provisional status

2016-09-06 Thread R. David Murray

R. David Murray added the comment:

Obviously I quite missed the 3.5 deadline, and it is only thanks to the Core 
Sprint that I'm going to make the 3.6 deadline, but at least I'm making it.

There is one code change in this patch, changing the default behavior of 
as_string/str on EmailMessage (only) to be more sensible, and take advantage of 
the policy.utf8 flag to make str output more readable by default.  Otherwise, 
it is simply (hah) a fairly complete documentation reorganization and rewrite 
giving primacy to the new API and demoting the old API to 'legacy'.

--
components: +email
keywords: +patch
nosy: +barry
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file44410/email_doc_rewrite.patch

___
Python tracker 

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



[issue1602] windows console doesn't print or input Unicode

2016-09-06 Thread Steve Dower

Steve Dower added the comment:

Latest patch is attached.

PEP acceptance is sounding likely, so feel free to critically review.

--
Added file: http://bugs.python.org/file44409/1602_4.patch

___
Python tracker 

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



  1   2   3   >