New submission from Tymoteusz Paul: What happens (and how to reproduce):
import base64 str = """GET http://www.google.com.hk/search?q=hotels+near+airport&pws=1&igu=1&ip=0.0.0.0&safe=images&gl=CN&gll=39.913889,116.391667&near=china&hl=zh-CN HTTP/1.0\nContent-Length: 0\nUser-Agent: Opera/9.80 (X11; Linux i686; U; en-US) Presto/2.9.173 Version/12.00\nProxy-Authorization: Basic\nAuthorization: Basic\nReferer: http://www.google.com/\n\n""" base64.decodestring(str) What is expected: Exception should be throw as provided string is not encoded with base64. What is the result: We receive some garbage string which hex representation is '\x18D\xe1\xb6\xda\x7f\xff\x0c0\x82\x8a \x95\xe7(\x9a\x19?\xb1\xe6\xabr\x1a' ---------- messages: 199299 nosy: Tymoteusz.Paul priority: normal severity: normal status: open title: Bas64.decodestring() returns data instead of throwing exception type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19208> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com