[issue41670] ceval traces code differently based with USE_COMPUTED_GOTOS

2020-08-30 Thread Ammar Askar


Ammar Askar  added the comment:

So I think this is a weird edge case with a set of opcode predictions (GET_ITER 
-> FOR_ITER -> POP_BLOCK) going outside of a line boundary.

The disassembly of the reproducer above is:

  4   0 SETUP_FINALLY   16 (to 18)

  5   2 LOAD_CONST   1 (())
  4 GET_ITER
>>6 FOR_ITER 4 (to 12)
  8 STORE_FAST   0 (i)
 10 JUMP_ABSOLUTE6

  6 >>   12 POP_BLOCK
 14 LOAD_CONST   2 (1)
 16 RETURN_VALUE

When computed gotos are disabled and there is a tracing function, instructions 
0, 2, 4, 14 and 16 hit the `fast_next_opcode` label and have a chance to be 
traced as line hits. Note that `maybe_call_line_trace` will only cause a line 
hit if the instruction that starts a line (POP_BLOCK in this case) is being 
executed.

When computed gotos are enabled, DISPATCH is a no-op and there is a special 
case for when tracing is enabled that causes every opcode to go through 
`fast_next_opcode`: 
https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Python/ceval.c#L1054-L1059

When computed gotos are not enabled, there is no similar check for PREDICT (and 
might be too costly to add) causing this issue: 
https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Python/ceval.c#L1131-L1141

--
title: Windows and Linux execute the same code differently -> ceval traces code 
differently based with USE_COMPUTED_GOTOS

___
Python tracker 

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



[issue41670] ceval traces code differently with USE_COMPUTED_GOTOS

2020-08-30 Thread Ammar Askar


Change by Ammar Askar :


--
title: ceval traces code differently based with USE_COMPUTED_GOTOS -> ceval 
traces code differently with USE_COMPUTED_GOTOS

___
Python tracker 

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



[issue41670] Windows and Linux execute the same code differently

2020-08-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +Mark.Shannon, pablogsal

___
Python tracker 

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



[issue39349] Add "cancel_futures" parameter to concurrent.futures.Executor.shutdown()

2020-08-30 Thread Kyle Stanley


Kyle Stanley  added the comment:

Good catch, Shantanu. It was not intentional on my part, and it would make 
sense to include *cancel_futures* in the base Executor class as documented. If 
you'd like to submit a PR to add it (attaching it to this issue), I should be 
able to review it within a reasonable period.

--

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Got it.

On Sun, Aug 30, 2020 at 15:28 Terry J. Reedy  wrote:

>
>
> Terry J. Reedy  added the comment:
>
>
>
> sys.argv cannot be set until sys exists.  As I mentioned above, subsequent
> calls before finalization must continue to be no-ops.
>
>
>
> Code that depends on a bug, in this case of sys.argv not existing, is
> always vulnerable.  In this case, I would expect that people who want
> sys.argv to have a particular value would unconditionally set it.  If it
> were conditionally set, the program would likely exit or otherwise fail a
> test.  I intentionally have not suggested backporting a code change.
>
>
>
> --
>
>
>
> ___
>
> Python tracker 
>
> 
>
> ___
>
> --
--Guido (mobile)

--

___
Python tracker 

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



[issue41670] Windows and Linux execute the same code differently

2020-08-30 Thread Ammar Askar


Ammar Askar  added the comment:

minimal reproducer without coverage:


import sys

def f():
try:
for i in []: pass
return 1
except:
return 2

def tracer(frame, event, _):
if event == 'line':
print("executing line {}".format(frame.f_lineno))
return tracer

sys.settrace(tracer)
f()



With computed gotos this results in:

> executing line 4
> executing line 5
> executing line 6

but without:

> executing line 4
> executing line 5

--
nosy: +ammar2

___
Python tracker 

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



[issue41671] inspect.getdoc/.cleandoc doesn't always remove trailing blank lines

2020-08-30 Thread RalfM


New submission from RalfM :

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> def func1():
... """This is func1.
... """
... pass
...
>>> inspect.getdoc(func1)
'This is func1.\n'
>>>
>>> def func2():
... """Line1
...Line2 
...
..."""
...
>>> inspect.getdoc(func2)
'Line1\nLine2 \n\n'

Note: The blank line between "Line2 " and the closing """ contains 11 spaces.

The algorithm given in PEP 257 returns what I would expect, i.e. 
'This is func1.'
and
'Line1\nLine2'
respectively.

Strictly speaking, inspect.cleandoc doesn't claim to implement PEP 257.
However, there is a comment "# Remove any trailing or leading blank lines." in 
the code of inspect.cleandoc, and this is obviously not done.

Looking at the code, the reason seems to be twofold:

1. When removing the indentation, PEP 257 also does a .rstrip() on the lines, 
inspect.cleandoc doesn't.
As a consequence, in inspect.cleandoc trailing lines with many spaces will 
still contain spaces after the indentation has been removed, thus are not empty 
and the "while lines and not lines[-1]" doesn't remove them.
That explains func2 above.

2. If all lines but the first are blank (as in func1 above), indent / margin 
will be sys.maxint / sys.maxsize and no indentation will be removed.
PEP 257 copies dedented lines to a new list. If no indentation needs to be 
removed, nothing but the first line will be copied, and so the trailing lines 
are gone.
inspect.cleandoc dedents lines inplace. If no indentation needs to be removed 
the trailing lines with spaces remain and, as they contain spaces, the "while 
lines and not lines[-1]" doesn't remove them.

There is another difference between PEP 257 and inspect.cleandoc: PEP 257 
removes trailing whitespace on every line, inspect.cleandoc preserves it.
I don't know whether that's intentional.

I see this behaviour in 3.7 and 3.8, and the inspect.cleandoc code is unchanged 
in 3.9.0rc1.

--
components: Library (Lib)
messages: 376136
nosy: RalfM
priority: normal
severity: normal
status: open
title: inspect.getdoc/.cleandoc doesn't always remove trailing blank lines
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



[issue41670] Windows and Linux execute the same code differently

2020-08-30 Thread Ned Batchelder


New submission from Ned Batchelder :

Coverage.py bug reports https://github.com/nedbat/coveragepy/issues/1022 and 
https://github.com/nedbat/coveragepy/issues/959 demonstrate the same Python 
code, with the same disassembly, executing differently.

In 
https://discuss.python.org/t/same-python-version-different-optimizations-on-different-os/5098,
 Ammar Askar said:

> For any core developer who wants to look into this, based on my preliminary 
> research this seems to be related to opcode prediction and computed GOTOS.
> 
> If you put #define USE_COMPUTED_GOTOS 0 above 
> https://github.com/python/cpython/blob/master/Python/ceval.c#L1033 then this 
> issue is re-creatable on Linux/Mac.
> 
> It seems to be an issue relating to how f_lasti is updated.

--
components: Interpreter Core
keywords: 3.8regression
messages: 376135
nosy: nedbat
priority: normal
severity: normal
status: open
title: Windows and Linux execute the same code differently
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

sys.argv cannot be set until sys exists.  As I mentioned above, subsequent 
calls before finalization must continue to be no-ops.

Code that depends on a bug, in this case of sys.argv not existing, is always 
vulnerable.  In this case, I would expect that people who want sys.argv to have 
a particular value would unconditionally set it.  If it were conditionally set, 
the program would likely exit or otherwise fail a test.  I intentionally have 
not suggested backporting a code change.

--

___
Python tracker 

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



[issue39349] Add "cancel_futures" parameter to concurrent.futures.Executor.shutdown()

2020-08-30 Thread Shantanu


Shantanu  added the comment:

I was working on updating typeshed stubs to reflect this change. It looks like 
the parameter wasn't actually added to the base class 
(https://github.com/python/cpython/blob/c3a651ad2544d7d1be389b63e9a4a58a92a31623/Lib/concurrent/futures/_base.py#L608),
 even though it's documented as having the new parameter 
(https://docs.python.org/3.9/library/concurrent.futures.html#concurrent.futures.Executor.shutdown).

Is this intentional? If not, I'd be happy to submit a PR adding the parameter 
to the base class.

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2020-08-30 Thread Shantanu


Shantanu  added the comment:

I was looking at adding stubs for these to typeshed. Is it intentional that we 
ignore the flags and address arguments in the implementation?

--
nosy: +hauntsaninja

___
Python tracker 

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



[issue41669] Case mismatch between "include" and "Include"

2020-08-30 Thread Gregory Szorc


New submission from Gregory Szorc :

On Windows, `sysconfig.get_path('include')` returns `Include` (capital I).

However, the actual installation path is `include` (lowercase i).

I believe the reason for the case mismatch is in this code in PC/layout/main.py:

```
if ns.include_dev:

for dest, src in rglob(ns.source / "Include", "**/*.h"):
yield "include/{}".format(dest), src
src = ns.source / "PC" / "pyconfig.h"
yield "include/pyconfig.h", src
```

The case mismatch is relevant for case sensitive filesystems. In my case, I was 
extracting a Windows Python install on Linux and then using the `sysconfig` 
value to locate directories within that install. Due to the case mismatch, 
Linux says `Include` doesn't exist since `sysconfig` points to "include."

Case only renames can be a bit wonky to perform. I would suggest preserving 
what is shipped today and changing `sysconfig` to advertise lowercase 
"include." However, this would create a mismatch between the cpython source 
repo and built distributions. So maybe attempting the case-only rename is 
doable.

Note that Windows will not allow you to have a file/directory varying only in 
case. i.e. you can have both an "include" and "Include." I can't recall if you 
can perform a case-only rename with a single system call (meaning it is atomic) 
or whether you need to go through a temporary directory.

--
components: Windows
messages: 376131
nosy: indygreg, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Case mismatch between "include" and "Include"
type: behavior
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



[issue41668] Expose eventfd for high-performance event notifier in Linux

2020-08-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue41668] Expose eventfd for high-performance event notifier in Linux

2020-08-30 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The eventfd system calls can allow us to implement some Linux-specific high 
performance version of some event notifier abstractions in the standard 
library. 

eventfd() creates an "eventfd object" that can be used as an event wait/notify 
mechanism by user-space applications. The object contains an
unsigned 64-bit integer counter that is maintained by the kernel. This acts as 
a file descriptor that can be used by the usual suspects 
(read/write/poll/close...).

The advantage here is that the kernel maintains the counter and if used in 
conjunction with poll/epoll, it allows for a high-performance and
scallabe event notification system.

--
components: IO, Library (Lib)
messages: 376130
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Expose eventfd for high-performance event notifier in Linux
versions: Python 3.10

___
Python tracker 

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



[issue41667] The python PEG generator incorrectly handles empty sequences in gather rules

2020-08-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue41667] The python PEG generator incorrectly handles empty sequences in gather rules

2020-08-30 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Currently, empty sequences in gather rules make the conditional for
gather rules fail as empty sequences evaluate as "False". We need to
explicitly check for "None" (the failure condition) to avoid false
negatives.

--
messages: 376129
nosy: pablogsal
priority: normal
severity: normal
status: open
title: The python PEG generator incorrectly handles empty sequences in gather 
rules
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue41654] Segfault when raising MemoryError

2020-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The problem is that the deallocator of MemoryError class is not taking into 
account subclasses for the freelist management, but the allocator (tp_new) is.

--

___
Python tracker 

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



[issue39994] pprint handling of dict subclasses that override __repr__

2020-08-30 Thread Eric V. Smith


Change by Eric V. Smith :


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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 38e32872eb3cf0dc9dd8cef9b05e47ba03638d34 by Miss Islington (bot) 
in branch '3.8':
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) 
(GH-22019)
https://github.com/python/cpython/commit/38e32872eb3cf0dc9dd8cef9b05e47ba03638d34


--

___
Python tracker 

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



[issue41344] SharedMemory crash when size is 0

2020-08-30 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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the report and the PR, vinay0410!

--

___
Python tracker 

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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset ca55ecbf9aab305fa301ec69410ca3d3d18ec848 by Miss Islington (bot) 
in branch '3.9':
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) 
(GH-22018)
https://github.com/python/cpython/commit/ca55ecbf9aab305fa301ec69410ca3d3d18ec848


--

___
Python tracker 

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



[issue41654] Segfault when raising MemoryError

2020-08-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
nosy: +pablogsal
nosy_count: 4.0 -> 5.0
pull_requests: +21120
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22020

___
Python tracker 

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



[issue37168] small_ints[] modified (third party C-extension?)

2020-08-30 Thread Tim Peters


Tim Peters  added the comment:

Closing, since it remains a unique report and there hasn't been another word 
about it in over a year.

--
resolution:  -> works for me
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue37168] small_ints[] modified (third party C-extension?)

2020-08-30 Thread Stefan Krah


Stefan Krah  added the comment:

If nothing has been diagnosed, I suggest closing this.

--
status: open -> pending

___
Python tracker 

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



[issue37168] small_ints[] modified (third party C-extension?)

2020-08-30 Thread Stefan Krah


Change by Stefan Krah :


--
title: Decimal divisions sometimes 10x or 100x too large -> small_ints[] 
modified (third party C-extension?)

___
Python tracker 

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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21119
pull_request: https://github.com/python/cpython/pull/22019

___
Python tracker 

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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 475a5fbb5644ea200c990d85d8c264e78ab6c7ea by Vinay Sharma in 
branch 'master':
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556)
https://github.com/python/cpython/commit/475a5fbb5644ea200c990d85d8c264e78ab6c7ea


--
nosy: +pablogsal

___
Python tracker 

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



[issue41344] SharedMemory crash when size is 0

2020-08-30 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +21118
pull_request: https://github.com/python/cpython/pull/22018

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Guido van Rossum

Guido van Rossum  added the comment:

Something just occurred to me. What if the caller has already set
says.argv? We shouldn’t overwrite it. Or what if they only set it (later)
if not already set. Would we break their code?
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue39994] pprint handling of dict subclasses that override __repr__

2020-08-30 Thread Irit Katriel


Irit Katriel  added the comment:

Thank you Serhiy.  This ticket can be closed now.

--

___
Python tracker 

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



[issue18417] urlopen() has a hidden default for its timeout argument

2020-08-30 Thread Facundo Batista


Change by Facundo Batista :


--
nosy:  -facundobatista

___
Python tracker 

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



[issue37168] Decimal divisions sometimes 10x or 100x too large

2020-08-30 Thread Facundo Batista


Change by Facundo Batista :


--
nosy:  -facundobatista

___
Python tracker 

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



[issue41654] Segfault when raising MemoryError

2020-08-30 Thread hai shi


hai shi  added the comment:

Hm, Looks like we need check the double free risk of `Py_DECREF()`.

--

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I had the same idea late last night, though after 20 years, I have forgotten 
how to spell "['']" in C.  (Is some sort of allocation or declaration 
required?).

In the doc, change "It does not set sys.argv; use PySys_SetArgvEx() for that." 
to "It initializes sys.argv to ['']; use PySys_SetArgvEx() to modify it or 
change sys.path."

"This is a no-op when called for a second time (without calling Py_FinalizeEx() 
first)." needs to be respected.

--

___
Python tracker 

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



[issue39994] pprint handling of dict subclasses that override __repr__

2020-08-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 582f13786bb75c73d609790967fea03a5b50148a by Irit Katriel in 
branch 'master':
bpo-39994: Fix pprint handling of dict subclasses that override __repr__ 
(GH-21892)
https://github.com/python/cpython/commit/582f13786bb75c73d609790967fea03a5b50148a


--

___
Python tracker 

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



[issue40153] json dump with repeated key

2020-08-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This module has been heavily used in the real world and we have no evidence 
that there is an actual problem to be solved.  Marking this as closed.  If a 
real world issue does arise, feel free to reopen and we can consider extending 
the API to have a validation step.

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



[issue41637] Calling with an infinite number of parameters is not detected

2020-08-30 Thread Camion


Camion  added the comment:

I understand all that. But the problem is that it should crash the program and 
not the interpreter.

--

___
Python tracker 

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



[issue40486] pathlib's iterdir doesn't specify what happens if directory content change

2020-08-30 Thread Facundo Batista


Facundo Batista  added the comment:

However, Serhiy, `os.listdir()` builds a list quickly and gives you that, so 
the chance of the directory being modified is quite low (however, for big 
directories, that may happen, and it's probably good to notice that in the 
docs).

For `Path.iterdir()` that list is not built, and as it's iteration is external, 
the amount of time between getting one item to the other is unbound, *anything* 
could happen in the middle. 

In short, I think that both docs should state that the directory could change 
while it's iterated (in the os.listdir case probably stating that the chances 
are low).

--

___
Python tracker 

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



[issue15947] Assigning new values to instance of pointer types does not check validity

2020-08-30 Thread Facundo Batista


Facundo Batista  added the comment:

I'm closing this, it looks to me that behaviour changed and this is safe now.

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



[issue35228] Index search in CHM help crashes viewer

2020-08-30 Thread Christoph Zwerschke


Christoph Zwerschke  added the comment:

Had the same problem for years and wondered why nobody else complained.

Still reproducable with Win 10 Pro 2004, Python 3.8, cp1252 locale.

Deleting hh.dat did not solve the problem for me.

--
nosy: +cito

___
Python tracker 

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



[issue40153] json dump with repeated key

2020-08-30 Thread Facundo Batista


Facundo Batista  added the comment:

The balance here is allow an invalid JSON to be created (but documenting that 
on some situations that will happen), or sticking to always produce valid 
JSONs, but with a hit in performance (which we don't know so far if it's big or 
small).

--

___
Python tracker 

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



[issue39102] Increase Enum performance

2020-08-30 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Guido van Rossum

Guido van Rossum  added the comment:

I think it’s reasonable to expect sys.argv to have at least one item,
possibly empty. The proposed fix of setting it to [“”] seems right to me.
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes

2020-08-30 Thread Johannes Reiff


Johannes Reiff  added the comment:

It has been almost a month since the last update, so pinging as suggested in 
the Developer's Guide. Do I need to do something before the PR can be merged?

--

___
Python tracker 

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



[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-08-30 Thread Ben Darnell


Ben Darnell  added the comment:

I've posted a pull request with a test and fix: 
https://github.com/python/cpython/pull/22017. It's a more targeted fix than 
cmeyer's PR (which I didn't even notice until now due to unfamiliarity with the 
BPO UI)

--

___
Python tracker 

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



[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-08-30 Thread Ben Darnell


Change by Ben Darnell :


--
pull_requests: +21117
pull_request: https://github.com/python/cpython/pull/22017

___
Python tracker 

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



[issue41666] fix

2020-08-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I agree with xtreak. I guess you probably misspelled the initial word:

>>> 'Python'[2:5]  # same as the tutorial
'tho'

>>> 'Pyhton'[2:5]  # misspelling
'hto'

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41615] sys.argv may be None or an empty list

2020-08-30 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

One possible option to guarantee initialization could be for PyInitialize to 
always call PySys_SetArgvEx(1, [""], 0), providing a default value for embedded 
interpreters that fail to call it.

--

___
Python tracker 

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



[issue41666] fix

2020-08-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing this as not a bug since the example seems to be correct. Feel free to 
reopen with more details if needed.

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



[issue41666] fix

2020-08-30 Thread M-o-T


Change by M-o-T :


--
title: Problem in tutorial/introduction.html#strings -> fix

___
Python tracker 

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



[issue41666] Problem in tutorial/introduction.html#strings

2020-08-30 Thread M-o-T


Change by M-o-T :


--
nosy:  -mohammadtavakoli1378

___
Python tracker 

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



[issue41666] Problem in tutorial/introduction.html#strings

2020-08-30 Thread M-o-T


New submission from M-o-T :

Hi, I found a problem with this address
https://docs.python.org/3/tutorial/introduction.html#strings

In here
>>> word[0:2]  # characters from position 0 (included) to 2 (excluded)
'Py'
>>> word[2:5]  # characters from position 2 (included) to 5 (excluded)
'tho'

In the second example word[2:5] becomes 'hto'

--
messages: 376104
nosy: mohammadtavakoli1378
priority: normal
severity: normal
status: open
title: Problem in tutorial/introduction.html#strings
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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-30 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 85ca9c049c5a490d143d28933bbb02ab80394ed8 by Miss Islington (bot) 
in branch '3.8':
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-22016)
https://github.com/python/cpython/commit/85ca9c049c5a490d143d28933bbb02ab80394ed8


--

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-30 Thread Dong-hee Na


Dong-hee Na  added the comment:

Thanks William

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-30 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 901c2eae6e27ee7793e5a3c638664e01a3bf8de8 by Miss Islington (bot) 
in branch '3.9':
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-21978)
https://github.com/python/cpython/commit/901c2eae6e27ee7793e5a3c638664e01a3bf8de8


--

___
Python tracker 

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



[issue41524] PyOS_mystricmp advances pointers too far

2020-08-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21116
pull_request: https://github.com/python/cpython/pull/22016

___
Python tracker 

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



[issue41665] Empty

2020-08-30 Thread Damien Ruiz


New submission from Damien Ruiz :

Didn't mean to create this and can't delete.

--
stage:  -> resolved
status: open -> closed
title: Function called -> Empty

___
Python tracker 

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



[issue41665] Function called

2020-08-30 Thread Damien Ruiz


Change by Damien Ruiz :


--
nosy: x_0euf
priority: normal
severity: normal
status: open
title: Function called

___
Python tracker 

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