Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98921

Re: HTTPSConnection from http.client?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: HTTPSConnection from http.client?
Date Tue, 17 Nov 2015 14:24:45 +0100
Organization None
Lines 59
Message-ID <mailman.385.1447766701.16136.python-list@python.org> (permalink)
References <CABPy6+zYvqmOFy7aMNMH0DtUNaaJ3M3nR47QPhDPijsvN2jHbA@mail.gmail.com> <n2f2mb$qoo$1@ger.gmane.org> <CABPy6+zTajMJ8uoPxADbs7hzhVt31XoxGg_NZtaTYwL=LDMwBw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace news.uni-berlin.de Zl6E/bJ01c60OTfqMc7mCQMT3YLaXRYiwk16ocVZbZgg==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'importerror:': 0.05; 'https': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'importing': 0.15; 'packages.': 0.15; 'broken,': 0.16; 'http.client': 0.16; 'module?': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'traceback.': 0.16; 'wrote:': 0.16; 'alex': 0.18; 'ssl': 0.18; '>>>': 0.20; '2015': 0.20; 'please?': 0.22; 'seems': 0.23; 'second': 0.24; 'tried': 0.24; 'import': 0.24; 'module': 0.25; 'install': 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'package.': 0.27; 'idea': 0.28; 'looks': 0.29; 'succeed': 0.29; 'url:client': 0.29; 'there.': 0.30; 'connections': 0.30; 'minimal': 0.30; 'post': 0.31; '[1]': 0.32; 'anybody': 0.32; 'url:python': 0.33; 'tue,': 0.34; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'to:addr :python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'available.': 0.37; 'missing': 0.37; 'no,': 0.38; 'thank': 0.38; 'does': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'received:de': 0.40; 'hello,': 0.40; 'some': 0.40; 'url:3': 0.60; 'your': 0.60; 'skip:u 10': 0.61; 'day': 0.67; 'url:http': 0.75; 'otten': 0.84; 'subject:skip:H 10': 0.84; 'sorry.': 0.91; 'source?': 0.91
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host p57bd942b.dip0.t-ipconnect.de
User-Agent KNode/4.13.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:98921

Show key headers only | View raw


Alex Naumov wrote:

> On Tue, Nov 17, 2015 at 12:22 PM, Peter Otten <__peter__@web.de> wrote:
>> Alex Naumov wrote:
>>
>>> Hello,
>>>
>>> does anybody know how to create a HTTPS connections in python2 or
>>> python3? I tried second day to do that with http.client[1], but every
>>> time get error:
>>>
>>> from http.client import HTTPSConnection
>>> ImportError: cannot import name HTTPSConnection
>>>
>>>
>>> Where is HTTPSConnection located? Which module?
>>>
>>> I use openSUSE 13.1 x86_64.
>>>
>>> Thank you,
>>> Alex
>>>
>>>
>>> [1] https://docs.python.org/3/library/http.client.html
>>
>> Did you compile Python from source?
> 
> No, I install it as a package.
> 
>> You may be missing the development
>> packages.
> 
> Yes, it looks like some packages are not there.
> 
> 
>> On a minimal SLES-12-x86_64 installation:
> 
> Can you tell me what's the name of package with http.client module please?

You already have that module as it is part of the Python standard 
installation. You can double check by importing something that is always 
available. E. g. the following should succeed on your system

>>> from http.client import HTTPConnection
>>>

What you are likely missing is ssl support. Try

>>> import ssl

to verify that it fails and post the traceback.

Unfortunately my conclusion from Marco's post is that

>>> from http.client import HTTPSConnection

should succeed on your system without the need for additional packages. 
Something seems to be broken, but I have no idea what, sorry.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: HTTPSConnection from http.client? Peter Otten <__peter__@web.de> - 2015-11-17 14:24 +0100

csiph-web