[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread paul j3


paul j3  added the comment:

For custom handling of unrecognized arguments, use parser_known_args().  You 
don't need this new parameter.

--

___
Python tracker 

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



[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Miki Tebeka


Miki Tebeka  added the comment:

I think the lack sub second parts in these formats is a disadvantage.
There's a merit in using a standard but IMO it's more natural to write someting 
like "2s" in a configuration value than "P2S" which is more cryptic.

--

___
Python tracker 

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



[issue37894] [win] shutil.which can not find the path if 'cmd' include directory path and not include extension name

2020-07-09 Thread Wansoo Kim


Wansoo Kim  added the comment:

Can I solve this problem?

--
nosy: +ys19991

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread paul j3


paul j3  added the comment:

I didn't pay attention to the patch that added this "exit_on_error" parameter.  
So I don't know exactly what error handling it was supposed to handle or why.  
But given the location of the code change, it does not handle every possible 
error.

Specifically it's  in parser.parse_known_args() where it calls 
_parse_known_args().  With this parameter True, a argparse.ArgumentError is 
caught and converted to parse.error() call.  That's the original behavior.

With False, there's no special handling for ArgumentError.  Catching that is 
left to the developer, as illustrated in the docs.

In the documented example, it's a 'type' error. 'choices' would also behave 
this way. 'nargs' errors also.  But not all errors are handled like this.

Inside _parse_known_args(), `self.error()` is called several times, once for 
'required' arguments failure, and for a required mutually_exclusive_group 
error.  I count 9 self.error() calls; exit_on_error only changes one of those.

The error highlighted in this issue is called in parser.parse_args().  This 
calls parse_known_args(), and raises an error if there are 'extras', 
unrecognized strings.

So clearly the new docs is is describing this new parameter in overly broad 
terms.  It only changes the handling of a subset of parser.error() calls.  Off 
hand I can't think of clean way of refining the description without getting 
overly technical about the error handling.

Developers already had the documented option of changing the parse.error() and 
parse.exit() methods.

--

___
Python tracker 

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



[issue23802] patch: __deepcopy__ memo dict argument usage

2020-07-09 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:


New changeset 3cbade7d309ab1ea97ec286d19d506df30bd1ab7 by Joannah Nanjekye in 
branch 'master':
bpo-23802: patch: __deepcopy__ memo dict argument usage (GH-21326)
https://github.com/python/cpython/commit/3cbade7d309ab1ea97ec286d19d506df30bd1ab7


--

___
Python tracker 

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



[issue11354] argparse: nargs could accept range of options count

2020-07-09 Thread Christoph Anton Mitterer


Christoph Anton Mitterer  added the comment:

Next to code readability, there's IMO one could reason to properly support this 
would be a clean and easy way to get proper help strings for such options.

Of course I can do something like:
parser = argparse.ArgumentParser()
parser.add_argument("--foo", nargs="+", help="Mae govannen", metavar=("bar", 
"baz"))
args = parser.parse_args()

and later check that, say, only 2 arguments are allowed.

But the help text will be an ugly:
>$ python3 f.py --help
>usage: f.py [-h] [--foo bar [baz ...]]
>
>optional arguments:
>  -h, --help   show this help message and exit
>  --foo bar [baz ...]  Mae govannen

indicating that >1 options were allowed.

--
nosy: +calestyo

___
Python tracker 

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



[issue37766] IDLE autocomplete: revise fetch_completions, add htest

2020-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The attached tem4.py validates a refactoring of the mode ATTRS, what '' 
computation of bigl.  The removal of dict 'namespace' invalidates 

if "__all__" in bigl:
smalll = sorted(eval("__all__", namespace))

However, this small branch should be removed as explained in msg373432.  The 
removal will also fix an IDLE execution process crash resulting from a user 
bug.  Given "__all__ = [modname], Show Completions results in
TypeError: cannot pickle 'module' object
and a crash restart.

After "import modname", "modname." wait or Show Completions crashes due to 
if "__all__" in bigl:
smalll = sorted(entity.__all__)
Since this is needed, the fix is to filter entity.__all__.

--
Added file: https://bugs.python.org/file49311/tem4.py

___
Python tracker 

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



[issue27609] IDLE completions: format, factor, and fix

2020-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The removed post duplicates the content of #37766.  Another bug is reported and 
will be fixed there.

--

___
Python tracker 

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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PR 15138 always adds keywords to the big list for the current module.  They are 
also normally present in the small list, when it only excludes '_' names.  But 
if the module being edited contains '__all__', the small list, which is the 
first list presented, is currently just __all__.  This excludes builtins and 
now keywords and possibly non-_ names defined in the module.  I think this 
restriction is a mistake; __all__ defines a limited external view of the 
module.  It is not intended to restrict the names used in the module.  I will 
remove the restriction (and a crash bug it contains) in a partly completed PR 
for #37766.

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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8 by Miss Islington (bot) 
in branch '3.8':
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
https://github.com/python/cpython/commit/3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8


--

___
Python tracker 

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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset fd27fb7f3dd157294f05bb060f7efd243732ab2d by Miss Islington (bot) 
in branch '3.9':
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
https://github.com/python/cpython/commit/fd27fb7f3dd157294f05bb060f7efd243732ab2d


--

___
Python tracker 

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



[issue27609] IDLE completions: format, factor, and fix

2020-07-09 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg373259

___
Python tracker 

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



[issue38854] Decorator with paren tokens in arguments breaks inspect.getsource

2020-07-09 Thread daniel hahler


Change by daniel hahler :


--
title: Decorator breaks inspect.getsource -> Decorator with paren tokens in 
arguments breaks inspect.getsource

___
Python tracker 

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



[issue38854] Decorator breaks inspect.getsource

2020-07-09 Thread daniel hahler


Change by daniel hahler :


--
components: +Library (Lib)
type:  -> behavior
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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20572
pull_request: https://github.com/python/cpython/pull/21424

___
Python tracker 

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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +20571
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/21423

___
Python tracker 

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



[issue37765] IDLE: Include keywords in module-level autocomplete list

2020-07-09 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset bce2eb4646021910aa4074d86f44a09b32d0b2b2 by Terry Jan Reedy in 
branch 'master':
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
https://github.com/python/cpython/commit/bce2eb4646021910aa4074d86f44a09b32d0b2b2


--

___
Python tracker 

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



[issue41263] Convert code.__new__ to Argument Clinic

2020-07-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Argument Clinic is already used for code.replace(). The proposed PR converts 
code.__new__() to Argument Clinic.

--
components: Argument Clinic, Installation
messages: 373428
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Convert code.__new__ to Argument Clinic
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



[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

2020-07-09 Thread Arcadiy Ivanov


Change by Arcadiy Ivanov :


--
nosy: +vstinner

___
Python tracker 

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



[issue35919] multiprocessing: shared manager Pool fails with AttributeError

2020-07-09 Thread Felipe A. Hernandez


Change by Felipe A. Hernandez :


--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue35919] multiprocessing: shared manager Pool fails with AttributeError

2020-07-09 Thread Felipe A. Hernandez


Felipe A. Hernandez  added the comment:

import traceback
import multiprocessing.managers


class MyManager(multiprocessing.managers.SyncManager):
pass

class DictList(multiprocessing.managers.BaseProxy):
_method_to_typeid_ = {'__getitem__': 'dict'}

def __getitem__(self, key):
return self._callmethod('__getitem__', (key,))

MyManager.register('DictList', None, DictList)

with MyManager() as manager:

nested = manager.DictList([{'hello': 'world'}])
print(nested[0]['hello'])  # world

proxy = manager.list([nested])
try:
print(proxy[0][0]['hello'])
except AttributeError:
traceback.print_exc()
print("""
Bug: AttributeError: ProxyBase._callmethod is None
--

This error is raised because proxies returned as #RETURN messages
have no manager reference, which is required to resolve typeids
(using BaseManager._registry).

Only proxies returned as #PROXY messages will be fully functional.

This is an undocumented current implementation limitation.

Fix (proposal)
--

Include the manager class (not the instance) as part of the proxy
serialization in BaseProxy.__reduce__, as BaseManager._registry is
a class variable.

Note: #PROXY message protocol can be also replaced by regular proxy
  serialization after this fix, resulting on simpler codebase.
""")

--
nosy: +Felipe A. Hernandez

___
Python tracker 

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



[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Peter Otten


Peter Otten <__pete...@web.de> added the comment:

While I don't want to start a philosical discussion -- is that really better? 
Finding adverbs with a regex doesn't work in the general case -- think 
butterfly, panoply, well -- and the example is meant to illustrate the usage of 
re.findall() rather than regex syntax.

"finding adverbs" is just shorter and easier to understand than "finding 
sequences of word characters that end with "ly".

--
nosy: +peter.otten

___
Python tracker 

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



[issue41262] Convert memoryview to Argument Clinic

2020-07-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue41262] Convert memoryview to Argument Clinic

2020-07-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Argument Clinic, Interpreter Core -Extension Modules
nosy: +larry

___
Python tracker 

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



[issue41262] Convert memoryview to Argument Clinic

2020-07-09 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR converts Objects/memoryobject.c to Argument Clinic.

Advantages:

* Highly optimized code is used to parse arguments instead of slow 
PyArg_ParseTupleAndKeywords().
* All future improvements of argument parsing (better performance or errors 
handling) will be automatically applied to memoryobject.

Previously Argument Clinic was used for memoryview.hex().

--
components: Extension Modules
messages: 373425
nosy: serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: Convert memoryview to Argument Clinic
type: performance
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



[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Anthony Sottile


Anthony Sottile  added the comment:

awesome, I'm going to work through this with someone in my discord as a demo / 
mentorship opportunity -- hope that's ok!

--

___
Python tracker 

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



[issue41251] __future__.barry_as_FLUFL.getMandatoryRelease() is wrong

2020-07-09 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Thanks for keeping the first 'F' in FLUFL!  :D

--

___
Python tracker 

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



[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Rim Chatti


Rim Chatti  added the comment:

re.findall(r"\w+ly", text) does not find all adverbs in a sentence, it finds 
words that contain ly (not ending with ly) :
if text= 'andlying clearly', output: [andly, clearly]
which is wrong! 
the right way to do this is re.findall(r'\b\w+ly\b',text)
output= clearly!

--
components: +Regular Expressions -Documentation
keywords: +patch
message_count: 2.0 -> 3.0
nosy: +ezio.melotti, mrabarnett
nosy_count: 3.0 -> 5.0
pull_requests: +20569
stage:  -> patch review
type:  -> behavior
pull_request: https://github.com/python/cpython/pull/21420

___
Python tracker 

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



[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Paul Ganssle


Paul Ganssle  added the comment:

I think a positional-only argument would be the best option if we could do it, 
but it would be a backwards-incompatible change and it's probably not worth the 
hassle.

If anyone is using the keyword argument, they're probably using `format=` 
rather than `fmt=`, since it's pretty rare for anyone to use the pure python 
version of datetime. PyPy uses it, but I think they tend to aim for consistency 
with the C API of CPython, and it seems like they already patch s/fmt/format/ 
themselves: 
https://foss.heptapod.net/pypy/pypy/-/blob/branch/default/lib_pypy/datetime.py#L781

If anyone wants to make a PR I think we can fix this for 3.10, though 
unfortunately because it is an API change it can't be backported. I think in 
typeshed they can safely change from `fmt` to `format` even today (which would 
almost certainly be more accurate to end user use cases).

--
nosy:  -rkm
stage:  -> needs patch

___
Python tracker 

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



[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Ruairidh MacLeod


Change by Ruairidh MacLeod :


--
nosy: +rkm

___
Python tracker 

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



[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

2020-07-09 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

$ PYTHONWARNINGS=ignore gdb --args 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python
 ./repro.py 
GNU gdb (GDB) Fedora 9.1-5.fc32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python...
(gdb) run
Starting program: 
/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python
 ./repro.py
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.31-2.fc32.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after fork from child process 185113]
{'_platform': 'linux', '_os_name': 'posix', '_executable': 
('/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin/python',),
 '_exec_dir': 
'/home/arcivanov/Documents/src/arcivanov/pybuilder/target/venv/test/cpython-3.9.0.beta.4/bin',
 '_name': 'CPython', '_type': 'cpython', '_version': (3, 9, 0, 'beta', 4), 
'_is_pypy': False, '_is_64bit': True, '_versioned_dir_name': 
'cpython-3.9.0.beta.4', '_environ': {'SHELL': '/bin/bash', 'SESSION_MANAGER': 
'local/unix:@/tmp/.ICE-unix/6175,unix/unix:/tmp/.ICE-unix/6175', 'WINDOWID': 
'56623111', 'COLORTERM': 'truecolor', 'PYENV_SHELL': 'bash', 'XDG_CONFIG_DIRS': 
'/etc/xdg:/usr/share/kde-settings/kde-profile/default/xdg', 'HISTCONTROL': 
'ignoredups', 'XDG_MENU_PREFIX': 'kf5-', 'rvm_prefix': '/home/arcivanov', 
'HISTSIZE': '-1', 'HOSTNAME': 'ai-karellen-lap', 'LANGUAGE': '', 'JAVA_HOME': 
'/home/arcivanov/devhome/current/jdk', 'SSH_AUTH_SOCK': 
'/tmp/ssh-2nZCuLIsvvyW/agent.5125', 'SHELL_SESSION_ID': '1fe1a56ee9dd4fac
 8589a5eebfb3e6b0', 'DEV_HOME': '/home/arcivanov/devhome/current', 
'MY_RUBY_HOME': '/home/arcivanov/.rvm/rubies/ruby-2.4.3', 'ANT_HOME': 
'/home/arcivanov/devhome/current/ant', 'XDM_MANAGED': 'method=classic', 
'DESKTOP_SESSION': 'default', 'RBENV_SHELL': 'bash', 'SSH_AGENT_PID': '5854', 
'GTK_RC_FILES': 
'/etc/gtk/gtkrc:/home/arcivanov/.gtkrc:/home/arcivanov/.config/gtkrc', 
'GDK_CORE_DEVICE_EVENTS': '1', 'XCURSOR_SIZE': '32', 'RUBY_VERSION': 
'ruby-2.4.3', 'XDG_SEAT': 'seat0', 'PWD': 
'/home/arcivanov/Documents/src/arcivanov/pybuilder', 'PYENV_VIRTUALENV_INIT': 
'1', 'LOGNAME': 'arcivanov', 'XDG_SESSION_TYPE': 'x11', 'MODULESHOME': 
'/usr/share/Modules', 'rvm_version': '1.29.10 (latest)', 'MANPATH': 
'/home/arcivanov/devhome/current/jdk/man:/home/arcivanov/devhome/current/postgres-xl/share/man:/home/arcivanov/devhome/current/haproxy/share/man:/home/arcivanov/devhome/current/jdk/man:/home/arcivanov/devhome/current/postgres-xl/share/man:/home/arcivanov/devhome/current/haproxy/share/man::',
 '_'
 : '/usr/bin/gdb', 'XAUTHORITY': '/tmp/xauth-1000-_0',
 'SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS': '0', 'WINDOWPATH': '1', 'LINES': '221', 
'GTK2_RC_FILES': 
'/etc/gtk-2.0/gtkrc:/home/arcivanov/.gtkrc-2.0:/home/arcivanov/.gtkrc-2.0-kde4:/home/arcivanov/.config/gtkrc-2.0',
 'HOME': '/home/arcivanov', 'SSH_ASKPASS': '/usr/bin/ksshaskpass', 'LANG': 
'en_US.UTF-8', 'LS_COLORS': 
'rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;
 

[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

2020-07-09 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

This is in the 3.9 branch as of a0a6f1167834c87f12e2eca11dd77143103e7691

--

___
Python tracker 

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



[issue41261] 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval

2020-07-09 Thread Arcadiy Ivanov


New submission from Arcadiy Ivanov :

"Short" reproducer:


repro.py:

```
import sys
from os import getcwd, chdir
from runpy import run_path


def smoke_test(script, *args):
old_argv = list(sys.argv)
del sys.argv[:]
sys.argv.append(script)
sys.argv.extend(args)

old_modules = dict(sys.modules)
old_meta_path = list(sys.meta_path)
old_cwd = getcwd()

try:
return run_path(script, run_name="__main__")
except SystemExit as e:
if e.code:
print("Test did not exit successfully")
finally:
del sys.argv[:]
sys.argv.extend(old_argv)

sys.modules.clear()
sys.modules.update(old_modules)

del sys.meta_path[:]
sys.meta_path.extend(old_meta_path)
chdir(old_cwd)


smoke_test("script.py")

smoke_test("script.py")
```

script.py:

```
import sys
import subprocess
import ast

_PYTHON_INFO_SCRIPT = """import platform, sys, os, sysconfig
_executable = os.path.normcase(os.path.abspath(getattr(sys, "_base_executable", 
sys.executable)))
_platform = sys.platform
if _platform == "linux2":
_platform = "linux"
print({
"_platform": _platform,
"_os_name": os.name,
"_executable": (_executable, ),
"_exec_dir": 
os.path.normcase(os.path.abspath(os.path.dirname(_executable))),
"_name": platform.python_implementation(),
"_type": platform.python_implementation().lower(),
"_version": tuple(sys.version_info),
"_is_pypy": "__pypy__" in sys.builtin_module_names,
"_is_64bit": (getattr(sys, "maxsize", None) or getattr(sys, "maxint")) > 2 
** 32,
"_versioned_dir_name": "%s-%s" % (platform.python_implementation().lower(), 
".".join(str(f) for f in sys.version_info)),
"_environ": dict(os.environ),
"_darwin_python_framework": sysconfig.get_config_var("PYTHONFRAMEWORK")
})
"""

result = subprocess.check_output([sys.executable, "-c", _PYTHON_INFO_SCRIPT], 
universal_newlines=True)
python_info = ast.literal_eval(result)
print(python_info)

```

--
components: Interpreter Core
messages: 373418
nosy: arcivanov
priority: normal
severity: normal
status: open
title: 3.9-dev SEGV in object_recursive_isinstance in ast.literal_eval
type: crash
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



[issue41194] Python 3.9.0b3 crash on compile() in PyAST_Check() when the _ast module is loaded more than once

2020-07-09 Thread Arcadiy Ivanov


Arcadiy Ivanov  added the comment:

Ok, then. I'll open a new bug.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue40832] hi param in bisect module should not accept negative values

2020-07-09 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

If the implementation made it easy, I would add the check.  But since it would 
be an invasive change, I'm inclined to pass on it because it is so uncommon — 
the lo and hi arguments are rarely used, even more rarely with a negative hi 
paired with a non-negative lo  — I've never seen this arise in practice ever.

If someone does find a real-world case where this was problematic, feel free to 
reopen this and we'll find a way to squeeze in the extra range check.

--
resolution:  -> wont fix
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



[issue41172] test_peg_generator C tests fail on Windows ARM

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset c65ee555124a5647b8e3a5d58c906fa5db9e927a by Miss Islington (bot) 
in branch '3.9':
bpo-41172: Fix check for compiler in test suite (GH-21400)
https://github.com/python/cpython/commit/c65ee555124a5647b8e3a5d58c906fa5db9e927a


--

___
Python tracker 

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



[issue33754] f-strings should be part of the Grammar

2020-07-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I share Eric's concern about "unknowingly changing the behavior of f-strings."

--
nosy: +rhettinger

___
Python tracker 

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



[issue41250] Number separators in different places

2020-07-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you for the suggestion, but we'll decline for the reasons listed in the 
PEP and those listed by Eric.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Please submit a PR.

The parenthesis are not needed:
   re.findall(r"\b\w+ly\b", text)

--
keywords: +easy
nosy: +rhettinger
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.5

___
Python tracker 

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



[issue41172] test_peg_generator C tests fail on Windows ARM

2020-07-09 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue41172] test_peg_generator C tests fail on Windows ARM

2020-07-09 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +20568
pull_request: https://github.com/python/cpython/pull/21419

___
Python tracker 

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



[issue41172] test_peg_generator C tests fail on Windows ARM

2020-07-09 Thread Steve Dower


Steve Dower  added the comment:


New changeset af56c4fc76ac39ce76d649d7bebf7f78c1add4fa by Steve Dower in branch 
'master':
bpo-41172: Fix check for compiler in test suite (GH-21400)
https://github.com/python/cpython/commit/af56c4fc76ac39ce76d649d7bebf7f78c1add4fa


--

___
Python tracker 

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



[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

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



[issue37179] asyncio loop.start_tls() provide support for TLS in TLS

2020-07-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

> The aiohttp issue says they won't fix this until asyncio supports it. Kinda 
> understand that.

I saw you opened an issue with aiohttp to allow this and they're open to it. I 
hope that will get some movement. It also would be a big test for uvloop's (and 
3.10 asyncio) TLS implementation.

--

___
Python tracker 

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



[issue41247] asyncio.set_running_loop() cache running loop holder

2020-07-09 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 0b6169e391ce6468aad711f08ffb829362293ad5 by Tony Solomonik in 
branch '3.8':
bpo-41247: asyncio.set_running_loop() cache running loop holder (#21406)
https://github.com/python/cpython/commit/0b6169e391ce6468aad711f08ffb829362293ad5


--

___
Python tracker 

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



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-09 Thread Yury Selivanov


Yury Selivanov  added the comment:

> So how about maybe:   

That wouldn't work. You still haven't explained what's wrong with calling `loop 
= asyncio.get_running_loop()` inside `async def main()`. That literally solves 
all problems without the need of us modifying any APIs.

--

___
Python tracker 

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



[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Anthony Sottile


New submission from Anthony Sottile :

C:

https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Modules/_datetimemodule.c#L3183

pure python:

https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Lib/datetime.py#L927


this makes it difficult to properly type in mypy:

https://github.com/python/typeshed/blob/209b6bb127f61fe173a60776e23883ac450cf1c8/stdlib/2and3/datetime.pyi#L55

and calling with `.strftime(fmt=...)` or `.strftime(format=...)` is inconsistent

(that said, it should _probably_ be a positional-only argument)

--
components: Extension Modules, Library (Lib)
messages: 373407
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: datetime: strftime method takes different keyword argument: fmt (pure) 
or format (C)
type: behavior
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



[issue41259] Find adverbs is not correct on the documentation

2020-07-09 Thread Rim Chatti


Change by Rim Chatti :


--
title: Find adverbs is not correct -> Find adverbs is not correct on the 
documentation

___
Python tracker 

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



[issue41259] Find adverbs is not correct

2020-07-09 Thread Rim Chatti


New submission from Rim Chatti :

re.findall(r"\w+ly", text) does not find all adverbs in a sentence, it finds 
words that contain ly (not ending with ly) :
if text= 'andlying clearly', output: [andly, clearly]
which is wrong! 
the right way to do this is re.findall(r'\b(\w+ly)\b',text)
output= clearly!

--
assignee: docs@python
components: Documentation
messages: 373406
nosy: Rim Chatti, docs@python
priority: normal
severity: normal
status: open
title: Find adverbs is not correct
versions: Python 3.5

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-07-09 Thread mohamed koubaa


Change by mohamed koubaa :


--
pull_requests: +20567
pull_request: https://github.com/python/cpython/pull/21418

___
Python tracker 

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



[issue41004] [CVE-2020-14422] Hash collisions in IPv4Interface and IPv6Interface

2020-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
title: Hash collisions in IPv4Interface and IPv6Interface -> [CVE-2020-14422] 
Hash collisions in IPv4Interface and IPv6Interface

___
Python tracker 

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



[issue41258] CVE-2020-14422

2020-07-09 Thread STINNER Victor


Change by STINNER Victor :


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



[issue41258] CVE-2020-14422

2020-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: vstinner
priority: normal
severity: normal
status: open
title: CVE-2020-14422

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread Matthew Hughes


Matthew Hughes  added the comment:

I've attached a patch containing tests showing the current behavior, namely 
that exit_on_error does not change the behavior of 
argparse.ArgumentParser.parse_args in either case:

* An unrecognized option is given
* A required option is not given

Should the docs be updated to note this?

--
keywords: +patch
Added file: https://bugs.python.org/file49310/exit_on_error_tests.patch

___
Python tracker 

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



[issue39981] Default values for AST Nodes

2020-07-09 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +20566
pull_request: https://github.com/python/cpython/pull/21417

___
Python tracker 

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



[issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw()

2020-07-09 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw()

2020-07-09 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 8b33961e4bc4020d8b2d5b949ad9d5c669300e89 by Chris Jerdonek in 
branch 'master':
bpo-29590: fix stack trace for gen.throw() with yield from (#19896)
https://github.com/python/cpython/commit/8b33961e4bc4020d8b2d5b949ad9d5c669300e89


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-07-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 96a6a6d42be272a27562d98549bbffc0d1854669 by Hai Shi in branch 
'master':
bpo-40275: Use new test.support helper submodules in tests (GH-21412)
https://github.com/python/cpython/commit/96a6a6d42be272a27562d98549bbffc0d1854669


--

___
Python tracker 

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



[issue41257] mimetypes.guess_extension('video/x-matroska') return wrong value

2020-07-09 Thread Saber Hayati


New submission from Saber Hayati :

Code:
import mimetypes
print(mimetypes.guess_extension('video/x-matroska'))
# return '.mpv' instead of '.mkv'

Python 3.8.3 on Linux

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 373402
nosy: Saber Hayati
priority: normal
severity: normal
status: open
title: mimetypes.guess_extension('video/x-matroska') return wrong value
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



[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-07-09 Thread Mark Shannon


Mark Shannon  added the comment:

issue29590 is unrelated

--

___
Python tracker 

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



[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Martin Panter


Martin Panter  added the comment:

I don't know how much support this will get since there is already a 
str(timedelta) operation defined with a different format. But I don't like that 
format much. The day[s] part is too verbose, the H:MM:SS part could too easily 
be interpreted as D:HH:MM, and the result for negative deltas is horrible (-43 
days, 23:59:55; see Issue 38701).

My favourite format for a duration is usually the HTML 5 format like

1w 0d 12h 0m 27s

Another option is ISO 8601 format:

P1W0DT12H0M27S

But both of these standards only go down to the seconds unit, so 50 ms has to 
be 0.05s or PT0.05S.

--
nosy: +martin.panter

___
Python tracker 

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



[issue40327] list(sys.modules.items()) can throw RuntimeError: dictionary changed size during iteration

2020-07-09 Thread Nir Soffer


Nir Soffer  added the comment:

Does this really affect only python 3.7?

We see this in RHEL 8.2, using python 3.6.8:
https://bugzilla.redhat.com/show_bug.cgi?id=1837199#c69

Likely caused by:

lvs = dict(self._lvs)

Without locking. self._lvs is a dict that may contain 1000's of items.

I'm not sure if this is relvant now for upstream, but backport to 3.6 would be 
useful.

--
nosy: +nirs

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 1e66f7e102b64da5a6d69b135cf7d82708aca231 by Miss Islington (bot) 
in branch '3.8':
bpo-41199: Docstring convention not followed for dataclasses documentation page 
(GH-21413)
https://github.com/python/cpython/commit/1e66f7e102b64da5a6d69b135cf7d82708aca231


--

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset b4beda1a865972dc6477fd84b1a96ff5ccbfb45a by Miss Islington (bot) 
in branch '3.9':
bpo-41199: Docstring convention not followed for dataclasses documentation page 
(GH-21413)
https://github.com/python/cpython/commit/b4beda1a865972dc6477fd84b1a96ff5ccbfb45a


--

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 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



[issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-07-09 Thread Larry Hastings


Larry Hastings  added the comment:

Any news?

--

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20564
pull_request: https://github.com/python/cpython/pull/21415

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20563
pull_request: https://github.com/python/cpython/pull/21414

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 61bb24a270d15106decb1c7983bf4c2831671a75 by marload in branch 
'master':
bpo-41199: Docstring convention not followed for dataclasses documentation page 
(GH-21413)
https://github.com/python/cpython/commit/61bb24a270d15106decb1c7983bf4c2831671a75


--
nosy: +miss-islington

___
Python tracker 

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



[issue41199] Docstring convention not followed for dataclasses documentation page

2020-07-09 Thread Wansoo Kim


Change by Wansoo Kim :


--
keywords: +patch
pull_requests: +20562
pull_request: https://github.com/python/cpython/pull/21413

___
Python tracker 

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



[issue40275] test.support has way too many imports

2020-07-09 Thread hai shi


Change by hai shi :


--
pull_requests: +20561
pull_request: https://github.com/python/cpython/pull/21412

___
Python tracker 

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



[issue41033] readline.c: SEGFAULT on SIGWINCH when loaded twice

2020-07-09 Thread daniel hahler


daniel hahler  added the comment:

91e1bc18bd (bpo-41194) reminded me of this.
Maybe the same mechanism could be used here.

--

___
Python tracker 

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread Christian Heimes


Christian Heimes  added the comment:

Thanks!

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 90584c02b4dcfc087bee5e4131b7ba72b669d58a by Miss Islington (bot) 
in branch '3.9':
bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() 
(GH-21407)
https://github.com/python/cpython/commit/90584c02b4dcfc087bee5e4131b7ba72b669d58a


--

___
Python tracker 

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset 54babbe976531d4d1c21ea415f71e7c6846e15bc by Miss Islington (bot) 
in branch '3.8':
bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() 
(GH-21407)
https://github.com/python/cpython/commit/54babbe976531d4d1c21ea415f71e7c6846e15bc


--

___
Python tracker 

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



[issue41202] Allow to provide custom exception handler to asyncio.run()

2020-07-09 Thread tomaszdrozdz


tomaszdrozdz  added the comment:

OK.  
I understand.  

So how about maybe:  

def run(main, *, debug=False, loop=None):  
...  

if loop:  
loop = events.new_event_loop()

So we could customize loop like:  

loop = events.new_event_loop()  
loop.set_XXX(...)  
asyncio.run(my_coro, loop=loop)  

Just what tehn with debug parameter ?

--

___
Python tracker 

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



[issue41256] activate script created by venv is not smart enough

2020-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20559
pull_request: https://github.com/python/cpython/pull/21410

___
Python tracker 

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20560
pull_request: https://github.com/python/cpython/pull/21411

___
Python tracker 

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



[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-07-09 Thread Chris Jerdonek


Chris Jerdonek  added the comment:

Mark, I want to flag issue29590 for you ("Incorrect stack traces when 
re-entering a generator/coroutine stack via .throw()") in case this issue 
relates to or would help at all with that.

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue41252] Incorrect reference counting in _ssl.c's _servername_callback()

2020-07-09 Thread miss-islington


miss-islington  added the comment:


New changeset ee96f32ca24779656d3c8736d26671fc3689f0a3 by Zackery Spytz in 
branch 'master':
bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() 
(GH-21407)
https://github.com/python/cpython/commit/ee96f32ca24779656d3c8736d26671fc3689f0a3


--
nosy: +miss-islington

___
Python tracker 

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



[issue41251] __future__.barry_as_FLUFL.getMandatoryRelease() is wrong

2020-07-09 Thread Christian Heimes


Christian Heimes  added the comment:

It's an easter egg and internal joke. Barry would be disapointed if we would 
deprive him of his title.

--
nosy: +barry, christian.heimes
resolution:  -> wont fix
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



[issue41256] activate script created by venv is not smart enough

2020-07-09 Thread kunaltyagi


New submission from kunaltyagi :

TLDR: `activate` script should be able to:
* inform user if it has been run and not sourced
* act as a placeholder to detect the shell being used and source the necessary 
`activate.{SHELL}` instead of throwing an error

---
It's mildly infuriating that `activate` on different setups needs to be called 
differently. The lack of messages when it's not sourced is also beginner 
unfriendly.

Both the issues are relatively easy to fix. First, making it shell agnostic. We 
can move the contents of `activate` to `activate.sh` and change `activate` to 
contain code like:
```sh
[ $FISH_VERSION ] && . activate.fish
[ $BASH_VERSION ] && . activate.sh
...
```

This of course will fail hard when you try to `. /bin/activate`. 
Finding the path of the file is not trivial, but doable. If we assume `dirname` 
is not present on the system, we can use `/activate.`.

Making the "sourced or ran" logic shell agnostic is slightly easier to 
accomplish due to `$_`, `$0`, `$BASH_SOURCE`.

It'll possibly take a non-trivial amount of code to accomplish something this 
trivial, but it'll save people with custom shells 3 keystrokes and make the 
workflow smoother.

--
components: Library (Lib)
messages: 373386
nosy: kunaltyagi
priority: normal
severity: normal
status: open
title: activate script created by venv is not smart enough
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread Matthew Hughes


Matthew Hughes  added the comment:

> typo in the docs that it should have used enabled instead of enable

Well spotted, I'll happily fix this up.

> I guess the docs by manually mean that ArgumentError will be raised when 
> exit_on_error is False that can be handled.

To be clear, in this case, even with exit_on_error=False, ArgumentError is 
_not_ being raised, but SystemExit is.

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



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

2020-07-09 Thread Julien Palard

Julien Palard  added the comment:

Strange fact, this was already fixed in 
011525ee92eb1c13ad1a62d28725a840e28f8160 (which closes issue10761, nice spot 
Andrew) but was lost during a merge in 0d28a61d23:

$ git show 0d28a61d23
commit 0d28a61d233c02c458c8b4a25613be2f4979331e
Merge: ed3a303548 d7c9d9cdcd

$ git show 0d28a61d23:Lib/tarfile.py | grep unlink  # The merge commit does no 
longer contains the fix

$ git show ed3a303548:Lib/tarfile.py | grep unlink  # The "left" parent does 
not contains it neither

$ git show d7c9d9cdcd:Lib/tarfile.py | grep unlink  # The "right" one does 
contains it.
os.unlink(targetpath)
os.unlink(targetpath)

Stranger fact, the test was not lost during the merge, and still lives today 
(test_extractall_symlinks).

Happen that the current test is passing because it's in part erroneous, instead 
of trying to create a symlink on an existing one, it creates a symlink far far 
away:

(Pdb) p targetpath
'/home/mdk/clones/python/cpython/@test_648875_tmp-tardir/testsymlinks/home/mdk/clones/python/cpython/@test_648875_tmp-tardir/testsymlinks/symlink'

Aditionally it passes anway because tar.errorlevel equals 1, which means the 
error is logged but not raised.

With the following small patch:

--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -1339,10 +1339,10 @@ class WriteTest(WriteTestBase, unittest.TestCase):
 f.write('something\n')
 os.symlink(source_file, target_file)
 with tarfile.open(temparchive, 'w') as tar:
-tar.add(source_file)
-tar.add(target_file)
+tar.add(source_file, arcname="source")
+tar.add(target_file, arcname="symlink")
 # Let's extract it to the location which contains the symlink
-with tarfile.open(temparchive) as tar:
+with tarfile.open(temparchive, errorlevel=2) as tar:
 # this should not raise OSError: [Errno 17] File exists
 try:
 tar.extractall(path=tempdir)


the error is raised as expected: FileExistsError: [Errno 17] File exists: 
'/home/mdk/clones/python/cpython/@test_649794_tmpæ-tardir/testsymlinks/source' 
-> 
'/home/mdk/clones/python/cpython/@test_649794_tmpæ-tardir/testsymlinks/symlink'

I'm opening an PR to restore this as it was intended.

--

___
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-07-09 Thread Julien Palard


Change by Julien Palard :


--
pull_requests: +20558
pull_request: https://github.com/python/cpython/pull/21409

___
Python tracker 

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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I guess the docs by manually mean that ArgumentError will be raised when 
exit_on_error is False that can be handled. By default with exit_on_error being 
True self.error() which raises SystemExit and catching SystemExit can mask 
other errors. This was added in bpo-9938 with GH-15362. There is also a typo in 
the docs that it should have used enabled instead of enable in "the feature can 
be enable by setting exit_on_error to False"

--
nosy: +paul.j3, rhettinger, xtreak
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



[issue41255] Argparse.parse_args exits on unrecognized option with exit_on_error=False

2020-07-09 Thread Matthew Hughes


New submission from Matthew Hughes :

>>> import argparse
>>> parser = argparse.ArgumentParser(exit_on_error=False)
>>> parser.parse_args(["--unknown"])
usage: [-h]
: error: unrecognized arguments: --unknown

The docs https://docs.python.org/3.10/library/argparse.html#exit-on-error say:

> Normally, when you pass an invalid argument list to the parse_args() method 
> of an ArgumentParser, it will exit with error info.
> If the user would like catch errors manually, the feature can be enable by 
> setting exit_on_error to False:

This description _appears_ to be at odds with the observed behavior.

--
components: Library (Lib)
messages: 373382
nosy: mhughes
priority: normal
severity: normal
status: open
title: Argparse.parse_args exits on unrecognized option with exit_on_error=False
type: behavior
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



[issue41237] Access violation in python39.dll!meth_dealloc on exit

2020-07-09 Thread Christoph Gohlke


Christoph Gohlke  added the comment:

This issue seems specific to C extensions built with pybind11 (using 2.5.0 and 
master branch). Building the minimal example at 
https://github.com/pybind/python_example and running `python.exe -c"import 
python_example"` will crash at exit.

--
status: open -> closed

___
Python tracker 

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



[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle
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



[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Miki Tebeka


New submission from Miki Tebeka :

I suggest adding datetime.timedelta methods that convert to/from str.

The reason is that I have several places where configuration contains various 
timeouts. I'd like to write '50ms' and not 0.05 which is more human readable.

See https://golang.org/pkg/time/#ParseDuration for how Go does it.

--
components: Library (Lib)
messages: 373380
nosy: tebeka
priority: normal
severity: normal
status: open
title: Add to/from string methods to datetime.timedelta
type: enhancement

___
Python tracker 

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



[issue41250] Number separators in different places

2020-07-09 Thread Eric V. Smith


Eric V. Smith  added the comment:

The formatting specification language is already complicated enough without 
adding even more to it. As PEP 378 says "It is not the goal to replace the 
locale module, to perform internationalization tasks, or accommodate every 
possible convention."

Your best bet is to write your own formater and use that:

f'{formater(v)}'

You could also pass it whatever parameters you want, like specifying the number 
of digits or the separator or whether to use the locale to determine these 
things.

The PEP suggests Babel (http://babel.pocoo.org/en/latest/), which I don't have 
any experience with, but seems pretty complete.

--

___
Python tracker 

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