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 martin.panter
Recipients Nan Wu, ezio.melotti, martin.panter
Date 2015-10-27.05:18:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There is already a check for being str in do_request_(). Maybe it is okay to remove this check; I think it would be equivalent to the new check.

Regarding the dict check, here is a strange class that currently works, but would be broken by the patch. Maybe it is okay to break it though, since it certainly goes against the urlopen() documentation.

class ReaderMapping(dict):
    def __init__(self):
        super().__init__({"abc": "xyz"})
        self.mode = "r" = "123"
    def read(self, size):
        data = = ""
        return data

urlopen(Request("http://localhost/", headers={"Content-Length": 3}, data=ReaderMapping()))

If we wanted to continue to support this kind of usage, perhaps the safest option would be to change the test to “if type(data) is dict” rather than use isinstance().

I also left a comment about eliminating urlencode() in the test.
Date User Action Args
2015-10-27 05:18:42martin.pantersetrecipients: + martin.panter, ezio.melotti, Nan Wu
2015-10-27 05:18:42martin.pantersetmessageid: <>
2015-10-27 05:18:42martin.panterlinkissue25439 messages
2015-10-27 05:18:40martin.pantercreate