This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Cal.Leeming
Recipients Cal.Leeming, r.david.murray
Date 2011-06-30.19:39:52
SpamBayes Score 7.837004e-10
Marked as misclassified No
Message-id <1309462793.26.0.295451194415.issue12455@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, I should clarify.. The str() patch worked, but it failed to work within the realm of urllib2:


s = _str("Content-MD5")
print "Builtin:"
print "plain:       %s" % ( s )
print "capitalized: %s" % ( s.capitalize() )

s = str("Content-MD5")
print "Builtin:"
print "plain:       %s" % ( s )
print "capitalized: %s" % ( s.capitalize() )

Builtin:
plain:       Content-MD5
capitalized: Content-MD5
Builtin:
plain:       Content-MD5
capitalized: Content-md5

Why it works in the unit test, and not within urllib2, is totally beyond me. Especially since I put a debug call on the method, and it does get called.. yet urllib2 debug still shows it sending the wrong value.

---
capitalize() bypassed: sending value: Content-MD5
send: 'POST /api/url\r\nContent-Md5: nts0yj7AdzJALyNOxafDyA==\r\n\r\n'
---

I have a feeling that the problem may lie somewhere after the opener (like HTTPConnection or AbstractHTTPHandler), rather than the urllib2 calls to capitalize(), but not having much luck monkey patching those :X
History
Date User Action Args
2011-06-30 19:39:53Cal.Leemingsetrecipients: + Cal.Leeming, r.david.murray
2011-06-30 19:39:53Cal.Leemingsetmessageid: <1309462793.26.0.295451194415.issue12455@psf.upfronthosting.co.za>
2011-06-30 19:39:52Cal.Leeminglinkissue12455 messages
2011-06-30 19:39:52Cal.Leemingcreate