[issue38689] IDLE crashes when KeyError is raised during calltip generation

2019-11-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Further experiments suggest a fix for the hang, which is not specific to this 
example.  See new issue #38695.

--
stage:  -> test needed
type:  -> behavior
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue38695] IDLE should restart instead of hanging when subprocess exits

2019-11-04 Thread Terry J. Reedy


New submission from Terry J. Reedy :

This is a spinoff from #38689, about 'strange_callable(' in Shell hanging, 
because there is an uncaught exception is the run process.  (See issue for 
'strange_callable'.)  Running IDLE from Windows Command Prompt, Windows 
eventually shows the circle cursor.  Clicking on the window turns it gray and 
trying to close it by clicking 'X' brings up 'Python is not responding' with 
options to Wait, Close, or Try to Restore.  I have seen this before with other 
code.

Restore results in the GUI process RESTARTing a run process and the following 
in the console.

Exception in Tkinter callback
Traceback (most recent call last):
  File "f:\dev\3x\lib\idlelib\rpc.py", line 359, in pollpacket
s = self.sock.recv(BUFSIZE)
ConnectionResetError: [WinError 10054] An existing connection was forcibly 
closed by the remote host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "f:\dev\3x\lib\idlelib\rpc.py", line 432, in pollresponse
message = self.pollmessage(wait)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 384, in pollmessage
packet = self.pollpacket(wait)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 361, in pollpacket
raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "f:\dev\3x\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
  File "f:\dev\3x\lib\idlelib\multicall.py", line 176, in handler
r = l[i](event)
  File "f:\dev\3x\lib\idlelib\calltip.py", line 51, in try_open_calltip_event
self.open_calltip(False)
  File "f:\dev\3x\lib\idlelib\calltip.py", line 70, in open_calltip
argspec = self.fetch_tip(expression)
  File "f:\dev\3x\lib\idlelib\calltip.py", line 95, in fetch_tip
return rpcclt.remotecall("exec", "get_the_calltip",
  File "f:\dev\3x\lib\idlelib\rpc.py", line 219, in remotecall
return self.asyncreturn(seq)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 248, in asyncreturn
response = self.getresponse(seq, wait=0.05)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 291, in getresponse
response = self._getresponse(myseq, wait)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 311, in _getresponse
response = self.pollresponse(myseq, wait)
  File "f:\dev\3x\lib\idlelib\rpc.py", line 436, in pollresponse
self.handle_EOF()
  File "f:\dev\3x\lib\idlelib\pyshell.py", line 389, in handle_EOF
raise EOFError
EOFError

(Close, after confirmation, results in nothing except the Windows > prompt.)

This suggests to me that the remote process running idlelib.run should have an 
outer try-except that catches everything and sends "I am stopping" before 
exiting.  The GUI process would then RESTART a new subprocess.  There are 
conditions under which this already happens, so it seems that the current 
trigger just needs to be broadened.

--
assignee: terry.reedy
components: IDLE
messages: 356009
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE should restart instead of hanging when subprocess exits
type: behavior

___
Python tracker 

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



[issue38689] IDLE crashes when KeyError is raised during calltip generation

2019-11-04 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since isinstance(Object.__call__, types.MethodType) is False, the 'fob' in 
'inspect.signature(fob)' is Object.  (See the initial get_argspec code.)  
Indeed, 'inspect.signature(Object)' results in the traceback following 
inspect.signature(fob) and 'isinstance(Object, types.MethodType)' results in 
the last line thereof.  Not returning 'False' strikes me as maybe a bug in 
'isinstance'.  Have you opened a report for this?  

Directly importing and executing  idlelib code is not supported (its is 
'private'), but entering 'Object(' to cause IDLE to make the same call is.  And 
the result is worse than the exception.  The IDLE gui process hangs, waiting 
for the response from the socket connection to the user code process that never 
comes.  This is clearly a bug, regardless of whether the user code is buggy.

The relevant section of get_argspec is

try:
argspec = str(inspect.signature(fob))
except ValueError as err:
msg = str(err)
if msg.startswith(_invalid_method):
return _invalid_method

Signature() is documented as returning either ValueError or TypeError, and with 
the 'bug' in isinstance, others are possible.  So any error should be caught.  
(The default of falling through and checking for a docstring signature is 
correct.)

--

___
Python tracker 

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



[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

2019-11-04 Thread pascalhofmann


pascalhofmann  added the comment:

0.0.0.0/0 is a network with addresses from 0.0.0.0 to 255.255.255.255.
0.0.0.0/8 is a network with addresses from 0.0.0.0 to 0.255.255.255.

So 4278190080 out of 4294967296 addresses in 0.0.0.0/0 clearly are no private 
addresses.

--

___
Python tracker 

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



[issue38694] docs.python.org does not switch version properly

2019-11-04 Thread Dong-hee Na


New submission from Dong-hee Na :

1. open https://docs.python.org/3.8/whatsnew/3.8.html
2. choose dev (3.9)
3. 3.9 whats news should be shown but still showing 3.8

--
assignee: docs@python
components: Documentation
messages: 356006
nosy: corona10, docs@python
priority: normal
severity: normal
status: open
title: docs.python.org does not switch version properly
type: behavior

___
Python tracker 

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



[issue38693] Use f-strings instead of str.format within importlib

2019-11-04 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue38590] argparse unexpected behavior with argument group inside mutually exclusive group

2019-11-04 Thread paul j3


paul j3  added the comment:

With one exception, groups are not designed or intended to be nested.  But by 
inheritance (from _ActionsContainer) nesting isn't blocked nor does it raise 
any errors.

As you surmise, an ArgumentGroup, is used only for grouping the help lines.  By 
default that are two groups, with 'optionals' and 'required' names (actually 
the later should be 'positional').  The rest are user defined.  They don't 
affect parsing in any way.

MutuallyExclusiveGroup is used in parsing.  It also is used, to the extent 
possible, when formatting usage.

If a MutuallyExclusiveGroup is nested inside another MutuallyExclusiveGroup the 
parsing effect is just one flat group.  Usage can be messed up - that's been 
the subject of another bug/issue.

A MutuallyExclusiveGroup may be put in an ArgumentGroup.  This is a way of 
giving the exclusive group a title and/or description in the help.

There is a bug/issue requesting some sort of inclusive group.  I tried to 
develop such a patch, implementing nesting, complete logic control (not just 
the current xor).  But the usage formatting needs a complete rewrite.  Overall 
this is too complex of an addition.  On StackOverFlow I tell people to 
implement their own post-parsing testing.

--
nosy: +paul.j3

___
Python tracker 

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



[issue38693] Use f-strings instead of str.format within importlib

2019-11-04 Thread Gregory P. Smith


New submission from Gregory P. Smith :

importlib is full of str.format calls, modernizing it to use f-strings is a 
slight performance win and much more readable.

--
assignee: gregory.p.smith
messages: 356005
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: Use f-strings instead of str.format within importlib
type: performance
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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-11-04 Thread miss-islington

miss-islington  added the comment:


New changeset 4c22e1665c4d8e8fa31bd7aa7b403480d9be5ce2 by Miss Islington (bot) 
in branch '3.8':
closes bpo-37633: Reëxport some function compatibility wrappers for macros in 
``pythonrun.h``. (GH-17056)
https://github.com/python/cpython/commit/4c22e1665c4d8e8fa31bd7aa7b403480d9be5ce2


--
nosy: +miss-islington

___
Python tracker 

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



[issue38591] Deprecate Process Child Watchers

2019-11-04 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

FWIW, I started implementing a pidfd-based child process watcher over on #38692.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue38692] add a pidfd child process watcher

2019-11-04 Thread Benjamin Peterson


New submission from Benjamin Peterson :

Recent versions of Linux has built out support for pidfd, a way to do process 
management with file descriptors. I wanted to try it out, so implemented a 
pidfd-based child watcher for asyncio.

My WIP progress patch is attached. It passes all asyncio tests.

--
components: asyncio
files: 0001-asyncio-Add-a-pidfd-child-process-watcher.patch
keywords: patch
messages: 356001
nosy: asvetlov, benjamin.peterson, yselivanov
priority: normal
severity: normal
status: open
title: add a pidfd child process watcher
type: enhancement
versions: Python 3.9
Added file: 
https://bugs.python.org/file48695/0001-asyncio-Add-a-pidfd-child-process-watcher.patch

___
Python tracker 

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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-11-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16568
pull_request: https://github.com/python/cpython/pull/17057

___
Python tracker 

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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-11-04 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 62161ce989d7d4fe2b0e6899a54da20feeddc798 by Benjamin Peterson in 
branch 'master':
closes bpo-37633: Reëxport some function compatibility wrappers for macros in 
``pythonrun.h``. (GH-17056)
https://github.com/python/cpython/commit/62161ce989d7d4fe2b0e6899a54da20feeddc798


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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-11-04 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

2019-11-04 Thread Ammar Askar


Ammar Askar  added the comment:

Aah actually I was looking at an older version of the docs, the documentation 
now says, "if the address is allocated for private networks" which is actually 
misleading. The addresses here aren't all private networks: 
https://github.com/python/cpython/blob/25fa3ecb98f2c038a422b19c53641fa8e3ef8e52/Lib/ipaddress.py#L1537-L1553

--

___
Python tracker 

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



[issue38655] ipaddress.ip_network('0.0.0.0/0').is_private == True

2019-11-04 Thread Ammar Askar


Ammar Askar  added the comment:

The documentation for is_private notes:

  Returns:
  A boolean, True if the address is reserved per RFC 4193.
  iana-ipv4-special-registry or iana-ipv6-special-registry.

If we take a look at the iana-ipv4-special-registry then 0.0.0.0/8 does show up 
there: 
https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml

While the name might be a misnomer, is_reserved instead of is_private might 
have been better, it does seem to conform to what the documentation says it 
will do.

--
nosy: +ammar2

___
Python tracker 

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



[issue38475] Break Statement

2019-11-04 Thread Zachary Ware


Zachary Ware  added the comment:

Absent any response from the OP, I'm going to go with yes.

Devor, if you can reduce your example to show a bug in the Python interpreter 
or standard library, please reopen with that example.

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



[issue27994] In the argparse help(argparse) prints weird comments instead of good docstrings

2019-11-04 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2019-11-04 Thread STINNER Victor


New submission from STINNER Victor :

When using python3 -E or python3 -I, PYTHONCASEOK environment variable should 
be ignored by importlib. See an email sent in 2012:
https://mail.python.org/pipermail/python-dev/2012-December/123403.html

See importlib._bootstrap_external._relax_case attribute and its 
_make_relax_case() function.

--
components: Library (Lib)
messages: 355996
nosy: vstinner
priority: normal
severity: normal
status: open
title: importlib: PYTHONCASEOK should be ignored when using python3 -E
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



[issue27994] In the argparse help(argparse) prints weird comments instead of good docstrings

2019-11-04 Thread Lewis Gaul


Change by Lewis Gaul :


--
nosy: +aeros

___
Python tracker 

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



[issue27994] In the argparse help(argparse) prints weird comments instead of good docstrings

2019-11-04 Thread Lewis Gaul


Lewis Gaul  added the comment:

This doesn't seem to be the case [anymore] to me, should this be closed?

--
nosy: +Lewis Gaul

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

Same issue on x86 Gentoo Refleaks 3.7:

test_ctypes leaked [174, 174, 174] references, sum=522
test_ctypes leaked [76, 78, 76] memory blocks, sum=230

https://buildbot.python.org/all/#/builders/114/builds/631

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

This change introduced a reference leak on Windows. Example on 3.7:

https://buildbot.python.org/all/#/builders/132/builds/645

test_ctypes leaked [174, 174, 174] references, sum=522
test_ctypes leaked [76, 77, 77] memory blocks, sum=230

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

> I have encountered a minor bug with this new feature.

Please open a new issue.

--

___
Python tracker 

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



[issue36439] Inconsistencies with datetime.fromtimestamp(t) when t < 0

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue37373] Configuration of windows event loop for libraries

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

> Is it be possible to backport this inside the standard ProactorEventLoop of 
> Python-3.8.1 ? As things are currently broken, no kitten would be armed 
> https://github.com/python-trio/trio/pull/1269

No, we don't add features to minor releases.

If you need add_reader(), your code works with Python 3.7 but fails with 3.8, 
you can use the following code to ensure that you use the SelectorEventLoop:

if sys.platform == 'win32':
  asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

--

___
Python tracker 

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



[issue38430] Memory leak in ThreadPoolExecutor + run_in_executor

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

> IMO this punches a big hole in the Python execution model, but provides no 
> benefit.

This PEP is about fixing a Python 3.8 regression. In Python 3.7, it was 
possible to get and set frame_eval. In Python 3.8, it's no longer possible.

One option to fix the regression would be to again expose PyInterpreterState 
structure... but we are trying to do the opposite: hide more structures, not 
expose more structures :-/

IMHO private getter and setter functions are perfectly fine. Please ensure that 
the setter can report an issue. We have too many setters which cannot report an 
error which is very painful :-(

--

___
Python tracker 

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



[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Matthew Barnett


Matthew Barnett  added the comment:

It's been many years since I looked at the code, and there have been changes 
since then, so some of the details might not be correct.

As to have it should behave:

re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a')

Iteration 1.
Match the repeated part. Group 1 matches.
Iteration 2.
Match the repeated part. Group 1 matches.
Has group 2 matched? No.
Try to match 'z'. Fail and backtrack.
Retry the repeated part.
Iteration 2.
Has group 1 matched? Yes.
Group 2 matches.
Has group 2 matched? Yes.
Try to match 'a'. Success. Group 1 matched and group 2 matched.


re.match('(?:()|(?(1)()|z)){1,2}(?(1)a|z)', 'a')

Iteration 1.
Match the repeated part. Group 1 matches.
Iteration 2.
Match the repeated part. Group 1 matches.
Has group 1 matched? Yes.
Try to match 'a'. Success. Group 1 matched and group 2 didn't match.

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16566
pull_request: https://github.com/python/cpython/pull/17052

___
Python tracker 

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



[issue25522] IDLE: warn if save-as name matches stdlib name

2019-11-04 Thread Zackery Spytz


Zackery Spytz  added the comment:

I have created a pull request for this issue.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue25522] IDLE: warn if save-as name matches stdlib name

2019-11-04 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 17269090940aa20f6079a6b9f27ae319f8cdae14 by Victor Stinner in 
branch 'master':
bpo-38644: Pass tstate to _Py_CheckFunctionResult() (GH-17050)
https://github.com/python/cpython/commit/17269090940aa20f6079a6b9f27ae319f8cdae14


--

___
Python tracker 

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



[issue38475] Break Statement

2019-11-04 Thread Lewis Gaul


Lewis Gaul  added the comment:

Should this issue be closed?

--
nosy: +Lewis Gaul

___
Python tracker 

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



[issue38690] Command line option with &/or without a space results in the same outcome

2019-11-04 Thread jason gors


New submission from jason gors :

The syntax in the Command line documentation was unexpected regarding the `-m` 
option (specifically `python -mtimeit`) [0].  Showing this:

```
python -mtimeit "range(100)"
# behaving equivalent to this:
python -m timeit "range(100)"
```

This led me to discover many cases where command line arguments are like this 
in python (e.g. the call working correctly without a space between an argument 
flag and what is being passed into the command).  Like this:

```
python -c"print('Hi')"
# behaving the same as:
python -c "print('Hi')"
```

This is also the case with pip as well:

```
pip install -rrequirements.txt 
# behaving exactly like:
pip install -r requirements.txt
```

However, when I think of the *nix commands, like `rm`, this behavior fails.  
When you want to pass several flags at once, you can either list them 
separately (e.g. `rm -f -i myfile.py`) or concatenate them together (e.g. `rm 
-fi myfile.py`), but `rm` fails if you try calling it without a space between 
the argument(s) and the file to be removed (e.g.`rm -fimyfile.py`).

I'm not sure whether this command line behavior in python is intentional, but 
it's not obvious as to why this is the case.

[0] https://docs.python.org/3/using/cmdline.html#cmdoption-m

--
components: Library (Lib)
messages: 355985
nosy: jgors
priority: normal
severity: normal
status: open
title: Command line option with &/or without a space results in the same outcome
type: behavior
versions: Python 2.7, 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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16564
pull_request: https://github.com/python/cpython/pull/17050

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset be434dc0380d9f5c7c800de9943cc46d55fd9491 by Victor Stinner in 
branch 'master':
bpo-38644: Pass tstate to Py_EnterRecursiveCall() (GH-16997)
https://github.com/python/cpython/commit/be434dc0380d9f5c7c800de9943cc46d55fd9491


--

___
Python tracker 

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



[issue38689] IDLE crashes when KeyError is raised during calltip generation

2019-11-04 Thread Dan Snider


New submission from Dan Snider :

When the following program has been input (into 32 bit 3.8.0 Python running on 
windows 10), all IDLE processes and windows will immediately and irrevocably 
hang the instant the open parentheses at the end of the statement "Object(" is 
rendered.

However that's just my 90% sure guess of the cause, based on 
 how when the regular dict from this example is swapped with one that raises 
AttributeError instead of KeyError, a crash no longer occurs. Quite perplexing, 
seeing as neither exception is handled in get_argspec.

>>> if 1:
from idlelib.calltip import get_argspec
class Type(type):
__class__ = property((__class__:={}).__getitem__,__class__.__setitem__)
class Object(metaclass=Type):
__slots__ = '__class__'
get_argspec(Object)


Traceback (most recent call last):
  File "", line 7, in 
get_argspec(Object)
  File "C:\Python38\lib\idlelib\calltip.py", line 141, in get_argspec
argspec = str(inspect.signature(fob))
  File "C:\Python38\lib\inspect.py", line 3093, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "C:\Python38\lib\inspect.py", line 2842, in from_callable
return _signature_from_callable(obj, sigcls=cls,
  File "C:\Python38\lib\inspect.py", line 2218, in _signature_from_callable
if isinstance(obj, types.MethodType):
KeyError: 

--
assignee: terry.reedy
components: IDLE
messages: 355983
nosy: bup, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE crashes when KeyError is raised during calltip generation
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



[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley


Jackson Riley  added the comment:

I've got a bit confused and am doubting myself - is the below output expected?
>>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a')
>>> m.groups()
('', '')
>>> m = re.match('(?:()|(?(1)()|z)){1,2}(?(1)a|z)', 'a')
>>> m.groups()
('', None)

The first pattern doesn't behave as I would (probably naively expect) given 
Matthew's explanation of this bug - wouldn't the bug cause the match to fail 
with {1,2} as well?
Also, it seems odd that changing the condition in the if clause should change 
what gets captured.

Anyone have any thoughts?

--

___
Python tracker 

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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue38688] Python 3.8 regression: endless loop in shutil.copytree

2019-11-04 Thread Christian Boltz


New submission from Christian Boltz :

The following test script works with Python 3.7 (and older), but triggers an 
endless loop with Python 3.8:


#!/usr/bin/python3

import shutil
import os

os.mkdir('/dev/shm/t')
os.mkdir('/dev/shm/t/pg')

with open('/dev/shm/t/pg/pol', 'w+') as f:
f.write('pol')

shutil.copytree('/dev/shm/t/pg', '/dev/shm/t/pg/somevendor/1.0')


The important point is probably that 'pg' gets copied into a subdirectory of 
itsself. While this worked in Python up to 3.7, doing the same in Python 3.8 
runs into an endless loop:

# python3 /home/abuild/rpmbuild/SOURCES/test.py
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/SOURCES/test.py", line 15, in  
shutil.copytree('/dev/shm/t/pg', '/dev/shm/t/pg/somevendor/1.0')
  File "/usr/lib/python3.8/shutil.py", line 547, in copytree 
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.8/shutil.py", line 486, in _copytree
copytree(srcobj, dstname, symlinks, ignore, copy_function,
...
copytree(srcobj, dstname, symlinks, ignore, copy_function,
  File "/usr/lib/python3.8/shutil.py", line 547, in copytree 
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib/python3.8/shutil.py", line 449, in _copytree
os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "/usr/lib/python3.8/os.py", line 206, in makedirs 
head, tail = path.split(name)
  File "/usr/lib/python3.8/posixpath.py", line 104, in split 
sep = _get_sep(p)
  File "/usr/lib/python3.8/posixpath.py", line 42, in _get_sep 
if isinstance(path, bytes):
RecursionError: maximum recursion depth exceeded while calling a Python object

I also reported this at https://bugzilla.opensuse.org/show_bug.cgi?id=1155839

--
components: Library (Lib)
messages: 355981
nosy: cboltz
priority: normal
severity: normal
status: open
title: Python 3.8 regression: endless loop in shutil.copytree
type: crash
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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-11-04 Thread Brett Cannon


Brett Cannon  added the comment:

I've flagged this as a release blocker so the Release Manager can make a call 
about whether this should hold up future releases.

--
nosy: +brett.cannon
priority: normal -> release blocker

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Malversán

Malversán  added the comment:

In my scenario that buffer overrun never happens, maybe because I use messages 
that are not big enough to overflow the default recv() buffer size.

But I think I can confirm that multiple messages are never received in an 
atomic read, even if they are being issued intensively in short millisecond 
intervals. Even more, I think there is a recvmmsg() call specific for that 
purpose if you want to receive multiple reads at once.

As I said I do not have the answers, I rely on the high-level definitions and 
have little knowledge about how it works at low level.

But I think your question may be extended also to recvmsg(). What is its 
behaviour if it fills all the passed iovec structs?

Probably an answer can be found where you found the recommendation of using 
recvmsg() over recv(). There should be a reason for that recommendation.

--

___
Python tracker 

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



[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

> since the new threads are spawned in ThreadPoolExecutor *after* 
> executor.submit() is called

It's also worth mentioning that ThreadPoolExecutor only spawns up to one 
additional thread at a time for each executor.submit() called.

--

___
Python tracker 

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



[issue38652] Remove/update provisional note for asyncio.BufferedProtocol

2019-11-04 Thread Anj-A


Change by Anj-A <2017...@gmail.com>:


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

___
Python tracker 

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



[issue38687] Expose 'adler32_combine' function from zlib

2019-11-04 Thread Callum Attryde


Change by Callum Attryde :


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

___
Python tracker 

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



[issue38687] Expose 'adler32_combine' function from zlib

2019-11-04 Thread Callum Attryde


New submission from Callum Attryde :

zlib contains a function for combining Adler32 checksums which is not currently 
exposed by the Python module. This enhancement adds that function to Python

--
components: Extension Modules
messages: 355977
nosy: callumattryde
priority: normal
severity: normal
status: open
title: Expose 'adler32_combine' function from zlib
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue38652] Remove/update provisional note for asyncio.BufferedProtocol

2019-11-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Hey, I've done the change and opened a pull request for it (I'm working with 
> Ben and I've let him know)

Make sure to change the title of the PR to "bpo-: ", 
this will automatically attach the PR to the associated bpo issue. For example, 
if your PR title was "Remove provisional note for asyncio.BufferedProtocol", 
the full title should be:

bpo-38652: Remove provisional note for asyncio.BufferedProtocol

--

___
Python tracker 

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



[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Nice work! This is a great excercise, but we can really just use 
> concurrent.futures.ThreadPool as is. Spawning threads is fast. As I mentioned 
> before all we need to do is to design *our* API to NOT initialize pools in 
> __init__, that's it. The design outlined in https://bugs.python.org/msg355881 
> would do that.

Thanks, it was quite helpful for better understanding the internals of 
ThreadPoolExecutor. 

I think that I'm still not understanding something important though. Even if we 
initialize our ThreadPoolExecutor outside of __init__ (in a start() coroutine 
method, as your proposing), it seems like the threads will be spawned 
throughout the lifespan of the threadpool, rather than upon startup since the 
new threads are spawned in ThreadPoolExecutor *after* executor.submit() is 
called (up to max_workers) rather than upon initialization. So even if an 
instance of ThreadPoolExecututor is initialized asynchronously within a start() 
coroutine method, the individual threads within it won't be spawned at the same 
time.

That's why I wrote an explicit way of spawning threads in the above example, 
based on the way that ThreadPoolExecutor spawns threads in 
_adjust_thread_count(), which is called at the end of submit().

--

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613 by Victor Stinner in 
branch 'master':
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
https://github.com/python/cpython/commit/f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613


--

___
Python tracker 

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



[issue38665] Crash when running SQLAlchemy with pyodbc

2019-11-04 Thread Brett Cannon


Brett Cannon  added the comment:

Basically you have to figure out where that bad memory came from and that's 
just plain hard in C short of slowly cutting out code until you get a small 
reproducer. Typically these sorts of issues are almost always in the extension 
modules, but your case is tricky as even if that's true you don't know which 
one is the cause.

--

___
Python tracker 

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



[issue38665] Crash when running SQLAlchemy with pyodbc

2019-11-04 Thread Dave Johansen


Dave Johansen  added the comment:

I can't. I just know that I'm running this process and this crash happens. Any 
recommendations on how to diagnose that?

--

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-04 Thread Brett Cannon


Brett Cannon  added the comment:

@Mark are you strongly opposed because we're providing an API for changing the 
eval function in the CPython API and you think it should be in the private API? 
Or you objecting to PEP 523 all-up (based on your list of objections)? Either 
way the PEP was accepted and implemented a while ago and so I'm not quite sure 
what you are expecting as an outcome short of a repeal of PEP 523 which would 
require a separate PEP.

--

___
Python tracker 

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



[issue38662] Decouple ensurepip from pip's internals using runpy

2019-11-04 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist

2019-11-04 Thread Brett Cannon


Change by Brett Cannon :


--
components: +Library (Lib)
nosy: +brett.cannon

___
Python tracker 

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



[issue38665] Crash when running SQLAlchemy with pyodbc

2019-11-04 Thread Brett Cannon


Brett Cannon  added the comment:

Can you trace this to actually being Python's fault? Unfortunately you're using 
two extension modules who both could be at fault with this.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Can recv() get two messages at once?
What is the behavior if the buffer size passed into recv() is smaller than the 
message length?

--

___
Python tracker 

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



[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

2019-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not sure there is much in common between this and issue33721. There are 
many ways to get a file path unrepresentable at the OS level. But I do not know 
any valid case for getting an out-of-range file descriptor. I am not convinced 
there is a bug here.

--

___
Python tracker 

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



[issue38652] Remove/update provisional note for asyncio.BufferedProtocol

2019-11-04 Thread Anj-A


Anj-A <2017...@gmail.com> added the comment:

Hey, I've done the change and opened a pull request for it (I'm working with 
Ben and I've let him know)

--
nosy: +Anj-A

___
Python tracker 

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



[issue37838] typing.get_type_hints not working with forward-declaration and decorated functions

2019-11-04 Thread Anj-A


Change by Anj-A <2017...@gmail.com>:


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

___
Python tracker 

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



[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

2019-11-04 Thread Anj-A


Anj-A <2017...@gmail.com> added the comment:

Hey, I'm not exactly clear what the required fix is here and would appreciate 
some guidance, is it in the documentation or in the way the error is handled?

--

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

This issue added this FIXME:

/* Due to the macros in which it's used, _Py_CheckRecursionLimit is in
   the stable ABI.  It should be removed therefrom when possible.
*/

FYI I proposed PR 17046 to fix it ;-)

--
nosy: +vstinner

___
Python tracker 

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



[issue38644] Pass explicitly tstate to function calls

2019-11-04 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16559
pull_request: https://github.com/python/cpython/pull/17046

___
Python tracker 

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



[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

This issue reminds me bpo-33721:

"os.path functions that return a boolean result like exists(), lexists(), 
isdir(), isfile(), islink(), and ismount() now return False instead of raising 
ValueError or its subclasses UnicodeEncodeError and UnicodeDecodeError for 
paths that contain characters or bytes unrepresentable at the OS level. 
(Contributed by Serhiy Storchaka in bpo-33721.)"

https://docs.python.org/dev/whatsnew/3.8.html#os-path

--
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2019-11-04 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue9495] argparse unittest tracebacks are confusing if an error is raised when not expected

2019-11-04 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

2019-11-04 Thread Anj-A


Anj-A <2017...@gmail.com> added the comment:

Hi all, I'm a newcomer interested in doing a small fix. Wondering if anyone's 
working on this at the moment?

--
nosy: +Anj-A

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Malversán

Malversán  added the comment:

I do not have the answer about getting message boundaries at lower levels, but 
from a high-level point of view SOCK_SEQ_PACKET gives atomic reads, with no 
need to check for message boundaries yourself. Every time you read from a 
SOCK_SEQ_PACKET socket you get an entire message. That is the main difference 
with SOCK_STREAM, as far as I know.

--

___
Python tracker 

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



[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

At first, would be nice to figure out what "invalid line reported" does mean.  
What text is reported and what is expected?

--

___
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

2019-11-04 Thread Alex


Alex  added the comment:

I've had a look at the most recent patch and the code surrounding it, and I 
would be happy to take on the work to update the code and testing.

However,
> - It's easy to test for this range after parsing, with '*' or '+' nargs.  So 
> the main thing this patch adds is in the help/usage display.  It doesn't add 
> significant functionality.

I didn't initially consider this.

I'd still be happy to finish this off, but if the general feeling is that 
contribution time would be better spent elsewhere then that's also fine.

--

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Another question: does SSL/TLS make sense for seqpacket?

--

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

How to get the message boundary without recvmsg()? Sorry, I'm not familiar with 
seqpacket.

--

___
Python tracker 

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



[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I'm going to have to rescind the above statements. I was able to implement a 
> new prototype of asyncio.ThreadPool (using ThreadPoolExecutor) that spawns 
> it's threads asynchronously on startup. Since this one a bit more involved 
> than the previous code examples, I created a gist: 
> https://gist.github.com/aeros/8a86de6b13f17b9f717ea539ee1ee78f

Nice work! This is a great excercise, but we can really just use 
concurrent.futures.ThreadPool as is. Spawning threads is fast. As I mentioned 
before all we need to do is to design *our* API to NOT initialize pools in 
__init__, that's it. The design outlined in https://bugs.python.org/msg355881 
would do that.

--

___
Python tracker 

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



[issue28577] ipaddress.ip_network(...).hosts() returns nothing for an IPv4 /32

2019-11-04 Thread Ethan Furman


Ethan Furman  added the comment:

I came across this /32 issue today trying to iterate over the hosts in 
127.0.0.1/32.  I think it's fair to say that any /32 network has precisely one 
host, and that host should by returned by IPv4Network().hosts().

--
nosy: +ethan.furman

___
Python tracker 

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



[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley


Jackson Riley  added the comment:

Ah thank you very much Serhiy, that's super helpful!

--

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Malversán

Malversán  added the comment:

It has a certain logic to recommend recvmsg() in place of recv(), as 
SOCK_SEQ_PACKET is characterized by transmitting entire messages only. But it 
has to be noted that my current hack (described above) is working for 
SOCK_SEQ_PACKET sockets with no modification of the asyncio underlying reading 
logic.

--

___
Python tracker 

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



[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Matthew referred to the code of the regex module (of which he is the author).

https://pypi.org/project/regex/

--

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-04 Thread PypeBros


Change by PypeBros :


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

___
Python tracker 

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



[issue38686] WWW-Authenticate qop="auth,auth-int" rejected by urllib

2019-11-04 Thread PypeBros

New submission from PypeBros :

in urllib/request.py, 
   when trying to use HTTP Digest Authentication 
   with a server that replies with `WWW-Authenticate: Digest` 
   where `qop="auth,auth-int"` rather than mere `qop="auth"`

the connection fails to establish with a "qop 'auth,auth-int' is not supported" 
error message.

`qop="auth,auth-int" should imho be accepted according to the `qop-options` 
rule in §3.2.1 of https://www.ietf.org/rfc/rfc2617.txt, given that 'auth' is 
supported by urllib/request.py

--
messages: 355952
nosy: PypeBros
priority: normal
severity: normal
status: open
title: WWW-Authenticate qop="auth,auth-int" rejected by urllib
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue38621] Bad decoding of encoded-words in unstructured email headers

2019-11-04 Thread Fred Drake


Change by Fred Drake :


--
resolution: fixed -> rejected
stage: resolved -> 

___
Python tracker 

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



[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

Hi, I'm a new contributor: is there any consensus on what or if something needs 
to be done? If so, I can try and take forward the patch.

--
nosy: +callumquick

___
Python tracker 

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



[issue23692] Undocumented feature prevents re module from finding certain matches

2019-11-04 Thread Jackson Riley


Jackson Riley  added the comment:

Hi Matthew, thank you for your suggestions of where to start.
Could you possibly give a pointer to the place in the code where the 'capture 
changed' counter is incremented? I had a bit of a hunt and couldn't find it but 
may have been looking in the wrong places!

--
nosy: +jacksonriley

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

A matter of creating tests to allow test enabling of new socket types I could 
attempt, but new protocol/transport types may be beyond me.

--

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

For each type, we need at least a test that creates a socket pair and 
successfully transfers data through the wire.

I don't know what additional things are required. For example, on reading about 
SOCK_SEQ_PACKET I've found that recvmsg() is highly recommended over recv() to 
get messages boundaries. It obviously requires the new transport type and the 
new async protocol specification.

Doesn't look trivial.

--

___
Python tracker 

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



[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

Hi, is there anything that needs to be fixed or done here?

--
nosy: +callumquick

___
Python tracker 

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



[issue38684] hashlib: build fails when blake2 is disabled in OpenSSL

2019-11-04 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 6552563b3d5061816720a5a6c7d4ffd6ba35b98b by Christian Heimes 
(Alexandru Ardelean) in branch 'master':
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (#17043)
https://github.com/python/cpython/commit/6552563b3d5061816720a5a6c7d4ffd6ba35b98b


--

___
Python tracker 

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



[issue38684] hashlib: build fails when blake2 is disabled in OpenSSL

2019-11-04 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16557
pull_request: https://github.com/python/cpython/pull/17044

___
Python tracker 

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



[issue38285] Asyncio BaseEventLoop can support socket types other than SOCK_STREAM

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

Hi Andrew, I'm a new contributor, but this sounds like a pretty cool 
enhancement. 

Would you be able to elaborate on what kind of things might be required to 
support each new socket type and test them in particular so I can see if I can 
take it on?

--
nosy: +callumquick

___
Python tracker 

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



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

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

Hi, I'm a new contributor and this issue looks like an interesting enhancement: 
is there any consensus forming on what we want to limit to e.g. raising 
depreciation warnings when these first-class classes are created without 
running event loop?

--
nosy: +callumquick

___
Python tracker 

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



[issue38680] PyGILState_Release does not release gil correctly, resulting in deadlock

2019-11-04 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

What's the value of PyGILState_Check() before the call to PyGILState_Ensure()? 

PyGILState_Ensure() and PyGILState_Release() should bracket code where you're 
not sure about the current GIL state, but need the GIL.  The Release function 
only undoes the action of the Ensure function, and won't release the GIL if the 
GIL was held before the call to the Ensure function.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue38685] can't create a venv with a dash in the name

2019-11-04 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

close, bad manip :/

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



[issue38685] can't create a venv with a dash in the name

2019-11-04 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

I tried to create a venv via python -m venv 

here are the commands:

> python --version
Python 3.8.0

> python -m venv ~/.virtualenvs/test-proftpd
Error: [Errno 40] Too many levels of symbolic links: 
'/home/stephane/.virtualenvs/test-proftpd/bin/python'
Fail with a dash.

> python -m venv ~/.virtualenvs/test_proftpd
Work fine with an underscore

--
messages: 355941
nosy: matrixise
priority: normal
severity: normal
status: open
title: can't create a venv with a dash in the name
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



[issue38684] hashlib: build fails when blake2 is disabled in OpenSSL

2019-11-04 Thread Alexandru Ardelean


Change by Alexandru Ardelean :


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

___
Python tracker 

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



[issue38314] Implement unix read_pipe.is_reading() method

2019-11-04 Thread Callum Ward


Change by Callum Ward :


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

___
Python tracker 

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



[issue38684] hashlib: build fails when blake2 is disabled in OpenSSL

2019-11-04 Thread Alexandru Ardelean


New submission from Alexandru Ardelean :

This was caught via OpenWrt's build, when upgrading to 3.8.
By default, Blake2 is not enabled in OpenWrt's OpenSSL.
Not sure if this is an issue in OpenSSL or Python or both.

After digging through the _hashopenssl.c, it seems that the check for Blake2 
being enabled/present in OpenSSL is not consistent with how OpenSSL does it.

The build error is:

86_64-openwrt-linux-musl-gcc -shared 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib
 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib
 -znow -zrelro 
-L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib
 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib
 -znow -zrelro 
-L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home
 
/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib
 -znow -zrelro 
-L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 
-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts 
-Wno-error=unused-but-set-variable -Wno-error=unused-result 
-ffile-prefix-map=/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0=Python-3.8.0
 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 
-Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline 
-I/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include 
-I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/include
 
-I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include/fortify
 
-I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include
 build/temp.linux2-3.8/home/sandu/work/openwrt/openwrt/buil
 d_dir/target-x86_64_musl/Python-3.8.0/Modules/_curses
_panel.o -L. 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib
 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib
 -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 
-L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/x86_64-openwrt-linux-musl/lib
 -lpanelw -lncursesw -o build/lib.linux2-3.8/_curses_panel.cpython-38.so
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:
 In function 'py_digest_by_name':
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:22:
 error: implicit declaration of function 'EVP_blake2s256'; did you mean 
'SN_blake2s256'? [-Werror=implicit-function-declaration]
 digest = EVP_blake2s256();
  ^~
  SN_blake2s256
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:20:
 warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 
'int' makes pointer from integer without a cast [-Wint-conversion]
 digest = EVP_blake2s256();
^
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:22:
 error: implicit declaration of function 'EVP_blake2b512'; did you mean 
'LN_blake2b512'? [-Werror=implicit-function-declaration]
 digest = EVP_blake2b512();
  ^~
  LN_blake2b512
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:20:
 warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 
'int' makes pointer from integer without a cast [-Wint-conversion]
 digest = EVP_blake2b512();
^

--
assignee: christian.heimes
components: Build, SSL
messages: 355940
nosy: Alexandru Ardelean, christian.heimes
priority: normal
severity: normal
status: open
title: hashlib: build fails when blake2 is disabled in OpenSSL
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing 

[issue38314] Implement unix read_pipe.is_reading() method

2019-11-04 Thread Callum Ward


Callum Ward  added the comment:

I've agreed with Ben that I'll look at making the necessary changes today.

--
nosy: +callumquick

___
Python tracker 

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



[issue32309] Implement asyncio.run_in_executor shortcut

2019-11-04 Thread Kyle Stanley


Kyle Stanley  added the comment:

> The asynchronous spawning of threads or processes would also not be 
> compatible with the executor subclasses as far as I can tell.

> Thus, it seemed to make more sense to me to actually build up a new Pool 
> class from scratch that was largely based on Executor, but with significantly 
> differing functionality. Otherwise, it seems like we would have to make some 
> modifications to ThreadPoolExecutor, or inherit from it and then redesign the 
> internals of some of the methods to change the way the threads/processes are 
> spawned. 

I'm going to have to rescind the above statements. I was able to implement a 
new prototype of asyncio.ThreadPool (using ThreadPoolExecutor) that spawns it's 
threads asynchronously on startup. Since this one a bit more involved than the 
previous code examples, I created a gist: 
https://gist.github.com/aeros/8a86de6b13f17b9f717ea539ee1ee78f

It's by no means a complete implementation, but it at least proves the 
functionality that Yury described is very much possible using the existing 
ThreadPoolExecutor class.

--

___
Python tracker 

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



[issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes

2019-11-04 Thread Tomas Hyland


Tomas Hyland  added the comment:

Hi there, I'm taking part in 'EnHackathon' spending several days over the next 
few weeks working on issues. I think this could be a good issue for a small 
team of first-time contributors with experience in C to work on.
Would anyone be able to offer guidance if we encounter problems?

--
nosy: +tohyland

___
Python tracker 

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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-11-04 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

@Mark Shannon what I do is change the code object of the frame about to be 
evaluated to add a programmatic breakpoint, to avoid the need to have the trace 
function set at contexts that would need to be traced (after changing the 
frame.f_code it goes on to call the regular _PyEval_EvalFrameDefault), so, the 
user-code runs at full speed on all contexts (there's still added overhead on a 
function call to decide if the code object needs to be changed, but that'd 
happen on the regular tracing code too).

Note that this does not change the semantics of anything as it calls the 
regular _PyEval_EvalFrameDefault, so, the worries you're listing shouldn't be a 
concern in this particular use-case.

Also note that until Python 3.7 this was easy to change, and that's still 
possible in Python 3.8 (the only thing is that now it's less straightforward).

Note that my use is much simpler that the original intent of the frame 
evaluator -- my use case could be solved by having a callback to change the 
code object before the frame execution -- but as far as I know, right now, the 
way to do that is through the frame evaluation API.

--

___
Python tracker 

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



[issue38683] Installation failed - no privileges to access directory

2019-11-04 Thread Benedek Rácz

New submission from Benedek Rácz :

Python installation failed when I try to install to system dir on Windows 10. 
(C:\Program Files\Python37)

**Reproduce**

I have downloaded the installer, and I have changed the install location to 
`C:\Program Files\Python37`. Then I get the attached error.

**Expected behavior**

Not to crash, ask for administrator privileges. If its needed.

**I use:**
 - Win 10 Pro
 - Version 10.0.18362 Build 18362
 - Python 3.7.5 (https://www.python.org/ftp/python/3.7.5/python-3.7.5-amd64.exe)

--
components: Installation
files: pythonInstallFail.PNG
messages: 355935
nosy: Benedek Rácz
priority: normal
severity: normal
status: open
title: Installation failed - no privileges to access directory
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48694/pythonInstallFail.PNG

___
Python tracker 

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



  1   2   >