[issue42417] Empty body {} in POST requests leads to 405 Method not allowed error

2020-12-13 Thread Bhushan Shelke


Bhushan Shelke  added the comment:

Hmm... intriguing... I just downloaded the files, an executed again, following 
is response

Server
```127.0.0.1 - - [14/Dec/2020 13:07:34] "{}POST 
http://localhost:6000/getResponse HTTP/1.1" 405 -```

Client
```py flask_client.py
b'\n405 Method 
Not Allowed\nMethod Not Allowed\nThe method is not allowed 
for the requested URL.\n'

```

Since my theory is based on - body being appended sent fist before header in 
TCP packet. I just uploaded a file(flask_client_long_headers.py) having long 
header values. Could you please use this and check if you can reproduce it now. 
Also please suggest me any other alternative through which I could send more 
relevant information.

--
Added file: https://bugs.python.org/file49676/flask_client_long_headers.py

___
Python tracker 

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



[issue42634] Incorrect line number in bytecode for try-except-finally

2020-12-13 Thread Mark Shannon


New submission from Mark Shannon :

The following code, when traced, produces a spurious line event for line 5:

a, b, c = 1, 1, 1
try:
a = 3
except:
b = 5
finally:
c = 7
assert a == 3 and b == 1 and c == 7

Bug reported by Ned Batchelder 
https://gist.github.com/nedbat/6c5dedde9df8d2de13de8a6a39a5f112

--
assignee: Mark.Shannon
messages: 382958
nosy: Mark.Shannon, nedbat
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Incorrect line number in bytecode for try-except-finally
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue42633] Wave documentation doesn't mention signed/unsigned requirements

2020-12-13 Thread Matthew Walker


New submission from Matthew Walker :

It would be very useful if the documentation for Python's Wave module mentioned 
that 8-bit samples must be unsigned while 16-bit samples must be signed.

See the Wikipedia article on the WAV format: "There are some inconsistencies in 
the WAV format: for example, 8-bit data is unsigned while 16-bit data is 
signed" https://en.wikipedia.org/wiki/WAV

Although I haven't contributed previously, I would be pleased to make such a 
contribution if it would be appreciated.

--
assignee: docs@python
components: Documentation
messages: 382957
nosy: docs@python, mattgwwalker
priority: normal
severity: normal
status: open
title: Wave documentation doesn't mention signed/unsigned requirements
type: enhancement
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



[issue27820] Possible bug in smtplib when initial_response_ok=False

2020-12-13 Thread Pandu E POLUAN


Pandu E POLUAN  added the comment:

This issue is still a bug for Python 3.6 and Python 3.8

I haven't checked on Python 3.7 and Python 3.9

--
versions: +Python 3.6, Python 3.8

___
Python tracker 

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



[issue27820] Possible bug in smtplib when initial_response_ok=False

2020-12-13 Thread Pandu E POLUAN


Pandu E POLUAN  added the comment:

Hi, I'm one of the maintainers of aio-libs/aiosmtpd.

This issue also bit me when trying to write unit tests for aio-libs/aiosmtpd 
AUTH implementation

But I partially disagree with Dario D'Amico's changes, specifically the 
suggested change in the auth_login() method.

According to draft-murchison-sasl-login-00.txt [1], the two challenges sent by 
the server SHOULD be ignored. The example in that document uses 
b"VXNlciBOYW1lAA==" and b"UGFzc3dvcmQA" (b64 of b"User Name\x00" and 
b"Password\x00", respectively), and this is what we have implemented in 
aio-libs/aiosmtpd.

Furthermore, the same document never indicated that username may be sent along 
with "AUTH LOGIN", so we haven't implemented that in aio-libs/aiosmtpd.

So rather than hardcoding the challenges to b"Username:" and b"Password:", a 
compliant SMTP client must instead _count_ the number of challenges it received.

I propose the following changes instead:

def auth(self, mechanism, authobject, *, initial_response_ok=True):
... snip ...
if initial_response is not None:
response = encode_base64(initial_response.encode('ascii'), eol='')
(code, resp) = self.docmd("AUTH", mechanism + " " + response)
self._challenge_count = 1
else:
(code, resp) = self.docmd("AUTH", mechanism)
self._challenge_count = 0
# If server responds with a challenge, send the response.
while code == 334:
self._challenge_count += 1
challenge = base64.decodebytes(resp)
... snip ...

... snip ...

def auth_login(self, challenge=None):
""" Authobject to use with LOGIN authentication. Requires self.user and
self.password to be set."""
if challenge is None or self._challenge_count < 2:
return self.user
else:
return self.password


[1] https://www.ietf.org/archive/id/draft-murchison-sasl-login-00.txt

--
nosy: +pepoluan

___
Python tracker 

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



[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-13 Thread Xinmeng Xia


Xinmeng Xia  added the comment:

Similar bugs exist in other exceptions.

--

___
Python tracker 

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



[issue42632] Reassgining ZeroDivisionError will lead to bug in Except clause

2020-12-13 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Running the following program:
==
def foo():
try:
1/0
except ZeroDivisionError as e:
ZeroDivisionError = 1
foo()
==
The expected output should be nothing. ZeroDivisionError is caught and then 
reassignment is executed. However, running this program in Python3.10 will lead 
to the following error: 

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 5, in foo
1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 8, in 
foo()
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 6, in foo
except Exception as e:
UnboundLocalError: local variable 'Exception' referenced before assignment

--
components: Interpreter Core
messages: 382953
nosy: xxm
priority: normal
severity: normal
status: open
title: Reassgining ZeroDivisionError will lead to bug in Except clause
type: compile error
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



[issue42532] spec_arg's __bool__ is called while initializing NonCallableMock

2020-12-13 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset 14f2a124e20081b8981c8d6165dbd78d11b6808c by Karthikeyan 
Singaravelan in branch '3.9':
[3.9] bpo-42532: Check if NonCallableMock's spec_arg is not None instead of 
call its __bool__ function (GH-23613) (GH-23676)
https://github.com/python/cpython/commit/14f2a124e20081b8981c8d6165dbd78d11b6808c


--

___
Python tracker 

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



[issue42382] No easy way to get the distribution which provided a importlib.metadata.EntryPoint

2020-12-13 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +22614
pull_request: https://github.com/python/cpython/pull/23758

___
Python tracker 

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



[issue42630] Variable.__init__ to raise a RuntimeError instead of obscure AttributeError

2020-12-13 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

Sorry, we need "global" too:

333 > if not master:
334 > global _default_root
335 > if not _default_root:
336 > _default_root = Tk()
337 > master = _default_root
338 > self._root = master._root()

--
resolution:  -> works for me

___
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

2020-12-13 Thread Ned Batchelder


Ned Batchelder  added the comment:

Mark, I'm categorizing and characterizing the test failures.  Here's the start 
of it: https://gist.github.com/nedbat/6c5dedde9df8d2de13de8a6a39a5f112  Let me 
know what other information would be useful.

--

___
Python tracker 

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



[issue42630] Variable.__init__ to raise a RuntimeError instead of obscure AttributeError

2020-12-13 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

Or maybe:

333 > if not master:
334 > if not _default_root:
335 > _default_root = Tk()
336 > master = _default_root
337 > self._root = master._root()

--
title: Variable.__init__ raise a RuntimeError instead of obscure AttributeError 
-> Variable.__init__ to raise a RuntimeError instead of obscure AttributeError

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2020-12-13 Thread Roland Hieber


Roland Hieber  added the comment:

(That was meant to be 68669ef7883 for the autolinking feature)

--

___
Python tracker 

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



[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2020-12-13 Thread Roland Hieber


Roland Hieber  added the comment:

What's the status of this patch? Is it still needed after 68669ef7883e, which 
went into v3.8.1?

--
nosy: +rhi

___
Python tracker 

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



[issue42630] Variable.__init__ raise a RuntimeError instead of obscure AttributeError

2020-12-13 Thread Ivo Shipkaliev


Ivo Shipkaliev  added the comment:

https://mail.python.org/archives/list/python-id...@python.org/thread/FSQUFJJQDNSRN4HI7VFXWCNO46YLXQDS/

--

___
Python tracker 

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



[issue42631] Multiprocessing module hangs on os.read() on Linux

2020-12-13 Thread to7m


New submission from to7m :

As best I can tell, sometimes when a Listener or Connection is not properly 
initialised, the Client fails to communicate properly with it. Instead of 
raising an exception, the Client hangs.


receiver.py:


from multiprocessing.connection import Listener

while True:
with Listener(("localhost", 1), authkey=b"test") as listener:
with listener.accept() as connection:
print(connection.recv())


client.py (intended as a stress test):


from multiprocessing.connection import Client

for i in range(1000):
successfully_sent = False
while not successfully_sent:
try:
with Client(("localhost", 1), authkey=b"test") as client:
client.send(i)
except (ConnectionRefusedError, ConnectionResetError):
continue
successfully_sent = True


Also noteworthy: I posted on StackExchange 
(https://stackoverflow.com/questions/65276145/multiprocessing-receive-all-messages-from-multiple-runtimes)
 and it seems that the code there (only 1000 messages) took around an hour to 
run for a Windows user, whereas it would take less than a second to 
successfully run on Linux.

--
components: IO
files: receive.py
messages: 382945
nosy: to7m
priority: normal
severity: normal
status: open
title: Multiprocessing module hangs on os.read() on Linux
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49675/receive.py

___
Python tracker 

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



[issue42630] Variable.__init__ raise a RuntimeError instead of obscure AttributeError

2020-12-13 Thread Ivo Shipkaliev


New submission from Ivo Shipkaliev :

Hello.

I think it would be nice to add:

335 > if not master:
336 > raise RuntimeError('a valid Tk instance is required.')

to lib/tkinter/__init__.py, and not rely on this unclear AttributeError.

Could it be assigned to me, please?

Best Regards
Ivo Shipkaliev

--
components: Tkinter
messages: 382944
nosy: shippo_
priority: normal
severity: normal
status: open
title: Variable.__init__ raise a RuntimeError instead of obscure AttributeError
type: behavior

___
Python tracker 

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:

Thanks for noticing the failures and for the PR!

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:


New changeset 9feda9f871498463fe502d63204cf9cd6c1f4706 by Miss Islington (bot) 
in branch '3.8':
bpo-42598: Fix implicit function declarations in configure (GH-23690) (GH-23757)
https://github.com/python/cpython/commit/9feda9f871498463fe502d63204cf9cd6c1f4706


--

___
Python tracker 

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:


New changeset 3dcdbdeb4833e45430ccc9cb3432f779a6fd8c94 by Miss Islington (bot) 
in branch '3.9':
bpo-42598: Fix implicit function declarations in configure (GH-23690) (GH-23756)
https://github.com/python/cpython/commit/3dcdbdeb4833e45430ccc9cb3432f779a6fd8c94


--

___
Python tracker 

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22613
pull_request: https://github.com/python/cpython/pull/23757

___
Python tracker 

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +22612
pull_request: https://github.com/python/cpython/pull/23756

___
Python tracker 

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



[issue42598] Some configure checks rely on implicit function declaration

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:


New changeset 674fa0a740151e0416c9383f127b16014e805990 by Joshua Root in branch 
'master':
bpo-42598: Fix implicit function declarations in configure (GH-23690)
https://github.com/python/cpython/commit/674fa0a740151e0416c9383f127b16014e805990


--
nosy: +ned.deily

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:

> Are there plans to backport PR 22855 to any branches older than 3.9?

The plan is to also support 3.8 on Big Sur and Apple Silicon as 3.8 is still in 
bugfix mode.  There are no plans to backport support to 3.7 and 3.6 which are 
in the security-fix-only phase of their release cycles.

--

___
Python tracker 

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



[issue41559] Add support for PEP 612 (Parameter Specification Variables) to typing.py

2020-12-13 Thread Guido van Rossum


Guido van Rossum  added the comment:

This is now unblocked now that GH-23060 has landed.

--

___
Python tracker 

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



[issue37945] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2020-12-13 Thread Doug Richardson


Change by Doug Richardson :


--
nosy: +drichardson

___
Python tracker 

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



[issue42608] Installation failed from source code on Debian ([307/416] test_socket)

2020-12-13 Thread Ned Deily


Ned Deily  added the comment:

Also, I have seen test_socket hang like this in the past on Debian when 
building with older versions of openssl 1.1.0. If possible, try upgrading to a 
later or current version of openssl 1.1.0.

--
nosy: +ned.deily

___
Python tracker 

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



[issue37324] collections: remove deprecated aliases to ABC classes

2020-12-13 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
nosy: +hugovk
nosy_count: 4.0 -> 5.0
pull_requests: +22611
pull_request: https://github.com/python/cpython/pull/23754

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-12-13 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 463c7d3d149283814d879a9bb8411af64e656c8e by kj in branch 'master':
bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and 
typing (GH-23060)
https://github.com/python/cpython/commit/463c7d3d149283814d879a9bb8411af64e656c8e


--

___
Python tracker 

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



[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e by Pablo Galindo in 
branch 'master':
bpo-30858: Improve error location for expressions with assignments (GH-23753)
https://github.com/python/cpython/commit/43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e


--

___
Python tracker 

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



[issue42625] Segmentation fault of PyState_AddModule()

2020-12-13 Thread hai shi


hai shi  added the comment:

> When does this actually happen? Is there a common situation where you'd 
> mistakenly pass NULL to PyState_AddModule?

If created mod haven't been checked will have this risk. PyState_AddModule
is a exposing C API, we should make sure that calling API is in a safe way(not 
raising a segmentation fault). :)

--

___
Python tracker 

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



[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

+1 for the `=` sign

--

___
Python tracker 

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



[issue41100] Support macOS 11 and Apple Silicon Macs

2020-12-13 Thread Joshua Root


Joshua Root  added the comment:

Are there plans to backport PR 22855 to any branches older than 3.9?

--
nosy: +jmr

___
Python tracker 

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