[issue40633] json.dumps() should encode float number NaN to null

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I missed that as well ;-)

Shall we close this now?

--

___
Python tracker 

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



[issue40633] json.dumps() should encode float number NaN to null

2020-05-17 Thread Mark Dickinson


Mark Dickinson  added the comment:

... but I'm an idiot, since that option is already there (allow_nan=False), and 
I've just checked that we are in fact using it.

--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 94d9c5e5afdee4f46be9d9faaa39d6be40c34849 by Miss Islington (bot) 
in branch '3.8':
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
https://github.com/python/cpython/commit/94d9c5e5afdee4f46be9d9faaa39d6be40c34849


--

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-05-17 Thread Michael Felt


Michael Felt  added the comment:

Bot failed for AIX https://buildbot.python.org/all/#builders/227/builds/978 
with:

0:07:11 Re-running test_asyncio in verbose mode
Failed to import test module: test.test_asyncio.test_events
Traceback (most recent call last):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/loader.py",
 line 436, in _find_test_path
module = self._get_module_from_name(name)
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/unittest/loader.py",
 line 377, in _get_module_from_name
__import__(name)
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_asyncio/test_events.py",
 line 239, in 
class EventLoopTestsMixin:
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/test_asyncio/test_events.py",
 line 1262, in EventLoopTestsMixin
@unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled')
AttributeError: module 'test.support' has no attribute 'IPV6_ENABLED'
test test_asyncio crashed -- Traceback (most recent call last):
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 270, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 234, in _runtest_inner2
test_runner()
  File 
"/home/shager/cpython-buildarea/3.x.edelsohn-aix-ppc64/build/Lib/test/libregrtest/runtest.py",
 line 208, in _test_module
raise Exception("errors while loading tests")
Exception: errors while loading tests
1 test failed again:
test_asyncio

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-05-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +19468
pull_request: https://github.com/python/cpython/pull/20169

___
Python tracker 

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



[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2020-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset 442634c42fcaf31c636f693951a97734042c3e7b by Kjell Braden in 
branch 'master':
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
https://github.com/python/cpython/commit/442634c42fcaf31c636f693951a97734042c3e7b


--
nosy: +miss-islington

___
Python tracker 

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



[issue22622] ElementTree only writes declaration when passed encoding

2020-05-17 Thread Stefan Behnel


Stefan Behnel  added the comment:

Right, thanks. Closing since this works in Py3.

--
resolution:  -> out of date
stage: needs patch -> 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



[issue40607] asyncio.wait_for should reraise future exception even if timeout expires

2020-05-17 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Thank you again, Roman and all.

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

___
Python tracker 

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



[issue31131] asyncio.wait_for() TimeoutError doesn't provide full traceback

2020-05-17 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

This issue was just resolved by the combination of #40607 followed by #31033 
(merged for 3.9.0 beta 1).

Running the example code above now results in the following:

Traceback (most recent call last):
  File "/.../cpython/test-31131.py", line 5, in run
await asyncio.sleep(100)
  File "/.../cpython/Lib/asyncio/tasks.py", line 669, in sleep
return await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../cpython/Lib/asyncio/tasks.py", line 507, in wait_for
fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/.../cpython/test-31131.py", line 15, in 
main(run())
  File "/.../cpython/test-31131.py", line 11, in main
loop.run_until_complete(future)
  File "/.../cpython/Lib/asyncio/base_events.py", line 642, in 
run_until_complete
return future.result()
  File "/.../cpython/Lib/asyncio/tasks.py", line 509, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

As you can see the traceback now includes the exception chain from the 
TimeoutError to the point of interruption: await asyncio.sleep(100).

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Improve traceback of cancelled tasks / add cancel() msg argument
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Zac Hatfield-Dodds


Zac Hatfield-Dodds  added the comment:

I know what else it might find either, but I still think it's worth running 
property-based tests in CI to find out!  The demo I wrote for my language 
summit talk doesn't have any parser tests, but still would have caught this bug 
in the pull request that introduced it.


The specific reproducer here is odd, because it's reported as an internal error 
in Hypothesmith - I use the `compile()` builtin to check that strings valid 
against an approximate grammar are actually valid.

It's structurally less complex than typical outputs because it's only a 
fragment of the tree being generated, but because shrinking doesn't run for 
generation-time errors it's also much harder to interpret than usual.

--

___
Python tracker 

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



[issue31033] Improve traceback of cancelled tasks / add cancel() msg argument

2020-05-17 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Thanks so much, Yury.

(Removing the "release blocker" flag now that it has been merged.)

--
priority: release blocker -> normal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: Add argument to .cancel() of Task and Future -> Improve traceback of 
cancelled tasks / add cancel() msg argument

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-17 Thread Chris Jerdonek


Chris Jerdonek  added the comment:


New changeset da742ba826721da84140abc785856d4ccc2d787f by Chris Jerdonek in 
branch 'master':
bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)
https://github.com/python/cpython/commit/da742ba826721da84140abc785856d4ccc2d787f


--

___
Python tracker 

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



[issue22622] ElementTree only writes declaration when passed encoding

2020-05-17 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2 is EOL, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-05-17 Thread miss-islington


miss-islington  added the comment:


New changeset d17f3d8315a3a775ab0807fc80acf92b1bd682f8 by Shantanu in branch 
'master':
bpo-13601: Mention stderr's line buffering in What's New (GH-20168)
https://github.com/python/cpython/commit/d17f3d8315a3a775ab0807fc80acf92b1bd682f8


--
nosy: +miss-islington

___
Python tracker 

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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-05-17 Thread Shantanu


Change by Shantanu :


--
pull_requests: +19467
pull_request: https://github.com/python/cpython/pull/20168

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Zac: The reproducer here apparently uses a long string of weird accented 
characters. I'm not sure how to generalize from that to other things that 
Hyothes* could find. But maybe this helps: 
https://github.com/python/cpython/pull/20106#issuecomment-629742075

--

___
Python tracker 

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



[issue40629] Error MSB4086 (numeric comparison)

2020-05-17 Thread veganaiZe


veganaiZe  added the comment:

Probably a result of pulling in `msbuild` from .net 4.0 tools.

I'm setting up a dedicated virtual machine.

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



[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2020-05-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Here is minimal reproducing code.

import types
import inspect

class A:
def say(self): print("A.say")
a = A()

class B: pass
b = B()
b.say = types.MethodType(a.say, b)

Let us examine MethodType first.  Calling 'b.say()' asks the previously 
neglected question: Is b.say a proper, sane callable?  I claim not. With 
3.9.0a6, the call fails with "TypeError: say() takes 1 positional argument but 
2 were given".  b.say() calls a.say(b), which calls A.say(a, b).  If A.say took 
another parameter, such as 'name', 'b.say()' might work, but only by accident.

Here is another buggy use of MethodType, 
b.A = types.MethodType(A, b)
b.A()
# TypeError: A() takes no arguments
Again, given 'def __init__(self, something)', b.A() might work, but only by 
accident.

types.MethodType is an example of "[This module] defines names for some object 
types that are used by the standard Python interpreter, but not exposed as 
builtins like int or str are."  The names are mainly intended to be used for 
isinstance checks and rarely, if at all, for object creation.

The MethodType entry lack a signature and only says "The type of methods of 
user-defined class instances."  Its docstring, "method(function, 
instance)\n\nCreate a bound instance method object." does have a signature.  
However, 'function' must be a function compatible with being passed 'instance' 
as the first argument.  This is false for both A and a.say; both result in 
buggy 'callables'.

MethodType checks that its first argument, assigned to the .__func__ attribute, 
is callable (has a '.__call__' attribute) but apparently does not check further.

As for getsource.  For b.A and b.say, it raises "TypeError: module, class, 
method, function, traceback, frame, or code object was expected, got {type}", 
where type is 'type' and 'method' respectively.  For both, the message is 
slightly confusing in that the function got something on the list (type=class). 
 For both, getsource could be patched to work with the buggy inputs.  I the 
latter is a bad idea.  Built-in functions usually fail with buggy inputs.  We 
should either improve the error message for methods or just close this.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-17 Thread Yury Selivanov


Yury Selivanov  added the comment:

Elevating to release blocker to make sure it's included. The PR is good.

--

___
Python tracker 

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



[issue31033] Add argument to .cancel() of Task and Future

2020-05-17 Thread Yury Selivanov


Change by Yury Selivanov :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue40633] json.dumps() should encode float number NaN to null

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

We could add an option to cause NaNs to raise an error, but I don't think it 
would get used.

Otherwise, it's likely best to leave the module as-is.

--

___
Python tracker 

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for PR :-)

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +19466
pull_request: https://github.com/python/cpython/pull/20167

___
Python tracker 

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



[issue40651] class:`OrderedDict` Examples: LRU implementation has a bug.

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset bb8635cc3bc3dd65996803849ee1a91cfbebae9c by qudongfang in branch 
'master':
bpo-40651: Improve LRU recipe in the OrderedDict documentation  (GH-#20139)
https://github.com/python/cpython/commit/bb8635cc3bc3dd65996803849ee1a91cfbebae9c


--
nosy: +rhettinger

___
Python tracker 

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



[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The advent of the LOAD_METHOD opcode addresses this issue.

--
resolution:  -> out of date
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



[issue40665] Use Argument Clinic for bisect

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the PR :-)

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



[issue40665] Use Argument Clinic for bisect

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 3a855b26aed02abf87fc1163ad0d564dc3da1ea3 by Shantanu in branch 
'master':
bpo-40665: Use Argument Clinic for the bisect module (GH-20163)
https://github.com/python/cpython/commit/3a855b26aed02abf87fc1163ad0d564dc3da1ea3


--
nosy: +rhettinger

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

One minor nit:  We're getting a nuisance compiler warning:

test_peg_generator passed (2 min 40 sec)
/var/folders/1b/3499qp8s7xv5w0fvjcgl4510gn/T/tmp90rifd5z/parse.c:97:19: 
warning: code will never be executed [-Wunreachable-code]
p->mark = _mark;
  ^
1 warning generated.

--
nosy: +rhettinger

___
Python tracker 

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



[issue40452] IDLE: preserve clipboard on closure on Windows

2020-05-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

eryksun, Piping to clip.exe is not working well.  On the patch, I asked if you 
know what Windows system call it uses, but I cannot request your review there.

--
nosy: +eryksun

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Zac Hatfield-Dodds


Zac Hatfield-Dodds  added the comment:

I understand from Paul Ganssle that this bug was found using Hypothesmith in my 
stdlib property tests (reported at 
https://github.com/Zac-HD/stdlib-property-tests/issues/14).

As discussed in https://github.com/we-like-parsers/cpython/issues/91 and 
https://pyfound.blogspot.com/2020/05/property-based-testing-for-python.html I'm 
keen to help out how I can, so if there's anything more specific than "write 
tools, write test, and wait" please let me know!

Best,
Zac

--
nosy: +Zac Hatfield-Dodds

___
Python tracker 

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



[issue39076] Use types.SimpleNamespace for argparse.Namespace

2020-05-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> rejected
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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle

Paul Ganssle  added the comment:

I've merged the existing implementation, but I'm leaving this staged as 
"release blocker" so that Łukasz can have final say on whether this goes into 
3.9.

Thanks for the help everyone!

--

___
Python tracker 

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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle


Paul Ganssle  added the comment:


New changeset e527ec8abe0849e784ce100f53c2736986b670ae by Paul Ganssle in 
branch 'master':
bpo-40536: Add zoneinfo.available_timezones (GH-20158)
https://github.com/python/cpython/commit/e527ec8abe0849e784ce100f53c2736986b670ae


--

___
Python tracker 

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



[issue39173] _AttributeHolder of argparse should support the sort function or not?

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Am marking this as closed, out-of-date.

If needed, feel free to re-open.

--
resolution:  -> out of date
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



[issue39058] argparse should preserve argument ordering in Namespace

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 9681953c99b686cf23d1c476a2b26d2ddbec7694 by Raymond Hettinger in 
branch 'master':
bpo-39058:  Preserve attribute order in argparse Namespace reprs. (GH-17621)
https://github.com/python/cpython/commit/9681953c99b686cf23d1c476a2b26d2ddbec7694


--

___
Python tracker 

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



[issue39058] argparse should preserve argument ordering in Namespace

2020-05-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue13601] sys.stderr should be line-buffered when stderr is not a TTY

2020-05-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Can you submit a PR and CC me?

--

___
Python tracker 

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



[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-05-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset eefd4e04a2a1d3929d0f7978469e5b5c4e56 by Rahul Kumaresan in 
branch 'master':
bpo-39705 : sorted() tutorial example under looping techniques improved 
(GH-18999)
https://github.com/python/cpython/commit/eefd4e04a2a1d3929d0f7978469e5b5c4e56


--

___
Python tracker 

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



[issue39801] list.insert is slow, likely due to manual memmove

2020-05-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-17 Thread R. David Murray


Change by R. David Murray :


--
stage: backport needed -> resolved

___
Python tracker 

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



[issue40597] generated email message exceeds RFC-mandated limit of 998 characters

2020-05-17 Thread R. David Murray


R. David Murray  added the comment:


New changeset c1f1ddf30a595c2bfa3c06e54fb03fa212cd28b5 by Miss Islington (bot) 
in branch '3.8':
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently 
(gh-20038) (gh-20084)
https://github.com/python/cpython/commit/c1f1ddf30a595c2bfa3c06e54fb03fa212cd28b5


--

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-17 Thread 1v3m


Change by 1v3m :


--
nosy: +1v3m
nosy_count: 7.0 -> 8.0
pull_requests: +19465
pull_request: https://github.com/python/cpython/pull/20166

___
Python tracker 

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



[issue40612] Make traceback module's formatting of SyntaxError more similar to system formatting

2020-05-17 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue40452] IDLE: preserve clipboard on closure on Windows

2020-05-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Now that I think about it, I have run into enough problems with ^V not pasting 
something copied with ^C that I always leave source windows open until 
successful.  I had not noticed that there is only a problem between windows 
(but this may be true) or after closing IDLE or that it only occurs when 
copying *from* IDLE.  In fact, the last might not be true if other apps have 
the same bug.  (I will start paying more attention after this is fixed.)

--
type: enhancement -> behavior

___
Python tracker 

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



[issue40662] ast.get_source_segment behaviour with missing location info doesn't match docstring

2020-05-17 Thread Shantanu


Shantanu  added the comment:

The code works on 3.8 for me, but has regressed on 3.9 master. Looks like this 
is caused by https://bugs.python.org/issue36287 
(https://github.com/python/cpython/pull/18843)

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19464
pull_request: https://github.com/python/cpython/pull/20165

___
Python tracker 

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



[issue40431] turtledemo/__main__.py: SyntaxError: invalid string prefix else"#fca"

2020-05-17 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I believe the file was synchronized across versions as new features have not 
recently been added. Backporting the fix to my typo should keep it that way.  
This is an example of why code review even of patches that 'work' is a good 
thing.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40665] Use Argument Clinic for bisect

2020-05-17 Thread Shantanu


Change by Shantanu :


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

___
Python tracker 

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



[issue40665] Use Argument Clinic for bisect

2020-05-17 Thread Shantanu


New submission from Shantanu :

As the title says! Am submitting a PR.

--
components: Argument Clinic
messages: 369153
nosy: hauntsaninja, larry
priority: normal
severity: normal
status: open
title: Use Argument Clinic for bisect

___
Python tracker 

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



[issue40257] Improve the use of __doc__ in pydoc

2020-05-17 Thread Thomas Caswell


Change by Thomas Caswell :


--
nosy: +tcaswell

___
Python tracker 

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



[issue34431] Docs does not eval allows code object as argument

2020-05-17 Thread Furkan Onder


Furkan Onder  added the comment:

Hi Jonathan,
Are you still planning to work on the patch?

--

___
Python tracker 

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



[issue40664] Documentation error: itertools.dropwhile(is_even, itertools.count()) output

2020-05-17 Thread SilentGhost


SilentGhost  added the comment:

Did you try running that? The documentation is correct, dropwhile works 
differently than filter.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-05-17 Thread Christian Heimes


Christian Heimes  added the comment:

You can find an example in Python/bootstrap_hash.c that deals with getrandom 
syscall.

--

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2020-05-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-05-17 Thread ntninja


ntninja  added the comment:

I thought this might be the case, I'll look into adapting the patch accordingly 
then.

--

___
Python tracker 

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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Filipe Laíns

Change by Filipe Laíns :


--
nosy: +FFY00

___
Python tracker 

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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread gaborbernat

gaborbernat  added the comment:

I think semantically the correct expression would be available timezones, free 
function, set and no cache. Document the operation is expensive and users 
should cache if they want repeated access or provide an available timezones 
cached function 👍 my 2c

--
nosy: +gaborbernat

___
Python tracker 

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



[issue40664] Documentation error: itertools.dropwhile(is_even, itertools.count()) output

2020-05-17 Thread Nicolas Gimenez


Nicolas Gimenez  added the comment:

Relase: 0.32
Lang: English
Python version: 3.8.3

--

___
Python tracker 

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



[issue40664] Documentation error: itertools.dropwhile(is_even, itertools.count()) output

2020-05-17 Thread Nicolas Gimenez


New submission from Nicolas Gimenez :

On this page:
https://docs.python.org/3/howto/functional.html
The example:

"itertools.dropwhile(is_even, itertools.count()) =>
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..."

is wrong. It should be:

"itertools.dropwhile(is_even, itertools.count()) =>
  1, 3, 5, 7, 9, ..."

--
assignee: docs@python
components: Documentation
messages: 369146
nosy: docs@python, nicobao
priority: normal
severity: normal
status: open
title: Documentation error:  itertools.dropwhile(is_even, itertools.count()) 
output
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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Am leaning toward the iterative approach in new_merge.py because it most 
directly implements the core concept of storing the data in a binary tree.

Merits: no recursion, no nested generators, avoids the clutter of left-empty 
and right-empty checks, easy to understand, simple and fast loops, all local 
variables or instance variables, no calls to memory allocator after then 
initial tree construction, runs well on PyPy, and easily Cythonized.

--

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

I see almost no time difference for 'make time_stdlib': before 3.471, after 
3.451. But I see a serious difference for 'make time_compile': before 3.474, 
after 4.996. That's over 40% slower (on the extreme case, xxl.py).

I'll prepare a PR just in case.

--

___
Python tracker 

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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle

Paul Ganssle  added the comment:

I've opened a PR adding this feature and tagged this as release blocker, since 
I'd like to make sure this is in the beta if Łukasz does not object.

The concerns about the stability of the function I expressed earlier have not 
changed much, though we did get some feedback from the tz database list that at 
least make me think that the new approach (excluding posix/, right/ and 
posixrules) is *probably* the right way to go.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue40536] Addition of a "list of available time zones" function to zoneinfo

2020-05-17 Thread Paul Ganssle


Change by Paul Ganssle :


--
pull_requests: +19461
pull_request: https://github.com/python/cpython/pull/20158

___
Python tracker 

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



[issue40662] ast.get_source_segment behaviour with missing location info doesn't match docstring

2020-05-17 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

A quick benchmark using xxl.py:

Base time (master):
Time: 9.386 seconds on an average of 20 runs

With the patch in this issue:
Time: 9.498 seconds on an average of 20 runs

Sadly I could not test with PGO/LTO and without CPU isolation, so it would be 
great if someone could double-check these numbers.

Also, I will be unable to do a PR until this night/tomorrow morning (London 
time) :(

--

___
Python tracker 

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



[issue40662] ast.get_source_segment behaviour with missing location info doesn't match docstring

2020-05-17 Thread Irit Katriel


Change by Irit Katriel :


--
title: ast.get_source_segment behaviour with missing location info doesn't 
match doctoring -> ast.get_source_segment behaviour with missing location info 
doesn't match docstring

___
Python tracker 

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



[issue40663] Wrong generated annotation on subscripting

2020-05-17 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
components: +Interpreter Core
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



[issue40663] Wrong generated annotation on subscripting

2020-05-17 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

$ python3.8
Python 3.8.0+ (heads/3.8:b9e5547f58, Nov 28 2019, 19:18:03) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import annotations
>>> b: Type[(int, str, *types)]
>>> __annotations__
{'b': 'Type[int, str, *types]'}

 $ python3.7
Python 3.7.5 (default, Apr 19 2020, 20:18:17) 
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import annotations
>>> b: Type[(int, str, *types)]
>>> __annotations__
{'b': 'Type[int, str, *types]'}
>>>

--

___
Python tracker 

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



[issue40663] Wrong generated annotation on subscripting

2020-05-17 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40662] ast.get_source_segment behaviour with missing location info doesn't match doctoring

2020-05-17 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



[issue40663] Wrong generated annotation on subscripting

2020-05-17 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

>>> from __future__ import annotations
>>> a: Type[int, str]
>>> b: Type[(int, str, *types)]
>>> __annotations__
{'a': 'Type[int, str]', 'b': 'Type[int, str, *types]'}
>>> ast.parse(__annotations__["b"])
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/isidentical/cpython/master/Lib/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
  File "", line 1
Type[int, str, *types]
   ^
SyntaxError: invalid syntax

--
messages: 369140
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Wrong generated annotation on subscripting

___
Python tracker 

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



[issue40662] ast.get_source_segment behaviour with missing location info doesn't match doctoring

2020-05-17 Thread Irit Katriel


New submission from Irit Katriel :

The doctoring says "If some location information (lineno, end_lineno, 
col_offset, or end_col_offset) is missing, return None."

However:

>>> s = "12"
>>> node = ast.parse(s).body[0]
>>> ast.get_source_segment(s, node)
'12'
>>> del node.lineno
>>> ast.get_source_segment(s, node)
>>> node = ast.parse(s).body[0]
>>> del node.end_lineno
>>> ast.get_source_segment(s, node)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/iritkatriel/src/cpython/Lib/ast.py", line 336, in 
get_source_segment
end_lineno = node.end_lineno - 1
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

In other parts of ast.py there are hasattr checks for lineno/col_offset 
alongside checks for None for end_lineno/end_col_offset. So this difference in 
behaviour of the end_ fields seems intended.

--
components: Library (Lib)
messages: 369139
nosy: benjamin.peterson, brett.cannon, iritkatriel, pablogsal, yselivanov
priority: normal
pull_requests: 19458
severity: normal
status: open
title: ast.get_source_segment behaviour with missing location info doesn't 
match doctoring
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



[issue37630] Investigate replacing SHA3 code with OpenSSL

2020-05-17 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 62ecd8a8f908282726d2f019c93efa1cf2e9e784 by Christian Heimes in 
branch 'master':
bpo-37630: Fix spelling shake128 -> shake_128 (GH-20154)
https://github.com/python/cpython/commit/62ecd8a8f908282726d2f019c93efa1cf2e9e784


--

___
Python tracker 

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



[issue40629] Error MSB4086 (numeric comparison)

2020-05-17 Thread veganaiZe


veganaiZe  added the comment:

Using Windows 10 SDK (from late 2019).  It's essential for the 2015r3 tools 
(since the build tools don't include the standard lib headers! --Gimme a break 
Microsoft!)

Here's the TL;DR from the log:

 2>Building with tools version "4.0".
 2>C:\src\cpython\PCbuild\python.props(111,31): error MSB4086: A numeric 
comparison was attempted on "$([System.Version]::Parse($(_RegistryVersion)))" 
that evaluates to "10.0.18362.0" instead of a number, in condition 
"$([System.Version]::Parse($(_RegistryVersion))) > 
$([System.Version]::Parse($(DefaultWindowsSDKVersion)))". 
[C:\src\cpython\PCbuild\_freeze_importlib.vcxproj]

--

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Guido van Rossum

Guido van Rossum  added the comment:

How costly is PyErr_Occurred()? That worries me most, otherwise I’d accept this 
right away.

--

___
Python tracker 

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



[issue40452] IDLE: preserve clipboard on closure on Windows

2020-05-17 Thread E. Paine

E. Paine  added the comment:

Test example:

1) Open IDLE (shell or editor)
2) Copy some text in the IDLE window
3) Close the IDLE window (instance should end)
4) Paste into application of choice
Without the patch, the clipboard is cleared when the instance ends so nothing 
is pasted. With the patch, the content remains in the clipboard as expected.

Note: This is not a problem if clipboard history is turned on or the content is 
pasted before closure, however the order of events above is fairly common for 
me.


Encoding:

In the latest commit to the pull, I have changed the encoding from UTF-8 to 
UTF-16 and my reasoning is as follows:

1) Most importantly, using UTF-8, characters with a unicode value >=2^8 are 
incorrectly copied as multiple characters. UTF-8 does support these characters 
but uses a different number of bytes per character (which is presumably what is 
causing these issues - for example, "AĀ" is encoded as "\x41\xc4\x80", which 
pastes as "A─Ç") UTF-16, however, correctly works for all characters supported 
by Tcl (see next point).

2) "Strings in Tcl are encoded using 16-bit Unicode characters" 
(https://www.tcl.tk/man/tcl8.2.3/TclCmd/encoding.htm). Therefore, the encoding 
we choose should have at least 16 bits allocated per character (meaning either 
UTF-16 or UTF-32).

3) Windows' "Unicode-enabled functions [...] use UTF-16 (wide character) 
encoding, which is [...] used for native Unicode encoding on Windows operating 
systems" (https://docs.microsoft.com/en-us/windows/win32/intl/unicode). For me, 
this was what decided the new encoding (between the two given in the previous 
point).

--

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Indeed, that diff solves the problem

--

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think we may need to test for the error indicator (and maybe PyErr_Ocurred 
for safety) before every alternative. Something like:

diff --git a/Tools/peg_generator/pegen/c_generator.py 
b/Tools/peg_generator/pegen/c_generator.py
index 8f9972bb41..61cb694628 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -468,10 +468,6 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
 memoize = self._should_memoize(node)

 with self.indent():
-self.print("if (p->error_indicator) {")
-with self.indent():
-self.print("return NULL;")
-self.print("}")
 self.print(f"{result_type} _res = NULL;")
 if memoize:
 self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, 
&_res))")
@@ -685,6 +681,12 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
 def visit_Alt(
 self, node: Alt, is_loop: bool, is_gather: bool, rulename: 
Optional[str]
 ) -> None:
+self.print("if (p->error_indicator == 1 || PyErr_Occurred()) {")
+with self.indent():
+self.print("p->error_indicator = 1;")
+self.print("return NULL;")
+self.print("}")
+
 self.print(f"{{ // {node}")
 with self.indent():
 # Prepare variable declarations for the alternative

--

___
Python tracker 

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



[issue40661] The new parser segfaults when parsing invalid input

2020-05-17 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The new peg parser segfaults when parsing the attached reproducer.

this is due to the fact that the exception set by `tokenizer_error` is not 
properly propagated.

--
components: Interpreter Core
files: reproducer.py
messages: 369132
nosy: gvanrossum, lys.nikolaou, pablogsal
priority: release blocker
severity: normal
stage: needs patch
status: open
title: The new parser segfaults when parsing invalid input
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file49169/reproducer.py

___
Python tracker 

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



[issue37630] Investigate replacing SHA3 code with OpenSSL

2020-05-17 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19457
pull_request: https://github.com/python/cpython/pull/20154

___
Python tracker 

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



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-05-17 Thread Christian Heimes


Christian Heimes  added the comment:

The statx call was introduced by Kernel 4.11 in 2017. Major LTS Linux 
distributions like Debian 9, Ubuntu 16.04, and CentOS 7 use older Kernels like 
Linux 4.9 LTS or 3.10 LTS.

In general we try to support older Kernel ABIs even when Python is compiled on 
a system with more recent ABI. This means you have to perform a runtime feature 
detection and fall back to old stat when the syscall fails.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-05-17 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +19456
pull_request: https://github.com/python/cpython/pull/20153

___
Python tracker 

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



[issue39959] Bug on multiprocessing.shared_memory

2020-05-17 Thread Rauan Mukhamejanov


Rauan Mukhamejanov  added the comment:

Not sure about "it can always be accessed and closed/unlinked by any process 
later on", as each process will be spawning its own resource_tracker, using a 
separate pipe. Thus, unregister calls from other processes will not have any 
effect. 

The documentation is indeed unclear that processes must share the 
resource_tracker. Can we introduce a new flag - "persist", that would indicate 
no resource tracking is needed? Registering will only happen if create=True and 
persist=False, meaning the user accepts the creating process must outlive all 
other processes that could connect to the shared memory. If persist=False, the 
user accepts the responsibility for manual cleaning up of the allocated memory. 
This will allow catering to a wider range of use cases, where readers/writer 
processes can exit and re-connect to shared_memory as they see fit.

--
nosy: +rauanargyn

___
Python tracker 

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



[issue38870] Expose ast.unparse in the ast module

2020-05-17 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +19455
pull_request: https://github.com/python/cpython/pull/20152

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-17 Thread Glenn Travis


Glenn Travis  added the comment:

I think that you are referring to Gatekeeper.  Something that I have run into 
with various applications, such as certain utility files in Ortho4XP and even 
when adding aircraft to X-Plane(some of the developers refuse to become 
approved Apple developers).

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



[issue40643] Improve doc-strings for datetime.strftime & strptime

2020-05-17 Thread Edison Abahurire


Edison Abahurire  added the comment:

Oh! I realized that statement is there because the strftime method used is 
inherited from the date class.

--

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-17 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I strongly suspect bpo-37834 and GH-15231 is where the difference was 
introduced.

--

___
Python tracker 

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



[issue39533] Use `statx(2)` system call on Linux for extended `os.stat` information

2020-05-17 Thread Pavol Babinčák

Change by Pavol Babinčák :


--
nosy: +scrool

___
Python tracker 

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



[issue40654] shutil.copyfile mutates symlink for absolute path

2020-05-17 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thank you Eryk for the thorough and informative investigation. Seriously, wow.

> Do you want 3.8 to revert to using the print name, at least for symlinks? 
> (ntpath._readlink_deep would need to be modified to support long target 
> paths.) Or would you rather that shutil used a more reliable way to copy 
> symlinks verbatim on Windows? For example, use CopyFileExW for a file and 
> CreateDirectoryEx for a directory.

In this case, my instinct is that `shutil` should devise a more reliable way to 
copy symlinks. It claims that it does to the extent the platform allows [1].

> symbolic links in the source tree are represented as symbolic links in the 
> new tree and the metadata of the original links will be copied as far as the 
> platform allows

It hadn't occurred to me that the effect may be manifest in readlink, but I see 
that now too:

~ # py -3.7 -c "import os; print(os.readlink('temp/bar'))"
c:\Users\jaraco\temp\foo
~ # py -3.8 -c "import os; print(os.readlink('temp/bar'))"
\\?\c:\Users\jaraco\temp\foo

So even if shutil.copyfile were to copy the symlinks exactly, the expectation 
would still be missed that the output of readlink doesn't match the input to 
symlink, so the expectation would still be missed. A user/programmer should be 
able to predict the output of 'readlink' given the input to 'symlink' (or cmd 
/c mklink).

Based on that reasoning, my answer would be "both", but I'd put a priority on 
restoring the use of "print name" for `readlink`, as that may be sufficient to 
satisfy most (if not all) use-cases.


[1]: https://docs.python.org/3/library/shutil.html#shutil.copytree

--

___
Python tracker 

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



[issue18262] ZipInfo.external_attr are not documented

2020-05-17 Thread Pavol Babinčák

Pavol Babinčák  added the comment:

I'm interested in this documentation enhancement as well.

Alex, I'm wondering if you could convert your patch to GitHub? [1]


[1] 
https://devguide.python.org/pullrequest/#converting-an-existing-patch-from-b-p-o-to-github

--
nosy: +scrool

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-17 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

It's because application on recent versions of MacOS cannot access files in 
some directories without being granted permission explicitly, a permission 
model similar to what iOS and Android.

You can grant them additional permission using System Preferences, see 
https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/
 for example. All applications on recent version of MacOS behaves like this and 
this is not a bug in Python.

--

___
Python tracker 

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



[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink

2020-05-17 Thread Chris AtLee


Chris AtLee  added the comment:

It's caused by the combination of the symlink existing, and having the tarfile 
opened in r| mode.

If I run the attached test file in a fresh directory, I get the following 
exception:

raceback (most recent call last):
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2227, in makelink
os.symlink(tarinfo.linkname, targetpath)
FileExistsError: [Errno 17] File exists: 'message.txt' -> './symlink.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../test.py", line 12, in 
tf.extractall()
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2024, in extractall
self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(),
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2065, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2145, in _extract_member
self.makelink(tarinfo, targetpath)
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2237, in makelink
self._extract_member(self._find_link_target(tarinfo),
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2137, in _extract_member
self.makefile(tarinfo, targetpath)
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 
2176, in makefile
source.seek(tarinfo.offset_data)
  File "/home/catlee/.pyenv/versions/3.8.2/lib/python3.8/tarfile.py", line 513, 
in seek
raise StreamError("seeking backwards is not allowed")
tarfile.StreamError: seeking backwards is not allowed

--
Added file: https://bugs.python.org/file49168/test.py

___
Python tracker 

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



[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink

2020-05-17 Thread Julien Palard


Julien Palard  added the comment:

Hi Chris, which exception did you got exactly? Was it caused by the r| mode or 
by a symlink (or file) already existing?

--
nosy: +mdk

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-17 Thread Glenn Travis


Glenn Travis  added the comment:

As per your suggestion I have sent an email to python help, just looking for 
info regarding what you would consider the key permission settings.

--

___
Python tracker 

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



[issue40649] [Errno 1]

2020-05-17 Thread Glenn Travis


Glenn Travis  added the comment:

ok, fine.
So what permissions would indicate that "the Python interpreter can read it."
The Get Info screenshot that he sent me looks just like mine with regard to 
permissions. The long list in terminal shows nothing special. 

I am not having problems running the scripts.

--

___
Python tracker 

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



[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2020-05-17 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


--
nosy: +Yonatan Goldschmidt

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


Added file: https://bugs.python.org/file49167/losers.py

___
Python tracker 

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



[issue38938] Possible performance improvement for heaqq.merge()

2020-05-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


Removed file: https://bugs.python.org/file49165/losers.py

___
Python tracker 

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



  1   2   >