Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-09 Thread Christian Heimes
On 2018-04-09 10:30, Serhiy Storchaka wrote:
>> I get the same issues too, and this has been happening for quite some
>> time.  The tests and/or poplib itself may be written in a fragile way.
> 
> I get the different issue with test_poplib (running with the -j option).
> All tests except test_multiprocessing_fork are passed, and test_poplib
> hangs. I thought it is a misconfiguration on my computer.

It's not your computer, it's the test suite. It uses the old asyncore
library. The test has become unstable since the ssl module properly
checks host names, see https://bugs.python.org/issue32706 and
https://bugs.python.org/issue32753.

In Python 3.6 and earlier, a hostname verification error resulted in a
closed connection. Starting with Python 3.7, the ssl module checks the
hostname earlier in the TLS handshake. A verification error results in a
TLS handshake alert and an exception on the server side. Sometimes the
old server code in asyncore runs into a race condition and the test fails.

The whole test framework needs to be rewritten from scratch and replaced
with something better. I haven't had time to work on it.

Christian

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-09 Thread INADA Naoki
FYI, there is filed issue.

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


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-09 Thread Christian Heimes
On 2018-04-08 01:33, Skip Montanaro wrote:
>> Do you have ca-certificates installed?
> 
> It seems so:
> 
> % apt search ca-certificates | grep installed
> 
> ca-certificates/artful,artful,now 20170717 all [installed]
> ca-certificates-mono/artful,artful,now 4.6.2.7+dfsg-1ubuntu1 all
> [installed,automatic]
> liblwp-protocol-https-perl/artful,artful,now 6.07-2 all [installed]

Skip, it's a red herring. Python's test_poplib suite doesn't depend on
public CA certs.

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-09 Thread Serhiy Storchaka

08.04.18 19:10, Antoine Pitrou пише:

On Sat, 7 Apr 2018 17:31:47 -0500
Skip Montanaro  wrote:

It's been a long while since I rebuilt Python from the Git source. I
tried for the first time the other day. Everything passed except
test_poplib and test_asyncio. The former just runs and runs and runs.
Here's the first traceback I encounter when executing ./python
Lib/test/test_poplib.py:

test_stls_context (__main__.TestPOP3Class) ... Exception in thread Thread-16:
Traceback (most recent call last):
   File "/home/skip/src/python/cpython/Lib/threading.py", line 917, in
_bootstrap_inner
 self.run()
   File "Lib/test/test_poplib.py", line 227, in run
 asyncore.loop(timeout=0.1, count=1)
   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 207, in loop
 poll_fun(timeout, map)
   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 150, in poll
 read(obj)
   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 87, in read
 obj.handle_error()
   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 83, in read
 obj.handle_read_event()
   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 422, in
handle_read_event
 self.handle_read()
   File "Lib/test/test_poplib.py", line 194, in handle_read
 self._do_tls_handshake()
   File "Lib/test/test_poplib.py", line 174, in _do_tls_handshake
 self.socket.do_handshake()
   File "/home/skip/src/python/cpython/Lib/ssl.py", line 1108, in do_handshake
 self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert
certificate unknown (_ssl.c:1049)

[...]

I get the same issues too, and this has been happening for quite some
time.  The tests and/or poplib itself may be written in a fragile way.


I get the different issue with test_poplib (running with the -j option). 
All tests except test_multiprocessing_fork are passed, and test_poplib 
hangs. I thought it is a misconfiguration on my computer.


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-08 Thread Antoine Pitrou
On Sat, 7 Apr 2018 17:31:47 -0500
Skip Montanaro  wrote:
> It's been a long while since I rebuilt Python from the Git source. I
> tried for the first time the other day. Everything passed except
> test_poplib and test_asyncio. The former just runs and runs and runs.
> Here's the first traceback I encounter when executing ./python
> Lib/test/test_poplib.py:
> 
> test_stls_context (__main__.TestPOP3Class) ... Exception in thread Thread-16:
> Traceback (most recent call last):
>   File "/home/skip/src/python/cpython/Lib/threading.py", line 917, in
> _bootstrap_inner
> self.run()
>   File "Lib/test/test_poplib.py", line 227, in run
> asyncore.loop(timeout=0.1, count=1)
>   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 207, in loop
> poll_fun(timeout, map)
>   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 150, in poll
> read(obj)
>   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 87, in read
> obj.handle_error()
>   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 83, in read
> obj.handle_read_event()
>   File "/home/skip/src/python/cpython/Lib/asyncore.py", line 422, in
> handle_read_event
> self.handle_read()
>   File "Lib/test/test_poplib.py", line 194, in handle_read
> self._do_tls_handshake()
>   File "Lib/test/test_poplib.py", line 174, in _do_tls_handshake
> self.socket.do_handshake()
>   File "/home/skip/src/python/cpython/Lib/ssl.py", line 1108, in do_handshake
> self._sslobj.do_handshake()
> ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert
> certificate unknown (_ssl.c:1049)
[...]

I get the same issues too, and this has been happening for quite some
time.  The tests and/or poplib itself may be written in a fragile way.

Regards

Antoine.


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-07 Thread Skip Montanaro
> Do you have ca-certificates installed?

It seems so:

% apt search ca-certificates | grep installed

ca-certificates/artful,artful,now 20170717 all [installed]
ca-certificates-mono/artful,artful,now 4.6.2.7+dfsg-1ubuntu1 all
[installed,automatic]
liblwp-protocol-https-perl/artful,artful,now 6.07-2 all [installed]

S
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trying to build from source, test-poplib fails

2018-04-07 Thread Ryan Gonzalez

Do you have ca-certificates installed?

On April 7, 2018 5:33:35 PM Skip Montanaro  wrote:


It's been a long while since I rebuilt Python from the Git source. I
tried for the first time the other day. Everything passed except
test_poplib and test_asyncio. The former just runs and runs and runs.
Here's the first traceback I encounter when executing ./python
Lib/test/test_poplib.py:

test_stls_context (__main__.TestPOP3Class) ... Exception in thread Thread-16:
Traceback (most recent call last):
 File "/home/skip/src/python/cpython/Lib/threading.py", line 917, in
_bootstrap_inner
   self.run()
 File "Lib/test/test_poplib.py", line 227, in run
   asyncore.loop(timeout=0.1, count=1)
 File "/home/skip/src/python/cpython/Lib/asyncore.py", line 207, in loop
   poll_fun(timeout, map)
 File "/home/skip/src/python/cpython/Lib/asyncore.py", line 150, in poll
   read(obj)
 File "/home/skip/src/python/cpython/Lib/asyncore.py", line 87, in read
   obj.handle_error()
 File "/home/skip/src/python/cpython/Lib/asyncore.py", line 83, in read
   obj.handle_read_event()
 File "/home/skip/src/python/cpython/Lib/asyncore.py", line 422, in
handle_read_event
   self.handle_read()
 File "Lib/test/test_poplib.py", line 194, in handle_read
   self._do_tls_handshake()
 File "Lib/test/test_poplib.py", line 174, in _do_tls_handshake
   self.socket.do_handshake()
 File "/home/skip/src/python/cpython/Lib/ssl.py", line 1108, in do_handshake
   self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert
certificate unknown (_ssl.c:1049)

I thought perhaps I was missing something, but _ssl built just fine. I
believe I have a recent enough version of libssl (1.0.2g), and I'm on
a pretty vanilla system (up-to-date Ubuntu 17.10). SSL-wise:

% apt search ssl | grep installed | egrep '^lib' | egrep ssl

libgnutls-openssl27/artful,now 3.5.8-6ubuntu3 amd64 [installed]
libio-socket-ssl-perl/artful,artful,now 2.050-1 all [installed]
libnet-smtp-ssl-perl/artful,artful,now 1.04-1 all [installed]
libnet-ssleay-perl/artful,now 1.80-1build1 amd64 [installed]
libssl-dev/artful-updates,artful-security,now 1.0.2g-1ubuntu13.4 amd64
[installed]
libssl-doc/artful-updates,artful-updates,artful-security,artful-security,now
1.0.2g-1ubuntu13.4 all [installed,automatic]
libssl1.0.0/artful-updates,artful-security,now 1.0.2g-1ubuntu13.4
amd64 [installed]

Any clues about what I might be missing from my setup would be appreciated.

Not sure what was wrong with test_asyncio. I ran it in isolation and it passed.

Thx,

Skip
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com


--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Trying to build from source, test-poplib fails

2018-04-07 Thread Skip Montanaro
It's been a long while since I rebuilt Python from the Git source. I
tried for the first time the other day. Everything passed except
test_poplib and test_asyncio. The former just runs and runs and runs.
Here's the first traceback I encounter when executing ./python
Lib/test/test_poplib.py:

test_stls_context (__main__.TestPOP3Class) ... Exception in thread Thread-16:
Traceback (most recent call last):
  File "/home/skip/src/python/cpython/Lib/threading.py", line 917, in
_bootstrap_inner
self.run()
  File "Lib/test/test_poplib.py", line 227, in run
asyncore.loop(timeout=0.1, count=1)
  File "/home/skip/src/python/cpython/Lib/asyncore.py", line 207, in loop
poll_fun(timeout, map)
  File "/home/skip/src/python/cpython/Lib/asyncore.py", line 150, in poll
read(obj)
  File "/home/skip/src/python/cpython/Lib/asyncore.py", line 87, in read
obj.handle_error()
  File "/home/skip/src/python/cpython/Lib/asyncore.py", line 83, in read
obj.handle_read_event()
  File "/home/skip/src/python/cpython/Lib/asyncore.py", line 422, in
handle_read_event
self.handle_read()
  File "Lib/test/test_poplib.py", line 194, in handle_read
self._do_tls_handshake()
  File "Lib/test/test_poplib.py", line 174, in _do_tls_handshake
self.socket.do_handshake()
  File "/home/skip/src/python/cpython/Lib/ssl.py", line 1108, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert
certificate unknown (_ssl.c:1049)

I thought perhaps I was missing something, but _ssl built just fine. I
believe I have a recent enough version of libssl (1.0.2g), and I'm on
a pretty vanilla system (up-to-date Ubuntu 17.10). SSL-wise:

% apt search ssl | grep installed | egrep '^lib' | egrep ssl

libgnutls-openssl27/artful,now 3.5.8-6ubuntu3 amd64 [installed]
libio-socket-ssl-perl/artful,artful,now 2.050-1 all [installed]
libnet-smtp-ssl-perl/artful,artful,now 1.04-1 all [installed]
libnet-ssleay-perl/artful,now 1.80-1build1 amd64 [installed]
libssl-dev/artful-updates,artful-security,now 1.0.2g-1ubuntu13.4 amd64
[installed]
libssl-doc/artful-updates,artful-updates,artful-security,artful-security,now
1.0.2g-1ubuntu13.4 all [installed,automatic]
libssl1.0.0/artful-updates,artful-security,now 1.0.2g-1ubuntu13.4
amd64 [installed]

Any clues about what I might be missing from my setup would be appreciated.

Not sure what was wrong with test_asyncio. I ran it in isolation and it passed.

Thx,

Skip
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com