~pythonregexp2.7/python/issue2636-01+09-01-01

« back to all changes in this revision

Viewing changes to Lib/httplib.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 00:02:12 UTC
  • mfrom: (39022.1.34 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922000212-7r0q4f4ugiq57jph
Merged in changes from the Atomic Grouping / Possessive Qualifiers branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
67
67
"""
68
68
 
69
 
import mimetools
70
69
import socket
 
70
from sys import py3kwarning
71
71
from urlparse import urlsplit
72
72
import warnings
 
73
with warnings.catch_warnings():
 
74
    if py3kwarning:
 
75
        warnings.filterwarnings("ignore", ".*mimetools has been removed",
 
76
                                DeprecationWarning)
 
77
    import mimetools
73
78
 
74
79
try:
75
80
    from cStringIO import StringIO
813
818
                        host_enc = self.host.encode("ascii")
814
819
                    except UnicodeEncodeError:
815
820
                        host_enc = self.host.encode("idna")
816
 
                    if self.port == HTTP_PORT:
 
821
                    if self.port == self.default_port:
817
822
                        self.putheader('Host', host_enc)
818
823
                    else:
819
824
                        self.putheader('Host', "%s:%s" % (host_enc, self.port))