[issue18930] os.spawnXX functions terminates process if second argument is empty list

2020-01-06 Thread Stefan Schukat


Stefan Schukat  added the comment:

@Batuhan the error does not appear anymore in at least Python 3.6.1
>>> import os
>>> nPath = os.path.join(os.environ["windir"], "notepad.exe")
>>> os.spawnv(os.P_NOWAIT, nPath, []) # or os.spawnv(os.P_NOWAIT, nPath, [], {})
Traceback (most recent call last):
  File "", line 1, in 
ValueError: spawnv() arg 2 cannot be empty

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2020-01-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> I think it would be a mistake to make the stdlib use this for most 
> notions of what a "character" is, as I said this notion is also 
> inaccurate. Having an iterator library somewhere that you can use and 
> compose is great, changing the internal workings of string operations 
> would be a major change, and not entirely productive.

Agreed. 

I won't pretend to be able to predict what Python 5.0 will bring *wink* 
but there's too much history around the "code point = character" notion 
for the language to change now.

If the language can expose a grapheme iterator, then people can 
experiment with grapheme-based APIs in libraries.

(By grapheme I mean "extended grapheme cluster", but that's a mouthful. 
Sorry linguists.)

What do you think of these as a set of grapheme primitives?

(1) is_grapheme_break(string, i)

Return True if a grapheme break would occur *before* string[i].

(2) graphemes(string, start=0, end=len(string))

Iterate over graphemes in string[start:end].

(3) graphemes_reversed(string, start=0, end=len(string))

Iterate over graphemes in reverse order.

I *think* is_grapheme_break would be enough for people to implement 
their own versions of graphemes and graphemes_reversed. Here's an 
untested version:

def graphemes(string, start, end):
cluster = []
for i in range(start, end):
c = string[i]
if is_grapheme_break(string, i):
if i != start:
# don't yield the empty cluster at Start Of Text
yield ''.join(cluster)
cluster = [c]
else:
cluster.append(c)
if cluster:
yield ''.join(cluster)

Regarding is_grapheme_break, if I understand the note here:

https://www.unicode.org/reports/tr29/#Testing

one never needs to look at more than two adjacent code points to tell 
whether or not a grapheme break will occur between them, so this ought 
to be pretty efficient. At worst, it needs to look at string[i-1] and 
string[i], if they exist.

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2020-01-06 Thread Manish


Manish  added the comment:

> one never needs to look at more than two adjacent code points to tell 
whether or not a grapheme break will occur between them, so this ought 
to be pretty efficient. 


That note is outdated (and has been outdated since Unicode 9). The regional 
indicator rules (GB12 and GB13) and the emoji rule (GB11) require arbitrary 
lookbehind (though thankfully not arbitrary lookahead).

I think the ideal API surface is an iterator and nothing else. Everything else 
can be derived from the iterator. It's theoretically possible to expose an 
is_grapheme_break that's faster than just iterating -- look at the code in 
unicode-segmentation's _reverse_ iterator to see how -- but it's going to be 
tricky to get right. Building the iterator on top of is_grapheme_break is not a 
good idea.

--

___
Python tracker 

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



[issue38599] Deprecate creation of asyncio object when the loop is not running

2020-01-06 Thread Joongi Kim


Joongi Kim  added the comment:

It is also generating deprecation warning:

> /opt/python/3.8.0/lib/python3.8/asyncio/queues.py:48: DeprecationWarning: The 
> loop argument is deprecated since Python 3.8, and scheduled for removal in 
> Python 3.10.
>   self._finished = locks.Event(loop=loop)

--
nosy: +achimnol

___
Python tracker 

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



[issue38623] Python documentation should mention how to find site-packages

2020-01-06 Thread Peter Bittner


Peter Bittner  added the comment:

There is a specific question this change attempts to answer: "Where is the 
module I imported located in the file system?"

I suspect this comes up a lot because developers want to inspect or mess with 
installed modules, add debug output and the like, to understand some of their 
development issues better.

The site module documentation explains the details.[3] The paragraph the change 
adds links to that documentation. That should be sufficient (for a tutorial); 
other technical details probably fit well in the document being linked to.

[3] https://docs.python.org/3/library/site.html#site.getusersitepackages

I tried to keep it concise, adding value with a quick glance over the `site` 
module features that relate to the module paths topic.

--

___
Python tracker 

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



[issue38623] Python documentation should mention how to find site-packages

2020-01-06 Thread Inada Naoki


Inada Naoki  added the comment:

> There is a specific question this change attempts to answer: "Where is the 
> module I imported located in the file system?"

So `print(the_module.__file__)` is better answer.  (or `pip list -v` if the 
module is third party package installed via pip).

`python -m site` doesn't tell you where the imported module came from.



> [3] https://docs.python.org/3/library/site.html#site.getusersitepackages

After merging PR 17858, you can use :ref:`site-commandline` for cross reference.

--

___
Python tracker 

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



[issue39212] Show qualified function name when giving arguments error

2020-01-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Sun, Jan 05, 2020 at 10:32:26PM +, Ram Rachum wrote:
[...]
> TypeError: __init__() takes 2 positional arguments but 3 were given
> 
> As you can see, it's pretty simple to get this exception text, so I'm not 
> sure why you didn't get that text. 

But I *did* get that text. I'm asking how you got the *different* text 
which you gave in your initial request.

Firstly, you stated that you got the fully-qualified exception type:

builtins.TypeError

rather than just TypeError, which was my question. How did you get the 
fully-qualified exception class?

Secondly you quoted the error message:

__init__() takes 1 positional argument but 2 were given

which is what I get in 3.5 using `def __init__(self)`, but in 3.8 it 
gives a different message "MyClass() takes no arguments".

I'm not worried about the error message discrepency, since that's 
irrelevant to your enhancement request, and easily explained if you were 
quoting from an older version of Python. But I don't know how you got 
the `builtins.TypeError` fully-qualified part. That is the part I'm 
asking about.

> Regarding you saying it's more annoying than useful: Especially for 
> methods such as `__init__`, it's often difficult to understand which 
> class is being instantiated, especially in a complex codebase.

I agree with you that there are occasions where this could be difficult. 
Apart from the "no source code" case, I can see that might be the case 
if the failing line is a complex expression like this:

do_things(Spam(arg)[Eggs(None)] + Cheese(Aardvark(thingy)))

and you don't know which of Spam, Eggs, Cheese or Aardvark has failed. 
Or in an expression like this:

lookup_class['some key'](arg)

where the source is only an indirect reference to the class you want.

But in my experience, the great bulk of calls to classes (apart from 
simple "atomic" values like int, float, str, etc) stand alone:

obj = MyClass(arg)

and there is no difficulty in telling which class has the problem.

In my experience, I would say > 90% easy cases and < 10% tricky cases. 
(YMMV.)

So in my opinion, and I recognise that you may disagree, this is only of 
benefit in a minority of cases. For the majority of cases, it will only 
be additional noise in the message that adds nothing that wasn't already 
obvious from the source line.

And in particular, beginners are often intimidated by error messages, 
and the longer the error message, the more they are intimidated. In that 
case, `TypeError: __init__ ...` is shorter and therefore less scary than 
`builtins.TypeError: package.some_module.MyClass.__init__ ...`.

So I'm not disputing that this will be useful *sometimes*. I'm just 
trying to weigh up the cons of longer, more complex error messages 
with redundant information versus the occasional cases where the 
information is helpful.

--

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I bisected this to this commit:

995d9b92979768125ced4da3a56f755bcdf80f6e is the first bad commit
commit 995d9b92979768125ced4da3a56f755bcdf80f6e
Author: Anthony Sottile 
Date:   Sat Jan 12 20:05:13 2019 -0800

bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens 
(GH-10021)

 Lib/test/test_ast.py   | 19 +
 Lib/test/test_fstring.py   | 32 +-
 Lib/test/test_opcodes.py   |  2 +-
 Lib/test/test_string_literals.py   |  8 +++---
 Misc/ACKS  |  1 +
 .../2018-10-20-18-05-58.bpo-16806.zr3A9N.rst   |  1 +
 Parser/parsetok.c  | 15 --
 Parser/tokenizer.c |  7 +
 Parser/tokenizer.h |  5 
 Python/ast.c   | 10 +--
 Python/importlib.h | 16 +--
 Python/importlib_external.h| 18 ++--
 Python/importlib_zipimport.h   |  8 +++---
 13 files changed, 91 insertions(+), 51 deletions(-)
 create mode 100644 Misc/NEWS.d/next/Core and 
Builtins/2018-10-20-18-05-58.bpo-16806.zr3A9N.rst

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This commit seems to generate some warnings in the nested run_until_complete 
test. The check for running loop is now done at run_until_complete itself 
before going through the below code in it to create a future and raised a 
RuntimeError by run_forever as the test used to do. Not sure why CI doesn't 
have these warnings.

PYTHONWARNINGS=always ./python.exe -m test test_asyncio -m 
test_run_until_complete_nesting
0:00:00 load avg: 2.16 Run tests sequentially
0:00:00 load avg: 2.16 [1/1] test_asyncio
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: 
coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting..coro1' 
was never awaited
  tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: 
coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting..coro1' 
was never awaited
  tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/Users/kasingar/stuff/python/cpython/Lib/traceback.py:220: RuntimeWarning: 
coroutine 'EventLoopTestsMixin.test_run_until_complete_nesting..coro1' 
was never awaited
  tb.tb_frame.clear()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

== Tests result: SUCCESS ==

1 test OK.

Total duration: 164 ms
Tests result: SUCCESS

--
nosy: +xtreak

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39190] _result_handler dies on raised exceptions [multiprocessing]

2020-01-06 Thread Sindri Guðmundsson

Change by Sindri Guðmundsson :


--
type: behavior -> crash

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Dong-hee Na


Dong-hee Na  added the comment:

@pablogsal

Works correct with PR 17860 :)


Python 3.9.0a2+ (heads/pr/17860:958541d67c, Jan  6 2020, 20:45:49)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = """
... 
... 
... 
... 
... 0KiB
... 0
... 1.3
... 0
... 
... 
... 16738211KiB
... 237.15
... 1.3
... 0
... 
... never
... none
... 
... 
... 
... """
>>> a
'\n\n\n
\n\n0KiB\n
0\n1.3\n
0\n\n\n 
   16738211KiB\n237.15\n
1.3\n0\n  
  \nnever\n 
   none\n\n
\n\n'
>>>

--

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks for the report!

--

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-06 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Ooh, you are right.
The warning is printed only, test runner thinks that the test is ok.
I'll prepare a quick fix.

--
assignee:  -> asvetlov
status: closed -> open

___
Python tracker 

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



[issue39191] Coroutine is awaited despite an exception in run_until_complete()

2020-01-06 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +17280
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/17863

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 5ed9d60bc53e2eb0a88f07d5afe5299acdc0b216 by Jason R. Coombs (Miss 
Islington (bot)) in branch '3.8':
bpo-38907: In http.server script, restore binding to IPv4 on Windows. 
(GH-17851) (#17854)
https://github.com/python/cpython/commit/5ed9d60bc53e2eb0a88f07d5afe5299acdc0b216


--

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +17281
pull_request: https://github.com/python/cpython/pull/17864

___
Python tracker 

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



[issue18930] os.spawnXX functions terminates process if second argument is empty list

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing as this also does not happen anymore on master as well.

--
nosy: +pablogsal
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



[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-06 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

I don't have a particularly deep opinion on what should be done, just a bit of 
weirdness I hit upon while implementing the PEP in PyPy. fwiw, we implement it 
as an AST transformer that the compiler runs before running the optimizer to 
make sure that the AST optimizations don't get applied to annotions. The 
transformer replaces all annotations with a Constant ast node, containing the 
unparsed string.

--

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17282
pull_request: https://github.com/python/cpython/pull/17865

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 7cdc31a14c824000cbe8b487900c9826a33f6940 by Jason R. Coombs in 
branch 'master':
bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864)
https://github.com/python/cpython/commit/7cdc31a14c824000cbe8b487900c9826a33f6940


--

___
Python tracker 

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



[issue39200] Fix inaccurate TypeError messages when calling with insufficient arguments

2020-01-06 Thread Dong-hee Na


Dong-hee Na  added the comment:

@pablogsal 
PR 17813 is merged. 
If you don't mind, can we review PR 17814 that will be applied or not?

--

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 33cb4a62bf6848093b7a05c9794582d204798b1b by Jason R. Coombs (Miss 
Islington (bot)) in branch '3.8':
bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864) 
(GH-17865)
https://github.com/python/cpython/commit/33cb4a62bf6848093b7a05c9794582d204798b1b


--

___
Python tracker 

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



[issue38907] http.server (command) fails to bind dual-stack on Windows

2020-01-06 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In PR 17378, we discussed and I believe the conclusion is that the fix in the 
other PR(s) is sufficient to address the deficiency.

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



[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-01-06 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

>> I don't have a particularly deep opinion on what should be done, just a bit 
>> of weirdness I hit upon while implementing the PEP in PyPy. fwiw, we 
>> implement it as an AST transformer that the compiler runs before running the 
>> optimizer to make sure that the AST optimizations don't get applied to 
>> annotions. The transformer replaces all annotations with a Constant ast 
>> node, containing the unparsed string.


I have given it a try in PR 17866 and it was not as invasive as I imagine, so 
if Łukasz agrees, we can go ahead :)

--

___
Python tracker 

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



[issue25872] multithreading traceback KeyError when modifying file

2020-01-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Michael, reopening. I was wrong while trying the reproducer since map is 
lazy in Python 3 and threads were not executed.

--
resolution: wont fix -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.9 -Python 2.7

___
Python tracker 

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



[issue34480] _markupbase.py fails with UnboundLocalError on invalid keyword in marked section

2020-01-06 Thread Ezio Melotti


Ezio Melotti  added the comment:

I think so.
It might be worth double-checking if BeautifulSoup (and possibly other 3rd 
party libs) use _markupbase.py and/or ParserBase.error().  If they do, giving 
them a heads up and/or going through a regular deprecation process might be 
good, otherwise PR 8562 can be reopened and merged after removing the call to 
self.error() in ParserBase.parse_marked_section().

--

___
Python tracker 

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



[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread mmckerns


New submission from mmckerns :

In Lib/datetime.py, there's an import: `from _datetime import *`
which will fail if `_datetime.py` exists in the current directory, or earlier 
in the path than Lib.  For reference, see:
https://github.com/numpy/numpy/issues/15257

--
components: Library (Lib)
messages: 359429
nosy: mmckerns
priority: normal
severity: normal
status: open
title: fail on datetime import if _datetime.py exists in PATH
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



[issue39212] Show qualified function name when giving arguments error

2020-01-06 Thread Ram Rachum


Ram Rachum  added the comment:

> But I *did* get that text. I'm asking how you got the *different* text 
> which you gave in your initial request.

Oh, right. Looking back, turns out Wing IDE did that for me. Didn't notice, 
sorry.

> So in my opinion, and I recognise that you may disagree, this is only of 
> benefit in a minority of cases. For the majority of cases, it will only 
> be additional noise in the message that adds nothing that wasn't already 
> obvious from the source line.

I understand your perspective.

One correction though regarding adding noise to the error. You gave this 
example:

builtins.TypeError: package.some_module.MyClass.__init__ takes 1 positional 
argument but 2 were given

While actually it'll be:

TypeError: MyClass.__init__ takes 1 positional argument but 2 were given

Since __qualname__ only includes the class, not its module. So it's quite a bit 
shorter.

--

___
Python tracker 

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



[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not a bug. You should not use the same module name, than a stdlib 
module. For example, if you have a "sys.py" file in your Python path 
(PYTHONPATH), you will get big troubles.

--
nosy: +vstinner
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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5ec91f78d59d9c39b984f284e00cd04b96ddb5db by Pablo Galindo in 
branch 'master':
bpo-39209: Manage correctly multi-line tokens in interactive mode (GH-17860)
https://github.com/python/cpython/commit/5ec91f78d59d9c39b984f284e00cd04b96ddb5db


--

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17284
pull_request: https://github.com/python/cpython/pull/17867

___
Python tracker 

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



[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

On my Fedora 31, epoll_event structure is defined in sys/epoll.h as:

typedef union epoll_data
{
  void *ptr;
  int fd;
  uint32_t u32;
  uint64_t u64;
} epoll_data_t;

struct epoll_event
{
  uint32_t events;  /* Epoll events */
  epoll_data_t data;/* User data variable */
} __EPOLL_PACKED;


I can reproduce the issue using this Python script:

import select
p = select.epoll()
p.register(1, select.EPOLLIN)
p.poll(0)

The Linux syscall is defined as:

asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
struct epoll_event __user *event);

It's implemented in fs/eventpoll.c:

https://github.com/torvalds/linux/blob/c79f46a282390e0f5b306007bf7b11a46d529538/fs/eventpoll.c#L2077-L2083

Valgrind complains that ev.data is only partially initialized: it's a 64-bit 
structure, but we only set ev.data.fd. I guess that the glibc implements 
epoll_ctl() as a raw system call: Valgrind is unable to know if it's ok to only 
partially initialize the epoll_data union.


Benjamin: "I suspect Valgrind is being too conservative. union epoll_data is 64 
bits wide but the file descriptor only occupies the first 32 bits. The last 32 
bits don't need to be initialized by the application."

Right. But Valgrind is not smart enough.

I see 2 options:

* Initialize ev.data to 0
* Use Misc/valgrind-python.supp to ignore this *false alarm*

--
nosy: +vstinner

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17285
pull_request: https://github.com/python/cpython/pull/17868

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17286
pull_request: https://github.com/python/cpython/pull/17869

___
Python tracker 

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



[issue35561] Valgrind reports Syscall param epoll_ctl(event) points to uninitialised byte(s)

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

> Initialize ev.data to 0

I dislike this option, since the code is legit: Valgrind produces a false alarm.

> Use Misc/valgrind-python.supp to ignore this *false alarm*

I prefer this option.

--

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset b2e281aaa2e4a1f24671d293dfd06b23bb052e47 by Miss Islington (bot) 
in branch '3.8':
bpo-39209: Manage correctly multi-line tokens in interactive mode (GH-17860)
https://github.com/python/cpython/commit/b2e281aaa2e4a1f24671d293dfd06b23bb052e47


--
nosy: +miss-islington

___
Python tracker 

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



[issue39209] Crash on REPL mode with long text copy and paste

2020-01-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset acf5e5f3f42a3d2985499df82331705edbe717be by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-39041: Add GitHub Actions support (GH-17594)
https://github.com/python/cpython/commit/acf5e5f3f42a3d2985499df82331705edbe717be


--

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0048833e1308d39dc9c6489da7872ade0f14486f by Steve Dower (Miss 
Islington (bot)) in branch '3.8':
bpo-39041: Add GitHub Actions support (GH-17594)
https://github.com/python/cpython/commit/0048833e1308d39dc9c6489da7872ade0f14486f


--

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset 7b79dc9200a19ecbac667111dffd58e314be02a8 by Steve Dower (Anthony 
Wee) in branch 'master':
bpo-29778: Fix incorrect NULL check in _PyPathConfig_InitDLLPath() (GH-17818)
https://github.com/python/cpython/commit/7b79dc9200a19ecbac667111dffd58e314be02a8


--

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread Steve Dower


Steve Dower  added the comment:

Thanks, Anthony! And congratulations on becoming a CPython contributor!

--

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread Steve Dower


Change by Steve Dower :


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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17287
pull_request: https://github.com/python/cpython/pull/17871

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset a9a43c221bf3896ed1d1c2eee2531b7121cf78e4 by Miss Islington (bot) 
in branch '3.8':
bpo-29778: Fix incorrect NULL check in _PyPathConfig_InitDLLPath() (GH-17818)
https://github.com/python/cpython/commit/a9a43c221bf3896ed1d1c2eee2531b7121cf78e4


--
nosy: +miss-islington

___
Python tracker 

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



[issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

Oops, I'm guilty of pushing this change! Sorry & thanks for the fix.

if (_Py_dll_path == NULL) {
/* Already set: nothing to do */
return _PyStatus_OK();
}

--

___
Python tracker 

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



[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread mmckerns


mmckerns  added the comment:

Sure, that's obvious for `datetime` and `sys`.  Less obvious for unexpected 
conflicts with stdlib modules that begin with an underscore...

--

___
Python tracker 

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



[issue39231] Mistaken notion in tutorial

2020-01-06 Thread Robert


New submission from Robert :

https://docs.python.org/3/tutorial/controlflow.html
4.7.8. Function Annotations
[...] "The following example has a positional argument, a keyword argument, and 
the return value annotated:"

It is not a "positional argument" but an "optional argument".

--
assignee: docs@python
components: Documentation
messages: 359443
nosy: docs@python, r0b
priority: normal
severity: normal
status: open
title: Mistaken notion in tutorial
type: enhancement

___
Python tracker 

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



[issue39226] venv does not include pythonXX.lib

2020-01-06 Thread Brett Cannon


Brett Cannon  added the comment:

When have you seen this work previously? On my Windows 10 machine there is no 
Scripts\libs directory for Python 3.7, let alone a python37.lib file in any 
directory that I can find.

--
nosy: +brett.cannon, vinay.sajip

___
Python tracker 

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



[issue39225] Python should warn when a global/local has the same name as a builtin

2020-01-06 Thread Brett Cannon


Brett Cannon  added the comment:

I agree with Eric that this is the realm of linters as there are legitimate 
reasons sometimes to mask and redefine built-ins.

Thanks for the idea, Reuven, but I'm closing the issue.

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



[issue39204] Automate adding Type Annotations to Documentation

2020-01-06 Thread Brett Cannon


Brett Cannon  added the comment:

I think a bigger thing is to simply get type annotations to be used in the 
stdlib first, then we can worry about documenting them as part of the API. :)

--
nosy: +brett.cannon

___
Python tracker 

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



[issue39221] Cross compiled python installed wrong version of lib2to3/Grammar pickle

2020-01-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue38623] Python documentation should mention how to find site-packages

2020-01-06 Thread Brett Cannon


Brett Cannon  added the comment:

I agree with Inada-san that pointing out how to get the file path on a module 
is a better solution then explaining directory layouts which are borderline 
implementation details.

--

___
Python tracker 

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



[issue39232] asyncio crashes when tearing down the proactor event loop

2020-01-06 Thread Michael Hall


New submission from Michael Hall :

When using asyncio.run for an asynchronous application utilizing ssl, on 
windows using the proactor event loop the application crashes when the loop is 
closed, completely skipping a finally block in the process.

This appears to be due to a __del__ method on transports used.

Manual handling of the event loop close while including a brief sleep appears 
to work as intended.

Both versions work fine with the selector event loop on linux.

This appears to be a somewhat known issue already, as it's been reported to 
aiohttp, however both the traceback, and the differing behavior seem to 
indicate this is an issue with the proactor event loop.

(On linux this still emits a resource warning without the sleep)

While I don't mind handling the loop cleanup, it seems like this case should 
also emit a resource warning rather than crashing.

If it's decided in which way this should be handled, I'm willing to contribute 
to or help test whatever direction the resolution for this should go. 

Traceback included below, toy version of the problem attached as code.

Exception ignored in: 
Traceback (most recent call last):
  File 
"C:\Users\Michael\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py",
 line 116, in __del__
self.close()
  File 
"C:\Users\Michael\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py",
 line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
  File 
"C:\Users\Michael\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py",
 line 715, in call_soon
self._check_closed()
  File 
"C:\Users\Michael\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py",
 line 508, in _check_closed   
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

--
components: asyncio
files: example.py
messages: 359448
nosy: asvetlov, mikeshardmind, yselivanov
priority: normal
severity: normal
status: open
title: asyncio crashes when tearing down the proactor event loop
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file48829/example.py

___
Python tracker 

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



[issue39204] Automate adding Type Annotations to Documentation

2020-01-06 Thread Guido van Rossum


Guido van Rossum  added the comment:

Actually I agree with the OP that we could get some mileage out of joining 
typeshed with the docs, regardless of whether there are annotations in the 
stdlib.

--

___
Python tracker 

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



[issue30717] Add unicode grapheme cluster break algorithm

2020-01-06 Thread Paul Ganssle


Paul Ganssle  added the comment:

> Oh, also, if y'all are fine with binding to Rust (through a C ABI) I'd love 
> to help y'all use unicode-segmentation, which is much less work that pulling 
> in ICU. Otherwise if y'all have implementation questions I can answer them. 
> This spec is kinda tricky to implement efficiently, but it's not super hard.

Is the idea here that we'd take on a new dependency on the compiled 
`unicode-segmentation` binary, rather than adding Rust into our build system? 
Does `unicode-segmentation` support all platforms that CPython supports? I was 
under the impression that Rust requires llvm and llvm doesn't necessarily have 
the same support matrix as CPython (I'd love to be corrected if I'm wrong on 
this).

(Note: I don't actually know what the process is for taking on new dependencies 
like this, just trying to point at one possible stumbling block.)

--

___
Python tracker 

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



[issue39233] glossary entry for parameter out-of-date for positional-only parameters

2020-01-06 Thread Mark Dickinson


New submission from Mark Dickinson :

The glossary entry for parameter[1] says:

> Python has no syntax for defining positional-only parameters.

Since PEP 570 landed in Python 3.8, that's no longer true.


[1] https://docs.python.org/3/glossary.html#term-parameter

--
assignee: docs@python
components: Documentation
messages: 359451
nosy: docs@python, mark.dickinson
priority: normal
severity: normal
status: open
title: glossary entry for parameter out-of-date for positional-only parameters
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



[issue39233] glossary entry for parameter out-of-date for positional-only parameters

2020-01-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +pablogsal

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread YoSTEALTH


New submission from YoSTEALTH :

# enum in C
# -
enum {
a,
b,
c
}
# a = 0
# b = 1
# b = 2

# enum in Python
# --
class Count(enum.IntEnum):
a = enum.auto()
b = enum.auto()
c = enum.auto()
# a = 1
# b = 2
# b = 3


I am not sure why the `enum.auto()` starts with 1 in Python but this has just 
wasted a week worth of my time.

--
assignee: docs@python
components: Documentation
messages: 359452
nosy: YoSTEALTH, docs@python
priority: normal
severity: normal
status: open
title: `enum.auto()` incrementation value not specified.
versions: Python 3.6, Python 3.7, 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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread YoSTEALTH


Change by YoSTEALTH :


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

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +17289
pull_request: https://github.com/python/cpython/pull/17873

___
Python tracker 

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



[issue39158] ast.literal_eval() doesn't support empty sets

2020-01-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> The function literal_eval is not safe anymore as the 
> constructor can be intercepted

"Safe" means safe from user input to literal_eval().

If a person can already write arbitrary code that redefines a builtin, then 
they can already do anything they want.

--

___
Python tracker 

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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-06 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

A normal generator expression like (i for i in a) produces the following AST:

Module(
body=[
Expr(
value=GeneratorExp(
elt=Name(
id="i", ctx=Load(), lineno=1, col_offset=1, end_lineno=1, 
end_col_offset=2
),
generators=[
comprehension(
target=Name(
id="i",
ctx=Store(),
lineno=1,
col_offset=7,
end_lineno=1,
end_col_offset=8,
),
iter=Name(
id="a",
ctx=Load(),
lineno=1,
col_offset=12,
end_lineno=1,
end_col_offset=13,
),
ifs=[],
is_async=0,
)
],
lineno=1,
*col_offset=0,*
end_lineno=1,
*end_col_offset=14,*
),
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=14,
)
],
type_ignores=[],
)

But when calling a function with a generator expression as an argument, 
something is off:

Module(
body=[
Expr(
value=Call(
func=Name(
id="f", ctx=Load(), lineno=1, col_offset=0, end_lineno=1, 
end_col_offset=1
),
args=[
GeneratorExp(
elt=Name(
id="i",
ctx=Load(),
lineno=1,
col_offset=2,
end_lineno=1,
end_col_offset=3,
),
generators=[
comprehension(
target=Name(
id="i",
ctx=Store(),
lineno=1,
col_offset=8,
end_lineno=1,
end_col_offset=9,
),
iter=Name(
id="a",
ctx=Load(),
lineno=1,
col_offset=13,
end_lineno=1,
end_col_offset=14,
),
ifs=[],
is_async=0,
)
],
lineno=1,
*col_offset=1,*
end_lineno=1,
*end_col_offset=2,*
)
],
keywords=[],
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=15,
),
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=15,
)
],
type_ignores=[],
)


I'm not sure if this is intentional or not, because there is a call to 
copy_location in Python/ast.c:3149. If this call to copy_location is removed, 
the inconsistency goes away.

--
components: Interpreter Core
messages: 359454
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: Generator expression has wrong line/col info when inside a Call object
type: behavior
versions: Python 3.7, 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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think that was introduced in  https://bugs.python.org/issue31241

--
nosy: +pablogsal

___
Python tracker 

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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-06 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Do you think it is okay to just remove the call to copy_location?

--

___
Python tracker 

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



[issue39236] Adding a .gitignore file to virtual environments

2020-01-06 Thread Brett Cannon


New submission from Brett Cannon :

In a discussion on Twitter, the idea of having venv lay down a .gitignore file 
in a newly created virtual environment that consisted of nothing but `*` came 
up (https://twitter.com/codewithanthony/status/1213680829530099713). The 
purpose would be to help prevent people from inadvertently committing their 
venv to git. It seems pytest does something similar for .pytest_cache (got one 
complaint but have chosen to keep it otherwise).

To me this seems like a good enhancement. Since this would mostly benefit 
beginners then it should probably be an opt-out if we do it at all. Maybe make 
--no-ignore-file to opt out?

FYI Mercurial does not support subdirectory hgignore files like git does, so 
this may be git-specific (for now): 
https://www.selenic.com/mercurial/hgignore.5.html.

--
components: Library (Lib)
messages: 359459
nosy: brett.cannon, vinay.sajip, xtreak
priority: low
severity: normal
status: open
title: Adding a .gitignore file to virtual environments
type: enhancement
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



[issue39236] [venv] Adding a .gitignore file to virtual environments

2020-01-06 Thread Brett Cannon


Change by Brett Cannon :


--
title: Adding a .gitignore file to virtual environments -> [venv] Adding a 
.gitignore file to virtual environments

___
Python tracker 

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



[issue39158] ast.literal_eval() doesn't support empty sets

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> "Safe" means safe from user input to literal_eval().

Yup, apologies. I had something in mind and I realized after writing my initial 
comment. That is why I said afterwards:

> and the security concern is non-existent.

--

___
Python tracker 

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



[issue39235] Generator expression has wrong line/col info when inside a Call object

2020-01-06 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

>Do you think it is okay to just remove the call to copy_location?

I think that because in that case the parenthesis is collapsed with function 
call parenthesis, the position of the AST node for the generator expression 
should point to the left parenthesis.

But I would suggest asking Serhiy (I added him to the noisy list) as he was the 
author of the PR.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23147] Possible error in _header_value_parser.py

2020-01-06 Thread Batuhan


Batuhan  added the comment:

This issue looks resolved.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue38972] [venv] Link to instructions to change PowerShell execution policy for venv activation

2020-01-06 Thread Brett Cannon


Change by Brett Cannon :


--
title: Link to instructions to change PowerShell execution policy for venv 
activation -> [venv] Link to instructions to change PowerShell execution policy 
for venv activation

___
Python tracker 

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



[issue38901] [venv] Add a CLI flag to venv to use the pwd basename as the prompt

2020-01-06 Thread Brett Cannon


Change by Brett Cannon :


--
title: Add a CLI flag to venv to use the pwd basename as the prompt -> [venv] 
Add a CLI flag to venv to use the pwd basename as the prompt

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread Ethan Furman


Ethan Furman  added the comment:

`auto()` starts with 1 because Enum numbering starts at 1 (which is in the 
docs, albeit buried in the Functional API section).

Thank you for your effort to save somebody else from that frustration, though, 
I appreciate it.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue38901] [venv] Add a CLI flag to venv to use the pwd basename as the prompt

2020-01-06 Thread Brett Cannon


Brett Cannon  added the comment:

Any more feedback from anyone on the idea of using the basename of a directory 
if specified for `--prompt`?

--

___
Python tracker 

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



[issue39233] glossary entry for parameter out-of-date for positional-only parameters

2020-01-06 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 2e9012a3e1e316c54e27f51ba5849ba06eab7da2 by Ethan Furman 
(YoSTEALTH) in branch 'master':
bpo-39234: Doc: `enum.auto()` incrementation value not specified. (GH-17872)
https://github.com/python/cpython/commit/2e9012a3e1e316c54e27f51ba5849ba06eab7da2


--

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17292
pull_request: https://github.com/python/cpython/pull/17876

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17291
pull_request: https://github.com/python/cpython/pull/17875

___
Python tracker 

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



[issue22606] Inconsistency between Python 2 and PyPy regarding future imports

2020-01-06 Thread Batuhan


Batuhan  added the comment:

I guess this issue expired (due to python2).

--
nosy: +BTaskaya

___
Python tracker 

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



[issue39237] Redundant call to round in delta_new

2020-01-06 Thread Alex Henrie


New submission from Alex Henrie :

The delta_new function in _datetimemodule.c currently contains the following 
code:

/* Round to nearest whole # of us, and add into x. */
double whole_us = round(leftover_us);
int x_is_odd;
PyObject *temp;

whole_us = round(leftover_us);

The second call to the round function produces the same result as the first 
call and can therefore be safely eliminated.

--
components: Library (Lib)
messages: 359465
nosy: alex.henrie
priority: normal
severity: normal
status: open
title: Redundant call to round in delta_new
type: performance
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



[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2020-01-06 Thread Batuhan


Batuhan  added the comment:

@Gerrit.Holl do you able to reproduce this with a clean python installation, as 
@eric.snow suggested there is a chance that some kind of pth hack that tried to 
inject ipython etc.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue39237] Redundant call to round in delta_new

2020-01-06 Thread Alex Henrie


Change by Alex Henrie :


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

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2020-01-06 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

@steve.dower - Does this fix need more work for android? @xdegaye says he does 
not need this for android anymore.

--

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread YoSTEALTH


Change by YoSTEALTH :


--
pull_requests: +17294
pull_request: https://github.com/python/cpython/pull/17878

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17295
pull_request: https://github.com/python/cpython/pull/17879

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17296
pull_request: https://github.com/python/cpython/pull/17880

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset b1ce22d086660d2505010694c8813cc67adf8f9e by Miss Islington (bot) 
(Steve Dower) in branch 'master':
bpo-39041: Fix coverage upload command for GitHub Actions (GH-17873)
https://github.com/python/cpython/commit/b1ce22d086660d2505010694c8813cc67adf8f9e


--
nosy: +miss-islington

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2020-01-06 Thread Steve Dower


Steve Dower  added the comment:

I started creating an example of improving the skip cases, and ended up just 
making a PR. It should:

* expect a helpful error on Windows
* work fine on other platforms with crypt
* skip all tests on other platforms without crypt

--

___
Python tracker 

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



[issue25172] Unix-only crypt should not be present on Windows.

2020-01-06 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +17297
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17881

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset fb59f5ffe80a1f2dcf7c6cbd2406e15bea49da21 by Miss Islington (bot) 
in branch '3.8':
bpo-39041: Fix coverage upload command for GitHub Actions (GH-17873)
https://github.com/python/cpython/commit/fb59f5ffe80a1f2dcf7c6cbd2406e15bea49da21


--

___
Python tracker 

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



[issue39041] Support GitHub Actions in CI

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset 676b16c14040ddb9a2ef3408e66a77c1dfb8e841 by Miss Islington (bot) 
in branch '3.7':
bpo-39041: Fix coverage upload command for GitHub Actions (GH-17873)
https://github.com/python/cpython/commit/676b16c14040ddb9a2ef3408e66a77c1dfb8e841


--

___
Python tracker 

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



[issue39234] `enum.auto()` incrementation value not specified.

2020-01-06 Thread miss-islington


miss-islington  added the comment:


New changeset 24bcefcb74231476b055bb6f0726642abeb10f04 by Miss Islington (bot) 
(YoSTEALTH) in branch 'master':
bpo-39234: `enum.auto()` default initial value as 1 (GH-17878)
https://github.com/python/cpython/commit/24bcefcb74231476b055bb6f0726642abeb10f04


--
nosy: +miss-islington

___
Python tracker 

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



[issue39238] test_asyncio: test_cancel_make_subprocess_transport_exec() hangs randomly on PPC64LE Fedora 3.x

2020-01-06 Thread STINNER Victor


New submission from STINNER Victor :

PPC64LE Fedora 3.x buildbot:
https://buildbot.python.org/all/#builders/11/builds/134

0:35:30 load avg: 0.00 [420/420/1] test_asyncio crashed (Exit code 1)
Timeout (0:15:00)!
Thread 0x3fff82de5330 (most recent call first):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/selectors.py",
 line 468 in select
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 1852 in _run_once
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 596 in run_forever
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 629 in run_until_complete
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/test/test_asyncio/test_subprocess.py",
 line 441 in test_cancel_make_subprocess_transport_exec
(...)
0:35:30 load avg: 0.00 Re-running test_asyncio in verbose mode
(...)
test_shell_loop_deprecated 
(test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ... ok
test_start_new_session 
(test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ... ok
test_stdin_broken_pipe 
(test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ... ok
test_stdin_not_inheritable 
(test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ... ok
test_stdin_stdout 
(test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) ... ok
test_terminate (test.test_asyncio.test_subprocess.SubprocessFastWatcherTests) 
... ok
Timeout (0:15:00)!
Thread 0x3fffb25e5330 (most recent call first):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/selectors.py",
 line 468 in select
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 1852 in _run_once
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 596 in run_forever
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/asyncio/base_events.py",
 line 629 in run_until_complete
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/test/test_asyncio/test_subprocess.py",
 line 441 in test_cancel_make_subprocess_transport_exec
  

--
components: Tests, asyncio
messages: 359473
nosy: asvetlov, pablogsal, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: test_asyncio: test_cancel_make_subprocess_transport_exec() hangs 
randomly on PPC64LE Fedora 3.x
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



[issue37387] test_compileall fails randomly on Windows when tests are run in parallel

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

x86 Windows7 3.8:
https://buildbot.python.org/all/#/builders/223/builds/59

FAIL: test_no_args_respects_force_flag 
(test.test_compileall.CommmandLineTestsNoSourceEpoch)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\test_py_compile.py",
 line 20, in wrapper
return fxn(*args, **kwargs)
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\test_py_compile.py",
 line 20, in wrapper
return fxn(*args, **kwargs)
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\test_compileall.py",
 line 322, in test_no_args_respects_force_flag
self.assertRunOK('-f', PYTHONPATH=self.directory)
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\test_compileall.py",
 line 271, in assertRunOK
rc, out, err = script_helper.assert_python_ok(
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\support\script_helper.py",
 line 157, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\support\script_helper.py",
 line 143, in _assert_python
res.fail(cmd_line)
  File 
"D:\cygwin\home\db3l\buildarea\3.8.bolen-windows7\build\lib\test\support\script_helper.py",
 line 70, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: 
['D:\\cygwin\\home\\db3l\\buildarea\\3.8.bolen-windows7\\build\\PCbuild\\win32\\python_d.exe',
 '-X', 'faulthandler', '-S', '-m', 'compileall', '-f']

stdout:
---
(...)

Compiling 
'D:\\cygwin\\home\\db3l\\buildarea\\3.8.bolen-windows7\\build\\lib\\socketserver.py'...

Compiling 
'D:\\cygwin\\home\\db3l\\buildarea\\3.8.bolen-windows7\\build\\lib\\sre_compile.py'...

*** PermissionError: [WinError 5] Access is denied: 
'D:\\cygwin\\home\\db3l\\buildarea\\3.8.bolen-windows7\\build\\lib\\__pycache__\\sre_compile.cpython-38.pyc.12753880'
 -> 
'D:\\cygwin\\home\\db3l\\buildarea\\3.8.bolen-windows7\\build\\lib\\__pycache__\\sre_compile.cpython-38.pyc'

--

___
Python tracker 

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



[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

> Sure, that's obvious for `datetime` and `sys`.  Less obvious for unexpected 
> conflicts with stdlib modules that begin with an underscore...

Yeah, sadly, these modules are less known, but cause the same kind of issues :-(

--

___
Python tracker 

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



[issue39074] Threading memory leak in _shutdown_locks for non-daemon threads

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, I close this issue as a duplicate of bpo-37788.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> fix for bpo-36402 (threading._shutdown() race condition) causes 
reference leak

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-39074 as a duplicate of this issue.

--

___
Python tracker 

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



[issue39201] Threading.timer leaks memory in 3.8.0/3.8.1

2020-01-06 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as a duplicate of bpo-37788.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> fix for bpo-36402 (threading._shutdown() race condition) causes 
reference leak

___
Python tracker 

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



  1   2   >