R. David Murray [Fri, 4 Jun 2010 19:51:06 +0000 (19:51 +0000)]
#4487: have Charset check with codecs for possible aliases.
Previously, unexpected results occurred when email was passed, for example,
'utf8' as a charset name, since email would accept it but would *not* use
the 'utf-8' codec for it, even though Python itself recognises that as
an alias for utf-8. Now Charset checks with codecs for aliases as well
as its own internal table. Issue 8898 has been opened to change this
further in py3k so that all aliasing is routed through the codecs module.
R. David Murray [Thu, 3 Jun 2010 20:19:25 +0000 (20:19 +0000)]
#8889: rewrite transient_internet so we don't use EAI_NODATA on FreeBSD.
FreeBSD doesn't have socket.EAI_NODATA. I rewrote the routine because
there's no easy way to conditionally include a context manager in a
with statement. As a side benefit, instead of a stack of context
managers there's now only one.
R. David Murray [Thu, 3 Jun 2010 15:43:20 +0000 (15:43 +0000)]
#5610: use \Z not $ so we don't eat extra chars when body part ends with \r\n.
If a body part ended with \r\n, feedparser, using '$' to terminate its
search for the newline, would match on the \r\n, and think that it needed
to strip two characters in order to account for the line end before the
boundary. That made it chop one too many characters off the end of
the body part. Using \Z makes the match correct.
Stefan Krah [Thu, 3 Jun 2010 12:39:50 +0000 (12:39 +0000)]
Issue #7384: If the system readline library is linked against ncurses,
the curses module must be linked against ncurses as well. Otherwise it
is not safe to load both the readline and curses modules in an application.
Thanks Thomas Dickey for answering questions about ncurses/ncursesw
and readline!
Lars Gustäbel [Thu, 3 Jun 2010 12:34:14 +0000 (12:34 +0000)]
Issue #8741: Fixed the TarFile.makelink() method that is responsible
for extracting symbolic and hard link entries as regular files as a
work-around on platforms that do not support filesystem links.
This stopped working reliably after a change in r74571. I also added
a few tests for this functionality.
Lars Gustäbel [Thu, 3 Jun 2010 09:56:22 +0000 (09:56 +0000)]
Issue #8833: tarfile created hard link entries with a size
field != 0 by mistake. The associated testcase did not
expose this bug because it was broken too.
R. David Murray [Wed, 2 Jun 2010 22:03:15 +0000 (22:03 +0000)]
#1368247: make set_charset/MIMEText automatically encode unicode _payload.
Fixes (mysterious, to the end user) UnicodeErrors when using utf-8 as
the charset and unicode as the _text argument. Also makes the way in
which unicode gets encoded to quoted printable for other charsets more
sane (it only worked by accident previously). The _payload now is encoded
to the charset.output_charset if it is unicode.
Ronald Oussoren [Wed, 2 Jun 2010 03:47:14 +0000 (03:47 +0000)]
Fix for issue8868: without this patch 'MacOS.WMAvailable()' will return
False on MacOSX 10.5 or earlier and scripts won't be able to access GUI
functionality.
Mark Dickinson [Sun, 30 May 2010 12:12:25 +0000 (12:12 +0000)]
Issue #5211: Complete removal of implicit coercions for the complex
type. Coercion for arithmetic operations was already removed in
r78280, but that commit didn't remove coercion for rich comparisons.
R. David Murray [Tue, 25 May 2010 15:20:46 +0000 (15:20 +0000)]
Issue 8143: sync unquote in urlparse with urllib; add comment about doing so.
unquote is duplicated in the two files to avoid a circular reference.
(This is fixed in Python3.) Updates keep getting made to the public unquote
without fixing the urlparse one, however, so this fix syncs the two
and adds a comment to both to make sure changes are applied to both.
Victor Stinner [Sat, 22 May 2010 13:37:56 +0000 (13:37 +0000)]
Issue #6268: More bugfixes about BOM, UTF-16 and UTF-32
* Fix seek() method of codecs.open(), don't write the BOM twice after seek(0)
* Fix reset() method of codecs, UTF-16, UTF-32 and StreamWriter classes
* test_codecs: use "w+" mode instead of "wt+". "t" mode is not supported by
Solaris or Windows, but does it really exist? I found it the in the issue.
Antoine Pitrou [Fri, 21 May 2010 17:12:38 +0000 (17:12 +0000)]
Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows
embedders of the interpreter to set sys.argv without also modifying
sys.path. This helps fix `CVE-2008-5983
<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
Brett Cannon [Thu, 20 May 2010 18:37:55 +0000 (18:37 +0000)]
Turned out that if you used explicit relative import syntax
(e.g. from .os import sep) and it failed, import would still try the implicit
relative import semantics of an absolute import (from os import sep). That's
not right, so when level is negative, only do explicit relative import
semantics.
Fixes issue #7902. Thanks to Meador Inge for the patch.