> > Python 2.4.3 (#1, Jun 13 2006, 11:46:08) > > [GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import httplib > > >>> conn = httplib.HTTPConnection("www.python.org") > > >>> conn.request("GET", "/index.html") > > Hello World. > > Off-hand -- I'd suggest you do a search of your computer for any > occurrence of > httplib.py > httplib.pyc > httplib.pyo > on the odd chance that you are picking up some corrupted version...
Problem solved (sort of...). I searched for "httplib*". I had some cygwin stuff archived on my Linux box, but the cygwin stuff wasn't in my search path, but on an odd chance I renamed the cygwin httplib* files to something else. Problem persisted. On another odd chance I fired up "python" as root, plugged in the example at http://www.python.org/doc/current/lib/httplib-examples.html, and things were clicking... There was a problem with "r2", but that was understandable... In my confused state I created a new user, fired up python, slung the example code, and had no problem (except for "r2", but that was understandable). So, I looked at my search path under the account that was experiencing the problem. That wasn't it... Then I'm thinking there's an environmental variable causing this. Too many to work right now. Will investigate later. So, the problem lies somewhere in the account running Python... Not sure how/why... Thanks to all!, Pete > > -=-=-=-=-=-=-=- > PythonWin 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] > on win32. > Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) - > see 'Help/About PythonWin' for further copyright information. > >>> import httplib > >>> conn = httplib.HTTPConnection("www.python.org") > >>> conn.request("GET", "/index.html") > >>> resp = conn.getresponse() > >>> print resp.getheaders() > [('content-length', '12196'), ('accept-ranges', 'bytes'), ('server', > 'Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_python/3.1.3 > Python/2.3.5 mod_ssl/2.0.54 OpenSSL/0.9.7e'), ('last-modified', 'Sat, 23 > Sep 2006 23:49:01 GMT'), ('etag', '"61b82-2fa4-99e01540"'), ('date', > 'Sun, 24 Sep 2006 03:26:30 GMT'), ('content-type', 'text/html')] > >>> print resp.read() > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta content="text/html; charset=utf-8" http-equiv="content-type" /> > -- > Wulfraed Dennis Lee Bieber KD6MOG > [EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [EMAIL PROTECTED]) > HTTP://www.bestiaria.com/ -- http://mail.python.org/mailman/listinfo/python-list