Giampaolo Rodolà [Mon, 23 Aug 2010 22:10:32 +0000 (22:10 +0000)]
fix issue 9601: ftplib now provides a workaround for invalid response code returned on MKD and PWD by non-compliant FTPserver implementations such as ISS shipped with Windows server 2003
Martin v. Löwis [Mon, 23 Aug 2010 15:27:26 +0000 (15:27 +0000)]
Explicitly pass socket type and family for getaddrinfo,
to make test work on Solaris.
Disable gethostbyaddr IDNA test for now as there is no
reverse DNS entry for the IPv6 address of the test name.
Brett Cannon [Sun, 22 Aug 2010 22:19:11 +0000 (22:19 +0000)]
One of the joys of having test_multiprocessing occasionally execute after
test_importlib is that it discovers special little race conditions. For
instance, it turns out that importlib would throw an exception if two different
Python processes both tried to create the __pycache__ directory as one process
would succeed, causing the other process to fail as it didn't expect to get any
"help". So now importlib simply stays calm and just accepts someone else did
the work of creating the __pycache__ directory for it, moving on with life.
Brett Cannon [Sun, 22 Aug 2010 20:38:47 +0000 (20:38 +0000)]
While not strictly necessary thanks to the odd ABC inheritance done through
importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader
for completeness.
Brett Cannon [Sun, 22 Aug 2010 20:36:25 +0000 (20:36 +0000)]
Under OS X, history_get from readline returns a const char *, but the local
variable the return value is assigned to is char *. Since the assigned-to
variable is never changed, simply make that a const char * and cast all calls
to get_history to const char * to silence the compiler warning (found with
LLVM).
Victor Stinner [Fri, 20 Aug 2010 16:38:14 +0000 (16:38 +0000)]
test_undecodable_code(): set locale to C
The test is still failing on "x86 FreeBSD 7.2 3.x" and "sparc solaris10 gcc
3.x" buildbots. It looks like the locale encoding is able to decode b'\xff'. I
suppose that it is an encoding like 'iso-8859-1'.
Use C locale to set, I hope, the locale encoding to 'ascii'. Display also the
encoding so if the test fails, at least I will learn the locale encoding
choosen for the C locale.
Victor Stinner [Fri, 20 Aug 2010 11:08:18 +0000 (11:08 +0000)]
test_main_invalid_unicode() of test_sys: print string as ascii
There are buildbot failures on "x86 FreeBSD 3.x" and "sparc solaris10 gcc 3.x".
I suppose that _Py_char2wchar() doesn't fail even if the locale encoding is
unable to decode the byte string, because _Py_char2wchar() has a special mode
for platform without mbrtowc() (ISO C99) function.
Let's check my theory by avoid error on the Python print() instruction.
Check the return values for all functions returning an ast node.
Failure to do it may result in strange error messages or even crashes,
in admittedly convoluted cases that are normally syntax errors, like:
def f(*xx, __debug__): pass
#5127: Even on narrow unicode builds, the C functions that access the Unicode
Database (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others) now accept
and return characters from the full Unicode range (Py_UCS4).
The differences from Python code are few:
- unicodedata.numeric(), unicodedata.decimal() and unicodedata.digit()
now return the correct value for large code points
- repr() may consider more characters as printable.
Antoine Pitrou [Wed, 18 Aug 2010 20:44:14 +0000 (20:44 +0000)]
Issue #9433: The "-j" option to regrtest now works under Windows too.
It is not sure it will be beneficial, though, since process launching is
more expensive under Windows than it is under Linux.
Victor Stinner [Wed, 18 Aug 2010 10:56:19 +0000 (10:56 +0000)]
Improve PEP 383 tests (in test_os)
* Use the current filesystem encoding instead of always using utf-8
* Enable the test on Mac OS X
* Use TESTFN_UNENCODABLE and TESTFN_UNICODE instead of arbitrary filenames
* To decode a filename, use strict error handler instead surrogateescape for
mbcs encoding (on Windows)
* Use TESTFN_UNENCODABLE (if available) for the directory name
Skip the test if no non-ascii filename can be created.
Victor Stinner [Tue, 17 Aug 2010 23:37:11 +0000 (23:37 +0000)]
Issue #9425: Create PyModule_GetFilenameObject() function
... to get the filename as a unicode object, instead of a byte string. Function
needed to support unencodable filenames. Deprecate PyModule_GetFilename() in
favor on the new function.
Encode unicode strings to the terminal encoding with backslashreplace error (as
Python does for sys.stderr) before writing them to sys.stdout. It fixes
UnicodeEncodeError on writing non-ascii characters in an ascii terminal (C
locale: ASCII encoding).