[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Ville Skyttä added the comment:

@rhettinger, the test_asyncio thing I mentioned is now taken care of in #27907.

--

___
Python tracker 

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



[issue27907] Misspelled variable in test_asyncio/test_events

2016-08-30 Thread Ville Skyttä

New submission from Ville Skyttä:

Simply renaming the variable breaks the test which is why it was left out of 
#27895, this one keeps the test working.

--
files: reponse.patch
keywords: patch
messages: 274001
nosy: scop
priority: normal
severity: normal
status: open
title: Misspelled variable in test_asyncio/test_events
type: enhancement
Added file: http://bugs.python.org/file44291/reponse.patch

___
Python tracker 

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



[issue27904] Let logging format more messages on demand

2016-08-30 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +vinay.sajip
stage:  -> patch review
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



[issue27895] Spelling fixes

2016-08-30 Thread SilentGhost

Changes by SilentGhost :


--
stage:  -> resolved

___
Python tracker 

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



[issue27891] Consistently group and sort imports within idlelib modules.

2016-08-30 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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

___
Python tracker 

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



[issue27891] Consistently group and sort imports within idlelib modules.

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96ac4cd43a20 by Terry Jan Reedy in branch 'default':
Issue #27891: Consistently group and sort imports within idlelib modules.
https://hg.python.org/cpython/rev/96ac4cd43a20

--
nosy: +python-dev

___
Python tracker 

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



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

2016-08-30 Thread Steve Dower

Steve Dower added the comment:

New patch attached (1602_2.patch - hopefully the review will work this time 
too).

I discovered while researching for the PEP that a decent amount of code expects 
to be able to write ASCII to sys.stdout.buffer (or sys.stdout.buffer.raw). As 
my first patch required utf-16-le at this point, it was going to cause havoc.

Rather than break that compatibility, I decided that exposing utf-8 and doing 
the reencoding at the latest possible stage was better. This is also more 
consistent with how other encoding issues are likely to be resolved, and 
shouldn't be any less performant, given that previously we were decoding to 
utf-16 anyway.

The downsides of this is that read(n) now can only read up to n/4 characters, 
and write(n) has a much more complicated time dealing with large buffers (as we 
need to cap the number of utf-16-le bytes but return the number of utf-8 bytes 
- it's not a direct relationship, so there's more work and a little bit of 
guessing in some cases).

On the upside, the readline handling is simpler as utf-8 is compatible with the 
existing interface and now sys.stdin.encoding is accurate. I've rolled that fix 
into this patch (just the myreadline.c change) as they really ought to go in 
together.

--
Added file: http://bugs.python.org/file44290/1602_2.patch

___
Python tracker 

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



[issue27630] Generator._encoded_EMTPY misspelling in email package

2016-08-30 Thread Martin Panter

Martin Panter added the comment:

FYI in 3.6 the spelling has been changed to _EMPTY (Issue 27895)

--

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Martin Panter

Martin Panter added the comment:

Be careful with user-visible changes to the code, like the _encoded_EMTPY 
attribute (Issue 27630). I wouldn’t backport that.

--
nosy: +martin.panter
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



[issue27906] Socket accept exhaustion during high TCP traffic

2016-08-30 Thread kevinconway

kevinconway added the comment:

I've added a unit test to the patch that asserts sock.accept() is called the 
appropriate number of times.

Worth a note, I had to adjust one of the existing tests to account for the new 
backlog argument. There is a default value for the argument to preserve 
backwards compat for any callers, but the mock used in the test was not 
tolerant of having an extra arg available.

--
Added file: http://bugs.python.org/file44289/multi-accept-2.patch

___
Python tracker 

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-30 Thread Nick Coghlan

Nick Coghlan added the comment:

Nice! The one thing I would suggest double checking with this change is whether 
or not we have test cases covering ranges with lengths that don't fit into 
ssize_t. It's been years since I looked at that code, so I don't remember 
exactly how it currently works, but it does work (except for __len__, due to 
the signature of the C level length slot):

>>> bigrange = range(int(-10e30), int(10e30))
>>> len(bigrange)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: Python int too large to convert to C ssize_t
>>> bigrange[:]
range(-635896294965248, 635896294965248)
>>> bigrange[0:-1]
range(-635896294965248, 635896294965247)
>>> bigrange[::2]
range(-635896294965248, 635896294965248, 2)
>>> bigrange[0:-1:2]
range(-635896294965248, 635896294965247, 2)

--
nosy: +ncoghlan

___
Python tracker 

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



[issue27891] Consistently group and sort imports within idlelib modules.

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Patch 2 has minor revisions to hyperparser, mainmenu, pyshell, and adds 
material to README.txt.

--
Added file: http://bugs.python.org/file44288/import-27891-2.diff

___
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-08-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, the tests are often full of mocks, and I trust that the test
suite you wrote verifies that this fixes the problem. The unit tests
are more to ensure that future changes to the code won't accidentally
break the code you wrote (which is why we should really have test
coverage, but that's another story).

--

___
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-08-30 Thread kevinconway

kevinconway added the comment:

I'll dig into the existing asyncio unit tests and see what I can come up with. 
I'm not sure, yet, exactly what I might test for.

The variables involved with reproducing the error are mostly environmental. CPU 
speed of the host, amount of CPU bound work happening in handler coroutines, 
and the rate of new connections are the major contributors we've identified. 
I'm not sure how I might simulate those in a unit test.

Would it be sufficient to add a test that ensures the _accept_connection calls 
.accept() on the listening socket 'backlog' number of times in event there are 
no OS errors?

--

___
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-08-30 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks -- IIRC this was even brought up during asyncio's early implementation 
phase, but we didn't have enough experience to warrant the extra logic. It 
seems like now is the time to do this!

I hope you won't need it for 3.4, because that version is out of support. 
However I would like to have this upstream in https://github.com/python/asyncio.

Is there any chance you can write a unit test for this functionality? Or is the 
only way to test it really to do a load test?

--

___
Python tracker 

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



[issue22233] http.client splits headers on non-\r\n characters

2016-08-30 Thread Doug Hellmann

Changes by Doug Hellmann :


--
nosy: +doughellmann

___
Python tracker 

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



[issue27903] Avoid ResourceWarnings from platform._dist_try_harder

2016-08-30 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lemburg

___
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-08-30 Thread kevinconway

kevinconway added the comment:

Attaching the patch file

--
keywords: +patch
Added file: http://bugs.python.org/file44287/multi-accept.patch

___
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-08-30 Thread kevinconway

New submission from kevinconway:

My organization noticed this issue after launching several asyncio services 
that would receive either a sustained high number of incoming connections or 
regular bursts of traffic. Our monitoring showed a loss of between 4% and 6% of 
all incoming requests. On the client side we see a socket read error 
"Connection reset by peer". On the asyncio side, with debug turned on, we see 
nothing.

After some more investigation we determined asyncio was not calling 'accept()' 
on the listening socket fast enough. To further test this we put together 
several hello-world type examples and put them under load. I've attached the 
project we used to test. Included are three docker files that will run the 
services under different configurations. One runs the service as an aiohttp 
service, the other uses the aiohttp worker behind gunicorn, and the third runs 
the aiohttp service with the proposed asyncio patch in place. For our testing 
we used 'wrk' to generate traffic and collect data on the OS/socket errors.

For anyone attempting to recreate our experiments, we ran a three test 
batteries against the service for each endpoint using:

wrk --duration 30s --timeout 10s --latency --threads 2 --connections 10 
wrk --duration 30s --timeout 10s --latency --threads 2 --connections 100 
wrk --duration 30s --timeout 10s --latency --threads 2 --connections 1000 

The endpoints most valuable for us to test were the ones that replicated some 
of our production logic:

/  # Hello World
/sleep?time=100  # Every request is delayed by 100 milliseconds and 
returns an HTML message.
/blocking/inband  # Every request performs a bcrypt with complexity 10 and 
performs the CPU blocking work on the event loop thread.

Our results varied based on the available CPU cycles, but we consistently 
recreate the socket read errors from production using the above tests.

Our proposed solution, attached as a patch file, is to put the socket.accept() 
call in a loop that is bounded by the listening socket's backlog. We use the 
backlog value as an upper bound to prevent the reverse situation of starving 
active coroutines while the event loop continues to accept new connections 
without yielding. With the proposed patch in place our loss rate disappeared.

For further comparison, we reviewed the socket accept logic in Twisted against 
which we ran similar tests and encountered no loss. We found that Twisted 
already runs the socket accept in a bounded loop to prevent this issue 
(https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/tcp.py#L1028).

--
components: asyncio
files: testservice.zip
messages: 273989
nosy: gvanrossum, haypo, kevinconway, yselivanov
priority: normal
severity: normal
status: open
title: Socket accept exhaustion during high TCP traffic
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44286/testservice.zip

___
Python tracker 

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



[issue22233] http.client splits headers on non-\r\n characters

2016-08-30 Thread Martin Panter

Martin Panter added the comment:

If someone reviews my patch and thinks it is fine, I might commit it. Maybe I 
can just re-review it myself, now that I have forgotten all the details :)

If messing with the email package is a problem (performance, or compatibility), 
another option is to keep the changes to the HTTP module (which I would be more 
confident in changing on my own). I have another patch for review at Issue 
24363 which apparently also fixes this splitlines() bug.

--
versions:  -Python 3.4

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Anthony Flury

Anthony Flury added the comment:

Assuming the reader knows the details of how Python works is not a great 
assumption when those documents are being used (by the most part) by people 
like me who are reasonable developers but who don't know, and for most cases 
don't care about the internals of Python.

The inspect library is a bit different I conceed, as the user is starting to 
poke under the belly of the beast as it were, but i do think it would be useful 
to link from Inspect to the data model docs, were the terminology is discussed 
in more detail.

If I had tried to port my existing code to Python3.5, and it would have failed 
it's test set at this point - I don't think that the inspect library docs as 
they are would have helped.

I know inspect is deliving into the internals - but for most people a block of 
code within a def block within a class definition is a method - that is what 
everyone refers to them - even though internally they aren't bound, and aren't 
'methods' strictly speaking - I think the docs should try to bridge the gap 
between common (non expert) language and the correct language terminology where 
neccessary

--

___
Python tracker 

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



[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b8dd9ae08a91 by R David Murray in branch '3.5':
#27893: arg name and bytes references in email.parser docs.
https://hg.python.org/cpython/rev/b8dd9ae08a91

New changeset 059f9f518834 by R David Murray in branch 'default':
Merge #27893: arg name and bytes references in email.parser docs.
https://hg.python.org/cpython/rev/059f9f518834

--
nosy: +python-dev

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

Perhaps we could add a cross link from 'bound method' to the 'instance methods' 
section of the data model docs.

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

The docs do not so much assume you know what the library does, as they assume 
you know how python3 works.  Which is to say, that bound methods are obtained 
from instances and that functions defined on a class are functions.  That's 
documented in the data model docs, and the inspect docs in general assume you 
understand the python data model and are using inspect to probe it.

As Steven said, if you can point specifically to something you think can be 
improved we will consider it, but know that the python3 docs are in general 
written without respect to how python2 worked.  There are very few references 
to python2 in the python3 docs, and this is by design.  The story is different 
in the python2 docs, so conceivably there could be something inserted there 
about the python3 difference.

--

___
Python tracker 

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



[issue22233] http.client splits headers on non-\r\n characters

2016-08-30 Thread Clay Gerrard

Clay Gerrard added the comment:

BUMP. ;)

This issue was recently raised as one blocker to OpenStack Object Storage 
(Swift) finishing our port to python3 (we're hoping to finish adding support 
>=3.5 by Spring '17 - /me crosses fingers).

I wonder if someone might confirm or deny the attached patch is likely to be 
included in the 3.6 timeframe (circa 12/16?) and/or back-ported to the 3.5 
series?

FWIW, I would echo other's sentiment that I would much prefer the 
implementation to be correct even if there was some worry we might have to 
choose between further optimization and getting a fix ASAP :D

Warm Regards,
-Clay

--
nosy: +Clay Gerrard

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Martin Panter

Martin Panter added the comment:

“Proxy servers such as NGinx and Varnish: . . . if the Accept header is 
omitted, the proxy cache can return any of the cached responses.”

This is not really my area of expertise, but this behaviour is inconsistent 
with my understanding of how Accept and Vary are supposed to work in general. I 
would expect a cache to treat a missing Accept field as a separate “value” that 
does not match any specific Accept value.

See . Also, 
what about a server that sets “Vary: Cookie”, to send a response that depends 
on whether the user has already seen the page. Do these NGinx and Varnish 
caches respond with a random response if Cookie is missing?

I still think if you care about the media type, it is better practice to 
specify what types you want with a more explicit Accept value. And if you don’t 
care about the media type, the NGinx/Varnish behaviour may not be a problem 
anyway.

--

___
Python tracker 

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



[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

Yeah, and it should probably remain so at this point.  It's not even completely 
wrong; from an email perspective it is text.  It should also say "equivalent", 
not "precisely equivalent", since BytesIO is not in fact involved in the 
implementation.

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> I do think that the documentation could be a lot clearer.

Which specific documentation are you referring to? The "What's New" document 
from 3.0? That's a historical document, a snapshot of the past.

If you have a concern about the current documentation, can you tell us 
specifically where and what?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue17642] IDLE add font resizing hot keys and wheel

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I intend to backport the simple list expansion to 3.5.  Key or wheel patches 
will probably be 3.6 only.

--

___
Python tracker 

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



[issue17642] IDLE add font resizing hot keys and wheel

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f478f9b88319 by Terry Jan Reedy in branch '2.7':
Issue #17642: add larger font sizes for classroom projection.
https://hg.python.org/cpython/rev/f478f9b88319

New changeset c9d59e6cc1e4 by Terry Jan Reedy in branch 'default':
Issue #17642: add larger font sizes for classroom projection.
https://hg.python.org/cpython/rev/c9d59e6cc1e4

--
nosy: +python-dev

___
Python tracker 

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



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

2016-08-30 Thread Michael Felt

Michael Felt added the comment:

On 27-Aug-16 09:11, Martin Panter wrote:
> Martin Panter added the comment:
>
> The documentation is in RST format in the Doc/ directory. For basic stuff, 
> you can just copy the syntax from existing text, or see e.g. 
>  
> for more hints. For this change, I think we need to mention in 
> Doc/library/ctypes.rst:
>
> * the special AIX changes for find_library(); include “.. versionchanged::” 
> (or maybe versionadded? I’m not sure) notice
> * the change for the CDLL constructor, also with versionchanged
>
> Perhaps also add an entry to Doc/whatsnew/3.6.rst.
>
> Patch 160823 does not addressed many of my previous comments. Please have a 
> closer look. I can make simple changes to simplify the code myself, but I 
> don’t really know what to do about the questionable regular expressions, for 
> instance.
As far as regular expressions go, that will always be difficult for me 
aka questionable for you. Every language has it's nuances and I never 
seem to get them right.

>
> Also, see . What was wrong with 
> the cases supported by your original patches?
As you clearly pointed out, there were no prior cases showing their 
need. I was taking an unbiased approach in that I knew no previous code 
well. I was just trying to make it work and was trying to think of cases 
were it could go wrong. In short, I was trying to solve issues that do 
not exist. People accept whatever libFOO.so points to as a symbolic link 
- and expect libSOO.so to be the name of the shared library that 
dlopen() is going to open somewhere.

Once I understood the boundaries of find_library("foo") I limited myself 
to only resolve in the way the compile-time resolution is done. As such, 
find_library("c") is the equivalent of -lc and needs to resolve to 
libc.a(shr.o) - period (32-bit) or libc.a(shr_64.o) (64-bit).

The linker is not looking for a particular member name: it only uses 
-lFOO to find libFOO.a, and it it exists it looks for a symbol. The 
member name that contains the symbol is what it stores in the executable 
(displayed via dump -H). So, getting back to this patch and packaging 
conventions.

Basically, libtool has standardised how members are named, i.e., 
versioning. In most cases with OSS packages the only member-name that 
gets stored is the same name that libFOO.so would be a symbolic link to. 
Again, the compiler-linker only needs the name of the archive. The 
member name within the archive is irrelevant - from a compiler/linker 
perspective.

My goal for find_library() is to find the most likely name based on some 
legacy "rules" from the way IBM packaged libraries starting over 20 
years ago (aka AIX 4 standards) that are alive today to support binary 
compatibility - as much as possible. Mainly, that is relevant for 
libraries/archives such as libc.a. For new libraries, especially OSS 
packages built using the GNU autotools (and finishing with libtool) 
there are other conventions.

Finally, we had different goals - my focus was on writing something that 
matches other platforms python2 behavior, not on writing a new syntax 
specific for Python3.6 and AIX. If I were to do be writing a new syntax 
I would prefer that it also work for other platforms. Something 
different for only one platform feels wrong - imho.

In closing:
a) regular expressions and me is always a headache for someone. please 
accept my apologies if I have given you a headache.
b) I had assumed abilities for find_library() (from studying the output 
of ldconfig and trying to follow the regular expressions in the current 
code) that are not used. To assume makes an ass of u and me - especially me.
c) I also apologize for not meeting your expectations. I cut code, 
rather than defend it, as you were correct that is was not based on 
meeting the needs of general aka current practice.

I am not trying to redesign find_library(). My hope is that most python 
code would work asis - if they follow conventions aka general practice 
(not equivalent to best practice as best depends (in part) on your goal).
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-08-30 Thread Stefan Krah

Stefan Krah added the comment:

Wow, on my machine this is very stable, great.

The output should be like

   http://www.bytereef.org/software/mpdecimal/benchmarks/telco.py ,

but printing one number only should be okay. The important thing is that some 
decimal is printed at all to test the formatting speed.


So LGTM.

--
assignee: skrah -> haypo

___
Python tracker 

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



[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread Martin Panter

New submission from Martin Panter:

Actually it seems the parameter is called *text*:

>>> BytesParser().parsebytes(bytes=b"")
TypeError: parsebytes() got an unexpected keyword argument 'bytes'
>>> BytesParser().parsebytes(text=b"")


--
components: +email
nosy: +barry, martin.panter, r.david.murray
title: BytesParser.parsebytes docstring fix -> 
email.parser.BytesParser.parsebytes docs fix
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



[issue27905] Add documentation for typing.Type

2016-08-30 Thread Michael Lee

New submission from Michael Lee:

This patch adds some documentation for typing.Type[C]. The content itself is 
mostly an abbreviated version of the description from PEP 484 -- let me know if 
the patch is too terse or needs more examples.

--
assignee: docs@python
components: Documentation
files: document-type.patch
keywords: patch
messages: 273974
nosy: docs@python, gvanrossum, michael0x2a
priority: normal
severity: normal
status: open
title: Add documentation for typing.Type
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44285/document-type.patch

___
Python tracker 

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



[issue27902] pstats.Stats: strip_dirs() method cannot handle file paths from different OS

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

We could add to the compatibility paragraph that compatibility with files 
produced by the same program on a different platform is not guaranteed.

For the option, that would be an enhancement, and you should open a new issue 
for that.

--
assignee:  -> docs@python
components: +Documentation -Windows
nosy: +docs@python, r.david.murray
stage:  -> needs patch
type: behavior -> enhancement
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue18899] make pystone.py Py3 compatible in benchmark suite

2016-08-30 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> out of date
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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Ville Skyttä added the comment:

Right, I noticed the asyncio test breakage as well, that was one of the reasons 
I attached a couple of versions of the patch. spelling3 was not supposed to 
contain the breaking changes any more, maybe you worked on an earlier one? 
Anyway, thanks.

--

___
Python tracker 

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



[issue27904] Let logging format more messages on demand

2016-08-30 Thread Ville Skyttä

New submission from Ville Skyttä:

Avoid some string formatting operations on disabled log levels.

--
files: logging.patch
keywords: patch
messages: 273971
nosy: scop
priority: normal
severity: normal
status: open
title: Let logging format more messages on demand
type: performance
Added file: http://bugs.python.org/file44284/logging.patch

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Putting it another way:   To an origin server, 'Accept: */*' means it can 
return anything it wants.  To a proxy server, the absence of an accept header 
means in can return anything it has cached (possibly different from what the 
origin server would have returned).  In contract, to a proxy server, 'Accept: 
*/*' means return exactly what the origin server would have returned with the 
same headers.

--

___
Python tracker 

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



[issue27903] Avoid ResourceWarnings from platform._dist_try_harder

2016-08-30 Thread Ville Skyttä

New submission from Ville Skyttä:

Use opened files as context managers.

--
components: Library (Lib)
files: platform-resourcewarning.patch
keywords: patch
messages: 273969
nosy: scop
priority: normal
severity: normal
status: open
title: Avoid ResourceWarnings from platform._dist_try_harder
type: enhancement
Added file: http://bugs.python.org/file44283/platform-resourcewarning.patch

___
Python tracker 

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



[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Update:  After more research, I learned that while 'Accept: */*' should not 
have an effect on the origin webserver, it can and does have an effect on proxy 
servers.

Origin servers are allowed to vary the content-type of responses when given 
different Accept headers.  When they do so, they should also send "Vary: 
Accept".   

Proxy servers such as NGinx and Varnish respond to the "Vary: Accept" by 
caching the different responses using a combination of url and the accept 
header as the cache key.  If the request has 'Accept: */*', then the cache 
lookup returns the same result as if the 'Accept: */*' had been passed directly 
to the server.  However, if the Accept header is omitted, the proxy cache can 
return any of the cached responses (typically the most recent, regardless of 
content-type).

Accordingly, it is a good practice to include 'Accept: */*' in the request so 
that you get a consistent result (what the server would have returned) rather 
than the inconsistent and unpredictable content-types you would receive in the 
absence of the Accept header.  I believe that is why the other tools and book 
examples use 'Accept: */*' even though the origin wouldn't care.

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Anthony Flury

Anthony Flury added the comment:

Not sure I agree with closing this. I am not convinced (as a reasonably 
seasoned developer) that the documentation is clear.

It may not be a bug in the code, resulting as it does from a change in the way 
methods are implemented in Python 3.5, but I do think that the documentation 
could be a lot clearer. It does read as if it is written for someone who 
already knows what the library does, rather than as a guide for someone trying 
to work through it for the first time.

I have changed this to a documentation issue - I hope that this is ok.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue25446] smtplib.py AUTH LOGIN code messed up sending login and password data since 3.5

2016-08-30 Thread Miko Ohtamaa

Miko Ohtamaa added the comment:

I think there is something more in this. 

I am running Python 3.5.0 (default, Apr 24 2016, 12:47:36).

Sparkpost servers require AUTH LOGIN approach as per their instructions 
https://support.sparkpost.com/customer/portal/articles/1988470-smtp-connection-problems

When trying to use these (free) servers smtplib authentication will result to 
smtplib.SMTPAuthenticationError: (500, b'5.5.2 unrecognized command') like in 
the issue description earlier. I am still investigating this.

--
nosy: +miohtama, ned.deily

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mark probably already knows this, but I found this SO answer to be informative: 
 
http://stackoverflow.com/questions/3886988/how-to-distinguish-different-types-of-nan-float-in-python

--

___
Python tracker 

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



[issue27902] pstats.Stats: strip_dirs() method cannot handle file paths from different OS

2016-08-30 Thread Jaroslav

New submission from Jaroslav:

Setup
=

profile data from machine
-
- Win 7 (64bit)
- Python 3.5.2 (32bit)

data analyzed on

- Lubuntu 16.04 (64bit) incl. Python 3

issue
-
method strip_dirs() cannot extract the base name since it assumes the 
Unix-style file paths. not tested for opposite direction. no exception emitted.

comment
---
1. optional argument controlling the used 'path' module can definitely help
2. documentation update will be welcome

--
components: Windows
messages: 273964
nosy: Jaroslav, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: pstats.Stats: strip_dirs() method cannot handle file paths from 
different OS
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue27842] Order CSV header fields

2016-08-30 Thread Steve Holden

Steve Holden added the comment:

A pleasure. Pretty heavily committed at present, but all Python related so 
maybe there'll be more small positive improvements.

--

___
Python tracker 

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



[issue27894] Fix to_addrs refs in smtplib docs

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I like this. Very nice.  What I understand is that callers that access 
PySlice_GetIndicesEx via the header file (included with Python.h) will see the 
function as a macro.  When the macro is expanded, the length expression will be 
evaluated after any __index__ calls.

This approach requires that the length expression calculate the length from the 
sequence, rather than being a length computer before the call. I checked and 
all of our users in /Objects pass some form of seq.get_size().  This approach 
also requires that the function be accessed via .h rather than directly as the 
function in the .c file.  If we go this way, should he PySlice_GetIndicesEx doc 
say something?

I reviewed the two new functions and am satisfied a) that they correctly 
separate converting None and non-ints to ints from adjusting start and stop as 
ints according to length and b) that the effect of the change in logic for the 
latter is to stop making unnecessary checks that must fail.

--

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 89ce78ce1bfa by Raymond Hettinger in branch 'default':
Issue #27895: Strengthen the dict reader tests.
https://hg.python.org/cpython/rev/89ce78ce1bfa

--

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread R. David Murray

R. David Murray added the comment:

They are both correct.  In 2.7 a class method is a method.  In python3, a class 
method is a function.

As for the docs, the python3 docs say that it returns true for "a bound method 
on an object", while the python2 docs say "a bound or unbound method".  A class 
method is not bound, and unbound method do not exist in python3.  So the docs 
are correct as well.  The notes about the difference could go into a porting 
guide, but I don't think they belong in the main docs.

To fix your code, just treat function objects on classes as what you are 
thinking of as methods.  Because they are: any function assigned to a class 
becomes a bound method when invoked through an instance.  I think that's even 
backward compatible, though I haven't checked.

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Note that Python 3 did away with unbound methods: in Python 3, `a.m` is simply 
a function, so there's little the `inspect` module can do to distinguish it 
from a regular top-level function.

https://docs.python.org/3/whatsnew/3.0.html#operators-and-special-methods

--
nosy: +mark.dickinson

___
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-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Since we're using re as the sample, here's where re.I is defined:

Lib/re.py:
-
I = IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case

As already mentioned, re.I results in 2, and a re.compile object is not usable 
as a re flag.

> Also, I suppose that means you've given up on the autocreation

We decided auto-created values were too magical for the stdlib (see 
issue26988).  They will exist in my aenum package, though.

> (since the values _are_ semantical here),

The values have meaning because the underlying library gave them meaning; so 
assuming a type of Flags are used, they will be IntFlags.

> and I suppose you'll require all the declared values to be powers of 2.

Nope.  You are welcome to give more meaningful names to different combinations 
of powers of two.

> With those conditions, I think this is a good enhancement of Python.

Hopefully you still think so. ;)

--

___
Python tracker 

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



[issue27842] Order CSV header fields

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Steve.

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



[issue27842] Order CSV header fields

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb3e2a5be31b by Raymond Hettinger in branch 'default':
Issue #27842: The csv.DictReader now returns rows of type OrderedDict.
https://hg.python.org/cpython/rev/bb3e2a5be31b

--
nosy: +python-dev

___
Python tracker 

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



[issue27901] inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2016-08-30 Thread Anthony Flury

New submission from Anthony Flury:

Consider the following code in Python2.7 & Python3.5 

import inspect

class a(object):
 def m(self):
 pass

in Python 2.7 

inspect.ismethod(a.m) returns True

in Python 3.5
 
inspect.ismethod(a.m) returns False

Not sure which is `correct`, but I can see the Python3.5 result causing some 
issues with automatic code documenters. 

I have code which will break under Python3.5 with this - my code performs 
static analysis of code, detecting functions, classes, attributes, and also 
traversing the mro to find inherited methods etc. Amongst other things this 
code identifies methods on classes, without instantiating those classes.

This may simply require a documentation change to explain the difference on 
Py3.5 - rather than a code change.

--
components: Library (Lib)
messages: 273955
nosy: anthony-flury
priority: normal
severity: normal
status: open
title: inspect.ismethod returns different results on the same basic code 
between Python2.7 Python3.5
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



[issue23591] enum: Add Flags and IntFlags

2016-08-30 Thread Vedran Čačić

Vedran Čačić added the comment:

The weirdest thing is that it already works pretty well in output of re.compile.

>>> re.compile('', re.I | re.M)
re.compile('', re.IGNORECASE|re.MULTILINE)
>>> _.flags  # re.UNICODE == 32 added automatically
42

So the only thing we should enhance is the output of .flags, and it seems that 
all the necessary code is already in the source code of __repr__ of SRE_Pattern 
objects.

Also, I suppose that means you've given up on the autocreation (since the 
values _are_ semantical here), and I suppose you'll require all the declared 
values to be powers of 2. With those conditions, I think this is a good 
enhancement of Python.

--

___
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-08-30 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue27889] ctypes interfers with signal handling

2016-08-30 Thread Andre Merzky

Andre Merzky added the comment:

I also see the problem on 2.7.11, on MacOS, but with significantly lower 
frequency.  I can't tell if that is due to changes in Python, the different 
architecture, or whatever...

$ python -V
Python 2.7.11

$ uname -a
Darwin cameo.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 
2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64

$ while true; do i=$((i+1)); echo -n "$i: "; python t.py || break; done
1: except: caught sigusr2
2: except: caught sigusr2
3: except: caught sigusr2
...
134: except: caught sigusr2
Traceback (most recent call last):
  File "t.py", line 30, in 
print 'unexcepted'
  File "t.py", line 14, in sigusr2_handler
raise RuntimeError('caught sigusr2')
RuntimeError: caught sigusr2

--

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

I missed Antoine's 2015 comments on the test code. Here's one more version of 
the patch, which addresses those comments.

--
Added file: http://bugs.python.org/file44282/cpython-struct-float16-v9.patch

___
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-08-30 Thread Steve Newcomb

Steve Newcomb added the comment:

On 08/30/2016 01:24 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka added the comment:
>
> According to your profile results all re functions are 2.5-4 times faster 
> under 2.7.12 than under 2.7.6. May be I misinterpret it?
I can't explain the profiler's report.  I'm kind of glad that you, too, 
find it baffling.  Is it possible that the profiler doesn't actually 
work predictably in the multiprocessing context?  If so, one thing I can 
*easily* do is to disable multiprocessing in that code and see what the 
profiler reports are then.  It will take all night, but I'm beginning to 
think it would be worthwhile, because it might point the finger of blame 
at either the multiprocessing module or the re module, but not both at once.

(I originally provided a "disable multiprocessing" capability in that 
code in order to use the Python debugger with it.  It would kind of make 
sense if the profiler had limitations similar to those of the debugger.)
>
> Note that 96-99% of time (2847.099 of 2980.718 seconds under 2.7.6 and 
> 4474.890 of 4519.872 seconds under 2.7.12) is spent in posix.waitpid. The 
> rest of time is larger under 2.7.6 (2980.718 - 2847.099 = 133.619) than under 
> 2.7.12 (4519.872 - 4474.890 = 44.982).
Yeah, I'm beginning to wonder if those strange statistics, too, are 
artifacts of using a single-process profiler in a multiprocessing context.

--

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.6 -Python 3.3

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Updated patch:
- Fix NaN packing behaviour.
- Expand documentation note on the half-precision format, with links to the 
wikipedia pages for IEEE 754 and for half-precision. (No direct link to IEEE 
754 itself, since it isn't publicly available.)
- Use unpack_halffloat consistently; add pack_halffloat helper function.

If there's no further feedback, I'll apply this in the next day or two.

--
Added file: http://bugs.python.org/file44281/cpython-struct-float16-v8.patch

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +skrah

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> XML munges apos entity in tag content

___
Python tracker 

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



[issue24139] Use sqlite3 extended error codes

2016-08-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Attached is a patch to enable the extended error codes. This patch should be 
dependent on issue 16379.
Without returning the sqlite error code in the exception the extended error 
code does not reveal any information not currently available. As you can see in 
https://github.com/mackyle/sqlite/blob/ebb27fe5bd5045d924d99cdd7dec9b7064c24768/src/main.c#L1318
 there are messages only for the non-extended error codes and that is what is 
exposed now.

--
keywords: +patch
nosy: +palaviv
Added file: http://bugs.python.org/file44280/24139.patch

___
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-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Raymond, thanks for your support.

I am happy to have a flags variant.  The advice to wait and let Enum mature 
instead of adding the Flag variant at the beginning was sound, and we have a 
better product to show for it now.

The four base Enum-type classes will be:
- Enum
- IntEnum
- Flags
- IntFlags

I see no reason to add any more than these four to the stdlib -- further 
specializations can live in recipes, third-party modules, or private libraries.

While Enum and Flags are the heart of the enum module, IntEnum and IntFlags are 
present for two reasons:
- commonly needed when interfacing with other systems
- use in the stdlib itself

Pollution (otherwise known as enums escaping into other code where they don't 
make sense) is controlled by:
- IntEnums losing their enum status as soon as they are combined with
  any other number; and
- IntFlags losing their enum status as soon as a non-bitwise operator is
  used on them.

I'll commit as soon as the test suite is finished (and any failures are not 
attributable to these changes), and work on the docs later.

Serhiy, I'm not going to include your changes to re, os, etc., as they are not 
part of adding Flags/IntFlags.  Please open new issues for them.  I am not 
opposed to those changes, as

>>> re.I


is more useful than

>>> re.I
2

--

___
Python tracker 

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



[issue27900] ctypes fails to find ncurses via ncursesw on Arch Linux

2016-08-30 Thread daniel hahler

New submission from daniel hahler:

The following code fails on Arch Linux:

import ctypes.util
print(ctypes.util.find_library("ncurses"))

It first looks at "ldconfig -p" (via _findSoname_ldconfig), which only
contains:

libncursesw.so.6 (libc6,x86-64) => /usr/lib/libncursesw.so.6
libncursesw.so.6 (libc6) => /usr/lib32/libncursesw.so.6
libncursesw.so (libc6,x86-64) => /usr/lib/libncursesw.so
libncursesw.so (libc6) => /usr/lib32/libncursesw.so
libncurses++w.so.6 (libc6,x86-64) => /usr/lib/libncurses++w.so.6
libncurses++w.so (libc6,x86-64) => /usr/lib/libncurses++w.so

/usr/lib/libncurses.so exists, but as a text file:

INPUT(-lncursesw)

Then "_findLib_gcc" is called, which tries to link a file, and then looks at
its output:

% if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; 
then CC=cc;else exit 10; fi;LANG=C LC_ALL=C $CC -Wl,-t -o /tmp/tmp1ysftojh 2>&1 
-lncurses
/usr/bin/ld: mode elf_x86_64

   
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtbegin.o
-lncursesw 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libncursesw.so)
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/lib/libc.so.6
(/usr/lib/libc_nonshared.a)elf-init.oS
/usr/lib/ld-linux-x86-64.so.2
/usr/lib/ld-linux-x86-64.so.2
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crtn.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o: In function 
`_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: link errors found, deleting executable `/tmp/tmp1ysftojh'
collect2: error: ld returned 1 exit status

I don't know if "ldconfig" could be made to display the "text symlink", but 
with the "cc"-method, it could look for an explicit "cannot find" error 
instead?!

% if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; 
then CC=cc;else exit 10; fi;LANG=C LC_ALL=C $CC -Wl,-t -o /tmp/tmp1ysftojh 2>&1 
-lncursesxx
/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/crtbegin.o
libgcc_s.so.1 
(/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/../../../../lib/libgcc_s.so.1)
/usr/bin/ld: cannot find -lncursesxx
collect2: error: ld returned 1 exit status

The workaround is to also look for "ncursesw" explicitly.

I have noticed this with pyrepl, which uses it in 
https://bitbucket.org/pypy/pyrepl/src/9401662c4e6c11a4d66804361a7e7d09a1f379d7/pyrepl/_minimal_curses.py?at=default&fileviewer=file-view-default#_minimal_curses.py-19:26.

--
components: ctypes
messages: 273947
nosy: blueyed
priority: normal
severity: normal
status: open
title: ctypes fails to find ncurses via ncursesw on Arch Linux
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue27898] regexp performance degradation between 2.7.6 and 2.7.12

2016-08-30 Thread Steve Newcomb

Steve Newcomb added the comment:

On 08/30/2016 12:46 PM, Raymond Hettinger wrote:
> Raymond Hettinger added the comment:
>
> It would be helpful if you could run "hg bisect" with your set-up to isolate 
> the change that causes the problem.
I don't think I understand you.  There's no difference in the Python 
code we're using in both cases.  The only differences, AFAIK, are in the 
Python interpreter and in the Linux distribution.  I'm not qualified to 
analyze the differences in the latter items.
>Alternatively, make a small set of regular expressions that demonstrate 
> the performance regression.
It will be hard to do that, because the code is so complex, and because 
debugging in the multiprocessing context is so hairy. Still, it's the 
only approach I can think of, too.  Sigh.  I'm thinking about it.

--

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FYI, the patch did not apply cleanly to Python 3.5 so this was applied to 3.6 
only.  If someone feels this is important to them, they are welcome to backport 
the applicable parts of the patch.

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



[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2016-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually making slicing always working is easier than I expected. Maybe it is 
even easier than raise an error.

PySlice_GetIndicesEx() is split on two functions. First convert slice 
attributes to Py_ssize_t, then scale them to appropriate range depending on the 
length. Here is a sample patch.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file44279/slice_get_indices.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 75d6d5d9b674 by Raymond Hettinger in branch 'default':
Issue #27895:  Spelling fixes (Contributed by Ville Skyttä).
https://hg.python.org/cpython/rev/75d6d5d9b674

--
nosy: +python-dev

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Thanks for the patch.  Some of these were a bit embarrassing.

Removed the Lib/test/decimaltestdata because this is from an external source 
(not our code) that is periodically refreshed.   I had to hand edit some of the 
changes to test_asyncio because the patch was breaking those tests for some 
reason.  I had some hesitancy about changing function or variable names in real 
code and had to spend time looking at each in detail but they all seem 
legitimate.

--

___
Python tracker 

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Israel Fruchter

Israel Fruchter added the comment:

I've now found http://bugs.python.org/issue2647, and seem like this was 
classify as not a bug.

maybe documetion should say it ? or anther way to actuly decide about how to 
output those

--

___
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-08-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

According to your profile results all re functions are 2.5-4 times faster under 
2.7.12 than under 2.7.6. May be I misinterpret it?

Note that 96-99% of time (2847.099 of 2980.718 seconds under 2.7.6 and 4474.890 
of 4519.872 seconds under 2.7.12) is spent in posix.waitpid. The rest of time 
is larger under 2.7.6 (2980.718 - 2847.099 = 133.619) than under 2.7.12 
(4519.872 - 4474.890 = 44.982).

--
nosy: +serhiy.storchaka

___
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-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

[Ethan]
> My experience is that a module maintainer, or somebody claiming to speak
> for the module maintainer, can close any issue in their area at any 
> time regardless of the number of core devs in favor of a change.

Ethan, it is still up to you and the other module maintainers to decide whether 
this goes in or whether to defer it for a release cycle.  If you have any 
concerns about having too many enum variants and think this is at odds with 
your goals for the module, say so here and we can resolve it at the sprints.  
On the other hand, if you're happy with it, we should get it applied as soon as 
possible.

[Serhiy]
> If general IntFlags will not added, I'm going to open separate issues
> for adding specialized class for every particular case (re, os, etc).

When enum went in, I thought Guido had said and everyone agreed to refrain 
sweeping through the standard lib and applying enums broadly to long standing 
and stable APIs.  Perhaps something has changed since them but there was a 
clear intention to show restraint, let enums mature, respect stable APIs, and 
to wait for demonstrated need (i.e. actual rather than imagined user 
difficulties).

--
nosy: +rhettinger

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue25423] Deprecate benchmarks that execute too quickly

2016-08-30 Thread Brett Cannon

Brett Cannon added the comment:

I trust you fixed it. :)

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



[issue27899] Apostrophe is not replace with ' ElementTree.tostring (also in Element.write)

2016-08-30 Thread Israel Fruchter

New submission from Israel Fruchter:

Both on python2.7 and python3.4
>>> from xml.etree import cElementTree as ET
>>> text = 'its > < & ''
>>> root = ET.fromstring(text.encode('utf-8'))
>>> ET.tostring(root, method="xml")
its > < & '

I would expected to return the same as the input to be a complient XML 1.0

I would understand why for html it would return something diffrent, see:
http://stackoverflow.com/questions/2083754/why-shouldnt-apos-be-used-to-escape-single-quotes

as a workaround I had to path ElementTree:

from xml.etree.ElementTree import _escape_cdata ,_raise_serialization_error
from mock import patch

def _escape_cdata(text):
# escape character data
try:
# it's worth avoiding do-nothing calls for strings that are
# shorter than 500 character, or so.  assume that's, by far,
# the most common case in most applications.
if "&" in text:
text = text.replace("&", "&")
if "<" in text:
text = text.replace("<", "<")
if ">" in text:
text = text.replace(">", ">")
if "'" in text:
text = text.replace("'", "'")
return text
except (TypeError, AttributeError):
_raise_serialization_error(text)

from xml.etree import cElementTree as ET

text = 'its > < & ''
root = ET.fromstring(text.encode('utf-8'))

with patch('xml.etree.ElementTree._escape_cdata', new=_escape_cdata):

s = ET.tostring(root, encoding='unicode', method="xml")
print(s)

--
components: XML
messages: 273937
nosy: fruch
priority: normal
severity: normal
status: open
title: Apostrophe is not replace with ' ElementTree.tostring (also in 
Element.write)
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



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

2016-08-30 Thread Brett Cannon

Brett Cannon added the comment:

Just FYI, Alecsandru, I plan on applying your patches this week or next, so if 
you can just double-check they still apply cleanly that would be great.

--

___
Python tracker 

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



[issue2445] Use The CygwinCCompiler Under Cygwin

2016-08-30 Thread David Stanek

Changes by David Stanek :


--
nosy:  -dstanek

___
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-08-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It would be helpful if you could run "hg bisect" with your set-up to isolate 
the change that causes the problem.  Alternatively, make a small set of regular 
expressions that demonstrate the performance regression.

--
nosy: +rhettinger

___
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-08-30 Thread Ethan Furman

Ethan Furman added the comment:

Patch includes tests, but not docs.

>From a previous comment:
---
> As it stands, Weird(7) would be , and if A was not
> defined an error would be raised.

Actually, it would be  since BC has a higher value than A.

--
stage:  -> patch review
Added file: http://bugs.python.org/file44278/issue23591.stoneleaf.02.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

There's some NaN behaviour that needs fixing in the packing code: packing a NaN 
currently creates a signalling NaN rather than a quiet NaN, and the sign of a 
NaN isn't respected. (One can make a strong argument that the sign of the NaN 
doesn't matter, but we're respecting the sign for '>> '{:064b}'.format(struct.unpack('>> '{:032b}'.format(struct.unpack('>> '{:016b}'.format(struct.unpack('>> '{:064b}'.format(struct.unpack('>> '{:032b}'.format(struct.unpack('>> '{:016b}'.format(struct.unpack('

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



[issue26284] Fix telco benchmark

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

@Stefan: Can you please check bm_telco.py and maybe propose a pull request if 
something is wrong?

--

___
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-08-30 Thread Steve Newcomb

New submission from Steve Newcomb:

Our most regular-expression-processing-intensive Python 2.7 code takes 2.5x 
more execution time in 2.7.12 than it did in 2.7.6.  I discovered this after 
upgrading from Ubuntu 14.04 to Ubuntu 16.04.  Basically this code runs 
thousands of compiled regular expressions on thousands of texts.  Both the 
multiprocessing module and the re module are heavily used.

See attached profiler outputs, which look quite different in several respects.  
I used the profiling module to profile the same Python code, processing the 
same data, using the same hardware, under both Ubuntu 14.04 (Python 2.7.6) and 
Ubuntu 16.04 (Python 2.7.12).  

It is striking, for example, that cPickle.load appears so prominently in the 
2.7.12 profile -- a fact which appears to implicate the multiprocessing module 
somehow.  But I suspect that the re module is more likely the main source of 
the problem, because the execution times of other production steps -- steps 
that do not call the multiprocessing module -- also appear to be extended to a 
degree that is roughly proportional to the amount of regular expression 
processing done in those other steps.

I will happily provide any further information I can.  Any insights about this 
surprisingly severe performance degradation would be welcome.

--
files: profiles_2.7.6_vs_2.7.12
messages: 273932
nosy: steve.newcomb
priority: normal
severity: normal
status: open
title: regexp performance degradation between 2.7.6 and 2.7.12
Added file: http://bugs.python.org/file44277/profiles_2.7.6_vs_2.7.12

___
Python tracker 

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



[issue25573] FrameSummary repr() does not support previously working uses of repr in traceback module

2016-08-30 Thread Tomas Orsava

Tomas Orsava added the comment:

This problem has already been addressed in issue 27208, and it was fixed by 
updating the documentation to reflect the new repr().

Therefore, I believe this issue can be closed.

--
nosy: +torsava

___
Python tracker 

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



[issue18899] make pystone.py Py3 compatible in benchmark suite

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, pystone... I didn't know we had included that particular horror in the 
> benchmark suite :-)

pystone was removed from the new https://github.com/python/performance 
benchmark suite.

I suggest to close this issue as outdated.

--
nosy: +haypo

___
Python tracker 

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



[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

The new https://github.com/python/performance benchmark suite has a very 
different design than the old https://hg.python.org/benchmarks benchmark suite:

* it now only runs benchmarks in a virtual environment
* dependencies are installed in the venv by pip
* there is a "run" command which now accepts a --python=PYTHON option to choose 
the Python binary (and so the tested Python version)

There is no more such thing as ported_lib().

Can I now close this issue as outdated, or do you consider that performance 
still has this issue?

--
nosy: +haypo

___
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-08-30 Thread STINNER Victor

STINNER Victor added the comment:

The new https://github.com/python/performance benchmark suite now displays the 
median rather than the arithmetic mean (average) by default (it also displays 
the standard deviation).

See the perf issue for a discussion about median vs mean:
https://github.com/haypo/perf/issues/1

Can we now close this issue?

--
nosy: +haypo

___
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-08-30 Thread STINNER Victor

STINNER Victor added the comment:

Can you please send a pull request to the new 
https://github.com/python/performance project?

--
nosy: +haypo

___
Python tracker 

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



[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-08-30 Thread Xiang Zhang

New submission from Xiang Zhang:

When supplied a custom string with upper returning a non-string, 
pysqlite_connection_create_collation will fail assertion and crash. Serhiy, I 
think we can use the same way in set_isolation_level to avoid this.

--
components: Library (Lib)
files: create_collation.patch
keywords: patch
messages: 273927
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Avoid possible crash in pysqlite_connection_create_collation
type: crash
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44276/create_collation.patch

___
Python tracker 

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



[issue25423] Deprecate benchmarks that execute too quickly

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

I believe that this issue was indirectly fixed by the issue #26275. The new 
flavor of the benchmark suite now calibrates (computes the number of outter 
loop iterations) each benchmark based on time, no more using a fixed number of 
loop iteartions.

Brett: Can you please confirm that the issue was fixed in the new performance 
benchmark suite?
https://github.com/python/performance


$ python3 -m performance run -b silent_logging,unpack_sequence --fast -o json
Python benchmark suite 0.1.3dev
(...)
Report on Linux smithers 4.5.7-300.fc24.x86_64 #1 SMP Wed Jun 8 18:12:45 UTC 
2016 x86_64 x86_64
Total CPU cores: 8

### logging/no_output ###
Median +- std dev: 809 ns +- 16 ns

### unpack_sequence ###
Median +- std dev: 120 ns +- 4 ns


* silent_logging used 10 inner-loops and 2^14 outter-loops
* unpack_sequence used 400 inner-loops and 4096 outter-loops

You can you this using the "python3 -m perf dump -v json" command on the output 
JSON file (search for "loop").

--
nosy: +haypo

___
Python tracker 

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



[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

This issue was fixed in the new flavor of the benchmark, the new performance 
project:
https://github.com/python/performance

--
dependencies:  -Fix telco benchmark
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



[issue11734] Add half-float (16-bit) support to struct module

2016-08-30 Thread Mark Dickinson

Mark Dickinson added the comment:

Thanks, Raymond. I'll do a final pass and aim to apply this in the next couple 
of days.

--

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-08-30 Thread STINNER Victor

STINNER Victor added the comment:

I worked on a new version of the benchmark suite, it is now called performance 
and moved to GitHub:
https://github.com/python/performance

In performance 0.1.2, bm_telco.py uses BytesIO for input and six.StringIO for 
output. The output is just one number per line, it's different than  
http://bugs.python.org/file41802/telco_haypo.py output.

I don't know which benchmark is "right".

I believe that bm_telco.py of performance is now much more stable thanks to the 
perf module which runs the benchmark in multiple processes (20 by default). It 
helps to get a better distribution of samples.

Example:

$ python3 -m performance run -b telco -o telco.json
(...)

$ python3 -m perf show --hist --stats --metadata telco.json 
Metadata:
- aslr: Full randomization
- cpu_config: 0-7=driver:intel_pstate, intel_pstate:no turbo, governor:powersave
- cpu_count: 8
- cpu_model_name: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
- description: Telco decimal benchmark
- hostname: smithers
- loops: 8
- name: telco
- perf_version: 0.7.4
- platform: Linux-4.5.7-300.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
- python_executable: 
/home/haypo/prog/python/performance/venv/cpython3.5-da07a9f70715/bin/python
- python_implementation: cpython
- python_version: 3.5.1 (64bit)
- timer: clock_gettime(CLOCK_MONOTONIC), resolution: 1.00 ns

22.7 ms: 18 #
23.0 ms: 27 
###
23.4 ms:  7 
23.7 ms:  1 ###
24.1 ms:  2 ##
24.4 ms:  1 ###
24.7 ms:  0 |
25.1 ms:  1 ###
25.4 ms:  0 |
25.8 ms:  0 |
26.1 ms:  0 |
26.5 ms:  0 |
26.8 ms:  0 |
27.1 ms:  0 |
27.5 ms:  0 |
27.8 ms:  0 |
28.2 ms:  0 |
28.5 ms:  0 |
28.9 ms:  1 ###
29.2 ms:  1 ###
29.5 ms:  1 ###

Total duration: 15.1 sec
Start date: 2016-08-30T18:09:49
End date: 2016-08-30T18:10:07
Raw sample minimum: 182 ms
Raw sample maximum: 237 ms

Number of runs: 20
Total number of samples: 60
Number of samples per run: 3
Number of warmups per run: 1
Loop iterations per sample: 8

Minimum: 22.8 ms (-2%)
Median +- std dev: 23.2 ms +- 1.4 ms
Mean +- std dev: 23.6 ms +- 1.4 ms
Maximum: 29.7 ms (+28%)

Median +- std dev: 23.2 ms +- 1.4 ms


The histogram helps to see that there is no such "minimum", but more a gaussian 
curve. The perf module uses the median of samples rather than the minimum, it 
also displays and computes the standard deviation by default.

--

___
Python tracker 

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



[issue27896] Allow passing sphinx options to Doc/Makefile

2016-08-30 Thread Julien

New submission from Julien:

Context: 

 - Providing french translation to docs.python.rg/fr/: 
http://bugs.python.org/issue26546
 - Simplifying my first proposition of docsbuild-scripts: 
https://github.com/python/docsbuild-scripts/pull/1

Goals:

 - Simplify my modifications of docsbuild-scripts to make it more robust
 - Avoid executing external (~untrusted) Makefile on docs.python.org servers

To achieve this, I need the ``Doc/Makefile`` to be sufficient to build 
internationalized versions by passing sphinx options to it, I'd like to call, 
typically:

make autobuild-stable SPHINXOPTS='-D language=fr -D locale_dirs=./locale/'

Which work if `Doc/Makefile` don't erase but append to the `SPHINXOPTS` 
variable. Which is done by `allow_sphinxopts.diff`.

We may simplify it further by adding `locale_dirs` to `Doc/conf.py` which does 
not break the english build, but I'm not sure if it's of any interest.

We may abstract it further by accepting a new parameter like SPHINXLANG='fr', 
with a default of 'en', but in every case I think it's a good thing to allow 
passing arbitrary SPHINXOPTS so let's start with this?

--
assignee: docs@python
components: Documentation
files: allow_sphinxopts.diff
keywords: patch
messages: 273921
nosy: docs@python, sizeof
priority: normal
severity: normal
status: open
title: Allow passing sphinx options to Doc/Makefile
versions: Python 3.6
Added file: http://bugs.python.org/file44275/allow_sphinxopts.diff

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Added file: http://bugs.python.org/file44274/spelling3.patch

___
Python tracker 

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



[issue27895] Spelling fixes

2016-08-30 Thread Ville Skyttä

Changes by Ville Skyttä :


Removed file: http://bugs.python.org/file44273/spelling2.patch

___
Python tracker 

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



  1   2   >