From: Jason R. Coombs Date: Sun, 10 Nov 2013 23:59:44 +0000 (-0500) Subject: Merge with 3.3 for Issue #19544 and Issue #6286. Merge is untested. I was unable... X-Git-Tag: v3.4.0b1~323 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0048ae0cc62cba45b197976031f0680d90687ffc;p=thirdparty%2FPython%2Fcpython.git Merge with 3.3 for Issue #19544 and Issue #6286. Merge is untested. I was unable to test due to bab0cbf86835. --- 0048ae0cc62cba45b197976031f0680d90687ffc diff --cc Lib/distutils/command/upload.py index 88990b2c6bd4,d2bc82cea32a..287158343b8b --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@@ -162,41 -170,31 +170,31 @@@ class upload(PyPIRCCommand) self.announce("Submitting %s to %s" % (filename, self.repository), log.INFO) # build the Request - # We can't use urllib since we need to send the Basic - # auth right with the first request - # TODO(jhylton): Can we fix urllib? - schema, netloc, url, params, query, fragments = \ - urllib.parse.urlparse(self.repository) - assert not params and not query and not fragments - if schema == 'http': - http = httpclient.HTTPConnection(netloc) - elif schema == 'https': - http = httpclient.HTTPSConnection(netloc) - else: - raise AssertionError("unsupported schema "+schema) - - data = '' - loglevel = log.INFO + headers = {'Content-type': + 'multipart/form-data; boundary=%s' % boundary, + 'Content-length': str(len(body)), + 'Authorization': auth} + + request = Request(self.repository, data=body, + headers=headers) + # send the data try: - http.connect() - http.putrequest("POST", url) - http.putheader('Content-type', - 'multipart/form-data; boundary=%s'%boundary) - http.putheader('Content-length', str(len(body))) - http.putheader('Authorization', auth) - http.endheaders() - http.send(body) + result = urlopen(request) + status = result.getcode() + reason = result.msg - except socket.error as e: + except OSError as e: self.announce(str(e), log.ERROR) return + except HTTPError as e: + status = e.code + reason = e.msg - r = http.getresponse() - if r.status == 200: - self.announce('Server response (%s): %s' % (r.status, r.reason), + if status == 200: + self.announce('Server response (%s): %s' % (status, reason), log.INFO) else: - self.announce('Upload failed (%s): %s' % (r.status, r.reason), + self.announce('Upload failed (%s): %s' % (status, reason), log.ERROR) if self.show_response: - msg = '\n'.join(('-' * 75, r.read(), '-' * 75)) + msg = '\n'.join(('-' * 75, result.read(), '-' * 75)) self.announce(msg, log.INFO) diff --cc Misc/NEWS index fef9e62a2a43,d84fc4551d34..563c7fea80c6 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -28,83 -66,75 +28,87 @@@ Core and Builtin - Issue #18603: Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the Python executable and not removed by the linker's optimizer. -- Issue #19279: UTF-7 decoder no more produces illegal strings. +- Issue #19306: Add extra hints to the faulthandler module's stack + dumps that these are "upside down". -- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at - least one place so as to avoid regressions. +Library +------- -- Issue #19014: memoryview.cast() is now allowed on zero-length views. ++- Issue #19544 and Issue #6286: Restore use of urllib over http allowing use ++ of http_proxy for Distutils upload command, a feature accidentally lost ++ in the rollback of distutils2. + -- Issue #19098: Prevent overflow in the compiler when the recursion limit is set - absurdly high. +- Issue #19544 and Issue #7457: Restore the read_pkg_file method to + distutils.dist.DistributionMetadata accidentally removed in the undo of + distutils2. -- Issue #18942: sys._debugmallocstats() output was damaged on Windows. +- Issue #16685: Added support for any bytes-like objects in the audioop module. + Removed support for strings. -- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions. +- Issue #7171: Add Windows implementation of ``inet_ntop`` and ``inet_pton`` + to socket module. Patch by Atsuo Ishimoto. -- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc() - fails. +- Issue #19261: Added support for writing 24-bit samples in the sunau module. -- Issue #16741: Fix an error reporting in int(). +- Issue #1097797: Added CP273 encoding, used on IBM mainframes in + Germany and Austria. Mapping provided by Michael Bierenfeld. -- Issue #17899: Fix rare file descriptor leak in os.listdir(). +- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms. -- Issue #18552: Check return value of PyArena_AddPyObject() in - obj2ast_object(). +- Issue #19378: Fixed a number of cases in the dis module where the new + "file" parameter was not being honoured correctly -- Issue #18560: Fix potential NULL pointer dereference in sum(). +- Issue #19378: Removed the "dis.Bytecode.show_info" method -- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0], - prefix and exec_prefix if the operation system does not obey MAXPATHLEN. +- Issue #19378: Renamed the "dis.Bytecode.display_code" method to + "dis.Bytecode.dis" and converted it to returning a string rather than + printing output. -- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all(). +- Issue #19378: the "line_offset" parameter in the new "dis.get_instructions" + API has been renamed to "first_line" (and the default value and usage + changed accordingly). This should reduce confusion with the more common use + of "offset" in the dis docs to refer to bytecode offsets. -- Issue #17872: Fix a segfault in marshal.load() when input stream returns - more bytes than requested. +- Issue #18678: Corrected spwd struct member names in spwd module: + sp_nam->sp_namp, and sp_pwd->sp_pwdp. The old names are kept as extra + structseq members, for backward compatibility. -- Issue #18426: Fix NULL pointer dereference in C extension import when - PyModule_GetDef() returns an error. +- Issue #6157: Fixed tkinter.Text.debug(). tkinter.Text.bbox() now raises + TypeError instead of TclError on wrong number of arguments. Original patch + by Guilherme Polo. -- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the - tstate is first removed from TLS and then deallocated. +- Issue #10197: Rework subprocess.get[status]output to use subprocess + functionality and thus to work on Windows. Patch by Nick Coghlan -- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise - OverflowError when an argument of %c format is out of range. +- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of + integers instead of a string. Based on patch by Guilherme Polo. -- Issue #18137: Detect integer overflow on precision in float.__format__() - and complex.__format__(). +- Issue #19403: contextlib.redirect_stdout is now reentrant -- Issue #18183: Fix various unicode operations on strings with large unicode - codepoints. +- Issue #19286: Directories in ``package_data`` are no longer added to + the filelist, preventing failure outlined in the ticket. -- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). +- Issue #19480: HTMLParser now accepts all valid start-tag names as defined + by the HTML5 standard. -- Issue #18038: SyntaxError raised during compilation sources with illegal - encoding now always contains an encoding name. +- Issue #15114: The html.parser module now raises a DeprecationWarning when the + strict argument of HTMLParser or the HTMLParser.error method are used. -- Issue #17644: Fix a crash in str.format when curly braces are used in square - brackets. +- Issue #19410: Undo the special-casing removal of '' for + importlib.machinery.FileFinder. -- Issue #17983: Raise a SyntaxError for a ``global __class__`` statement in a - class body. +- Issue #19424: Fix the warnings module to accept filename containing surrogate + characters. -- Issue #17927: Frame objects kept arguments alive if they had been copied into - a cell, even if the cell was cleared. +- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler. -Library -------- +- Issue #19227: Remove pthread_atfork() handler. The handler was added to + solve #18747 but has caused issues. + +- Issue #19420: Fix reference leak in module initalization code of + _hashopenssl.c -- Issue #19395: Raise an exception when attempting to pickle a bz2 or lzma - compressor/decompressor object, rather than creating a pickle that would - cause a segfault when loaded and used. +- Issue #19329: Optimized compiling charsets in regular expressions. - Issue #19227: Try to fix deadlocks caused by re-seeding then OpenSSL pseudo-random number generator on fork().