1. 07 Sep, 2018 2 commits
  2. 06 Sep, 2018 2 commits
  3. 05 Sep, 2018 1 commit
  4. 04 Sep, 2018 5 commits
  5. 03 Sep, 2018 6 commits
  6. 02 Sep, 2018 2 commits
  7. 01 Sep, 2018 3 commits
  8. 31 Aug, 2018 6 commits
  9. 30 Aug, 2018 2 commits
  10. 29 Aug, 2018 11 commits
    • Victor Stinner's avatar
      Fix TestPosixSpawn.test_close_file() (GH-8992) · 0382406f
      Victor Stinner authored
      Modify TestPosixSpawn to run Python using -I and -S options.
      
      Disable site module to avoid side effects. For example, on Fedora 28,
      if the HOME environment variable is not set, site._getuserbase()
      calls pwd.getpwuid() which opens /var/lib/sss/mc/passwd, but then
      leaves the file open which makes test_close_file() to fail.
      0382406f
    • Victor Stinner's avatar
      bpo-34523: Use _PyCoreConfig instead of globals (GH-9005) · fbca9085
      Victor Stinner authored
      Use the core configuration of the interpreter, rather
      than using global configuration variables. For example, replace
      Py_QuietFlag with core_config->quiet.
      fbca9085
    • Victor Stinner's avatar
      bpo-34523: Py_FileSystemDefaultEncoding NULL by default (GH-9003) · de427556
      Victor Stinner authored
      * Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
        default value is now NULL: initfsencoding() set them
        during Python initialization.
      * Document how Python chooses the filesystem encoding and error
        handler.
      * Add an assertion to _PyCoreConfig_Read().
      de427556
    • Victor Stinner's avatar
      bpo-34485: Emit C locale coercion warning later (GH-9002) · cf215041
      Victor Stinner authored
      PYTHONCOERCELOCALE=warn warning is now emitted later and written into
      sys.stderr, rather than being written into the C stderr stream.
      cf215041
    • Victor Stinner's avatar
      bpo-34523: Support surrogatepass in locale codecs (GH-8995) · 3d4226a8
      Victor Stinner authored
      Add support for the "surrogatepass" error handler in
      PyUnicode_DecodeFSDefault() and PyUnicode_EncodeFSDefault()
      for the UTF-8 encoding.
      
      Changes:
      
      * _Py_DecodeUTF8Ex() and _Py_EncodeUTF8Ex() now support the
        surrogatepass error handler (_Py_ERROR_SURROGATEPASS).
      * _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() now use
        the _Py_error_handler enum instead of "int surrogateescape" to pass
        the error handler. These functions now return -3 if the error
        handler is unknown.
      * Add unit tests on _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx()
        in test_codecs.
      * Rename get_error_handler() to _Py_GetErrorHandler() and expose it
        as a private function.
      * _freeze_importlib doesn't need config.filesystem_errors="strict"
        workaround anymore.
      3d4226a8
    • Victor Stinner's avatar
      bpo-34523: Py_DecodeLocale() use UTF-8 on Windows (GH-8998) · c5989cd8
      Victor Stinner authored
      Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding on
      Windows if Py_LegacyWindowsFSEncodingFlag is zero.
      
      pymain_read_conf() now sets Py_LegacyWindowsFSEncodingFlag in its
      loop, but restore its value at exit.
      c5989cd8
    • Victor Stinner's avatar
      bpo-34523: Fix config_init_fs_encoding() (GH-8991) · 70fead25
      Victor Stinner authored
      Call config_init_fs_encoding() if filesystem_errors is not NULL but
      filesystem_encoding is NULL.
      70fead25
    • Victor Stinner's avatar
      bpo-34523: Add _PyCoreConfig.filesystem_encoding (GH-8963) · b2457efc
      Victor Stinner authored
      _PyCoreConfig_Read() is now responsible to choose the filesystem
      encoding and error handler. Using Py_Main(), the encoding is now
      chosen even before calling Py_Initialize().
      
      _PyCoreConfig.filesystem_encoding is now the reference, instead of
      Py_FileSystemDefaultEncoding, for the Python filesystem encoding.
      
      Changes:
      
      * Add filesystem_encoding and filesystem_errors to _PyCoreConfig
      * _PyCoreConfig_Read() now reads the locale encoding for the file
        system encoding.
      * PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize()
        now use the interpreter configuration rather than
        Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
        global configuration variables.
      * Add _Py_SetFileSystemEncoding() and _Py_ClearFileSystemEncoding()
        private functions to only modify Py_FileSystemDefaultEncoding and
        Py_FileSystemDefaultEncodeErrors in coreconfig.c.
      * _Py_CoerceLegacyLocale() now takes an int rather than
        _PyCoreConfig for the warning.
      b2457efc
    • Victor Stinner's avatar
      bpo-34485: Add _PyCoreConfig.stdio_encoding (GH-8881) · dfe0dc74
      Victor Stinner authored
      * Add stdio_encoding and stdio_errors fields to _PyCoreConfig.
      * Add unit tests on stdio_encoding and stdio_errors.
      dfe0dc74
    • Victor Stinner's avatar
      bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988) · 177d921c
      Victor Stinner authored
      On Windows, the LC_CTYPE is now set to the user preferred locale at
      startup: _Py_SetLocaleFromEnv(LC_CTYPE) is now called during the
      Python initialization. Previously, the LC_CTYPE locale was "C" at
      startup, but changed when calling setlocale(LC_CTYPE, "") or
      setlocale(LC_ALL, "").
      
      pymain_read_conf() now also calls _Py_SetLocaleFromEnv(LC_CTYPE) to
      behave as _Py_InitializeCore(). Moreover, it doesn't save/restore the
      LC_ALL anymore.
      
      On Windows, standard streams like sys.stdout now always use
      surrogateescape error handler by default (ignore the locale).
      177d921c
    • Victor Stinner's avatar
      bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) · 315877dc
      Victor Stinner authored
      Standard streams like sys.stdout now use the "surrogateescape" error
      handler, instead of "strict", on the POSIX locale (when the C locale is not
      coerced and the UTF-8 Mode is disabled).
      
      Add tests on sys.stdout.errors with LC_ALL=POSIX.
      315877dc