Other articles

  1. Python 3.7 UTF-8 Mode

    Since Python 3.0 was released in 2008, each time an user reported an encoding issue, someone showed up and asked why Python does not "simply" always use UTF-8. Well, it's not that easy. UTF-8 is the best encoding in most cases, but it is still not the best encoding …

    read more
  2. Python 3.7 and the POSIX locale

    During the childhood of Python 3, encodings issues were common, even on well configured systems. Python used UTF-8 rather than the locale encoding, and so commonly produced mojibake. For these reasons, when users complained about the Python behaviour with the POSIX locale, bug reports were closed with a message like …

    read more
  3. Python 3.0 listdir() Bug on Undecodable Filenames

    Ten years ago, when Python 3.0 final was released, os.listdir(str) ignored silently undecodable filenames:

    $ python3.0
    >>> os.mkdir(b'x')
    >>> open(b'x/nonascii\xff', 'w').close()
    >>> os.listdir('x')

    You had to use bytes to see all filenames:

    >>> os.listdir(b'x')

    If the locale is POSIX …

    read more

Page 1 / 4 »