diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-05 11:59:14 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-05 11:59:14 (GMT) |
commit | 0372e106841e2d641556b6f5146d59cbe189534f (patch) | |
tree | 8305ae6560d213bbab352ebc343afa33fc81af8a /Lib/logging/handlers.py | |
parent | 9cc432d93799652cb21ac4473d6875ed3de01937 (diff) | |
download | cpython-0372e106841e2d641556b6f5146d59cbe189534f.zip cpython-0372e106841e2d641556b6f5146d59cbe189534f.tar.gz cpython-0372e106841e2d641556b6f5146d59cbe189534f.tar.bz2 |
Improved coverage and fixed bug in HTTPHandler with POST requests.
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 603a534..0086808 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -29,7 +29,7 @@ from stat import ST_DEV, ST_INO, ST_MTIME import queue try: import threading -except ImportError: +except ImportError: #pragma: no cover threading = None try: @@ -1044,7 +1044,9 @@ class HTTPHandler(logging.Handler): s = ('u%s:%s' % self.credentials).encode('utf-8') s = 'Basic ' + base64.b64encode(s).strip() h.putheader('Authorization', s) - h.endheaders(data if self.method == "POST" else None) + h.endheaders() + if self.method == "POST": + h.send(data.encode('utf-8')) h.getresponse() #can't do anything with the result except (KeyboardInterrupt, SystemExit): #pragma: no cover raise |