It should be possible to override the default encoding to transmit bytes in another encoding even if invalid (bpo-36274).
(self)
| 1602 | conn.putrequest('GET', '/', skip_host=1) |
| 1603 | |
| 1604 | def test_putrequest_override_encoding(self): |
| 1605 | """ |
| 1606 | It should be possible to override the default encoding |
| 1607 | to transmit bytes in another encoding even if invalid |
| 1608 | (bpo-36274). |
| 1609 | """ |
| 1610 | class UnsafeHTTPConnection(client.HTTPConnection): |
| 1611 | def _encode_request(self, str_url): |
| 1612 | return str_url.encode('utf-8') |
| 1613 | |
| 1614 | conn = UnsafeHTTPConnection('example.com') |
| 1615 | conn.sock = FakeSocket('') |
| 1616 | conn.putrequest('GET', '/☃') |
| 1617 | |
| 1618 | |
| 1619 | class ExtendedReadTest(TestCase): |
nothing calls this directly
no test coverage detected