[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2017-08-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:

If you want something API compatible that can be used in a Python 2 and 3 
application that wants a getstatusoutput() API I think an appropriate place to 
put it would be to add a commands modules to https://pypi.python.org/pypi/past/ 
with a consistent getstatusoutput() API.  Either there or something in 
https://pypi.python.org/pypi/six/.

The inadvertent API difference between 2.7 commands.getstatusoutput() and 3.3.4 
subprocess.getstatusoutput() is unfortunate but - I agree - too late to change. 
 Fixing the documentation to mention the discrepancy is the least worst option.

--

___
Python tracker 

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



[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2017-08-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I intend subprocess32 to Python 2 only.  Python 3 users should use the standard 
library subprocess module.

subprocess32 does not include getstatusoutput() or getoutput() functions as 
those are available in the Python 2 stdlib commands module.

--

___
Python tracker 

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



[issue31150] [EASY] test_thread: Warning -- reap_children() reaped child process

2017-08-08 Thread Ammar Askar

Changes by Ammar Askar :


--
pull_requests: +3067

___
Python tracker 

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



[issue31138] dir argument NamedTemporaryFile should accept a pathlib.Path

2017-08-08 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> out of date

___
Python tracker 

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



[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Lisa, would you like to take this one?

--
assignee:  -> lisroach
nosy: +lisroach, rhettinger

___
Python tracker 

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



[issue31147] a mostly useless check in list_extend()

2017-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

-0 The test "Py_SIZE(self) < self->allocated" is very cheap so I don't mind 
leaving it in to handle the rare cases (or to prevent future bugs if the 
list_resize logic ever changes).

--
nosy: +rhettinger

___
Python tracker 

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



[issue31152] Tutorial wording implies an understanding of a concept prior to it being introduced

2017-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It is okay for the tutorial to occasionally have forward references. 
 Python is a fully object oriented language so references to classes and 
instances will appear in many places.  AFAICT, this particular passage has 
never caused any reported difficulty for any users.  As it reads now, I find it 
to be clear and correct guidance.

--
nosy: +rhettinger

___
Python tracker 

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



[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2017-08-08 Thread Nick Coghlan

Nick Coghlan added the comment:

I've added Greg to the nosy list and filed an issue with subprocess32 about 
this: https://github.com/google/python-subprocess32/issues/30

I did that mainly to make sure they don't inadvertently backport this 
regression, but also to ask if subprocess32 might potentially provide a way to 
get the old intended-but-not-actually-tested behaviour back in 3.x.

--
nosy: +gregory.p.smith

___
Python tracker 

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



Re: __new__ and __init__ - why does this work?

2017-08-08 Thread Ian Kelly
On Tue, Aug 8, 2017 at 6:08 PM, Ian Pilcher  wrote:
> I have created a class to provide a "hash consing"[1] set.
>
>   class UniqueSet(frozenset):
>
>   _registry = dict()
>
>   def __new__(cls, *args, **kwargs):
>   set = frozenset(*args, **kwargs)
>   try:
>   return UniqueSet._registry[set]
>   except KeyError:
>   self = super(UniqueSet, cls).__new__(cls, *args, **kwargs)
>   UniqueSet._registry[set] = self
>   return self
>
>   def __init__(self, *args, **kwargs):
>   pass
>
> I can't figure out how it works, though.  In particular, I can't figure
> out how the call to __new__ actually initializes the set (since my
> __init__ never calls the superclass __init__).
>
> Is this a particular behavior of frozenset, or am I missing something
> about the way that __new__ and __init__ interact?

It's initialized by the superclass call to __new__. frozenset is
immutable, and __init__ methods of immutable types generally don't do
anything (if they could, then they wouldn't be immutable), which is
why it doesn't really matter that you didn't call it. At the same
time, it generally doesn't hurt to call it, and you probably shouldn't
even have an override of __init__ here if it doesn't do anything.

It seems a bit inefficient that you create *two* sets in __new__ and
then map one of them to the other in your registry. Why not just
create the UniqueSet and then map it to itself if it's not already
registered? Something like this (untested):

def __new__(cls, *args, **kwargs):
self = super(UniqueSet, cls).__new__(cls, *args, **kwargs)
return UniqueSet._registry.setdefault(self, self)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30876] SystemError on importing module from unloaded package

2017-08-08 Thread Larry Hastings

Larry Hastings added the comment:

If the change has been checked into the 3.5 branch, it'll go out with 3.5.5.

TBH we should probably stop accepting bug fixes into a branch when it hits rc1 
of "last release to accept bugfixes" (e.g. 3.5.4rc1).  There are two or three 
bugfixes in the 3.5 branch that I cherry-picked around when I made 3.5.4 final. 
 I'm going to let them simply ship in 3.5.5 (eventually), even though 3.5.5 
shouldn't have any "bug fixes".  Maybe we'll be crisper when it comes to 
3.6.xrc1 etc.

--

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-08-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Tagging Petr Viktorin and Matthias Klose, as this may impact distro builds of 
3.5.4 that run the tests over the installed version rather than directly from 
the VCS checkout.

It would be slightly helpful to not have to carry the "fix Python's self-tests" 
patch indefinitely, but it's also not likely to be a major cause of patch 
conflicts with security updates, so it shouldn't matter much either way.

--
nosy: +doko, encukou

___
Python tracker 

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



Re: Validating regexp

2017-08-08 Thread Cameron Simpson

On 08Aug2017 17:31, Jon Ribbens  wrote:

On 2017-08-08, Chris Angelico  wrote:

On Wed, Aug 9, 2017 at 2:57 AM, Larry Martell  wrote:

Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty
subexpression for regexp' I'd like to flag it before it gets to SQL.


Okay, so your definition of validity is "what MySQL will accept". In
that case, I'd feed it to MySQL and see if it accepts it. Regexps are
sufficiently varied that you really need to use the same engine for
validation as for execution.


... but bear in mind, there have been ways of doing denial-of-service
attacks with valid-but-nasty regexps in the past, and I wouldn't want
to rely on there not being any now.


The ones I've seen still require some input length (I'm thinking exponential 
rematch backoff stuff here). I suspect that if your test query matches the RE 
against a fixed empty string it is hard to be exploited. i.e. I think most of 
this stuff isn't expensive in terms of compiling the regexp but in executing it 
against text.


Happy to hear to falsifications to my beliefs here.

Cheers,
Cameron Simpson  (formerly c...@zip.com.au)
--
https://mail.python.org/mailman/listinfo/python-list


[issue31152] Tutorial wording implies an understanding of a concept prior to it being introduced

2017-08-08 Thread Lorem Ipsum

New submission from Lorem Ipsum:

Python 3.5.4 Tutorial Section 8.5. User-defined Exceptions Paragraph 2 
(https://docs.python.org/3.5/tutorial/errors.html#user-defined-exceptions) 
states [emphasis mine]:

"When creating a module that can raise several distinct errors, a common 
practice is to create a base class for exceptions defined by that module, and 
SUBCLASS THAT TO create specific exception classes for different error 
conditions:"

The use of 'subclass' as a verb when it has not been used so prior is 
confusing, especially to beginners.  The concept of a class is not formally 
covered until Section 9 and up until this point in the tutorial, 'class' has 
been used as a noun.  When read with 'subclass' as a noun, the sentence is 
nonsensical. It may also be that the comma which precedes 'and' is not proper 
usage. 

Suggested improvement: change "subclass that to create specific classes for..." 
to "then create specific exception subclasses for..."

"When creating a module that can raise several distinct errors, a common 
practice is to create a base class for exceptions defined by that module, and 
then create specific exception subclasses for different error conditions:"

--
assignee: docs@python
components: Documentation
messages: 299962
nosy: Lorem Ipsum, docs@python
priority: normal
severity: normal
status: open
title: Tutorial wording implies an understanding of a concept prior to it being 
introduced
type: enhancement
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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-08 Thread D Gentry

D Gentry added the comment:

If that's the best thing that you can suggest, it's obvious why my request
is being redirected.

That is unfortunate that you have decided to opt out of using the MSI
installer, as that seems to be the solution as far as I can see.

I've enjoyed working with Python for years and was hoping for a new MSI
installer to be released eventually, but hearing that you have decided to
discontinue porting for any future release for MSI is definitely not what I
was expecting.

I guess I'll wait to see if your Windows guys have anything to add but save
it to say that I have already tried disabling any anti virus software,
checked my user permission as well as the folder permissions, and attempted
installing via administrator as well, all with no difference in the result.
Meanwhile, I have been able to uninstall python 2.7 and re-install it
without issue (at the time I was investigating a possible path conflict as
the issue) and even installed 3.4.4rc1, as that is the most current version
available in MSI format.

Your exe files all fail to execute properly, and ends up throwing the same
non-descript error in a log that offers very little insight into the root
of the problem, yet you tell me the problem is with my system when I have
investigated the alternatives and the only issue I have found is you don't
have a MSI version offered any more.

Are you expecting users to compile the source code into a MSI installer, if
that's what they require?

If that's what it's going to take, I'll do it myself, get what I need done
and move on from python after this project.

On Tue, Aug 8, 2017 at 2:57 PM, Steve Dower  wrote:

>
> Changes by Steve Dower :
>
>
> --
> type: crash -> behavior
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31151] test_socketserver: Warning -- reap_children() reaped child process

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Ah, the master branch is also affected. Example:

http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.x/builds/47/steps/test/logs/stdio

1:35:05 load avg: 4.64 [212/406] test_socketserver passed -- running: 
test_subprocess (370 sec)
beginning 6 repetitions
123456
Warning -- reap_children() reaped child process 4641
.Warning -- reap_children() reaped child process 4708
..Warning -- reap_children() reaped child process 4832
.Warning -- reap_children() reaped child process 4916
Warning -- reap_children() reaped child process 4921
..

--
title: [3.6] test_socketserver: Warning -- reap_children() reaped child process 
-> test_socketserver: Warning -- reap_children() reaped child process
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



[issue31151] [3.6] test_socketserver: Warning -- reap_children() reaped child process

2017-08-08 Thread STINNER Victor

New submission from STINNER Victor:

It seems like test_socketserver leaks child processes on the "x86 Gentoo 
Refleaks 3.6" buildbot, but I'm unable to reproduce the bug.

http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.6/builds/49/steps/test/logs/stdio

0:48:11 load avg: 3.91 [154/405/2] test_socketserver failed -- running: 
test_decimal (630 sec)
Warning -- reap_children() reaped child process 1044
beginning 6 repetitions
123456
Warning -- reap_children() reaped child process 1104
Warning -- reap_children() reaped child process 1115
.Warning -- reap_children() reaped child process 1170
Warning -- reap_children() reaped child process 1175
Warning -- reap_children() reaped child process 1184
.Warning -- reap_children() reaped child process 1249
.Warning -- reap_children() reaped child process 1311
Warning -- reap_children() reaped child process 1316
...
test_socketserver leaked [1, 1, 1] memory blocks, sum=3

(...)

test_ForkingUnixStreamServer (test.test_socketserver.SocketServerTest) ... 
creating server
ADDR = /tmp/unix_socket.hqh5x95a
CLASS = 
server running
test client 0
test client 1
test client 2
waiting for server
done
Warning -- reap_children() reaped child process 17938
ok

test_ForkingUnixDatagramServer (test.test_socketserver.SocketServerTest) ... 
creating server
ADDR = /tmp/unix_socket.gry6ulhp
CLASS = 
server running
test client 0
test client 1
test client 2
waiting for server
done
Warning -- reap_children() reaped child process 18212
ok

test_ForkingUDPServer (test.test_socketserver.SocketServerTest) ... creating 
server
ADDR = ('127.0.0.1', 43415)
CLASS = 
server running
test client 0
test client 1
test client 2
waiting for server
done
Warning -- reap_children() reaped child process 18281
ok
test_ForkingUnixDatagramServer (test.test_socketserver.SocketServerTest)

--
components: Tests
messages: 299959
nosy: haypo
priority: normal
severity: normal
status: open
title: [3.6] test_socketserver: Warning -- reap_children() reaped child process
type: resource usage
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



[issue31150] [EASY] test_thread: Warning -- reap_children() reaped child process

2017-08-08 Thread STINNER Victor

New submission from STINNER Victor:

It seems like an unit test of test_thread leaks a process. A bisection found 
the following 2 tests are enough to get the warning:

* test.test_thread.TestForkInThread.test_forkinthread
* test.test_thread.LockTests.test_acquire_contended

I bet that test_forkinthread() doesn't wait correctly for the child process 
(fork) completion using os.waitpid() or something like that.



Example 1 (from Refleak buildbot):

haypo@selma$ ./python -m test -R 3:3 test_thread
Run tests sequentially
0:00:00 load avg: 0.55 [1/1] test_thread
beginning 6 repetitions
123456
Warning -- reap_children() reaped child process 6984
.Warning -- reap_children() reaped child process 7054
.Warning -- reap_children() reaped child process 7125
.Warning -- reap_children() reaped child process 7195
.Warning -- reap_children() reaped child process 7266
.Warning -- reap_children() reaped child process 7336
.
1 test OK.

Total duration: 5 sec
Tests result: SUCCESS


Example 2 (only run the 2 methods):

haypo@selma$ ./python -m test -m 
test.test_thread.TestForkInThread.test_forkinthread -m 
test.test_thread.LockTests.test_acquire_contended -v test_thread test_thread 

0:00:00 load avg: 0.27 [1/2] test_thread
test_acquire_contended (test.test_thread.LockTests) ... ok
test_forkinthread (test.test_thread.TestForkInThread) ... ok

--
Ran 2 tests in 0.037s

OK
0:00:00 load avg: 0.27 [2/2] test_thread
test_acquire_contended (test.test_thread.LockTests) ... Warning -- 
reap_children() reaped child process 10613
ok
test_forkinthread (test.test_thread.TestForkInThread) ... ok

--
Ran 2 tests in 0.036s

OK
test_thread failed (env changed)

--
keywords: easy
messages: 299958
nosy: haypo
priority: normal
severity: normal
status: open
title: [EASY] test_thread: Warning -- reap_children() reaped child process
versions: 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



[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This seems like a reasonable enhancement to `sum` to me.

Since 2.7 is in feature freeze, this can only apply to 3.7.

--
nosy: +steven.daprano
type: behavior -> enhancement
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



[issue31142] python shell crashed while input quotes in print()

2017-08-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I'm afraid your error report isn't completely clear. What do you mean "input 
single quote in print"? Do you mean this?

print(')


You say IDLE "crashed". What do you mean? Do you mean the IDLE application put 
up an error message and then disappeared? If so, what was the error message?

If IDLE said something like:

SyntaxError: EOL while scanning string literal

that's perfectly normal. That's because you haven't written a valid string, you 
need to quote the single quote: print("'").

--
assignee:  -> terry.reedy
components: +IDLE -Demos and Tools
nosy: +steven.daprano, terry.reedy

___
Python tracker 

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



__new__ and __init__ - why does this work?

2017-08-08 Thread Ian Pilcher

I have created a class to provide a "hash consing"[1] set.

  class UniqueSet(frozenset):

  _registry = dict()

  def __new__(cls, *args, **kwargs):
  set = frozenset(*args, **kwargs)
  try:
  return UniqueSet._registry[set]
  except KeyError:
  self = super(UniqueSet, cls).__new__(cls, *args, **kwargs)
  UniqueSet._registry[set] = self
  return self

  def __init__(self, *args, **kwargs):
  pass

I can't figure out how it works, though.  In particular, I can't figure
out how the call to __new__ actually initializes the set (since my
__init__ never calls the superclass __init__).

Is this a particular behavior of frozenset, or am I missing something
about the way that __new__ and __init__ interact?

--

Ian Pilcher arequip...@gmail.com
 "I grew up before Mark Zuckerberg invented friendship" 


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


[issue31133] [2.7] PCbuild/pcbuild.sln of Python 2.7 cannot be open by Visual Studio 2010

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

My notes on compiling CPython 2.7 on Windows using Visual Studio:
http://haypo-notes.readthedocs.io/cpython_windows.html

--

___
Python tracker 

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



[issue31133] [2.7] PCbuild/pcbuild.sln of Python 2.7 cannot be open by Visual Studio 2010

2017-08-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3066

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

> Too bad, test_resize() failed again while testing commit 
> 56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8 :-( So this fix was not enough.

I am not sure anymore about this statement. I had a bug in my watchdog code, 
that I fixed after this failure.

I ran again the test during 3 hours and it didn't fail.

I reverted all my local changes, I rebuild Python 2.7 in debug mode to get a 
fresh python_d.exe, I removed all __pycache__, and then I ran again the test 
during 1 hour: no fail. I ran 4 instances of the test in parallel during 1 
hour: no fail.

Hum, it *seems* like the bug was fixed.

Since it's a race condition, it's not possible to say that it's really fixed. 
But my test results show that the bug is very likely to be fixed, so I close 
the bug.

I will watch AMD64 Windows8.1 Refleaks 2.7 buildbot slave next days to check if 
the bug occurs again.

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3065

___
Python tracker 

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



[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

I wrote https://github.com/python/cpython/pull/3029 which seems to fix the 
issue.

I don't know importlib well enough to understand why we need a weak reference 
to a lock.

My PR adds a second lock per module lock (!) to be able to wait until 
_module_locks[name] is deleted when a thread detects that _module_locks[name] 
exists and the associated lock was destroyed.

--

___
Python tracker 

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



[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3064

___
Python tracker 

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



[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

The problem is the weakref callback of _module_locks. It seems like the 
callback is called after a second thread replaced _module_locks[name]

* Thread 1: _get_module_lock('random') sets _module_locks['random'] and 
registers a weakref callback on the newly created lock

* Thread 1: the lock is destroyed, the weakref callback will be called as soon 
as possible

* Thread 2: _get_module_lock('random') sees that the weakref is dead and so 
replaces _module_locks['random'] with a new lock, and registers a new weakref 
callback on the second lock

* Thread 1: Call the weakref callback removing _module_locks['random'] -- BUG: 
the callback is called too late, after Thread 2 already sets a new lock

* Thread 2: The lock is destroyed, the second weakref callback will be called 
as soon as possible

* Thread 2: The second callback is called and fails with KeyError since 
_module_locks['random'] was already called in the Thread 1 in the meanwhile

--

___
Python tracker 

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



[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Oh, it's easy to reproduce the bug on the master branch. Example on Linux:

haypo@selma$ ./python -m test test_threaded_import
Run tests sequentially
0:00:00 load avg: 0.16 [1/1] test_threaded_import
Exception ignored in: .cb at 0x7f53201e2f70>
Traceback (most recent call last):
  File "", line 176, in cb
KeyError: ('random',)
1 test OK.

Total duration: 2 sec
Tests result: SUCCESS

--
nosy: +brett.cannon, ncoghlan

___
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-08-08 Thread Brett Cannon

Brett Cannon added the comment:

Running with `./python -m test -u all -j0` causes test_ssl to hang so that 
needs to also be skipped (otherwise failures look to be the same from a test 
module level):

19 tests failed:
test_asyncio test_asyncore test_epoll test_fcntl test_ftplib
test_httpservers test_import test_mmap test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_spawn test_os
test_posix test_resource test_selectors test_signal
test_subprocess test_time test_unicode_file

24 tests skipped:
test_bz2 test_curses test_dbm_gnu test_dbm_ndbm test_devpoll
test_gdb test_idle test_kqueue test_lzma test_msilib
test_ossaudiodev test_readline test_sqlite test_startfile test_tcl
test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle
test_winconsoleio test_winreg test_winsound test_zipfile64

--

___
Python tracker 

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



[issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows

2017-08-08 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c82b7f332aff606af6c9c163da75f1e86514125e by Victor Stinner 
(Julien Palard) in branch 'master':
bpo-31149: Doc: Add Japanese to the language switcher. (#3028)
https://github.com/python/cpython/commit/c82b7f332aff606af6c9c163da75f1e86514125e


--
nosy: +haypo

___
Python tracker 

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



[issue30849] test_stress_delivery_dependent() of test_signal randomly fails on AMD64 Debian root 3.6

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Hey Antoine, as expected, your test fails randomly on the CI :-(

Another failure:

http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.x/builds/829/steps/test/logs/stdio

test_stress_delivery_dependent (test.test_signal.StressTest) ... Timeout 
(0:15:00)!
Thread 0xb74bd700 (most recent call first):
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_signal.py",
 line 973 in measure_itimer_resolution
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_signal.py",
 line 985 in decide_itimer_count
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/test_signal.py",
 line 1001 in test_stress_delivery_dependent
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", 
line 615 in run
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/case.py", 
line 663 in __call__
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py",
 line 1896 in _run_suite
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/support/__init__.py",
 line 1940 in run_unittest
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 168 in test_runner
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 169 in runtest_inner
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/runtest.py",
 line 137 in runtest
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 290 in rerun_failed_tests
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 540 in _main
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 510 in main
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/libregrtest/main.py",
 line 585 in main
  File 
"/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/test/__main__.py", 
line 2 in 
  File "/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", 
line 85 in _run_code
  File "/buildbot/buildarea/3.x.ware-gentoo-x86.nondebug/build/Lib/runpy.py", 
line 193 in _run_module_as_main

--

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-08-08 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3062

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-08-08 Thread Julien Palard

New submission from Julien Palard:

Japanese translation have reached the prerequisites from PEP 545, their last 
step is to be added to the language switcher.

Current build has been reviewed by Inada and is OK: 
https://docs.python.org/ja/3.7/

Note: On the current build, the /ja/ is not detected by the language switcher, 
as this *is* the step to add /ja/ to this same language switcher, this is the 
issue http://bugs.python.org/issue31146

--
messages: 299947
nosy: inada.naoki, mdk, ned.deily
priority: normal
severity: normal
status: open
title: Add Japanese to the language switcher

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-08 Thread Steve Dower

Changes by Steve Dower :


--
type: crash -> behavior

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-08 Thread Steve Dower

Steve Dower added the comment:

Looking at your log, you clearly have some sort of configuration blocking 
installers or else corruption somewhere on your system. There really isn't 
enough information available for me to be able to tell.

Perhaps you have a virus scanner running that is blocking the installer?

--

___
Python tracker 

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



[issue31138] dir argument NamedTemporaryFile should accept a pathlib.Path

2017-08-08 Thread Wilfredo Sanchez

Wilfredo Sanchez added the comment:

Huh… my apologies.  I must have been fiddling with an older interpreter REPL 
without noticing when I ran into this.

Never mind me.  :-)

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



Re: Planning a Python Course for Beginners

2017-08-08 Thread Bob Gailer
On Aug 8, 2017 10:20 AM, "Stefan Ram"  wrote:
>
>   I am planning a Python course.
>
>   I started by writing the course akin to courses I gave
>   in other languages, that means, the course starts roughly
>   with these topics:
>
> - number and string literals
> - types of number and string literals
>   (just giving the names »int«, »float«, and »string«)
> - using simple predefined operators (+, -, *, /)
>   (including 2*"a" and "a"+"b")
> - calling simple predefined functions (len, type, ...)
>
>   . This is a little bit boring however and might not
>   show off Python's strength early in the course.
>
>   So, I now think that maybe I should start to also
>   include list (like
>
> [1,2,3]
>
>   ) right from the start. A list conceptually is not
>   much more difficult than a string since a string
>   "abc" resembles a list ["a","b","c"]. I.e., the
>   course then would start as follows:
>
> - number, string, and list literals
> - types of number, string and list literals
>   (just giving the names »int«, »float«, »string«,
>   and »list«)
> - using simple predefined operators (+, -, *, /)
>   (including 2*"a", "a"+"b",  2*["a"], and [1]+[2])
> - calling simple predefined functions (len, type, ...)
>
>   However, once the box has been opened, what else
>   to let out? What about tuples (like
>
> (1,2,3)
>
>   ). Should I also teach tuples right from the start?
>
>   But then how to explain to beginners why two
>   different types (lists AND tuples) are needed for
>   the concept of a linear arrangement of things?
>
>   Are there any other very simple things that
>   I have missed and that should be covered very
>   early in a Python course?
IMHO its a good idea to introduce conversational programming early. Start
with input() and print() then int(), if, while, break . Add one item at a
time.  This will be more interesting and useful than a bunch of data types
and operators, and  answer a lot of questions that otherwise show up on the
help and tutor lists. Also explain tracebacks. None of the above in great
detail; just let students know there is more detail to come later
>
>   (Especially things that can show off fantastic
>   Python features that are missing from other
>   programming languages, but still only using
>   literals, operators and function calls.)
I think program flow is more important than fantastic or unique
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] [ANN] Daily Windows builds of Python 3.x

2017-08-08 Thread Paul Moore
On 8 August 2017 at 17:21, Steve Dower  wrote:
> For a while I've been uploading the official releases to nuget.org. These
> packages can be installed with nuget.exe (latest version always available at
> https://aka.ms/nugetclidl), which is quickly becoming a standard tool in
> Microsoft's build toolsets. It's very much a CI-focused package manager,
> rather than a user-focused one, and CI on Windows was previously an area
> where it was difficult to use Python.
>
> See the official feed at https://www.nuget.org/packages/python, and related
> packages pythonx86, python2 and python2x86.
>
> For people looking for an official "no installer" version of Python for
> Windows, this is it.

I've been aware of these builds for a while, but wasn't 100% sure of
the status of them. It would be really useful if they could be
publicised more widely - if for no other reason than to steer people
towards these rather than the embedded distribution when these are
more appropriate.

But regardless of that minor point, the availability of these builds
is really nice.

> And since all the infrastructure was there already, I decided to publish
> daily builds in a similar way to myget.org:
>
> https://www.myget.org/feed/python/package/nuget/pythondaily
>
> To install the latest daily build, run nuget.exe with this command:
>
> nuget.exe pythondaily -Source
> https://www.myget.org/F/python/api/v3/index.json
>
> (Note that if you already have a "pythondaily" package in that directory,
> nuget will consider the requirement satisfied. As I said, it's meant for
> reproducible CI builds rather than users who want to update things in the
> least amount of keystrokes :) )
>
> The sys.version string contains the short commit hash. Please include this
> string when reporting bugs in these builds. Also, only the amd64 Release
> build is available pre-built.
>
> >>> sys.version
> '3.7.0a0 (remotes/origin/master:733d0f63c, Aug  8 2017, 15:56:14) [MSC
> v.1900 64 bit (AMD64)]'
>
> Hopefully this is valuable for people who want to include daily builds in
> their own test runs or validate recent bug fixes.

Nice! I can imagine these being a really useful resource for people
wanting to (say) test against the development version in their
Appveyor builds.

Thanks for putting the effort into producing these :-)
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26510] [argparse] Add required argument to add_subparsers

2017-08-08 Thread Anthony Sottile

Changes by Anthony Sottile :


--
pull_requests: +3061

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

> I pushed my fix for bpo-31135, no idea at this point if it fix this issue.

Too bad, test_resize() failed again while testing commit 
56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8 :-( So this fix was not enough.

--

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

I interrupted 
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%202.7/builds/63/
 which was running since 17 hours... ("running: test_ttk_guionly (32770 sec)")

--

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

The short answer is no.  We no longer use the MSI installer.

Perhaps the windows experts will be interested in exploring why you can't use 
the current installers, since they work for most people.

--
components: +Windows
nosy: +paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my fix for bpo-31135, no idea at this point if it fix this issue.

New changeset 56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8 by Victor Stinner in 
branch '2.7':
ttk: fix LabeledScale and OptionMenu destroy() method (#3026)
https://github.com/python/cpython/commit/56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8

--

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset cd7e9c1b67d3d07ee03e0a79af2791c19031cecb by Victor Stinner in 
branch 'master':
ttk: fix LabeledScale and OptionMenu destroy() method (#3025)
https://github.com/python/cpython/commit/cd7e9c1b67d3d07ee03e0a79af2791c19031cecb


--

___
Python tracker 

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



Re: Validating regexp

2017-08-08 Thread Jon Ribbens
On 2017-08-08, Chris Angelico  wrote:
> On Wed, Aug 9, 2017 at 2:57 AM, Larry Martell  wrote:
>> Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty
>> subexpression for regexp' I'd like to flag it before it gets to SQL.
>
> Okay, so your definition of validity is "what MySQL will accept". In
> that case, I'd feed it to MySQL and see if it accepts it. Regexps are
> sufficiently varied that you really need to use the same engine for
> validation as for execution.

... but bear in mind, there have been ways of doing denial-of-service
attacks with valid-but-nasty regexps in the past, and I wouldn't want
to rely on there not being any now.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26350] Windows: signal doc should state certains signals can't be registered

2017-08-08 Thread Ross Rosen

Ross Rosen added the comment:

I'm not sure if this is helpful, but I thought it might be useful for you to 
hear a non-expert user's perspective.  (In summary, I'm agreeing with the OP.)

I spent a lot of time getting some signal handling working on OSX. Then finally 
in my process got to porting to Windows. I spent a bunch more time scratching 
my head trying to figure out why it wasn't working. Even after reading the 
os.kill and signal docs and searching for "Windows" I still wasn't clear what 
was wrong.  

This thread was the answer. 

So my suggestion at the least would be to put warnings in the signal doc, and 
clarify the language in the os.kill.

--
nosy: +Ross Rosen

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8 by Victor Stinner in 
branch '2.7':
ttk: fix LabeledScale and OptionMenu destroy() method (#3026)
https://github.com/python/cpython/commit/56e162ad5c5d3effe9b4f05d0179e1b6a2a2d9b8


--

___
Python tracker 

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



Re: Validating regexp

2017-08-08 Thread Chris Angelico
On Wed, Aug 9, 2017 at 2:57 AM, Larry Martell  wrote:
> On Tue, Aug 8, 2017 at 12:51 PM, Chris Angelico  wrote:
>> On Wed, Aug 9, 2017 at 2:37 AM, Larry Martell  
>> wrote:
>>> Anyone have any code or know of any packages for validating a regexp?
>>>
>>> I have an app that allows users to enter regexps for db searching.
>>> When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
>>> causes downstream issues. I'd like to flag it at entry time.
>>
>> re.compile()? Although I'm not sure that 'A|B|' is actually invalid.
>> But re.compile("(") throws.
>
> Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty
> subexpression for regexp' I'd like to flag it before it gets to SQL.

Okay, so your definition of validity is "what MySQL will accept". In
that case, I'd feed it to MySQL and see if it accepts it. Regexps are
sufficiently varied that you really need to use the same engine for
validation as for execution.

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


Re: Validating regexp

2017-08-08 Thread Larry Martell
On Tue, Aug 8, 2017 at 12:57 PM, Larry Martell  wrote:
> On Tue, Aug 8, 2017 at 12:51 PM, Chris Angelico  wrote:
>> On Wed, Aug 9, 2017 at 2:37 AM, Larry Martell  
>> wrote:
>>> Anyone have any code or know of any packages for validating a regexp?
>>>
>>> I have an app that allows users to enter regexps for db searching.
>>> When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
>>> causes downstream issues. I'd like to flag it at entry time.
>>
>> re.compile()? Although I'm not sure that 'A|B|' is actually invalid.
>> But re.compile("(") throws.
>
> Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty
> subexpression for regexp' I'd like to flag it before it gets to SQL.

I guess I will have to do a test query with it and catch the error.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Validating regexp

2017-08-08 Thread Chris Angelico
On Wed, Aug 9, 2017 at 2:37 AM, Larry Martell  wrote:
> Anyone have any code or know of any packages for validating a regexp?
>
> I have an app that allows users to enter regexps for db searching.
> When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
> causes downstream issues. I'd like to flag it at entry time.

re.compile()? Although I'm not sure that 'A|B|' is actually invalid.
But re.compile("(") throws.

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


Re: Validating regexp

2017-08-08 Thread Larry Martell
On Tue, Aug 8, 2017 at 12:51 PM, Chris Angelico  wrote:
> On Wed, Aug 9, 2017 at 2:37 AM, Larry Martell  wrote:
>> Anyone have any code or know of any packages for validating a regexp?
>>
>> I have an app that allows users to enter regexps for db searching.
>> When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
>> causes downstream issues. I'd like to flag it at entry time.
>
> re.compile()? Although I'm not sure that 'A|B|' is actually invalid.
> But re.compile("(") throws.

Yeah, it does not throw for 'A|B|' - but mysql chokes on it with empty
subexpression for regexp' I'd like to flag it before it gets to SQL.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Validating regexp

2017-08-08 Thread Skip Montanaro
> I have an app that allows users to enter regexps for db searching.
> When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
> causes downstream issues. I'd like to flag it at entry time.

Just call re.compile(...) on it and catch any exceptions, modulo
caveats about operating with unvalidated user input.

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


Re: Validating regexp

2017-08-08 Thread MRAB

On 2017-08-08 17:37, Larry Martell wrote:

Anyone have any code or know of any packages for validating a regexp?

I have an app that allows users to enter regexps for db searching.
When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
causes downstream issues. I'd like to flag it at entry time.


Couldn't you just try compile the regex and catch any exception?

Also, in that way is 'A|B|' invalid?
--
https://mail.python.org/mailman/listinfo/python-list


[issue31113] Stack overflow with large program

2017-08-08 Thread Yury Selivanov

Changes by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue31113] Stack overflow with large program

2017-08-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch makes stackdepth() not consuming the C stack for recursion. The 
new code is not strictly equivalent to the old code, but I think they should 
produce the same results in common cases (the existing stack depth calculation 
algorithm is not free from bugs, see issue24340).

Since this change is not trivial, I think it should be made it only in master. 
In maintained versions it is safer to change build options on Windows to 
produce the executable with larger stack.

--
stage:  -> patch review
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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-08 Thread D Gentry

New submission from D Gentry:

I've noticed that the only installers that are able to successfully complete on 
my windows 7 x64 system are the MSI installers.

Unfortunately, python.org hasn't released an MSI version since 3.4.4 it seems.

Is it possible to get an MSI installer for one of the more recent versions?

--
files: Python 3.6.2 (64-bit)_20170808103648.log
messages: 299936
nosy: D Gentry
priority: normal
severity: normal
status: open
title: Can we get an MSI installer for something past 3.4.4?
type: crash
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file47066/Python 3.6.2 
(64-bit)_20170808103648.log

___
Python tracker 

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



Validating regexp

2017-08-08 Thread Larry Martell
Anyone have any code or know of any packages for validating a regexp?

I have an app that allows users to enter regexps for db searching.
When a user enters an invalid one (e.g. 'A|B|' is one I just saw) it
causes downstream issues. I'd like to flag it at entry time.
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] Daily Windows builds of Python 3.x

2017-08-08 Thread Steve Dower

Hi all

As part of a deal with Zach Ware at PyCon, I agreed that if he removed 
the Subversion dependency from our builds, I would set up daily Windows 
builds of Python. Zach did an excellent job, and so I am now following 
through on my half of the deal :)


For a while I've been uploading the official releases to nuget.org. 
These packages can be installed with nuget.exe (latest version always 
available at https://aka.ms/nugetclidl), which is quickly becoming a 
standard tool in Microsoft's build toolsets. It's very much a CI-focused 
package manager, rather than a user-focused one, and CI on Windows was 
previously an area where it was difficult to use Python.


See the official feed at https://www.nuget.org/packages/python, and 
related packages pythonx86, python2 and python2x86.


For people looking for an official "no installer" version of Python for 
Windows, this is it.



And since all the infrastructure was there already, I decided to publish 
daily builds in a similar way to myget.org:


https://www.myget.org/feed/python/package/nuget/pythondaily

To install the latest daily build, run nuget.exe with this command:

nuget.exe pythondaily -Source 
https://www.myget.org/F/python/api/v3/index.json


(Note that if you already have a "pythondaily" package in that 
directory, nuget will consider the requirement satisfied. As I said, 
it's meant for reproducible CI builds rather than users who want to 
update things in the least amount of keystrokes :) )


The sys.version string contains the short commit hash. Please include 
this string when reporting bugs in these builds. Also, only the amd64 
Release build is available pre-built.


>>> sys.version
'3.7.0a0 (remotes/origin/master:733d0f63c, Aug  8 2017, 15:56:14) 
[MSC v.1900 64 bit (AMD64)]'


Hopefully this is valuable for people who want to include daily builds 
in their own test runs or validate recent bug fixes.


Cheers,
Steve
--
https://mail.python.org/mailman/listinfo/python-list


[issue20844] SyntaxError: encoding problem: iso-8859-1 on Windows

2017-08-08 Thread Steven Winfield

Steven Winfield added the comment:

I've just been bitten by this on 3.6.2, Windows Server 2008 R2, when running 
the setup.py script for QuantLib-SWIG:
https://github.com/lballabio/QuantLib-SWIG/blob/v1.10.x/Python/setup.py

It seems there is different behaviour depending on whether:
  * Unix (LF) or Windows (CRLF) line endings are used
  * The file is >4096 bytes or <=4096 bytes
  * The module docstring has an initial space

Some of that has been mentioned previously, but I think the 4096-byte limit 
might be new, which is why I'm posting.

I've attached a script I used to come up with the results below. It contains:
  * a -*- coding line (for iso-8859-1 in this case)
  * a docstring consisting entirely of lines of x's, of length 78
  * Unix line endings

The file's length is exactly 4096 bytes.

Running this, or slightly modified versions of this, with a 3.6.2 interpreter 
gave the following results:

  * In all cases, when Windows line endings were used there was no issue - 
running the script produced no errors or output.

  * With Unix line endings:

* File length <= 4096, with no leading spaces in the docstring:
  File "issue20844.py", line 1
SyntaxError: encoding problem: iso-8859-1

* File length > 4096, with no leading spaces in the docstring:
  File "issue20844.py", line 56
x"""
   ^
SyntaxError: EOF while scanning triple-quoted string literal


* Any file length, with the first 'x' on line 3 replaced with a space (line 
2 if the coding line is ignored):
  File "issue20844.py", line 2

x
^
IndentationError: unexpected indent

I had no issues with python 2.7.13.

--
nosy: +steven.winfield
versions: +Python 3.6
Added file: http://bugs.python.org/file47065/issue20844.py

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:

If i could stop thinking of r as meaning "raw" as we document it and instead 
"regular expression literal" I wouldn't make this mistake. :)

Thanks everyone!

--

___
Python tracker 

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



Re: Planning a Python Course for Beginners

2017-08-08 Thread Grant Edwards
On 2017-08-08, Peter Heitzer  wrote:
> Stefan Ram  wrote:
>>  I am planning a Python course.
> [different topics]
>>  Are there any other very simple things that
>>  I have missed and that should be covered very 
>>  early in a Python course? 
>
> The differences between blanks and tabs :-)

You've misspelled "Tabs are evil and should never be used". ;)


-- 
Grant Edwards   grant.b.edwardsYow! We just joined the
  at   civil hair patrol!
  gmail.com

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


[issue31146] Docs: On non-public translations, language picker fallback to "English"

2017-08-08 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue31147] a mostly useless check in list_extend()

2017-08-08 Thread Oren Milman

New submission from Oren Milman:

in listobject.c, in case list_extend() receives an 'iterable' which isn't 'self'
nor a tuple nor a list, we have the following (heavily edited for brevity):
mn = Py_SIZE(self) + PyObject_LengthHint(iterable);
list_resize(self, mn);

... // self is extended to also include the elements of 'iterable'.

// (*)
if (Py_SIZE(self) < self->allocated) {
list_resize(self, Py_SIZE(self));
}

IMHO, the condition in (*) is mostly useless, for two reasons:
1. the list_resize() which is called in (*) does nothing in case
   (Py_SIZE(self) >= (self->allocated >> 1)) is true. In particular, this call
   to list_resize() would have done nothing if it had been called while the
   condition in (*) was false.
2. the condition in (*) is false only in the following cases:
- list_resize(self, mn) caused
  (self->allocated == Py_SIZE(self) + actual_length_of_iterable) to be
  true. e.g.:
  Py_SIZE(self) = 58 and PyObject_LengthHint(iterable) == 8 and
  actual_length_of_iterable == 22
  (because 66 + 66 // 8 + 6 == 80 == 58 + 22).
- list_resize(self, mn) caused
  (self->allocated < Py_SIZE(self) + actual_length_of_iterable), which
  sometime later caused list_extend() to call app1(), which called
  list_resize(), which caused
  (self->allocated == Py_SIZE(self) + actual_length_of_iterable) to be true.
  e.g.:
  Py_SIZE(self) == 58 and PyObject_LengthHint(iterable) == 8 and
  actual_length_of_iterable == 39
  (because 66 + 66 // 8 + 6 == 80 and
   81 + 81 // 8 + 6 == 97 == 58 + 39)

   so ISTM that the condition is only rarely false, especially as
   PyObject_LengthHint(iterable) >= actual_length_of_iterable is usually true
   (i guess).


Thus, i believe we should either change the condition in (*) to
(Py_SIZE(self) < (self->allocated >> 1)), or remove it (and always call
list_resize()).


(note that i ignored error cases, as ISTM they are quite irrelevant to the
issue.)

--
components: Interpreter Core
messages: 299933
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: a mostly useless check in list_extend()
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



[issue31146] Docs: On non-public translations, language picker fallback to "English"

2017-08-08 Thread Julien Palard

New submission from Julien Palard:

As, by default, "english" is selected, and as we're building translations far 
before rendering them public by adding them to the language switcher, there's a 
timespan where a human can voluntarily land on a translation with a language 
switcher unaware of this language.

The language switcher currently defaults to english, so english is selected. As 
"english" is already selected, one can't select "english" to navigate to the 
english version.

Solutions may be to just hide the select element on unknown translations, or 
display the unknown language tag. With more work and a "predicted" list of 
tags-names, it may be possible to also display the name of the language.


Code is here: 
https://github.com/python/cpython/blob/master/Doc/tools/static/switchers.js

I'll take a look, but if some want to do it, let me know.

--
assignee: docs@python
components: Documentation
messages: 299932
nosy: docs@python, mdk
priority: normal
severity: normal
status: open
title: Docs: On non-public translations, language picker fallback to "English"
type: enhancement
versions: Python 2.7, 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



Re: Planning a Python Course for Beginners

2017-08-08 Thread justin walters
On Tue, Aug 8, 2017 at 7:19 AM, Stefan Ram  wrote:

>   I am planning a Python course.
>
>   I started by writing the course akin to courses I gave
>   in other languages, that means, the course starts roughly
>   with these topics:
>
> - number and string literals
> - types of number and string literals
>   (just giving the names »int«, »float«, and »string«)
> - using simple predefined operators (+, -, *, /)
>   (including 2*"a" and "a"+"b")
> - calling simple predefined functions (len, type, ...)
>
>   . This is a little bit boring however and might not
>   show off Python's strength early in the course.
>
>   So, I now think that maybe I should start to also
>   include list (like
>
> [1,2,3]
>
>   ) right from the start. A list conceptually is not
>   much more difficult than a string since a string
>   "abc" resembles a list ["a","b","c"]. I.e., the
>   course then would start as follows:
>
> - number, string, and list literals
> - types of number, string and list literals
>   (just giving the names »int«, »float«, »string«,
>   and »list«)
> - using simple predefined operators (+, -, *, /)
>   (including 2*"a", "a"+"b",  2*["a"], and [1]+[2])
> - calling simple predefined functions (len, type, ...)
>
>   However, once the box has been opened, what else
>   to let out? What about tuples (like
>
> (1,2,3)
>
>   ). Should I also teach tuples right from the start?
>
>   But then how to explain to beginners why two
>   different types (lists AND tuples) are needed for
>   the concept of a linear arrangement of things?
>
>   Are there any other very simple things that
>   I have missed and that should be covered very
>   early in a Python course?
>
>   (Especially things that can show off fantastic
>   Python features that are missing from other
>   programming languages, but still only using
>   literals, operators and function calls.)
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

One thing I find that gets overlooked in a lot of beginner Python
courses is Python's module system. Covering the module system
will allow you to hit on the subject of namespacing and scope.

Python's module system is one of its greatest strengths in my opinion.
No other language I've used makes it so simple to structure a project.

Another idea: Dictionaries

Dictionaries are a conceptually simple data structure that should be easy
for beginners to grok. Obviously, their implementation is a bit complex,
but I
don't think you would need to get into that. Dictionaries are very powerful
data structures that can be used to keep code DRY and store important
data to be accessed from anywhere in an application or script. Dictionaries
also have a time complexity average of O(1) for read access which
makes them fairly efficient.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Planning a Python Course for Beginners

2017-08-08 Thread Chris Angelico
On Wed, Aug 9, 2017 at 1:02 AM, Stefan Ram  wrote:
> Chris Angelico  writes:
>>Why a new Python course?
>
>   It is not a course in the sense of a written text
>   (which I would call "course notes").
>
>   It is a course in the sense of an event, where I will meet
>   participants in a classroom. I will get paid for it, so this
>   payment is the reason I do it (simplified ;-).

Ah. Well, that's a good answer to the question of "why are you even
bothering to write this", but unfortunately doesn't answer the
questions that I hoped it would, about target audience and such. Heh.
C'est la vie.

>   Since this is my first-ever Python course, but has not yet
>   begun, I do not know the participants, but I can say this:
>
> - the course description requires that the participant
>   have experiences "working with a computer", but not that
>   they have any knowledge about programming.
>
> - the participants in my other courses for other
>   programming languages usually are slow learners, so I
>   prepare for this kind of audience. I try to avoid topics
>   that are abstract, advanced or complicated as much as
>   possible. I try to include very simple exercises.
>   Most books and tutorials assume faster learners,
>   so that's another reasone why I don't use them.

So, this here is the important info. In that case, I would start with
wowing them with the amazing stuff Python can do. Start with a few
demonstrations of the simplicity and beauty of expression evaluation.
It's okay to use concepts you haven't yet explained; instead of
starting with concrete info and building up to something interesting,
start with something interesting and then explain how it all works.

Just my opinion, of course, but if you didn't want totally unbacked
opinions, you wouldn't have come to this list :)

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


[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread Ned Deily

Ned Deily added the comment:

For future reference, please make sure to include current release managers on 
proposed changes like this since doc building and distribution is part of the 
release process.

--
nosy: +ned.deily

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Another hang: test_ttk\test_extensions.py:335: 
LabeledScaleTest.test2_variable_change(). Traceback:

(...)
File: "C:\haypo\2.7\lib\lib-tk\test\test_ttk\test_extensions.py", line 335, in 
test2_variable_change
  x.update()
File: "C:\haypo\2.7\lib\lib-tk\Tkinter.py", line 1023, in update
  self.tk.call('update')

I'm now using this batch script:
---
:repeat
PCbuild\amd64\python_d.exe -m test -u all --timeout=30 -R 3:3 -r 
test_ttk_guionly
if not %errorlevel% equ 0 goto :fail
echo OK
goto :repeat

:fail
echo ERR
---

--

___
Python tracker 

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



Re: Planning a Python Course for Beginners

2017-08-08 Thread Peter Heitzer
Stefan Ram  wrote:
>  I am planning a Python course.
[different topics]
>  Are there any other very simple things that
>  I have missed and that should be covered very 
>  early in a Python course? 

The differences between blanks and tabs :-)

-- 
Dipl.-Inform(FH) Peter Heitzer, peter.heit...@rz.uni-regensburg.de
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31145] PriorityQueue.put() fails with TypeError if priority_number in tuples of (priority_number, data) are the same.

2017-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I don't see any way to change PriorityQueue to fix this.  The non-comparability 
of dicts likely won't be restored, nor will the lexicographic comparison order 
of tuples be likely to change.

One possible way forward is to provide a wrapper with the desired comparison 
behavior:

pq = PriorityQueue()
pq.put(Prioritize(13, task))
task = pq.get().item
  
where Prioritize is implemented something like this:

import functools

@functools.total_ordering
class Prioritize:

def __init__(self, priority, item):
self.priority = priority
self.item = item

def __eq__(self, other):
return self.priority == other.priority

def __lt__(self, other):
return self.priority < other.priority

from queue import PriorityQueue, Empty
from contextlib import suppress

bugged = [
(-25.691, {'feedback': 13, 'sentiment': 0.309, 'support_ticket': 5}), (-25.691, 
{'feedback': 11, 'sentiment': 0.309, 'support_ticket': 3}), (-25.0, 
{'feedback': 23, 'sentiment': 0.0, 'support_ticket': 15}),
]

pq = PriorityQueue()

for priority, item in bugged:
pq.put(Prioritize(priority, item))
with suppress(Empty):
while True:
item = pq.get_nowait().item
print(item)

--
assignee:  -> rhettinger
nosy: +rhettinger
type: behavior -> enhancement
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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Yesterday, I ran test_ttk_guionly during 3 hours on Windows with Python 2.7 
compiled in debug mode. I saw between 4 and 7 hangs. I'm not sure about the 
exact number since sometimes the test unblocked when I just moved my mouse or 
clicked on my Command Prompt window

At this point, I'm only sure that the following tests blocked:

* test_ttk\test_extensions.py:184: LabeledScaleTest.test_resize() -- test 
ttk.LabeledScale
* test_ttk\test_widgets.py:1367: TreeviewTest.test_heading_callback() -- test 
ttk.Treeview
* test_ttk.test_widgets.TreeviewTest.test_tag_bind() -- test ttk.Treeview

bpo-31135 fixes LabeledScale.destroy(), so it may be related.

--

___
Python tracker 

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



[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

Ah, I see.  We don't really support .pyc-only distribution, though we try not 
to break it.

Do you want to propose a fix?

--

___
Python tracker 

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



Re: Planning a Python Course for Beginners

2017-08-08 Thread Chris Angelico
On Wed, Aug 9, 2017 at 12:19 AM, Stefan Ram  wrote:
>   I am planning a Python course.
>

Before answering any other questions, answer this one:

Why a new Python course? How is it different from what already exists?

The answer to that will govern just about everything else. The
specifics that you're asking about are unanswerable without first
knowing your audience, for instance.

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


[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread Todd Schiller

Todd Schiller added the comment:

I'm reporting that lib2to3 doesn't work without having source .py files for the 
fixes that are packaged with the lib2to3 library. Perhaps the get_all_fix_names 
method in lib2to3/refactor.py should check for either .py or .pyc files?

The source files are included with the package that I'm installing (anyjson 
0.3.3 in this case).

--

___
Python tracker 

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



[issue22635] subprocess.getstatusoutput changed behavior in 3.4 (maybe 3.3.4?)

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Bug mentionned on a Twitter discussion:
https://twitter.com/zhenech/status/89040992829441

--

___
Python tracker 

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



[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

What are you reporting as the bug here?  2to3 obviously can't work without the 
source, so based just on what you have written here this sounds like an Azure 
bug.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

The Tcl event loop is recursive: http://wiki.tcl.tk/1527

--

___
Python tracker 

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



[issue31145] PriorityQueue.put() fails with TypeError if priority_number in tuples of (priority_number, data) are the same.

2017-08-08 Thread Mikołaj Babiak

New submission from Mikołaj Babiak:

# list of tuples in form of (priority_number, data)
bugged = [
(-25.691, {'feedback': 13, 'sentiment': 0.309, 'support_ticket': 5}), (-25.691, 
{'feedback': 11, 'sentiment': 0.309, 'support_ticket': 3}), (-25.0, 
{'feedback': 23, 'sentiment': 0.0, 'support_ticket': 15}),
]

from queue import PriorityQueue

pq = PriorityQueue()

for item in bugged:
   pq.put(item)

# TypeError: '<' not supported between instances of 'dict' and 'dict'

It seems that if priority_numbers are equal, heapq.heapify() falls back to 
comparing data element from tuple (priority_number, data).
I belive this is an undesired behaviour.
It is acctually listed as one of implementation challenges on 
https://docs.python.org/3/library/heapq.html:
"Tuple comparison breaks for (priority, task) pairs if the priorities are equal 
and the tasks do not have a default comparison order."

In python 2.7 the issue in not present and PriorityQueue.put() works as expected

--
components: Library (Lib)
messages: 299922
nosy: Mikołaj Babiak
priority: normal
severity: normal
status: open
title: PriorityQueue.put() fails with TypeError if priority_number in tuples of 
(priority_number, data) are the same.
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



[issue31144] add initializer to concurrent.futures.ProcessPoolExecutor

2017-08-08 Thread nvdv

New submission from nvdv:

Unfortunately concurrent.futures.ProcessPoolExecutor does not provide any means 
to interact with worker processes (like initializer function in 
multiprocessing.Pool constructor).

This problem has been mentioned at least once: 
https://mail.python.org/pipermail/python-dev/2014-March/133697.html.

It's not hard to work around this issue by subclassing ProcessPoolExecutor and 
adding all necessary methods, but IMO solution can be more generic.

--
components: Library (Lib)
messages: 299921
nosy: nvdv
priority: normal
severity: normal
status: open
title: add initializer to concurrent.futures.ProcessPoolExecutor
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue31143] lib2to3 requires source files for fixes

2017-08-08 Thread Todd Schiller

New submission from Todd Schiller:

The lib2to3 library doesn't detect/apply any fixes if the source files aren't 
included with the distribution. See get_all_fix_names at 
https://github.com/python/cpython/blob/master/Lib/lib2to3/refactor.py#L30

This affects Azure's official Python site extensions [1], which only include 
bytecode pyc's for the fixes [2].

This results in bad installs when using setuptools to install packages that 
leverage the use_2to3 flag during the install [3]

[1] https://github.com/Azure/azure-python-siteextensions
[2] https://github.com/Azure/azure-python-siteextensions/issues/14
[3] https://github.com/pypa/setuptools/issues/1120#issuecomment-320769664

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 299920
nosy: tschiller
priority: normal
severity: normal
status: open
title: lib2to3 requires source files for fixes
type: behavior

___
Python tracker 

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



[issue31068] [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 Refleaks 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Calling "self.tk.call('update')" runs the Tcl event loop:
* http://wiki.tcl.tk/1252
* https://www.tcl.tk/man/tcl/TclCmd/update.htm

Interesting but very old (2001) article: "Update considered harmful"
http://wiki.tcl.tk/1255

--
title: test_ttk_guionly hangs at self.tk.call('update') on AMD64 Windows8.1 
Refleaks 2.7 -> [2.7] test_ttk_guionly hangs at self.tk.call('update') on AMD64 
Windows8.1 Refleaks 2.7

___
Python tracker 

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



[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

In fact, this ia a FAQ: 

https://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

That seems like a reasonable use case, but is fnmatch what git is using for 
this?  If so, what is the feature set required?  In any case, the existing 
functionality must remain as is for backward compatibility reasons, so this 
would either be a new function or keyword controlled optional behavior.

(You will note that our fnmatch documentation specifically mentions treating / 
as a normal character.)

--

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

widget_instance-2.7-v2.patch: Updated patch for Python 2.7 to debug 
test_ttk_guionly.

https://github.com/python/cpython/pull/3026 fix LabeledScale and OptionMenu 
destroy() method for Python 2.7.

--
Added file: http://bugs.python.org/file47064/widget_instance-2.7-v2.patch

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3060

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Example of failure on master using widget_instance-master.patch:

haypo@selma$ ./python -m test -v -u all test_ttk_guionly 

==
ERROR: test_initialization 
(tkinter.test.test_ttk.test_extensions.LabeledScaleTest)
--
Traceback (most recent call last):
  File 
"/home/haypo/prog/python/master/Lib/tkinter/test/test_ttk/test_extensions.py", 
line 14, in tearDown
super().tearDown()
  File "/home/haypo/prog/python/master/Lib/tkinter/test/support.py", line 40, 
in tearDown
w.destroy()
  File "/home/haypo/prog/python/master/Lib/tkinter/__init__.py", line 2305, in 
destroy
% self.children)
Exception: destroy() doesn't clear all children: {'!labeledscale2': 
}


My https://github.com/python/cpython/pull/3025 PR fixes LabeledScale and 
OptionMenu destroy() method in the master branch.

--

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3059

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

widget_instance-master.patch: Check that Tkinter.Widget.destroy() removes all 
children and check that test_ttk_guionly doesn't leak widgets.

--
Added file: http://bugs.python.org/file47063/widget_instance-master.patch

___
Python tracker 

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



[issue31135] [2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

On master, LabeledScaleTest.test_initialization() leaks a widget in the root 
widget, even after root.destroy(). The problem is that 
LabeledScaleTest.__del__() doesn't call Frame.destroy(self) if self._variable 
is not set. So master has at least this bug.

--

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Even if changes are merged, I prefer to wait until the doc at docs.python.org 
is to date before closing the issue.

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



[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 245dafca85097dd8b84f02b01f39f5d32091754b by Victor Stinner 
(Julien Palard) in branch '2.7':
bpo-31045: Language switch (#2652) (#3024)
https://github.com/python/cpython/commit/245dafca85097dd8b84f02b01f39f5d32091754b


--

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e93135dbb265e801ca19cd9c5428d57d1cf4 by Victor Stinner 
(Julien Palard) in branch '3.6':
bpo-31045: Language switch (#2652) (#3023)
https://github.com/python/cpython/commit/e93135dbb265e801ca19cd9c5428d57d1cf4


--

___
Python tracker 

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



[issue31142] python shell crashed while input quotes in print()

2017-08-08 Thread py78py90py

New submission from py78py90py:

I have downloaded python 3.6 into MacOSX system.
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

Then I opened the IDLE and try to input some sentences.
I inputed "print()", then input single quote in print.
But the IDLE crashed.

--
components: Demos and Tools
messages: 299909
nosy: py78py90py
priority: normal
severity: normal
status: open
title: python shell crashed while input quotes in print()
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



[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Mark Bell

Changes by Mark Bell :


--
type:  -> behavior

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3058

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-08-08 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3056

___
Python tracker 

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



[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3055

___
Python tracker 

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



[issue31141] Start should be a keyword argument of the built-in sum

2017-08-08 Thread Mark Bell

New submission from Mark Bell:

The built-in function sum takes an optional argument "start" to specify what 
value to start adding from (defaults to 0). This argument should be a keyword 
argument in order to match the other built-in functions such as:

enumerate(range(10), start=5)

This patch allows users to write:

sum(range(10), start=5)

which previously raised "TypeError: sum() takes no keyword arguments". Since 
the only change is making an optional positional argument into a keyword 
argument, this has no effect on any existing code using the current convention 
of:

sum(range(10), 5)

--
components: ctypes
messages: 299908
nosy: Mark.Bell
priority: normal
severity: normal
status: open
title: Start should be a keyword argument of the built-in sum
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue31140] Insufficient error message with incorrect formated string literal

2017-08-08 Thread Eric V. Smith

Eric V. Smith added the comment:

Thanks. There was some work on this recently: I'll try and check 3.7 later 
today.

--

___
Python tracker 

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



  1   2   >