[issue23951] Update devguide style to use a similar theme as Docs

2016-07-19 Thread Lisa Roach

Lisa Roach added the comment:

Whoops, forgot to remove some errant code.

--
Added file: http://bugs.python.org/file43804/devguide_theme_revised.patch

___
Python tracker 

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



[issue23951] Update devguide style to use a similar theme as Docs

2016-07-19 Thread Lisa Roach

Lisa Roach added the comment:

Thanks for the feedback!

I've cleaned up the patch, hopefully I've been able to catch all the little 
things that needed to be removed. 

I was able to wire in rstlint to the make.bat and makefile, so 'make check' 
should now work. 

I believe tools/static/py.png is included in the patch, if you are still not 
seeing it let me know. 


One thing I haven't been able to figure out: both the devguide and python 3 
documentation have below the search bar this sentence: 
"Enter search terms or a module, class or function name. "

This sentence is not appearing below my patch's search bar, I am not sure why. 
Additionally, the "go" button is being generated slightly differently (in a 
div), causing it to appear below the search bar instead of beside it. Any ideas 
on how to fix this?

--
Added file: http://bugs.python.org/file43803/devguide_theme_revised.patch

___
Python tracker 

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



[issue27546] Integrate tkinter and asyncio (and async)

2016-07-19 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Guido, that seems like a reasonable roadmap.  The examples directory is not in 
the CPython repo, but I found it here.
https://github.com/python/asyncio/tree/master/examples

For a demo based on crawl.py, the goal would be a live status report.  Perhaps 
as files are fetched, they could be entered into a Treeview-based url tree, 
with columns for the statistics. (I still have to learn to practical use of 
Treeview.)  This would require adding widget data insertion commands within the 
crawl code.  Who actually wrote it, that would understand it?

Responsiveness should be a matter of prioritizing events.  Using the  asyncio 
loop as a base, I did the minimum needed for the first demo and for the initial 
part of the follow-up below.  For general use, _run_once should be modified to 
always let gui events be handled 'soon' by either not blocking or having a 
short timeout.  The root.update call could be moved from run_forever to 
multiple places within _run_once.  At an extreme, the _process_events 
implementations could be modified to call root.update() after processing each 
io event.  According to timeit.timeit(root.update), a do-nothing call takes 
less than 4 microseconds on my machine.

---

I implemented my idea of updating a tk widget in an async for loop.  The 
attached tkaloop does so, with the syntax I proposed previously.  There is only 
a change to the timer api.  With respect to the datetime clock, the behavior is 
essentially the same as with the first code.

Given that one can do the same thing with a normal for loop and explicit update 
(as some beginners try to do), is this useful?

1. Responsiveness: A normal for-loop blocks, freezing the gui.  To test that 
this is not so here, I added a button to do something visible - change a 
background color.  While the clock is running, it only sort-of works, because 
clicks are only processed after each 1 second tick.  The reason is that the 
select call in _run_once gets a timeout that is the minimum time to a scheduled 
event.  (The same should be true in tkloop.py if similarly modified.)  The next 
step is to modify _run_once as discussed above.

Tk allows one to specify delays to the nearest millisecond and on my machine, 
that precision is real.

from tkinter import *
import time

root = Tk()
root.withdraw()
timer = time.perf_counter
##n = 999
##delay = 1
n=1
delay=337
def tick():
global n
if n:
n -= 1
root.after(delay, tick)
else:
print(timer() - start)

tick()
start = timer()
root.mainloop()

prints .3370... in multiple runs. 1000 loops with a delay of 1 ms takes 1.05... 
seconds.  Similar performance would be a target for run_forever.

2. Parallel looping.  Supposed we wanted to automate the background color 
changes, with an interval of, say x seconds.  If x is, say, .3, then one could 
use .1 second ticks and an update block that flips the background every 3 ticks 
and the clock every 10.

But what if the intervals are not so conveniently commensurable or the separate 
updates not so easily mashed together into one loop block?
Parallel looping with chained callbacks, whether with tk or asyncio is fairly 
easy.  I presume it could be done with asyncio coroutines (but have no 
experience).  What I would like, but cannot see, is a way to do so with async 
for.  Within a function, async for blocks execution of remaining code after the 
for statement the same as normal for statement.

My conclusion thus far: with the response issue solved, a single async for loop 
could work for some time-driven applications, including some that beginners 
write, but not all.

An alternative for reducing the callback boilerplate is an animate function.  I 
have thought of writing one for tkinter, but have not yet because I have not 
yet needed one for IDLE.

--
Added file: http://bugs.python.org/file43802/tkaloop.py

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Removed file: http://bugs.python.org/file43796/python-2.7-httpoxy.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Removed file: http://bugs.python.org/file43797/python-3.5-httpoxy.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Added file: http://bugs.python.org/file43801/python-3.5-httpoxy.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Rémi Rampin added the comment:

- Added CVE number
- Link to full note on getproxies() doc
- Improved comment on uppercase (lowercase will be preferred to mIxED_case too)

--
Added file: http://bugs.python.org/file43800/python-2.7-httpoxy.patch

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-19 Thread Ricardo Esperanza

Ricardo Esperanza added the comment:

Steve
CCleanr my registry, then restarted and execute instal again
It worked for a longer period and ended with different error
attached log.
logs attached

--
Added file: http://bugs.python.org/file43798/Python 3.5.2 
(32-bit)_20160719204204_000_core_JustForMe_rollback.log

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-19 Thread Ricardo Esperanza

Ricardo Esperanza added the comment:

Steve 
another log file

--
Added file: http://bugs.python.org/file43799/Python 3.5.2 
(32-bit)_20160719204204.log

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-19 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This does need to be fixed.  

FWIW, here is the relevant docstring from MutableMapping:
''' D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = 
E[k]
If E present and lacks .keys() method, does: for (k, v) in E: 
D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v
'''

--
nosy: +rhettinger

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-19 Thread Emanuel Barry

Changes by Emanuel Barry :


--
assignee:  -> eric.snow
components: +Library (Lib)
keywords: +3.5regression -3.4regression
nosy: +ebarry, eric.snow
stage:  -> needs patch

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-19 Thread Yury Selivanov

Yury Selivanov added the comment:

Jim, the patch lgtm. Will merge it soon.

--
assignee:  -> yselivanov

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Zachary Ware

Zachary Ware added the comment:

I have confirmed that this is not a Python issue.  PyNaCl takes some special 
coercion and a third-party library to build (see 
https://github.com/pyca/pynacl/issues/165), but I managed to get it to build 
with 3.5.1 and 3.6 and imported nacl._sodium in both with no problem.

--
stage:  -> resolved

___
Python tracker 

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



[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow

Changes by Eric Snow :


--
hgrepos:  -310

___
Python tracker 

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



[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow

Changes by Eric Snow :


Removed file: http://bugs.python.org/file43629/deforder-with-tp-slot.diff

___
Python tracker 

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



[issue25393] 'resource' module documentation error

2016-07-19 Thread Zachary Ware

Zachary Ware added the comment:

Thanks to Christos for the report and Alakshendra for the patch!

--
nosy: +zach.ware

___
Python tracker 

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



[issue25393] 'resource' module documentation error

2016-07-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 434fc614c506 by Zachary Ware in branch '2.7':
Issue #25393: Fix probable copy/paste error in resource docs
https://hg.python.org/cpython/rev/434fc614c506

New changeset 0fe2b7509707 by Zachary Ware in branch '3.5':
Issue #25393: Fix probable copy/paste error in resource docs
https://hg.python.org/cpython/rev/0fe2b7509707

New changeset 829117ae2e55 by Zachary Ware in branch 'default':
Closes #25393: Merge with 3.5
https://hg.python.org/cpython/rev/829117ae2e55

--
nosy: +python-dev
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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Decorater

Decorater added the comment:

Commenting*

--

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Decorater

Decorater added the comment:

hmm unless it has something to do with only my bot's debug command doing the 
following as it seems it could possible be only my bot's debug command however 
commenting out 1 thing in Discord.py also generates this Issue.

Debug Command Code:
https://bpaste.net/show/904eccf5bdc0 (what I was using when I found this issue)

Result of Uncommenting Import Error Catch in Discord.py:
Traceback (most recent call last):
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\DecoraterBot.py", line 10, i
n 
import discord
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\disco
rd\__init__.py", line 20, in 
from .client import Client, AppInfo
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\disco
rd\client.py", line 42, in 
from .voice_client import VoiceClient
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\resources\Dependencies\disco
rd\voice_client.py", line 58, in 
import nacl.secret
  File "nacl\secret.py", line 18, in 
  File "nacl\bindings\__init__.py", line 17, in 
  File "nacl\bindings\crypto_box.py", line 17, in 
ImportError: No module named 'nacl._sodium'

Yep this must be some Regression in 3.6 or something uncaught it does however 
work in 3.5.2 as expected.

--

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for this patch. The CVE number assigned to python -  CVE-2016-1000110.

There is redundancy in /Doc/library/urllib.request.rst change where the same 
paragraph is repeated twice. See if you can have it at a single location as a 
`Note` and reference it.

--

___
Python tracker 

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



[issue19489] move quick search box above TOC

2016-07-19 Thread Ammar Askar

Ammar Askar added the comment:

bump, added the documentation experts list, not sure if the core dev who made 
this issue is still active.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-19 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

Consider the following code:

$ cat x.py
from collections import OrderedDict
class X:
def items(self):
print('items')
return []
def keys(self):
print('keys')
return []

print(dict(X()))
print(OrderedDict(X()))

When I run it under python 3.4, I get

$ python3.4 x.py
keys
{}
keys
OrderedDict()

but under python 3.5, I get

$ python3.5 x.py
keys
{}
items
OrderedDict()


Under 3.4 both dict and OrderedDict constructors call the keys() method of the 
underlying object (and then call __getitem__ repeatedly if keys() returns a 
non-empty list), but in 3.5 OrderedDict behavior changed and it calls the 
values() method instead.

--
keywords: 3.4regression
messages: 270842
nosy: belopolsky
priority: normal
severity: normal
status: open
title: An unexpected difference between dict and OrderedDict
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



[issue25393] 'resource' module documentation error

2016-07-19 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

I've looked at the patch, and the fix looks correct to me. Thanks Alakshendra! 

I'll verify it builds correctly.

--
nosy: +Evelyn Mitchell

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Cory Benfield

Cory Benfield added the comment:

Ok, so I've taken a preliminary look at this patch. It looks good to me! I have 
one question: right now the patch as written will blow away not just 
HTTP_PROXY, but also any other mixed-case spelling of that name (e.g. 
HtTp_PrOxY) in a CGI environment.

That's *probably* not a concern: I think in practice such a spelling is almost 
never used. However, I wanted to draw it out explicitly: we should probably 
include a code comment that indicates that we know that it's a side effect of 
the code, and that we don't care.

For what it's worth, we should also consider commenting with a note regarding 
the CVE number assigned to Python. We may want to consider getting a CVE number 
for this specific fix as well, though I'd need to chat to someone in the PSRT 
at this point to get an idea of what they think.

Good work!

--

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Added file: http://bugs.python.org/file43797/python-3.5-httpoxy.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Added file: http://bugs.python.org/file43796/python-2.7-httpoxy.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Removed file: 
http://bugs.python.org/file43779/python-2.7-httpoxy-mitigation.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Rémi Rampin

Changes by Rémi Rampin :


Removed file: 
http://bugs.python.org/file43780/python-3.5-httpoxy-mitigation.patch

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Brett Cannon

Brett Cannon added the comment:

Anything is possible, but I'm not aware of any big changes in extension loading 
in 3.6. Would need a test case to verify.

--

___
Python tracker 

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



[issue27567] Add constants EPOLLRDHUP and POLLRDHUP to module select.

2016-07-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d87f30c29ad4 by Berker Peksag in branch 'default':
Issue #27567: Expose the POLLRDHUP constant in the select module
https://hg.python.org/cpython/rev/d87f30c29ad4

--

___
Python tracker 

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



[issue27567] Add constants EPOLLRDHUP and POLLRDHUP to module select.

2016-07-19 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
status: open -> closed

___
Python tracker 

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



[issue27575] dict viewkeys intersection slow for large dicts

2016-07-19 Thread David Su

New submission from David Su:

In dictobject.c, the function dictviews_and performs a very expensive set 
creation operation on the keys of the self dict object:

>From Python 2.7:
...
static PyObject*
dictviews_and(PyObject* self, PyObject *other)
{
PyObject *result = PySet_New(self);
...
tmp = PyObject_CallMethod(result, "intersection_update", "(O)", other);
...

Similar logic can be found in the Python 3 code as well.


For large dicts (~10 000 000 keys), it takes a significant amount of time to 
copy the keys into a new set, and also wastes a lot of memory. This issue is 
amplified when the intersection operation is performed many times.

This implementation uses O(len(self)) time and space, while it is expected to 
use O(min(len(self), len(other)) time and space.


Solution 1: Manually copy the keys of the dict into a set, and perform all 
intersection operations on that set. However, still wastes lots of memory. 

Solution 2 (Recommended): Port the intersection logic from the set class to the 
dict view class.

--
components: Library (Lib)
messages: 270836
nosy: David Su2
priority: normal
severity: normal
status: open
title: dict viewkeys intersection slow for large dicts
type: performance
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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-07-19 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +haypo

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Steve Dower

Steve Dower added the comment:

Any chance this is a regression in the "extension module within a package" 
issue we saw during 3.5?

There's a pretty relevant difference between:

>>> import nacl._sodium
>>> import _cffi_backend

--

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-07-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached patch fixes the issue. There is at least already an existing test 
case: test_subprocess.MiscTests.test_getoutput calls 
subprocess.getstatusoutput() that runs a Popen instance with shell=True.

--
stage:  -> patch review
Added file: http://bugs.python.org/file43795/unix_shell_16255.patch

___
Python tracker 

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



[issue27574] Faster parsing keyword arguments

2016-07-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Parsing keyword arguments is much more slow than parsing positional arguments. 
Parsing time can be larger that useful execution time.

$ ./python -m timeit "b'a:b:c'.split(b':', 1)"
100 loops, best of 3: 0.638 usec per loop
$ ./python -m timeit "b'a:b:c'.split(b':', maxsplit=1)"
100 loops, best of 3: 1.64 usec per loop

The main culprit is that Python strings are created for every keyword name on 
every call.

Proposed patch adds alternative API that caches keyword names as Python strings 
in special object. Argument Clinic is changed to use this API in generated 
file. An effect of the optimization:

$ ./python -m timeit "b'a:b:c'.split(b':', maxsplit=1)"
100 loops, best of 3: 0.826 usec per loop

Invocations of PyArg_ParseTupleAndKeywords() in non-generated code are kept, 
since API is not stable yet. Later I'm going to cache parsed format strings and 
speed up parsing positional arguments too.

--
components: Interpreter Core
files: faster_keyword_args_parse.patch
keywords: patch
messages: 270832
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Faster parsing keyword arguments
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file43794/faster_keyword_args_parse.patch

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Brett Cannon

Brett Cannon added the comment:

If it's only affecting a single library then chances are it's not Python's 
fault.

--
components: +Windows
nosy: +brett.cannon, paul.moore, steve.dower, tim.golden, zach.ware
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue27472] add the 'unix_shell' attribute to test.support

2016-07-19 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +haypo
stage: patch review -> commit review

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-07-19 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
components: +Interpreter Core
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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Anders Hovmöller

Anders Hovmöller added the comment:

Hmm, ok. I guess I was confused by "dates and times" part of the subject. Ok, 
so only datetimes. My other comments still apply though. 

> On 19 Jul 2016, at 16:20, Mathieu Dupuy  wrote:
> 
> 
> Mathieu Dupuy added the comment:
> 
> because it limits itself to only support the RFC 3339 subset, as
> explained in the begining of the discussion.
> 
> 2016-07-19 16:07 GMT+02:00 Anders Hovmöller :
>> 
>> Anders Hovmöller added the comment:
>> 
>> The tests attached to this ticket seem pretty bare. Issues that I can spot 
>> directly:
>> 
>> - only tests for datetimes, not times or dates
>> - only tests for zulu and "-8:00” timezones
>> - no tests for invalid input (parsing a valid date as a datetime for example)
>> - only tests for -MM-DDTHH:MM:SSZ, but ISO8601 supports:
>>- Naive times
>>- Timezone information (specified as offsets or as Z for 0 offset)
>>- Year
>>- Year-month
>>- Year-month-date
>>- Year-week
>>- Year-week-weekday
>>- Year-ordinal day
>>- Hour
>>- Hour-minute
>>- Hour-minute
>>- Hour-minute-second
>>- Hour-minute-second-microsecond
>>- All combinations of the three "families" above!
>> (the above list is a copy paste from my project that implements all ISO8601 
>> that fits into native python: https://github.com/boxed/iso8601 
>> )
>> 
>> This is a more reasonable test suite: 
>> https://github.com/boxed/iso8601/blob/master/iso8601.py#L166 
>>  although it 
>> lacks the tests for bogus inputs.
>> 
>>> On 2016-07-16, at 03:41, Alexander Belopolsky  
>>> wrote:
>>> 
>>> 
>>> Alexander Belopolsky added the comment:
>>> 
>>> I would very much like to see this ready before the feature cut-off for 
>>> Python 3.6.  Could someone post a summary on python-ideas to get a show of 
>>> hands on some of the remaining wrinkles?
>>> 
>>> I would not worry about a C implementation at this point.  We can put 
>>> python implementation in _strptime.py and call it from C as we do for the 
>>> strptime method.
>>> 
>>> --
>>> 
>>> ___
>>> Python tracker 
>>> 
>>> ___
>> 
>> --
>> 
>> ___
>> Python tracker 
>> 
>> ___
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-19 Thread Kirk Hansen

Kirk Hansen added the comment:

Raymond: Thanks for essentially answering my stackoverflow question (if you are 
a member, and add most of your response, I'll accept it).

I agree enough with your documentation statement. An entry in an FAQ would have 
been just as helpful to me as a note in the documentation, and the FAQ is 
probably more accessible.

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

because it limits itself to only support the RFC 3339 subset, as
explained in the begining of the discussion.

2016-07-19 16:07 GMT+02:00 Anders Hovmöller :
>
> Anders Hovmöller added the comment:
>
> The tests attached to this ticket seem pretty bare. Issues that I can spot 
> directly:
>
> - only tests for datetimes, not times or dates
> - only tests for zulu and "-8:00” timezones
> - no tests for invalid input (parsing a valid date as a datetime for example)
> - only tests for -MM-DDTHH:MM:SSZ, but ISO8601 supports:
> - Naive times
> - Timezone information (specified as offsets or as Z for 0 offset)
> - Year
> - Year-month
> - Year-month-date
> - Year-week
> - Year-week-weekday
> - Year-ordinal day
> - Hour
> - Hour-minute
> - Hour-minute
> - Hour-minute-second
> - Hour-minute-second-microsecond
> - All combinations of the three "families" above!
> (the above list is a copy paste from my project that implements all ISO8601 
> that fits into native python: https://github.com/boxed/iso8601 
> )
>
> This is a more reasonable test suite: 
> https://github.com/boxed/iso8601/blob/master/iso8601.py#L166 
>  although it 
> lacks the tests for bogus inputs.
>
>> On 2016-07-16, at 03:41, Alexander Belopolsky  wrote:
>>
>>
>> Alexander Belopolsky added the comment:
>>
>> I would very much like to see this ready before the feature cut-off for 
>> Python 3.6.  Could someone post a summary on python-ideas to get a show of 
>> hands on some of the remaining wrinkles?
>>
>> I would not worry about a C implementation at this point.  We can put python 
>> implementation in _strptime.py and call it from C as we do for the strptime 
>> method.
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Anders Hovmöller

Anders Hovmöller added the comment:

The tests attached to this ticket seem pretty bare. Issues that I can spot 
directly:

- only tests for datetimes, not times or dates
- only tests for zulu and "-8:00” timezones
- no tests for invalid input (parsing a valid date as a datetime for example)
- only tests for -MM-DDTHH:MM:SSZ, but ISO8601 supports:
- Naive times
- Timezone information (specified as offsets or as Z for 0 offset)
- Year
- Year-month
- Year-month-date
- Year-week
- Year-week-weekday
- Year-ordinal day
- Hour
- Hour-minute
- Hour-minute
- Hour-minute-second
- Hour-minute-second-microsecond
- All combinations of the three "families" above!
(the above list is a copy paste from my project that implements all ISO8601 
that fits into native python: https://github.com/boxed/iso8601 
)

This is a more reasonable test suite: 
https://github.com/boxed/iso8601/blob/master/iso8601.py#L166 
 although it 
lacks the tests for bogus inputs.

> On 2016-07-16, at 03:41, Alexander Belopolsky  wrote:
> 
> 
> Alexander Belopolsky added the comment:
> 
> I would very much like to see this ready before the feature cut-off for 
> Python 3.6.  Could someone post a summary on python-ideas to get a show of 
> hands on some of the remaining wrinkles?
> 
> I would not worry about a C implementation at this point.  We can put python 
> implementation in _strptime.py and call it from C as we do for the strptime 
> method.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-19 Thread Antti Haapala

Antti Haapala added the comment:

About shifts, according to C standard, right shifts >> of negative numbers are 
implementation-defined:

   "[in E1 >> E2], If E1 has a signed type and a negative value, the
   resulting value is implementation-defined."

In K&R this meant that the number can be either zero-extended or sign-extended. 
In any case it cannot lead to undefined behaviour, but the implementation must 
document what is happening there. Now, GCC says that >> is always 
arithmetic/sign-extended. This is the implementation-defined behaviour, now GCC 
has defined what its implementation will do, but some implementation can choose 
zero-extension. (unlikely)

As for the other part as it says "GCC does not use the latitude given in C99 
only to treat certain aspects of signed ‘<<’ as undefined". But GCC6 will 
diagnose that now with -Wextra, and thus it changed already, as with -Werror 
-Wextra the code doesn't necessarily compile any longer, which is fine. Note 
that this "certain -- only" refers to that section where the C99 and C11 
explicitly say that the behaviour is undefined and C89 doesn't say anything. It 
could as well be argued that in C89 it is undefined by omission.

Additionally all shifts that shift by more than or equal to the width *still* 
have undefined behaviour (as do shifts by negative amount). IIRC they work 
differently on ARM vs x86: in x86 the shift can be mod 32 on 386, and in ARM, 
mod 256.

--

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-19 Thread Anders Hovmöller

Anders Hovmöller added the comment:

> The `arrow` library depends on the supposed "strict" behaviour of strptime 
> that has never been guaranteed, which often results in very buggy behaviour 
> under some conditions.

Well… the arrow library accepts all sorts of broken input and gives you a date 
back. I think they even think that’s a feature and not a bug so no use in 
trying to help people who are adamant that they don’t want to be helped :/

--

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This time, with a patch that includes updated tests.

--
Added file: http://bugs.python.org/file43793/code.patch

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano

Changes by Steven D'Aprano :


Removed file: http://bugs.python.org/file43791/code.patch

___
Python tracker 

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



[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-19 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Following (and thanks to :) Martin's review and comments, this new patch:
* does not use the not portable '-e' echo option
* uses single quotes (') to avoid the escaping
* improves the error message

“make touch” does not always fix the problem, for example when 
Objects/typeslots.py has been modified or when this file has been touched, so 
it is not mentioned in the error message.

--
Added file: http://bugs.python.org/file43792/py_for_gen_26662_2.patch

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Does this work with negative steps?

--

___
Python tracker 

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



[issue27573] code.interact() should print an exit message

2016-07-19 Thread Steven D'Aprano

New submission from Steven D'Aprano:

Way too often I've lost track of whether I'm in the code.interact() REPL or the 
original REPL, or hit Ctrl-D once too often, and accidentally quit the real 
REPL. It is easy to lose track, since the real and imitation REPL both use the 
same prompts.

It would be useful if code.interact() and the InteractiveConsole printed a 
message when they exited.

--
components: Library (Lib)
files: code.patch
keywords: patch
messages: 270822
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: code.interact() should print an exit message
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43791/code.patch

___
Python tracker 

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



[issue20932] Undefined behavior flagged by Clang 3.4 (Python 3.5 from hg)

2016-07-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +martin.panter

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-19 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Raymond, that was a fantastic explanation. Would you be willing to turn it into 
a FAQ? Or if you don't have the time, to allow somebody to steal your 
description and use it?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue27567] Add constants EPOLLRDHUP and POLLRDHUP to module select.

2016-07-19 Thread Марк Коренберг

Changes by Марк Коренберг :


--
status: closed -> open

___
Python tracker 

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



[issue27567] Add constants EPOLLRDHUP and POLLRDHUP to module select.

2016-07-19 Thread Марк Коренберг

Марк Коренберг added the comment:

Thanks, but POLLRDHUP is also missing...I have typo in subject(fixed)

--
title: Add constants EPOLLRDHUP and EPOLLHUP to module select. -> Add constants 
EPOLLRDHUP and POLLRDHUP to module select.

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-19 Thread Cory Benfield

Cory Benfield added the comment:

I like this patch a great deal, I'll happily review it with docs and tests.

--
nosy: +Lukasa

___
Python tracker 

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



[issue27572] Support bytes-like objects when base is given to int()

2016-07-19 Thread Xiang Zhang

Changes by Xiang Zhang :


Added file: http://bugs.python.org/file43790/bytes_like_support_to_int.patch

___
Python tracker 

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



[issue27572] Support bytes-like objects when base is given to int()

2016-07-19 Thread Xiang Zhang

Changes by Xiang Zhang :


Removed file: http://bugs.python.org/file43789/bytes_like_support_to_int.patch

___
Python tracker 

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



[issue27572] Support bytes-like objects when base is given to int()

2016-07-19 Thread Xiang Zhang

Changes by Xiang Zhang :


--
type:  -> enhancement

___
Python tracker 

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



[issue27572] Support bytes-like objects when base is given to int()

2016-07-19 Thread Xiang Zhang

New submission from Xiang Zhang:

Right now, int() supports bytes-like objects when *base* is not given:

>>> int(memoryview(b'100'))
100

When *base* is given bytes-like objects are not supported:

>>> int(memoryview(b'100'), base=2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: int() can't convert non-string with explicit base

Is there any obvious reason not to support it when *base* is given? I suggest 
add it.

--
components: Interpreter Core
files: bytes_like_support_to_int.patch
keywords: patch
messages: 270818
nosy: martin.panter, xiang.zhang
priority: normal
severity: normal
status: open
title: Support bytes-like objects when base is given to int()
versions: Python 3.6
Added file: http://bugs.python.org/file43789/bytes_like_support_to_int.patch

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring the _sodium pyd file made with pip.

2016-07-19 Thread Decorater

Decorater added the comment:

It dooes work foor _cffi_backend however on reading it so this issue is only on 
nacl._sodium then.

--
title: 3.6 Seems to be ignoring all pyd's installed and compiled by pip -> 3.6 
Seems to be ignoring the _sodium pyd file made with pip.

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring all pyd's installed and compiled by pip

2016-07-19 Thread Decorater

Decorater added the comment:

Attacked are the 2 versions of _sodium for PyNacl that it seems to not be able 
to find.

--
Added file: http://bugs.python.org/file43788/_sodium.cp36-win32.pyd

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring all pyd's installed and compiled by pip

2016-07-19 Thread Decorater

Changes by Decorater :


Added file: http://bugs.python.org/file43787/_sodium.cp36-win_amd64.pyd

___
Python tracker 

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



[issue27571] 3.6 Seems to be ignoring all pyd's installed and compiled by pip

2016-07-19 Thread Decorater

New submission from Decorater:

in 3.5 the following would succed:
>>>import nacl._sodium
None

but in 3.6 (I even compiled it for 3.6 specifically) this happens:

>>>import nacl._sodium
Traceback (most recent call last):
import nacl._sodium
ImportError: No module named 'nacl._sodium'

--
messages: 270815
nosy: Decorater
priority: normal
severity: normal
status: open
title: 3.6 Seems to be ignoring all pyd's installed and compiled by pip
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