<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Include/internal/pycore_fileutils.h, branch 3.10</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/internal/pycore_fileutils.h?h=3.10</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/internal/pycore_fileutils.h?h=3.10'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2021-04-30T13:21:42Z</updated>
<entry>
<title>bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096)</title>
<updated>2021-04-30T13:21:42Z</updated>
<author>
<name>Jakub Kulík</name>
<email>Kulikjak@gmail.com</email>
</author>
<published>2021-04-30T13:21:42Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86'/>
<id>urn:sha1:9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86</id>
<content type='text'>
</content>
</entry>
<entry>
<title>bpo-42236: Use UTF-8 encoding if nl_langinfo(CODESET) fails (GH-23086)</title>
<updated>2020-11-01T22:07:23Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-11-01T22:07:23Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e662c398d87f136497f8ec672e83657ae3a599e0'/>
<id>urn:sha1:e662c398d87f136497f8ec672e83657ae3a599e0</id>
<content type='text'>
If the nl_langinfo(CODESET) function returns an empty string, Python
now uses UTF-8 as the filesystem encoding.

In May 2010 (commit b744ba1d14c5487576c95d0311e357b707600b47), I
modified Python to log a warning and use UTF-8 as the filesystem
encoding (instead of None) if nl_langinfo(CODESET) returns an empty
string.

In August 2020 (commit 94908bbc1503df830d1d615e7b57744ae1b41079), I
modified Python startup to fail with a fatal error and a specific
error message if nl_langinfo(CODESET) returns an empty string. The
intent was to prevent guessing the encoding and also investigate user
configuration where this case happens.

In 10 years (2010 to 2020), I saw zero user report about the error
message related to nl_langinfo(CODESET) returning an empty string.

Today, UTF-8 became the defacto standard and it's safe to make the
assumption that the user expects UTF-8. For example,
nl_langinfo(CODESET) can return an empty string on macOS if the
LC_CTYPE locale is not supported, and UTF-8 is the default encoding
on macOS.

While this change is likely to not affect anyone in practice, it
should make UTF-8 lover happy ;-)

Rewrite also the documentation explaining how Python selects the
filesystem encoding and error handler.</content>
</entry>
<entry>
<title>bpo-42236: Enhance _locale._get_locale_encoding() (GH-23083)</title>
<updated>2020-11-01T19:59:35Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-11-01T19:59:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=82458b6cdbae3b849dc11d0d7dc2ab06ef0451c4'/>
<id>urn:sha1:82458b6cdbae3b849dc11d0d7dc2ab06ef0451c4</id>
<content type='text'>
* Rename _Py_GetLocaleEncoding() to _Py_GetLocaleEncodingObject()
* Add _Py_GetLocaleEncoding() which returns a wchar_t* string to
  share code between _Py_GetLocaleEncodingObject()
  and config_get_locale_encoding().
* _Py_GetLocaleEncodingObject() now decodes nl_langinfo(CODESET)
  from the current locale encoding with surrogateescape,
  rather than using UTF-8.</content>
</entry>
<entry>
<title>bpo-42208: Add _Py_GetLocaleEncoding() (GH-23050)</title>
<updated>2020-10-31T00:02:09Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2020-10-31T00:02:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=710e82630775774dceba5e8f24b1b10e6dfaf9b7'/>
<id>urn:sha1:710e82630775774dceba5e8f24b1b10e6dfaf9b7</id>
<content type='text'>
_io.TextIOWrapper no longer calls getpreferredencoding(False) of
_bootlocale to get the locale encoding, but calls
_Py_GetLocaleEncoding() instead.

Add config_get_fs_encoding() sub-function. Reorganize also
config_get_locale_encoding() code.</content>
</entry>
<entry>
<title>bpo-40422: Move _Py_closerange to fileutils.c (GH-22680)</title>
<updated>2020-10-13T20:04:44Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans91@users.noreply.github.com</email>
</author>
<published>2020-10-13T20:04:44Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7992579cd27f14f472acc37aca537eec55f681ef'/>
<id>urn:sha1:7992579cd27f14f472acc37aca537eec55f681ef</id>
<content type='text'>
This API is relatively lightweight and organizationally, given that it's
used by multiple modules, it makes sense to move it to fileutils.

Requires making sure that _posixsubprocess is compiled with the appropriate
Py_BUIILD_CORE_BUILTIN macro.</content>
</entry>
<entry>
<title>bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)</title>
<updated>2019-03-19T00:46:25Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-03-19T00:46:25Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=5f9cf23502febe0eb3bc02e45c7d2bfc79424757'/>
<id>urn:sha1:5f9cf23502febe0eb3bc02e45c7d2bfc79424757</id>
<content type='text'>
Python initialization now fails if decoding pybuilddir.txt
configuration file fails at startup.

_PyPathConfig_Calculate() now reports memory allocation failure and
decoding error on decoding pybuilddir.txt content from
UTF-8/surrogateescape.</content>
</entry>
<entry>
<title>bpo-36142: Add preconfig.c (GH-12128)</title>
<updated>2019-03-01T16:52:56Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2019-03-01T16:52:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=91b9ecf82c3287b45f39158c5134a87414ff26bc'/>
<id>urn:sha1:91b9ecf82c3287b45f39158c5134a87414ff26bc</id>
<content type='text'>
* Add _PyArgv_Decode() function
* Move _Py_ClearFileSystemEncoding() and _Py_SetFileSystemEncoding()
  to preconfig.c.</content>
</entry>
<entry>
<title>bpo-34523: Fix C locale coercion on FreeBSD CURRENT (GH-10672)</title>
<updated>2018-11-23T12:08:26Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2018-11-23T12:08:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=353933e712b6c7f7ba9a9a50bd5bd472db7c35d0'/>
<id>urn:sha1:353933e712b6c7f7ba9a9a50bd5bd472db7c35d0</id>
<content type='text'>
bpo-34523, bpo-35290: C locale coercion now resets the Python
internal "force ASCII" mode. This change fix the filesystem encoding
on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when
the UTF-8 mode is disabled.

Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.</content>
</entry>
<entry>
<title>bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606)</title>
<updated>2018-11-20T15:20:16Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2018-11-20T15:20:16Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=02e6bf7f2025cddcbde6432f6b6396198ab313f4'/>
<id>urn:sha1:02e6bf7f2025cddcbde6432f6b6396198ab313f4</id>
<content type='text'>
locale.localeconv() now sets temporarily the LC_CTYPE locale to the
LC_MONETARY locale if the two locales are different and monetary
strings are non-ASCII. This temporary change affects other threads.

Changes:

* locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode
  monetary fields.
* Add LocaleInfo.grouping_buffer: copy localeconv() grouping string
  since it can be replaced anytime if a different thread calls
  localeconv().
* _Py_GetLocaleconvNumeric() now requires a "struct lconv *"
  structure, so locale.localeconv() now longer calls localeconv()
  twice. Moreover, the function now requires all arguments to be
  non-NULL.
* Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT.
* Move _Py_GetLocaleconvNumeric() definition from fileutils.h
  to pycore_fileutils.h. pycore_fileutils.h now includes locale.h.
* The _locale module is now built with Py_BUILD_CORE defined.</content>
</entry>
<entry>
<title>bpo-35081: Add pycore_fileutils.h (GH-10371)</title>
<updated>2018-11-06T23:44:03Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@redhat.com</email>
</author>
<published>2018-11-06T23:44:03Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9fc57a384825530635ef5ec093a31d864ea14f7c'/>
<id>urn:sha1:9fc57a384825530635ef5ec093a31d864ea14f7c</id>
<content type='text'>
Move Py_BUILD_CORE code from Include/fileutils.h to a new
Include/internal/pycore_fileutils.h file.</content>
</entry>
</feed>
