[issue27387] Thread hangs on str.encode() when locale is not set

2016-06-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2016-06-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Maybe omit the mention of the array mode since it can't be used with variables 
created with Tkinter wrapper?

--

___
Python tracker 

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-25 Thread Xiang Zhang

Xiang Zhang added the comment:

Of course, I know it. But doesn't the local variable `bases` refer to mro[1]?

[1] https://hg.python.org/cpython/file/tip/Objects/typeobject.c#l4900

--

___
Python tracker 

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



[issue27389] When a TypeError is raised due to invalid arguments to a method, it should use __qualname__ to identify the class the method is in

2016-06-25 Thread Steven Barker

New submission from Steven Barker:

When a method is called with incorrect arguments (too many or too few, for 
instance), a TypeError is raised. The message in the TypeError generally of the 
form:

foo() takes 2 positional arguments but 3 were given

I think the message should include the class name along with the method name, 
so it would say `SomeClass.foo` instead of just `foo`. Since that is 
`SomeClass.foo`'s __qualname__, it should not be too hard to get the right name 
in most situations.

Here's an example showing how the current error messages can be ambiguous:

class A:
def foo(self, x):
pass

class B:
def foo(self, x, y): # different method signature!
pass

lst = [A(), B()]

for item in lst:
item.foo(1)  # raises TypeError: foo() missing 1 required positional 
argument: 'y'"

for item in lst:
item.foo(1, 2) # raises "TypeError: foo() takes 2 positional arguments but 
3 were given"

In neither loop is is clear which class's `foo` method is causing the exception 
(nor does the traceback help, since it only shows the `item.foo(...)` line). Of 
course, in this example it's easy to see the two classes have `foo` methods 
with different signatures, but if there were hundreds of objects in the list 
and they were instances of dozens of different classes it would be rather more 
annoying to figure out which class has the incorrect method signature.

I've looked through the code and the two exceptions above come from the 
`format_missing` and `too_many_positional` functions in Python/ceval.c . It's 
not obvious how to patch them to use `__qualname__` instead of `__name__`, 
since they are taking the name from a code object, rather than a function 
object or bound method object (and code objects don't have an equivalent to 
`__qualname__`, only `co_name` which is related to `__name__`).

Several other argument related TypeError exceptions are raised directly in 
_PyEval_EvalCodeWithName, which *does* have a `qualname` parameter, though the 
function doesn't use it for much. It's also where the other functions described 
above get called from, so it could probably pass the `qualname` along to them. 
Alas, it seems that in some common cases (such as calling a Python function 
with any kind of argument unpacking like `*foo` or `**foo`), the value of the 
`qualname` parameter is actually Null, so it may not be of much help.

A few extra TypeErrors related to function calls are raised directly in the 
gigantic `PyEval_EvalFrameEx` function. These seem to all use 
`PyEval_GetFuncName` to get the name, so perhaps we could modify its behavior 
to return the method's `__qualname__` rather than the `__name__`. (I have no 
idea what backwards compatibility issues this might cause. Perhaps a new 
function that returns the qualname would be better.)

--
messages: 269274
nosy: Steven.Barker
priority: normal
severity: normal
status: open
title: When a TypeError is raised due to invalid arguments to a method, it 
should use __qualname__ to identify the class the method is in
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-06-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Virtual environments don't provide any sandboxing, they just let you isolate 
different dependency sets from each other when switching between working on 
different applications.

If you're inside a venv, you'll see either:

sys.prefix != sys.base_prefix (venv created by Py3 stdlib)

or:

hasattr(sys, "real_prefix") (venv created by virtualenv)

In this case, you can assume the user has write permissions to the virtual 
environment and just invoke sys.executable with "-m pip install pipgui" as 
arguments.

If you're *not* in a virtual environment, you're running directly in the system 
Python, and the user may not have permission to install new packages for 
everyone (and even if they do, it's not necessarily a good idea). In that case, 
you want to pass "-m pip install --user pipgui", so the GUI components get 
installed in the user's home directory, rather than system wide.

--

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

What's New: patchcheck found trailing whitespace to remove; it contains some 
additions that appear to belong to another issue.

configdialog change looks good and dialog still works.

I am expecting to add more Vars sometime soon, though probably not in the next 
few days.  Before I do, I want to reduce the repetition of names and remove the 
repetition of trace_add calls.  I just opened #27388.

--

___
Python tracker 

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



[issue27388] IDLE configdialog: reduce multiple references to Var names

2016-06-25 Thread Terry J. Reedy

New submission from Terry J. Reedy:

ConfigDialog uses nearl 20 tkinter Vars, and I expect to add more.  The name of 
each appears in at least 6 places.

In one of 'create tab frame' methods:
1. create the Var
2. use the Var with at least 1 tk widget
In AttachVarCallbacks method:
3, 4. attach trace with callback with derived name
  self.varname.trace_add('write', self.VarChanged_varname)
In remove_var_callbacks method (with delete call already factored out):
5. include Var in for loop tuple, to remove callback with
  "var.trace_remove('write', var.trace_info()[0][1])"
In callback definition:
6. def VarChanged_varname

The above uses the new trace method names that will be introduced in #22115, 
which I expect will be applied first.  (I might also replace
'VarChanged_' with 'var_changed_' or something shorter, but this is not 
relevant here.)

I propose to consolidate 1, 3, & 4 by replacing AttachVarCallbacks with

def add_traced_var(varname):
"""Create var; bind to varname, append to list, and trace with callback.

varname must match use in caller and callback def.
"""
var = tk.StringVar(self.root)
setattr(self, varname, var)
self.vars.append(var)
cbsuffix = 'font' if varname.startswith('font') else varname
var.trace_add('write', self.getattr('VarChanged_' + cbsuffix))

The cbsuffix local takes care of the complication that the 3 'fontWxyz' vars 
need the same callback.  In any Var are not StringVars, add vartype parameter.

Each tab frame creation method would call add_traced_var within a varname loop. 
 The current varname tuple for 5. would be replaced with self.vars, which 
should then be cleared.  This will leave 3 name occurrences that must match 
instead of 6.

---
I believe 1-6 is complete.  Varnames are translated to config item names within 
the callbacks, so do not have to match.  For instance,

def VarChanged_spaceNum(self, *params):
value = self.spaceNum.get()
self.AddChangedItem('main', 'Indent', 'num-spaces', value)

translated 'spaceNum' to 'num-spaces'.  On the other hand, I an not sure why 
the difference.  For back compatibility, config names are fixed.  The varnames, 
like method names, are internal to configdialog and can lowercased (PEP8) and 
otherwised changed.
---

For testing, I will embed the add and delete methods in a dummy class with a 
couple of dummy callbacks.  Then add, introspect, delete, and introspect again.

--
assignee: terry.reedy
messages: 269271
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE configdialog: reduce multiple references to Var names
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue27363] Complex with negative zero imaginary part

2016-06-25 Thread Vedran Čačić

Vedran Čačić added the comment:

Yes, but IMO that's a separate issue. And if complex analysis has taught me 
anything, it's that the sign of zero of .imag is much more important than the 
sign of zero of .real part (most elementary functions have branch cuts along 
real axis, where sign of .imag ensures continuity on both sides). Of course, 
having both would be even better, but having only this part is a good part of a 
good thing.

However, as I said, I know it's complicated. How about giving a "conventional" 
repr to complex? As far as I see, it's really not hard to implement - the only 
problem is backwards compatibility. But that was a problem when parentheses 
were added, too, right?

[ And there would be one more benefit: We could finally say goodbye to  weird 
"names" (infj, nanj) in the repr. By analogy with float, this could just be 
complex('nan', '-inf') or whatever. ]

For what it's worth, I'm not sure we should try too hard to preserve 
complex(repr(z)) being z given isinstance(z, complex). For example, Fraction 
and Decimal don't have this property (while it does kinda hold for str instead 
of repr, and it would continue to kinda hold for str here). Yes, I know 
Fraction and Decimal aren't builtins and complex is, but I really think it's 
only because of syntax support for j-based literals.

--

___
Python tracker 

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



[issue27051] Create PIP gui

2016-06-25 Thread Nick Coghlan

Nick Coghlan added the comment:

As far as the security questions go, yes, this is one of the benefits of 
education focused stributions like the Raspbian used on the Raspberry Pi - they 
can make extra packages available without introducing kids to the idea of 
downloading and running arbitrary components from the internet before they're 
adequately equipped to judge the risks of what they're running.

That's the other big reason I think the PyPI approach will be valuable - by 
offering educators something that's potentially useful to them (a pip GUI), 
you'd hopefully be able to attract more direct feedback around how to make it 
ever more suitable to that use case.

--

___
Python tracker 

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



[issue27051] Create PIP gui

2016-06-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, I think we need to separate two questions here:

1. Making a GUI for pip available *at all*. At the moment, there isn't really 
one, so even if instructors want to offer one, they can't without writing it 
first. That's a reported PyPA issue here: 
https://github.com/pypa/packaging-problems/issues/57

2. Whether to endorse and bundle such a GUI with CPython, and integrate it with 
IDLE.

I think the first aspect is an unequivocally good idea, and I'd encourage 
Upendra to head down that path to make it available to folks that are 
interested in having a cross-platform GUI for working with pip packages, 
regardless of what happens on the CPython integration front.

For the second point, I'll note that Donald was a trusted *PyPA* developer 
prior to our collaboration on PEP 453 - he became a CPython core developer 
specifically to maintain ensurepip.

I believe that "cross-community collaboration" model would also be a good fit 
for integration of a pip GUI distributed that was otherwise distributed via 
PyPI - we'd want core developers, or folks trusted by core developers, 
reviewing and maintaining the PyPI package, without necessarily pulling it 
directly into the CPython maintenance workflows.

--

___
Python tracker 

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



[issue27051] Create PIP gui

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Our messages crossed.  See msg269266 for fuller response.

--

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Nick, in answer to msg269259, see last two messages above.  The commit would be 
here and I would want your review before committing.

> always using a "--user" install if it doesn't detect an active virtual 
> environment)

I will look up what --user does. You will have to educate me (preferably with 
code) about 'detect an active virtual environment'.  I have never used such.  
Is running in a venv safer with respect to downloading 3rd party code?

--

___
Python tracker 

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



[issue24137] Force not using _default_root in IDLE

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Using Rietveld to make a 1-2 diff for each file, it appears you made 3 changes. 
I incorporated 2, and missed 1 (which you just pushed).  I believe I 
incorporated your changes by hand because I had already made additional changes 
myself. I suspect that at that time I failed to middle-click the '1' for 
'pyshell' hard enough to get the 1-2 diff for pyshell.  I should have counted 
and checked to make sure I had all 8 diffs.

--

___
Python tracker 

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



[issue27051] Create PIP gui

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Upendra: you own the code you are writing.  Are you willing to create and 
maintain for some time a PyPI project?

If so, Nick, Donald, or someone should be willing and able to help.  If you do 
so, please make someone a backup co-owner, to make it less likely that it 
becomes an orphan project.

It would be silly to tell beginners that they must learn to use a console to 
run pip to install pipgui so they can avoid using a console to run pip.  If we 
go this route, I could, at least as a backup, have the IDLE menu event handle 
conditionally offer to install pipgui.  See msg269252 of #23551.

A separate 'ensurepipgui' doesn't seem necessary to me.  Once pip is known to 
be installed, it can be used to install pipgui.  Once pipgui exists, ensurepip 
should just install it as its last step.  Nick, what do you think?

One concern I have is that installing pipgui from PyPI seems more of a security 
risk than pre-installing it.  Before committing to idlelib, I would review it 
before testing on my own machine.  Any further changes would have to be by a 
core developer, and would be published on Python-checkins for anyone to review. 
 The latter does not happen for external projects.  (Upendra, please don't take 
offense from this.  Donald is a core developer with a long history, including 
with security issues.  You aren't.  And I have not much experience with 
security issues either.)

Another issue with pip and pipgui is that PyPI is apparently vulnerable to 
typosquatting attacks, see
 
http://arstechnica.co.uk/security/2016/06/german-student-university-of-hamburg-typosquatting-attack/
I believe beginners are more susceptible to mistyping package names. The above 
report makes me realize that installing from a stored requirements list is a 
good idea, and think that pipgui, at least when run from IDLE, should install 
from a whitelist, (in idlelib, for IDLE?).  Some instructors might require this 
or want to add or subtract names.

--

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It is possible that some institution might block or remove a pip install.  IDLE 
should check for the presence of pip itself before adding the menu entry.

--

___
Python tracker 

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



[issue27387] Thread hangs on str.encode() when locale is not set

2016-06-25 Thread Josh Purvis

New submission from Josh Purvis:

This bug manifest itself in at least one very specific situation:

1. No locale is set on the machine
2. A file (test1.py) imports a second (test2.py)
3. The second file (test2.py) calls str.encode() from inside a thread
4. Running Python 2.7

[Environment with no locale set]:

# both of these are unset:
$ echo $LC_CTYPE

$ echo $LANG

$

[test1.py]:

import test2

[test2.py]:

from threading import Thread

class TestThread(Thread):
def run(self):
msg = 'Error from server: code=000a'
print msg
msg = msg.encode('utf-8')

t = TestThread()
t.start()
t.join()

print 'done'

[Expected behavior]:

$ python test1.py   
  
Error from server: code=000a
done

[Actual behavior]: 

$ python test1.py   
  
Error from server: code=000a
[script hangs here indefinitely]

Much thanks to Alan Boudreault, a developer of the cassandra-driver Python 
package, for helping me locate this bug and further narrow it down to the 
threading module. The above code snippet was copied from his comment on my 
issue over there (https://datastax-oss.atlassian.net/browse/PYTHON-592).

Another curious behavior is that if you modify test1.py to decode any string 
prior to the import, it implicitly fixes the issue:

[test1.py']:

"any string".decode('utf-8')
import test2

I realize that one should probably always have a locale set, however, this 
proved to be very difficult to isolate, especially given that it works if no 
import occurs or a string is decoded prior to the import.

--
components: Interpreter Core, Unicode
messages: 269262
nosy: ezio.melotti, haypo, joshpurvis
priority: normal
severity: normal
status: open
title: Thread hangs on str.encode() when locale is not set
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-25 Thread Larry Hastings

Larry Hastings added the comment:

Well, as Donald Rumsfeld said in 2008: "As you know, you go to war with the 
army you have, not the army you might want or wish to have at a later time."

3.5.2 final and 3.4.5 final will ship with Matthias's patch as proposed.  FWIW 
I'd accept an improved patch in both versions for the next release.

--

___
Python tracker 

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



[issue20350] Replace tkapp.split() to tkapp.splitlist()

2016-06-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.5

___
Python tracker 

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



[issue20350] Replace tkapp.split() to tkapp.splitlist()

2016-06-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d78cd7c4a9e by Serhiy Storchaka in branch 'default':
Issue #20350. tkapp.splitlist() is now always used instead of unreliable
https://hg.python.org/cpython/rev/8d78cd7c4a9e

--
nosy: +python-dev

___
Python tracker 

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



[issue27365] Allow non-ascii chars in IDLE NEWS.txt (for contributor names)

2016-06-25 Thread Larry Hastings

Larry Hastings added the comment:

If this is fixed, and resolved, why is it still open?  Closing.

--
status: open -> closed

___
Python tracker 

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



[issue27051] Create PIP gui

2016-06-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Terry, would you be open to overseeing the merge of a version that bootstrapped 
itself as follows:

- IDLE gained a pip GUI launcher that, if the pip GUI was not importable, 
offered to install it from PyPI (always using a "--user" install if it doesn't 
detect an active virtual environment)
- if the GUI was already importable, it would just launch it

Then, pip-gui itself could just be a normal PyPI package, without any 
dependency vendoring, and without any specific coupling to the CPython release 
process.

--

___
Python tracker 

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



[issue24364] Not all defects pass through email policy

2016-06-25 Thread R. David Murray

R. David Murray added the comment:

The name default is future proofing.  It will be the default...eventually :)  
And it is the default now if you use EmailMessage to construct your messages.

--

___
Python tracker 

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



[issue27386] Asyncio server hang when clients connect and immediately disconnect

2016-06-25 Thread Jim Fulton

New submission from Jim Fulton:

I recently ported ZEO to asyncio.

We'd had a bug in our old asyncore-based server where the server would hang if 
several connections were made and then immediately disconnected on Mac OS X.  
This was due to an error-handling bug in our code that we fixed.  We have a 
regression test for this case.

The regression test for this case fails using asyncio.Server.

I've attached a (ZEO-independent) script that demonstrates the problem.

If you run the script with Python 3.4 or 3.5, I expect the script will hang. It 
does for me on Mac OS X 10.10.5 and Ubuntu 14.04.

--
components: asyncio
files: echo.py
messages: 269256
nosy: gvanrossum, haypo, j1m, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio server hang when clients connect and immediately disconnect
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file43540/echo.py

___
Python tracker 

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



[issue24137] Force not using _default_root in IDLE

2016-06-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You have missed my changes in nodefaultroot2.diff.

--

___
Python tracker 

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



[issue24137] Force not using _default_root in IDLE

2016-06-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a8d611eb6173 by Serhiy Storchaka in branch 'default':
Issue #24137: Fixed IDLE on Linux with tkinter default root disabled.
https://hg.python.org/cpython/rev/a8d611eb6173

--

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2016-06-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Terry. Here is updated patch. IDLE now uses new API.

--
Added file: http://bugs.python.org/file43539/tkinter_trace_variable_6.patch

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-06-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Starting with June 20 msg268947 of #27051, Ned Deily raised the issue of adding 
something to the stdlib that depends on an external interface.  Nick Coughlin 
agreed that this is problematical.  Pipgui might have to be installed into 
site-packages from PyPI.

Once pipgui is installed on somewhere on the path, it does not matter where, as 
IDLE will use some variant of ' -m pipgui'.  The issue is 
getting it installed *somewhere*.

Module mainmenu (Bindings in 3.5) uses the following code to conditionally add 
'Turtle Demo' to the IDLE menu.

from importlib.util import find_spec
menudefs = ...
if find_spec('turtledemo'):
menudefs[-1][1].append(('Turtle Demo', '<>'))

I believe the issue is that some Linux distributions either do or might make 
installing turtle-turtledemo a separate option from Tkinter and IDLE, so that 
IDLE might be installed but turtledemo not.  If turtledemo is not present, 
there is nothing for IDLE to do.

If pipgui is pip-installable, the same condition could be used , but in the 
menu event handler. When "if find_spec('pip') and not find_spec('pipgui')" is 
true, IDLE could offer to run 'python -m pip install pipgui' in a subprocess.

--

___
Python tracker 

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



[issue26243] zlib.compress level as keyword argument

2016-06-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Berker and Martin.

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

___
Python tracker 

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



[issue26243] zlib.compress level as keyword argument

2016-06-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ab2e7e51869d by Serhiy Storchaka in branch 'default':
Issue #26243: Correct a wording in docs.
https://hg.python.org/cpython/rev/ab2e7e51869d

--

___
Python tracker 

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



[issue26243] zlib.compress level as keyword argument

2016-06-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01f82a7a1250 by Serhiy Storchaka in branch 'default':
Issue #26243: Only the level argument to zlib.compress() is keyword argument
https://hg.python.org/cpython/rev/01f82a7a1250

--

___
Python tracker 

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



[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client

2016-06-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl

___
Python tracker 

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

__bases__ != mro()

--

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-25 Thread Xiang Zhang

Xiang Zhang added the comment:

Add the newest version applying Martin's comments.

--
Added file: http://bugs.python.org/file43538/64bit_support_for_zlib_v7.patch

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-06-25 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-06-25 Thread Brett Cannon

Brett Cannon added the comment:

The restriction of lazily loading built-ins and extensions is now lifted!

--
status: open -> closed

___
Python tracker 

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



[issue26186] LazyLoader rejecting use of SourceFileLoader

2016-06-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7af4b3ad75b7 by Brett Cannon in branch 'default':
Issue #26186: Remove the restriction that built-in and extension
https://hg.python.org/cpython/rev/7af4b3ad75b7

--

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-06-25 Thread Oren Milman

Oren Milman added the comment:

Also, Brett was the one who added the three terms to the glossary in 
https://hg.python.org/cpython/rev/ea5767ebd903, and a clarification of 'finder' 
in https://hg.python.org/cpython/rev/88cee7d16ccb, so I guess his input in this 
matter also would be helpful.

(If both of you think the other way, I am probably wrong :) )

--

___
Python tracker 

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



[issue27363] Complex with negative zero imaginary part

2016-06-25 Thread Mark Dickinson

Mark Dickinson added the comment:

> People usually say it's because we don't have separate imaginary type, but we 
> don't need it.

I think we do. Consider the case of something like -0 + 1j (the `repr` of 
complex(-0.0, 1.0)). That currently evaluates to `complex(0.0, 1.0)`, because 
the `-0.0` is combined with the `+0.0` real part of `1j`.

--

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-06-25 Thread Oren Milman

Oren Milman added the comment:

Except for some trailing spaces I have just found in my original proposed 
patches, I don't have any extra changes to add. So as soon as Brett answers 
about those two assignments, I would update and upload the patches diff file.

With regard to terminology, I believe 'Explicit is better than implicit' fits 
here.
IMHO using (in the code and docs) each of the three terms explicitly, with 
accordance to the glossary 
(https://docs.python.org/3/glossary.html#term-finder, 
https://docs.python.org/3/glossary.html#term-loader, 
https://docs.python.org/3/glossary.html#term-importer, all of which were first 
added back in revision 51025, BTW), makes the import mechanism clearer (than 
using 'importer' as an ambiguous term).

--

___
Python tracker 

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



[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-06-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> The same problem occurs when cross-compiling for Android and running 
> test_sysconfig and test_distutils.

This is misleading. Actually, test_sysconfig and test_distutils do not fail 
when run from the source tree, but fail on an installed python, whatever the 
compilation mode: native or cross-compilation.

--

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert

Michel Albert added the comment:

New patch with proposed changes.

--
Added file: http://bugs.python.org/file43537/net-in-net-r6.patch

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-06-25 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
dependencies: +rename the platform directory from plat-$(MACHDEP) to 
plat-$(PLATFORM_TRIPLET)

___
Python tracker 

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



[issue23968] rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET)

2016-06-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The same problem occurs when cross-compiling for Android and running 
test_sysconfig and test_distutils.

Some other points:
* The generation of the platform directory breaks the support of read only 
source trees. The files of this  directory are not tracked by mercurial and 
printed by 'hg status'.

* The new files in the platform directory are regenerated from C headers of the 
build machine.

--

___
Python tracker 

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



[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-25 Thread Martin Panter

Martin Panter added the comment:

I’m not sure what the best solution is. I am just pointing out the problem. It 
seems an “importer” as mentioned in PEP 302 is more general than the current 
glossary definition. E.g. ImpImporter() returns an object that has a 
find_module() method (which partially makes it both a “meta path finder” and a 
“path entry finder”), but it has no load_module() method. So it fails the 
“importer” definition according to the current glossary.

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-06-25 Thread Martin Panter

Martin Panter added the comment:

Oren: If you have extra changes to make on the same topic, it is probably best 
to make a new patch that combines both the original changes plus the new 
changes.

Brett: Since you were responsible for the two dead assignments, your input 
would be helpful. Perhaps you meant to add extra code and forgot, or perhaps 
they are just useless and we can remove them.

I skimmed over PEP 302, and it seems it uses the term “importer” more or less 
to mean what the current glossary terms “finder”. I.e. the first object to help 
with importing a module. Or maybe it means the system behind both the finder 
and loader stages, even if one object does not perform both steps. I don’t know 
much about this, but another option could be to redefine “importer” as it is 
more generally used.

--
nosy: +martin.panter

___
Python tracker 

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



[issue27363] Complex with negative zero imaginary part

2016-06-25 Thread Vedran Čačić

Vedran Čačić added the comment:

Mark, I think it would be a great idea. It would be consistent with both "str 
is straightforward, repr is reproducible", and with the idea that (evalable) 
repr is almost always of the form `typename(arguments)`. It would also get rid 
of that "supefluous-looking" parentheses around the repr, and put them in the 
right place: a call. :-)

[ On the other hand, I started to think deeply about the reason why we cannot 
make 1-0j do the right thing, and I'm not so sure anymore. People usually say 
it's because we don't have separate imaginary type, but we don't need it: all 
we need is a separate _real_ type, and we have it: float.

When Python subtracts 0j from a float 1.0, there is no absolute imperative that 
it has to do it in the same way as subtracting 0j from a complex(1.0, 0.0). We 
_can_ make it so the result of the former is complex(1.0, -0.0), and result of 
the latter is complex(1.0, 0.0).

Of course, now even the imaginary complex numbers couldn't be outputed simply, 
and -0 real part should become -0.0, but it might be worth it. I understand 
it's enormously complicated though, and I'd be satisfied with a "normal" repr. 
Or a literal_eval that really understand complex numbers' repr. ]

--

___
Python tracker 

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



[issue20674] Update comments in dictobject.c

2016-06-25 Thread Jaysinh shukla

Jaysinh shukla added the comment:

Agreeing with "SilentGhost". Demonstrating `hash()` example for type int using 
list comprehension. Review  issue20674_patch_v5.diff Thanks!

--
Added file: http://bugs.python.org/file43536/issue20674_patch_v5.diff

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the updated patch. Some comments from a quick review:

* We need tests for the TypeError branches in both methods

* +'of type %s' % type(other)

  type(other) -> type(other).__name__

* You can drop the XXX part in

  +XXX Instances of

* Perhaps code duplication mentioned by SilentGhost can be eliminated by using 
the operator module

--

___
Python tracker 

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



[issue27353] Add nroot function to math

2016-06-25 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Mon, Jun 20, 2016 at 09:02:09PM +, Tim Peters wrote:
> Note that the very popular TI graphics calculators have had a distinct 
> nth-root function at least since the TI-83.  It's a minor convenience 
> there.

Likewise HP calculators ("xroot") and at least one Javascript library. 
But it does seem to be uncommon among programming languages. Which 
surprises me, because it is not just a convenience, it can be more 
accurate than using the generic pow(x, 1/n).

But seeing as there isn't that much interest, I'll stick with a private 
function in statistics.

--

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert

Michel Albert added the comment:

Updated patch, taking into account notes from the previous patch-reviews

--
Added file: http://bugs.python.org/file43535/net-in-net-r5.patch

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread SilentGhost

SilentGhost added the comment:

Have you seen my comments on rietveld re you previous patch?

--

___
Python tracker 

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



[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-25 Thread Jaysinh shukla

Jaysinh shukla added the comment:

Dear Martin,
I observed your comment. I can see, issue mentioned by you 
http://bugs.python.org/issue26896 contains patch of clarifying the reference of 
Importer, Finder. The issue-26896 is still under review phase. It will be good 
step to update doc in this issue according to 
http://bugs.python.org/file42666/issue.diff patch?

Thanks!

--

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert

Michel Albert added the comment:

Test pass properly.

Is there anything else left to do?

Here's the fixed patch (net-in-net-r4.patch)

--
Added file: http://bugs.python.org/file43534/net-in-net-r4.patch

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-06-25 Thread Michel Albert

Michel Albert added the comment:

I just realised that the latest patch on this no longer applies properly. I 
have fixed the issue and I am currently in the process of running the 
unit-tests which takes a while. Once those pass, I'll update some metadata and 
resubmit.

--

___
Python tracker 

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



[issue24364] Not all defects pass through email policy

2016-06-25 Thread Martin Panter

Martin Panter added the comment:

I see that “compat32” and “default” are actually different things (Compat32 vs 
EmailPolicy classes). IMO “default” was a bad choice of name, but I guess that 
ship has already sailed.

This patch adds a test_defect_handling.TestCompat32 subclass, so the test 
methods are now run with compat32 as well as the “default” policy.

--
Added file: http://bugs.python.org/file43533/defect-fixes.v2.patch

___
Python tracker 

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



[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-25 Thread Xiang Zhang

Xiang Zhang added the comment:

In the mro list I think the first is always the type itself which has already 
been checked to be a statically allocated type if we can touch the loop. 
Starting from 0 checks it twice and it's not a base either.

BTW, I don't receive an email from the tracker. :(

--

___
Python tracker 

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



[issue20674] Update comments in dictobject.c

2016-06-25 Thread SilentGhost

SilentGhost added the comment:

I've left comments on rietveld. Not sure if everyone's seeing them.

--
nosy: +SilentGhost
stage: needs patch -> patch review

___
Python tracker 

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



[issue20674] Update comments in dictobject.c

2016-06-25 Thread Jaysinh shukla

Jaysinh shukla added the comment:

Improving last with with following points:
1. Removing string related examples
2. Updating int example with more readable way (According to me).

Reviewer review the patch file named "issue20674_patch_v3.diff"

--
Added file: http://bugs.python.org/file43532/issue20674_patch_v3.diff

___
Python tracker 

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