Commit Graph

167 Commits

Author SHA1 Message Date
Nick Coghlan 9b99747386
bpo-31975 (PEP 565): Show DeprecationWarning in __main__ (GH-4458)
- primary change is to add a new default filter entry for
  'default::DeprecationWarning:__main__'
- secondary change is an internal one to cope with plain
  strings in the warning module's internal filter list
  (this avoids the need to create a compiled regex object
  early on during interpreter startup)
- assorted documentation updates, including many more
  examples of configuring the warnings settings
- additional tests to ensure that both the pure Python and
  the C accelerated warnings modules have the expected
  default configuration
2018-01-08 12:45:02 +10:00
Victor Stinner 9454060e84
bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)
bpo-29240, bpo-32030: If the encoding change (C locale coerced or
UTF-8 Mode changed), Py_Main() now reads again the configuration with
the new encoding.

Changes:

* Add _Py_UnixMain() called by main().
* Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be
  called multipled times.
* Rename pymain_parse_cmdline_envvars() to pymain_read_conf().
* Py_Main() now clears orig_argc and orig_argv at exit.
* Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is
  no need anymore to get two copies of the wchar_t** argv.
* _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn.
* Py_UTF8Mode is now initialized to -1.
* Locale coercion (PEP 538) now respects -I and -E options.
2017-12-16 04:54:22 +01:00
Victor Stinner 358e5e17a5
bpo-32329: Fix -R option for hash randomization (#4873)
bpo-32329, bpo-32030:

* The -R option now turns on hash randomization when the
  PYTHONHASHSEED environment variable is set to 0 Previously, the
  option was ignored.
* sys.flags.hash_randomization is now properly set to 0 when hash
  randomization is turned off by PYTHONHASHSEED=0.
* _PyCoreConfig_ReadEnv() now reads the PYTHONHASHSEED environment
  variable. _Py_HashRandomization_Init() now only apply the
  configuration, it doesn't read PYTHONHASHSEED anymore.
2017-12-15 00:51:22 +01:00
Victor Stinner 747f48e2e9
bpo-32230: Set sys.warnoptions with -X dev (#4820)
Rather than supporting dev mode directly in the warnings module, this
instead adjusts the initialisation code to add an extra 'default'
entry to sys.warnoptions when dev mode is enabled.

This ensures that dev mode behaves *exactly* as if `-Wdefault` had
been passed on the command line, including in the way it interacts
with `sys.warnoptions`, and with other command line flags like `-bb`.

Fix also bpo-20361: have -b & -bb options take precedence over any
other warnings options.

Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
2017-12-12 22:59:48 +01:00
Victor Stinner 5e3806f8cf
bpo-32101: Add PYTHONDEVMODE environment variable (#4624)
* bpo-32101: Add sys.flags.dev_mode flag
  Rename also the "Developer mode" to the "Development mode".
* bpo-32101: Add PYTHONDEVMODE environment variable
  Mention it in the development chapiter.
2017-11-30 11:40:24 +01:00
Victor Stinner 5d39e04290
bpo-32030: Rework memory allocators (#4625)
* Fix _PyMem_SetupAllocators("debug"): always restore allocators to
  the defaults, rather than only caling _PyMem_SetupDebugHooks().
* Add _PyMem_SetDefaultAllocator() helper to set the "default"
  allocator.
* Add _PyMem_GetAllocatorsName(): get the name of the allocators
* main() now uses debug hooks on memory allocators if Py_DEBUG is
  defined, rather than calling directly malloc()
* Document default memory allocators in C API documentation
* _Py_InitializeCore() now fails with a fatal user error if
  PYTHONMALLOC value is an unknown memory allocator, instead of
  failing with a fatal internal error.
* Add new tests on the PYTHONMALLOC environment variable
* Add support.with_pymalloc()
* Add the _testcapi.WITH_PYMALLOC constant and expose it as
   support.with_pymalloc().
* sysconfig.get_config_var('WITH_PYMALLOC') doesn't work on Windows, so
   replace it with support.with_pymalloc().
* pythoninfo: add _testcapi collector for pymem
2017-11-29 17:20:38 +01:00
Victor Stinner 21c7730761
bpo-32089: Use default action for ResourceWarning (#4584)
In development and debug mode, use the "default" action, rather than
the "always" action, for ResourceWarning in the default warnings
filters.
2017-11-27 12:11:55 +01:00
Victor Stinner 09f3a8a124
bpo-32089: Fix warnings filters in dev mode (#4482)
The developer mode (-X dev) now creates all default warnings filters
to order filters in the correct order to always show ResourceWarning
and make BytesWarning depend on the -b option.

Write a functional test to make sure that ResourceWarning is logged
twice at the same location in the developer mode.

Add a new 'dev_mode' field to _PyCoreConfig.
2017-11-20 17:32:40 -08:00
Victor Stinner ccb0442a33
bpo-32043: New "developer mode": "-X dev" option (#4413)
Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.

Changes:

* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
   than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()
2017-11-16 03:20:31 -08:00
Nick Coghlan d7ac06126d bpo-31845: Fix reading flags from environment (GH-4105)
The startup refactoring means command line settings
are now applied after settings are read from the
environment.

This updates the way command line settings are applied
to account for that, ensures more settings are first read
from the environment in _PyInitializeCore, and adds a
simple test case covering the flags that are easy to check.
2017-10-25 12:11:26 +10:00
Serhiy Storchaka 77732be801 bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667) 2017-10-04 20:25:40 +03:00
Nick Coghlan 6ea4186de3 bpo-28180: Implementation for PEP 538 (#659)
- new PYTHONCOERCECLOCALE config setting
- coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default
- always uses C.UTF-8 on Android
- uses `surrogateescape` on stdin and stdout in the coercion
  target locales
- configure option to disable locale coercion at build time
- configure option to disable C locale warning at build time
2017-06-11 13:16:15 +10:00
Eric Snow 6b4be195cd bpo-22257: Small changes for PEP 432. (#1728)
PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
2017-05-22 21:36:03 -07:00
Serhiy Storchaka 70d28a184c Remove unused imports. 2016-12-16 20:00:15 +02:00
Xavier de Gaye 76febd0792 Issue #26919: On Android, operating system data is now always encoded/decoded
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
2016-12-15 20:59:58 +01:00
INADA Naoki 0e175a6e76 Issue #28532: Show sys.version when -V option is supplied twice 2016-11-21 20:57:14 +09:00
Martin Panter 02b75abf73 Merge spelling and grammar fixes from 3.5 2016-08-05 01:51:39 +00:00
Martin Panter 69332c1a64 Fix spelling and grammar in documentation and code comments 2016-08-04 13:07:31 +00:00
Gregory P. Smith fcbdf9906b * Re-fix issue #19284: Don't generate the no-op -R command line
parameter to "enable" the always on sys.flags.hash_randomization
  in _args_from_interpreter_flags() used by multiprocessing and
  some unittests.  This simplifies the code.
* assert_python_ok docstring typo fix.
* Fix test_cmd_line not to fail if PYTHONHASHSEED is set to a fixed seed.
2015-12-13 20:15:26 -08:00
Gregory P. Smith 6edadfc9ca * Re-fix issue #19284: Don't generate the no-op -R command line
parameter to "enable" the always on sys.flags.hash_randomization
  in _args_from_interpreter_flags() used by multiprocessing and
  some unittests.  This simplifies the code.
* assert_python_ok docstring typo fix.
* Fix test_cmd_line not to fail if PYTHONHASHSEED is set to a fixed seed.
2015-12-13 20:09:42 -08:00
Gregory P. Smith 220ba72c20 Fix test_cmd_line not to fail if PYTHONHASHSEED is set to a fixed seed
due to test_hash_randomization expecting a different seed per process.
2015-12-13 20:01:44 -08:00
Martin Panter b4ce1fc31b Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure 2015-11-30 03:18:29 +00:00
Berker Peksag ce643913a9 Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
2015-05-06 06:33:17 +03:00
R David Murray 687592def9 Merge: #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure. 2015-04-14 17:58:40 -04:00
R David Murray f4bbc535b9 #23925: stop (eg) PYTHONSTARTUP from causing test_cmd_line failure.
Patch by Jamiel Almeida.
2015-04-14 17:57:41 -04:00
Steve Dower 79938f22ef Suppress assert dialogs in test_cmd_line. 2015-03-07 20:32:16 -08:00
Gregory P. Smith 8f2fae1e7d Skip some tests that require a subinterpreter launched with -E or -I when the
interpreter under test is being run in an environment that requires the use of
environment variables such as PYTHONHOME in order to function at all.

Adds a test.script_helper.interpreter_requires_environment() function
to be used with @unittest.skipIf on stdlib test methods requiring this.
2015-02-04 01:04:31 -08:00
Gregory P. Smith b9a3dd9dfb Skip some tests that require a subinterpreter launched with -E or -I when the
interpreter under test is being run in an environment that requires the use of
environment variables such as PYTHONHOME in order to function at all.

Adds a private test.script_helper._interpreter_requires_environment() function
to be used with @unittest.skipIf on stdlib test methods requiring this.
2015-02-04 00:59:40 -08:00
Gregory P. Smith 48e810069d revert 7b833bd1f509. I misread the side effect that the code was triggering.
*any* kwarg supplied to _assert_python causes it to not append -E to the
command line flags so without='-E' does effectively work.
2015-01-22 22:55:00 -08:00
Gregory P. Smith 566646133e Remove the unimplemented but ignored without='-E' parameters being passed to
script_helper.assert_python_failure().  No such feature has ever existed,
thus it doesn't do what the comment claims.  (It does add a 'without'
variable to the environment of the child process but that was not intended)
2015-01-22 22:04:16 -08:00
Victor Stinner e8785ff82a Close #18754: Run Python child processes in isolated more in the test suite. 2013-10-12 14:44:01 +02:00
Christian Heimes ad73a9cf97 Issue #16400: Add command line option for isolated mode.
-I

    Run Python in isolated mode. This also implies -E and -s. In isolated mode
    sys.path contains neither the script’s directory nor the user’s
    site-packages directory. All PYTHON* environment variables are ignored,
    too. Further restrictions may be imposed to prevent the user from
    injecting malicious code.
2013-08-10 16:36:18 +02:00
Serhiy Storchaka e3ed4edb94 Issue #18338: `python --version` now prints version string to stdout, and
not to stderr.  Patch by Berker Peksag and Michael Dickens.
2013-07-11 20:01:17 +03:00
Victor Stinner ef8115e5eb Issue #17206: Fix test_cmd_line and test_faulthandler for my previous change
(test.regrtest and test.script_helper enable faulthandler module in
subprocesses).
2013-06-25 21:54:17 +02:00
Victor Stinner 3fa1aaebde Issue #17516: do not create useless tuple: remove dummy commas in tests 2013-03-26 01:14:08 +01:00
Ezio Melotti 1f8898a591 #17323: The "[X refs, Y blocks]" printed by debug builds has been disabled by default. It can be re-enabled with the `-X showrefcount` option. 2013-03-26 01:59:56 +02:00
Ezio Melotti a833e0d8ae Merge debug print removal with 3.3. 2012-11-23 22:17:02 +02:00
Ezio Melotti 9ab09d129e Merge debug print removal with 3.2. 2012-11-23 22:16:45 +02:00
Ezio Melotti 82e60de727 Remove debug print. 2012-11-23 22:16:07 +02:00
Ezio Melotti 8b9a8f3c98 #16306: merge with 3.3. 2012-11-23 19:01:42 +02:00
Ezio Melotti 8a6d1fed41 #16306: merge with 3.2. 2012-11-23 18:52:39 +02:00
Ezio Melotti a0dd22e5e8 #16306: report only the first unknown option and add more tests. Patch by Serhiy Storchaka. 2012-11-23 18:48:32 +02:00
Ezio Melotti 32f4e6e991 #16309: avoid using deprecated method and turn docstring in a comment. 2012-11-23 01:51:20 +02:00
Ezio Melotti 195ad6ce05 #16306: merge with 3.3. 2012-11-18 14:06:54 +02:00
Ezio Melotti f7c709d62d #16306: merge with 3.2. 2012-11-18 14:02:08 +02:00
Ezio Melotti 7c66319edc #16306: Fix multiple error messages when unknown command line parameters where passed to the interpreter. Patch by Hieu Nguyen. 2012-11-18 13:55:52 +02:00
Victor Stinner e667e98faa Issue #16218, #16444: Backport improvment on tests for non-ASCII characters 2012-11-12 01:23:15 +01:00
Hynek Schlawack 15c02e3048 Issue #15001: fix segfault on "del sys.module['__main__']"
Patch by Victor Stinner.
2012-11-07 09:10:49 +01:00
Hynek Schlawack 33363f43e3 Issue #15001: fix segfault on "del sys.module['__main__']"
Patch by Victor Stinner.
2012-11-07 09:07:22 +01:00
Hynek Schlawack 5c6b3e214c Issue #15001: fix segfault on "del sys.module['__main__']"
Patch by Victor Stinner.
2012-11-07 09:02:24 +01:00
Victor Stinner 8b219b2936 Issue #16414: Add support.FS_NONASCII and support.TESTFN_NONASCII
These constants are used to test functions with non-ASCII data, especially
filenames.
2012-11-06 23:23:43 +01:00
Andrew Svetlov 76bcff27b2 Issue #7317: Display full tracebacks when an error occurs asynchronously.
Patch by Alon Horev with update by Alexey Kachayev.
2012-11-03 15:56:05 +02:00
Andrew Svetlov 69032c81aa Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at all.
Thanks to Armin Rigo and Alexey Kachayev.
2012-11-03 13:52:58 +02:00
Victor Stinner 90ef747e04 Close #13119: use "\r\n" newline for sys.stdout/err on Windows
sys.stdout and sys.stderr are now using "\r\n" newline on Windows, as Python 2.
2012-08-04 01:37:32 +02:00
Victor Stinner 7b3f0fa68e Close #13119: use "\r\n" newline for sys.stdout/err on Windows
sys.stdout and sys.stderr are now using "\r\n" newline on Windows, as Python 2.
2012-08-04 01:28:00 +02:00
Benjamin Peterson c9f54cf512 enable hash randomization by default 2012-02-21 16:08:05 -05:00
Georg Brandl 2fb477c0f0 Merge 3.2: Issue #13703 plus some related test suite fixes. 2012-02-21 00:33:36 +01:00
Georg Brandl 09a7c72cad Merge from 3.1: Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 21:31:46 +01:00
Georg Brandl 2daf6ae249 Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 19:54:16 +01:00
Antoine Pitrou 39a73a4cfa Issue #7111: Python can now be run without a stdin, stdout or stderr stream.
It was already the case with Python 2.  However, the corresponding
sys module entries are now set to None (instead of an unusable file object).
2011-11-28 19:09:45 +01:00
Antoine Pitrou 11942a58a1 Issue #7111: Python can now be run without a stdin, stdout or stderr stream.
It was already the case with Python 2.  However, the corresponding
sys module entries are now set to None (instead of an unusable file object).
2011-11-28 19:08:36 +01:00
Antoine Pitrou 5604ef3e36 Issue #13444: When stdout has been closed explicitly, we should not attempt to flush it at shutdown and print an error.
This also adds a test for issue #5319, whose resolution introduced the issue.
2011-11-26 22:02:29 +01:00
Antoine Pitrou d7c8fbf89e Issue #13444: When stdout has been closed explicitly, we should not attempt to flush it at shutdown and print an error.
This also adds a test for issue #5319, whose resolution introduced the issue.
2011-11-26 21:59:36 +01:00
R David Murray fcb17e13da Merge #10206: add test for previously fixed bug. 2011-06-24 13:28:08 -04:00
R David Murray e697e3750f #10206: add test for previously fixed bug.
Patch by Francisco Martín Brugué.
2011-06-24 13:26:31 -04:00
Éric Araujo be3bd57ba2 Remove traces of division_warning left over from Python 2 (#10998) 2011-03-26 01:55:15 +01:00
Marc-André Lemburg 8f36af7a4c Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'.

These are optimized in the Python Unicode implementation
to result in more direct processing, bypassing the codec
registry.

Also see issue11303.
2011-02-25 15:42:01 +00:00
Victor Stinner 02bfdb3f79 Merged revisions 88530 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88530 | victor.stinner | 2011-02-23 13:07:37 +0100 (mer., 23 févr. 2011) | 4 lines

  Issue #11272: Fix input() and sys.stdin for Windows newline

  On Windows, input() strips '\r' (and not only '\n'), and sys.stdin uses
  universal newline (replace '\r\n' by '\n').
........
2011-02-23 12:10:23 +00:00
Victor Stinner c0f1a1afae Issue #11272: Fix input() and sys.stdin for Windows newline
On Windows, input() strips '\r' (and not only '\n'), and sys.stdin uses
universal newline (replace '\r\n' by '\n').
2011-02-23 12:07:37 +00:00
Victor Stinner 13d49ee7d6 Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
UnicodeEncodeError.
2010-12-04 17:24:33 +00:00
Antoine Pitrou 9bc35682de Use script_helper in one more test 2010-11-09 21:33:55 +00:00
Brian Curtin 8581c7e11a Merged revisions 86081 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86081 | brian.curtin | 2010-11-01 09:00:33 -0500 (Mon, 01 Nov 2010) | 2 lines

  Close subprocess pipes to clear ResourceWarning messages in debug mode.
........
2010-11-01 14:08:58 +00:00
Brian Curtin c4ac887917 Close subprocess pipes to clear ResourceWarning messages in debug mode. 2010-11-01 14:00:33 +00:00
Antoine Pitrou 9583cac633 Issue #10089: Add support for arbitrary -X options on the command-line.
They can be retrieved through a new attribute `sys._xoptions`.
2010-10-21 13:42:28 +00:00
Victor Stinner f933e1ab6f Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment variable
is not set, the locale encoding is ISO-8859-1, whereas most programs (including
Python) expect UTF-8. Python already uses UTF-8 for the filesystem encoding and
to encode command line arguments on this OS.
2010-10-20 22:58:25 +00:00
Victor Stinner 073f759d65 Move non-ascii test from test_run_code() to a new function: test_non_ascii() 2010-10-20 21:56:55 +00:00
Victor Stinner f6211eda71 Move test_undecodable_code() from test_sys to test_cmd_line 2010-10-20 21:52:33 +00:00
Antoine Pitrou d7931095d5 Add some debug output in verbose mode 2010-10-08 18:46:09 +00:00
Antoine Pitrou f51d8d3a2e Better Python spawning primitives in test.script_helper, for
easier writing of unit tests and better error reporting.
2010-10-08 18:05:42 +00:00
Nick Coghlan d26c18adcc Issue #8202: Set sys.argv[0] to -m rather than -c while searching for the module to execute. Also updates all the cmd_line_script tests to validate the setting of sys.path[0] and the current working directory 2010-08-17 13:06:11 +00:00
Victor Stinner 30ba25b865 Merged revisions 80116 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r80116 | victor.stinner | 2010-04-16 17:10:27 +0200 (ven., 16 avril 2010) | 2 lines

  Issue #7605: Fix test_cmd_line if the current working directory is not ASCII
........
2010-04-16 15:44:04 +00:00
Victor Stinner 76cf68724c Issue #7605: Fix test_cmd_line if the current working directory is not ASCII 2010-04-16 15:10:27 +00:00
Georg Brandl 1b37e8728c Merged revisions 78093 via svnmerge from
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.
........
2010-03-14 10:45:50 +00:00
Benjamin Peterson 577473fe68 use assert[Not]In where appropriate
A patch from Dave Malcolm.
2010-01-19 00:09:57 +00:00
Nick Coghlan 260bd3e557 Merged revisions 76286-76287,76289-76294,76296-76299,76301-76305,76307,76310-76311,76313-76322 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76286 | nick.coghlan | 2009-11-15 17:30:34 +1000 (Sun, 15 Nov 2009) | 1 line

  Issue #6816: expose the zipfile and directory execution mechanism to Python code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation.
........
  r76321 | nick.coghlan | 2009-11-16 13:55:51 +1000 (Mon, 16 Nov 2009) | 1 line

  Account for another cache when hunting ref leaks
........
  r76322 | nick.coghlan | 2009-11-16 13:57:32 +1000 (Mon, 16 Nov 2009) | 1 line

  Allow for backslashes in file paths passed to the regex engine
........
2009-11-16 06:49:25 +00:00
Nick Coghlan 6ead552b47 Note that a number of the changes listed below were not applicable to the Py3k branch, and hence the corresponding
files are unchanged in this checkin. This checkin is also the first time the environment checking in regrtest has
been forward ported to the Py3k branch.

This checkin causes test_xmlrpc to fail - see issue 7165 (it's a bug in the 3.x version of xmlrpc.server)
I am also getting a failure in test_telnetlib, but it isn't clear yet if that is due to these changes.

Recorded merge of revisions 75400-75401,75404,75406,75414,75416,75422,75425-75428,75435,75439,75441-75444,75447-75449,75451-75453,75455-75458,75460-75469,75471-75473,75475-75477,75479-75481,75483,75486-75489 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75400 | r.david.murray | 2009-10-14 23:58:07 +1000 (Wed, 14 Oct 2009) | 6 lines

  Enhanced Issue 7058 patch, which will not be backported.  Refactors the
  code, adds checks for stdin/out/err, cwd, and sys.path, and adds a new
  section in the summary for tests that modify the environment (thanks to
  Ezio Melotti for that suggestion).
........
  r75453 | nick.coghlan | 2009-10-17 16:33:05 +1000 (Sat, 17 Oct 2009) | 1 line

  Correctly restore sys.stdout in test_descr
........
  r75456 | nick.coghlan | 2009-10-17 17:30:40 +1000 (Sat, 17 Oct 2009) | 1 line

  Enhancement to the new environment checking code to print the changed items under -vv. Also includes a small tweak to allow underscores in the names of resources.
........
  r75457 | nick.coghlan | 2009-10-17 17:34:27 +1000 (Sat, 17 Oct 2009) | 1 line

  Formatting tweak so that before and after values are vertically aligned
........
  r75458 | nick.coghlan | 2009-10-17 18:21:21 +1000 (Sat, 17 Oct 2009) | 1 line

  Check and revert expected sys.path alterations
........
  r75461 | nick.coghlan | 2009-10-18 00:40:54 +1000 (Sun, 18 Oct 2009) | 1 line

  Restore original sys.path when running TTK tests
........
  r75462 | nick.coghlan | 2009-10-18 01:09:41 +1000 (Sun, 18 Oct 2009) | 1 line

  Don't invoke reload(sys) and use StringIO objects instead of real files to capture stdin and stdout when needed (ensures all sys attributes remain unmodified after test_xmlrpc runs)
........
  r75463 | nick.coghlan | 2009-10-18 01:23:08 +1000 (Sun, 18 Oct 2009) | 1 line

  Revert changes made to environment in test_httpservers
........
  r75465 | nick.coghlan | 2009-10-18 01:45:52 +1000 (Sun, 18 Oct 2009) | 1 line

  Move restoration of the os.environ object into the context manager where it belongs
........
  r75466 | nick.coghlan | 2009-10-18 01:48:16 +1000 (Sun, 18 Oct 2009) | 1 line

  Also check and restore identity of sys.path, sys.argv and os.environ rather than just their values (this picked up a few more misbehaving tests)
........
  r75467 | nick.coghlan | 2009-10-18 01:57:42 +1000 (Sun, 18 Oct 2009) | 1 line

  Avoid replacing existing modules and sys.path in import tests
........
  r75468 | nick.coghlan | 2009-10-18 02:19:51 +1000 (Sun, 18 Oct 2009) | 1 line

  Don't replace sys.path in test_site
........
  r75481 | nick.coghlan | 2009-10-18 15:38:48 +1000 (Sun, 18 Oct 2009) | 1 line

  Using CleanImport to revert a reload of the os module doesn't work due to function registrations in copy_reg. The perils of reloading modules even for tests...
........
  r75486 | nick.coghlan | 2009-10-18 20:29:10 +1000 (Sun, 18 Oct 2009) | 1 line

  Silence a deprecation warning by using the appropriate replacement construct
........
  r75489 | nick.coghlan | 2009-10-18 20:56:21 +1000 (Sun, 18 Oct 2009) | 1 line

  Restore sys.path in test_tk
........
2009-10-18 13:19:33 +00:00
Georg Brandl ab91fdef1f Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k

........
  r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line

  convert old fail* assertions to assert*
........
2009-08-13 08:51:18 +00:00
Benjamin Peterson c9c0f201fe convert old fail* assertions to assert* 2009-06-30 23:06:06 +00:00
Amaury Forgeot d'Arc 66f8c43b09 #5924: on Windows, a large PYTHONPATH (more than 255 chars) was completely ignored.
Will backport to 3.0.
2009-06-09 21:30:01 +00:00
Philip Jenvey ab7481a0a4 Merged revisions 72817 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72817 | philip.jenvey | 2009-05-21 22:35:32 -0700 (Thu, 21 May 2009) | 4 lines

  don't use subprocess.call with PIPEs as the child can fill the pipe buf and
  deadlock. add a warning to subprocess docs about this, similar to Popen.wait's.
  refs http://bugs.jython.org/issue1351
........
2009-05-22 05:46:35 +00:00
Antoine Pitrou 39df610571 Fix test so as to also pass in debug mode 2009-01-26 22:00:21 +00:00
Antoine Pitrou 27fe9fc448 Followup of #4705: we can't skip the binary buffering layer for stdin because FileIO doesn't have a read1() method 2009-01-26 21:48:00 +00:00
Antoine Pitrou 0560843b8f Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
flag to work properly. Furthermore, when specifying -u, the text stdout
and stderr streams have line-by-line buffering enabled (the default being
to buffer arbitrary chunks of data). Patch by Victor Stinner, test by me.
2009-01-09 18:53:14 +00:00
Amaury Forgeot d'Arc e25576467b Enable this test only when subprocess supports non-ascii arguments.
(it is about parsing the python command line arguments, not about subprocess)
2008-11-12 00:59:11 +00:00
Amaury Forgeot d'Arc f4b27124d2 Temporarily print some information in test_cmd_line,
to understand why the test fails on some platforms.
2008-11-12 00:13:45 +00:00
Amaury Forgeot d'Arc 9a5499b4e5 #3705: Command-line arguments were not correctly decoded when the
terminal does not use UTF8.

Now the code propagates the unicode string as far as possible, and avoids
the conversion to char* which implicitely uses utf-8.

Reviewed by Benjamin.
2008-11-11 23:04:59 +00:00
Amaury Forgeot d'Arc 8530e8590f Revert r33661, which broke all buildbots. 2008-09-09 07:28:22 +00:00
Amaury Forgeot d'Arc 14b785192b #3705: Fix crash when given a non-ascii value on the command line for the "-c" and "-m" parameters
Second part, for Windows.

Reviewed by Antoine Pitrou
2008-09-09 07:04:36 +00:00
Antoine Pitrou 8769576477 Merged revisions 65686 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65686 | antoine.pitrou | 2008-08-14 23:04:30 +0200 (jeu., 14 août 2008) | 3 lines

  Issue #3476: make BufferedReader and BufferedWriter thread-safe
........
2008-08-14 22:44:29 +00:00
Benjamin Peterson ee8712cda4 #2621 rename test.test_support to test.support 2008-05-20 21:35:26 +00:00