[issue33422] Fix and update string/byte literals in help()

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you for your contribution Andrés!

I just wondering how did you discover this bug?

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior
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



[issue33422] Fix and update string/byte literals in help()

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c40eeeb5e69df12a5f46edc7ba82ec75c7d1b820 by Serhiy Storchaka 
(Andrés Delfino) in branch '2.7':
[2.7] bpo-33422: Fix quotation marks getting deleted when looking up 
byte/string literals on pydoc. (GH-6701) (GH-6712)
https://github.com/python/cpython/commit/c40eeeb5e69df12a5f46edc7ba82ec75c7d1b820


--

___
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-06 Thread David Bolen

David Bolen  added the comment:

Disk space seems unlikely as a reason - the local disk is 60GB on each 
buildbot, of which at least 50GB+ is generally free.  So that shouldn't be a 
problem (the WinXP/Win7 buildbots operate with far less, like 5-10GB).

I had also considered that perhaps something went wrong with the temp folder 
setting during the reboot so it ended up on the system disk (network) rather 
than the local disk, but it looks fine, and I see build and temporary files all 
created on the local disk.

I believe some of the worst overheads for Spectre patches were found in I/O 
intensive workloads.  Interestingly, neither buildbot processor reports PCID 
support, which might make it worse (though I don't know for sure if Azure 
exposes those flags to guests).

Of course, it could just be some other change in the new physical machines in 
some way.  There have been no other guest changes for a while (last was a build 
tool change in January).

Whatever it is, it certainly seems correlated to the maintenance, and appears 
to be consistent after that point.

-- David

--

___
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-06 Thread Paul Goins

Paul Goins  added the comment:

For what it's worth as a newbie here, I'll add my 2 cents.  (This is partially 
copied from my mail on python-dev.)

The one thing which I did notice between the last builds which passed and the 
current builds is, under the "10 slowest tests" header, test_io has shot up in 
terms of time to complete:

3.6: from 2 min 13 sec (passing) to 9 min 25 sec (tests timing out)
3.7: from 2 min 10 sec (passing) to 9 min 26 sec (tests timing out)
3.x: from 3 min 39 sec (passing) to 9 min 17 sec (tests timing out)

i.e. roughly 3x longer to run this test suite.

I did a local sanity test of that particular test suite, comparing the last 
passing changeset from 3.x with the HEAD of master, and I saw no difference in 
performance.  Thus, my bet is on a build agent related issue such as running 
low on disk space.  The Azure changes mentioned seems also a possible culprit.

--
nosy: +pdgoins

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2018-05-06 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

FWIW, I would _love_ to see this.  But I don't wrangle Windows myself so I 
can't usefully offer anything other than being happy to volunteer to run a 
Clang on Windows buildbot VM once there is something to actually be run.

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



[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-06 Thread paul j3

paul j3  added the comment:

I've attached a file that tries out the idea of building a custom `metavar` in 
the `add_parser` method.

It subclasses argparse._SubParsersAction, and registers it with the parser.  No 
other modification to production code is required.

Subparsers with a blank `help`, appear in the choices, but not the helps.

Subparsers with a SUPPRESS don't appear in either, but can still appear in 
error messages

If everything is SUPPRESS, the metavar is '{}'.  I have not tried to handle the 
case where the user provides his own 'metavar'.  The regular class can handle 
that just fine.

There are too many untested edge cases to add this to production, but if anyone 
wants to try it, feedback will be welcomed.

This makes SUPPRESS in the subparser help behave more like SUPPRESS in the 
regular Action help.  Otherwise a custom 'metavar' works just as well.

--
Added file: https://bugs.python.org/file47574/issue22848.py

___
Python tracker 

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



[issue33436] Add an interactive shell for Sqlite3

2018-05-06 Thread Raymond Hettinger

New submission from Raymond Hettinger :

To facilitate rapid experimentation with SQL queries, add a shell to run 
commands and display results.

Attached is minimal proof-of-concept modeled loosely on the Linux sqlite3 REPL. 
 Here's a sample session:

SQLite version 2.6.0

 Enter "help" for usage hints

sqlite> open Irises.db
sqlite> select distinct species from irises
('Iris-setosa',)
('Iris-versicolor',)
('Iris-virginica',)
sqlite> select species, avg(pet_len), avg(sep_len) from irises group by 
species
('Iris-setosa', 1.464, 5.005)
('Iris-versicolor', 4.26, 5.936)
('Iris-virginica', 5.552, 6.5879998)
sqlite> select count(*) from irises
(150,)
sqlite> quit

--
components: Library (Lib)
files: sqlite3_repl.py
messages: 316248
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add an interactive shell for Sqlite3
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file47573/sqlite3_repl.py

___
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-06 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

Thanks! I have updated the PR and added tests.

--

___
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-06 Thread Martin Panter

Martin Panter  added the comment:

Can you use the existing sched_param class?
https://docs.python.org/3/library/os.html#os.sched_param

--

___
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-06 Thread David Bolen

David Bolen  added the comment:

Nothing for my part, but there was an Azure "maintenance" on 4/16 where both 
the Win8 and Win10 buildbots were migrated to "newer" hardware (the first 
change to their physical machine for a really long time).  No word on why.  The 
VM machine class was unchanged, and the tests run on a local disk.  But perhaps 
there has been a performance or other impact (Spectre changes?)

That seems to line up in terms of timing, for example with Win10 3.x build 795 
and Win8 3.x build 831 both running the AM of 4/16 with the first failures.

Oddly, I'm having trouble finding a reference to test_mmap in older Win10 3.x 
build logs, but on Win8 3.x builds it was definitely one of the slower tests 
before that point, although only in the 4-5 minute range.

So not sure.  Assuming it was the "upgrade" and given the persistence of the 
failure since, I suppose it's safer to assume this is a new normal for that 
platform - if skipping the particular test(s) would work, I say go for it at 
least for now.

-- David

--

___
Python tracker 

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



[issue32608] Incompatibilities with the socketserver and multiprocessing packages

2018-05-06 Thread Michael Durso

Michael Durso  added the comment:

I added more commits to the PR based on your comments.  Although I cannot 
figure out why on the new Process objects create Threads that do not get 
cleaned up.

--

___
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-06 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

> Without thread support, event generation from multiple threads fails 
> immediately.

This ticket is for threaded Tcl only, so this is off topic.

In nonthreaded Tcl, this script crashes rather than freezes, for an entire ly 
different reason that I already explained in https://bugs.python.org/issue33257 
.

This ticket is solved if you ask me.
The only remaining matter is that there's no documentation:

* on Tkinter threading model: https://docs.python.org/3/library/tk.html claims 
full thread safety which is untrue.
* on best practices with Tkinter: as you could see, all the more or less 
obvious solutions are flawed. (That includes my solution: the program doesn't 
terminate gracefully if you close the window by hand.)

I'm going to cover at least the first item as part of executing Guido's 
suggestion to "add a warning to the docs".

--

___
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-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Without thread support, event generation from multiple threads fails 
immediately.  I tried an experiment with callback scheduling.  It seems to work 
-- almost.

thread_event.py runs on 2.7 with non-t tcl.  It modifies TkinterHandlres32.py 
by replacing
self.target.event_generate(c)
with
self.target.after(1, lambda t=self.target: t.event_generate(c))
to schedule the event generation in the main thread.
It also imports either tkinter or Tkinter, and runs for 10 seconds
self.root.after(1,self.stop)
for a more rigorous test.

However, when I add 2 0s to the delay, to make it 1000 seconds, the main thread 
and gui crash sometime sooner (100 seconds, say), leaving the worker threads 
sending indefinitely.  One time there was a traceback:

Traceback (most recent call last):
  File "F:\dev\tem\thread_event.py", line 55, in 
Main().go()
  File "F:\dev\tem\thread_event.py", line 35, in go
self.t_cleanup.join()
AttributeError: 'Main' object has no attribute 't_cleanup'

A second time, nothing appeared.

I suspect that without proper locking an .after call was eventually interrupted 
and the pending scheduled callback data structure corrupted. Mainloop exits 
without t_cleanup created.

--

___
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-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This issue is effectively a re-opening and continuation of #11077.  
TkinterCrash2(3)-2.py are altered versions of Serhiy's file of the same name on 
the old issue.  (Ivan, you really should have said all this at the beginning of 
this issue.)

Serhiy, you wrote "If there no other errors in TkinterCrash2-2.py, this issue 
can be closed."  When I ran your file on Win10 with 2.7.15 multiple times, I 
got messages like one or more of the following about half the runs.

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:/dev/tem/thread_event27.py", line 50, in run
self.deliverToQueue((self.target, z, y))
  File "f:/dev/tem/thread_event27.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: unknown or ambiguous item type "87414752LtickHook"

Exception in Tkinter callback
TclStackFree: incorrect freePtr. Call out of sequence?

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Traceback (most recent call last):
  File "C:\Programs\Python27\lib\lib-tk\Tkinter.py", line 1541, in __call__
return self.func(*args)
TypeError: callit() takes no arguments (6 given)

--

___
Python tracker 

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



[issue11077] Tkinter is not thread safe

2018-05-06 Thread Mark Lawrence

Change 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



[issue11077] Tkinter is not thread safe

2018-05-06 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This issue was effectively reopened by #33257, with altered versions of 
TkinterCrash2-2.  Serhiy's original thereof fails for me on 2.7.15.  I will put 
details on the new issue.

--

___
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-06 Thread Zachary Ware

Zachary Ware  added the comment:

David, has anything gone wonky on those builders lately?  Should we consider 
passing `-u-largefile` on them?

--
nosy: +db3l

___
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-06 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

One open question is how to construct and pass through the struct "sched_param" 
that “posix_spawnattr_setschedparam” needs.

--

___
Python tracker 

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



[issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__

2018-05-06 Thread Stefan Behnel

Stefan Behnel  added the comment:

> cmp(a,b) can be replaced with (a>b)-(a b" and "a < b" both return something that supports 
the minus operator, such as a boolean value. That might not be the case, and it 
is definitely impossible to infer automatically from a given piece of code.

Besides, even if the transformation happens to be correct in a given case, the 
result is definitely also very difficult to read and understand. IMHO, "but it 
keeps working" isn't enough of an argument here.

--
nosy: +scoder

___
Python tracker 

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



[issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__

2018-05-06 Thread Ayush

Ayush  added the comment:

I believe 2to3 should be able to replicate the same results of cmp function in 
python 3 too. I can create a PR which will allow the library to handle it. 

For example, a function call cmp(a,b) can be replaced with (a>b)-(a

___
___
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-06 Thread Martin Panter

Martin Panter  added the comment:

To wrap “posix_spawnattr_setschedparam” perhaps you could combine it with the 
scheduler policy:

# Inherit current policy and parameters:
posix_spawn(..., scheduler=None)

# Set new policy with parameters:
posix_spawn(..., scheduler=(policy, param))

# Inherit current policy but set new parameters:
posix_spawn(..., scheduler=(None, param))

--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2018-05-06 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Thanks, Serhiy.

--

___
Python tracker 

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



[issue21592] Make statistics.median run in linear time

2018-05-06 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

How does the performance change with this patch?

Quick-select is a nice idea in theory, but unless it is written in C, it is 
unlikely to beat sorting the list unless you have HUGE data sets. Its been 
nearly four years since I last did some benchmarks, but at the time there was 
no comparison, sorting was clearly much better (although Stefan found that 
select was faster than sorting).

In particular, all the quickselect versions I tested suffered catastrophic 
performance slowdowns if the data was already sorted: anything from double the 
time to ten times as much time.

--

___
Python tracker 

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



[issue33435] incorrect detection of information of some distributions

2018-05-06 Thread Andrey Bychkov

New submission from Andrey Bychkov :

In some linux distributions, the information about the distribution is 
incorrectly determined when the linux_distribution() method is called from the 
platform class. Since the information file os-release becomes a certain 
standard, I propose first of all to check its availability and if it is in the 
system, then parse the information from it. I apply the patch. It will work 
well with version 2.7.

--
components: Library (Lib)
files: fixed_lib_platform_os-release.patch
keywords: patch
messages: 316232
nosy: Andrey Bychkov
priority: normal
severity: normal
status: open
title: incorrect detection of information of some distributions
type: behavior
versions: Python 3.6
Added file: 
https://bugs.python.org/file47572/fixed_lib_platform_os-release.patch

___
Python tracker 

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



[issue33434] ^L character in Lib/email/generator.py

2018-05-06 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

That's a "form feed" or "page break" character: 
https://en.wikipedia.org/wiki/Page_break

Quoting that page: "The form feed character is sometimes used in plain text 
files of source code as a delimiter for a page break, or as marker for sections 
of code. Some editors, in particular emacs and vi, have built-in commands to 
page up/down on the form feed character. This convention is predominantly used 
in Lisp code, and is also seen in C and Python source code."

It's perhaps a bit old-fashioned, but some of us are old-fashioned kinds of 
people :-).

--
nosy: +njs -serhiy.storchaka
stage: resolved -> 

___
Python tracker 

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



[issue33434] ^L character in Lib/email/generator.py

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It is intended. Emacs use it for separating sections of code. Python parser 
specially supports this character.

--
nosy: +serhiy.storchaka
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



[issue33434] ^L character in Lib/email/generator.py

2018-05-06 Thread hexchain

New submission from hexchain :

There is a "^L" character in line 25 of the Lib/email/generator.py file, and it 
seems it's there for a long time (since commit 8b3febef2f9).

Is it intended or some carelessness? It does not seem to have any functional 
impact, though.

--
components: Library (Lib)
messages: 316229
nosy: hexchain
priority: normal
severity: normal
status: open
title: ^L character in Lib/email/generator.py
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, 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



[issue20087] Mismatch between glibc and X11 locale.alias

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a55ac801f749a731250f3c7c1db7d546d22ae032 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. 
(GH-6708). (GH-6717)
https://github.com/python/cpython/commit/a55ac801f749a731250f3c7c1db7d546d22ae032


--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 6049bda21b607acc90bbabcc604997e794e8aee1 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. 
(GH-6708) (GH-6713)
https://github.com/python/cpython/commit/6049bda21b607acc90bbabcc604997e794e8aee1


--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2018-05-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b1c70d0ffbb235def1deab62a744ffd9b5253924 by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
[3.6] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. 
(GH-6708) (GH-6714)
https://github.com/python/cpython/commit/b1c70d0ffbb235def1deab62a744ffd9b5253924


--

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2018-05-06 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6409

___
Python tracker 

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