Commit graph

42930 commits

Author SHA1 Message Date
Victor Stinner
c44abb127b Workaround issue #8611 in test_undecodable_code() of test_sys
Write test.support.workaroundIssue8611() function so it will be easier to
remove this workaround from all tests.
2010-08-20 16:52:14 +00:00
Victor Stinner
1b6372a1d1 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.
2010-08-20 16:38:14 +00:00
Victor Stinner
e6376f8849 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.
2010-08-20 11:08:18 +00:00
Vinay Sajip
89d8f82d01 Issue #7077: Fixed bug in previous fix. 2010-08-20 08:43:22 +00:00
Tim Golden
0ceb671aff Remove long-redundant plat-win from sys.path on Windows 2010-08-20 08:31:26 +00:00
Vinay Sajip
467d12fcb2 Issue #7077: Fixed SysLogHandler implementation of Unicode handling. 2010-08-19 22:20:22 +00:00
Amaury Forgeot d'Arc
12844e6df6 Add tests for r84209 (crashes in the Ast builder)
Also remove one tab, and move a check closer to the possible failure.
2010-08-19 21:32:38 +00:00
Vinay Sajip
8101021eae Issue #9606: Updated documentation for Filter objects. 2010-08-19 19:17:41 +00:00
Senthil Kumaran
67a62a41b8 Fix Issue9639 - reset the retry count on successful auth. 2010-08-19 17:50:31 +00:00
Amaury Forgeot d'Arc
92dc80a8d8 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
2010-08-19 17:43:15 +00:00
Victor Stinner
5c1808a1a8 test_pep277: display the filename as ascii on failure 2010-08-19 17:35:00 +00:00
Victor Stinner
114b724a4b Skip test_encodings() of test_os on Windows and Mac OS X 2010-08-19 17:22:57 +00:00
Victor Stinner
515ca2047d test_main_invalid_unicode() of test_sys displays stderr on failure 2010-08-19 17:18:12 +00:00
Victor Stinner
38430e2dff Fix os.get_exec_path() (code and tests) for python -bb
Catch BytesWarning exceptions.
2010-08-19 17:10:18 +00:00
Victor Stinner
9802b39c12 PYTHONFSENCODING is not available on Windows or Mac OS X 2010-08-19 11:36:43 +00:00
Victor Stinner
99435247e3 Ooops, finish test_sys fix: use expected variable 2010-08-19 11:30:09 +00:00
Victor Stinner
85ca2afe3b Fix test_sys about fs encoding for Windows and Mac OS X
* Check fs encoding value on Windows
 * Ignore LANG= test on Windows and Mac OS X (fs encoding is hardcoded on these
   platforms)
2010-08-19 11:23:47 +00:00
Victor Stinner
70f88c59eb Fix test_os: workaround #8611 bug 2010-08-19 11:17:12 +00:00
Martin v. Löwis
5ea823cf55 Decode NIS data to fs encoding, using the surrogate error handler. 2010-08-19 09:11:51 +00:00
Senthil Kumaran
f241afaead Fix Issue9638 - remove dead code from py3k imaplib 2010-08-19 07:02:20 +00:00
Victor Stinner
e8d5145e18 Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
error handler, or strict error handler on Windows.

 * Rewrite os.fsencode() documentation
 * Improve os.fsencode and os.fsdecode() tests using the new PYTHONFSENCODING
   environment variable
2010-08-19 01:05:19 +00:00
Victor Stinner
dbe6042f0a what's new 3.2: use :mod: 2010-08-18 23:41:33 +00:00
Victor Stinner
c732e3ba08 test_sys: move tests at the right place
filesystem encoding is not related to sys.sizeof()
2010-08-18 22:44:15 +00:00
Éric Araujo
358b63a419 Fix typo 2010-08-18 22:35:23 +00:00
Andrew M. Kuchling
4ea04a306f #7647: add ST_RDONLY, ST_NOSUID constants to os module.
(Also fix a name ordering in the ACKS file.)
2010-08-18 22:30:34 +00:00
Éric Araujo
0fc86b86ed Fix indentation level 2010-08-18 22:29:54 +00:00
Victor Stinner
3119ed73aa Fix PyUnicode_EncodeFSDefault() indentation 2010-08-18 22:26:50 +00:00
Victor Stinner
398356baaa Improve error message if the command is not decodable 2010-08-18 22:23:22 +00:00
Amaury Forgeot d'Arc
7e44b6b0c5 Add more tests to unicodedata with large code points
(the other functions where not affected by the recent change)
2010-08-18 22:07:15 +00:00
Victor Stinner
d5f2b5421a Fix reindent-rst.py: it works on binary files 2010-08-18 21:59:12 +00:00
Victor Stinner
94908bbc15 Issue #8622: Add PYTHONFSENCODING environment variable to override the
filesystem encoding.

initfsencoding() displays also a better error message if get_codeset() failed.
2010-08-18 21:23:25 +00:00
Amaury Forgeot d'Arc
56ab01b66a Fix stupid typo in test. 2010-08-18 21:12:52 +00:00
Victor Stinner
74a833fa96 Decompose TESTFN_UNICODE on Mac OS X 2010-08-18 21:06:23 +00:00
Antoine Pitrou
b85e165635 Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
Matthew Ahrens.
2010-08-18 21:05:19 +00:00
Amaury Forgeot d'Arc
324ac65ceb #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.
2010-08-18 20:44:58 +00:00
Antoine Pitrou
36e778ef02 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.
2010-08-18 20:44:14 +00:00
Senthil Kumaran
7ff59131f8 Fix Issue672656 - Securing pydoc server. 2010-08-18 19:32:21 +00:00
Martin v. Löwis
dfaf9ec93a Restore GIL in nis_cat in case of error. 2010-08-18 16:12:23 +00:00
Victor Stinner
c14190dc5b Add versionadded tag to PyModule_GetFilenameObject() doc 2010-08-18 10:57:33 +00:00
Victor Stinner
d91df1a7a9 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.
2010-08-18 10:56:19 +00:00
Victor Stinner
6c00c1464f 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.
2010-08-17 23:37:11 +00:00
Martin v. Löwis
6951157475 Correct library name that Ask will work on. 2010-08-17 23:16:51 +00:00
Martin v. Löwis
382d9177a4 Add Ask Solem. 2010-08-17 22:58:42 +00:00
Victor Stinner
6b06da5395 Remove unused functions _PyImport_FindModule and _PyImport_IsScript 2010-08-17 22:54:21 +00:00
Victor Stinner
0e5a41b8f5 libpython.py: py-bt commands escape unencodable characters
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).
2010-08-17 22:49:25 +00:00
Victor Stinner
6961bd690e Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx(). 2010-08-17 22:26:51 +00:00
Victor Stinner
6009ece0ed Replace :func: by :cfunc:
To get links to the C functions
2010-08-17 22:01:02 +00:00
Éric Araujo
f5be090bc3 Fix example 2010-08-17 21:24:05 +00:00
Antoine Pitrou
cdfe1c54fc Add versionadded tags 2010-08-17 21:15:00 +00:00
Antoine Pitrou
bf1a018ce4 Modernize gzip examples 2010-08-17 21:11:49 +00:00