[issue27918] Running test suites without gui but still having windows flash

2016-09-01 Thread Xiang Zhang

Changes by Xiang Zhang :


Removed file: http://bugs.python.org/file44314/issue27918.patch

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Martin Panter

Martin Panter added the comment:

Here is what I did. (You could probably do this yourself, but never mind :)

hg pull -r{default,2.7,3.5}
hg update default  # Update to the latest public revision
hg import --no-commit "$(xclip -o)"  # Apply your patch on top
hg diff -p > pep467.patch  # Make a new diff

If you look inside the patch file, the difference is that the Reitveld review 
system cannot handle “diff -r 3e41c0449b9c” from your file, but hopefully will 
know about “diff -r ebb23744a36c” in my version.

--
Added file: http://bugs.python.org/file44316/pep467.patch

___
Python tracker 

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



[issue27918] Running test suites without gui but still having windows flash

2016-09-01 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file44315/issue27918.patch

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file44317/pep467_doc_changes.patch

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Xiang what do you think about changing the isolation_levels list to 
> begin_statements list

This is interesting suggestion. Indeed, this simplifies the code. Thanks Aviv.

--
Added file: http://bugs.python.org/file44318/issue27881_v4.patch

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, you do this "It's going to be freed in the dealloc method unless your 
alter that part too". If this is done I admit this is more clean. Patch LGTM.

--

___
Python tracker 

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



[issue27925] Nicer interface to convert hashlib digests to int

2016-09-01 Thread Steven D'Aprano

New submission from Steven D'Aprano:

hashlib digests should have a nicer interface to allow conversion to ints.

Currently we write int(x.hexdigest(), 16) which is less than obvious and easy 
to get wrong. It would be nice to be able to just say int(x) (that's my strong 
preference) or x.as_int().

Use-case: sometimes we need to store hashes in a database table which, for 
historical reasons, is an integer.

--
messages: 274102
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Nicer interface to convert hashlib digests to int
type: enhancement

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Michael Foord

Changes by Michael Foord :


--
assignee:  -> michael.foord

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Michael Foord

Michael Foord added the comment:

Is this for mocking out runtime dependencies that aren't available at test 
time? It seems like a good way of masking bugs! I'd be happier with a (or at 
least an option) to specify the imports that should be mocked. The use case 
should be mentioned in the docs.

I think the name is slightly confusing. I originally thought this was a 
function to mock specific imports - not to catch failed imports. 
mock_missing_import (or similar) would be a better name.

It's common with the mock functions to be able to provide a class to use as the 
mock function, and to take arbitrary keyword arguments to pass to the mock 
constructor.

--

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Eyal Posener

Eyal Posener added the comment:

Thanks for the review, Michael.

About the use case: I use it for a process with loads code and inspect it's 
classes and methods. When I run this process, not always I have all the 
dependencies of the inspected code, so I found myself mocking all those 
packages before running the inspection code. This was very inconvenience, and 
broke any time someone added a new dependency to the code which is not in the 
standard library.

About the name: I agree.

About the keyword for the mock constructor: no problems.

Should I fix the code and submit an updated patch?
Do you think this function has a place in the standard mock module?

--

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

As noticed by veky on the review, _high_bit() is slow and can be optimized 
using int.bit_length(). Attached bit_length.patch implements this.

_high_bit(0) returns -1. Maybe an exception must be raised if the argument is < 
1? (also fail for negative number)

--
Added file: http://bugs.python.org/file44319/bit_length.patch

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Michael Foord

Michael Foord added the comment:

It's not a use case I've specifically had but I can see its use. I'm uncertain 
of whether that means it belongs in the module or not. Let me see if I can get 
some more eyes on this bug.

--

___
Python tracker 

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



[issue23591] enum: Add Flags and IntFlags

2016-09-01 Thread Vedran Čačić

Vedran Čačić added the comment:

Sure, errors should never pass silently. This function shouldn't be called with 
nonpositive arguments. And there is no highbit of 0 (and there are infinitely 
many of negative numbers;).

ValueError is probably best - though IndexError can also be argued for, since 
this is quite analogous to pop from empty list. :-)

--

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Michael Foord

Michael Foord added the comment:

Before you spend any more time on this, my current thinking is that this is a 
bit too specialised to belong in the standard library. I'll wait and see if a 
preponderance of core devs and other users disagree with me before I close this 
though.

--

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Martin Panter

Martin Panter added the comment:

Thanks for the patches. I left you some comments in the code review.

I expect there would be more bits of the docs that need fixing. 
Doc/library/functions.rst definitely; the tutorial is worth checking too. There 
may also be example code floating around using the deprecated calls.

Regarding code that uses the deprecated call, as well as blind searching 
(grep), you could try running the entire test suite with -Werror. That should 
catch a lot of them.

In the RST documentation, I think you missed adding entries for the zeros() and 
byte() constructor methods. Maybe use the other class methods maketrans(), 
fromhex() as a starting point.

Also, this will need an entry written for Doc/whatsnew/3.6.rst.

--

___
Python tracker 

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



[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Christian, thanks a lot for doing this!  Do you plan to change the SSLContext 
constructor and make the protocol argument optional? It sounds like that would 
be a logical followup to the OpenSSL API changes.

--

___
Python tracker 

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



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

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I can't comment on this, as I don't even know what a "registered id" is, sorry 
:-/

--

___
Python tracker 

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



[issue27926] ctypes is too slow to convert a Python list to a C array

2016-09-01 Thread Tom Cornebize

New submission from Tom Cornebize:

It is much faster to construct a Python array from the list and then cast this 
array, rather than using the "standard" constructor. See attached file to 
compare the performances.

This issue was previously asked on Stackoverflow: 
http://stackoverflow.com/questions/39225263/why-is-ctypes-so-slow-to-convert-a-python-list-to-a-c-array/

--
components: ctypes
files: ctypes_slow.py
messages: 274111
nosy: Tom Cornebize
priority: normal
severity: normal
status: open
title: ctypes is too slow to convert a Python list to a C array
type: performance
Added file: http://bugs.python.org/file44320/ctypes_slow.py

___
Python tracker 

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



[issue27866] ssl: get list of enabled ciphers

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What does "kea" mean? Key exchange?

--
nosy: +pitrou

___
Python tracker 

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



[issue27927] argparse: default propagation of formatter_class from ArgumentParser() to SubParsers

2016-09-01 Thread Benjamin Giesers

New submission from Benjamin Giesers:

It would be nice to propagate the formatter_class defined in 
argparse.ArgumentParser() to added SubParsers by default. Currently one has to 
define the formatter_class for each subparser again and again.

Example:
parser = argparse.ArgumentParser(description='property', 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
subparsers = parser.add_subparsers(help='sub-command help')
pcar = subparsers.add_parser('car', help='add car', 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
pcar.add_argument('--color', help='color of car', default='red')
pyacht = subparsers.add_parser('yacht', help='add yacht', 
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
pyacht.add_argument('--length', help='length of yacht [m]', default=12.5)

--
components: Library (Lib)
messages: 274114
nosy: Benjamin Giesers
priority: normal
severity: normal
status: open
title: argparse: default propagation of formatter_class from ArgumentParser() 
to SubParsers
type: enhancement
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



[issue27866] ssl: get list of enabled ciphers

2016-09-01 Thread Christian Heimes

Christian Heimes added the comment:

KEA stands for key exchange algorithm.

--

___
Python tracker 

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



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

2016-09-01 Thread Christian Heimes

Christian Heimes added the comment:

A GEN_RID is an OID plus some opaque data. It's up to an application to 
understand an OID and interpret its data. The value of a GEN_RID can be as 
simple as an int or UTF-8 strings or as complex as a nested ASN.1 struct for 
Kerberos principals.

I have modified Lib/test/make_ssl_certs.py to include two GEN_RIDS: 

  otherName.1 = 1.2.3.4;UTF8:some other identifier
  otherName.2 = 1.3.6.1.5.2.2;SEQUENCE:princ_name

  [princ_name]
  realm = EXP:0, GeneralString:KERBEROS.REALM
  principal_name = EXP:1, SEQUENCE:principal_seq
  [principal_seq]
  name_type = EXP:0, INTEGER:1
  name_string = EXP:1, SEQUENCE:principals
  [principals]
  princ1 = GeneralString:username

1.3.6.1.5.2.2 is the OID for Kerberos public key init (pkinit), used for e.g. 
FAST pre-auth and SmartCard authentication.

--

___
Python tracker 

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



[issue27921] f-strings: do not allow backslashes

2016-09-01 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



[issue27919] Deprecate and remove extra_path distribution kwarg

2016-09-01 Thread Nick Coghlan

Nick Coghlan added the comment:

I think there are two time frames to look at here:

1. How do we make it easier for folks to work with existing packages like the 
newrelic one?

For that, it may make sense for at least setuptools to override extra_path when 
using installation targets other then sysconfig.get_path("purelib") and 
sysconfig.get_path("platlib") such that they get the same result as if 
"extra_path" wasn't there.

We know the setting isn't going to work, so ignoring it actually seems like it 
may be the more user friendly option.

2. How do we persuade publishers to stop using the "extra_path" feature in the 
first place?

I'm less sure of the benefits of that step, as I'm not sure why anyone would 
choose to use extra_path in the first place - the common "*.pth" file means you 
can still get conflicts, even with a versioned path name, and if you keep the 
dist-into directory, --single-version-externally-managed already gives you 
version info directly in the filesystem.

The use case does seem obscure enough that we could deprecate it as an 
undocumented feature that is incompatible with non-site-packages installs, and 
then see if anyone objects to the deprecation.

--

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes

New submission from Christian Heimes:

OpenSSL 1.1 has EVP_PBE_scrypt(). hashlib.scrypt() is a low-hanging fruit for 
Python 3.6. I have a working patch with some tests. I need to write more tests 
and documentation:

https://github.com/tiran/cpython/commits/feature/openssl110_scrypt

--
messages: 274118
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: patch review
status: open
title: Add hashlib.scrypt
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



[issue27364] Deprecate invalid unicode escape sequences

2016-09-01 Thread Emanuel Barry

Emanuel Barry added the comment:

Ping. I'd like to get this merged in time for 3.6. Is there anything I can do 
to speed up the review?

Since the change itself is very straightforward, I think this would make sense 
to merge it now and then fix the invalid escapes that are found during the beta 
phase.

--

___
Python tracker 

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



[issue27364] Deprecate invalid unicode escape sequences

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think "invalid escape sequence '\?'" would look cleaner than "invalid escape 
sequence '?'".

--

___
Python tracker 

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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-01 Thread kevinconway

kevinconway added the comment:

Added a comment to the .accept() loop with a reference to the issue.

--
Added file: http://bugs.python.org/file44321/multi-accept-3.patch

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

@Nathaniel, Antoine: last ping before timeout :-p

--

___
Python tracker 

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



[issue27809] Add _PyFunction_FastCallDict(): fast call with keyword arguments as a dict

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

The main feature has been merged, so I close the issue.

--
resolution:  -> fixed
status: open -> closed
title: _PyObject_FastCall(): add support for keyword arguments -> Add 
_PyFunction_FastCallDict(): fast call with keyword arguments as a dict

___
Python tracker 

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



[issue27128] Add _PyObject_FastCall()

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

The main features (_PyFunction_FastCall()) has been merged. Supporting keyword 
arguments is now handled by other issue (see issue #27830). I close this issue.

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



[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

I splitted the giant patch into smaller patches easier to review. The first 
part (_PyObject_FastCall, _PyObject_FastCallDict) is already merged. Other 
issues were opened to implement the full feature. I now close this issue.

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



[issue27364] Deprecate invalid unicode escape sequences

2016-09-01 Thread Emanuel Barry

Emanuel Barry added the comment:

Thanks Serhiy; it does look better to me too!

--
Added file: 
http://bugs.python.org/file44322/deprecate_invalid_escapes_both_3.patch

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Is the timeout part of the API? :-)

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

> Is the timeout part of the API? :-)

I don't want to make the API public before you validated that it is usable for 
your use case or to track numpy memory usage.

I guess that the first beta release of Python 3.6 is the deadline for this 
issue. Otherwise, we will have to wait ~2 years with Python 3.7.

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I may be a bit confused, but the "domain" integer you added in issue 26588 
doesn't seem to be part of this API... Is it deliberate?

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

> I may be a bit confused, but the "domain" integer you added in issue 26588 
> doesn't seem to be part of this API... Is it deliberate?

They are part of this API.

msg262180: """Ok, I added the following C functions:

  int _PyTraceMalloc_Track(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr, 
size_t size);
  int _PyTraceMalloc_Untrack(_PyTraceMalloc_domain_t domain, Py_uintptr_t ptr);

(...)"""

The domain 0 is used to track Python memory allocations.

--

___
Python tracker 

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



[issue27929] asyncio.AbstractEventLoop.sock_connect brooken for AF_BLUETOOTH

2016-09-01 Thread Robert Jordens

New submission from Robert Jordens:

Since 3.5.2 sock_connect() tries to be smart and resolves addresses for you if 
they fail a socket.inet_pton() check. But inet_pton() only supports AF_INET(6) 
and does not work for other address families that socket otherwise supports 
just fine (e.g. AF_BLUETOOTH).

Before 3.5.2, in order to happily use bluetooth sockets with asyncio, you could 
just do:

sock = socket.socket(family=socket.AF_BLUETOOTH, type=socket.SOCK_STREAM,
proto=socket.BTPROTO_RFCOMM)
sock.setblocking(False)
addr = "00:12:34:56:78:99"
yield from loop.sock_connect(sock, (addr, 1))

This is a regression.

--
components: Argument Clinic
messages: 274131
nosy: Robert.Jordens, larry
priority: normal
severity: normal
status: open
title: asyncio.AbstractEventLoop.sock_connect brooken for AF_BLUETOOTH
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



[issue27929] asyncio.AbstractEventLoop.sock_connect brooken for AF_BLUETOOTH

2016-09-01 Thread Robert Jordens

Robert Jordens added the comment:

The error for inet_pton() is:

>>> import socket
>>> socket.inet_pton(socket.AF_BLUETOOTH, "00:12:34:56:78:99")
Traceback (most recent call last):
  File "", line 1, in 
socket.error: [Errno 97] Address family not supported by protocol

And the traceback in asyncio is:

DEBUG:asyncio:Using selector: EpollSelector
Traceback (most recent call last):
  File "log.py", line 91, in 
main()
  File "log.py", line 84, in main
loop.run_until_complete(log(loop, sys.argv[1]))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in 
run_until_complete
return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
  File "log.py", line 22, in log
yield from loop.sock_connect(sock, (addr, 1))
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 397, in 
sock_connect
yield from resolved
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Which patch are we talking about? In tracemalloc_track-3.patch, I see:

+   If memory block is already tracked, update the existing trace. */
+PyAPI_FUNC(int) _PyTraceMalloc_Track(void *ptr, size_t size);
+
+/* Untrack an allocated memory block in the tracemalloc module.
+   Do nothing if the block was not tracked.
+
+   Do nothing if tracemalloc is not tracing Python memory allocations. */
+PyAPI_FUNC(void) _PyTraceMalloc_Untrack(void *ptr);

--

___
Python tracker 

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



[issue27929] asyncio.AbstractEventLoop.sock_connect brooken for AF_BLUETOOTH

2016-09-01 Thread Robert Jordens

Changes by Robert Jordens :


--
components: +asyncio -Argument Clinic
nosy: +gvanrossum, haypo, yselivanov

___
Python tracker 

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



[issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH

2016-09-01 Thread Emanuel Barry

Emanuel Barry added the comment:

Thanks for the report! I'm unable to reproduce, as `socket.AF_BLUETOOTH` 
doesn't exist on my system, but surely someone else can.

--
keywords: +3.5regression
nosy: +ebarry, ned.deily
priority: normal -> high
stage:  -> needs patch
title: asyncio.AbstractEventLoop.sock_connect brooken for AF_BLUETOOTH -> 
asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH
type:  -> behavior

___
Python tracker 

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



[issue22458] Add fractions benchmark

2016-09-01 Thread Stefan Behnel

Stefan Behnel added the comment:

Done:
https://github.com/python/performance/pull/10

Note that I didn't replace the existing telco benchmark as it is more specific 
to Decimal. The new benchmark makes it possible to compare the decimal and 
fractions modules for similar operations, though.

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

> Which patch are we talking about?

I'm talking about this change which was already merged into the default branch 
of Python in March 2016:

New changeset 60655e543d8a by Victor Stinner in branch 'default':
Add C functions _PyTraceMalloc_Track()
https://hg.python.org/cpython/rev/60655e543d8a

--

___
Python tracker 

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



[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

2016-09-01 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Uh... ok, I thought you wanted some feedback on the patches posted, since I 
didn't know you had committed a new version of them.

I haven't tried to use the new API (for various reasons it's a bit cumbersome 
to use a self-compiled Python for Numba), but I'm sure it will be good enough.

--

___
Python tracker 

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



[issue27926] ctypes is too slow to convert a Python list to a C array

2016-09-01 Thread Eryk Sun

Eryk Sun added the comment:

This is a consequence of several factors. It starts with the __init__ method of 
ctypes.Array, Array_init. This function doesn't hard-code calling the base 
sq_ass_item slot function, Array_ass_item. If it did, it wouldn't be nearly as 
slow. Instead it calls the abstract function PySequence_SetItem. Doing it this 
way accommodates an array subclass that overrides __setitem__. 

What I'd like to do here is check whether the sq_ass_item slot is defined as 
Array_ass_item, and if so call it directly instead of PySequence_SetItem. But 
it turns out that it's not set as Array_ass_item even if the subclass doesn't 
override __setitem__, and more than anything this is the real culprit for the 
relative slowness of Array_init.

If a built-in type such as ctypes.Array defines both mp_ass_subscript and 
sq_ass_item, then the __setitem__ wrapper_descriptor wraps the more generic 
mp_ass_subscript slot function. Then for a subclass, update_one_slot in 
Objects/typeobject.c plays it safe when updating the sq_ass_item slot. It sees 
that the inherited __setitem__ descriptor doesn't call wrap_sq_setitem, so it 
defines the slot in the subclass to use the generic function slot_sq_ass_item. 

This generic slot function goes the long way around to look up and bind the 
__setitem__ method and convert the Py_ssize_t index to a Python integer, to 
call the wrapper that calls the mp_ass_subscript slot. To add insult to injury, 
the implementation of this slot for a ctypes Array, Array_ass_subscript, has to 
convert back to a Py_ssize_t integer via PyNumber_AsSsize_t.

I don't know if this can be resolved while preserving the generic design of the 
initializer. As is, calling PySequence_SetItem in a tight loop is ridiculously 
slow. I experimented with calling Array_ass_item directly. With this change 
it's as fast as assigning to a slice of the whole array. Actually with a list 
it's a bit slower because *t has to be copied to a tuple. But it takes about 
the same amount of time as assigning to a slice when t is already a tuple, such 
as tuple(range(100)).

I doubt any amount of tweaking will make ctypes as fast as an array.array. 
ctypes has a generic design to accommodate simple C data, pointers, and 
aggregate arrays, structs, and unions. This comes with some cost to 
performance. However, you can and should make use of the buffer protocol to use 
arrays from the array module or numpy where performance is critical. It's 
trivial to create a ctypes array from an object that supports the buffer 
protocol. For example: 

v = array.array('I', t)
a = (ctypes.c_uint32 * len(v)).from_buffer(v)

There's no need to use the array.array's buffer_info() or ctypes.cast(). The 
from_buffer() method creates an array that shares the buffer of the source 
object, so it's relatively fast. It's also returning a sized array instead of a 
lengthless pointer (though it is possible to cast to an array pointer and 
immediately dereference the array).

--
nosy: +eryksun

___
Python tracker 

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



[issue27926] ctypes is too slow to convert a Python list to a C array

2016-09-01 Thread Eryk Sun

Changes by Eryk Sun :


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



[issue27930] logging's QueueListener drops log messages

2016-09-01 Thread Petr Viktorin

New submission from Petr Viktorin:

There are two "barrier" like abstractions on Lib/logging/handlers.py in the 
_monitor method.

First _monitor has two loops, what is already kind of a hint something is not 
right.

Second, it has two ways to exit the loop, that also exit the thread:
1) The _stop threading.Event is "set"
2) The _sentinel object is added to the queue

The problem is, the documentation says that the correct way to not loose 
records, the stop method must be called, but, the stop method just sets the 
_stop object and then adds the _sentinel object to the queue.

The loop stops when noticing that _stop is set, and then enters a second 
version of the loop, trying again to see the _sentinel object, but this time 
with non blocking read.

The test case shows the problem, but it also hints about the race conditions by 
the fact that running the test case under "taskset 1" works, so, to reproduce 
the issue, run the test under a multiprocessor environment.

The proper solution would be to have a proper locking mechanism, otherwise, the 
_stop object should not be used, and rely only in seeing the _sentinel field; 
this is what the class DeterministicQueueListener does in the test case.


(Reported by Paulo Andrade at 
https://bugzilla.redhat.com/show_bug.cgi?id=1370484 )

--
components: Library (Lib)
files: test.py
messages: 274139
nosy: encukou, vinay.sajip
priority: normal
severity: normal
status: open
title: logging's QueueListener drops log messages
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44323/test.py

___
Python tracker 

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



[issue27931] Email parse IndexError <""@wiarcom.com>

2016-09-01 Thread Константин Волков

New submission from Константин Волков:

Email lib fails to parse some emails:

from email._header_value_parser import get_angle_addr
get_angle_addr('<""@wiarcom.com> SIZE=28113').addr_spec

IndexError: list index out of range

Seems that email address can be parsed.

--
components: email
messages: 274140
nosy: barry, r.david.murray, Константин Волков
priority: normal
severity: normal
status: open
title: Email parse IndexError <""@wiarcom.com>
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



[issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH

2016-09-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks related (possibly a duplicate) of issue #27136. Also related is a fix for 
the latter in https://github.com/python/asyncio/pull/357. That fix is already 
in the CPython repo, but I guess it didn't make it into 3.5.2.

--

___
Python tracker 

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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-09-01 Thread Guido van Rossum

Guido van Rossum added the comment:

I'll try to get to this during the core dev sprint next week.

--

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-01 Thread Okko Willeboordse

New submission from Okko Willeboordse:

Running;
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit 
(Intel)] on win32

platform.win32_ver() returns;
('10', '10.0.10586', '', u'Multiprocessor Free')

--
components: Windows
files: leaked_objects.txt
messages: 274144
nosy: Okko.Willeboordse, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: platform.win32_ver() leaks in 2.7.12
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file44324/leaked_objects.txt

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-01 Thread STINNER Victor

STINNER Victor added the comment:

Hum, can you please elaborate the issue? What is leaked_objects.txt?

--
nosy: +haypo

___
Python tracker 

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



[issue27932] platform.win32_ver() leaks in 2.7.12

2016-09-01 Thread Okko Willeboordse

Okko Willeboordse added the comment:

I did a gc.get_objects() before and after platform.win32_ver() and printed
objects that were not present before calling platform.win32_ver().

If I run platform.win32_ver() in a loop I see the memory increasing.

On 1 September 2016 at 17:35, STINNER Victor  wrote:

>
> STINNER Victor added the comment:
>
> Hum, can you please elaborate the issue? What is leaked_objects.txt?
>
> --
> nosy: +haypo
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27931] Email parse IndexError <""@wiarcom.com>

2016-09-01 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> needs patch
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



[issue27925] Nicer interface to convert hashlib digests to int

2016-09-01 Thread R. David Murray

R. David Murray added the comment:

+1  I just wanted this recently.  Also note that going through hexdigest/int 
isn't particularly efficient, so an object-supported fast way to do this would 
be nice.

--
nosy: +r.david.murray
stage:  -> needs patch

___
Python tracker 

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



[issue27925] Nicer interface to convert hashlib digests to int

2016-09-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

"int(x)" looks nice to me as well.

--
nosy: +rhettinger

___
Python tracker 

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



[issue27926] ctypes is too slow to convert a Python list to a C array

2016-09-01 Thread Tom Cornebize

Tom Cornebize added the comment:

Thank you for these explanations.

I understand that we get a generic function to the cost of performances.

However, I think we should at least tell in the documentation that the 
constructor (ctypes.c_uint32 * len(t))(*t) is slow and that we can do much 
faster in some specific cases (e.g. an array of integers).

It would be even better to have some specific method(s) to do this in ctypes, 
instead of having to rely on an array.array just to build a ctypes array from a 
list. I am not familiar with CPython code, so I do not know if it would be 
easily feasible.

--

___
Python tracker 

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



[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Федор Лянгузов

New submission from Федор Лянгузов:

Greetings,

I've encountered strange behavior when using functools.lru_cache as a function 
(not as a decorator): it is at least miscounting misses, but probably not work 
at all, when the result of functools.lru_cache()(func) is saved in variable 
other than 'func'. Consider this snippet:

def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)

f = functools.lru_cache()(factorial)
f(20)
print(f.cache_info())

Output should be: CacheInfo(hits=0, misses=21, maxsize=128, currsize=21)
Instead it is: CacheInfo(hits=0, misses=1, maxsize=128, currsize=1)

I'm using Python 3.5.2 64bit on Windows 7 Professional 64bit.
I've written 3 unittests (using built-in module), which are attached as a file. 
I don't know how to comment them (conceptually, not syntactically), sorry.

Fedor

--
components: Library (Lib)
files: lru_cache_test.py
messages: 274149
nosy: Федор Лянгузов
priority: normal
severity: normal
status: open
title: functools.lru_cache seems to not work when renaming decorated functions
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file44325/lru_cache_test.py

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
Added file: http://bugs.python.org/file44326/Add-hashlib.scrypt.patch

___
Python tracker 

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



[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ncoghlan, rhettinger

___
Python tracker 

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



[issue27268] Incorrect error message on float('')

2016-09-01 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Setting this aside for Nofar to review.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This behaviour is expected. The factorial function calls itself, it doesn't 
call "f", but it is "f" which has the cache. So the call to f() goes through 
the cache, misses, and then calls factorial(), which has no cache.

In effect, what you have written is something like:

def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)

def f(n):
if n in f.cache:
return f.cache[n]
else:
x = f.cache[n] = factorial(n)
return x

f.cache = lru_cache()

--
nosy: +steven.daprano

___
Python tracker 

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



[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Steven D'Aprano

Steven D'Aprano added the comment:

In case it isn't obvious, my example is meant to be pseudo-code, not the exact 
implementation used.

--

___
Python tracker 

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



[issue27376] Add mock_import method to mock module

2016-09-01 Thread Israel Fruchter

Israel Fruchter added the comment:

Some real use cases is needed, like testing a code that behave differently on 
case of package availability.

I think something like patch for modules can be useful here, so you could have 
some control on what would be returned.

--
nosy: +fruch

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Elias Zamaria

Elias Zamaria added the comment:

I tried running `hg import --no-commit "$(xclip -o)"` and got the following 
result:

bash: xclip: command not found
abort: need at least one patch to import

I am using OS X 10.11.6 and Mercurial 3.8.2. I did a bit of quick research on 
xclip, but it looks like yet another unfamiliar tool, and I don't know exactly 
what it does or how it is supposed to help me.

I looked at your suggestions for my patch, and I am working on them.

I am planning to look at the tutorial, and to look for, and maybe fix, 
deprecated calls, but so far, I don't have a clear idea how long it will take 
me, or if it is realistic for one person to do it.

--

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Matthias Klose

Matthias Klose added the comment:

here's a patch, not yet including the ABI levels. I think we didn't need them 
for Linux, and maybe start for Android without using them. You can later 
introduce these if you have to.

--
keywords: +patch
Added file: http://bugs.python.org/file44327/android.diff

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Well, here's a list of cross compilers in Android NDK:

$ ls $ANDROID_NDK/toolchains/*/prebuilt/*/bin/*-gcc | xargs -i basename '{}'
 
aarch64-linux-android-gcc
arm-linux-androideabi-gcc
mips64el-linux-android-gcc
mipsel-linux-android-gcc
i686-linux-android-gcc
x86_64-linux-android-gcc

Does Python's platform triplet have the same meaning as GCC's --target? If so 
those names can be used.

By the way, +1 for not including the API level.

--

___
Python tracker 

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



[issue27919] Deprecate and remove extra_path distribution kwarg

2016-09-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 94710cbcac47 by Jason R. Coombs in branch 'default':
Issue #27919: Deprecate extra_path option in distutils.
https://hg.python.org/cpython/rev/94710cbcac47

--
nosy: +python-dev

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Aviv Palivoda

Aviv Palivoda added the comment:

What do you think about removing the isolation_level member from the 
pysqlite_Connection. It is only there to be for the 
pysqlite_connection_get_isolation_level and that could be easily calculated 
from the begin_statement.

--
Added file: http://bugs.python.org/file44328/issue27881_v5.patch

___
Python tracker 

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



[issue27919] Deprecate and remove extra_path distribution kwarg

2016-09-01 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Thanks, Nick. I've also observed that the package that was mentioned in the 
comments was "Numeric Python" and I confirmed that numpy is not currently using 
this option, so that's a positive indication that it's unneeded. I've also 
reached out to New Relic and invited them to comment here about the value they 
get (if any) from the option.

I've committed the deprecation warning as well. I'll plan to mirror this 
deprecation warning in Setuptools to get faster feedback. I'm open to reverting 
this change before the final release of Python 3.6 if it turns out to be a 
necessary feature.

As for your first suggestion - having Setuptools disable the behavior, I'm not 
sure Setuptools has the context to disable the behavior, because at the time 
pip is invoking the install command, Setuptools doesn't know whether pip is 
going to install the packages into platlib or elsewhere. At least, that's my 
presumption; I haven't dived into the code. I'm okay with not having a 
workaround if later versions of Setuptools and Python can disable the 
functionality without breaking anything but the most obscure packages.

--

___
Python tracker 

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



[issue901727] extra_path kwarg to setup() undocumented

2016-09-01 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Given the progression in issue27919, I suggest this documentation effort can be 
dropped, but feel free to revive the conversation if you disagree.

--
nosy: +jason.coombs
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not convinced that the zeros() method is needed. Zero-initialized sequences 
can be created via sequence repetition. Sorry, but arguments against this sound 
like "we made bad design decision in the past, let repeat it with new name" to 
me.

In any case if you want to write a code for different Python versions you 
should use sequence repetition.

Here is a patch that replaces all creations of zero-initialized bytes and 
bytearray objects in the stdlib and tests with repetitions. All tests (except 
test_bytes of course) are passed on Linux if disallow an int argument in bytes 
and bytearray constructors.

--
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file44329/no_bytes_from_int.patch

___
Python tracker 

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



[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-09-01 Thread Bernard Spil

Bernard Spil added the comment:

Hi Christian,

Great stuff!

Please can you replace the HAVE_RAND_EGD ifdefs into OPENSSL_NO_EGD checks? 
Then the RAND_egd checks in configure.ac can also be removed.

This was introduced by OpenSSL in 
https://github.com/openssl/openssl/commit/0423f812dc61f70c6ae6643191259ca9e5692c7f
 and is consistent with the naming in LibreSSL.

Cheers,

Bernard.

--

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I thought about this. This changes the behavior (for now isolation_level 
returns exactly the same object that was assigned to it) and slows down the 
getter. This can be added only on the default branch.

--

___
Python tracker 

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



[issue27888] Hide pip install/uninstall windows in setup

2016-09-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e065aec0e6fa by Steve Dower in branch '2.7':
Issue #27888: Prevent Windows installer from displaying console windows and 
failing when pip cannot be installed/uninstalled.
https://hg.python.org/cpython/rev/e065aec0e6fa

--
nosy: +python-dev

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Ethan Furman

Ethan Furman added the comment:

Two things to note:

- there is no need to change the stdlib to use anything besides the default
  constructor -- it's not going away, and it already works (my apologies if
  I misunderstood)

- PEP 467 has not yet been accepted (unless I missed that?)

However, thank you for getting some code written!

--

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Matthias Klose

Matthias Klose added the comment:

yes, it should follow the gnu triplets. I updated these, and added some for 
mips. However I can't check if the mips ones will do what they are supposed to 
do. Please could you check these if you have cross compilers available?

--
Added file: http://bugs.python.org/file44330/android.diff

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Matthias Klose

Changes by Matthias Klose :


Removed file: http://bugs.python.org/file44327/android.diff

___
Python tracker 

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



[issue27933] functools.lru_cache seems to not work when renaming decorated functions

2016-09-01 Thread Федор Лянгузов

Федор Лянгузов added the comment:

Ok, thank you very much, i've got a little smarter today. Now i understand, 
that user_function (in this case factorial) is not modified by decorator, it is 
my job to change factorial to wrapper by assignment. Enlightning.

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Aviv Palivoda

Aviv Palivoda added the comment:

The only change I see that can happen is that we return upper case isolation 
level when the user used a lower case. I think that it is worth to slow down 
the getter for the code simplification.

--

___
Python tracker 

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



[issue16379] SQLite error code not exposed to python

2016-09-01 Thread Aviv Palivoda

Changes by Aviv Palivoda :


Added file: http://bugs.python.org/file44331/16379-3.patch

___
Python tracker 

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



[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-09-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 546b1f70cbed by Serhiy Storchaka in branch '3.5':
Issue #27881: Fixed possible bugs when setting 
sqlite3.Connection.isolation_level.
https://hg.python.org/cpython/rev/546b1f70cbed

New changeset 96e05f1af2c8 by Serhiy Storchaka in branch 'default':
Issue #27881: Fixed possible bugs when setting 
sqlite3.Connection.isolation_level.
https://hg.python.org/cpython/rev/96e05f1af2c8

--
nosy: +python-dev

___
Python tracker 

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



[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-01 Thread Elias Zamaria

Elias Zamaria added the comment:

Here is a patch with all of my latest changes, including the changes that 
Martin suggested for the tests.

--
Added file: http://bugs.python.org/file44332/pep467_attempt2.patch

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

CPython builds fine for MIPS with this patch. For MIPS64, apparently Android 
NDK is broken - it can't even compile a simple C file.

--

___
Python tracker 

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




[issue22881] show median in benchmark results

2016-09-01 Thread Stefan Behnel

Changes by Stefan Behnel :


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



[issue27921] f-strings: do not allow backslashes

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> -result.append(f'  [Previous line repeated {count-3} more 
> times]\n')
> +result.append(f'  [Previous line repeated {count-3} more 
> times]''\n')

This looks a little ugly.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27925] Nicer interface to convert hashlib digests to int

2016-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is another way:

int.from_bytes(x.digest(), 'big')

Note that converting to int you lose the length of the digest. md5 digest 
d41d8cd98f00b204e9800998ecf8427e and sha1 digest 
d41d8cd98f00b204e9800998ecf8427e are converted to the same int. This 
can add a vulnerability.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

OK found some wrong usages in my build script. Now MIPS64 builds fine, and 
PLATFORM_TRIPLET is detected as intended. I didn't test the build on actual 
devices, as I don't have a MIPS or MIPS64 device.

--

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-01 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Rather than PyArg_ParseTupleAndKeywords can you have it use argument clinic?

Also, how about making all arguments other than password be keyword only so
that code calling the function is more clear.  Otherwise it's a bit of
positional argument soup with a lot of integers and potential to invert
password and salt without realizing it.

--

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Matthias Klose

Matthias Klose added the comment:

I think that's good for now. The compiler checks maybe can be later adjusted.

--

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a931fdc4c4c4 by doko in branch 'default':
- Issue #27917: Set platform triplets for Android builds.
https://hg.python.org/cpython/rev/a931fdc4c4c4

--
nosy: +python-dev

___
Python tracker 

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



[issue27917] Choose platform triplets for android builds

2016-09-01 Thread Matthias Klose

Matthias Klose added the comment:

checked in.

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



[issue27934] json float encoding incorrect for dbus.Double

2016-09-01 Thread Eddie James

New submission from Eddie James:

JSON does not correctly encode dbus.Double types, even though all other dbus 
types are handled fine. I end up with output like this (0.25 is the floating 
point value): dbus.Double(0.25, variant_level=1)

Found that the encoding uses repr() for float objects but uses str() for 
integer objects. I propose a change to use str() for float objects as well. 
This could be ported back to 2.7 as well

--
components: Library (Lib)
files: json-float-str-default.patch
keywords: patch
messages: 274179
nosy: eajames
priority: normal
severity: normal
status: open
title: json float encoding incorrect for dbus.Double
type: behavior
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file44333/json-float-str-default.patch

___
Python tracker 

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



[issue27934] json float encoding incorrect for dbus.Double

2016-09-01 Thread Eddie James

Changes by Eddie James :


Added file: http://bugs.python.org/file44334/json-float-str-2.7.patch

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-01 Thread Christian Heimes

Christian Heimes added the comment:

Argument is easy.

Your second request is a very good idea but also harder to implement. Neither 
PyArg_Parse nor clinic have a way to declare arguments that required and 
keyword only but have no default value. I have a workaround but it ain't 
beautiful.

--

___
Python tracker 

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



[issue27928] Add hashlib.scrypt

2016-09-01 Thread Gregory P. Smith

Gregory P. Smith added the comment:

If clinic doesn't support required keyword only args then don't worry about it 
for now. :)

--

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-09-01 Thread Steve Newcomb

Steve Newcomb added the comment:

Oops.  The correct url is sftp://coolheads.com/files/py-re-perform-276v2712/

On 09/01/2016 04:52 PM, Steve Newcomb wrote:
> On 08/30/2016 12:46 PM, Raymond Hettinger wrote:
>> Raymond Hettinger added the comment:
>>
>> It would be helpful if you ... make a small set of regular 
>> expressions that demonstrate the performance regression.
>>
> Done.  Attachments:
>
> test.py : Code that exercises re.sub() and outputs a profile report.
>
> test_output_2.7.6.txt : Output of test.py under Python 2.7.6.
>
> test_output_2.7.12.txt : Output of test.py under Python 2.7.12.
>
> p17.188.htm -- test data: public information from the U.S. Internal 
> Revenue Service.
>
> Equivalent hardware was used in both cases.
>
> The outputs show that 2.7.12's re.sub() takes 1.2 times as long as 
> 2.7.6's.  It's a significant difference, but...
>
> ...it was not the dramatic degradation I expected to find in this 
> exercise.  Therefore I attempted to tease what I was looking for out 
> of the profile stats I already uploaded to this site, made from actual 
> production runs.  My attempts are all found in an hg repository that 
> can be downloaded from 
> sftp://s...@coolheads.com//files/py-re-perform-276-2712 using password 
> bysIe20H .
>
> I do not feel the latter work took me where I wanted to go, and I 
> think the reason is that, at least for purposes of our application, 
> Python 2.7.12 has been so extensively refactored since Python 2.7.6.  
> So it's an apples-to-oranges comparison, apparently.  Still, the 
> performance difference for re.sub() is quite dramatic , and re.sub() 
> is the only comparable function whose performance dramatically 
> worsened: in our application, 2.7.12's re.sub() takes 3.04 times as 
> long as 2.7.6's.
>
> The good news, of course, is that by and large the performance of the 
> other *comparable* functions largely improved, often dramatically.  
> But at least in our application, it doesn't come close to making up 
> for the degradation in re.sub().
>
> My by-the-gut bottom line: somebody who really knows the re module 
> should take a deep look at re.sub().  Why would re.sub(), unlike all 
> others, take so much longer to run, while *every* other function in 
> the re module get (often much) faster?  It feels like there's a bug 
> somewhere in re.sub().
>
> Steve Newcomb
>

--

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-09-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo
type:  -> performance

___
Python tracker 

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



[issue22458] Add fractions benchmark

2016-09-01 Thread Stefan Krah

Stefan Krah added the comment:

I think string conversion should be part of this benchmark, or it should be 
renamed to fraction-arith or something.

The formatting function can be a significant bottleneck, and if you use 
Fractions for financial calculations the result will still need to be printed 
in decimal floating point form.


That said, is the purpose of this benchmark to show that fractions are slow and 
generate interest in changing the situation?

--
nosy: +skrah

___
Python tracker 

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



  1   2   >