[issue37666] urllib.requests.urlopen doesn't support cadata=

2019-07-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +orsenthil

___
Python tracker 

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



[issue37666] urllib.requests.urlopen doesn't support cadata=

2019-07-23 Thread Christian Heimes


Christian Heimes  added the comment:

Yes, that's my favorite solution.

Actually I would like to deprecate and remove all TLS/SSL related arguments in 
favor of a single context/ssl_context argument.

--

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

After-thought test 2: proportional fonts* work fine.  Nearly all have 
monospaced digits, with extra space around '1' if there is no bottom bar.  So 
those also have nicely aligned right-justified columns in the sidebar.  And the 
one font I found with proportional digits, Miriam Libre, still had readable 
numbers.

* Given the PEP 8 discouragement of the sort of vertical alignment, such as

one  =  1
eight=  8
ten  = 10
nineteen = 19

which people, including me, have done with other languages, using a 
proportional font with python is not nearly as crazy as some people claim, and 
not to be totally disregarded.  The main issue is line length and what happens 
when someone else views the same file with a fixed-pitch font.

--

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 9d54de16589b9d0f073093fb90a8c7040224335a by Miss Islington (bot) 
in branch '3.8':
bpo-37667: Add regression test for regrtest. (GH-14929)
https://github.com/python/cpython/commit/9d54de16589b9d0f073093fb90a8c7040224335a


--
nosy: +miss-islington

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14702
pull_request: https://github.com/python/cpython/pull/14931

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14701
pull_request: https://github.com/python/cpython/pull/14930

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset e95ac20103437d8099fb91cd4468ab030852f3b7 by Gregory P. Smith in 
branch 'master':
bpo-37667: Add regression test for regrtest. (GH-14929)
https://github.com/python/cpython/commit/e95ac20103437d8099fb91cd4468ab030852f3b7


--

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A regression test for this type of situation is in the works in the open PR.

--
stage: patch review -> commit review
status: open -> closed
versions: +Python 3.9

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +14700
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/14929

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

fixed, but not marking closed until the 3.8 automerge happens.

--
resolution:  -> fixed
stage: patch review -> commit review
versions:  -Python 3.9

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14699
pull_request: https://github.com/python/cpython/pull/14928

___
Python tracker 

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



[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2019-07-23 Thread Gordon Messmer


Gordon Messmer  added the comment:

As an example, let's consider dnf's i18n setup:

try:
dnf.pycomp.setlocale(locale.LC_ALL, '')
except locale.Error:
# default to C.UTF-8 or C locale if we got a failure.
try:
dnf.pycomp.setlocale(locale.LC_ALL, 'C.UTF-8')
os.environ['LC_ALL'] = 'C.UTF-8'
except locale.Error:
dnf.pycomp.setlocale(locale.LC_ALL, 'C')
os.environ['LC_ALL'] = 'C'

If setting the environment-specified locale fails, dnf will attempt to set the 
locale
to C.UTF-8, and if that fails it will set the locale to C.  This seems like an 
ideal
process.  If the expected locale is missing, dnf will attempt to at least use 
UTF-8,
before falling back to the C locale.

Unfortunately, because of the alias, this process will be unable to set the 
'C.UTF-8'
locale on systems which do not have the 'en_US' locale installed.  This renders
system support for 'C.UTF-8' unusable when no locales are installed.

--

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +14698
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14927

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

tracking that as a release blocker in https://bugs.python.org/issue37667

--

___
Python tracker 

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



[issue37667] test.regrtest is now only running 40 tests

2019-07-23 Thread Gregory P. Smith


New submission from Gregory P. Smith :

After the PR for https://bugs.python.org/issue36044 when in, see the comment in 
the issue.

test.regrtest is now only running 40 tests.

that means all of our CI is failing to run most of the test suites.

--
components: Tests
messages: 348365
nosy: gregory.p.smith, lukasz.langa
priority: release blocker
severity: normal
stage: needs patch
status: open
title: test.regrtest is now only running 40 tests
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-07-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

For what it's worth, I see this failure often when running the test suite. I 
have created a pull request to increase the delay.

--
nosy: +ZackerySpytz
versions: +Python 3.9

___
Python tracker 

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



[issue35771] IDLE: Fix tooltip Hovertiptest failure

2019-07-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +14697
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14926

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

Travis only runs 40 tests after this change 
(https://travis-ci.org/python/cpython/jobs/562362678).

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue37666] urllib.requests.urlopen doesn't support cadata=

2019-07-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Probably nevermind on implementing this:

  ssl_context = ssl.create_default_context(cadata=...)
  urllib.request.urlopen(..., context=ssl_context)

Works fine.  It might be worth a note in the urlopen() docs if anything.

--

___
Python tracker 

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



[issue37665] threading.TIMEOUT_MAX integer overflow on 32-bit builds with threading.Thread.join

2019-07-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

See also bpo-33632.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue30755] locale.normalize() and getdefaultlocale() convert C.UTF-8 to en_US.UTF-8

2019-07-23 Thread Gordon Messmer


Change by Gordon Messmer :


--
keywords: +patch
pull_requests: +14696
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14925

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

A note on the first 3 comments in msg223086 of 2014-07-15.

1. Canvas versus Text: The prototype posted by Brian Oakley on SO had to use a 
Canvas because it was meant to work even with texts with multiple fonts and 
in-line widgets.  IDLE's editor, intended mainly for .py files, does not allow 
either.  As long as line numbers use the same font as the text, they have the 
same height and vertical spacing as the text.

I checked that this remains true when non-latin character sets are mixed in.  I 
pasted the config font sample into a numbered editor and it worked perfectly. 
At least on Windows, tk fonts are vertically monospaced at least for this 
sample, and I assume for all.  To do this, either ascii/latin/etc lines are 
over-spaced or hanji/kanji/hangul lines are underspaced.  Source Code Pro, 
which I normally use, does the former.  Courier does the latter.

2. Call versus Event notification.  IDLE's menu and hot keys generate 
pseudoevents handled by one event handler.  Some tk widgets generate 
widget-specific pseudoevent that can be handled by any handler.  IDLE's config 
dialog pushes font change notifications by calling text methods that amount to 
event handlers.  It can do this because 'listed windows' are registered as 
listeners by being on the list of such instances.

I suggested 5 years ago that we might switch font change notification to 
events.  I don't think so now.  The current system allows control of the order 
in which texts within a code frame respond to config changes.  It works better 
if code contexts, when present, change before the main text.

3. Line number foreground and background.  We made them configurable to user 
preference.  Possibilities are: same as text; toned down version of text (for 
instance, black on white to dark gray on light gray), or contrasting with text.

(I discussed 4. global versus local setting on 7/21.)

--

___
Python tracker 

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



[issue37666] urllib.requests.urlopen doesn't support cadata=

2019-07-23 Thread Gregory P. Smith


New submission from Gregory P. Smith :

The underlying 
https://docs.python.org/3/library/ssl.html#ssl.SSLContext.load_verify_locations 
API supports cafile, capath and cadata.

urlopen() only offers up cafile and capath.  It should also support cadata for 
completeness.

This matters for applications that embed their root certificate pem as data.  
Requiring the user to write that to a file or ship that as a file just so the 
library can read it rather than passing it in as a string is gross.

Lets add cadata support to urlopen().

--
assignee: christian.heimes
components: Library (Lib), SSL
messages: 348359
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.requests.urlopen doesn't support cadata=
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37665] threading.TIMEOUT_MAX integer overflow on 32-bit builds with threading.Thread.join

2019-07-23 Thread Arun Sharma


New submission from Arun Sharma :

threading's TIMEOUT_MAX constant causes overflows when used as the timeout for 
threading.Thread.join on a 32-bit platform, like a Raspberry PI running 
Raspbian (2019-07-10-raspbian-buster).

The underlying code uses sem_timedwait.  The timespec on this platform resolves 
seconds to a 32-bit integer, adding the current time to the timeout to get a 
deadline.


>>> import threading
>>> threading.TIMEOUT_MAX
9223372036.0


The deadline is larger than the int32 UNIX Epoch and results in an overflow.

Just changing the threading.TIMEOUT_MAX to be based on the time left until the 
UNIX Epoch would require changing the timeout over the duration of the program 
and would not be very viable as the Epoch gets closer.

--
files: timeout_max_32_bit.py
messages: 348358
nosy: Arun Sharma
priority: normal
severity: normal
status: open
title: threading.TIMEOUT_MAX integer overflow on 32-bit builds with 
threading.Thread.join
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48501/timeout_max_32_bit.py

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer


Aaron Meurer  added the comment:

Well paradoxically, the bugs that this prevents are the ones it doesn't warn 
about. If someone writes '\tan(x)' thinking it is a string representing a LaTeX 
formula for the tangent of x, they won't realize that they actually created a 
string with a tab plus "an(x)". So actually I would argue that the end goal 
*is* to make people aware of which escape characters exist, or at the very 
least, always make strings raw if there's even the remotest chance they will 
contain a backslash character. 

Is it the best way to go about this? I don't know. The whole thing sort of 
makes me think raw strings should have been the default, but it's obviously too 
late to change that. 

I personally don't feel strongly about the warnings being enabled by default or 
not. My big gripe is that if you actually want the warnings they are difficult 
to get in a reproducible way. I'm actually surprised they are so annoying for 
you. Once a py file is compiled into a pyc file the warnings completely 
disappear, even if you want them!

The fact that you can't use a real escape sequence in a raw string is annoying 
but not the end of the world given that it's trivial to concatenate strings.

--

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-23 Thread Steve Dower


New submission from Steve Dower :

Can we have a newer bundled version of pip for 3.8/3.9?

In particular, I'd really like to be able to use the new location for a pip.ini 
inside of sys.prefix, as it will fix the problems with "python3 -m pip" on 
Windows when obtained from the Store (and we want to default to --user).

--
messages: 348356
nosy: Marcus.Smith, dstufft, ncoghlan, paul.moore, steve.dower
priority: normal
severity: normal
status: open
title: Update bundled pip and setuptools
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37663] Making venv activation script prompts consistent

2019-07-23 Thread Brett Cannon


Change by Brett Cannon :


--
dependencies: +Drop support for Aspen magic directories in venv's activate 
scripts, venv activation scripts erroneously check if __VENV_PROMPT__ is defined

___
Python tracker 

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



[issue37663] Making venv activation script prompts consistent

2019-07-23 Thread Brett Cannon


New submission from Brett Cannon :

There are five activation scripts and they are all do things differently when 
it comes to prompt manipulation. Standardizing on one set of semantics would 
probably be good for consistency and so people know what to expect regardless 
of their shell.

Currently the various semantics are as follows (see subdirectories in 
https://github.com/python/cpython/tree/master/Lib/venv/scripts for the code):

- PowerShell: use __VENV_PROMPT__, make it green
- bash: use __VENV_PROMPT__ if defined (which is nearly true; bpo-37661), else 
if virtual env in a directory named "__" (for some defunked software named 
Aspen; bpo-37660) then use "[dir]", else "(dir)"
- Command Prompt: use __VENV_PROMPT__
- csh: use __VENV_NAME__ if defined, else calculate name and use "[dir]"
- fish: same as bash, except if not using __VENV_PROMPT__ then use white text 
on a blue background

So the variances/questions are:
1. Always use __VENV_PROMPT__ and don't bother testing? (bpo-37661 suggests we 
should, or else come up with a new way to tell whether a custom prompt was 
provided)
2. Always use colour regardless of whether the prompt is custom? (I vote "yes"; 
don't care about what the colours happen to be)
3. Parentheses or square brackets? (Due to bpo-37661 I vote for parentheses 
since that's what people are used to)

--
components: Library (Lib)
messages: 348355
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
status: open
title: Making venv activation script prompts consistent
type: behavior

___
Python tracker 

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



[issue37663] Making venv activation script prompts consistent

2019-07-23 Thread Brett Cannon


Change by Brett Cannon :


--
priority: normal -> low

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> Raymond, are you in agreement that these warnings should 
> at some point eventually become syntax errors?

I used to think so, but after experiencing the incessant warnings, I question 
the value.  In inactive sessions (either with the regular REPL or the ipython 
REPL), they are a recurring annoyance that interferes with data exploration 
live demos.  Perhaps, this should be left for a lint or code analysis tool.  
Why should we intentionally break code that is currently working fine.

Another issue that I've encountered is that ASCII art becomes gets flagged.  
Switching to a raw string then kills the unicode escape sequences.

This isn't really a "Raymond doesn't like this" concern.  I think anyone who 
starts using 3.8 on a daily basis for non-toy examples will constantly run into 
this.  Possibly, it catches a real error, but most often it will just be a 
recurring distractor, especially when teaching Python.  All instructors and 
runners of live demos will need to memorize exactly which characters require an 
escape and which don't -- it creates a new burden that didn't exist before.  
And if the source of the problem is in an external library, the result is 
unactionable by the user, merely making their experience unpleasant.

--

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset aee260f1c4d32bf67edec209d949294d4dc403c1 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.7':
bpo-29446: IDLE -- add explicit imports (GH-14919) (#14921)
https://github.com/python/cpython/commit/aee260f1c4d32bf67edec209d949294d4dc403c1


--

___
Python tracker 

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



[issue37662] Document venv.EnvBuilder.upgrade_dependencies()

2019-07-23 Thread Brett Cannon


New submission from Brett Cannon :

The upgrade_deps parameter to EnvBuilder exists and venv.EnvBuilder.create() 
calls self.upgrade_dependencies(), but that method isn't documented anywhere.

--
messages: 348352
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
status: open
title: Document venv.EnvBuilder.upgrade_dependencies()

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset fc63d5a361f7d20282019cad84336a242c124267 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.8':
bpo-29446: IDLE -- add explicit imports (GH-14919) (GH-14920)
https://github.com/python/cpython/commit/fc63d5a361f7d20282019cad84336a242c124267


--

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14695
pull_request: https://github.com/python/cpython/pull/14921

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset c6fd6c83b70df76421d05a7628367e64a2f83589 by Terry Jan Reedy in 
branch 'master':
bpo-29446: IDLE -- add explicit imports (GH-14919)
https://github.com/python/cpython/commit/c6fd6c83b70df76421d05a7628367e64a2f83589


--

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14694
pull_request: https://github.com/python/cpython/pull/14920

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +14693
pull_request: https://github.com/python/cpython/pull/14919

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Aaron Meurer


Aaron Meurer  added the comment:

Raymond, are you in agreement that these warnings should at some point 
eventually become syntax errors?

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

AFAICT, I'm currently one of the only people in the world using the 3.8 beta 
for my work on a daily basis.  I've encountered these warnings multiple times 
in multiple contexts.  If we think other people won't experience this recurring 
annoyance, we're in denial.

The entire point of beta testing is to discover problems like this.  However, 
the participants in this thread seem inclined to ignore the evidence and 
persist with the idea that inflicting this on users makes the language better.  
Respectfully, I disagree.

--

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm starting to see this error even for plain text strings in existing code:

>>> dunder_methods = '''

d[k]  d.__getitem__(k) -> value 
   \--> d.__missing__(k) -> value
\---> raise KeyError(k)
d[k] = v  d.__setitem__(k, v) -> None
del d[k]  d.__delitem__(k) -> None

'''

SyntaxError: invalid escape sequence \-


These not easily suppressed messages are really annoying.  We don't have to 
inflict this on our users.  IMO, this is the least user friendly change to 
Python 3.8 and as far as I can tell, it is entirely unnecessary (we've lived 
without it for 28+ years).

--

___
Python tracker 

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



[issue37660] Drop support for Aspen magic directories in venv's activate scripts

2019-07-23 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue37661] venv activation scripts erroneously check if __VENV_PROMPT__ is defined

2019-07-23 Thread Brett Cannon


New submission from Brett Cannon :

If you look at 
https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L112-L113 
you will see that the prompt context for a virtual environment is always set. 
Then if you look at the string substitutions for the activation scripts you 
will also see that the string substitution for __VENV_PROMPT__ is thus always 
done.

This is an issue as it means that for the fish and bash activation scripts they 
have erroneous checks for custom prompts. I.e. 
https://github.com/python/cpython/blob/master/Lib/venv/scripts/posix/activate.fish#L55
 for fish and 
https://github.com/python/cpython/blob/master/Lib/venv/scripts/common/activate#L57
 for bash will never fail, halting any other further checks unless one creates 
a custom EnvBuilder class which will make sure the prompt context stays empty 
all the way to string substitution. This impacts the colouring of the prompt in 
fish as that's only done if there is no default prompt (which is never true).

--
components: Library (Lib)
messages: 348346
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
status: open
title: venv activation scripts erroneously check if __VENV_PROMPT__ is defined
type: behavior

___
Python tracker 

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



[issue37660] Drop support for Aspen magic directories in venv's activate scripts

2019-07-23 Thread Brett Cannon


Brett Cannon  added the comment:

And this code and comment exists outside of just the bash activation script: 
https://github.com/python/cpython/blob/master/Lib/venv/scripts/posix/activate.fish#L62

--
title: Drop support for Aspen magic directories in venv's activate script -> 
Drop support for Aspen magic directories in venv's activate scripts

___
Python tracker 

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



[issue37660] Drop support for Aspen magic directories in venv's activate script

2019-07-23 Thread Brett Cannon


New submission from Brett Cannon :

Or at least update the comment as the URL at 
https://github.com/python/cpython/blob/master/Lib/venv/scripts/common/activate#L62
 is a 404 and the domain seems to be a news site in Asia now 
(http://www.zetadev.com/).

--
components: Library (Lib)
messages: 348344
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Drop support for Aspen magic directories in venv's activate script
type: enhancement

___
Python tracker 

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



[issue37659] subprocess.list2cmdline() should not escape wrapping single/double quotes

2019-07-23 Thread Eryk Sun


Eryk Sun  added the comment:

The behavior of list2cmdline with double quotes is intentional. It supports 
passing literal quote characters in the command line for applications that use 
VC++ argv parsing, WINAPI CommandLineToArgvW, or in general any application 
that adheres to these rules when parsing its command line [1]. (Not all do -- 
such as cmd.exe -- in which case we have to pass a custom command line instead 
of relying on listcmdline.) 

If we have a command line already, then generally the best thing to do in 
Windows is pass it as is. Don't split it and rebuild it via list2mdline.

The problem I see is using shlex.split in Windows. posix=False doesn't  mean it 
can handle Windows command lines properly. The shlex module is meant to 
tokenize a command line like a Unix shell. With posix=False, quote characters 
aren't stripped out, i.e. it preserves the double quotes in '"spam"'. But with 
posix=True it's just as wrong for Windows because it tokenizes "'spam & eggs'" 
as ['spam & eggs']. This is wrong because single quotes generally have no 
special meaning in Windows command lines (certainly not for CreateProcessW, 
CommandLineToArgvW, and VC++ argv handling). They should be retained as literal 
characters. Thus the proper result in Windows is "'spam & eggs'" -> ["'spam", 
'&', "eggs'"].

[1]: https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments

--
nosy: +eryksun

___
Python tracker 

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



[issue37659] subprocess.list2cmdline() should not escape wrapping single/double quotes

2019-07-23 Thread James Xu


New submission from James Xu :

While working on our project, we have noticed that for 
`subprocess.Popen(command, ...)`, when `command` is a string that contains 
escaped double quote, for example, `command = '"path to executable" --flag 
arg'`, this works fine. However, when command is changed to 
`shlex.split(command, posix=False)`, the Popen command fails. Looking a bit 
into the source code, it seems that for the command above,

```
>>> shlex.split('"path to executable" --flag arg', posix=False)
['"path to executable"', '--flag', 'arg']
```

and when this array of strings gets passed into `Popen`, the escaped double 
quote gets escaped again, since `subprocess.list2cmdline` does not check if a 
pair of double quote or single quote are wrapping the entire string `arg`. And 
this is the same behavior for both py2 and py3, 
https://github.com/python/cpython/blob/master/Lib/subprocess.py#L508. As a 
result, upon execution the command becomes, `'"\\"path to executable\\"" --flag 
arg'`

example:
```
>>> sp.list2cmdline(['"do things"'])
'"\\"do things\\""'
>>> sp.list2cmdline(['do things'])
'"do things"'
>
```

--
components: Windows
messages: 348342
nosy: kejxu, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: subprocess.list2cmdline() should not escape wrapping single/double quotes
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue37656] Can't pip install because of bisect_left

2019-07-23 Thread Brett Cannon


Brett Cannon  added the comment:

I'm going to close this as this is more likely an Anaconda or path problem than 
a CPython problem. But as Raymond said, chances are you have some other file 
named bisect on your sys.path.

--
nosy: +brett.cannon
resolution:  -> third party
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



[issue37639] What happened to StreamReaderProtocol?

2019-07-23 Thread Aymeric Augustin


Change by Aymeric Augustin :


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



[issue37468] Don't install wininst*.exe on non-Windows platforms

2019-07-23 Thread Ned Deily


Ned Deily  added the comment:

The merged PR broke "make libinstall" and, hence, "make install" with at least 
some versions of make.  See Issue37653.

--
nosy: +ned.deily

___
Python tracker 

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



[issue37653] make install fails

2019-07-23 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PR!

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

___
Python tracker 

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



[issue37653] make install fails

2019-07-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset 387c3c5a04bc62cfa7c9dabe206ba2c582a71c05 by Ned Deily (Erlend 
Egeberg Aasland) in branch 'master':
bpo-37653: Fix libinstall target in Makefile (GH-14911)
https://github.com/python/cpython/commit/387c3c5a04bc62cfa7c9dabe206ba2c582a71c05


--

___
Python tracker 

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



[issue37653] make install fails

2019-07-23 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2019-07-23 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue30237] Access violation due to CancelSynchronousIo of console read

2019-07-23 Thread Steve Dower


Steve Dower  added the comment:

Yep, thanks for the ping!

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

___
Python tracker 

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



[issue37587] JSON loads performance improvement for long strings

2019-07-23 Thread Steve Dower


Steve Dower  added the comment:

Marco has a newer patch with better performance that we came up with at the 
sprints, but apparently it hasn't been pushed yet. Hopefully he'll get that up 
soon and we can review it instead - the current PR wasn't as reliably good as 
initial testing suggested.

--
versions: +Python 3.8

___
Python tracker 

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



[issue37657] ERROR: grip 4.5.2 requires docopt>=0.4.0, which is not installed.

2019-07-23 Thread Ned Deily


Ned Deily  added the comment:

Sorry, I have no idea why you saw those messages. Neither grip nor docopt are 
used directly by the python.org macOS installer and, after a quick glance, I 
didn't see anywhere where the certifi package used them.  Did you have an 
earlier alpha or beta version of 3.8.0 installed along with third-party 
packages (via python3.8 -m pip install, for example)?  Unless you can show how 
to reproduce this behavior, there is little we can do about it.

--
status: open -> pending

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Tal Einat


Tal Einat  added the comment:

PR Merged! This will be in 3.8.0 and 3.7.5. Thanks to everyone who worked on 
this and took part in the discussion!

Special thanks to Saimadhav for preparing a patch and iterating on it several 
times; I picked up the work from where he left off, and it was a great starting 
point.

Special thanks also to Terry for stewarding the development of IDLE in general, 
and for working with me actively on the PR for this over the past month and a 
half.

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

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Tal Einat


Tal Einat  added the comment:


New changeset e9ec1663d8fa0b3829add14e784107482af8dacb by Tal Einat in branch 
'3.7':
[3.7] bpo-17535: IDLE editor line numbers (GH-14030)
https://github.com/python/cpython/commit/e9ec1663d8fa0b3829add14e784107482af8dacb


--

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +14692
pull_request: https://github.com/python/cpython/pull/14917

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 1da6a313ddaa269dddce303cb03ca95fe57d0c85 by Miss Islington (bot) 
in branch '3.8':
bpo-17535: IDLE editor line numbers (GH-14030)
https://github.com/python/cpython/commit/1da6a313ddaa269dddce303cb03ca95fe57d0c85


--
nosy: +miss-islington

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread Tal Einat


Tal Einat  added the comment:


New changeset 7123ea009b0b004062d91f69859bddf422c34ab4 by Tal Einat in branch 
'master':
bpo-17535: IDLE editor line numbers (GH-14030)
https://github.com/python/cpython/commit/7123ea009b0b004062d91f69859bddf422c34ab4


--

___
Python tracker 

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



[issue17535] IDLE editor line numbers

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14691
pull_request: https://github.com/python/cpython/pull/14916

___
Python tracker 

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



[issue37639] What happened to StreamReaderProtocol?

2019-07-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Hi. StreamReaderProtocol was leaked implementation detail, not a public 
reusable class. The protocol has too many "gray zones" where its implementation 
is not well defined or even wrong. 

This situation prevents us from stream API improvements which require changing 
these implementation details. Keeping full backward compatibility literally 
means doubling source code, it makes no sense for "private" API but adds a huge 
maintenance burden.

We are striving to remove it from public API step by step: 
documentation-deprecation-removal.

If you really need the class -- please copy-paste the source lines into your 
project and use the copy on your own.

--

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2019-07-23 Thread Nikita Ilyasov


Nikita Ilyasov  added the comment:

server example: https://gist.github.com/hexrain/bc92aa70eebc229365f0ce4bcccf7fc4

--

___
Python tracker 

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



[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2019-07-23 Thread Nikita Ilyasov

New submission from Nikita Ilyasov :

In some cases `asyncio.wait_for` can lead to socket leak.

Condensed example:

```python
async def _create_connection(timeout=60, ssl_obj):
loop = asyncio.get_event_loop()
connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000, 
ssl=ssl_obj)
connector = asyncio.ensure_future(connector)
tr, pr = await asyncio.wait_for(connector, timeout=timeout, loop=loop)
return tr, pr

async def main():
...
res = await asyncio.wait_for(_acquire_impl(), timeout=timeout, loop=loop)

```

If my understanding is correct `wait_for` should work in exactly 2 ways

1. the inner task is completed and the outer task will receive the result – 
transport and protocol in this case
2. The inner task is cancelled and no connection was established

I provided source code for client and server so the problem can be easily 
reproduced on your system.

certificate and key can be easily generated with `minica`


I found out that if I catch `CancelledError` and add a `done_callback` to the 
inner task, like so:

```python
try:
tr, pr = await asyncio.wait_for(connector, timeout=timeout, loop=loop)
return tr, pr
except asyncio.CancelledError as e:
connector.add_done_callback(_done_callback)
raise e
```
then inside of `_done_callback` I can access the transport and protocol object 
and close the transport manually to prevent leaking.


I run `netstat -a | grep 5000 | grep ESTAB | awk '{ print $5 }' | sort | uniq 
-c | grep 5000` after the script is done and there are many unclosed 
connections.

The output depends on your hardware so you might need to tweak the timeout 
parameter

--
components: asyncio
files: example.py
messages: 348328
nosy: Nikita Ilyasov, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: In some cases asyncio.wait_for can lead to socket leak.
type: resource usage
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48500/example.py

___
Python tracker 

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



[issue36974] Implement PEP 590

2019-07-23 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset bf8e82f976b37856c7d35cdf88a238cb6f57fe65 by Łukasz Langa (Jeroen 
Demeyer) in branch '3.8':
[3.8] bpo-36974: separate vectorcall functions for each calling convention 
(GH-13781) (#14782)
https://github.com/python/cpython/commit/bf8e82f976b37856c7d35cdf88a238cb6f57fe65


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2019-07-23 Thread Mickaël Schoentgen

Change by Mickaël Schoentgen :


--
nosy: +Tiger-222

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 28815e0e2c904644660d29995cdfbb65f67e4a1d by Miss Islington (bot) 
in branch '3.7':
bpo-33610: validate non-negative integer inputs in IDLE's config (GH-14822)
https://github.com/python/cpython/commit/28815e0e2c904644660d29995cdfbb65f67e4a1d


--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-23 Thread miss-islington


miss-islington  added the comment:


New changeset 5dab5e7d24c790d54b8d1eca0568e798bfda2c68 by Miss Islington (bot) 
in branch '3.8':
bpo-33610: validate non-negative integer inputs in IDLE's config (GH-14822)
https://github.com/python/cpython/commit/5dab5e7d24c790d54b8d1eca0568e798bfda2c68


--

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14689
pull_request: https://github.com/python/cpython/pull/14913

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14690
pull_request: https://github.com/python/cpython/pull/14914

___
Python tracker 

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



[issue33610] IDLE: Make multiple improvements to CodeContext

2019-07-23 Thread Tal Einat


Tal Einat  added the comment:


New changeset 1ebee37dde5c2aabc8e2d2c7bbe2a69b293133bb by Tal Einat in branch 
'master':
bpo-33610: validate non-negative integer inputs in IDLE's config (GH-14822)
https://github.com/python/cpython/commit/1ebee37dde5c2aabc8e2d2c7bbe2a69b293133bb


--

___
Python tracker 

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



[issue37544] Test hang causes --enable-optimizations build to hang

2019-07-23 Thread Jarek Zgoda


Jarek Zgoda  added the comment:

Thank you for the information.

The build system is standard Ubuntu 18.04.2 and openssl is system provided. I 
will try to build Python against other openssl versions, as well against 
libressl.

--

___
Python tracker 

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