def test_url_escape_unicode(self):
tests = [
# byte strings are passed through as-is
- ("\u00e9".encode("utf8"), "%C3%A9"),
+ ("\u00e9".encode(), "%C3%A9"),
("\u00e9".encode("latin1"), "%E9"),
# unicode strings become utf8
("\u00e9", "%C3%A9"),
[
b"Content-Disposition: form-data; name=argument",
b"",
- "\u00e1".encode("utf-8"),
+ "\u00e1".encode(),
b"--1234567890",
- 'Content-Disposition: form-data; name="files"; filename="\u00f3"'.encode(
- "utf8"
- ),
+ 'Content-Disposition: form-data; name="files"; filename="\u00f3"'.encode(),
b"",
- "\u00fa".encode("utf-8"),
+ "\u00fa".encode(),
b"--1234567890--",
b"",
]
def test_utf8_logging(self):
with ignore_bytes_warning():
- self.logger.error("\u00e9".encode("utf8"))
+ self.logger.error("\u00e9".encode())
if issubclass(bytes, basestring_type):
# on python 2, utf8 byte strings (and by extension ascii byte
# strings) are passed through as-is.