[issue30200] tkinter ListboxSelect

2017-04-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Bug examples should be the bare minimum of code needed to reproduce the 
problem, not a dump of (failing) application code.  See, for instance, 
https://stackoverflow.com/help/mcve.

http://www.tcl.tk/man/tcl8.6/TkCmd/listbox.htm says "Any time the set of 
selected item(s) in the listbox is updated by the user through the keyboard or 
mouse, the virtual event <> will be generated."  It was the same 
for 8.5.

What precise actions are *needed* to produce what you consider buggy behavior?  
Please copy the complete traceback for the exception.  What system (OS) are you 
using.  If *nix, are you using the same tcl/tk for 3.6 as for 3.5?

--
nosy: +serhiy.storchaka, terry.reedy
stage:  -> test needed
versions: +Python 3.7

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The '|' should be '&' to avoid useless summing of 0 products.

I think this should be rejected.  Python's number and collections classes 
provide basic operations from which users can build application-specific 
functions.  Or in the case of floats, we provide a separate module of 
specialized functions.  Or in the case of itertools, a section of recipes that 
build on the basic iterators in the module.

In this case, it makes little sense to me to provide an 'inner product' of 
Counters (bags, multisets).

>>> a, b, c, d = 'a', 'b', 'c', 'd'
>>> c1 = C([a,a,a,b,b,c])
>>> c2 = C([a, c,c,c, d,d,d])
>>> sum(c1[x]*c2[x] for x in c1.keys() & c2.keys())
6

Even if the keys are counts and one thinks of the counters as sparse vectors, 
they are not really matrices.  Hence @ does not exactly fit.

If one does want sparse vectors implemented as dicts, they do not always have 
to be Counters.  A function would not require that.

def sparse_inner_prod(v1, v2):
return sum(v1[x]*v2[x] for x in v1.keys() & v2.keys())

This only requires that v1 and v2 both have keys and __getitem__ methods.

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I believe importing argparse in the __main__ clause (or a main or test function 
called therein) is common.  I prefer it there as it is not germain to the code 
that is usually imported.  I have a similar view on not immediately importing 
warnings when only needed for deprecation.

I am interested in argparse import time because I have thought about switching 
IDLE arg processing from getopt to argparse.  But both IDLE and user process 
startup time are already slow enough.  (For IDLE, the numbers for Serhiy's 
import counter for 3.6 on Win 10 with idlelib.idle instead of argparse are 38 
192 154.

I recently sped up user process startup (performed each time one 'runs' code 
from the editor) by around 25% (.1 second on my machine, just noticeable) by a 
few fairly straightforword changes.  For idlelib.run, the import numbers are 40 
182 142 in 3.5.3 and 38 138 100 in 3.6.1.  I probably can improve this further, 
but each change would have to be justified on its own.  So I think it 
appropriate to start with a subset of possible speedup changes for argparse.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29982] tempfile.TemporaryDirectory fails to delete itself

2017-04-28 Thread Guido van Rossum

Guido van Rossum added the comment:

A simpler approach would be to simply ignore the error when it occurs in 
TemporaryDirectory._cleanup. There are no absolute guarantees about tempfile 
always cleaning up -- just a best effort. The complexity (and potential delays) 
of a retry loop seem more risky than simply occasionally not cleaning up -- 
that happens anyways, for a variety of reasons.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue30158] Deprecation warnings emitted in test_importlib

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30158] Deprecation warnings emitted in test_importlib

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in 
branch 'master':
bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. 
(#1285)
https://github.com/python/cpython/commit/3cc8259b71ef784a9f7593f04da96043afe2228a


--

___
Python tracker 

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



[issue29576] Improve some deprecations in the importlib

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 3cc8259b71ef784a9f7593f04da96043afe2228a by Serhiy Storchaka in 
branch 'master':
bpo-30158: Fix deprecation warnings in test_importlib introduced by bpo-29576. 
(#1285)
https://github.com/python/cpython/commit/3cc8259b71ef784a9f7593f04da96043afe2228a


--

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-28 Thread Martin Panter

Martin Panter added the comment:

I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang’s 
backtick=True if others prefer that. :) In my mind “grave accent” is the pure 
ASCII character; it just got abused for other things. Other options:

b2a_uu(data, space=False)
b2a_uu(data, avoid_spaces=True)
b2a_uu(data, use_0x60=True)

--

___
Python tracker 

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



[issue21071] struct.Struct.format is bytes, but should be str

2017-04-28 Thread Martin Panter

Martin Panter added the comment:

I don’t think the API should be expanded to accept arbitrary bytes-like objects 
as format strings. Struct formats are strings of ASCII-compatible characters, 
but not arbitrary chunks of memory.

I think the main question is whether it is okay to break compatibility 
(Victor’s pull request, or my format-str.patch), or whether there has to be a 
backwards-compatible deprecation of the existing bytes attribute. FWIW I am 
okay with breaking compatibility, since the main documentation already implies 
it should be a text string.

--

___
Python tracker 

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



[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Dong-hee Na

Dong-hee Na added the comment:

'\ r' -> '\r'
'\ n' -> '\n'

--

___
Python tracker 

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



[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Dong-hee Na

Dong-hee Na added the comment:

One of the purposes of the JDK patch is to prevent '\ r' and '\ n' from being 
inserted into the ftp command. In particular, it seems to assume that if 
another malice command is inserted after '\ n', the possibility of such an 
attack will be opened at a later time.
IMO, I think that we can block '\ r \ n' and '\ n' at the same time by blocking 
only '\ n'. Although '\ r' allows

--

___
Python tracker 

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



[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Dong-hee Na

Dong-hee Na added the comment:

Thanks, Martin
I agree with you.
So, in this case, we should update FTPHandler right?
If this approach right, Can I proceed this issue?

--

___
Python tracker 

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



[issue16349] Document whether it's safe to use bytes for struct format string

2017-04-28 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +struct.Struct.format is bytes, but should be str -Document 
whether it's safe to use bytes for struct format string

___
Python tracker 

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



[issue16349] Document whether it's safe to use bytes for struct format string

2017-04-28 Thread Martin Panter

Martin Panter added the comment:

I think the direction to take for this depends on the outcome of Issue 21071. 
First we have to decide if the “format” attribute is blessed as a byte string 
(and not deprecated), or whether it is deprecated or changed to a text string.

Serhiy pointed out that it is not entirely “safe” because mixing equivalent 
byte and text formats can generate ByteWarning.

--
dependencies: +Document whether it's safe to use bytes for struct format string

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions: +Python 3.6, Python 3.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



[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-28 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Martin Panter

Martin Panter added the comment:

I understand this bug (as reported by ECBFTW) is about Python injecting 
unexpected FTP commands when the “urllib” and “urllib2” modules are used. The 
“httplib” module (“http.client” in Python 3) is unaffected. I only mentioned 
HTTP as an example of a similar fix made recently; sorry if that was confusing.

To be clear, in Python 2 I think both the “urllib” _and_ “urllib2” modules are 
affected, as well as “ftplib” directly. In Python 3, “urllib.request” and 
“ftplib” are affected. But I don’t think “urlparse” and “urllib.parse” should 
be changed.

--

___
Python tracker 

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



[issue30183] [HPUX] compilation error in pytime.c with cc compiler

2017-04-28 Thread David Haney

Changes by David Haney :


--
pull_requests: +1463

___
Python tracker 

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



[issue30202] Update test.test_importlib.test_abc to test find_spec()

2017-04-28 Thread Brett Cannon

New submission from Brett Cannon:

It looks like test_abc isn't really testing find_spec() very much compared to 
find_module(). There might also be some tests still using find_module() that 
should be updated to use find_spec() instead.

--
components: Tests
messages: 292552
nosy: brett.cannon, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Update test.test_importlib.test_abc to test find_spec()
versions: Python 3.7

___
Python tracker 

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



[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon

Changes by Brett Cannon :


--
versions: +Python 3.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



[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon

Brett Cannon added the comment:

When failures are bit more isolated they should probably be reported to 
https://github.com/microsoft/bashonwindows .

--

___
Python tracker 

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



[issue30145] Create a How to or Tutorial documentation for asyncio

2017-04-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Yes, this is a very longstanding open issue. I've already discussed this with 
Guido many times, and even found someone to help us. Will try to kickstart the 
project this weekend.

--

___
Python tracker 

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



[issue30145] Create a How to or Tutorial documentation for asyncio

2017-04-28 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue27377] Add socket.fdtype()

2017-04-28 Thread Neil Schemenauer

Neil Schemenauer added the comment:

Changing title, I think #28134 (socket.socket(fileno=fd) does not work as 
documented) is a cleaner solution.  However, exposing the ability to query a 
socket file descriptor seems useful so I'm still proposing to add 
socket.fdtype().

The github PR 1348 has been modified to remove fromfd2() and only add the 
function fdtype().

--
title: Add smarter socket.fromfd() -> Add socket.fdtype()

___
Python tracker 

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



[issue19417] Bdb: add docstrings and a unittest file (test.test_bdb)

2017-04-28 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +1462

___
Python tracker 

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



[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch looks good to me.

--
nosy: +rhettinger

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Periodically, I've looked at possibly adding these kind of extensions. 

The argument in favor in that it is easy to do and is an obvious extension with 
plausible utility.  

The main arguments against is that it represents feature creep far removed from 
the original intended use cases (the tool is primary about counting and trys 
not to venture into elementwise arithmetic on sparse vectors.)   

It is tempting to add a new feature that might sometimes be useful, but we 
should also worry that usability and learnability are impaired if the class 
becomes less cohesive, less thematic, and less focused on unified design goals.

The other factor against adding the feature is that since the Counter is just a 
dict subclass, it is easy for users to just manipulate the data directly.  
We're not really adding much that a person can't already easily do themselves.

--

___
Python tracker 

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



Re: portable python

2017-04-28 Thread Terry Reedy

On 4/28/2017 1:01 PM, allen wade wrote:

is there a way to install python on a thumb drive


Check http://portablepython.com/

 that does not require an

administrator's password?  I have to use public computers and store all my
applications to the thumb drive, using the Portable Apps Platform to manage
the applications.


For Windows, I would look at https://winpython.github.io/

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Terry Reedy

On 4/28/2017 9:01 AM, eryk sun wrote:

On Fri, Apr 28, 2017 at 12:32 PM, Yip, Kin  wrote:

Traceback (most recent call last):
   File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in 
 from tkinter import *
   File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in 
 from turtle import *
   File "c:\Program Files\Python36\lib\turtle.py", line 116, in 
 from tkinter import simpledialog
ImportError: cannot import name 'simpledialog'


The traceback tells you what you need to know. See how importing
tkinter used your "Python Codes\tkinter.py".

The first part of this problem is that "Edit with IDLE" is executed as
`pythonw.exe -m idlelib "%L" %*`. The -m command-line option adds the
working directory (not the script directory) to the head of sys.path.
The second part is that Explorer starts the process with the working
directory set to the parent directory of the "%L" target file. The 3rd
part is that you have a file in that directory named tkinter.py.
Overall this is a bad experience for beginners, and I know Terry Reedy
is working to improve this.


There is an issue to fix this.
https://bugs.python.org/issue26143
I added a note mentioning this report.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I and others constantly tell people to start IDLE from the command line when 
they have a problem.  Today, someone actually followed the advice and the 
traceback revealed that the problem was a personal tkinter.py masking the 
stdlib file!  Renaming it to mytkinter.py fixed the problem.  This tell me that 
'fixing' sys.path for the idle process must be done immediately after importing 
sys and before importing tkinter.  In the user process, the sys import should 
again be first, followed by the fixup.

I have verified that a user 'sys.py' does not mask sys imports.  Python itself 
imports sys, so IDLE's 'import sys' just gets the existing sys.modules['sys'].

--

___
Python tracker 

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



[issue28134] socket.socket(fileno=fd) does not work as documented

2017-04-28 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +1461

___
Python tracker 

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



[issue27869] test failures under Bash on Windows / WSL

2017-04-28 Thread Brett Cannon

Brett Cannon added the comment:

Running the tests with -uall didn't change the results.

--

___
Python tracker 

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



[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-28 Thread Stefan Krah

Stefan Krah added the comment:

I'm with Nathaniel here: The fixed-bug is probably too obscure to warrant ABI 
breakage.

--
nosy: +skrah

___
Python tracker 

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



portable python

2017-04-28 Thread allen wade
is there a way to install python on a thumb drive that does not require an
administrator's password?  I have to use public computers and store all my
applications to the thumb drive, using the Portable Apps Platform to manage
the applications.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-28 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Pillow also had broken wheels up on pypi for a while; they've now put out a bug 
fix release that #undef's PySlice_GetIndicesEx, basically monkeypatching out 
the bugfix to get back to the 3.6.0 behavior: 
https://github.com/python-pillow/Pillow/issues/2479

--

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 941ea53b5776aaeb9dc1026e482a4ce5c5768830 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-30197: Enhance swap_attr() and backport swap_item() in 
test.test_support. (#1341) (#1347)
https://github.com/python/cpython/commit/941ea53b5776aaeb9dc1026e482a4ce5c5768830


--

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 910ba937e90ffe3aa154a5b27dc7e2c3d3c88d1f by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. 
(#1341) (#1346)
https://github.com/python/cpython/commit/910ba937e90ffe3aa154a5b27dc7e2c3d3c88d1f


--

___
Python tracker 

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



[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Done.

--

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 712114b3f9f5f98f03c66a80607b6f7101c5cc90 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. 
(GH-1341) (#1345)
https://github.com/python/cpython/commit/712114b3f9f5f98f03c66a80607b6f7101c5cc90


--

___
Python tracker 

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



[issue27377] Add smarter socket.fromfd()

2017-04-28 Thread Neil Schemenauer

Changes by Neil Schemenauer :


--
pull_requests: +1460

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1459

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1458

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1457

___
Python tracker 

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



[issue30201] [3.5] RecvmsgIntoSCMRightsStreamTest fails with "OSError: [Errno 12] Cannot allocate memory" on macOS El Capitan

2017-04-28 Thread STINNER Victor

New submission from STINNER Victor:

The test fails on Python 3.5 but pass on Python 3.6, I don't know why.

http://buildbot.python.org/all/builders/x86-64%20El%20Capitan%203.5/builds/31/steps/test/logs/stdio

==
ERROR: testFDPassEmpty (test.test_socket.RecvmsgSCMRightsStreamTest)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py",
 line 2851, in testFDPassEmpty
len(MSG), 10240),
  File 
"/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py",
 line 1955, in doRecvmsg
result = sock.recvmsg(bufsize, *args)
OSError: [Errno 12] Cannot allocate memory

==
ERROR: testFDPassEmpty (test.test_socket.RecvmsgIntoSCMRightsStreamTest)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py",
 line 2851, in testFDPassEmpty
len(MSG), 10240),
  File 
"/Users/buildbot/buildarea/3.5.billenstein-elcapitan/build/Lib/test/test_socket.py",
 line 2046, in doRecvmsg
result = sock.recvmsg_into([buf], *args)
OSError: [Errno 12] Cannot allocate memory

--
components: Tests, macOS
messages: 292538
nosy: haypo, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: [3.5] RecvmsgIntoSCMRightsStreamTest fails with "OSError: [Errno 12] 
Cannot allocate memory" on macOS El Capitan
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



[issue30190] unittest's assertAlmostEqual improved error message

2017-04-28 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Thanks for chiming in.

> Is it worth to output a difference when the delta argument is not passed?

Yes, probably. I will change that.

> Is it worth to output a signed difference rather than an absolute value?

Mmmm probably not IMHO. Personally I never care about the position of left and 
right arguments. I just want to check whether a and b are almost equal.

--

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83 by Victor Stinner 
(Serhiy Storchaka) in branch 'master':
bpo-30197: Enhance functions swap_attr() and swap_item() in test.support. 
(#1341)
https://github.com/python/cpython/commit/d1a1def7bf221b04dcf3fc3a67aa19aa2f622f83


--
nosy: +haypo

___
Python tracker 

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



[issue30200] tkinter ListboxSelect

2017-04-28 Thread Frank Pae

New submission from Frank Pae:

prerequisite:
you have more than one tkinter listbox

behavior in py 2.7.13 and py 3.5.3:
if you leave a listbox and goes to another, then the abandoned listbox create 
not a  ListboxSelect Event

behavior in py 3.6.0 and 3.6.1:
if you leave a listbox and goes to another, then the abandoned listbox create a 
 ListboxSelect Event and this gives a error-message


I dont know if my program is false, but it works in 2.7 and 3.5 good, however 
not with 3.6

Thank you

--
components: Tkinter
files: tk_ListboxSelect.py
messages: 292535
nosy: Frank Pae
priority: normal
severity: normal
status: open
title: tkinter ListboxSelect
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46833/tk_ListboxSelect.py

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 98c7a9e662b49029ff051b6699ddc0f542663c96 by Victor Stinner in 
branch '3.5':
[3.5] bpo-30107: don't dump core on expected test_io crash (#1235) (#1344)
https://github.com/python/cpython/commit/98c7a9e662b49029ff051b6699ddc0f542663c96


--

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2017-04-28 Thread Sergey B Kirpichev

Changes by Sergey B Kirpichev :


--
nosy: +Sergey.Kirpichev

___
Python tracker 

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



Fwd: Bigotry (you win, I give up)

2017-04-28 Thread justin walters
On Thu, Apr 27, 2017 at 9:52 PM, Mike Reveile 
wrote:

> I can measure a Pineapple... by weight, volume, color, taste, smell,
> ripeness... but none of these numbers are the pineapple. They only help me
> relate to the pineapple. In this way Math itself (and the entire realm of
> computer science) is unreal.



I've always felt that math is simply another language like English or
Spanish. Language is an abstraction
that humans use to convey meaning to other humans. We agreed on common
labels and sounds
to represent things, actions, and ideas. Math is the same. The laws of
physics obviously exist in some sense
because we can observe their effects. We represent these effects with
numbers and symbols. The number 1
could just as well be the number gobbledeegorp. It doesn't matter. The
number one simply represents a single entity
of anything at all. Of course this is all from the narrow field of human
perception. What humans perceive
to be real could, in all possibility, be completely made up in our own
minds. I don't want to get to far into
the "perception is reality" side of things although.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949 by Victor Stinner in 
branch '3.6':
bpo-30125: disable faulthandler in ctypes test_SEH (#1237) (#1343)
https://github.com/python/cpython/commit/e005dd9a6da7dfa34f47a6989a7e0a6b1ad04949


--

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1456

___
Python tracker 

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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1455

___
Python tracker 

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



[issue30199] Warning -- asyncore.socket_map was modified by test_ssl

2017-04-28 Thread STINNER Victor

New submission from STINNER Victor:

It seems like test_asyncore_server() of test_ssl doesn't cleanup properly 
asyncore on FreeBSD, and so following unit tests can be impacted (and fail).

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/210/steps/test/logs/stdio

test_asyncore_server (test.test_ssl.ThreadedTests)
Check the example asyncore integration. ... 
 server:  new connection from 127.0.0.1:48985
 client:  sending b'FOO\n'...
 server:  read b'FOO\n' from client
 client:  read b'foo\n'
 client:  closing connection.
 server:  read b'over\n' from client
 client:  connection closed.
 cleanup: stopping server.
 cleanup: joining server thread.
 cleanup: successfully joined.
ok
...
Warning -- asyncore.socket_map was modified by test_ssl
  Before: {}
  After:  {6: }

Maybe AsyncoreEchoServer.__exit__() should just ends with 
"asyncore.close_all(ignore_all=True)"?

--
components: Tests
messages: 292532
nosy: haypo
priority: normal
severity: normal
status: open
title: Warning -- asyncore.socket_map was modified by test_ssl
type: resource usage
versions: Python 3.7

___
Python tracker 

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



RE: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Yip, Kin
Hi Erky and Peter,

Thanks for the explanations.   Next time, I'd try to treat the "traceback" more 
seriously :-)
I've learnt the difference between python.exe and python.exe   and   to be more 
carefully with my code names :-(

Kin

-Original Message-
From: eryk sun [mailto:eryk...@gmail.com] 
Sent: Friday, April 28, 2017 9:01 AM
To: python-list@python.org
Cc: Yip, Kin 
Subject: Re: "Edit with IDLE" doesn't work any more ?

On Fri, Apr 28, 2017 at 12:32 PM, Yip, Kin  wrote:
> Traceback (most recent call last):
>   File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in 
> from tkinter import *
>   File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in 
> from turtle import *
>   File "c:\Program Files\Python36\lib\turtle.py", line 116, in 
> from tkinter import simpledialog
> ImportError: cannot import name 'simpledialog'

The traceback tells you what you need to know. See how importing tkinter used 
your "Python Codes\tkinter.py".

The first part of this problem is that "Edit with IDLE" is executed as 
`pythonw.exe -m idlelib "%L" %*`. The -m command-line option adds the working 
directory (not the script directory) to the head of sys.path.
The second part is that Explorer starts the process with the working directory 
set to the parent directory of the "%L" target file. The 3rd part is that you 
have a file in that directory named tkinter.py.
Overall this is a bad experience for beginners, and I know Terry Reedy is 
working to improve this.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Peter Otten
Stefan Ram wrote:

> Peter Otten <__pete...@web.de> writes:
>>one of the modules in Python's standard library IDLE will try to run with
>>your module rather than the one it actually needs. Common candidates are
>>code.py or string.py, but there are many more.
> 
>   I know this from Java:
> 
>   When you write a program
> 
> ... main( final String[] args ) ...
> 
>   and then create a file »String.class« in the program's
>   directory, the program usually will not work anymore.
> 
>   However, in Java one can use an absolute path as in,
> 
> ... main( final java.lang.String[] args ) ...
> 
>   , in which case the program will still work in the
>   presence of such a »String.class« file.
> 
>   I wonder whether Python also might have such a kind
>   of robust "absolute addressing" of a module.

While I would welcome such a "reverse netloc" scheme or at least a "std" 
toplevel package that guarantees imports from the standard library I fear 
the pain is not yet big enough ;)


-- 
https://mail.python.org/mailman/listinfo/python-list


py-backwards - Python to python compiler that allows you to use Python 3.6 features in older versions.

2017-04-28 Thread breamoreboy
Hi folks, I've no idea if you could be interested in this beastie 
https://github.com/nvbn/py-backwards but if you don't know about it, you can't 
be :)

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread eryk sun
On Fri, Apr 28, 2017 at 12:32 PM, Yip, Kin  wrote:
> Traceback (most recent call last):
>   File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in 
> from tkinter import *
>   File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in 
> from turtle import *
>   File "c:\Program Files\Python36\lib\turtle.py", line 116, in 
> from tkinter import simpledialog
> ImportError: cannot import name 'simpledialog'

The traceback tells you what you need to know. See how importing
tkinter used your "Python Codes\tkinter.py".

The first part of this problem is that "Edit with IDLE" is executed as
`pythonw.exe -m idlelib "%L" %*`. The -m command-line option adds the
working directory (not the script directory) to the head of sys.path.
The second part is that Explorer starts the process with the working
directory set to the parent directory of the "%L" target file. The 3rd
part is that you have a file in that directory named tkinter.py.
Overall this is a bad experience for beginners, and I know Terry Reedy
is working to improve this.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 826f83f1d562a7b878499bc3af2267cfdfe5f2f9 by Victor Stinner in 
branch 'master':
bpo-30104: Only use -fno-strict-aliasing on dtoa.c (#1340)
https://github.com/python/cpython/commit/826f83f1d562a7b878499bc3af2267cfdfe5f2f9


--

___
Python tracker 

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



Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Peter Otten
Yip, Kin wrote:

> I'm relatively new with Python3 in Windows 7.  I'm using now Python 3.6.1.
> 
> Suddenly right-clicking on a .py file  and choose "Edit with IDLE" just
> doesn't work.
> 
> I've tried to do :
> 
> "c:\program files\python36\pythonw.exe"   -m idlelibmypythoncodes.py
> 
> 
> the IDLE editor just doesn't come up.But if I start the IDLE Shell and
> then "Open File", the editor is there and works normally.

IDLE shares its import mechanism with every other Python script. 

This results in the nasty quirk that if you have other .py files in the same 
directory as mypythoncodes.py, and one of these files has the same name as 
one of the modules in Python's standard library IDLE will try to run with 
your module rather than the one it actually needs. Common candidates are 
code.py or string.py, but there are many more. 

Once you rename or delete those files IDLE should start working again.

PS: Judging from the traceback in your answer to eryk sun in your case the 
offending module may be called tkinter.py



-- 
https://mail.python.org/mailman/listinfo/python-list


RE: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Yip, Kin
Hi,

I've finally known why   By chance, I went to the installation directory : 
C:\Program Files\Python36\Lib\tkinter   

to check on files.  I did "EDIT with IDLE" on any files there.  It all works !  
 Then, I went back to my directory
where I put all my personal .py codes.  It didn't work there.   Finally, I've 
guessed and realized/tested that
"EDIT with IDLE"  doesn't work in my python directory because I have just 
recently made a file called :

tkinter.py


Somehow, this stops "EDIT with IDLE" from working if I try to "EDIT with IDLE" 
on any files in that directory/folder.

After I rename it to mytkinter.py , things work normally now ! 

Weird !Don't know exactly why ...?!   

Sorry to bother you guys ...

Kin

-Original Message-
From: Python-list [mailto:python-list-bounces+kinyip=bnl@python.org] On 
Behalf Of Yip, Kin
Sent: Friday, April 28, 2017 8:33 AM
To: eryk sun ; python-list@python.org
Subject: RE: "Edit with IDLE" doesn't work any more ?

Hi Eryk,

If I do:

"c:\Program Files\Python36\python.exe"  -m idlelib beersong.py

I see the following :

===
Traceback (most recent call last):
  File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in 
from tkinter import *
  File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in 
from turtle import *
  File "c:\Program Files\Python36\lib\turtle.py", line 116, in 
from tkinter import simpledialog
ImportError: cannot import name 'simpledialog'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Program Files\Python36\lib\runpy.py", line 193, in 
_run_module_as_main
"__main__", mod_spec)
  File "c:\Program Files\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "c:\Program Files\Python36\lib\idlelib\__main__.py", line 6, in 
import idlelib.pyshell
  File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 7, in 
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined



Any suggestion ?

Kin

-Original Message-
From: eryk sun [mailto:eryk...@gmail.com] 
Sent: Friday, April 28, 2017 8:27 AM
To: python-list@python.org
Cc: Yip, Kin 
Subject: Re: "Edit with IDLE" doesn't work any more ?

On Fri, Apr 28, 2017 at 12:04 PM, Yip, Kin  wrote:
>
> I've tried to do :
>
> "c:\program files\python36\pythonw.exe"   -m idlelibmypythoncodes.py

Change this to use "python.exe" and run it from a command prompt. This way you 
can see the traceback if an exception is raised.
-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1454

___
Python tracker 

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



RE: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Yip, Kin
Hi Eryk,

If I do:

"c:\Program Files\Python36\python.exe"  -m idlelib beersong.py

I see the following :

===
Traceback (most recent call last):
  File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 4, in 
from tkinter import *
  File "C:\Users\kinyip\Desktop\Python Codes\tkinter.py", line 1, in 
from turtle import *
  File "c:\Program Files\Python36\lib\turtle.py", line 116, in 
from tkinter import simpledialog
ImportError: cannot import name 'simpledialog'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Program Files\Python36\lib\runpy.py", line 193, in 
_run_module_as_main
"__main__", mod_spec)
  File "c:\Program Files\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "c:\Program Files\Python36\lib\idlelib\__main__.py", line 6, in 
import idlelib.pyshell
  File "c:\Program Files\Python36\lib\idlelib\pyshell.py", line 7, in 
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined



Any suggestion ?

Kin

-Original Message-
From: eryk sun [mailto:eryk...@gmail.com] 
Sent: Friday, April 28, 2017 8:27 AM
To: python-list@python.org
Cc: Yip, Kin 
Subject: Re: "Edit with IDLE" doesn't work any more ?

On Fri, Apr 28, 2017 at 12:04 PM, Yip, Kin  wrote:
>
> I've tried to do :
>
> "c:\program files\python36\pythonw.exe"   -m idlelibmypythoncodes.py

Change this to use "python.exe" and run it from a command prompt. This way you 
can see the traceback if an exception is raised.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "Edit with IDLE" doesn't work any more ?

2017-04-28 Thread eryk sun
On Fri, Apr 28, 2017 at 12:04 PM, Yip, Kin  wrote:
>
> I've tried to do :
>
> "c:\program files\python36\pythonw.exe"   -m idlelibmypythoncodes.py

Change this to use "python.exe" and run it from a command prompt. This
way you can see the traceback if an exception is raised.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +brett.cannon, pitrou

___
Python tracker 

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



[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1453

___
Python tracker 

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



[issue30198] distutils build_ext: don't run newer_group() in parallel in multiple threads when using parallel

2017-04-28 Thread STINNER Victor

New submission from STINNER Victor:

Since Python 3.5, distutils is able to build extensions in parallel, nice 
enhancement! But setup.py of CPython is 2x slower in parallel mode when all 
modules are already built: (1 sec vs 500 ms).

Building extensions calls newer_group() which calls os.stat() 6,856 times. I 
wrote a cache for os.stat() but it has no impact on performance.

It seems like threads are fighting to death for the GIL in the os.stat() race...

Attached pull request calls newer_group() before spawning threads in parallel 
mode, so "setup.py build" takes the same time with and without parallel module, 
when all extensions are already built.

I didn't measure performance when all extensions must be built.

--
components: Distutils
messages: 292530
nosy: dstufft, haypo, merwok
priority: normal
severity: normal
status: open
title: distutils build_ext: don't run newer_group() in parallel in multiple 
threads when using parallel
type: performance
versions: Python 3.7

___
Python tracker 

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



"Edit with IDLE" doesn't work any more ?

2017-04-28 Thread Yip, Kin
Hi,

I'm relatively new with Python3 in Windows 7.  I'm using now Python 3.6.1.

Suddenly right-clicking on a .py file  and choose "Edit with IDLE" just doesn't 
work.

I've tried to do :

"c:\program files\python36\pythonw.exe"   -m idlelibmypythoncodes.py


the IDLE editor just doesn't come up.But if I start the IDLE Shell and then 
"Open File", the editor is there and
works normally.

I've tried to uninstall "python launcher" and then repair or modify  "python3.6 
" in Control Panel/Program and Features.   Nothing works ...

Any help ?  I show you my Windows registry at the bottom of this email.

Kin

PS: My registry :

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Python.File\shell]

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle]
"MUIVerb"=" with IDLE"
"Subcommands"=""

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell]

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36]
"MUIVerb"="Edit with IDLE 3.6 (64-bit)"

[HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36\command]
@="\"C:\\Program Files\\Python36\\pythonw.exe\" -m idlelib \"%L\" %*"

[HKEY_CLASSES_ROOT\Python.File\shell\open]

[HKEY_CLASSES_ROOT\Python.File\shell\open\command]
@="\"C:\\WINDOWS\\py.exe\" \"%L\" %*"

[HKEY_CLASSES_ROOT\Python.File\shell\Run]

[HKEY_CLASSES_ROOT\Python.File\shell\Run\command]
@="\"C:\\Windows\\py.exe\" \"%1\" %*"

[HKEY_CLASSES_ROOT\Python.File\shell\runas]

[HKEY_CLASSES_ROOT\Python.File\shell\runas\command]
@="\"C:\\Windows\\py.exe\" \"%1\" %*"

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24960] Can't use lib2to3 with embeddable zip file.

2017-04-28 Thread Philippe Pinard

Philippe Pinard added the comment:

As Sébastien Taylor, I ran into the same problem. The workaround I found was to 
unzip the content of python35.zip and put it in the Lib/ folder.

--
nosy: +ppinard

___
Python tracker 

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



[ANN] 10ᵀᴴ Advanced Scientific Programming in Python in Nikiti, Greece, August 28—September 2, 2017

2017-04-28 Thread Tiziano Zito
10ᵀᴴ Advanced Scientific Programming in Python
==
a Summer School by the G-Node and the Municipality of Sithonia

Scientists spend more and more time writing, maintaining, and debugging 
software. While techniques for doing this efficiently have evolved, only few 
scientists have been trained to use them. As a result, instead of doing their 
research, they spend far too much time writing deficient code and reinventing 
the wheel. In this course we will present a selection of advanced programming 
techniques and best practices which are standard in the industry, but 
especially tailored to the needs of a programming scientist. Lectures are 
devised to be interactive and to give the students enough time to acquire 
direct hands-on experience with the materials. Students will work in pairs 
throughout the school and will team up to practice the newly learned skills in 
a real programming project — an entertaining computer game.

We use the Python programming language for the entire course. Python works as a 
simple programming language for beginners, but more importantly, it also works 
great in scientific simulations and data analysis. We show how clean language 
design, ease of extensibility, and the great wealth of open source libraries 
for scientific computing and data visualization are driving Python to become a 
standard tool for the programming scientist.

This school is targeted at Master or PhD students and Post-docs from all areas 
of science. Competence in Python or in another language such as Java, C/C++, 
MATLAB, or Mathematica is absolutely required. Basic knowledge of Python and of 
a version control system such as git, subversion, mercurial, or bazaar is 
assumed. Participants without any prior experience with Python and/or git 
should work through the proposed introductory material before the course.

We are striving hard to get a pool of students which is international and 
gender-balanced.

You can apply online: https://python.g-node.org
Application deadline: 23:59 UTC, May 31, 2017. There will be no deadline 
extension, so be sure to apply on time ;-)
Be sure to read the FAQ before applying.

Participation is for free, i.e. no fee is charged! Participants however should 
take care of travel, living, and accommodation expenses by themselves.

Date & Location
===
August 28—September 2, 2017. Nikiti, Sithonia, Halkidiki, Greece

Program
===
→ Best Programming Practices
  • Best practices for scientific programming
  • Version control with git and how to contribute to open source projects with 
GitHub
  • Best practices in data visualization
→ Software Carpentry
  • Test-driven development
  • Debugging with a debuggger
  • Profiling code
→ Scientific Tools for Python
  • Advanced NumPy
→ Advanced Python
  • Decorators
  • Context managers
  • Generators
→ The Quest for Speed
  • Writing parallel applications
  • Interfacing to C with Cython
  • Memory-bound problems and memory profiling
  • Data containers: storage and fast access to large data
→ Practical Software Development
  • Group project

Preliminary Faculty
===
• Francesc Alted, freelance consultant, author of Blosc, Castelló de la Plana, 
Spain
• Pietro Berkes, NAGRA Kudelski, Lausanne, Switzerland
• Zbigniew Jędrzejewski-Szmek, Krasnow Institute, George Mason University, 
Fairfax, VA USA
• Eilif Muller, Blue Brain Project, École Polytechnique Fédérale de Lausanne 
Switzerland
• Juan Nunez-Iglesias, Victorian Life Sciences Computation Initiative, 
University of Melbourne, Australia
• Rike-Benjamin Schuppner, Institute for Theoretical Biology, 
Humboldt-Universität zu Berlin, Germany
• Nicolas P. Rougier, Inria Bordeaux Sud-Ouest, Institute of Neurodegenerative 
Disease, University of Bordeaux, France
• Bartosz Teleńczuk, European Institute for Theoretical Neuroscience, CNRS, 
Paris, France
• Stéfan van der Walt, Berkeley Institute for Data Science, UC Berkeley, CA USA
• Nelle Varoquaux, Berkeley Institute for Data Science, UC Berkeley, CA USA
• Tiziano Zito, freelance consultant, Berlin, Germany

Organizers
==
For the German Neuroinformatics Node of the INCF (G-Node) Germany:
• Tiziano Zito, freelance consultant, Berlin, Germany
• Zbigniew Jędrzejewski-Szmek, Krasnow Institute, George Mason University, 
Fairfax, USA
• Jakob Jordan, Institute of Neuroscience and Medicine (INM-6), 
Forschungszentrum Jülich GmbH, Germany
• Etienne Roesch, Centre for Integrative Neuroscience and Neurodynamics, 
University of Reading, UK

Website: https://python.g-node.org
Contact: python-i...@g-node.org
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


EuroPython 2017: Training sessions included

2017-04-28 Thread Alexander Hendorf
The program work group has decided on the first set of nine trainings for 
EuroPython 2017.
These training sessions are included in the EuroPython 2017 ticket price at no 
extra charge and provide a great value for money.

We are happy to announce the following three hour training sessions:

- Andrew Svetlov - Optimizing Python code with Cython
- Daniele Procida - Launch your application into the cloud
- Katharine Jarmul - Data Unit Testing with Python
- Kristian Rother  - Best Practices for Debugging
- Michael McKerns - Modern optimization methods in Python
- Miguel Grinberg - Building Microservices with Python and Flask
- Mike Müller - Faster Python Programs - Measure, don’t Guess
 - Paul Everitt - Debugging for the Masses…Visually
 - Roberto Polli - Ansible 2 done right

More information:
https://ep2017.europython.eu/en/events/trainings

We will announce the second set of trainings after the end of the talk voting.


Enjoy,

EuroPython 2017 Team
http://ep2017.europython.eu/
http://www.europython-society.org/

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Measuring Python startup performance is painful, there is a huge deviation.

That is why I run Python 100 times and repeat that several times for testing 
that the result is stable. With perf I got roughly the same result -- the 
absolute difference is 18-19 ms, or 17%.

--

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1452

___
Python tracker 

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



[issue30197] Enhance swap_attr() and swap_item() in test.support

2017-04-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch adds two features to functions swap_attr() and swap_item() in 
the test.support module.

1. They now work (rather than failing in __exit__) when delete the attribute or 
item inside the with block. There were several cases when I refused to use 
these functions instead of manually coded try/finally due to lack of this 
feature.

2. The original value of the attribute or item can be assigned to the target of 
"as" in the with statement. This can save a line of the code in some cases.

--
components: Tests
messages: 292527
nosy: ezio.melotti, michael.foord, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Enhance swap_attr() and swap_item() in test.support
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:

I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so 
here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: 
https://github.com/python/cpython/pull/1340

I chose to add the flag for any C compiler. If you think that a C compiler may 
not support that option, we can start by only adding the option on clang, and 
maybe add it on other C compilers if someone complains.

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:

I would like to fix FreeBSD CURRENT buildbots of Python 2.7, 3.5 and 3.6, so 
here my attempt to restrict the -fno-strict-aliasing option to the dtoa.c file: 
https://github.com/python/cpython/pull/1340

I chose to add the flag for any C compiler. If you think that a C compiler may 
not support that option, we can start by only adding the option on clang, and 
maybe add it on other C compilers if someone complains.

--

___
Python tracker 

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



[issue30104] clang 4.0 miscompiles dtoa.c, giving broken float parsing and printing

2017-04-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1451

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread STINNER Victor

STINNER Victor added the comment:

> $ time for i in `seq 100`; do ./python -S -c 'import argparse; 
> argparse.ArgumentParser()'; done

Measuring Python startup performance is painful, there is a huge deviation. You 
may try the new "command" command that I added to perf 1.1:
---
haypo@selma$ python3 -m perf command --stats -- python3 -S -c pass
.
Total duration: 21.0 sec
Start date: 2017-04-28 12:15:57
End date: 2017-04-28 12:16:20
Raw value minimum: 174 ms
Raw value maximum: 229 ms

Number of calibration run: 1
Number of run with values: 20
Total number of run: 21

Number of warmup per run: 1
Number of value per run: 3
Loop iterations per value: 16
Total number of values: 60

Minimum: 10.9 ms
Median +- MAD:   12.3 ms +- 0.5 ms
Mean +- std dev: 12.4 ms +- 0.7 ms
Maximum: 14.3 ms

  0th percentile: 10.9 ms (-12% of the mean) -- minimum
  5th percentile: 11.2 ms (-10% of the mean)
 25th percentile: 11.9 ms (-4% of the mean) -- Q1
 50th percentile: 12.3 ms (-1% of the mean) -- median
 75th percentile: 12.9 ms (+4% of the mean) -- Q3
 95th percentile: 13.7 ms (+10% of the mean)
100th percentile: 14.3 ms (+15% of the mean) -- maximum

Number of outlier (out of 10.4 ms..14.4 ms): 0

command: Mean +- std dev: 12.4 ms +- 0.7 ms
---

There is a huge difference between the minimum and the maximum.

By the way, I'm interested by feedback on that tool, I'm not sure that it's 
reliable, it can likely be enhanced somewhere ;-)

--

___
Python tracker 

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



[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

lxml is not the part of the Python standard library. Use lxml bug tracker if 
your issue is specific for lxml.

If you can reproduce the issue with xml.etree.ElementTree from the stdlib, 
please provide a simple example code that does this.

--
nosy: +serhiy.storchaka
stage:  -> test needed
status: open -> pending

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue30196] Add __matmul__ to collections.Counter

2017-04-28 Thread Jáchym Barvínek

New submission from Jáchym Barvínek:

The class collections.Counter should semantically contain only numbers, so it 
makes sense to define dot product od Counters, something like this:

def __matmul__(self, other):
  return sum(self[x] * other[x] for x in self.keys() | other.keys())

I find this useful ocassionaly.

--
components: Library (Lib)
messages: 292522
nosy: Jáchym Barvínek
priority: normal
severity: normal
status: open
title: Add __matmul__ to collections.Counter
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30195] writing non-ascii characters in xml file using python code embedded in C

2017-04-28 Thread mahboubi

New submission from mahboubi:

my python code embedded in C program, uses etree from lxml to write a plain 
string as element attribute in xml file. the problem is when my string contains 
non english characters(non ascii), the program fails to write even with unicode 
conversion such as unicode(mystring, "utf-8"), but when I use python code only, 
it works.

--
components: XML
messages: 292521
nosy: aimad, benjamin.peterson, ezio.melotti, haypo, lemburg
priority: normal
severity: normal
status: open
title: writing non-ascii characters in xml file using python code embedded in C
type: crash
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



[issue30052] URL Quoting page links to function Bytes instead of defintion

2017-04-28 Thread Nick Coghlan

Nick Coghlan added the comment:

New PR disabling the output caching and adding a corresponding NEWS entry: 
https://github.com/python/cpython/pull/1339

On my local machine, it takes a "nothing changed" build from less than 2 
seconds to just under 2 minutes, but I think that's fine for a daily build task.

--

___
Python tracker 

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



[issue30052] URL Quoting page links to function Bytes instead of defintion

2017-04-28 Thread Nick Coghlan

Changes by Nick Coghlan :


--
pull_requests: +1450

___
Python tracker 

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



[issue4773] HTTPMessage not documented and has inconsistent API across Py2/Py3

2017-04-28 Thread Socob

Changes by Socob <206a8...@opayq.com>:


--
nosy: +Socob

___
Python tracker 

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



Re: Thread getting stuck\hang

2017-04-28 Thread Iranna Mathapati
Hi Dennis,

Two threads(_st and _dy targets) sharing the same user define function at
the same  time...This is the reason for hang/stuck?

in both the thread ,we are calling same user define function
(itgen_explorer.startTrafficFlows) and greping the values from return
function ,using it in main function.

script was hang after completion of the program only .



On Fri, Apr 28, 2017 at 2:42 PM, Iranna Mathapati 
wrote:

> Hi Dennis,
>
> Two threads(_st and _dy targets) sharing the same user define function at
> the same  time...This is the reason for hang/stuck?
>
> in both the thread ,we are calling same user define function
> (itgen_explorer.startTrafficFlows) and greping the values from return
> function ,using it in main function.
>
>
> On Fri, Apr 28, 2017 at 5:06 AM, Dennis Lee Bieber 
> wrote:
>
>> On Thu, 27 Apr 2017 22:16:06 +0530, Iranna Mathapati
>>  declaimed the following:
>>
>> >Hi Dennis,
>> >
>> >all function arguments declare as global and pass it to the function.
>> >
>> >All three thread is completed the execution part and after completion of
>> >execution its stuck/hang the programme.
>> >
>> >*def
>> >validate_traffic_stats_st(FT_item,RT_item,forward_path_list
>> ,return_path_list,nat_type_list,pkt_st)*
>> >:
>> >global flag1
>> >flag1 = 1
>> >
>> Dangerous usage... Threads should not rely on writing to globals
>> unless
>> they surround all accesses to the global with a mutual exclusion lock --
>> OR
>> there is only one thread allowed to ever write to the global (a common
>> usage is for the main program to set a flag that signals threads to exit,
>> and the threads periodically read the flag to see if it has been set).
>>
>>
>> 
>> >log.error('{0} forward path itgen verification
>> >failed'.format(nat_type))
>> >flag1 = 0
>> >return flag1
>>
>> threads do not "return" data, they just exit
>>
>> 
>> >return
>> >flag1,count_st_Rx,count_st_in_Rx,count_st_out_Rx,count_st_
>> Tx,count_st_in_Tx,count_st_out_Tx
>> >
>>
>> Ditto -- all those items specified in the return are just being
>> dumped
>> on the floor.
>>
>>
>> Recommendations: GET RID OF ALL GLOBAL VARIABLES. If you MUST have
>> shared global variables, you MUST surround access to the variables with
>> mutual exclusion locks -- otherwise you run the risk of counters and lists
>> getting out of sync. I'd also suggest compressing sharing down to single
>> objects, not half a dozen ad-hoc names. That is:
>>
>> class St_Record(object):
>> def __init__(self):
>> self.flag1 = True
>> self.count_st_Rx = 0
>> self.count_st_in_Rx = 0
>> self.count_st_out_Rx = 0
>> self.whatever = suitableInitValue
>>
>> etc. for any other item needed for "st"
>>
>> Do a similar class for the "dy"
>>
>>
>> Instanciate one instance of each
>>
>> st_rec = St_Record()
>> ...
>>
>> And inside the relevant threads simply access as
>>
>> st_rec.count_st_Rx += ...
>>
>> Assuming these are only used by one thread (and the main program after
>> they
>> end) you don't even need to declare them global. Python will find the
>> instances at the module level, and one can mutate the instance (ie; the
>> contents) without needing to declare global.
>>
>>
>> "Lockup" of the program implies dead-lock, which usually means
>> race
>> conditions for the references to data objects between threads, or improper
>> use of mutual exclusion.
>> --
>> Wulfraed Dennis Lee Bieber AF6VN
>> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Thread getting stuck\hang

2017-04-28 Thread Iranna Mathapati
Hi Dennis,

Two threads(_st and _dy targets) sharing the same user define function at
the same  time...This is the reason for hang/stuck?

in both the thread ,we are calling same user define function
(itgen_explorer.startTrafficFlows) and greping the values from return
function ,using it in main function.


On Fri, Apr 28, 2017 at 5:06 AM, Dennis Lee Bieber 
wrote:

> On Thu, 27 Apr 2017 22:16:06 +0530, Iranna Mathapati
>  declaimed the following:
>
> >Hi Dennis,
> >
> >all function arguments declare as global and pass it to the function.
> >
> >All three thread is completed the execution part and after completion of
> >execution its stuck/hang the programme.
> >
> >*def
> >validate_traffic_stats_st(FT_item,RT_item,forward_path_
> list,return_path_list,nat_type_list,pkt_st)*
> >:
> >global flag1
> >flag1 = 1
> >
> Dangerous usage... Threads should not rely on writing to globals
> unless
> they surround all accesses to the global with a mutual exclusion lock -- OR
> there is only one thread allowed to ever write to the global (a common
> usage is for the main program to set a flag that signals threads to exit,
> and the threads periodically read the flag to see if it has been set).
>
>
> 
> >log.error('{0} forward path itgen verification
> >failed'.format(nat_type))
> >flag1 = 0
> >return flag1
>
> threads do not "return" data, they just exit
>
> 
> >return
> >flag1,count_st_Rx,count_st_in_Rx,count_st_out_Rx,count_
> st_Tx,count_st_in_Tx,count_st_out_Tx
> >
>
> Ditto -- all those items specified in the return are just being
> dumped
> on the floor.
>
>
> Recommendations: GET RID OF ALL GLOBAL VARIABLES. If you MUST have
> shared global variables, you MUST surround access to the variables with
> mutual exclusion locks -- otherwise you run the risk of counters and lists
> getting out of sync. I'd also suggest compressing sharing down to single
> objects, not half a dozen ad-hoc names. That is:
>
> class St_Record(object):
> def __init__(self):
> self.flag1 = True
> self.count_st_Rx = 0
> self.count_st_in_Rx = 0
> self.count_st_out_Rx = 0
> self.whatever = suitableInitValue
>
> etc. for any other item needed for "st"
>
> Do a similar class for the "dy"
>
>
> Instanciate one instance of each
>
> st_rec = St_Record()
> ...
>
> And inside the relevant threads simply access as
>
> st_rec.count_st_Rx += ...
>
> Assuming these are only used by one thread (and the main program after they
> end) you don't even need to declare them global. Python will find the
> instances at the module level, and one can mutate the instance (ie; the
> contents) without needing to declare global.
>
>
> "Lockup" of the program implies dead-lock, which usually means race
> conditions for the references to data objects between threads, or improper
> use of mutual exclusion.
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu

Louie Lu added the comment:

Add PR: https://github.com/python/cpython/pull/1338/


rbcollins: Need for help to review the patch, I think that both `$thing` and 
`$thing.py` can't be used in python (and for UNIX dir), and `\u2603` (☃) though 
can do something like `☃.py`, but it is not a valid identifier in python, too.

--
nosy: +louielu

___
Python tracker 

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



[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +1449

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-28 Thread Xiang Zhang

Xiang Zhang added the comment:

token defines it as backquote. But in doc there are also several places calling 
it backticks[1][2]. Do you have any preference Serhiy and Martin?

[1] https://docs.python.org/release/3.0.1/whatsnew/3.0.html#removed-syntax
[2] 
https://docs.python.org/2/library/2to3.html?highlight=backtick#2to3fixer-repr

--

___
Python tracker 

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



Re: Thread getting stuck\hang

2017-04-28 Thread Iranna Mathapati
Thanks Dennis,

On Fri, Apr 28, 2017 at 5:06 AM, Dennis Lee Bieber 
wrote:

> On Thu, 27 Apr 2017 22:16:06 +0530, Iranna Mathapati
>  declaimed the following:
>
> >Hi Dennis,
> >
> >all function arguments declare as global and pass it to the function.
> >
> >All three thread is completed the execution part and after completion of
> >execution its stuck/hang the programme.
> >
> >*def
> >validate_traffic_stats_st(FT_item,RT_item,forward_path_
> list,return_path_list,nat_type_list,pkt_st)*
> >:
> >global flag1
> >flag1 = 1
> >
> Dangerous usage... Threads should not rely on writing to globals
> unless
> they surround all accesses to the global with a mutual exclusion lock -- OR
> there is only one thread allowed to ever write to the global (a common
> usage is for the main program to set a flag that signals threads to exit,
> and the threads periodically read the flag to see if it has been set).
>
>
> 
> >log.error('{0} forward path itgen verification
> >failed'.format(nat_type))
> >flag1 = 0
> >return flag1
>
> threads do not "return" data, they just exit
>
> 
> >return
> >flag1,count_st_Rx,count_st_in_Rx,count_st_out_Rx,count_
> st_Tx,count_st_in_Tx,count_st_out_Tx
> >
>
> Ditto -- all those items specified in the return are just being
> dumped
> on the floor.
>
>
> Recommendations: GET RID OF ALL GLOBAL VARIABLES. If you MUST have
> shared global variables, you MUST surround access to the variables with
> mutual exclusion locks -- otherwise you run the risk of counters and lists
> getting out of sync. I'd also suggest compressing sharing down to single
> objects, not half a dozen ad-hoc names. That is:
>
> class St_Record(object):
> def __init__(self):
> self.flag1 = True
> self.count_st_Rx = 0
> self.count_st_in_Rx = 0
> self.count_st_out_Rx = 0
> self.whatever = suitableInitValue
>
> etc. for any other item needed for "st"
>
> Do a similar class for the "dy"
>
>
> Instanciate one instance of each
>
> st_rec = St_Record()
> ...
>
> And inside the relevant threads simply access as
>
> st_rec.count_st_Rx += ...
>
> Assuming these are only used by one thread (and the main program after they
> end) you don't even need to declare them global. Python will find the
> instances at the module level, and one can mutate the instance (ie; the
> contents) without needing to declare global.
>
>
> "Lockup" of the program implies dead-lock, which usually means race
> conditions for the references to data objects between threads, or improper
> use of mutual exclusion.
> --
> Wulfraed Dennis Lee Bieber AF6VN
> wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30103] uu package uses old encoding

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Python 2 used the term "backquote" when ` is a language part.

--

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-28 Thread Xiang Zhang

Xiang Zhang added the comment:

I think "grave accent" is not suitable. Although it's the standard unicode name 
but it's not commonly used in programming so not direct enough. "backquote" and 
"backtick" seems could be used interchangeably I don't have any preference. 
Perl seems to use backtick instead of backquote when ` is a language part. 
Yeah, space is also a choice.

--

___
Python tracker 

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



[issue30103] uu package uses old encoding

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Martin and Xiang. Wikipedia is not a reliable source, but it usually is 
based on reliable sources. In this case seems it is wrong.

The next question is about parameter name. The Wikipedia uses the name "grave 
accent", the manpage of FreeBSD uuencode uses the name "backquote", the 
proposed patch uses the name "backtick". "Grave accent" is an official Unicode 
name, "backquote" and "backtick" are commonly used in programming context. We 
could use also the name containing "space" with the default value True.

--

___
Python tracker 

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



[issue30152] Reduce the number of imports for argparse

2017-04-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

After reverting some changes (import heapq on Raymond's request and import 
gettext since it is needed for the ArgumentParser constructor) the effect of 
the patch is reducing the number of imports by 6 and the time by 0.017 sec (> 
10%) on my computer.

$ time for i in `seq 100`; do ./python -S -c 'import argparse; 
argparse.ArgumentParser()'; done

Unpatched:
real0m13.236s
user0m12.100s
sys 0m0.808s

Patched:
real0m11.535s
user0m10.356s
sys 0m0.756s

--

___
Python tracker 

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



  1   2   >