[issue33381] Incorrect documentation for strftime()/strptime() format code %f

2018-05-02 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

Note: strftime follows the existing documentation:

>>> datetime.datetime(1970, 1, 1, microsecond=1).strftime('%f')
'01'

The strptime behavior bug seems like a duplicate of #32267, which claims to be 
fixed in master as of early January; may not have made it into a release yet 
though. I can't figure out how to view the patch on that issue, it doesn't seem 
to be linked to GitHub like normal.

--
nosy: +josh.r

___
Python tracker 

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



[issue32813] SSL shared_ciphers implementation wrong - returns configured but not shared ciphers

2018-05-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It's looks like OpenSSL just fixed SSL_get_shared_ciphers to actually do what 
we would want here. 
https://github.com/openssl/openssl/commit/a216df599a6076147c27acea6c976fb11f505b1a

--

___
Python tracker 

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



[issue33414] Make shutil.copytree use os.scandir to take advantage of cached is_(dir|file|symlink)

2018-05-02 Thread Andrés Delfino

New submission from Andrés Delfino :

Right now we are using os.path.is(dir|file|symlink) in shutil.copytree, but 
taking advantage of os.scandir's is_(dir|file|symlink) seems the way to go.

I'll make a PR with to start the discussion with a proof of concept.

--
components: Library (Lib)
messages: 316108
nosy: adelfino
priority: normal
severity: normal
status: open
title: Make shutil.copytree use os.scandir to take advantage of cached 
is_(dir|file|symlink)
versions: Python 3.8

___
Python tracker 

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



[issue27448] Race condition in subprocess.Popen which causes a huge memory leak

2018-05-02 Thread Glen Walker

Glen Walker  added the comment:

Correct me if I'm wrong, the change released in Python 2.7.15 doesn't actually 
fix this race condition.

The race is:
* T1: gc_was_enabled = gc.isenabled() # True 
* T1: gc.disable()
* T2: gc_was_enabled = gc.isenabled() # False
* T1: gc.enable()
* T2: gc.disable()

To fix the race condition _disabling_gc_lock must also be held for gc.enable() 
in both call locations so it cannot happen between gc.isenabled() and 
gc.disable().

TBH, I'm not really expecting this to be fixed, this is more a note for any 
future travelers who come across this issue.

--
nosy: +gwalker

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

... Finally, since https://bugs.python.org/issue30916, the 3.x Windows build 
uses a binary external and needs even more patching to build and link against a 
debug and/or custom Tcl/Tk (too long to describe, can give a patch).

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> Is threaded tcl just a compile switch, as with CPython?

Yes.

In tcl.vcxproj, tk.vcxproj and tix.vcxproj, there are parameters named like 
TclOpts that are passed as OPTS arg to the lib's makefiles. For Tcl 8.5, you 
need to pass "threads" to build with threads; for 8.6, "nothreads" to build 
without.

Also, in tcltk.props, the resulting DLL/LIB names are hardcoded with or without 
the 't' suffix. You'll need to fix that if you wish to switch the Tcl flavor.

--

___
Python tracker 

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



pyOpt Error on Tutorial 1

2018-05-02 Thread Maha
I am trying to run pyOpt tutorial located at http://www.pyopt.org/tutorial.html.
It will display the Objective function but the line
slsqp = pyOpt.SLSQP()
gives the following error.
AttributeError: 'module' object has no attribute 'SLSQP'

It is installed on the following folder
C:\Python27\pyOpt-1.2.0\pyOpt\pySLSQP

could you please tell me why this is not available in the environment. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Guido van Rossum

Guido van Rossum  added the comment:

I guess nobody gives a damn.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> An automated test would need to fail more consistently, without needing to 
> click.  Running faster would also be good (and perhaps increase failure 
> rate).  The the test would be that the file runs in subprocess without an 
> error (perhaps multiple times).  There may be a test.support function for 
> this.

Thanks for the ideas. I'm on it.

Was thinking of just wrapping the logic with unittest machinery but for a 
subprocess, it's easier to test stderr for exceptions.

> You also claimed that tkinter is so broken, with either threaded or 
> non-threaded tcl/tk

https://bugs.python.org/issue33412

> CPython's current 2.7 windows installer is installing non-threaded 8.5.18.  
> (I have no idea if or how I could check.)

You can check this by seeing that the Tcl/Tk DLLs lack the 't' suffix.

> It would seem then, that we should change to threaded 8.5.18 before 2.7.16. 
> (2.7.15 was just released).

https://bugs.python.org/issue33257#msg316092

--

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> 
Do you have a suggestion for what to do short of dropping Tkinter support?

Didn't really look into this.
At first glance, from the trace log, the main thread seems to grab a lock at 
some initial point, and then tries to grab it again when running an event 
handler. So making the lock reentrant may help.

--

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread INADA Naoki

INADA Naoki  added the comment:

I'm sorry.  I just reviewed some easy pull requests when I have time.
I'll skip pull requests you assigned yourself next time.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Is threaded tcl just a compile switch, as with CPython?

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

You did not say 'never with threaded tcl'.  You also claimed that tkinter is so 
broken, with either threaded or non-threaded tcl/tk, that tkinter should be 
trashed.  Anyway, I like to test things for myself.

If 'never with threaded tcl' is true, then the crashes I observed indicate that 
CPython's current 2.7 windows installer is installing non-threaded 8.5.18.  (I 
have no idea if or how I could check.)  It would seem then, that we should 
change to threaded 8.5.18 before 2.7.16. (2.7.15 was just released).  I am 
surprised since the Windows installers were in Martin Loewis' charge until 
sometime after 2.7 was released, and he is the one who claimed that tkinter 
should be thread-safe.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> Ivan, as I also said there, it is not clear to me, given your subsequent 
> comments, what you consider to be the status of the PR.

The PR fixes the problem exposed by TkinterCrash2-2.py and TkinterCrash3-2-2.py 
and only lacks an autotest (I asked for any ideas for it and got no response).

Then I found another related bug (https://bugs.python.org/issue33257#msg315286 
) and though to fix it as well -- but it turned out to be deeper than expected.

I'd be fine to commit the current fix and work on the second bug separately.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> I ran TkinterCrash3-2-2.py 15 times on 64-bit Win10, installed x64 3.6.5, 
> with tk 8.6.8, and experienced no crashes.

I wrote in the initial message that this bug only happens with nonthreaded Tcl, 
regardless of Python version and Tcl version.

I've built Py2 with threaded Tcl 8.5.19.0 just to make sure, and indeed, it 
went away.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Rerunning 2.7, I sometimes get the following almost immediately without 
clicking [launch].

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Programs\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
  File "f:/python/a/tem.py", line 50, in run
self.deliverToqueue((self.target, z, y))
  File "f:/python/a/tem.py", line 133, in arrival_122
new_yz[1])
  File "C:\Programs\Python27\lib\lib-tk\Tkinter.py", line 2322, in create_line
return self._create('line', args, kw)
  File "C:\Programs\Python27\lib\lib-tk\Tkinter.py", line 2310, in _create
*(args + self._options(cnf, kw
TclError: bad option "97380032LrunLocal": must be addtag, bbox, bind, canvasx, 
canvasy, cget, configure, coords, create, dchars, delete, dtag, find, focus, 
gettags, icursor, index, insert, itemcget, itemconfigure, lower, move, 
postscript, raise, scale, scan, select, type, xview, or yview

An automated test would need to fail more consistently, without needing to 
click.  Running faster would also be good (and perhaps increase failure rate).  
The the test would be that the file runs in subprocess without an error 
(perhaps multiple times).  There may be a test.support function for this.

The TkinterCrash files currently have way too many comments for a non-beginner 
audience.



The t

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

As I reported on the pydev thread "bpo-33257: seeking advice & approval on the 
course of action", Firefox cannot find the string 'thread' in the tkinter 
chapter of the official doc.  Nor in the tkinter.ttk chapter.  IDLE does not 
find it in tkinter.__init__.  So the claim of 'thread-safe' seems not to be 
'official'.

As I understand 'crash', arrival_122, which calls Canvas.create_line, get 
called in each thread by Track.run. On the other pydev thread, Mac expert 
Ronald Oussorn said "at least on macOS calling GUI methods in Apple’s libraries 
from secondary threads is unsafe unless those methods are explicitly documented 
as thread-safe."

Maybe we should officially say that tkinter/tk/os gui calls from secondary 
threads is chancey, even while we try to make it less so.


Ivan, as I also said there, it is not clear to me, given your subsequent 
comments, what you consider to be the status of the PR.

--

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I had assigned this to myself to review and apply.  I would have appreciated 
you letting me complete that task when I had a chance to take a breath.  This 
was a bug that I caused, so I should be the one responsible for fixing it.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I reproduced the error on installed 2.7.14, running tk 8.5.18.

I ran TkinterCrash3-2-2.py 15 times on 64-bit Win10, installed x64 3.6.5, with 
tk 8.6.8, and experienced no crashes. I ran it another 10 times with 32-bit 
repository 3.8 debug and no crashes.  My conclusion: this is at least partly a 
tcl/tk issue fixed in current tcl/tk.

"this would affect any branch if built with nonthreaded Tcl."  If python is 
delivered (on Windows and Mac) with 'threaded tcl' and rebuilding with 
'nonthreaded tcl' causes a problem with tkinter, then one should not do that.  
In practice, essentially no one does so.

Serhiy, do you know what type of tcl/tk is distributed on Linux?

--
nosy:  -__Vano, gvanrossum

___
Python tracker 

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



Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-02 Thread C W
Thanks, Chris. That makes sense. The len() example is great!

On Tue, May 1, 2018 at 10:37 PM, Chris Angelico  wrote:

> On Wed, May 2, 2018 at 12:22 PM, C W  wrote:
> > It's interesting how mean() can be implemented, but median() will break
> > other packages.
> >
> > So, the default way in numpy is to use functions, not methods?
> >
> > When I first learned Python, I was told to create an object and to play
> > around, there are methods for that object. List has list methods, tuple
> has
> > tuple methods, etc.
> >
> > Now, the default way in numpy is to use function instead of methods? I'm
> > confused. What happened to object-oriented programming?
>
> Even outside of numpy, a lot of Python uses functions, not methods.
> One good reason for this is that a function can accept a wide variety
> of data types as its argument; for instance, len() accepts many
> things, not just lists. Some things are done with methods, others with
> stand-alone functions. There are design choices each way.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27300] tempfile.TemporaryFile(): missing errors=... argument

2018-05-02 Thread Stephan Hohe

Change by Stephan Hohe :


--
pull_requests: +6390
status: pending -> open

___
Python tracker 

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



[RELEASE] Python 3.7.0b4, final 3.7 beta, now available for testing

2018-05-02 Thread Ned Deily
Python 3.7.0b4 is the final beta preview of Python 3.7, the next feature
release of Python. Beta releases are intended to give you the
opportunity to test new features and bug fixes and to prepare your
projects to support the new feature release. We strongly encourage you
to test your projects with 3.7 during the beta phase and report issues
found to bugs.python.org as soon as possible. While the release is
feature complete entering the beta phase, it is possible that features
may be modified or, in rare cases, deleted up until the start of the
release candidate phase. Please keep in mind that this is a preview
release and its use is not recommended for production environments.
Attention macOS users: there is now a new installer variant for macOS
10.9+ that includes a built-in version of Tcl/Tk 8.6. This variant is
expected to become the default version when 3.7.0 releases. Check it out!

The next preview release will be the release candidate and is planned
for 2018-05-21 followed by the official release of 3.7.0, planned for
2018-06-15. You can find Python 3.7.0b4 and more information here:

https://www.python.org/downloads/release/python-370b4/

--
  Ned Deily
  n...@python.org -- []

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


[issue31706] urlencode should accept generator as values for mappings when doseq=True

2018-05-02 Thread François Freitag

Change by François Freitag :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> So this issue doesn't occur when linked with a thread-aware Tcl/Tk, 
right? Maybe we should just make sure that's the only configuration we 
ensure?

This would break compatibility, including some usage patterns (see the 
"Reuse the threaded versions" option above).
Can this actually be considered for anything short of the next major 
release?
While official Windows releases use a pocket version, POSIX ones would 
probably link against whatever a distribution provides.

--
nosy: +__Vano

___
Python tracker 

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



[issue33038] GzipFile doesn't always ignore None as filename

2018-05-02 Thread bbayles

bbayles  added the comment:

Is there someone who might be in a position to review the PR? It's pretty short.

--

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Guido van Rossum

Guido van Rossum  added the comment:

So it seems threads and Tkinter events don't mix. This doesn't surprise me 
much. (Similar issues can occur when mixing threads and asyncio if you don't 
follow the documentation's advice about how to send events across threads.)

Perhaps event_generate() needs to be more careful with locking?

Do you have a suggestion for what to do short of dropping Tkinter support?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Guido van Rossum

Guido van Rossum  added the comment:

So this issue doesn't occur when linked with a thread-aware Tcl/Tk, right? 
Maybe we should just make sure that's the only configuration we ensure?

--
nosy: +gvanrossum

___
Python tracker 

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



[issue33316] Windows: PyThread_release_lock always fails

2018-05-02 Thread STINNER Victor

Change by STINNER Victor :


--
title: PyThread_release_lock always fails -> Windows: PyThread_release_lock 
always fails

___
Python tracker 

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



[issue26834] Add truncated SHA512/224 and SHA512/256

2018-05-02 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2018-05-02 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-02 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

As for PR 6693: I think using keyword arguments would be more Pythonic.

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

Here are the possible courses of action to fix this.

All require design changes, thus can be shot down on a whim. So I'll ask for 
advice and approval at python-dev first, to be sure that my efforts won't be 
scrapped.


First, some terminology I'll be using:
* A "(Tcl interpreter) call" (in quotes) is a sequence of interdependent calls 
into Tcl that a Tkinter routine makes in the course of its action.
* Outstanding "calls" are those from other threads that have not started yet 
and are currently waiting for the Tcl lock.
* A "downstream" "call" is a call made by a running PythonCmd's Python payload.
* Each call to PythonCmd has a "start" -- before releasing the Tcl lock -- and 
an "end" -- when it reacquires it to Tcl_SetObjResult() and return
* A PythonCmd is "active" when it's before its "start" and "end"


Now, the fix options proper:

* At the "end", rearrange the Tcl interpreter's stack frames so that the 
current PythonCmd's one is on top (effectively, make it look as if independent 
"calls" use independent Tcl stacks. Theoretically possible.)
* Confirmed this to be impossible with Tcl's public API
* Prohibit other `PythonCmd's while one is already "active", except its 
"downstream" ones. Options:
* At the "end", the old PythonCmd checks if there are others "calls" on top 
of it (will only happen if such "call" has another "active" PythonCmd on top: 
all other Tkinter routines hold the Tcl lock for their entire duration after 
the 33257 fix), wait if there are.
* Problematic: this wait algorithm is biased against the old PythonCmd. 
Will lead to a potentially infinite wait if there are many threads making Tcl 
calls that result in PythonCmds.
* Hold the Tcl lock for the entire duration of a PythonCmd. To allow 
"downstream" calls, make the Tcl lock reentrant.
* Requires redesign of about two dozen functions in thread_*.c and 
pycond.h: there are only non-reentrant locks currently.
* Behaviour change: wouldn't allow outstanding "calls" while a 
PythonCmd is "active". This change is transparent to Python code though.
* Reuse the threaded versions of Tkapp_* routines: bind a nonthreaded 
interpreter to a thread and forward calls to it as events like in the threaded 
case
* Problematic: visible behaviour change: `tk.call()`s would now hang 
without a running `mainloop()`. Currently, only event handlers don't fire.

Rejected options:
* The new PythonCmd somehow checks at "start" if another one is "active" and 
waits if it's not a descendant of it.
* The new PythonCmd's Tcl interpreter frame has already been allocated when 
it gets control, so the old one cannot return before the new one in any case.

--

___
Python tracker 

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



[issue26834] Add truncated SHA512/224 and SHA512/256

2018-05-02 Thread Nick Timkovich

Nick Timkovich  added the comment:

Was this patch mostly ready to go? The additional SHA512 variants are appealing 
because they run ~40% faster than SHA256 on 64-bit hardware for longer messages.

--
nosy: +nicktimko

___
Python tracker 

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



[issue33413] asyncio.gather should not use special Future

2018-05-02 Thread Martin Teichmann

Change by Martin Teichmann :


--
keywords: +patch
pull_requests: +6388
stage:  -> patch review

___
Python tracker 

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



[issue33413] asyncio.gather should not use special Future

2018-05-02 Thread Martin Teichmann

New submission from Martin Teichmann :

asyncio.gather() returns a _GatheringFuture, which inherits from 
asyncio.Future. This is weird in current asyncio, as futures are supposed to be 
created with loop.create_future(). So I tried to reimplement gather() without 
this weird special future. I succeeded, yet I stumbled over weird 
inconsistencies with cancellation. There are three cases:

- coroutines have no special notion of cancellation, they treat CancelledError 
as any other exception

- futures have a clear distinction between exceptions and cancellation: 
future.set_exception(CancelledError()) is different from future.cancel(), as 
only for the latter future.cancelled() is True. This is used in the 
_GatheringFuture: it is cancelled() only if it got cancelled via 
future.cancel(), if its children gets cancelled it may 
set_exception(CancelledError()), but it will not be cancelled itself.

- Tasks consider raising a CancelledError always as a cancellation, whether it 
actually got cancelled or the wrapped coroutine raised CancelledError for 
whatever other reason. There is one exception: if the coroutine manages to 
return immediately after being cancelled, it raises a CancelledError, but 
task.cancelled() is false. So if a coroutine ends in

current_task().cancel()
return

the current task raises a CancelledError, but task.cancelled() is false.

I consider the last exception actually a bug, but it allows me to make my 
inheritance-free gather() look to the outside exactly like it used to be.

--
messages: 316085
nosy: Martin.Teichmann
priority: normal
severity: normal
status: open
title: asyncio.gather should not use special Future
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue33275] glob.glob should explicitly note that results aren't sorted

2018-05-02 Thread Eryk Sun

Eryk Sun  added the comment:

FAT inserts a new file entry in a directory at the first available position. 
(If it's a long filename, this could be up to 21 contiguous dirents for a 
combined long/short dirent set.) This means a directory listing is usually in 
the same order that files were added. One caveat is that dirents for deleted 
files may be reused once there are no more unused entries available in a 
cluster. (I'd expect this depends on the implementation. Also, this is less 
likely with a long filename, since it needs a large-enough contiguous block of 
dirents.) Given a volume with a 4 KiB cluster size, sans overhead there are 127 
32-byte dirents in a cluster.

I used to have an MP3 player that used FAT32 and only played files in directory 
order, so I had to resort directories on disk after adding files. In Ubuntu 
Linux, I see there's a "fatsort" package that implements this. There's probably 
a build available for MacOS.

--

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> worker threads are waiting for the Tcl lock

Pardon. They are waiting for Tkapp_ThreadSend()s into the main thread to 
return. The effect is still the same.

--

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Added file: https://bugs.python.org/file47564/trace.py

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Ivan Pozdeev

New submission from Ivan Pozdeev :

With threaded Tkinter, TkinterHanders3.py from 
https://bugs.python.org/issue33257 (attached) hangs.

Tracing with thread_debug and a modified trace.py (to show TIDs, attached) 
shows that worker threads are waiting for the Tcl lock while the main thread 
that holds it keeps waiting for some other lock with a strange timeout:

19000: PyThread_acquire_lock_timed(001B0F80, 0) called
19000: PyThread_acquire_lock(001B0F80, 0) -> 0
19000: PyThread_acquire_lock_timed(001B0F80, -100) called

Tested on 3.6 head, win7 x64, debug build.

--
components: Tkinter
files: TkinterHanders3.py
messages: 316082
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: Tkinter hangs if using multiple threads and event handlers
type: crash
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47562/TkinterHanders3.py

___
Python tracker 

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



[issue33412] Tkinter hangs if using multiple threads and event handlers

2018-05-02 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Added file: https://bugs.python.org/file47563/trace.zip

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-02 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


Added file: https://bugs.python.org/file47561/TkinterHanders3.py

___
Python tracker 

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



[issue33410] Using type in a format with padding causes TypeError

2018-05-02 Thread Eric V. Smith

Eric V. Smith  added the comment:

The problem is that type.__format__ doesn't exist, so object.__format__ is 
being called, and it throws an error if you provide a format spec. This is done 
for future expansion: if we do want to add type.__format__ in the future, we 
don't have to worry about existing cases that are using format specs that might 
not work with the new type.__format__.

No format spec is the same as calling str() on the argument and returning that, 
which is what is happening in your working examples.

If you want to apply a str formatting spec, you should covert the argument to a 
str first, using either !s or str():

>>> print('{a!s: >10}'.format(a=type(a)))

>>> print('{a: >10}'.format(a=str(type(a


--
nosy: +eric.smith

___
Python tracker 

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



[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

2018-05-02 Thread Gabe Appleton

Change by Gabe Appleton :


--
resolution:  -> rejected
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



[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

2018-05-02 Thread Tim Peters

Tim Peters  added the comment:

-1.  We should stop pretending this _ might_ happen ;-)

--
nosy: +tim.peters

___
Python tracker 

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



[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2018-05-02 Thread Petr Viktorin

Petr Viktorin  added the comment:

An option would be to use a colon to separate the module(s) from the 
attribute(s). The "inspect" module CLI does this, for example:
https://docs.python.org/3/library/inspect.html#command-line-interface

$ python3 -m inspect urllib.parse:SplitResult.geturl
def geturl(self):
return urlunsplit(self)

A colon can't appear in an identifier, so the old way can be used if there's no 
colon in the argument, making this backwards compatible.

--

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2018-05-02 Thread Quentin Millardet

Quentin Millardet  added the comment:

In a bash terminal, obtained result: 

$python > Normal.txt 2> Error.txt
import a
$cat Normal.txt 
$cat Error.txt 
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named a
>>> 
$


That i was expected  :

$python > Normal.txt 2> Error.txt
import a
$cat Normal.txt 

Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> $cat Error.txt 
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named a
$

--
status: pending -> open

___
Python tracker 

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



[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

I dislike using non-ASCII characters for the default implementation. I don't 
think that this formatting is popular, and I expect many troubles on each 
platform.

IMHO it's very easy to put such short function in your favorite module, or 
directly into your application, for your own usage. Call it 
my_nice_fraction_formatting() :-)

--
nosy: +vstinner

___
Python tracker 

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



[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

2018-05-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

In the Monaco font, the superscripts ⁰¹²³⁴⁵⁶⁷⁸⁹ don't all line-up.  The 1, 2, 
and 3 are lower which makes the fraction look weird.

--
nosy: +rhettinger

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2018-05-02 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Hello Quentin, and welcome.

Please don't post screen shots of text. We don't edit our code with Photoshop, 
and using a screenshot makes it difficult to copy your code for testing, to 
verify the bug report, and prevents the blind and visually impaired from taking 
part on the discussion.

Please copy and paste the code demonstrating the error as text, the output you 
received, and state the output you expected.

--
nosy: +steven.daprano
status: open -> pending

___
Python tracker 

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



[issue33410] Using type in a format with padding causes TypeError

2018-05-02 Thread Emanuel Barry

Emanuel Barry  added the comment:

`type` has a default `__format__` implementation which doesn't accept any 
formatting options. This is expected behaviour.

--
nosy: +ebarry
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue1322] Deprecate platform.dist() and platform.linux_distribution() functions

2018-05-02 Thread Matthias Bussonnier

Change by Matthias Bussonnier :


--
pull_requests: +6387

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2018-05-02 Thread Quentin Millardet

Change by Quentin Millardet :


--
status:  -> open

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2018-05-02 Thread Quentin Millardet

Change by Quentin Millardet :


--
status: open -> 

___
Python tracker 

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



[issue33411] All console message are in the error output in bash interpretor

2018-05-02 Thread Quentin Millardet

New submission from Quentin Millardet :

The probleme is all display (normal and error message), in bash, are send to 
the screen by the error output. So it's impossible when someone make a bash 
script to get the error back in a log file for exemple, or just to display only 
the error on a screen.

Problem test on Ubuntu 18.04 and Elementary loki (an Ubuntu 16.04 variant)

--
components: IO
files: Capture d'écran du 2018-05-02 16.16.09.png
messages: 316073
nosy: Quentin Millardet
priority: normal
severity: normal
status: open
title: All console message are in the error output in bash interpretor
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47560/Capture d'écran du 2018-05-02 
16.16.09.png

___
Python tracker 

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



[issue33410] Using type in a format with padding causes TypeError

2018-05-02 Thread alex

New submission from alex :

When trying to print a type in a formatted string with padding TypeError is 
raised. See examples below.

These work:
>>> a = 'abc'
>>> print('{a}'.format(a=type(a)))

>>> print('{a}'.format(a=str(type(a


These don't:
>>> print('{a: >10}'.format(a=type(a)))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported format string passed to type.__format__
>>> t = type(a)
>>> print('{a: >10}'.format(a=t))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported format string passed to type.__format__

--
messages: 316072
nosy: alexomics
priority: normal
severity: normal
status: open
title: Using type in a format with padding causes TypeError
type: behavior
versions: Python 3.6

___
Python tracker 

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



Masking using shapefiles

2018-05-02 Thread jorge . conrado



 Hi,

 I'm trying to make a mask using a shapefile of Brazil using the 
examplE:


 http://basemaptutorial.readthedocs.io/en/latest/clip.html


 I run my script and I had the messages:

 Traceback (most recent call last):
  File "mascarapy2.py", line 7, in 
from osgeo import gdal
  File 
"/home/conrado/anaconda3/lib/python2.7/site-packages/osgeo/__init__.py", 
line 21, in 

_gdal = swig_import_helper()
  File 
"/home/conrado/anaconda3/lib/python2.7/site-packages/osgeo/__init__.py", 
line 17, in swig_import_helper

_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: 
/home/conrado/anaconda3/lib/python2.7/site-packages/osgeo/../../.././libkea.so.1.4.7: 
undefined symbol: 
_ZN2H56H5FileC1ERKSsjRKNS_17FileCreatPropListERKNS_15FileAccPropListE



   Please, what can I do to solve this.

   Thanks,

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


[issue33275] glob.glob should explicitly note that results aren't sorted

2018-05-02 Thread Ben FrantzDale

Ben FrantzDale  added the comment:

I looked into it a bit more. With python 2.7 on macOS High Sierra on APFS 
(Encrypted) with a FAT32 thumb drive... I have a directory that 
glob.glob('/Volumes/thumb/tmp/*') shows as sorted. I cp -r that to /tmp with 
bash. glob.glob('/tmp/tmp/*') is now not sorted. and cp -r /tmp/tmp 
/Volumes/thumb/tmp1. Then glob.glob('/Volumes/thumb/tmp/*') shows a different 
order, but if I cp -r /Volumes/thumb/tmp/ /Volumes/thumb/tmp2 then 
glob.glob('/Volumes/thumb/tmp2/*') is sorted by file name just like 
glob.glob('/Volumes/thumb/tmp/*'). I'm not sue what that's saying other than 
that glob.glob can return things out of order on FAT32. It appears that 
glob.glob's ordering agrees with that of ls -f ("unsorted").

--

___
Python tracker 

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



[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-02 Thread Floreal

Floreal  added the comment:

Will this patch be integrated in future days / weeks / years? I still want to 
add a hidden subparser, but doing this by editing manually the metavar of the 
subparsers is not a good solution...

--
nosy: +floreal

___
Python tracker 

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



Re: Passing all pandas DataFrame columns to function as separate parameters

2018-05-02 Thread zljubisic
Thomas, thank you very very much, this was exactly what I needed.
Thanks again and best regards.
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: NumExpr 2.6.5

2018-05-02 Thread Robert McLeod
==
 Announcing Numexpr 2.6.5
==

Hi everyone,

This is primarily an incremental performance improvement release,
especially
with regards to improving import times of downstream packages (e.g.
`pandas`, `tables`, `sympy`).  Import times have been reduced from ~300 ms
to ~100 ms through removing a `pkg_resources` import and making the
`cpuinfo`
import lazy.

The maximum number of threads is now set at import-time, similar to
`numba`, by
setting an environment variable 'NUMEXPR_MAX_THREADS'.  The runtime number
of threads can still be reduced by calling `numexpr.set_num_threads(N)`.

DEPRECATION WARNING: The variable `numexpr.is_cpu_amd_intel` has been set
to a
dummy value of `False`. This variable may be removed in the future.

Project documentation is available at:

http://numexpr.readthedocs.io/

Changes from 2.6.4 to 2.6.5
---

- The maximum thread count can now be set at import-time by setting the
  environment variable 'NUMEXPR_MAX_THREADS'. The default number of
  max threads was lowered from 4096 (which was deemed excessive) to 64.
- A number of imports were removed (pkg_resources) or made lazy (cpuinfo)
in
  order to speed load-times for downstream packages (such as `pandas`,
`sympy`,
  and `tables`). Import time has dropped from about 330 ms to 90 ms. Thanks
to
  Jason Sachs for pointing out the source of the slow-down.
- Thanks to Alvaro Lopez Ortega for updates to benchmarks to be compatible
with
  Python 3.
- Travis and AppVeyor now fail if the test module fails or errors.
- Thanks to Mahdi Ben Jelloul for a patch that removed a bug where
constants
  in `where` calls would raise a ValueError.
- Fixed a bug whereby all-constant power operations would lead to infinite
  recursion.

-- 
Robert McLeod, Ph.D.
robbmcl...@gmail.com
robbmcl...@protonmail.com
robert.mcl...@hitachi-hhtc.ca
www.entropyreduction.al
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[issue1644818] Allow built-in packages and submodules as well as top-level modules

2018-05-02 Thread Fred L. Drake, Jr.

Change by Fred L. Drake, Jr. :


--
nosy: +fdrake

___
Python tracker 

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



[issue33409] Clarify the interaction between locale coercion & UTF-8 mode

2018-05-02 Thread Nick Coghlan

New submission from Nick Coghlan :

While Victor and I reconciled the respective designs & implementations of PEP 
538/540 (with 538 relying on 540 to handle the "No suitable target locale" 
case, and 540 relying on 538 to handle extension modules like GNU readline), 
the interaction between the two mechanisms currently isn't clear in the 
documentation.

So, before 3.7rc1 goes out, we should:

1. Combine the presentation of the two PEPs in the What's New documentation to 
make it clearer that they're tackling different aspects of the same problem
2. Clarify in the reference docs for PYTHONCOERCECLOCALE and PYTHONUTF8MODE 
that they're independent settings (so you have to explicitly turn them *both* 
off if you truly want to force ASCII based text handling in the C or POSIX 
locale)



(Issue raised based on a Twitter discussion with Anthony Shaw at 
https://twitter.com/anthonypjshaw/status/991614899791933441)

--
assignee: ncoghlan
components: Documentation
messages: 316069
nosy: ncoghlan, vstinner
priority: high
severity: normal
stage: needs patch
status: open
title: Clarify the interaction between locale coercion & UTF-8 mode
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33408] AF_UNIX is now supported in Windows

2018-05-02 Thread Eric V. Smith

Change by Eric V. Smith :


--
nosy: +eric.smith
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-02 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

I have open https://github.com/python/cpython/pull/6693 to start iterating over 
the missing capabilities of posix_spawn (Passing various attributes of the 
created child process).

Please, review to make sure that the design is OK and I will proceed to add 
tests.

Thanks!

--

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-02 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
pull_requests: +6386

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread INADA Naoki

Change by INADA Naoki :


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



[issue33408] AF_UNIX is now supported in Windows

2018-05-02 Thread Filip *

New submission from Filip * :

Unix socket (AF_UNIX) is now avalible in Windows 10 (April 2018 Update). Please 
add Python support for it.
More details about it on 
https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

--
components: Windows
messages: 316067
nosy: filips123, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: AF_UNIX is now supported in Windows
type: enhancement
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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

miss-islington  added the comment:


New changeset 6d3d02c69a65abcd64eb6d83baac5675f9208318 by Miss Islington (bot) 
in branch '2.7':
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
https://github.com/python/cpython/commit/6d3d02c69a65abcd64eb6d83baac5675f9208318


--

___
Python tracker 

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



[issue28167] remove platform.linux_distribution()

2018-05-02 Thread Matthias Klose

Matthias Klose  added the comment:

there is https://pypi.org/project/distro/

--

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

miss-islington  added the comment:


New changeset d5546991a2123b6ec84f7c4ecf37b62bedd78ea4 by Miss Islington (bot) 
in branch '3.6':
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
https://github.com/python/cpython/commit/d5546991a2123b6ec84f7c4ecf37b62bedd78ea4


--

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

> The current implementation looks half-baked to me. (...)

I would prefer to see a full implementation before Python 3.7 final, or to 
remove the feature from Python 3.7 and redo it in Python 3.8.

It seems doable to finish the implementation before Python 3.7 final.

--

___
Python tracker 

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



[issue21822] KeyboardInterrupt during Thread.join hangs that Thread

2018-05-02 Thread STINNER Victor

Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

miss-islington  added the comment:


New changeset 6a56790e0b50846f1f968e48c3a321c148b5e6cd by Miss Islington (bot) 
in branch '3.7':
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
https://github.com/python/cpython/commit/6a56790e0b50846f1f968e48c3a321c148b5e6cd


--
nosy: +miss-islington

___
Python tracker 

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



[issue33407] Implement Py_DEPRECATED() macro for Visual Studio

2018-05-02 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

In Arrow we use the following:

#if __cplusplus <= 201103L
# ifdef __GNUC__
#  define ARROW_DEPRECATED(...) __attribute__((deprecated(__VA_ARGS__)))
# elif defined(_MSC_VER)
#  define ARROW_DEPRECATED(...) __declspec(deprecated(__VA_ARGS__))
# else
#  define ARROW_DEPRECATED(...)
# endif
#else
#  define ARROW_DEPRECATED(...) [[deprecated(__VA_ARGS__)]]
#endif

--

___
Python tracker 

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



[issue33407] Implement Py_DEPRECATED() macro for Visual Studio

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, bpo-19569 is still open, for Visual Studio see:
https://bugs.python.org/issue19569#msg227727

--

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6385

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6384

___
Python tracker 

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



[issue33407] Implement Py_DEPRECATED() macro for Visual Studio

2018-05-02 Thread STINNER Victor

New submission from STINNER Victor :

According to the following links, it would be possible to implement the 
Pc_DEPRECATED() macro for Visual Studio:

https://mail.python.org/pipermail/python-dev/2018-May/153299.html
https://stackoverflow.com/questions/295120/c-mark-as-deprecated/295229#295229

"""
#ifdef __GNUC__
#define DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define DEPRECATED(func) func
#endif
"""

Moreover, is Py_DEPRECATED() defined on clang which also supports the 
deprecated function attribute?
https://clang.llvm.org/docs/AttributeReference.html#deprecated-gnu-deprecated

Current Include/pyport.h code:

#if defined(__GNUC__) \
&& ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
#else
#define Py_DEPRECATED(VERSION_UNUSED)
#endif

--
components: Windows
messages: 316059
nosy: paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Implement Py_DEPRECATED() macro for Visual Studio
versions: Python 3.8

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6383

___
Python tracker 

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



[issue33391] leak in set_symmetric_difference?

2018-05-02 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 491bbedc209fea314a04cb3015da68fb0aa63238 by INADA Naoki (lekma) 
in branch 'master':
bpo-33391: Fix refleak in set_symmetric_difference (GH-6670)
https://github.com/python/cpython/commit/491bbedc209fea314a04cb3015da68fb0aa63238


--
nosy: +inada.naoki

___
Python tracker 

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



[issue33406] [ctypes] increase the refcount of a callback function

2018-05-02 Thread Eryk Sun

Eryk Sun  added the comment:

There isn't a problem in most cases, since functions that take a callback 
usually call it before returning. If the library does keep a long-lived 
reference to a callback (e.g. a console control handler in Windows), there are 
ways to support this, depending on the context (e.g. global variable, class 
attribute, instance attribute, a dict). 

However, for the case where a callback should remain referenced for the 
lifetime of the process, it would be convenient to have a `callback_incref` 
option. Internally this would use a new function flag 
`FUNCFLAG_CALLBACK_INCREF`.

--
nosy: +eryksun
title: [ctypes] increase refcount of a CFUNCTYPE instance when passing to a 
CDLL -> [ctypes] increase the refcount of a callback function
type: behavior -> enhancement
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue28167] remove platform.linux_distribution()

2018-05-02 Thread Christian Heimes

Christian Heimes  added the comment:

We still don't have a suitable replacement for the feature. Five years, 
Matthias suggested to add a parser for freedesktop's os-release file.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28167] remove platform.linux_distribution()

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

IMHO it's now too late to remove it from Python 3.7.

Moreover, if the current warning is *PendingDeprecationWarning*, the warning 
must first become in Python N, to then remove the feature in Python N+1.

I'm ok to just change the warning and schedule a removal from Python 3.8.

--

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, pmpp confirmed that the 3.7b2 bug has been fixed in 3.7b3.

Thank you for your bug report Anthony Shaw!

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

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread pmpp

pmpp  added the comment:

b3 is also ok with the -X parameter :
PYTHONCOERCECLOCALE=0 LANG=C python3.7 -X utf8=0 -c "import sys; 
print(sys.stdin.encoding)"
ANSI_X3.4-1968

--

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

I cannot reproduce the issue with the future Python 3.7 beta4:

vstinner@apu$ PYTHONCOERCECLOCALE=0 LANG=C ./python -X utf8=0 -c "import sys; 
print(sys.stdin.encoding)"
ANSI_X3.4-1968
vstinner@apu$ LANG=C ./python -X utf8=0 -c "import sys; 
print(sys.stdin.encoding)"
UTF-8
vstinner@apu$ ./python
Python 3.7.0b3+ (heads/3.7:887b5f8fc6, May  2 2018, 09:54:18) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

The master branch works also as expected.

--

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread STINNER Victor

STINNER Victor  added the comment:

> PYTHONCOERCECLOCALE=0 LANG=C python3.7 -c "import sys; 
> print(sys.stdin.encoding)"

Are you aware of the PEP 540 "UTF-8 Mode"? It's also enabled automatically by 
the POSIX locale. If you hate UTF-8, you have to use:

PYTHONCOERCECLOCALE=0 python3.7 -X utf8=0
or
PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python3.7

--

___
Python tracker 

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



[issue33402] Change the fractions.Fraction class to convert to a unicode fraction string

2018-05-02 Thread Mark Dickinson

Mark Dickinson  added the comment:

-1 from me. Apart from anything else, the output for a general fraction looks 
(to my eyes) ugly in a fixed-width font: the tiny digits are harder to read, 
and there's too much space between successive numerator (or denominator) 
digits: those digits are designed for superscripts or subscripts.

--
nosy: +mark.dickinson

___
Python tracker 

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



testfixtures 6.0.2 released - important bug fix!

2018-05-02 Thread Chris Withers

Hi All,

I'm afraid I've found quite a serious regression in the 6.x series of 
testfixtures releases:


Objects that had neither __dict__ nor __slots__ would always be 
considered equal by compare().
I hit this comparing datetimes, but this would also affect types 
provides by extensions in other languages such as C or C++.
This did not affect built-in types such as dict, set, tuple and list as 
they have specific comparers provided that were not affects.


I've released 6.0.2 to fix this and would urge anyone using 6.0.0 or 
6.0.1 to upgrade as soon as possible.


The package is on PyPI and a full list of all the links to docs, issue 
trackers and the like can be found here:


https://github.com/Simplistix/testfixtures

Any questions, please do ask on the Testing in Python list or on the 
Simplistix open source mailing list...


cheers,

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


[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread pmpp

pmpp  added the comment:

indeed 
a3+ says :
PYTHONCOERCECLOCALE=0 LANG=C python3.7 -c "import sys; 
print(sys.stdin.encoding)"
ANSI_X3.4-1968


but can reproduce on b3:
PYTHONCOERCECLOCALE=0 LANG=C python3.7 -c "import sys; 
print(sys.stdin.encoding)"
utf-8

--
nosy: +pmpp

___
Python tracker 

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



[issue33394] the build of the shared modules is quiet/non-visible when GNU make gets passed macros

2018-05-02 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6382

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2018-05-02 Thread Matthias Klose

Matthias Klose  added the comment:


New changeset 9da7ee40037fa30d0d28fd8d7c652cde14e5a834 by Matthias Klose (Miss 
Islington (bot)) in branch '3.7':
bpo-33393: Update config.guess and config.sub files (GH-6658) (#6661)
https://github.com/python/cpython/commit/9da7ee40037fa30d0d28fd8d7c652cde14e5a834


--

___
Python tracker 

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



[issue33406] [ctypes] increase refcount of a CFUNCTYPE instance when passing to a CDLL

2018-05-02 Thread Ned Deily

Change by Ned Deily :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue33406] [ctypes] increase refcount of a CFUNCTYPE instance when passing to a CDLL

2018-05-02 Thread Zuzu_Typ

New submission from Zuzu_Typ :

It should be considered to increase the refcount of functions that are passed 
on to an external library at some point.

If this is not done and e.g. the function was a local variable, when leaving 
the scope it gets garbage-collected. When the library now tries to execute said 
function, an access violation occurs.

So if the refcount were increased either upon creating the CFUNCTYPE instance 
or when it's passed on, this could be avoided.

--
components: ctypes
messages: 316047
nosy: Zuzu_Typ
priority: normal
severity: normal
status: open
title: [ctypes] increase refcount of a CFUNCTYPE instance when passing to a CDLL
type: behavior

___
Python tracker 

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



[issue33355] Windows 10 buildbot: 15 min timeout on test_mmap.test_large_filesize()

2018-05-02 Thread Ned Deily

Change by Ned Deily :


--
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
priority: normal -> deferred blocker

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread Ned Deily

Change by Ned Deily :


--
nosy: +vstinner

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-02 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The current implementation looks half-baked to me. It doesn't implement the 
following features:

1. posix_spawnp(). It is like posix_spawn(), but searches an executable in PATH.

2. Passing various attributes of the created child process. 
POSIX_SPAWN_SETSIGMASK, POSIX_SPAWN_SETSCHEDPARAM, etc.

And I have doubts about introducing constants like POSIX_SPAWN_OPEN:

1. There is no need to make them integers. They could be strings (for 
readability) or opaque values.

2. Their names can conflict with future standard constants related to 
posix_path().

Implementing new features in 3.8 can conflict with the current design. Removing 
posix_spawn() in 3.7 and deferring the work to 3.8 still looks a better 
solution to me.

--

___
Python tracker 

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



[issue33405] PYTHONCOERCECLOCALE no longer being respected

2018-05-02 Thread anthony shaw

New submission from anthony shaw :

observing a behaviour on Python 3.7 b2 that doesn't match what's documented in 
PEP 538

PEP 538 states that the locale coercion behaviour can be disabled through the 
PYTHONCOERCECLOCALE environment variable.
I would then expect the stdin encoding to be the same as Python 3.6 when the C 
locale is specified with no encoding value. 

bash-3.2$ LANG=C python3.6 -c "import sys; print(sys.stdin.encoding)"
US-ASCII
bash-3.2$ LANG=C python3.7 -c "import sys; print(sys.stdin.encoding)"
utf-8
bash-3.2$ PYTHONCOERCECLOCALE=0 LANG=C python3.7 -c "import sys; 
print(sys.stdin.encoding)"
utf-8

LC_ALL is not set

bash-3.2$ locale
LANG="C"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Trying to dig into the reason why the env flag isn't disabling the behaviour I 
found some subsequent changes after the PEP which look to have broken the 
original implementation behaviour.

https://github.com/python/cpython/commit/9454060e84a669dde63824d9e2fcaf295e34f687

--
messages: 316045
nosy: anthony shaw
priority: normal
severity: normal
status: open
title: PYTHONCOERCECLOCALE no longer being respected
type: behavior
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