[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

Pablo,
in cc12888f9b4b69247f342fe1304984c3eb3d9647 you have regenerated configure with 
autoconf 2.71. The version is brand new and was released just 6 weeks ago. All 
my Linux machines have autoconf 2.69 from 2012 (!). Apparently 2.70 had some 
issues.

Would you mind if I regenerate configure with 2.69 and we stick with stable 
version for a little bit longer?

--

___
Python tracker 

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



[issue35118] Add peek() or first() method in queue

2021-03-16 Thread Alexey Volkov


Alexey Volkov  added the comment:

>Why not just dismiss older queue entries during a normal get() operation?  Or 
>just use a plain deque with access guarded by a lock.

You do not know whether the item needs to be removed until you see it. And to 
see it you need to get it. And if you get it, you cannot push it back to the 
start of the queue.

>FWIW, the standard library queue module doesn't have a straight-forward way to 
>implement a peek() method.

I currently use `q.deque[0]`

>Or just use a plain deque with access guarded by a lock.

I can. But technically the same applies to almost any queue usage.

--

___
Python tracker 

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



[issue43507] Variables in locals scope fails to be printed.

2021-03-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

I think this is essentially a duplicate of #24800. (Short version, the 
behaviour is by design, and documented, but there may be scope for clarifying 
or improving the documentation.)

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-03-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Would you mind if I regenerate configure with 2.69 and we stick with stable 
> version for a little bit longer?

Please, go ahead. I need to remember then to use a docker container or 
something like that for the release then.

What's the problem that you are experiencing?

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-16 Thread Paul


New submission from Paul :

The section "Subtyping relationships with other types" of PEP 544 states:

"A concrete type X is a subtype of protocol P if and only if X implements all 
protocol members of P with compatible types. In other words, subtyping with 
respect to a protocol is always structural."

This requirement is violated by the current implementation of CPython (version 
3.9.2):

```
from typing import Protocol


class P(Protocol):
pm: str  # no default value, but still a protocol member


class C(P):
# inherits P but does NOT implement pm, since P did not provide a default 
value
pass


assert isinstance(C(), P)  # violates the PEP 544 requirement cited above

C().pm  # raises: AttributeError: 'C' object has no attribute 'pm'
```

--
components: Library (Lib)
messages: 388827
nosy: paul-dest
priority: normal
severity: normal
status: open
title: Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43080] pprint for dataclass instances

2021-03-16 Thread Lewis Gaul


Lewis Gaul  added the comment:

> FWIW, we've not had a feature request for this ever, nor has there been a 
> request for pprint to support attrs, nor any other hand-rolled class that 
> implements methods similar to those generated by dataclasses.

I wouldn't expect core Python to support a 3rd party lib like attrs, but I fail 
to see what's so different between dataclasses, SimpleNamespace and namedtuple 
- all of these may be used for storing/modelling [nested] data, which then may 
be printed.

> AFAICT, this tracker issue wasn't motivated by a known use case; rather, it 
> was "my PR was accepted for SimpleNamespace and thought dataclasses could be 
> the next."

This issue is entirely motivated by a real-world example - I'm currently 
maintaining a private fork of the pprint module with support for dataclasses 
added. I'm assuming the reason this hasn't come up before is that dataclasses 
are relatively new (and plenty of users will still be on older versions of 
Python).

I was not the author of the issue that added support for SimpleNamespace, I 
just saw it and used it as an example of precedent.

> At some point, we need a modern redesign alternative to pprint.

I'm on board with this, but as Eric said there aren't currently any signs of 
this being worked on. In absence of a redesign, dataclass support seems like a 
natural extension to me.

--

___
Python tracker 

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



[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9

2021-03-16 Thread Tomas Orsava


Change by Tomas Orsava :


--
components: +XML

___
Python tracker 

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



[issue43511] Tk 8.6.11 slow on M1 Mac Mini MacOS Python 3.9.2 native ARM version

2021-03-16 Thread Thomas Wamm


Thomas Wamm  added the comment:

An easy demo of the performance problem is to compare the execution speed of 
the single command: 

>>> help('modules')

in a python3 shell in a terminal window (it's real fast), 
vs. inside the IDLE3 shell (it's terribly slow).

I understand that IDLE3 uses the tkinter.py/Tcl/Tk toolset for windowing. 
There's something slowing it down on the M1 Mac Mini (MacOS 11.2.3), making it 
run much slower than on a Wintel PC or Linux Raspberry Pi.

I don't know if the problem occurs with any Python versions other than 3.9.2 on 
MacOS.

--

___
Python tracker 

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



[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9

2021-03-16 Thread Tomas Orsava


Change by Tomas Orsava :


--
nosy: +eli.bendersky, scoder

___
Python tracker 

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



[issue43511] Tk 8.6.11 slow on M1 Mac Mini MacOS Python 3.9.2 native ARM version

2021-03-16 Thread E. Paine


Change by E. Paine :


--
components: +macOS
nosy: +epaine, ned.deily, ronaldoussoren
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



[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9

2021-03-16 Thread OndrejPtak


OndrejPtak  added the comment:

Reproducer:
* create ServerProxy with UPI containing query part, e.g. 
http://example.com?foo=bar
* communicate

Old behavior:
-
send: b'POST /?foo=bar HTTP/1.1\r\nHost: example.com\r\nAccept-Encoding: 
gzip\r\nContent-Type: text/xml\r\nUser-Agent: 
Python-xmlrpc/3.8\r\nContent-Length: 197\r\n\r\n'
send: b"\n\ngetRecentChanges\n\n\n20210301T00:00:00\n\n\n\n"

New behaviour:
--
send: b'POST / HTTP/1.1\r\nHost: example.com\r\nAccept-Encoding: 
gzip\r\nContent-Type: text/xml\r\nUser-Agent: 
Python-xmlrpc/3.9\r\nContent-Length: 197\r\n\r\n'
send: b"\n\ngetRecentChanges\n\n\n20210301T00:00:00\n\n\n\n"

--

___
Python tracker 

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



[issue43507] Variables in locals scope fails to be printed.

2021-03-16 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> exec docs should note that the no argument form in a local 
scope is really the two argument form

___
Python tracker 

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



[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

Should the rpath be set on OpenSSL, on the Python ssl module, or on the Python 
executable?

> no (default): don't set an rpath

If most users get it wrong, why not using "auto: auto-detect rpath from 
OPENSSL_LDFLAGS (--with-openssl or pkg-config)" by default?

The Fedora packaging disallows the usage of rpath.

All I need about rpath is that it can be dangerous in some cases, but I forgot 
about the details. For example, on Fedora, if OpenSSL is installed in the 
regular /usr/lib64/libssl.so directory, rpath must not be used. Otherwise, it 
can lead to crash, bugs or vulnerabilities.

Fedora, Python and rpath:

* https://pagure.io/packaging-committee/issue/886
* https://bugs.python.org/issue36659#msg340731

Tell me if you need more details about the issues when rpath is misued. But I 
need to ask my colleagues, I forgot the details.

--
nosy: +vstinner

___
Python tracker 

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



[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2021-03-16 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



[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

It's a compromise.

The default settings for --with-openssl-rpath=no (--without-openssl-rpath) is 
backwards compatible with previous Python versions. The default behavor stays 
the same.

I don't want to set an rpath *unless* the user specifies that they want an 
rpath. I lack time and resources to verify that OPENSSL_LDFLAGS and OpenSSL's 
pkg-config files don't include any -L flags on all Linux, BSD, and macOS 
distributions. The new flag will make it more obvious to users that they may 
want an rpath, too.

$ ./configure --help
...
  --with-openssl=DIR  override root of the OpenSSL directory to DIR
  --with-openssl-rpath=[DIR|auto|no]
  Set runtime library directory (rpath) for OpenSSL
  libraries, no (default): don't set rpath, auto:
  auto-detect rpath from --with-openssl and
  pkg-config, DIR: set an explicit rpath
...

--

___
Python tracker 

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



[issue43284] Inability to fetch build 20H2

2021-03-16 Thread Steve Dower


Steve Dower  added the comment:

Nothing has changed in platform, and all current releases return the same 
version number for me (which matches the original report).

As I said, we need to find a versioned DLL that _always_ rebuilds to extract 
the version number from, because that's the most reliable way I know of to 
avoid the compatibility shims.

--

___
Python tracker 

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



[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-03-16 Thread STINNER Victor


STINNER Victor  added the comment:

> The default settings for --with-openssl-rpath=no (--without-openssl-rpath) is 
> backwards compatible with previous Python versions. The default behavor stays 
> the same.

Ok. That makes sense.

--

___
Python tracker 

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



[issue43497] SyntaxWarning for "assertion is always true, perhaps remove parentheses?" does not work with constants

2021-03-16 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset a8ef4572a6b28bcfc0b10b34fa4204954b9dd761 by tsukasa-au in branch 
'master':
bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867)
https://github.com/python/cpython/commit/a8ef4572a6b28bcfc0b10b34fa4204954b9dd761


--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Ned Batchelder


Ned Batchelder  added the comment:

Is there a reason PEP 626 isn't yet mentioned in 
https://docs.python.org/3.10/whatsnew/3.10.html ?

--

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Mark Shannon


Mark Shannon  added the comment:

No. We should add it.

--

___
Python tracker 

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



[issue42246] Implement PEP 626 -- Precise line numbers for debugging

2021-03-16 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +23654
pull_request: https://github.com/python/cpython/pull/24892

___
Python tracker 

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



[issue41730] Show deprecation warnings for tkinter.tix

2021-03-16 Thread wyz23x2


wyz23x2  added the comment:

Um, is this going on?

--

___
Python tracker 

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



[issue18232] running a suite with no tests is not an error

2021-03-16 Thread Michał Górny

Change by Michał Górny :


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

___
Python tracker 

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



[issue18232] running a suite with no tests is not an error

2021-03-16 Thread Michał Górny

Change by Michał Górny :


--
versions: +Python 3.10 -Python 3.4

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Under Include/, including subdirectories, there are 88 macros that reuse 
arguments.

--
Added file: https://bugs.python.org/file49876/macros-that-reuse-args.txt

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


Removed file: https://bugs.python.org/file49876/macros-that-reuse-args.txt

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


Added file: https://bugs.python.org/file49877/macros-that-reuse-args.txt

___
Python tracker 

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



[issue43513] venv: recreate symlinks on --upgrade

2021-03-16 Thread ThiefMaster


New submission from ThiefMaster :

When using `python -m venv --upgrade someenv`, it rewrites `pyvenv.cfg` with 
the current python version but leaves the python symlinks untouched 
(https://github.com/python/cpython/blob/a8ef4572a6b28bcfc0b10b34fa4204954b9dd761/Lib/venv/__init__.py#L248)

This is of course fine when the original location of the Python interpreter is 
something like `/usr/bin/python3.9`, but when using pyenv it's a path 
containing the full version such as 
`/home/USER/.pyenv/versions/3.9.2/bin/python`, which makes in-place updates of 
minor Python versions harder than needed (manual update of the symlink needed).

IfF you agree that this change makes sense, I wouldn't mind sending a PR for 
this...

--
components: Library (Lib)
messages: 388840
nosy: ThiefMaster
priority: normal
severity: normal
status: open
title: venv: recreate symlinks on --upgrade
type: enhancement

___
Python tracker 

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



[issue43514] Disallow fork in a subinterpreter affects multiprocessing plugin

2021-03-16 Thread Frank Ueberschar


New submission from Frank Ueberschar :

Related to this issue https://bugs.python.org/issue34651, our Bareos libcloud 
plugin cannot be run with Python > 3.7. We are using subprocesses in a 
C-subinterpreter environment. 

Is there a way to circumvent rewriting our code completely?

--
components: C API
messages: 388841
nosy: franku
priority: normal
severity: normal
status: open
title: Disallow fork in a subinterpreter affects multiprocessing plugin
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



[issue43514] Disallow fork in a subinterpreter affects multiprocessing plugin

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

Could you please post the error message and either post a minimal example or 
give us a link to your code?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue32596] Lazy import concurrent.futures.process and thread

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I don't think this was a good idea. Making some imports implicitly lazy 
introduces unpredictability in stdlib imports. Here is an example bug report:
https://issues.apache.org/jira/browse/ARROW-11983

--
nosy: +pitrou

___
Python tracker 

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



[issue43515] Lazy import in concurrent.futures produces partial import errors

2021-03-16 Thread Antoine Pitrou


New submission from Antoine Pitrou :

Here is a reproducer script:
https://gist.github.com/pitrou/a73fa2cfce2557e0dd435353b9976972

With Python 3.6 it works fine.

--
components: Library (Lib)
messages: 388844
nosy: methane, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Lazy import in concurrent.futures produces partial import errors
type: behavior
versions: Python 3.10, 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



[issue43515] Lazy import in concurrent.futures produces partial import errors

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue43515] Lazy import in concurrent.futures produces partial import errors

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Bisecting actually points to issue35943.

--

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Note the conjunction of this change + issue32596 produces import fragility:
https://bugs.python.org/issue43515

--

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Ok, going through other open issues including on third-party projects, I think 
these changes should unfortunately be reverted.  The regressions produced are 
far from trivial and most developers seem at a loss how to fix them.

--

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-16 Thread Eric Snow


Eric Snow  added the comment:

One simple solution is to explicitly state that the limited API does not 
support subinterpreters.  This is already implied by the fact that the 
multi-phase init API (PEP 489) requires subinterpreter support but is not part 
of the limited API.

If we establish this constraint then the problem I originally described here 
goes away (and we can close this issue).

(Note: I'm pretty sure this is something someone suggested to me at some point, 
rather than my own idea.)

--

___
Python tracker 

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



[issue41654] Segfault when raising MemoryError

2021-03-16 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.10, Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

After analysis, it may not need reversal.  There is a simple logic error it 
seems.  Will check.

--

___
Python tracker 

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



[issue43516] python on raspberry pi

2021-03-16 Thread Yann Enoti


New submission from Yann Enoti :

Any idea why this doesnt work ?


import socket

HOST = "192.168.2.114"
PORT = 8000 #initiate port no above 1024

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Socket created')

#try:
s.bind((HOST, PORT))  #bind host address and port together#
#except socket.error as e:
#print('Bind failed.')

s.listen(10)  #configure how many clients the server can listen to 
simultaneously

print("Socket is Listening")
 
#conn, addr = s.accept()#accept new connection
#print("connection from:" + str(addr))


while True:
conn, addr = s.accept()#accept new connection
print("connection from:" + str(addr))

data = conn.recv(1024).decode()  #receive data stream

#if not data: #if data is not received break
   # break
print("from Android App:" + str(data))
data = input ('from Python Server:')
conn.send(data.encode())  #send data to client
conn.close()  #close the connection

--
components: Build
messages: 388850
nosy: gyenoti
priority: normal
severity: normal
status: open
title: python on raspberry pi

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +ammar2
nosy_count: 1.0 -> 2.0
pull_requests: +23657
pull_request: https://github.com/python/cpython/pull/20628

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +23658
pull_request: https://github.com/python/cpython/pull/20508

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner
nosy_count: 2.0 -> 3.0
pull_requests: +23659
pull_request: https://github.com/python/cpython/pull/22387

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-16 Thread Ken Jin


Ken Jin  added the comment:

Apologies if I misunderstood something, but doesn't PEP 544 also state in its 
"Rationale", "Non-goals" subsection that

"""
At runtime, protocol classes will be simple ABCs. There is no intent to provide 
sophisticated runtime instance and class checks against protocol classes. This 
would be difficult and error-prone and will contradict the logic of PEP 484.
"""

https://www.python.org/dev/peps/pep-0544/#non-goals

Which means that the Python runtime isn't supposed to check that, instead it's 
the static type checker's responsibility?

--
nosy: +gvanrossum, kj, levkivskyi

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
assignee: pitrou
components: Library (Lib)
nosy: pitrou
priority: deferred blocker
severity: normal
stage: needs patch
status: open
title: Fix false positives in circular import detection with from-imports
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



[issue43481] PyEval_EvalCode() namespace issue not observed in Python 2.7.

2021-03-16 Thread Chris Morton


Chris Morton  added the comment:

Root cause appears to be indexing c with [] operator. Replacing len(c) with 4 
produces the same error.

--

___
Python tracker 

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



[issue43516] python on raspberry pi

2021-03-16 Thread Eric V. Smith

Eric V. Smith  added the comment:

You’ve not told us the behavior you see or the behavior you expect, so we can’t 
tell if this is a bug in python. 

But it’s in all likelihood not a bug. If you want to get help with your code, I 
suggest asking on the python-list mailing list or maybe Stackoverflow. This bug 
tracker is not a support forum. 

https://mail.python.org/mailman/listinfo/python-list

--
nosy: +eric.smith
status: open -> pending

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-16 Thread Antoine Pitrou


New submission from Antoine Pitrou :

This seems to be caused by a logic error in the patch for issue35943.

It has been causing multiple issues for multi-threaded and multi-process 
systems written in Python:
* issue41567
* issue43515
* https://github.com/dask/distributed/issues/4168

--

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Ammar Askar, do you mind to backport PR 20628 to 3.9? It is the only warning 
left, and it seems there is a potential bug.

--

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


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

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread Ammar Askar


Ammar Askar  added the comment:

Sure thing, I'll work on the backport.

--

___
Python tracker 

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Fix false positives in circular import detection with 
from-imports

___
Python tracker 

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



[issue43515] Lazy import in concurrent.futures produces partial import errors

2021-03-16 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Fix false positives in circular import detection with 
from-imports

___
Python tracker 

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



[issue35943] PyImport_GetModule() can return partially-initialized module

2021-03-16 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Created a new issue + fix in issue43517.

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

___
Python tracker 

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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, nanjekyejoannah, ncoghlan, serhiy.storchaka

___
Python tracker 

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



[issue43518] textwrap.shorten does not always respect word boundaries

2021-03-16 Thread annesylvie


Change by annesylvie :


--
components: Library (Lib)
nosy: annesylvie
priority: normal
severity: normal
status: open
title: textwrap.shorten does not always respect word boundaries
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



[issue43518] textwrap.shorten does not always respect word boundaries

2021-03-16 Thread annesylvie


New submission from annesylvie :

The `shorten` function from the `textwrap` module does not always break strings 
at the correct location.

`shorten("hello world!", width=7, placeholder="")`
 returns
`'hello'`
as expected, but
`shorten("hello world!!", width=7, placeholder="")`
returns
`'hello w'`
which is incorrect. The error seems to appear when two or more exclamation 
marks (in this specific example) are added.

--

___
Python tracker 

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



[issue43499] Compiler warnings in building Python 3.9 on Windows

2021-03-16 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +23661
pull_request: https://github.com/python/cpython/pull/24896

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-16 Thread Eric Snow


Eric Snow  added the comment:

FYI, I posted to capi-sig about this:

https://mail.python.org/archives/list/capi-...@python.org/thread/INLCGPMTYFLRTWQL7RB4MUQZ37JAFRAU/

--

___
Python tracker 

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



[issue43512] Bug in isinstance(instance, cls) with cls being a protocol? (PEP 544)

2021-03-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, the runtime isinstance() checking is not required to give the right 
answer. Also, I believe one of the rules is "if you inherit from a protocol you 
are deemed to implement it". For methods, abstract methods can (but needn't) be 
used to indicate mandatory features. For attributes, there is no guarantee.

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-16 Thread mattip


mattip  added the comment:

I am confused. How can widening the usable number of functions (i.e. using the 
whole C-API rather than the limited API) help c-extension modules be usable in 
subinterpreters? Aren't the same singletons, exception types, and other types 
exposed in the full C-API?

--
nosy: +mattip

___
Python tracker 

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



[issue43519] access python private variable

2021-03-16 Thread David Elmakias


New submission from David Elmakias :

It might be my lack of knowledge in python, however I find this behavior a bit 
strange.

By declaring a private variable in a class, python creates an attribute with 
the name '___'.
Both are located on a different location in memory.

I found that by assigning data to the created variable with the exact 
name/notation '___' I changed the private 
variable data.

--
components: Build
files: access_class_private_variable.py
messages: 388862
nosy: AluminumPirate
priority: normal
severity: normal
status: open
title: access python private variable
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49878/access_class_private_variable.py

___
Python tracker 

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



[issue41654] Segfault when raising MemoryError

2021-03-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1f0cde678406749524d11e852a16bf243cef5c5f by Miss Islington (bot) 
in branch '3.9':
bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894)
https://github.com/python/cpython/commit/1f0cde678406749524d11e852a16bf243cef5c5f


--

___
Python tracker 

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



[issue43519] access python private variable

2021-03-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is not a bug, it is working as intended.

Python does not really support "private" attributes, except by convention. 
Names that begin with a single leading underscore are no different than any 
other name to the interpreter, but the reader is expected to not touch it.

Double-underscore names are no different, except that they have their names 
mangled so that subclasses can have their own version of the attribute that 
doesn't clash with that of the parent class.

Most people find that the double-underscore attributes are not worth the 
trouble. However you may like to read this:

https://www.python.org/dev/peps/pep-0008/#id49


By the way, attributes and variables in Python don't have fixed memory 
addresses. Whatever you did to make you think that:

"Both are located on a different location in memory."

you have misinterpreted what you are seeing.

There is no language feature to get the memory address of any object or 
variable in Python, except perhaps as an accident of implementation. And some 
interpreters include compacting garbage collectors that can move objects around 
memory.

--
nosy: +steven.daprano
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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson

New submission from Carl Anderson :

Fraction works with a regular slash:

>>> from fractions import Fraction
>>> Fraction("1/2")
Fraction(1, 2)

but there are other similar slashes such as (0x2044) in which it throws an 
error:

>>> Fraction("0⁄2")
Traceback (most recent call last):
  File "", line 1, in 
  File "/opt/anaconda3/lib/python3.7/fractions.py", line 138, in __new__
numerator)
ValueError: Invalid literal for Fraction: '0⁄2'


This seems to come from the (?:/(?P\d+))? section of the regex 
_RATIONAL_FORMAT in fractions.py

--
components: Library (Lib)
messages: 388865
nosy: weightwatchers-carlanderson
priority: normal
severity: normal
status: open
title: Fraction only handles regular slashes ("/") and fails with other similar 
slashes
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

There's a bigger issue here about what characters should be accepted in numeric 
literals. The Unicode minus sign (U+2212) "−" is also not currently accepted 
for Fractions or any other built-in numeric type.

> but there are other similar slashes such as (0x2044) in which it throws an 
> error

Do you have a proposal for the set of slashes that should be accepted, or a 
non-arbitrary rule for determining that set?  U+2044 (FRACTION SLASH), U+2215 
(DIVISION SLASH) and U+FF0F (FULLWIDTH SOLIDUS) all seem like potential 
candidates. Are there others?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson

Mark Dickinson  added the comment:

Seems worth noting that Unicode fractions like ⅔ produce a FRACTION SLASH 
character when normalized:

>>> unicodedata.normalize('NFKC', '⅔')
'2⁄3'
>>> list(map(unicodedata.name, unicodedata.normalize('NFKC', '⅔')))
['DIGIT TWO', 'FRACTION SLASH', 'DIGIT THREE']

--

___
Python tracker 

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



[issue43284] Inability to fetch build 20H2

2021-03-16 Thread Eryk Sun


Eryk Sun  added the comment:

Note that the following recommendation for getting the system version was 
removed in late 2019 [1][2]:

To obtain the full version number for the operating system,
call the GetFileVersionInfo function on one of the system
DLLs, such as Kernel32.dll, then call VerQueryValue to obtain
the \\StringFileInfoProductVersion subblock of the file 
version information.

The first commit added advice to check the "CurrentBuildNumber" registry value 
in Windows 10 1909+, but an engineer decided to just remove the paragraph. 
Apparently the developers do not want to guarantee that the version information 
on any particular system DLL can be used to get the system version. Apparently 
they also do not want to officially sanction using the 
"CurrentMajorVersionNumber", "CurrentMinorVersionNumber", and  
"CurrentBuildNumber" values in the registry.

---

[1] https://github.com/MicrosoftDocs/win32/pull/143
[2] 
https://docs.microsoft.com/en-us/windows/win32/sysinfo/getting-the-system-version

--
nosy: +eryksun

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

Related: #6632

--

___
Python tracker 

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



[issue43502] [C-API] Convert obvious unsafe macros to static inline functions

2021-03-16 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

PyUnicode_WRITE, PyUnicode_READ, and PyUnicode_READ_CHAR all reuse their 
arguments, and there's a lot of occurrences (58 AFAICS) where they are called 
with the increment operator applied to the index argument. For example:

Objects/unicodeobject.c:PyUnicode_WRITE(kind, data, pos++, ch);
Modules/_io/textio.c:   c = PyUnicode_READ(kind, in_str, i++);
Objects/stringlib/unicode_format.h: c = PyUnicode_READ_CHAR(self->str.str, 
self->index++);


Would a single PR for all three of them be acceptable, Victor?

--

___
Python tracker 

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



[issue43503] [subinterpreters] PyObject statics exposed in the limited API break isolation.

2021-03-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

There seems to be much confusion here. Maybe on my side?

PEP 489 is *very much* part of the limited API.

--
nosy: +petr.viktorin

___
Python tracker 

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-16 Thread Kodiologist


New submission from Kodiologist :

`ast.unparse` throws an error on an empty set, and it produces `nan` for NaN, 
which isn't a legal Python literal.

PR to follow shortly.

--
messages: 388872
nosy: Kodiologist
priority: normal
severity: normal
status: open
title: Allow `ast.unparse` to handle NaNs and empty sets
type: enhancement
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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-16 Thread Kodiologist


Change by Kodiologist :


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

___
Python tracker 

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-16 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue43477] from x import * behavior inconsistent between module types.

2021-03-16 Thread Brett Cannon


Brett Cannon  added the comment:

Thanks for the clarification! I think I understand what's going on now, and the 
logic is actually expected.

When you do `from .test_submodule import *`, Python must first import 
`test_pkg.test_submodule` in order to get you the object for the `import *` 
part (or frankly anything that comes after `import`). As part of importing 
`test_pkg.test_submodule`, it automatically gets attached to `test_pkg`, 
otherwise we wouldn't be able to cache the module in `sys.modules` and prevent 
redundant/duplicate imports.

As such, when you do `import test_pkg` in`test.py`, the fact that 
`test_pkg.__init__` has to import `test_pkg.test_submodule` means `test_pkg 
will automatically end up with a `test_submodule` attribute. That's why your 
`print()` function call succeeds.

If I'm still misunderstanding, can you please use an `assert` statement that 
fails because the logic doesn't work the way you expect it to be?

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



[issue43521] Allow `ast.unparse` to handle NaNs and empty sets

2021-03-16 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

The reason that we weren't support these cases was there were simply no way 
achieve them by parsing code so we simply ignored (empty sets etc). Though 
considering that you have a decent use case in hy, I'd agree that these small 
additions are viable.

--

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet


New submission from Quentin Pradet :

urllib3 is preparing a v2 with various SSL improvements, such as leaning on the 
ssl module to match hostnames when possible and reject certificates without a 
SAN. See 
https://urllib3.readthedocs.io/en/latest/v2-roadmap.html#modern-security-by-default
 for more details.

For this reason, we want to set `hostname_checks_common_name` to False on 
Python 3.7+ and OpenSSL 1.1.0+. (In other cases, we use a modified version of 
`ssl.match_hostname` that does not consider common names.)

I would expect that setting `hostname_checks_common_name` to False would 
rejects certificates without SANs, but that does not appear to be the case. I 
used the following Python code:

import socket
import ssl

print(ssl.OPENSSL_VERSION)
hostname = 'localhost'
context = ssl.create_default_context()
context.load_verify_locations("client.pem")
context.hostname_checks_common_name = False

with socket.create_connection((hostname, 8000)) as sock:
with context.wrap_socket(sock, server_hostname=hostname) as ssock:
assert "subjectAltName" not in ssock.getpeercert()


which prints `OpenSSL 1.1.1i  8 Dec 2020` and does not fail as expected. I'm 
testing this on macOS 11.2.2 but this currently breaks our test suite on 
Ubuntu, Windows and macOS, including on Python 3.10, see 
https://github.com/urllib3/urllib3/runs/2122811894?check_suite_focus=true.

To reproduce this, I used trustme (https://trustme.readthedocs.io/en/latest/). 
I modified the code to not include a SAN at all and ran `gunicorn --keyfile 
server.key --certfile server.pem app:app`, with app being the Flask quickstart 
application. I'll try to attach all those files if I manage to do it.

What am I missing?

--
assignee: christian.heimes
components: SSL
files: no_san_ignored.py
messages: 388875
nosy: Quentin.Pradet, christian.heimes
priority: normal
severity: normal
status: open
title: SSLContext.hostname_checks_common_name appears to have no effect
versions: Python 3.10
Added file: https://bugs.python.org/file49879/no_san_ignored.py

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet


Change by Quentin Pradet :


Added file: https://bugs.python.org/file49880/app.py

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet


Change by Quentin Pradet :


Added file: https://bugs.python.org/file49882/server.pem

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet


Change by Quentin Pradet :


Added file: https://bugs.python.org/file49881/client.pem

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Quentin Pradet


Change by Quentin Pradet :


Added file: https://bugs.python.org/file49883/server.key

___
Python tracker 

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



[issue43514] Disallow fork in a subinterpreter affects multiprocessing plugin

2021-03-16 Thread Frank Ueberschar


Frank Ueberschar  added the comment:

Here is part of the gdb backtrace:

[franku@franku py3plug-fd-libcloud]$ sbin/bareos_fd-py3plug-fd-libcloud -f -c 
etc/bareos   
Fatal Python error: _PyInterpreterState_DeleteExceptMain: not main interpreter
Python runtime state: initialized

Current thread 0x7f0dc2ab7640 (most recent call first):
  File "/usr/lib64/python3.9/multiprocessing/popen_fork.py", line 66 in _launch
  File "/usr/lib64/python3.9/multiprocessing/popen_fork.py", line 19 in __init__
  File "/usr/lib64/python3.9/multiprocessing/context.py", line 277 in _Popen
  File "/usr/lib64/python3.9/multiprocessing/context.py", line 224 in _Popen
  File "/usr/lib64/python3.9/multiprocessing/process.py", line 121 in start
  File 
"/home/franku/git/bareos/master/core/src/plugins/filed/python/libcloud/BareosLibcloudApi.py",
 line 102 in __init__
  File 
"/home/franku/git/bareos/master/core/src/plugins/filed/python/libcloud/BareosFdPluginLibcloud.py",
 line 267 in start_backup_job
  File 
"/home/franku/git/bareos/master/core/src/plugins/filed/python/pyfiles/BareosFdPluginBaseclass.py",
 line 285 in handle_plugin_event
  File 
"/home/franku/git/bareos/master/core/src/plugins/filed/python/pyfiles/BareosFdWrapper.py",
 line 38 in handle_plugin_event
Fatal Python error: _PyInterpreterState_DeleteExceptMain: not main interpreter
Python runtime state: initialized

--

___
Python tracker 

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



[issue43514] Disallow fork in a subinterpreter affects multiprocessing plugin

2021-03-16 Thread Frank Ueberschar


Frank Ueberschar  added the comment:

Initialization of the Python interpreter in C-code is here: 
https://github.com/bareos/bareos/blob/fb76608092ba204ce43cd7c262619e01f9d6a2d6/core/src/plugins/filed/python/python-fd.cc#L189

The actual Python code that starts the child processes is here:
https://github.com/bareos/bareos/blob/fb76608092ba204ce43cd7c262619e01f9d6a2d6/core/src/plugins/filed/python/libcloud/BareosLibcloudApi.py#L110

Where this is one of the actual Processes: 
https://github.com/bareos/bareos/blob/fb76608092ba204ce43cd7c262619e01f9d6a2d6/core/src/plugins/filed/python/libcloud/bareos_libcloud_api/bucket_explorer.py#L45

Inherited from this base class: 
https://github.com/bareos/bareos/blob/fb76608092ba204ce43cd7c262619e01f9d6a2d6/core/src/plugins/filed/python/libcloud/bareos_libcloud_api/process_base.py#L36

--

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-03-16 Thread Matthew Suozzo


Matthew Suozzo  added the comment:

A few more things:

Assertions on Mock-autospec'ed Mocks will silently pass since e.g. 
assert_called_once_with will now be mocked out. This may justify a more 
stringent stance on the pattern since it risks hiding real test failures.

One complicating factor with the implementation is that autospec'd objects may 
have children that are already Mocked out. Failing eagerly, however, would 
break cases where the child is never used (and consequently risk causing more 
friction than may be necessary) but failing only upon access of that child 
makes it trickier for the user to trace back to where the parent was mocked.

--

___
Python tracker 

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



[issue43514] Disallow fork in a subinterpreter affects multiprocessing plugin

2021-03-16 Thread Frank Ueberschar


Frank Ueberschar  added the comment:

These lines correspond (due to dirty working copy): 

File 
"/home/franku/git/bareos/master/core/src/plugins/filed/python/libcloud/BareosLibcloudApi.py",
 line 102 in __init__

The actual Python code that starts the child processes is here:
https://github.com/bareos/bareos/blob/fb76608092ba204ce43cd7c262619e01f9d6a2d6/core/src/plugins/filed/python/libcloud/BareosLibcloudApi.py#L110

--

___
Python tracker 

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



[issue43478] Disallow Mock spec arguments from being Mocks

2021-03-16 Thread Matthew Suozzo


Matthew Suozzo  added the comment:

And to give some context for the above autospec child bit, this is the relevant 
code that determines the spec to use for each child: 
https://github.com/python/cpython/blob/master/Lib/unittest/mock.py#L2671-L2696

--

___
Python tracker 

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



[issue43285] ftplib should not use the host from the PASV response

2021-03-16 Thread Ned Deily


Ned Deily  added the comment:


New changeset 4134f154ae2f621f25c5d698cc0f1748035a1b88 by Miss Islington (bot) 
in branch '3.6':
[3.6] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) 
(GH-24882)
https://github.com/python/cpython/commit/4134f154ae2f621f25c5d698cc0f1748035a1b88


--

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson

Carl Anderson  added the comment:

from https://en.wikipedia.org/wiki/Slash_(punctuation) there is

U+002F / SOLIDUS
U+2044 ⁄ FRACTION SLASH
U+2215 ∕ DIVISION SLASH
U+29F8 ⧸ BIG SOLIDUS
U+FF0F / FULLWIDTH SOLIDUS (fullwidth version of solidus)
U+1F67C 🙼 VERY HEAVY SOLIDUS

In XML and HTML, the slash can also be represented with the character entity 
/ or / or /.[42]

there are a couple more listed here:

https://unicode-search.net/unicode-namesearch.pl?term=SLASH

--

___
Python tracker 

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



[issue43334] venv does not install libpython

2021-03-16 Thread Anup Parikh


Anup Parikh  added the comment:

I'm seeing this issue in a third-party package that uses CMake and Make based 
build systems rather then setuptools (it's a mostly C library which 
additionally provides some python wrappers). Those build systems can normally 
parse a python installation with the standard directory structure to find the 
library and headers, but fail on a venv. I can bring this up with the package 
developers, but I don't see any downsides to linking the headers/libraries in 
the venv to make it easy to use.

Regarding the comment that venv's are primarily for runtime, I didn't see 
anything in PEP 405 that supports that statement. And in any case, even for 
runtime environments, installing a python package from a source distribution is 
valid, right? So shouldn't the venv support building extensions?

Again, I agree that third party packages that provide python wrappers should 
probably use standard tools (i.e., setuptools) to build the python C 
extensions, but I fail to see the downsides to including links to the 
headers/libraries in the venv for ease of use.

--
status: closed -> open

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Ezio Melotti


Change by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue43285] ftplib should not use the host from the PASV response

2021-03-16 Thread Ned Deily


Ned Deily  added the comment:


New changeset 79373951b3eab585d42e0f0ab83718cbe1d0ee33 by Miss Islington (bot) 
in branch '3.7':
[3.7] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) 
(GH-24883)
https://github.com/python/cpython/commit/79373951b3eab585d42e0f0ab83718cbe1d0ee33


--

___
Python tracker 

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



[issue43520] Fraction only handles regular slashes ("/") and fails with other similar slashes

2021-03-16 Thread Carl Anderson

Carl Anderson  added the comment:

I guess if we are doing slashes, then the division sign ÷ (U+00F7) should be 
included too. 

There are at least 2 minus signs too (U+002D, U+02D7).

--

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

Oh heck, this is a genuine bug. I'm not yet sure if it's an undocumented API 
quirk in OpenSSL, a design bug in OpenSSL, or a bug in my code.

Python sets the host flags on the X509_VERIFY_PARAM of the *SSL_CTX. All flags 
get copied to *SSL struct and later to *X509_STORE_CTX struct. At least I 
thought that all flags get copied. Apparently hostflags aren't copied from 
*SSL_CTX to *SSL because the *SSL_CTX doesn't have any verify hosts configured. 
They are only ever configured on *SSL struct.

https://github.com/openssl/openssl/blob/081a7061f3da07318c4b0f5de67b82285630bf6b/crypto/x509/x509_vpm.c#L202-L213

--

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

PS: I don't see any remark or warning about the behavior on the man pages 
https://www.openssl.org/docs/man1.1.1/man3/X509_VERIFY_PARAM_set_flags.html and 
https://www.openssl.org/docs/man1.1.1/man3/X509_check_host.html

--

___
Python tracker 

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



[issue43522] SSLContext.hostname_checks_common_name appears to have no effect

2021-03-16 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue43334] venv does not install libpython

2021-03-16 Thread Christian Heimes


Christian Heimes  added the comment:

This sounds like a bug in CMake or Make. Are you using any CMake plugins or 
autoconf/automake macros? It's very well possible that the author of these 
extension made a wrong assumption or the extension was written before venvs 
were introduced.

--

___
Python tracker 

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



[issue43523] Handling Ctrl+C when waiting on stdin on Windows via winrs

2021-03-16 Thread George Sovetov


New submission from George Sovetov :

Ctrl+C alone has no effect, but Ctrl+Break works:
```
winrs -r:127.0.0.1:20465 -u:Administrator -p:qweasd123 python -c "import 
sys;sys.stdin.read(1)"
```
Although, if I press Ctrl+C, type zero or more symbols and then press Enter, 
KeyboardInterrupt is raised:
```
lalala
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python39\lib\encodings\cp1252.py", line 22, in decode
def decode(self, input, final=False):
KeyboardInterrupt
^C^C
```

With the following commands, both Ctrl+C and Ctrl+Break work:
```
winrs -r:127.0.0.1:20465 -u:Administrator -p:qweasd123 python -c "import 
time;time.sleep(10)"
"c:\Program Files\Python39\python.exe" -c "import sys; sys.stdin.read(1)"
"c:\Program Files\Python39\python.exe" -c "import time;time.sleep(10)"
```

I faced this issue when working with WSMV (Windows remoting API) directly, but 
I reproduced this with winrs to make sure it's not a bug in my code. I send the 
Ctrl+C signal, got a no-error response, then poll the running command. It 
behaves as if a signal had no effect.

--
messages: 388890
nosy: sovetov
priority: normal
severity: normal
status: open
title: Handling Ctrl+C when waiting on stdin on Windows via winrs
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



[issue43285] ftplib should not use the host from the PASV response

2021-03-16 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the PRs and the What's New entries.

--
assignee: ned.deily -> 
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



[issue43517] Fix false positives in circular import detection with from-imports

2021-03-16 Thread Cebtenzzre


Change by Cebtenzzre :


--
nosy: +cebtenzzre

___
Python tracker 

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



  1   2   >