summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | test_sys: Remove workaround #8611Victor Stinner2010-10-131-3/+0
| | | | | | | | | | It looks like it is no more needed: Python 3.2 is slowly able to support non-ascii paths with an ascii locale.
* | Issue #9992: Remove PYTHONFSENCODING environment variable.Victor Stinner2010-10-131-29/+0
| |
* | Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODINGVictor Stinner2010-09-101-11/+0
| | | | | | | | | | | | environment variable to set the filesystem encoding at Python startup. sys.setfilesystemencoding() creates inconsistencies because it is unable to reencode all filenames in all objects.
* | Fix test_sys: set LC_ALL instead of LANGVictor Stinner2010-08-251-3/+4
| | | | | | | | | | LC_ALL is read before LANG to choose the locale encoding (LC_ALL, LANG and then LC_CTYPE: use the first non empty variable).
* | Disable test_undecodable_code() of test_sys on WindowsVictor Stinner2010-08-251-0/+6
| | | | | | | | This test is irrevelant on Windows
* | Fix test_sys for FreeBSD, Solaris and Mac OS XVictor Stinner2010-08-241-2/+15
| | | | | | | | | | | | | | _Py_char2wchar() (mbctowcs) decodes b'\xff' to '\xff' on FreeBSD, Solaris and Mac OS X, even if the locale is C (and the locale encoding is ASCII). Patch test_undecodable_code() to support this output and document the two different kinds of outputs.
* | Workaround issue #8611 in test_undecodable_code() of test_sysVictor Stinner2010-08-201-22/+22
| | | | | | | | | | Write test.support.workaroundIssue8611() function so it will be easier to remove this workaround from all tests.
* | test_undecodable_code(): set locale to CVictor Stinner2010-08-201-15/+12
| | | | | | | | | | | | | | | | | | | | 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.
* | test_main_invalid_unicode() of test_sys: print string as asciiVictor Stinner2010-08-201-1/+1
| | | | | | | | | | | | | | | | | | 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.
* | test_main_invalid_unicode() of test_sys displays stderr on failureVictor Stinner2010-08-191-4/+3
| |
* | Ooops, finish test_sys fix: use expected variableVictor Stinner2010-08-191-1/+1
| |
* | Fix test_sys about fs encoding for Windows and Mac OS XVictor Stinner2010-08-191-17/+22
| | | | | | | | | | | | * Check fs encoding value on Windows * Ignore LANG= test on Windows and Mac OS X (fs encoding is hardcoded on these platforms)
* | test_sys: move tests at the right placeVictor Stinner2010-08-181-56/+57
| | | | | | | | filesystem encoding is not related to sys.sizeof()
* | Improve error message if the command is not decodableVictor Stinner2010-08-181-1/+4
| |
* | Issue #8622: Add PYTHONFSENCODING environment variable to override theVictor Stinner2010-08-181-8/+24
| | | | | | | | | | | | filesystem encoding. initfsencoding() displays also a better error message if get_codeset() failed.
* | Issue #9425: file system encoding is not always utf-8Victor Stinner2010-08-081-4/+1
| | | | | | | | Fix a regression introduced in test_sys by r83778.
* | Issue #9425: skip tests if a filename is not encodableVictor Stinner2010-08-071-2/+4
| |
* | Syntax cleanup.Florent Xicluna2010-07-281-3/+1
| |
* | Corrected comments on where settrace and setprofile are tested.Alexander Belopolsky2010-07-251-2/+2
| |
* | Undo inadvertant checkin.Brian Curtin2010-07-081-1/+1
| |
* | Implement #1578269. Patch by Jason R. Coombs.Brian Curtin2010-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added Windows support for os.symlink when run on Windows 6.0 or greater, aka Vista. Previous Windows versions will raise NotImplementedError when trying to symlink. Includes numerous test updates and additions to test_os, including a symlink_support module because of the fact that privilege escalation is required in order to run the tests to ensure that the user is able to create symlinks. By default, accounts do not have the required privilege, so the escalation code will have to be exposed later (or documented on how to do so). I'll be following up with that work next. Note that the tests use ctypes, which was agreed on during the PyCon language summit.
* | Issue #8965: Write more tests for sys.getfilesystemencoding()Victor Stinner2010-06-111-11/+24
| |
* | Issue #8965: Add a regression test to test_sys with LANG=CVictor Stinner2010-06-111-2/+13
| |
* | test_sys: add a test on the file system encoding for darwinVictor Stinner2010-06-111-0/+5
| |
* | Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson2010-05-231-0/+17
| | | | | | | | | | | | (instances of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it easy to maintain the invariant that hash(x) == hash(y) whenever x and y have equal value.
* | Issue #3798: sys.exit(message) writes the message to sys.stderr file, insteadVictor Stinner2010-05-211-2/+10
| | | | | | | | of the C file stderr, to use stderr encoding and error handler
* | Fix test_main_invalid_unicode() of test_sys for ASCII locale encodingVictor Stinner2010-05-171-4/+3
| | | | | | | | It should fix sparc 3.x and 3.1 failures.
* | Improve test_exit() error message to analyze sparc failuresVictor Stinner2010-05-171-1/+2
| |
* | handle_system_exit() flushs files to warranty the output orderVictor Stinner2010-05-171-8/+18
| | | | | | | | | | | | PyObject_Print() writes into the C object stderr, whereas PySys_WriteStderr() writes into the Python object sys.stderr. Each object has its own buffer, so call sys.stderr.flush() and fflush(stderr).
* | PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (insteadVictor Stinner2010-05-171-0/+10
| | | | | | | | of strict) error handler to escape surrogates
* | Issue #6697: Fix a crash if code of "python -c code" contains surrogatesVictor Stinner2010-05-171-0/+18
| |
* | Merged revisions 80552-80556,80564-80566,80568-80571 via svnmerge fromVictor Stinner2010-04-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80552 | victor.stinner | 2010-04-27 23:46:03 +0200 (mar., 27 avril 2010) | 3 lines Issue #7449, part 1: fix test_support.py for Python compiled without thread ........ r80553 | victor.stinner | 2010-04-27 23:47:01 +0200 (mar., 27 avril 2010) | 1 line Issue #7449, part 2: regrtest.py -j option requires thread support ........ r80554 | victor.stinner | 2010-04-27 23:51:26 +0200 (mar., 27 avril 2010) | 9 lines Issue #7449 part 3, test_doctest: import trace module in test_coverage() Import trace module fail if the threading module is missing. test_coverage() is only used if test_doctest.py is used with the -c option. This commit allows to execute the test suite without thread support. Move "import trace" in test_coverage() and use test_support.import_module('trace'). ........ r80555 | victor.stinner | 2010-04-27 23:56:26 +0200 (mar., 27 avril 2010) | 6 lines Issue #7449, part 4: skip test_multiprocessing if thread support is disabled import threading after _multiprocessing to raise a more revelant error message: "No module named _multiprocessing". _multiprocessing is not compiled without thread support. ........ r80556 | victor.stinner | 2010-04-28 00:01:24 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py * Split Test.test_open() in 2 functions: test_open() and test_thread_open() * Skip test_open() and test_thread_open() if we are unable to find the C library * Skip test_thread_open() if thread support is disabled * Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError() ........ r80564 | victor.stinner | 2010-04-28 00:59:35 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 6: fix test_hashlib for missing threading module Move @test_support.reap_thread decorator from test_main() to test_threaded_hashing(). ........ r80565 | victor.stinner | 2010-04-28 01:01:29 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 7: simplify threading detection in test_capi * Skip TestPendingCalls if threading module is missing * Test if threading module is present or not, instead of test the presence of _testcapi._test_thread_state ........ r80566 | victor.stinner | 2010-04-28 01:03:16 +0200 (mer., 28 avril 2010) | 4 lines Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing TestFifo can be executed without the threading module ........ r80568 | victor.stinner | 2010-04-28 01:14:58 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, part 9: fix test_xmlrpclib for missing threading module * Skip testcases using threads if threading module is missing * Use "http://" instead of URL in ServerProxyTestCase if threading is missing because URL is not set in this case ........ r80569 | victor.stinner | 2010-04-28 01:33:58 +0200 (mer., 28 avril 2010) | 6 lines Partial revert of r80556 (Issue #7449, part 5, fix ctypes test) Rewrite r80556: the thread test have to be executed just after the test on libc_open() and so the test cannot be splitted in two functions (without duplicating code, and I don't want to duplicate code). ........ r80570 | victor.stinner | 2010-04-28 01:51:16 +0200 (mer., 28 avril 2010) | 8 lines Issue #7449, part 10: test_cmd imports trace module using test_support.import_module() Use test_support.import_module() instead of import to raise a SkipTest exception if the import fail. Import trace fails if the threading module is missing. See also part 3: test_doctest: import trace module in test_coverage(). ........ r80571 | victor.stinner | 2010-04-28 01:55:59 +0200 (mer., 28 avril 2010) | 6 lines Issue #7449, last part (11): fix many tests if thread support is disabled * Use try/except ImportError or test_support.import_module() to import thread and threading modules * Add @unittest.skipUnless(threading, ...) to testcases using threads ........
* | Fix my test introduced in test_sys by r79394:Victor Stinner2010-03-251-4/+9
| | | | | | | | | | | | | | | | | | | | Restore the orginal filesystem encoding before testing assertRaises(LookupError, sys.setfilesystemencoding, "xxx"). Unittest formats the exception, but the formatting failed because the file system was invalid (set to iso-8859-1 by the previous test). Anyway, ensure to restore the original filesystem encoding when exiting test_setfilesystemencoding() to avoid error propagation to the other tests.
* | Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encodingVictor Stinner2010-03-251-0/+1
| | | | | | | | is unknown.
* | Merged revisions 79060 via svnmerge fromCollin Winter2010-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79060 | collin.winter | 2010-03-18 14:54:01 -0700 (Thu, 18 Mar 2010) | 4 lines Add support for weak references to code objects. This will be used by an optimization in the incoming Python 3 JIT. Patch by Reid Kleckner! ........
* | Merged revisions 78093 via svnmerge fromGeorg Brandl2010-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line Remove unused imports in test modules. ........
* | Merged revisions 78835-78837 via svnmerge fromVictor Stinner2010-03-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78835 | victor.stinner | 2010-03-11 13:34:39 +0100 (jeu., 11 mars 2010) | 7 lines Issue #7774: Set sys.executable to an empty string if argv[0] has been set to an non existent program name and Python is unable to retrieve the real program name. Fix also sysconfig: if sys.executable is an empty string, use the current working directory. ........ r78836 | victor.stinner | 2010-03-11 14:27:35 +0100 (jeu., 11 mars 2010) | 4 lines Fix test_executable introduce in previous commit (r78835): Windows is able to retrieve the absolute Python path even if argv[0] has been set to a non existent program name. ........ r78837 | victor.stinner | 2010-03-11 14:46:06 +0100 (jeu., 11 mars 2010) | 3 lines Another fix to test_executable() of test_sys: set the current working to avoid the #7774 bug. ........
* | Merged revisions 77784 via svnmerge fromEric Smith2010-01-271-0/+4
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77784 | eric.smith | 2010-01-26 21:06:25 -0500 (Tue, 26 Jan 2010) | 1 line Added named (but not numbered) attributes to sys.getwindowsversion() test. ........
* | Fixed test_support -> support.Eric Smith2010-01-271-1/+1
| |
* | Merged revisions 77775 via svnmerge fromEric Smith2010-01-271-23/+24
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77775 | eric.smith | 2010-01-26 20:21:15 -0500 (Tue, 26 Jan 2010) | 1 line Switch to test_support.get_attribute. ........
* | Merged revisions 77771 via svnmerge fromEric Smith2010-01-271-1/+0
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77771 | eric.smith | 2010-01-26 19:58:43 -0500 (Tue, 26 Jan 2010) | 1 line Removed unneeded test. ........
* | Merged revisions 77763 via svnmerge fromEric Smith2010-01-271-1/+17
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77763 | eric.smith | 2010-01-26 19:28:29 -0500 (Tue, 26 Jan 2010) | 1 line Issue #7766: Change sys.getwindowsversion() return value to a named tuple and add the additional members returned in an OSVERSIONINFOEX structure. The new members are service_pack_major, service_pack_minor, suite_mask, and product_type. ........
* | Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-29/+29
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* | use assert[Not]In where appropriateEzio Melotti2010-01-231-2/+1
| |
* | use assert[Not]In where appropriateBenjamin Peterson2010-01-191-7/+7
| | | | | | | | A patch from Dave Malcolm.
* | Silence getcheckinterval()-related warnings in the test suiteAntoine Pitrou2009-11-131-5/+8
| |
* | Merge in the new GIL.Antoine Pitrou2009-11-101-0/+15
| |
* | Merged revisions 75887 via svnmerge fromGeorg Brandl2009-10-271-1/+8
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75887 | georg.brandl | 2009-10-27 23:56:09 +0100 (Di, 27 Okt 2009) | 1 line Make sure every run of test_intern() interns a new string, otherwise that test fails e.g. when some other test in test_builtin fails and it is rerun in verbose mode. ........
* | Merged revisions 75842 via svnmerge fromAntoine Pitrou2009-10-271-2/+4
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75842 | antoine.pitrou | 2009-10-27 20:23:56 +0100 (mar., 27 oct. 2009) | 3 lines Fix transient refleak in test_sys. ........
* | Add tests for sys.float_repr_styleMark Dickinson2009-10-241-0/+2
| |