[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na

Dong-hee Na  added the comment:

Thanks, Ross Rhodes for the fix!
And thanks, Wüstengecko for the report!

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 69120613c071e9327a9dc6e4b1ff21b2e94d885e by Ross in branch '3.9':
[3.9] bpo-42756: Configure LMTP Unix-domain socket to use global default 
timeout when timeout not provided (GH-23969) (GH-24050)
https://github.com/python/cpython/commit/69120613c071e9327a9dc6e4b1ff21b2e94d885e


--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Ross Rhodes


Change by Ross Rhodes :


--
pull_requests: +22886
pull_request: https://github.com/python/cpython/pull/24050

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests:  -22885

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +22885
pull_request: https://github.com/python/cpython/pull/24049

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2021-01-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 3bf05327c2b25d42b92795d9d280288c22a0963d by Ross in branch 
'master':
bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when 
timeout not provided (GH-23969)
https://github.com/python/cpython/commit/3bf05327c2b25d42b92795d9d280288c22a0963d


--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
type: crash -> behavior

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-31 Thread Dong-hee Na


Dong-hee Na  added the comment:

This is a regression bug that should be fixed.

--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-31 Thread Dong-hee Na


Dong-hee Na  added the comment:

This

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +vstinner

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-31 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-29 Thread Wüstengecko

Wüstengecko  added the comment:

Hello,
I can confirm that the PR resolves the issue.
Thanks for the quick fix!

--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Ross Rhodes

Ross Rhodes  added the comment:

Hello Wüstengecko,

Thanks for raising this issue. I've opened a PR which I believe will resolve 
the problem, but it's difficult to verify this against the mock socket setup. 
Feel free to leave feedback.

--

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Ross Rhodes


Change by Ross Rhodes :


--
keywords: +patch
nosy: +trrhodes
nosy_count: 1.0 -> 2.0
pull_requests: +22814
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/23969

___
Python tracker 

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



[issue42756] smtplib.LMTP.connect() raises TypeError if `timeout` is not specified

2020-12-27 Thread Wüstengecko

New submission from Wüstengecko :

Since Python 3.9, calling `smtplib.LMTP.connect()` without explicitly 
specifying any `timeout=` raises a `TypeError`. Specifying `None` or any 
integer value works correctly.

```
>>> import smtplib
>>> smtplib.LMTP("/tmp/lmtp.sock")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/smtplib.py", line 1071, in __init__
super().__init__(host, port, local_hostname=local_hostname,
  File "/usr/lib/python3.9/smtplib.py", line 253, in __init__
(code, msg) = self.connect(host, port)
  File "/usr/lib/python3.9/smtplib.py", line 1085, in connect
self.sock.settimeout(self.timeout)
TypeError: an integer is required (got type object)
>>> l = smtplib.LMTP()
>>> l.connect("/tmp/lmtp.sock")
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/smtplib.py", line 1085, in connect
self.sock.settimeout(self.timeout)
TypeError: an integer is required (got type object)
```

Upon investigation with `pdb`, the default object for the `timeout` parameter 
(`socket._GLOBAL_DEFAULT_TIMEOUT`) is passed through to the 
`self.sock.settimeout` call, instead of being handled as "no timeout 
specified". The relevant changes were introduced as fix for bpo-39329.

--
components: Library (Lib)
messages: 383850
nosy: wuestengecko
priority: normal
severity: normal
status: open
title: smtplib.LMTP.connect() raises TypeError if `timeout` is not specified
type: crash
versions: Python 3.9

___
Python tracker 

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