[issue39545] await is not supported in f-string in 3.6

2020-02-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue39631] Fix file association MIME type on Windows

2020-02-14 Thread Steve Dower


New submission from Steve Dower :

The installer for Windows creates file associations in 
Tools/msi/launcher/launcher_reg.wxs that identify ".py[w]" files as text/plain.

This is inconsistent with the mimetypes module, which uses text/x-python, and 
may cause some applications to assume that calling ShellExecute on a .py file 
will open a text editor rather than executing the script.

We should update the MIME type to text/x-python. This can be backported, as the 
change is in the launcher and isn't tied to the usual upgrade paths anyway.

--
components: Windows
messages: 361989
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Fix file association MIME type on Windows
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



[issue39631] Fix file association MIME type on Windows

2020-02-14 Thread Steve Dower


Steve Dower  added the comment:

The most likely negative potential impact of this would be for any users who 
have added additional verbs based on the content type. I don't recall whether 
we set PerceivedType or not, but that can probably stay.

I'm not aware of any applications (besides Windows itself) that set verbs based 
on content type rather than extensions, so I doubt anyone will be too upset.

--

___
Python tracker 

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



[issue9305] Don't use east/west of UTC in date/time documentation

2020-02-14 Thread Murali Ravipudi


Change by Murali Ravipudi :


--
nosy: +Murali Ravipudi

___
Python tracker 

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



[issue31116] base85 z85 variant encoding

2020-02-14 Thread Dobatymo


Dobatymo  added the comment:

base64.b85encode does not use ", ' or \ as well.

That's the _b85alphabet 

_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")

--
nosy: +Dobatymo

___
Python tracker 

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



[issue39632] variadic function call broken on armhf when passing a float argument

2020-02-14 Thread Nicolas Dessart


New submission from Nicolas Dessart :

On armhf and for variadic functions (and contrary to non-variadic functions), 
the VFP co-processor registers are not used for float argument parameter 
passing. This specificity is apparently completely disregarded by ctypes which 
always uses `ffi_prep_cif` to prepare the parameter passing of a function while 
it should most probably use `ffi_prep_cif_var` for variadic functions.

As such variadic function call with float arguments through ctypes
is currently broken on armhf targets.

I think that ctypes API should be updated to let the user specify if a function 
is variadic.

I've attached a patch to the ctypes unit tests that I'm using to reproduce this 
bug.


pi@raspberrypi:~/code/cpython $ ./python -m test test_ctypes
0:00:00 load avg: 0.00 Run tests sequentially
0:00:00 load avg: 0.00 [1/1] test_ctypes
_testfunc_d_bhilfd_var got 2 3 4 -1242230680 -0.00 -0.00
test test_ctypes failed -- Traceback (most recent call last):
  File "/home/pi/code/cpython/Lib/ctypes/test/test_functions.py", line 146, in 
test_doubleresult_var
self.assertEqual(result, 21)
AssertionError: -7.086855952261741e-44 != 21

test_ctypes failed

== Tests result: FAILURE ==

1 test failed:
test_ctypes

Total duration: 3.8 sec
Tests result: FAILURE

--
components: ctypes
files: ctypes_variadic_function_tests.diff
keywords: patch
messages: 361992
nosy: Nicolas Dessart
priority: normal
severity: normal
status: open
title: variadic function call broken on armhf when passing a float argument
versions: Python 3.9
Added file: 
https://bugs.python.org/file48895/ctypes_variadic_function_tests.diff

___
Python tracker 

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



[issue39632] variadic function call broken on armhf when passing a float argument

2020-02-14 Thread Nicolas Dessart


Change by Nicolas Dessart :


Added file: 
https://bugs.python.org/file48896/ctypes_variadic_function_tests.diff

___
Python tracker 

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



[issue39632] variadic function call broken on armhf when passing a float argument

2020-02-14 Thread Nicolas Dessart


Change by Nicolas Dessart :


Removed file: 
https://bugs.python.org/file48895/ctypes_variadic_function_tests.diff

___
Python tracker 

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



[issue39631] Fix file association MIME type on Windows

2020-02-14 Thread Mark Hammond


Change by Mark Hammond :


--
nosy: +mhammond

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-14 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

At the moment running python -m venv venv or python3 -m venv venv creates a 
virtual environment that does not contain a python. symlink, 
which results in executing whatever the default python is when running i.e. 
python. within an activated virtual env. OTOH if one runs 
python. -m venv venv, then everything is OK. Would it be possible 
to include a python. symlink in all cases? If not, then I think 
we should update the docs to mention that somewhere, since it took me quite a 
while to figure this out.

--
components: Library (Lib)
messages: 361993
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: venv does not include python. symlink by default
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



[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2020-02-14 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: test needed -> 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



[issue33983] unify types for lib2to3.pytree.Base.children

2020-02-14 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> Isn't children annotated as List in typeshed?

Yes, lib2to3.pytree.Base.children is annotated as a list of (Node or Leafs)
https://github.com/python/typeshed/blob/ea0a9c2bd6f6a69c3e49b47870e0109d98316fc6/stdlib/2and3/lib2to3/pytree.pyi#L23

--
nosy: +BTaskaya

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-14 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +eric.araujo, vinay.sajip

___
Python tracker 

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



[issue39159] Ideas for making ast.literal_eval() usable

2020-02-14 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> 1) We should document possible exceptions that need to be caught.  So far, 
> I've found TypeError, MemoryError, SyntaxError, ValueError.

Maybe we should wrap all of these into something like LiteralEvalError to 
easily catch all of them, LiteralEvalError can be subclass of that four but I 
guess in some cases this change might break code.

> 2) Define a size limit guaranteed not to give a MemoryError.  The smallest 
> unsafe size I've found so far is 301 characters:

>>> s = "(" * 101 + ")" * 101
>>> len(s)
202
>>> ast.literal_eval(s)
s_push: parser stack overflow
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.9/ast.py", line 61, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
  File "/usr/local/lib/python3.9/ast.py", line 49, in parse
return compile(source, filename, mode, flags,
MemoryError

> 3) Consider writing a standalone expression compiler that doesn't have the 
> same small limits as our usual compile() function.  This would make 
> literal_eval() usable for evaluating tainted inputs with bigger datasets. 
> (Imagine if the json module could only be safely used with inputs under 301 
> characters).

Can you explain it a bit more detailed, how does this standalone expression 
compiler should work?

--
components: +Library (Lib)
nosy: +BTaskaya
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



[issue39634] Incorrect heapq heapify naming

2020-02-14 Thread Harsh Patel


New submission from Harsh Patel :

heapify method is a misnomer in that it is actually the make-heap or build-heap 
procedure from textbooks

--
components: Library (Lib)
messages: 361996
nosy: hp685
priority: normal
pull_requests: 17888
severity: normal
status: open
title: Incorrect heapq heapify naming

___
Python tracker 

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



[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2020-02-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue34822] Simplify AST for slices

2020-02-14 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Serhiy, any plans to bump this patch to 3.9 and continue / merge? In general 
the benefits looks great, but on the other hand this might cause some breakage 
which I guess as @nascheme is OK in AST.

--
nosy: +BTaskaya, pablogsal

___
Python tracker 

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



[issue38131] compile(mode='eval') uninformative error message

2020-02-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +benjamin.peterson, pablogsal

___
Python tracker 

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



[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2020-02-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue39159] Ideas for making ast.literal_eval() usable

2020-02-14 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> 1) We should document possible exceptions that need to be caught.  So far, 
> I've found TypeError, MemoryError, SyntaxError, ValueError.

Also, an addition to these errors is RecursionError
>>> t = ast.Tuple(elts=[], ctx=ast.Load())
>>> t.elts.append(t)
>>> ast.literal_eval(t)

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.9/ast.py", line 101, in literal_eval
return _convert(node_or_string)
  File "/usr/local/lib/python3.9/ast.py", line 81, in _convert
return tuple(map(_convert, node.elts))
  File "/usr/local/lib/python3.9/ast.py", line 81, in _convert
return tuple(map(_convert, node.elts))
  File "/usr/local/lib/python3.9/ast.py", line 81, in _convert
return tuple(map(_convert, node.elts))
  [Previous line repeated 496 more times]
RecursionError: maximum recursion depth exceeded

--

___
Python tracker 

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



[issue39537] Change line number table format

2020-02-14 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue39634] Incorrect heapq heapify naming

2020-02-14 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

The "-ify" or "-fy" suffix in English means "to make". For example, "amplify", 
"magnify", "terrify", etc.

https://en.wiktionary.org/wiki/-ify

So heapify literally means "make into a heap". Not only is the name correct, 
but it is a better name for an in-place operation than either of the terms you 
give:

* "build-heap" does not describe an in-place operation;
* "make-heap" is ambiguous in whether it is in-place or not.

But even if we agreed that the name needs to change to match text books (which 
text books?), since heapify is a public function, we cannot just change the 
name. We would have to keep the old name around for many, many years, possibly 
forever.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-14 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 1ed61617a4a6632905ad6a0b440cd2cafb8b6414 by Vinay Sajip in branch 
'master':
bpo-12915: Add pkgutil.resolve_name (GH-18310)
https://github.com/python/cpython/commit/1ed61617a4a6632905ad6a0b440cd2cafb8b6414


--

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-14 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.5

___
Python tracker 

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



[issue39618] logger.exception with default message

2020-02-14 Thread Vinay Sajip


Vinay Sajip  added the comment:

Sorry, I don't think this change is a good idea. It's not clear what the value 
is in logging exceptions with no message.

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



[issue39633] venv does not include python. symlink by default

2020-02-14 Thread Vinay Sajip


Vinay Sajip  added the comment:

When a venv is activated, only one Python interpreter is active - whichever one 
the venv was created with. Why would you want to invoke it with `pythonX.Y` 
when `python` would do? I don't think that this is something people generally 
do - this has never come up before AFAIK. What if you invoked it with the wrong 
values of X.Y?

--

___
Python tracker 

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



[issue39634] Incorrect heapq heapify naming

2020-02-14 Thread Harsh Patel


Harsh Patel  added the comment:

This ticket is not intended to rename heapify method in the stdlib (its too
late for that). This is to merely add a clarification in the docs to state
that heapify here has a different connotation than what's used in standard
algorithmic literature (CLRS, Sedgewick etc).  See here
https://xlinux.nist.gov/dads/HTML/heapify.html

References:
https://algs4.cs.princeton.edu/24pq/
http://math.utoledo.edu/~codenth/Fall_16/4380/heap-hw.pdf

On Fri, Feb 14, 2020 at 2:00 PM Steven D'Aprano 
wrote:

>
> Steven D'Aprano  added the comment:
>
> The "-ify" or "-fy" suffix in English means "to make". For example,
> "amplify", "magnify", "terrify", etc.
>
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wiktionary.org_wiki_-2Dify&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=owI_YZl60rgj74U9tzqxcA&m=jUulcI-27ChSIukpI4uzg0LktqA5zRt9HI8Lz0JxRYU&s=o95nXSmjNMCHMbmoWeL7LildI9qwEdnusnlAOenreQ4&e=
>
> So heapify literally means "make into a heap". Not only is the name
> correct, but it is a better name for an in-place operation than either of
> the terms you give:
>
> * "build-heap" does not describe an in-place operation;
> * "make-heap" is ambiguous in whether it is in-place or not.
>
> But even if we agreed that the name needs to change to match text books
> (which text books?), since heapify is a public function, we cannot just
> change the name. We would have to keep the old name around for many, many
> years, possibly forever.
>
> --
> nosy: +steven.daprano
>
> ___
> Python tracker 
> <
> https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.python.org_issue39634&d=DwIFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=owI_YZl60rgj74U9tzqxcA&m=jUulcI-27ChSIukpI4uzg0LktqA5zRt9HI8Lz0JxRYU&s=kE5QfuakDzLUOPpeWAGCf7Z0zJeeeC1iDUSj-bMFzrE&e=
> >
> ___
>

--

___
Python tracker 

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



[issue39634] Add clarification in documentation for incorrect heapq heapify naming

2020-02-14 Thread Harsh Patel


Change by Harsh Patel :


--
title: Incorrect heapq heapify naming -> Add clarification in documentation for 
incorrect heapq heapify naming

___
Python tracker 

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



[issue39634] Add clarification in documentation for heapq.heapify naming

2020-02-14 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
title: Add clarification in documentation for incorrect heapq heapify naming -> 
Add clarification in documentation for heapq.heapify naming
type:  -> enhancement

___
Python tracker 

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



[issue39634] Add clarification in documentation for heapq.heapify naming

2020-02-14 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +rhettinger

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-14 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

The thing is that some projects I've worked on, like pegen, include a Makefile 
which uses `pythonX.Y` to choose the version and I have to change it to 
`python` quite frequently. 

I can't really figure out any way this could harm anyone, other than what you 
said (running `pythonX.Y` with the wrong values for X and Y), but even in that 
case you get something like `command not fonund` and that's an easy enough typo 
to find.

--

___
Python tracker 

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



[issue39634] Add clarification in documentation for heapq.heapify naming

2020-02-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you, but I'm going to decline this suggestion.

The docs are pretty clear about what heapify does:

* "To create a heap, use a list initialized to [], or you can transform a 
populated list into a heap via function heapify()."

* "Transform list x into a heap, in-place, in linear time."

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-02-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I concur with Paul's suggestion.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 
3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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