Github messages for voidlinux
 help / color / mirror / Atom feed
From: imrn <imrn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: Python SSL support is unavailable
Date: Sat, 16 May 2020 20:49:15 +0200	[thread overview]
Message-ID: <20200516184915.7A-ywS8j2G870VWoJvv8YaUbvU94ZFMY7R9SuMYBV-A@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-21994@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

New comment by imrn on void-packages repository

https://github.com/void-linux/void-packages/issues/21994#issuecomment-629684525

Comment:
Found it!. I discovered that I had an experimental obscure "ssl.py" within the same directory which also imports many classes from python's own "ssl".

Interestingly as above examples has no direct "import ssl" statement, somehow it interferes with them and their tracebacks provide no clues about it! Traceback does not even mention that obscure file and its classes!!

Luckly, as I decided to experiment with some more low level stuff below and analyze the trace back, I've discovered it. This time that obscure file surfaced in the traceback.

Bad luck, mixed with python's "marvelous" import machinery and exception handing creates interesting and hard to find bugs.

Thank you all for your comments for eliminating above possibilities so that I could focus on proper problem region. Just closing.

```python3
import socket
import ssl

hostname = 'www.python.org'
context = ssl.create_default_context()
with socket.create_connection((hostname, 443)) as sock:
    with context.wrap_socket(sock, server_hostname=hostname) as ssock:
        print(ssock.version())
```

      parent reply	other threads:[~2020-05-16 18:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 19:45 [ISSUE] " imrn
2020-05-15 19:52 ` Hoshpak
2020-05-15 19:58 ` Hoshpak
2020-05-15 21:20 ` q66
2020-05-16  3:51 ` sgn
2020-05-16  4:52 ` fosslinux
2020-05-16  8:07 ` imrn
2020-05-16  8:07 ` imrn
2020-05-16 11:46 ` imrn
2020-05-16 12:02 ` Chocimier
2020-05-16 12:02 ` Chocimier
2020-05-16 12:17 ` imrn
2020-05-16 12:21 ` Chocimier
2020-05-16 12:54 ` imrn
2020-05-16 12:58 ` imrn
2020-05-16 13:02 ` imrn
2020-05-16 13:14 ` imrn
2020-05-16 13:23 ` imrn
2020-05-16 15:21 ` imrn
2020-05-16 15:22 ` imrn
2020-05-16 18:00 ` imrn
2020-05-16 18:00 ` [ISSUE] [CLOSED] " imrn
2020-05-16 18:49 ` imrn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200516184915.7A-ywS8j2G870VWoJvv8YaUbvU94ZFMY7R9SuMYBV-A@z \
    --to=imrn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).