[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Anish Shah

Anish Shah added the comment:

I would like to work on this, if it is okay with Marco?
I look at the history of parsetok.c file and I think I can solve this issue. 

Also, I have a doubt - PEP 492 says that "async and await names will be softly 
deprecated in CPython 3.5 and 3.6".
What exactly does "softly deprecate" mean? is it just same as throwing a 
warning?

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Hi Jesse, could you please update your patch with a detailed comment 
summarizing your research?  Also it would be great if you can provide a 
separate patch for 2.7.

--
nosy: +yselivanov

___
Python tracker 

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



[issue26268] Update python.org installers to use OpenSSL 1.0.2f

2016-02-02 Thread Zachary Ware

New submission from Zachary Ware:

http://openssl.org/news/secadv/20160128.txt

--
components: Build, Macintosh, Windows
messages: 259422
nosy: ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Update python.org installers to use OpenSSL 1.0.2f
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



[issue26079] Build with Visual Studio 2015 using PlatformToolset=v120

2016-02-02 Thread Zachary Ware

Zachary Ware added the comment:

Perhaps the ideal approach here would be to pass TMP_DIR and OUT_DIR into the 
Tcl/Tk builds, so we can tell them where to put stuff.  However, that would 
require major surgery to Tix's makefile to get it to build.  I'd be +1 on doing 
so (since we're pretty much the de-facto maintainers of Tix at this point, as 
far as I can tell), but am not enthusiastic about actually doing it.  I'd be 
much more enthusiastic about deprecating Tix.

Steve, if the patch as given is good enough for you, I'm fine with applying it.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Victor,

Thanks for the initial review.  I'll work on the patch sometime later next 
week.  

As for test_vicious_descriptor_nonsense -- yeah, I saw that too.  I know what's 
going on there and I know how to fix that.  FWIW that test tests a very 
counter-intuitive and quirky CPython implementation detail.

--

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2016-02-02 Thread Mark Dickinson

Mark Dickinson added the comment:

Not really the same, since that issue was more about fast division. But it's 
the same spirit. It looks like I was more enthusiastic back then; now I'm older 
and grumpier. It's great to have this stuff, but I don't think it belongs in 
core Python: I'd much rather that the core Python integer implementation remain 
simple, portable and low-maintenance, and work well for the domain it's 
intended for: small-to-medium size integers. Cryptographic-size integers with a 
few hundred to a few thousand digits should be fine; number-theoretic work 
requiring hundreds of thousands of digits should use gmpy2 or something similar.

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue24780] unittest assertEqual difference output foiled by newlines

2016-02-02 Thread Anish Shah

Anish Shah added the comment:

The problem is in `difflib.ndiff` function. When the string does not have a 
trailing newline, we get an unreadable output.
After applying my patch, the following is the output of test2.py (submitted by 
Elena.Oat).




==
FAIL: test_notrailingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 8, in test_notrailingnewline_0
self.assertEqual("abcDefehiJkl", "abcdefGhijkl")
AssertionError: 'abcDefehiJkl' != 'abcdefGhijkl'
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_notrailingnewline_1 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 14, in test_notrailingnewline_1
self.assertEqual("a\nbcdf", "a\nbddf")
AssertionError: 'a\nbcdf' != 'a\nbddf'
  a
- bcdf
?  ^
+ bddf
?  ^


==
FAIL: test_notrailingnewline_2 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 18, in test_notrailingnewline_2
self.assertEqual("a\nbcdf", "a\nbddg")
AssertionError: 'a\nbcdf' != 'a\nbddg'
  a
- bcdf
+ bddg


==
FAIL: test_starting_and_ending_newline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 12, in test_starting_and_ending_newline_0
self.assertEqual("\nabcDefehiJkl\n", "\nabcdefGhijkl\n")
AssertionError: '\nabcDefehiJkl\n' != '\nabcdefGhijkl\n'
  
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_startingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 10, in test_startingnewline_0
self.assertEqual("\nabcDefehiJkl", "\nabcdefGhijkl")
AssertionError: '\nabcDefehiJkl' != '\nabcdefGhijkl'
  
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_trailingnewline_0 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 6, in test_trailingnewline_0
self.assertEqual("abcDefehiJkl\n", "abcdefGhijkl\n")
AssertionError: 'abcDefehiJkl\n' != 'abcdefGhijkl\n'
- abcDefehiJkl
?^  ^  ^
+ abcdefGhijkl
?^  ^  ^


==
FAIL: test_trailingnewline_1 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 16, in test_trailingnewline_1
self.assertEqual("a\nbcdf\n", "a\nbddf\n")
AssertionError: 'a\nbcdf\n' != 'a\nbddf\n'
  a
- bcdf
?  ^
+ bddf
?  ^


==
FAIL: test_trailingnewline_2 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 20, in test_trailingnewline_2
self.assertEqual("a\nbcdf\n", "a\nbddg\n")
AssertionError: 'a\nbcdf\n' != 'a\nbddg\n'
  a
- bcdf
+ bddg


--
Ran 8 tests in 0.004s

FAILED (failures=8)

--
keywords: +patch
Added file: http://bugs.python.org/file41782/issue24780.patch

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread SilentGhost

SilentGhost added the comment:

Well, you seem to suggest we add something to documentation to accommodate 
people who don't read it in the first place.

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Ok no problem, it was just a suggestion.

In asyncio, we try to document behaviour change but asyncio is different.
Major functions are still modified, asyncio API is still provisional, but
people rely on tehe exact API.

--

___
Python tracker 

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



[issue25945] Type confusion in partial_setstate and partial_call leads to memory corruption

2016-02-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Brett Cannon

Brett Cannon added the comment:

I'm not quite sure what you mean by "do not know how to check if the 
deprecation warning are enabled". Do you mean how do you make sure you don't 
emit a DeprecationWarning if someone hasn't turned warnings on? If that's the 
case then if you look at some example code and read 
https://docs.python.org/3/c-api/exceptions.html#issuing-warnings you will 
notice that when you call the warning-related functions, all you have to do is 
check if the return value is < 0, then return like there is an exception 
raised. Otherwise the warnings module handles whether something will be shown.

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should avoid calling malloc() each time

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> Aside of the performance, my colleague also told me that heavy pressure on 
> the memory allocator can slowly create framgmentation of the heap memory, 
> which is true.

Right, but there are so many other things which contribute to the memory 
fragmentation.. I doubt that optimizing epoll will make any detectable 
improvement on that side.

All in all, I think I'm with Serhiy -- since the performance benefits are 
unclear, we shouldn't complicate the code.

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Any change that increases the cache or branch predictor footprint of the 
evaluation loop may make the interpreter slower, even if the change doesn't 
seem related to a particular benchmark. That may be the reason here.

--

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread Timo Furrer

Changes by Timo Furrer :


--
nosy: +tuxtimo

___
Python tracker 

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



[issue26269] zipfile should call lstat instead of stat if available

2016-02-02 Thread Patrik Dufresne

New submission from Patrik Dufresne:

To mirror the behavior in tarfile, zipfile should make a call to stat instead 
of lstat if available.

Failure to do so resolved into an "IOError No such file or directory" if the 
filename is a symbolik link being broken. As such, the creation of the archive 
fail.

--
components: Library (Lib)
messages: 259436
nosy: Patrik Dufresne
priority: normal
severity: normal
status: open
title: zipfile should call lstat instead of stat if available
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25774] [benchmarks] Adjust to allow uploading benchmark data to codespeed

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



[issue26270] Support for read()/write()/select() on asyncio

2016-02-02 Thread Paulo Costa

New submission from Paulo Costa:

I want to read from file descriptors from async coroutines.

I currently use `loop.add_reader(fd, callback)` and `loop.remove_reader(fd)`

It works, but IMO using callbacks feels completely alien in the middle of a 
coroutine.

I suggest adding new APIs to handle this. e.g.:
- asyncio.select(fd, mode)
- asyncio.read(fd, num)
- asyncio.write(fd, str)

(It would be nice to support all kinds of IO operations, but these are 
certainly the most important)

Using the current APIs, the async implementation of read() looks like this:

async def async_read(fd. n):
loop = asyncio.get_event_loop()
future = asyncio.Future()

def ready():
future.set_result(os.read(fd, n))
loop.remove_reader(fd)

loop.add_reader(fd, ready)
return future

--
components: asyncio
messages: 259438
nosy: Paulo Costa, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Support for read()/write()/select() on asyncio
type: enhancement

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

(Crap. I sent an incomplete message, sorry about that.)

> Hum, it looks like jemalloc uses *more* memory than libc memory allocators. I 
> don't know if it's a known 

I don't know if it's a known issue/property of jemalloc.

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Brett Cannon

Brett Cannon added the comment:

I don't know what "softly deprecate" means. Hopefully someone involved with the 
PEP can answer that question.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

> I don't know what "softly deprecate" means. Hopefully someone involved with 
> the PEP can answer that question.

I actually thought about emitting DeprecationWarnings in 3.6 for async/await 
NAME tokens.  I think it's a reasonable thing to do to prepare for 3.7, where 
they will become proper keywords.

--

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread Andrew Barnert

New submission from Andrew Barnert:

Most real-world code that uses the UUID module wants either the standard format 
'{12345678-1234-5678-1234-567812345678}', or the same thing without the braces.

There are a number of different documented accessors, but none of them give you 
either of these. The simplest way I can think of to guarantee the standard 
format from what's documented is '{%08x-%04x-%04x-%02x%02x-%12x}' % u.fields.

It might be nice to add accessors for standard form and braceless standard 
form, but that probably isn't necessary--as long as there's documentation 
saying that __str__ returns the braceless standard form.

The example code does say that, but I don't think people can trust that a 
comment in an example is binding documentation--plus, plenty of people don't 
read the examples looking for more information about things that aren't 
documented. And I've seen people come up with buggy versions of the format 
string that miss leading zeros, or horrible things like repr(u)[6:42].

--
assignee: docs@python
components: Documentation
messages: 259414
nosy: abarnert, docs@python
priority: normal
severity: normal
status: open
title: UUID docs should say how to get "standard form"
type: enhancement

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread Andrew Barnert

Andrew Barnert added the comment:

> The docs seem to clearly show a str(x) as the way to produce the desired form 
> (without braces). https://docs.python.org/3/library/uuid.html#example

Please read the last paragraph of the original message.

--

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread SilentGhost

SilentGhost added the comment:

The docs seem to clearly show a str(x) as the way to produce the desired form 
(without braces). https://docs.python.org/3/library/uuid.html#example

--
nosy: +SilentGhost

___
Python tracker 

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



[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2016-02-02 Thread Ent

Changes by Ent :


--
status: open -> languishing

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2016-02-02 Thread Stefan Krah

Stefan Krah added the comment:

Jurjen, this is very nice! -- Like Mark, I'm not sure if this should be in 
CPython.


Decimal (Python >= 3.3) has sneaked in a couple of fast bignum
algorithms, so calculating and converting the latest Mersenne
prime takes a couple of seconds:

from decimal import *

c = getcontext()
c.prec = MAX_PREC
c.Emax = MAX_EMAX
c.Emin = MIN_EMIN

x = Decimal(2)**74207281 - 1
s = str(x)
assert s[:12] == "300376418084"
assert s[-12:] == "391086436351"

--
nosy: +skrah

___
Python tracker 

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



[issue26261] NamedTemporaryFile documentation is vague about the `name` attribute

2016-02-02 Thread Gedai Tamás Bence

Gedai Tamás Bence added the comment:

Antti, would you like to provide a patch? If you don't want to work on it, I 
can give it a try.

--
nosy: +beng94

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2016-02-02 Thread Joseph Hackman

Changes by Joseph Hackman :


--
nosy: +Joseph.Hackman

___
Python tracker 

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



[issue26079] Build with Visual Studio 2015 using PlatformToolset=v120

2016-02-02 Thread Steve Dower

Steve Dower added the comment:

Go ahead. Feel free to add toolsets to cover ICC if you need them.

At one point I was passing through those directories for the build and it was 
not really trivial. A few too many places where it needed to be handled, but 
with patches against Tix it's probably disable.

--

___
Python tracker 

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



[issue26188] Provide more helpful error message when `await` is called inside non-`async` method

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

I’m not that familiar with the parser either. Maybe I remember a flag or 
something saying “we are inside an async def function”, which changes “await” 
from a user identifier into a reserved keyword. But I can’t imagine how that 
flag will help much with this proposal. The problem I think is “await” is never 
treated as a reserved keyword when the flag is not set.

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-02 Thread Zach Byrne

Zach Byrne added the comment:

I took another look at this, and tried applying it to 3.6 and running the 
latest benchmarks. It applied cleanly, and the benchmark results were similar, 
this time unpack_sequence and spectral_norm were slower. Spectral norm makes 
sense, it's doing lots of FP addition. The unpack_sequence instruction looks 
like it already has optimizations for unpacking lists and tuples onto the 
stack, and running dis on the test showed that it's completely dominated calls 
to unpack_sequence, load_fast, and store_fast so I still don't know what's 
going on there.

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

unpack_sequence contains 400 lines of this: "a, b, c, d, e, f, g, h, i, j = 
to_unpack".  This code doesn't even touch BINARY_SUBSCR or BINARY_ADD.

Zach, could you please run your benchmarks in rigorous mode (perf.py -r)?  I'd 
also suggest to experiment with putting the baseline cpython as a first arg and 
as a second -- maybe your machine runs the second interpreter slightly faster.

--

___
Python tracker 

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



[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Anders Rundgren

Anders Rundgren added the comment:

In ES6/V8-compatible implementations which include "node.js", Chrome, Firefox, 
Safari and (of course) my Java reference implementation you can take a 
cryptographic hash of a JSON object with a predictable result.

That is, this request is in no way limited to JCS.

Other solutions to this problem has been to create something like XML's 
canonicalization which is much more complex.

The JSON RFC is still valid, it just isn't very useful for people who are 
interested in security solutions.  The predictable property order introduced in 
ES6 makes a huge difference!  Now it is just the number thing left...

The other alternative is dressing your JSON objects in Base64 to maintain a 
predictable signature like in IETF's JOSE.  I doubt that this is going to be 
mainstream except for OpenID/OAuth which JOSE stems from.

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should avoid calling malloc() each time

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: "I'm not sure that it is worth to apply this optimization. 
The patch adds half a hundred lines of complex code for only 80 ns benefit. On 
my computer just incrementing an integer takes 100 ns."

Yury Selivanov: "(...) Right, but there are so many other things which 
contribute to the memory fragmentation.. I doubt that optimizing epoll will 
make any detectable improvement on that side."

To be honest, I expected better speedup before I ran the benchmark. That's why 
I repeat that any performance patch must come with a concrete benchmark showing 
a non-negligible speedup ;-)

I reject my optimization since it doesn't make the code faster.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2016-02-02 Thread Łukasz Langa

Łukasz Langa added the comment:

If you're affected, there's a workaround. Use the following script to rewrite 
paths in your .zip file to be zipimport-compatible:

https://gist.github.com/ambv/909d38bdac4f3e719b7c

It preserves the preamble and all file metadata.

A little context why this is useful: for archives that are effectively "static" 
environments with entire dependency trees in them, this bug causes both a big 
slowdown in startup time (counted in seconds), as well as tens of megabytes of 
.pyc created on the fly. Examples include zipapp-style .pyz, Twitter's .pex or 
Facebook's .par. 

So while we're waiting for a new zipimport implementation, the workaround 
listed above should unblock people uzing this form of Python package 
distribution.

--
nosy: +lukasz.langa

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread Georg Brandl

Georg Brandl added the comment:

Andrew is right, this should be documented "properly".

--
nosy: +georg.brandl

___
Python tracker 

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



[issue25774] [benchmarks] Adjust to allow uploading benchmark data to codespeed

2016-02-02 Thread Brett Cannon

Brett Cannon added the comment:

Patch LGTM, although I'm not sure why the upload script needs to be in the 
benchmark repo itself.

--
assignee: brett.cannon -> zach.ware

___
Python tracker 

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



[issue26267] UUID docs should say how to get "standard form"

2016-02-02 Thread Andrew Barnert

Andrew Barnert added the comment:

No, I suggest we add something for users who don't think that a comment in an 
example is the place to look for documentation, but do think that actual 
documentation of a class or method is.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Yury: "Please use -r flag for perf.py"

Oh, I didn't know this flag. Sure, I can do that.

New benchmark using --rigorous to measure the performance of attached 
pymem.patch.

It always seems faster, newer slower.

Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
Min: 6.772531 -> 6.686245: 1.01x faster
Avg: 6.875264 -> 6.726859: 1.02x faster
Significant (t=3.44)
Stddev: 0.09026 -> 0.03398: 2.6560x smaller

### django_v3 ###
Min: 0.562797 -> 0.552539: 1.02x faster
Avg: 0.591345 -> 0.557561: 1.06x faster
Significant (t=4.17)
Stddev: 0.07689 -> 0.02581: 2.9794x smaller

### fastpickle ###
Min: 0.464270 -> 0.437667: 1.06x faster
Avg: 0.467195 -> 0.442298: 1.06x faster
Significant (t=10.59)
Stddev: 0.01156 -> 0.02046: 1.7693x larger

### fastunpickle ###
Min: 0.548834 -> 0.526554: 1.04x faster
Avg: 0.554601 -> 0.539456: 1.03x faster
Significant (t=4.67)
Stddev: 0.01137 -> 0.03040: 2.6734x larger

### json_dump_v2 ###
Min: 2.723152 -> 2.603108: 1.05x faster
Avg: 2.749255 -> 2.693655: 1.02x faster
Significant (t=2.89)
Stddev: 0.03016 -> 0.18988: 6.2963x larger

### regex_v8 ###
Min: 0.044256 -> 0.042201: 1.05x faster
Avg: 0.044733 -> 0.043134: 1.04x faster
Significant (t=4.55)
Stddev: 0.00201 -> 0.00288: 1.4309x larger

### tornado_http ###
Min: 0.253405 -> 0.247401: 1.02x faster
Avg: 0.256274 -> 0.250380: 1.02x faster
Significant (t=17.48)
Stddev: 0.00285 -> 0.00382: 1.3430x larger

The following not significant results are hidden, use -v to show them:
chameleon_v2, json_load, nbody.

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-02 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Second patch with a comment about how we know Mac OS 10.5+'s getaddrinfo is 
thread-safe. I'll wait for this to be merged before submitting another for 
Python 2.7.

--
Added file: 
http://bugs.python.org/file41784/25924-getaddrinfo-is-thread-safe-2.patch

___
Python tracker 

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



[issue26271] freeze.py makefile uses the wrong flags variables

2016-02-02 Thread Daniel Shaulov

New submission from Daniel Shaulov:

Tools/Freeze/makemakefile.py uses CFLAGS, LDFLAGS and CPPFLAGS instead of the 
PY_ prefixed versions. This makes flags passed to ./configure ineffective.

The patch makes the trivial fix of adding PY_ when needed.

--
components: Build
files: pyflags.patch
keywords: patch
messages: 259444
nosy: Daniel Shaulov
priority: normal
severity: normal
status: open
title: freeze.py makefile uses the wrong flags variables
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41785/pyflags.patch

___
Python tracker 

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



[issue26098] PEP 510: Specialize functions with guards

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 6: I inlined PyFunction_GetSpecializedCode() into fast_function() 
of Python/ceval.c. It reduces *a little bit* the overhead of the patch when 
specialization is not used, but it also avoids to expose this function. I don't 
think that it's worth to expose PyFunction_GetSpecializedCode(): it was only 
used in ceval.c. For example, I don't use it for unit tests. I prefer to write 
tests calling the function and checking the results (see test_pep510.py).

*Raw* overhead of specialized-6.patch on calling "def f(): pass": 1.7 
nanoseconds. I computed the overhead using timeit:

./python -m timeit -s 'def f(): pass' 'f()'

* Original: 71.7 ns
* specialize-6.patch: 73.4 ns (+1.7 ns, +2.4%)
* specialize-5.patch: 74.3 ns (+2.6 ns, +3.6%)

I will run perf.py to see the overhead on a macro benchmark.

--
Added file: http://bugs.python.org/file41786/specialize-6.patch

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

> Test with jemalloc using the shell script "python.jemalloc":
> ---
> #!/bin/sh
> LD_PRELOAD=/usr/lib64/libjemalloc.so /home/haypo/prog/python/default/python 
> "$@"
> ---

"perf.py -m" doesn't work with such bash script, but it works using exec:
---
#!/bin/sh
LD_PRELOAD=/usr/lib64/libjemalloc.so exec 
/home/haypo/prog/python/default/python "$@"
---

> Memory consumption:
python3 -u perf.py -m ../default/python ../default/python.jemalloc


Hum, it looks like jemalloc uses *more* memory than libc memory allocators. I 
don't know if it's a known 


Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
Mem max: 43088.000 -> 43776.000: 1.0160x larger

### chameleon_v2 ###
Mem max: 367028.000 -> 626324.000: 1.7065x larger

### django_v3 ###
Mem max: 23824.000 -> 25120.000: 1.0544x larger

### fastpickle ###
Mem max: 8696.000 -> 9712.000: 1.1168x larger

### fastunpickle ###
Mem max: 8708.000 -> 9696.000: 1.1135x larger

### json_dump_v2 ###
Mem max: 10488.000 -> 11556.000: 1.1018x larger

### json_load ###
Mem max: 8444.000 -> 9396.000: 1.1127x larger

### nbody ###
Mem max: 7392.000 -> 8416.000: 1.1385x larger

### regex_v8 ###
Mem max: 12760.000 -> 13576.000: 1.0639x larger

### tornado_http ###
Mem max: 28196.000 -> 29920.000: 1.0611x larger

--

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-02 Thread Yury Selivanov

Yury Selivanov added the comment:

I'm assigning this patch to myself to commit it in 3.6 later.

--
assignee:  -> yselivanov
components: +Interpreter Core
stage:  -> patch review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue26209] TypeError in smtpd module with string arguments

2016-02-02 Thread Lorenzo Ancora

Lorenzo Ancora added the comment:

(msg259229) Terry J. Reedy i Suggest that a standard and globally accepted 
scheme to manage IPv4 addresses is:

  "Host:PortNumber" --> (host, PortNumber)
  "Host"--> (host, DefaultPortNumber)
  "IP:PortNumber" --> (host, PortNumber)
  "IP"--> (host, DefaultPortNumber)

...where DefaultPortNumber is protocol and system dependent (IANA standard, see 
the SMTP line in: 
http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml).

A simple research reveals that all versions of the module are (sadly) poorly 
documented, but the module is an interface to a very important protocol that 
indeed must be offered by the standard library.
The only little suggestion in the documentation of the module is: 
https://docs.python.org/3.6/library/socket.html#socket.socket.accept
...from a one-word link in: 
https://docs.python.org/3.6/library/smtpd.html#smtpd.SMTPChannel.addr
Which has only an indirect relation with the object itself.

Many users may not recognize the cause of the error if the documentation 
doesn't explicitate the information to correctly initialize the core objects of 
the module.
I also Suggest that at least the object should return an helpful error in newer 
versions of Python.

Thank you for your efforts guys. :-)

--
components: +Library (Lib)
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue26265] errors during static build on OSX

2016-02-02 Thread David Beck

David Beck added the comment:

Thanks, I’ve done that (a couple of times). I posted this not so much because 
of my problems with PyQt, but because the output of the Python build when I 
used those two options asked me to report this as a bug.

cheers,

David

> On Feb 2, 2016, at 9:27 AM, Ned Deily  wrote:
> 
> 
> Ned Deily added the comment:
> 
> I can't speak to issues with PyQt5 since that is not part of the Python 
> standard library but you shouldn't need additional configure options just to 
> build Python itself. Make sure you have installed the latest version of Xcode 
> for your release via the App Store app update pane and that you have 
> installed the corresponding latest version of the Xcode Command Line Tools 
> with:
> 
> xcode-select --install
> 
> Then start with a clean build directory.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16764] Make zlib accept keyword-arguments

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

See Issue 8706 discussing adding keyword support to library functions in 
general.

Functions the first patch affects:

* zlib.compress(data, level=...): still relevant; see Issue 26243
* compressobj(memlevel=...): fixed in documentation in revision fdb5d84f9948 
instead
* compressobj.compress(data): still relevant, but little benefit IMO
* compressobj.flush(mode=...): still relevant; little benefit
* zlib.decompress(data, wbits=..., bufsize=...): still relevant
* decompressobj.decompress(data, max_length=...): still relevant
* decompressobj.flush(length=...): still relevant, but not worthwhile IMO; see 
Issue 23200

Most of the pep8 patch looks like pointless noise, and a lot of the remaining 
bits have probably already been addressed.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

Have you tried running the test suite? I suspect there are tests that will 
fail. E.g. the tests in revision 2771a0ac806b would need to be changed over to 
DeprecationWarning as well.

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Anders Rundgren

Anders Rundgren added the comment:

An easier fix than mucking around in the pretty complex number serializer code 
would be adding an "ES6Format" option to the "json.dump*" methods which could 
use the supplied conversion code as is.

For JSON parsing in an ES6-compatible way you must anyway use an "OrderedDict" 
hook option to get the right (=original) property order.

--

___
Python tracker 

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



[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

I still cannot reproduce any problem. When using set_tunnel(), this is the 
request sent to the proxy:

b'CONNECT 128.6.42.21:8088 HTTP/1.0\r\n'
b'\r\n'

This is the SNI and request sent through the proxy to the end server:

>>> wrapped = context.wrap_socket(conn, server_side=True)
Requested server name '128.6.42.21'
>>> for line in wrapped.recv(3000).splitlines(keepends=True): 
>>> print(repr(line))... 
b'GET /xx/ HTTP/1.1\r\n'
b'Host: 128.6.42.21:8088\r\n'
b'Accept-Encoding: identity\r\n'
b'\r\n'

Can you please provide some code that demonstrates your problem.

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

I'm concerned by the test_descr failure.

==
ERROR: test_vicious_descriptor_nonsense 
(test.test_descr.ClassPropertiesAndMethods)
--
Traceback (most recent call last):
  File "/home/haypo/prog/python/default/Lib/test/test_descr.py", line 4176, in 
test_vicious_descriptor_nonsense
self.assertEqual(c.attr, 1)
AttributeError: 'C' object has no attribute 'attr'

--


==
FAIL: test_objecttypes (test.test_sys.SizeofTest)
--
Traceback (most recent call last):
  File "/home/haypo/prog/python/default/Lib/test/test_sys.py", line 895, in 
test_objecttypes
check(get_cell().__code__, size('5i9Pi3P'))
  File "/home/haypo/prog/python/default/Lib/test/support/__init__.py", line 
1475, in check_sizeof
test.assertEqual(result, size, msg)
AssertionError: 192 != 160 : wrong size for : got 192, expected 
160

--


==
FAIL: test_pycfunction (test.test_gdb.PyBtTests)
Verify that "py-bt" displays invocations of PyCFunction instances
--
Traceback (most recent call last):
  File "/home/haypo/prog/python/default/Lib/test/test_gdb.py", line 857, in 
test_pycfunction
self.assertIn('#0 , args=(1,)) at ./Modules/timemodule.c:338\n338\tif 
(!parse_time_t_args(args, "|O:gmtime", ))\n#1 \n#4 Frame 0x77fb27b8, for file 
, line 3, in foo ()\n#7 Frame 0x77f423f8, for file , line 
5, in bar ()\n#10 Frame 0x77fb25e0, for file , line 6, in  
()\n'

--

--

___
Python tracker 

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-02-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review

___
Python tracker 

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



[issue26265] errors during static build on OSX

2016-02-02 Thread David Beck

New submission from David Beck:

I'm working on an iMac (27" mid 2010) running OSX 10.11.3.

I'm trying to build Python3.5.0 for use with pyqtdeploy. 

If I build python without specifying "--enable-universalsdk", I get multiple 
warnings "clang: warning: no such sysroot directory: 
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'"
 on trying to build PyQt5. 

If I specify "--enable-universalsdk" while building Python, I get an error "ld: 
symbol(s) not found for architecture i386" from the 'make' command. 

If I then specify "--with-universal-archs=64-bit", I get the output below, 
which includes a number of requests to report this here.

David$ /Users/David/OpenSource/Python-3.5.0/configure --prefix 
/Users/David/OpenSource/PyQtDeploy/python --enable-universalsdk 
--with-universal-archs=64-bit
checking build system type... x86_64-apple-darwin15.3.0
checking host system type... x86_64-apple-darwin15.3.0
checking for --enable-universalsdk... 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
checking for --with-universal-archs... 64-bit
checking MACHDEP... darwin
checking for --without-gcc... no
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for --with-cxx-main=... no
checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.
  
checking for the platform triplet based on compiler characteristics... darwin
checking for -Wl,--no-as-needed... no
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for --with-suffix... 
checking for case-insensitive build directory... yes
checking LIBRARY... libpython$(VERSION)$(ABIFLAGS).a
checking LINKCC... $(PURIFY) $(MAINCC)
checking for GNU ld... no
checking for inline... inline
checking for --enable-shared... no
checking for --enable-profiling... no
checking LDLIBRARY... libpython$(VERSION)$(ABIFLAGS).a
checking for ranlib... ranlib
checking for ar... ar
checking for readelf... no
checking for python3.5... python3.5
checking for python3.5... (cached) python3.5
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for --with-pydebug... no
checking whether gcc accepts and needs -fno-strict-aliasing... no
checking if we can turn off gcc unused result warning... yes
checking for -Werror=declaration-after-statement... yes
checking if we can turn on gcc mixed sign comparison warning... yes
checking if we can turn on gcc unreachable code warning... yes
checking which compiler should be used... gcc
checking which MACOSX_DEPLOYMENT_TARGET to use... 10.9
checking whether pthreads are available without options... no
checking whether gcc accepts -Kpthread... no
checking whether gcc accepts -Kthread... no
checking whether gcc accepts -pthread... no
checking whether g++ also accepts flags for thread support... no
checking for ANSI C header files... (cached) yes
checking asm/types.h usability... no
checking asm/types.h presence... no
checking for asm/types.h... no
checking conio.h usability... no
checking conio.h presence... no
checking for conio.h... no
checking direct.h usability... no
checking direct.h presence... no
checking for direct.h... no
checking dlfcn.h usability... no
checking dlfcn.h presence... yes
configure: WARNING: dlfcn.h: present but cannot be compiled
configure: WARNING: dlfcn.h: check for missing prerequisite headers?
configure: WARNING: dlfcn.h: see the Autoconf documentation
configure: WARNING: dlfcn.h: section "Present But Cannot Be Compiled"
configure: WARNING: dlfcn.h: proceeding with the compiler's result
configure: WARNING: ## -- ##
configure: WARNING: ## Report this to http://bugs.python.org/ ##
configure: WARNING: ## 

[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

> Why have two sets of functions doing exactly the same thing?

I have no idea.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Test with jemalloc using the shell script "python.jemalloc":
---
#!/bin/sh
LD_PRELOAD=/usr/lib64/libjemalloc.so /home/haypo/prog/python/default/python "$@"
---

Memory consumption:
python3 -u perf.py -m ../default/python ../default/python.jemalloc

Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
Mem max: 43100.000 -> 220.000: 195.9091x smaller

### chameleon_v2 ###
Mem max: 367276.000 -> 224.000: 1639.6250x smaller

### django_v3 ###
Mem max: 24136.000 -> 284.000: 84.9859x smaller

### fastpickle ###
Mem max: 8692.000 -> 284.000: 30.6056x smaller

### fastunpickle ###
Mem max: 8704.000 -> 216.000: 40.2963x smaller

### json_dump_v2 ###
Mem max: 10448.000 -> 216.000: 48.3704x smaller

### json_load ###
Mem max: 8444.000 -> 220.000: 38.3818x smaller

### nbody ###
Mem max: 7388.000 -> 220.000: 33.5818x smaller

### regex_v8 ###
Mem max: 12764.000 -> 220.000: 58.0182x smaller

### tornado_http ###
Mem max: 28216.000 -> 228.000: 123.7544x smaller





Performance:

Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
7.413484 -> 7.189792: 1.03x faster

### chameleon_v2 ###
Min: 5.559697 -> 5.869468: 1.06x slower
Avg: 5.672448 -> 6.033152: 1.06x slower
Significant (t=-13.67)
Stddev: 0.12098 -> 0.14203: 1.1740x larger

### nbody ###
Min: 0.242194 -> 0.229747: 1.05x faster
Avg: 0.244991 -> 0.235297: 1.04x faster
Significant (t=9.75)
Stddev: 0.00262 -> 0.00652: 2.4861x larger

### regex_v8 ###
Min: 0.042532 -> 0.046920: 1.10x slower
Avg: 0.043249 -> 0.047907: 1.11x slower
Significant (t=-13.23)
Stddev: 0.00180 -> 0.00172: 1.0503x smaller

### tornado_http ###
Min: 0.265755 -> 0.274526: 1.03x slower
Avg: 0.273617 -> 0.284186: 1.04x slower
Significant (t=-6.67)
Stddev: 0.00583 -> 0.01474: 2.5297x larger

The following not significant results are hidden, use -v to show them:
django_v3, fastpickle, fastunpickle, json_dump_v2, json_load.

--

___
Python tracker 

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



[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Mark Dickinson

Mark Dickinson added the comment:

> For JSON parsing in an ES6-compatible way you must anyway use an 
> "OrderedDict" hook option to get the right (=original) property order.

Why? From the JSON spec: "An object is an *unordered* set of name/value pairs." 
(emphasis mine). What do you mean by "JSON parsing in an ES6-compatible way"? 
Surely the JSON specification is all that should matter when determining how to 
parse JSON?

--

___
Python tracker 

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



[issue26233] select.epoll.poll() should avoid calling malloc() each time

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

@Yury, Serhiy: Do you think that it's worth to avoid malloc in epoll? Aside of 
the performance, my colleague also told me that heavy pressure on the memory 
allocator can slowly create framgmentation of the heap memory, which is true.

--

___
Python tracker 

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



[issue26238] httplib use wrong hostname in https request with SNI support

2016-02-02 Thread lirenke

Changes by lirenke :


--
resolution:  -> fixed

___
Python tracker 

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



[issue26244] zlib.compressobj level default value documentation

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

I also made a small change to the compressobj() doc string.

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



[issue24780] unittest assertEqual difference output foiled by newlines

2016-02-02 Thread Anish Shah

Anish Shah added the comment:

I would like to work on this..

--
nosy: +anish.shah

___
Python tracker 

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



[issue26229] Make number serialization ES6/V8 compatible

2016-02-02 Thread Mark Dickinson

Mark Dickinson added the comment:

> An easier fix than mucking around in the pretty complex number serializer
> code would be adding an "ES6Format" option to the "json.dump*" methods
> which could use the supplied conversion code as is.

Certainly if this were added we'd want to do it in a backwards compatible way; 
adding (yet) another flag to the json.dump* methods is one possibility.

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-02-02 Thread Florin Papa

Changes by Florin Papa :


--
nosy: +florin.papa

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

FYI Raymond, your revision 0731f097157b didn’t actually merge the 3.5 branch 
(It only had one parent). Also, the default branch never got any NEWS entry in 
58266f5101cc, so maybe it needs to be added?

--
nosy: +martin.panter

___
Python tracker 

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



[issue26259] Memleak when repeated calls to asyncio.queue.Queue.get is performed, without push to queue.

2016-02-02 Thread Jonas Brunsgaard

Jonas Brunsgaard added the comment:

You are right that get_nowait() is the correct api for my use case, using 
get_nowait() nothing is pushed to the internal _getters deque. The reason for 
my us of get() is that job futures are created one place in the code and then 
thrown in a processing function that will yield the job future. This design was 
created to handle all exceptions in processing(), but I agree that get_nowait 
would have been the superior solution.

I do not have time on my hands right now to take on the challenge of writing a 
patch, but I might take it up later, sound fun ;)

Good day to you sir, and thank you for the feedback.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

FYI benchmark result to compare Python with and without pymalloc (fast memory 
allocator for block <= 512 bytes). As expected, no pymalloc is slower, up to 
30% slower (and it's never faster).

Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
7.253671 -> 7.558993: 1.04x slower

### chameleon_v2 ###
Min: 5.598481 -> 5.794526: 1.04x slower
Avg: 5.714233 -> 5.922142: 1.04x slower
Significant (t=-8.01)
Stddev: 0.15956 -> 0.09048: 1.7636x smaller

### django_v3 ###
Min: 0.574221 -> 0.606462: 1.06x slower
Avg: 0.579659 -> 0.612088: 1.06x slower
Significant (t=-28.44)
Stddev: 0.00605 -> 0.00532: 1.1371x smaller

### fastpickle ###
Min: 0.450852 -> 0.502645: 1.11x slower
Avg: 0.455619 -> 0.513777: 1.13x slower
Significant (t=-26.24)
Stddev: 0.00696 -> 0.01404: 2.0189x larger

### fastunpickle ###
Min: 0.544064 -> 0.696306: 1.28x slower
Avg: 0.552459 -> 0.705372: 1.28x slower
Significant (t=-85.52)
Stddev: 0.00798 -> 0.00980: 1.2281x larger

### json_dump_v2 ###
Min: 2.780312 -> 3.265531: 1.17x slower
Avg: 2.830463 -> 3.370060: 1.19x slower
Significant (t=-23.73)
Stddev: 0.04190 -> 0.15521: 3.7046x larger

### json_load ###
Min: 0.428893 -> 0.558956: 1.30x slower
Avg: 0.431941 -> 0.569441: 1.32x slower
Significant (t=-74.76)
Stddev: 0.00791 -> 0.01033: 1.3060x larger

### regex_v8 ###
Min: 0.043439 -> 0.044614: 1.03x slower
Avg: 0.044388 -> 0.046487: 1.05x slower
Significant (t=-4.95)
Stddev: 0.00215 -> 0.00209: 1.0283x smaller

### tornado_http ###
Min: 0.264603 -> 0.278840: 1.05x slower
Avg: 0.270153 -> 0.285263: 1.06x slower
Significant (t=-23.04)
Stddev: 0.00489 -> 0.00436: 1.1216x smaller

The following not significant results are hidden, use -v to show them:
nbody.

--

___
Python tracker 

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



[issue26266] add classattribute to enum to handle non-Enum attributes

2016-02-02 Thread Ethan Furman

New submission from Ethan Furman:

The rules for what objects in an Enum become members and which do not are 
fairly straight-forward:

__double_underscore__ do not (but is reserved for Python)
_single_underscore_ do not (but is reserved for Enum itself)
any descriptored object (such as functions) do not

Which means the proper way to add constants/attributes to an Enum is to write a 
descriptor, but most folks don't think about that when the Enum is not working 
properly they (okay, and me :/ ) just add the double-underscore.

This question has already come up a couple times on StackOverflow:
- http://stackoverflow.com/q/17911188/208880
- http://stackoverflow.com/q/34465739/208880

While this doesn't come up very often, that just means it is even more likely 
to have the attribute be __double_underscored__ instead of descriptored.

The solution is have a descriptor in the Enum module for this case.  While it 
would be possible to have several (constant-unless-mutable, 
constant-even-if-mutable, not-constant, possibly others) I think the 
not-constant would be sufficient (aka a writable property), although I am not 
opposed to a constant-unless mutable version as well.

The not-constant version would look like this (I'll attach patch later):

class classattribute:
def __init__(self, value):
self.value = value
def __get__(self, *args):
return self.value
def __set__(self, value):
self.value = value
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.value)

--
assignee: ethan.furman
messages: 259399
nosy: barry, eli.bendersky, ethan.furman
priority: normal
severity: normal
status: open
title: add classattribute to enum to handle non-Enum attributes
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



[issue26265] errors during static build on OSX

2016-02-02 Thread Ned Deily

Ned Deily added the comment:

I can't speak to issues with PyQt5 since that is not part of the Python 
standard library but you shouldn't need additional configure options just to 
build Python itself. Make sure you have installed the latest version of Xcode 
for your release via the App Store app update pane and that you have installed 
the corresponding latest version of the Xcode Command Line Tools with:

xcode-select --install

Then start with a clean build directory.

--

___
Python tracker 

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



[issue25945] Type confusion in partial_setstate and partial_call leads to memory corruption

2016-02-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 542b5744ddc3 by Serhiy Storchaka in branch '3.5':
Issue #25945: Fixed bugs in functools.partial.
https://hg.python.org/cpython/rev/542b5744ddc3

New changeset 33109176538d by Serhiy Storchaka in branch 'default':
Issue #25945: Fixed bugs in functools.partial.
https://hg.python.org/cpython/rev/33109176538d

New changeset 628ce2975e29 by Serhiy Storchaka in branch '2.7':
Issue #25945: Fixed bugs in functools.partial.
https://hg.python.org/cpython/rev/628ce2975e29

--
nosy: +python-dev

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

>> It looks like some benchmarks are up to 4% faster:

> What this says is that some internals uses of PyMem_XXX should be replaced 
> with PyObject_XXX.

Why not changing PyMem_XXX to use the same fast allocator than PyObject_XXX? 
(as proposed in this issue)

FYI we now also have the PyMem_RawXXX family :)

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 02/02/2016 15:48, STINNER Victor a écrit :
>> What this says is that some internals uses of PyMem_XXX should be replaced 
>> with PyObject_XXX.
> 
> Why not changing PyMem_XXX to use the same fast allocator than
PyObject_XXX? (as proposed in this issue)

Why have two sets of functions doing exactly the same thing?

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 02/02/2016 15:47, STINNER Victor a écrit :
> 
> ### 2to3 ###
> Mem max: 43100.000 -> 220.000: 195.9091x smaller
> 
> ### chameleon_v2 ###
> Mem max: 367276.000 -> 224.000: 1639.6250x smaller
> 
> ### django_v3 ###
> Mem max: 24136.000 -> 284.000: 84.9859x smaller

These figures are not even remotely believable.
It would make sense to investigate them before posting such numbers ;-)

--

___
Python tracker 

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



[issue26256] Fast decimalisation and conversion to other bases

2016-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is this the same algorithm as in issue3451?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

> These figures are not even remotely believable.

To be honest, I didn't try to understand them :-) Are they the number of kB of 
the RSS memory?

Maybe perf.py doesn't like my shell script?

--

___
Python tracker 

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



[issue26243] zlib.compress level as keyword argument

2016-02-02 Thread Berker Peksag

Berker Peksag added the comment:

There is an outdated patch in issue 16764 for zlib.compress(), 
zlib.decompress(), zlib.flush() and other functions. Perhaps we can close it as 
a duplicate of this one.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hum, the point of PyMem_Malloc() is that it's distinct from PyObject_Malloc(), 
right? Why would you redirect one to the other?

--
nosy: +pitrou

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

About heap memory fragmentation, see also my attached two "benchmarks" in 
Python and C: python_memleak.py and tu_malloc.c.

--
Added file: http://bugs.python.org/file41778/python_memleak.py

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

> Hum, the point of PyMem_Malloc() is that it's distinct from 
> PyObject_Malloc(), right? Why would you redirect one to the other?

For performances.

> (of course, we might question why we have two different families of 
> allocation APIs...)

That's the real question: why does Python have PyMem family? Is it still 
justified in 2016?

--

Firefox uses jemalloc to limit the fragmentation of the heap memory. Once I 
spent a lot of time to try to understand the principle of fragmentation, and in 
my tiny benchmarks, jemalloc was *much* better than system allocator. By the 
way, jemalloc scales well on multiple threads ;-)

* http://www.canonware.com/jemalloc/
* https://github.com/jemalloc/jemalloc/wiki

My notes on heap memory fragmentation: 
http://haypo-notes.readthedocs.org/heap_fragmentation.html

--

___
Python tracker 

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



[issue26263] Serialize array.array to JSON by default

2016-02-02 Thread SilentGhost

Changes by SilentGhost :


--
components: +Extension Modules -Interpreter Core
nosy: +ezio.melotti, pitrou, rhettinger

___
Python tracker 

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



[issue23200] Deprecate the zlib decompressor’s flush() method

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

New version of the patch merged with current code and cleaning up the zipfile 
EOF detection.

--
Added file: http://bugs.python.org/file41780/deprecate-flush.v2.patch

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

> FYI Raymond, your revision 0731f097157b didn’t actually merge the 3.5 branch 
> (It only had one parent). Also, the default branch never got any NEWS entry 
> in 58266f5101cc, so maybe it needs to be added?

Maybe it's also worth to document the change in Python 3.5 and 3.6 
documentation with a ".. versionchanged::"?
https://docs.python.org/dev/library/collections.html#deque-objects

It can be suprising to get a different behaviour between two bugfix versions 
(Python 3.5.1 and 3.5.2). I'm not saying that we must not fix bugs, just that 
it helps users to document them :-)

It will also avoid bug reports about this behaviour change. Example of user 
report: issue #26260, "it works on Python 2 but no more on Python 3" ;-)

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

So, I ran ssh://h...@hg.python.org/benchmarks with my patch. It looks like some 
benchmarks are up to 4% faster:

$ python3 -u perf.py ../default/python.orig ../default/python.pymem

INFO:root:Automatically selected timer: perf_counter
[ 1/10] 2to3...
INFO:root:Running `../default/python.pymem lib3/2to3/2to3 -f all lib/2to3`
INFO:root:Running `../default/python.pymem lib3/2to3/2to3 -f all lib/2to3` 1 
time
INFO:root:Running `../default/python.orig lib3/2to3/2to3 -f all lib/2to3`
INFO:root:Running `../default/python.orig lib3/2to3/2to3 -f all lib/2to3` 1 time
[ 2/10] chameleon_v2...
INFO:root:Running `../default/python.pymem performance/bm_chameleon_v2.py -n 50 
--timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_chameleon_v2.py -n 50 
--timer perf_counter`
[ 3/10] django_v3...
INFO:root:Running `../default/python.pymem performance/bm_django_v3.py -n 50 
--timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_django_v3.py -n 50 
--timer perf_counter`
[ 4/10] fastpickle...
INFO:root:Running `../default/python.pymem performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle pickle`
INFO:root:Running `../default/python.orig performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle pickle`
[ 5/10] fastunpickle...
INFO:root:Running `../default/python.pymem performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle unpickle`
INFO:root:Running `../default/python.orig performance/bm_pickle.py -n 50 
--timer perf_counter --use_cpickle unpickle`
[ 6/10] json_dump_v2...
INFO:root:Running `../default/python.pymem performance/bm_json_v2.py -n 50 
--timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_json_v2.py -n 50 
--timer perf_counter`
[ 7/10] json_load...
INFO:root:Running `../default/python.pymem performance/bm_json.py -n 50 --timer 
perf_counter json_load`
INFO:root:Running `../default/python.orig performance/bm_json.py -n 50 --timer 
perf_counter json_load`
[ 8/10] nbody...
INFO:root:Running `../default/python.pymem performance/bm_nbody.py -n 50 
--timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_nbody.py -n 50 --timer 
perf_counter`
[ 9/10] regex_v8...
INFO:root:Running `../default/python.pymem performance/bm_regex_v8.py -n 50 
--timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_regex_v8.py -n 50 
--timer perf_counter`
[10/10] tornado_http...
INFO:root:Running `../default/python.pymem performance/bm_tornado_http.py -n 
100 --timer perf_counter`
INFO:root:Running `../default/python.orig performance/bm_tornado_http.py -n 100 
--timer perf_counter`

Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### 2to3 ###
6.880090 -> 6.818911: 1.01x faster

### fastpickle ###
Min: 0.453826 -> 0.442081: 1.03x faster
Avg: 0.456499 -> 0.443978: 1.03x faster
Significant (t=20.03)
Stddev: 0.00370 -> 0.00242: 1.5293x smaller

### fastunpickle ###
Min: 0.547908 -> 0.526027: 1.04x faster
Avg: 0.554663 -> 0.528686: 1.05x faster
Significant (t=15.95)
Stddev: 0.00893 -> 0.00728: 1.2260x smaller

### json_dump_v2 ###
Min: 2.733907 -> 2.627718: 1.04x faster
Avg: 2.762473 -> 2.664675: 1.04x faster
Significant (t=11.99)
Stddev: 0.03796 -> 0.04341: 1.1435x larger

### regex_v8 ###
Min: 0.042438 -> 0.042581: 1.00x slower
Avg: 0.042805 -> 0.044078: 1.03x slower
Significant (t=-2.12)
Stddev: 0.00171 -> 0.00388: 2.2694x larger

### tornado_http ###
Min: 0.254089 -> 0.246088: 1.03x faster
Avg: 0.257046 -> 0.249033: 1.03x faster
Significant (t=15.83)
Stddev: 0.00401 -> 0.00310: 1.2930x smaller

The following not significant results are hidden, use -v to show them:
chameleon_v2, django_v3, json_load, nbody.

real19m13.413s
user18m50.024s
sys 0m22.507s

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-02-02 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +ebarry

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It looks like some benchmarks are up to 4% faster:

What this says is that some internals uses of PyMem_XXX should be replaced with 
PyObject_XXX.

--

___
Python tracker 

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



[issue26188] Provide more helpful error message when `await` is called inside non-`async` method

2016-02-02 Thread Nicholas Chammas

Nicholas Chammas added the comment:

Related discussions about providing more helpful syntax error messages:

* http://bugs.python.org/issue1634034
* http://bugs.python.org/issue400734
* http://bugs.python.org/issue20608

>From the discussion on issue1634034, it looks like providing better messages 
>in the general case of a syntax error is quite difficult. But perhaps in 
>limited cases like this one we can do better.

Parsers are a bit over my head. Martin, is it difficult to distinguish between 
`await` as a regular name and `await` as a special token?

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-02 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Great, how do we ensure this gets merged soon?

--

___
Python tracker 

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



[issue26182] Deprecation warnings for the future async and await keywords

2016-02-02 Thread Marco Buttu

Marco Buttu added the comment:

The check for the 'with' statement was handled in the parser (parsetok.c), and 
in Python 2.5 the warnings were enabled by default. 
I do not know how to check if the deprecation warning are enabled, otherwise I 
would have tried to fix the problem.

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-02 Thread Guido van Rossum

Guido van Rossum added the comment:

Find an active developer who cares -- e.g. Martin Panter, Serhiy, Yury.

On Tue, Feb 2, 2016 at 5:46 AM, A. Jesse Jiryu Davis
 wrote:
>
> A. Jesse Jiryu Davis added the comment:
>
> Great, how do we ensure this gets merged soon?
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Reopened. Otherwise Martin's comments can be lost in spam.

> Maybe it's also worth to document the change in Python 3.5 and 3.6 
> documentation with a ".. versionchanged::"?

I don't think this is needed. This isn't new feature, this is just a bugfix, 
old behavior obviously was incorrect. We don't add the versionchanged directive 
for every bugfix.

--
status: closed -> open

___
Python tracker 

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



[issue23252] Add support of writing to unseekable file in zipfile

2016-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Currently the zipfile module requires seekable stream to read a list of entries 
from central directory at the end of ZIP file, and for reding their content in 
arbitrary order. The support of unseekable stream needs to design a new API. 
This is separate issue.

--

___
Python tracker 

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



[issue26136] DeprecationWarning for PEP 479 (generator_stop)

2016-02-02 Thread Anish Shah

Anish Shah added the comment:

I have submitted a patch. I have replace `PyExc_PendingDeprecationWarning` to 
`PyExc_DeprecationWarning` in Objects/genobject.c

Can anyone please review?

--
keywords: +patch
Added file: http://bugs.python.org/file41783/issue26136.patch

___
Python tracker 

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



[issue26233] select.epoll.poll() should avoid calling malloc() each time

2016-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure that it is worth to apply this optimization. The patch adds half a 
hundred lines of complex code for only 80 ns benefit. On my computer just 
incrementing an integer takes 100 ns.

--

___
Python tracker 

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



[issue25945] Type confusion in partial_setstate and partial_call leads to memory corruption

2016-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nick and Raymond for your reviews.

--

___
Python tracker 

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



[issue26270] Support for read()/write()/select() on asyncio

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

Maybe I misunderstand the asyncio protocols, transports, streams, etc too :) 
but last time I looked they all seemed to buffer your write data and send it in 
the background. E.g. in the echo-client-using-streams example, there is a 
writer.write() call that does not use “yield from”.

Does asyncio have an easy way for a coroutine to write to a socket (or file 
descriptor) and block (suspend the coroutine) until the write has finished (or 
the data fits into a finite buffer)? E.g. how would you upload a multi-megabyte 
file?

--
nosy: +martin.panter

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-02-02 Thread Martin Panter

Martin Panter added the comment:

Hello Jesse. Maybe Yury might be more qualified here than me to handle OS X 
stuff (correct me if I’m wrong). I mainly just work with Linux.

But reading around socketmodule.c, it sounds like we want to be able to build 
it on newer OS versions, but still have it compatible with older versions. If 
so, how does that MAC_OS_X_VERSION_10_5 macro work? Would some run-time check 
also be needed?

--
nosy: +martin.panter

___
Python tracker 

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



[issue26265] build errors on OS X 10.11 with --enable-universalsdk

2016-02-02 Thread Ned Deily

Ned Deily added the comment:

OK, thanks for reporting it.  A couple of things. I'm not sure why the PyQt5 
build is looking for the MacOSX10.10.sdk as you report.  There do seem to be 
some issues building a universal Python when using a current default Xcode SDK; 
I'm going to leave this issue open to investigate those.  You can get around 
those issues by using --enable-universalsdk=/ which uses the header files and 
libraries installed in traditional locations by the Command Line Tools rather 
than from the SDK locations.  Also, as documented in the Mac README 
(https://hg.python.org/cpython/file/3.5/Mac/README) where universal builds are 
described, --with-universal-archs=64-bit is a legacy configuration option that 
is only supported with an OS X 10.5 SDK, because it includes ppc64 which is no 
longer supported by current Xcode compilers.  On current systems, building with 
no --with-universal-archs option specified will produce 64-bit Intel binaries.  
Finally, depending on what your needs are, it might be easier to i
 nstall PyQt5 and Python 3.5 from a third-party distributor, like Homebrew, 
MacPorts, or conda.

--
title: errors during static build on OSX -> build errors on OS X 10.11 with 
--enable-universalsdk
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



[issue26259] Memleak when repeated calls to asyncio.queue.Queue.get is performed, without push to queue.

2016-02-02 Thread Jonas Brunsgaard

Jonas Brunsgaard added the comment:

Okay I thoroughly read the code again. Can you describe the architectural 
changes to the code regarding a patch, I will do a proposal. But I have to know 
we are on the same page, so I do not waste my and your time :)

--

___
Python tracker 

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



[issue26259] Memleak when repeated calls to asyncio.queue.Queue.get is performed, without push to queue.

2016-02-02 Thread Guido van Rossum

Guido van Rossum added the comment:

First, you wrote "The easy solution was to check if the queue was
empty and skip the read (get call) if there was nothing in the queue"
-- which is exactly what get_nowait() does.

As to a patch, I think you should just describe how you would change
the code, then we can talk details.

--

___
Python tracker 

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



[issue26098] PEP 510: Specialize functions with guards

2016-02-02 Thread STINNER Victor

STINNER Victor added the comment:

Results of the "The Grand Unified Python Benchmark Suite" on  
specialize-6.patch.

I'm skeptical, I don't understand how my patch can make a benchmark faster :-) 
The result of regex_v8 is bad :-/

$ python3 -u perf.py --rigorous ../default/python.orig ../default/python
(...)
Report on Linux smithers 4.3.3-300.fc23.x86_64 #1 SMP Tue Jan 5 23:31:01 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### chameleon_v2 ###
Min: 5.558607 -> 5.831682: 1.05x slower
Avg: 5.613403 -> 5.902949: 1.05x slower
Significant (t=-27.95)
Stddev: 0.06994 -> 0.07640: 1.0924x larger

### django_v3 ###
Min: 0.582356 -> 0.573327: 1.02x faster
Avg: 0.604402 -> 0.582197: 1.04x faster
Significant (t=3.43)
Stddev: 0.05618 -> 0.03215: 1.7474x smaller

### regex_v8 ###
Min: 0.043784 -> 0.049854: 1.14x slower
Avg: 0.044270 -> 0.050521: 1.14x slower
Significant (t=-19.87)
Stddev: 0.00200 -> 0.00243: 1.2105x larger

The following not significant results are hidden, use -v to show them:
2to3, fastpickle, fastunpickle, json_dump_v2, json_load, nbody, tornado_http.

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(of course, we might question why we have two different families of allocation 
APIs...)

--

___
Python tracker 

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



[issue26249] Change PyMem_Malloc to use PyObject_Malloc allocator?

2016-02-02 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file41779/tu_malloc.c

___
Python tracker 

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



  1   2   >