4 ms·
Python’s httplib uses print for debugging. Oh, it hurts…
- Estragon 16y agoFixing this is a minor rototilling exercise. Just change the print statements to something more sensible and submit a patch.
- wildjim 16y agoBut I've seen this sort of crap in all sorts of "standard" lib's in Python, and it never seems to get cleaned-up... ... I really hate having to use Python.
- j_baker 16y agoEvery language and library has its warts and Python is no exception. By and large though, I'd say that Python's standard library is the best part of the language. Sure there are a lot of things like this out there, but for the most part, the standard library "just works" the way it's supposed to.
- rue 16y ago> But I've seen this sort of crap in all sorts of "standard" lib's in Python, and it never seems to get cleaned-up... I assume you meant to write "I've seen this sort of crap and written patches for it"?
- jokull 16y agoCheck out restkit (http://github.com/benoitc/restkit http://github.com/benoitc/restkit) - much better then urllib/2 or httplib/2
- brodie 16y agoWhat's wrong with httplib2?
- jokull 16y agoIt actually uses httplib1 under the hood which I've had weird problems with (even when using the httplib2 abstraction). Restkit has a better interface and really cool filters for such things as proxies.
- est 16y agoand urllib3 http://code.google.com/p/urllib3/ http://code.google.com/p/urllib3/
- ErrantX 16y agoHttplib has caused me headaches in the past (admittedly due to a very specific and convoluted architecture). But I wouldn't call it bad... the point made here is simply an issue of not considering scale - in this case easily fixed. I would call it slow.
- deleted 16y ago[deleted]
- gxti 16y agoIt's a debugging feature. It scratched a particular itch that a particular developer had at the time that they wrote it. If it weren't there at all, would this blog post still have been written?
- TimothyFitz 16y agoThis code is almost as old as the web itself. The debug loglevel stuff was in the original check-in in 1994, by Guido himself: http://svn.python.org/view/python/trunk/Lib/httplib.py?revision=3849&view=markup http://svn.python.org/view/python/trunk/Lib/httplib.py?revis... A simple find-replace would be enough to switch it over to python's built-in logging module.
- japherwocky 16y agoCurious what you're using httplib for? 80% chance you're reinventing a wheel.
- fauigerzigerk 16y agoSometimes reinventing something as simple as the wheel is more robust than adapting someone elses equally half baked and unmaintained attempt at wheel reinvention from 2002.
- losethos 16y agosingle stepping is for those who can't read code