R. David Murray [Fri, 8 Oct 2010 15:55:28 +0000 (15:55 +0000)]
#4661: add bytes parsing and generation to email (email version bump to 5.1.0)
The work on this is not 100% complete, but everything is present to
allow real-world testing of the code. The only remaining major todo
item is to (hopefully!) enhance the handling of non-ASCII bytes in headers
converted to unicode by RFC2047 encoding them rather than replacing them with
'?'s.
Victor Stinner [Thu, 7 Oct 2010 22:09:40 +0000 (22:09 +0000)]
Fix fileutils for Windows
* Don't define _Py_wstat() on Windows, Windows has its own _wstat() function
with a different API (the stat buffer has another type)
* Include windows.h
Victor Stinner [Thu, 7 Oct 2010 21:45:39 +0000 (21:45 +0000)]
Create fileutils.c/.h
* _Py_fopen() and _Py_stat() come from Python/import.c
* (_Py)_wrealpath() comes from Python/sysmodule.c
* _Py_char2wchar(), _Py_wchar2char() and _Py_wfopen() come from Modules/main.c
* (_Py)_wstat(), (_Py)_wgetcwd(), _Py_wreadlink() come from Modules/getpath.c
Brian Curtin [Thu, 7 Oct 2010 01:12:19 +0000 (01:12 +0000)]
Fix #8584. Fix the skipping of a number of tests due to incorrect importing.
This undoes a previous attempt to fix some of the skips. Value and copy
come from sharedctypes rather than plain ctypes, and the test skipping is
then done at the class level rather than test-by-test.
Victor Stinner [Wed, 6 Oct 2010 23:24:57 +0000 (23:24 +0000)]
Rewrite RunMainFromImporter()
* fix argv0 reference counter if PyList_SetItem() fails
* don't use complex if conditions, but a simple indentation and "goto error"
* simplify error handling (remove Py_XDECREF(importer) from the error label)
* don't set sys_path to NULL (it's useless, sys_path is a borrowed reference
and sys_path is not a static variable)
* try to write only one instruction per line for better readability
Lars Gustäbel [Mon, 4 Oct 2010 15:18:47 +0000 (15:18 +0000)]
Issue #9065: no longer use "root" as the default for the
uname and gname field.
If tarfile creates a new archive and adds a file with a
uid/gid that doesn't have a corresponding name on the
system (e.g. because the user/group account was deleted) it
uses the empty string in the uname/gname field now instead
of "root". Using "root" as the default was a bad idea
because on extraction the uname/gname fields are supposed
to override the uid/gid fields. So, all archive members
with nameless uids/gids belonged to the root user after
extraction.
R. David Murray [Sat, 2 Oct 2010 15:58:26 +0000 (15:58 +0000)]
#1050268: make parseaddr 'quote' the contents of quoted strings in addresses.
Also made the doc string for email._parseaddr's 'quote' function more
accurate; I'd love to make the function match the old docstring instead,
but other code uses it according the existing semantics.
Victor Stinner [Sat, 2 Oct 2010 11:11:27 +0000 (11:11 +0000)]
Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE
and 32 bits wchar_t (eg. Linux in narrow build).
Mark Dickinson [Wed, 29 Sep 2010 19:06:36 +0000 (19:06 +0000)]
Issue #9599: Further accuracy tweaks to loghelper. For an integer n that's small enough to be converted to a float without overflow, log(n) is now computed as log(float(n)), and similarly for log10.
Antoine Pitrou [Wed, 29 Sep 2010 15:03:40 +0000 (15:03 +0000)]
Issue #9360: Cleanup and improvements to the nntplib module. The API
now conforms to the philosophy of bytes and unicode separation in Python 3.
A test suite has also been added.
Brian Curtin [Wed, 29 Sep 2010 14:51:42 +0000 (14:51 +0000)]
Fix #9978. WINFUNCTYPE is from ctypes, not from ctypes.wintypes.
r85073 changed the importing in wintypes to not use *, so the previous
usage here became even more incorrect.
Victor Stinner [Wed, 29 Sep 2010 10:37:16 +0000 (10:37 +0000)]
Issue #9979: Use PyUnicode_AsWideCharString() in _ctypes module
* Convert unicode to wide character string before creating the PyCapsule
object
* Catch integer overflow
* Avoid useless memset()
* Prepare the support of surrogates
Antoine Pitrou [Tue, 28 Sep 2010 23:59:51 +0000 (23:59 +0000)]
Give a dedicated page to memoryview objects, so that they can be part
of the concrete objects layer, while the buffer protocol is part of
the abstract objects layer.