Python Forum
httplib to http.client conversion issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
httplib to http.client conversion issue
#1
I am a relatively newbie, dealing with python 2.7 code that needs to go to python 3.6 or 3.7
In the code I have 'import httplib' that I dutifully changed to 'import http.client as httplib'

Later in the code I have:

class whateverHTTPS(httplib.HTTP):

To that I get the error:
AttributeError: module 'http.client' has no attribute 'HTTP'

I searched the online documentation for httplib and indeed did not find HTTP

Attempted to change the code to:

class whateverHTTPS(httpclient.HTTP):

produces the error:
NameError: name 'http' is not defined

can somebody please shed light on my mistake
Thanks
ZA
Reply
#2
Please show code.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Date Conversion issue Racer_x 2 1,786 Jan-10-2022, 02:40 PM
Last Post: Racer_x
  ModuleNotFoundError: No module named 'http.client'; 'http' is not a package abhishek81py 1 15,464 Jun-25-2020, 08:58 AM
Last Post: buran
  Type conversion issue while using Descriptor in Python3 mailnsuresh 1 2,855 May-07-2020, 12:26 PM
Last Post: deanhystad
  HTTP response capturing issue miunika 1 2,035 Mar-16-2019, 01:46 PM
Last Post: Larz60+
  HTTP response capturing issue anna 2 2,505 Mar-15-2019, 03:08 PM
Last Post: Larz60+
  Issue about conversion akshay_jain 1 3,470 Feb-20-2017, 08:17 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020