[issue33182] Python 3.7.0b3 fails to build with clang 6.0
New submission from Bernhard Rosenkraenzer <b...@lindev.ch>: Python 3.7.0b3 fails to build with clang 6.0 (implicit cast from void* to a different pointer type is an error now): /usr/bin/clang++ -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -g -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/ncursesw -flto -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/ncursesw -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -D_GNU_ SOURCE -fPIC -fwrapv -I/usr/include/ncursesw -fprofile-instr-generate -I. -I./Include -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/ncursesw -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -flto -O3 -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/ncursesw -fPIC -DPy_BUILD_CORE -o Programs/_testembed.o ./Programs/_testembed.c clang-6.0: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] ./Programs/_testembed.c:173:34: warning: ISO C++11 does not allow conversion from string literal to 'wchar_t *' [-Wwritable-strings] wchar_t *static_warnoption = L"once"; ^ ./Programs/_testembed.c:174:31: warning: ISO C++11 does not allow conversion from string literal to 'wchar_t *' [-Wwritable-strings] wchar_t *static_xoption = L"also_not_an_option=2"; ^ ./Programs/_testembed.c:177:14: error: cannot initialize a variable of type 'wchar_t *' with an rvalue of type 'void *' wchar_t *dynamic_once_warnoption = calloc(warnoption_len+1, sizeof(wchar_t)); ^ ~ ./Programs/_testembed.c:178:14: error: cannot initialize a variable of type 'wchar_t *' with an rvalue of type 'void *' wchar_t *dynamic_xoption = calloc(xoption_len+1, sizeof(wchar_t)); ^ ~~ 2 warnings and 2 errors generated. make[3]: *** [Makefile:777: Programs/_testembed.o] Error 1 -- components: Tests files: python-3.7.0b3-clang-6.0.patch keywords: patch messages: 314666 nosy: bero priority: normal severity: normal status: open title: Python 3.7.0b3 fails to build with clang 6.0 type: compile error versions: Python 3.7 Added file: https://bugs.python.org/file47505/python-3.7.0b3-clang-6.0.patch ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33182> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11898] Sending binary data with a POST request in httplib can cause Unicode exceptions
Bernhard Rosenkraenzer b...@arklinux.org added the comment: Not sure how to get it into verbose mode (I presume you don't mean python -v), but normal mode (22 tests) works fine: Python 2.7.1 (r271:86832, Apr 22 2011, 13:40:40) [GCC 4.6.0] on linux2 Type help, copyright, credits or license for more information. from test.test_httplib import test_main as f f() test_auto_headers (test.test_httplib.HeaderTests) ... ok test_ipv6host_header (test.test_httplib.HeaderTests) ... ok test_putheader (test.test_httplib.HeaderTests) ... ok test_responses (test.test_httplib.OfflineTest) ... ok test_bad_status_repr (test.test_httplib.BasicTest) ... ok test_chunked (test.test_httplib.BasicTest) ... ok test_chunked_head (test.test_httplib.BasicTest) ... ok test_epipe (test.test_httplib.BasicTest) ... ok test_filenoattr (test.test_httplib.BasicTest) ... ok test_host_port (test.test_httplib.BasicTest) ... ok test_incomplete_read (test.test_httplib.BasicTest) ... ok test_negative_content_length (test.test_httplib.BasicTest) ... ok test_partial_reads (test.test_httplib.BasicTest) ... ok test_read_head (test.test_httplib.BasicTest) ... ok test_response_headers (test.test_httplib.BasicTest) ... ok test_send (test.test_httplib.BasicTest) ... ok test_send_file (test.test_httplib.BasicTest) ... ok test_status_lines (test.test_httplib.BasicTest) ... ok testTimeoutAttribute (test.test_httplib.TimeoutTest) This will prove that the timeout gets through ... ok test_attributes (test.test_httplib.HTTPSTimeoutTest) ... ok testHTTPConnectionSourceAddress (test.test_httplib.SourceAddressTest) ... ok testHTTPSConnectionSourceAddress (test.test_httplib.SourceAddressTest) ... ok -- Ran 22 tests in 0.004s OK Not sure if this is an issue with 3.x - I haven't used 3.x so far. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11898] Sending binary data with a POST request in httplib can cause Unicode exceptions
New submission from Bernhard Rosenkraenzer b...@arklinux.org: Sending e.g. a JPEG file with a httplib POST request (e.g. through mechanize) can result in an error like this: File /usr/lib64/python2.7/httplib.py, line 947, in request self._send_request(method, url, body, headers) File /usr/lib64/python2.7/httplib.py, line 988, in _send_request self.endheaders(body) File /usr/lib64/python2.7/httplib.py, line 941, in endheaders self._send_output(message_body) File /usr/lib64/python2.7/httplib.py, line 802, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 2566: invalid start byte The code triggering this is the attempt to merge the msg and message_body into a single request in httplib.py lines 791+ The patch I'm attaching treats an invalid string of unknown encoding (e.g. binary data wrapped as string) like something that isn't a string. Works for me with the patch. -- components: Library (Lib) files: python-2.7.1-fix-httplib-UnicodeDecodeError.patch keywords: patch messages: 134211 nosy: bero priority: normal severity: normal status: open title: Sending binary data with a POST request in httplib can cause Unicode exceptions type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file21747/python-2.7.1-fix-httplib-UnicodeDecodeError.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11898 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com