Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    V

    Victor Stinner

    vstinner.github.io · Personal blog · on HN since 2018

    Victor Stinner, a CPython core developer, writes about Python internals, the C API, Unicode handling, subinterpreters, and bug fixes.

    Visit blogRSSHN submissions
    Languages & CompilersProgrammingOpen Source & Linux
    What HN says

    HN commenters recommend it for understanding why Python 3 handles Unicode and OS encodings as it does, and cite his PEP 383 surrogateescape write-up.

    Stats for nerds
    15HN people shared it
    9linked in comments
    25story points
    Nov 2025last shared
    2018people per year2025

    Top posts on HN

    1. 1
      The History and rationale of the Python 3 Unicode model for the operating system
      3 people · 9 points · first shared 2021 · Discussion on HN
    2. 2
      Python C API: Add functions to access PyObject
      2 people · 4 points · first shared 2021 · 1 comments on HN
    3. 3
      Isolate Python Subinterpreters
      1 person · 4 points · first shared 2020 · Discussion on HN
    4. 4
      Pass the Python thread state explicitly
      1 person · 3 points · first shared 2020 · Discussion on HN
    5. 5
      Python 3.7 UTF-8 Mode
      2 people · 2 points · first shared 2018 · Discussion on HN
    6. 6
      Remove private C API functions
      1 person · 2 points · first shared 2023 · Discussion on HN
    7. 7
      How Victor Stinner fixed a very old GIL race condition in Python 3.7
      1 person · 1 points · first shared 2018 · Discussion on HN
    8. 8
      Homepage
      1 person · first shared 2018
    9. 9
      Journey to stable benchmark system
      1 person · first shared 2020
    10. 10
      Journey to stable benchmark deadcode
      1 person · first shared 2020

    What HN people wrote when they linked it

    • saurikJan 2021

      So, my favorite thought process from the Python 2 to 3 transition comes from staring deeply into the hubris of the Python 3000 effort itself as wanting to insist "everything is Unicode"; on the one hand they were trying to shame developers using Python 2 for using it incorrectly (even though it was totally possible to handle Unicode correctly with that stack), yet on the other they were pumping out ridiculous unavoidable security SNAFUs in their API surface by assuming that filenames on disk are UTF-8 :/.

      To tell another story of the importance of reading the--in this case, not even long!--specification: on Windows, filenames are stored as UCS-2 (as it all predates UTF-16), and is most likely most correctly modeled as an arbitrary sequence of non-0 16-bit values; meanwhile, on Unix systems, a filename is pretty much just an arbitrary sequence of non-0 8-bit values (with some weirdness around the slash character... the API surface doesn't support it really but sometimes the filesystem does). The premise that filenames have a display encoding mostly comes from the software rendering the strings and is then defined in terms of a bunch of hacks involving "locales", and isn't a property of the underlying API or storage semantics.

      You can't assume in either case that they are canonical Unicode representations, and so storing them as "strings" in your program is super wrong and can lead to anything from data storage mistakes to security vulnerabilities. The Python 3 API…

    • chubotJun 2023

      Thanks, yeah that's basically what I thought, but it's nice to know it was the same year!

      If only UTF-8 had been invented a little earlier, we could have avoided so much pain :-(

      The idea of global varables like LANG= and LC_TYPE= in C is utterly incoherent.

      Python's notion of "default file system encoding" is likewise incoherent.

      You can obviously process strings with two different encodings in the same program !!! Encodings are metadata, and metadata should be attached to data. Encodings shouldn't be global variables!

      Python 3 made things worse in many ways, largely due to adherence to Windows legacy, and then finally introduced UTF-8 mode:

      https://vstinner.github.io/painful-history-python-filesystem-encoding.html

    • sametmaxMay 2018

      Funnily, because of the 2/3 transition, Python became a language obsessed with encoding correctness. Hence the team spent a great deal improving the situation, from version to version during the last 10 years.

      For a fantastic read (from Victor Stinner himself) on all the work done and get how twisted this get when you want to be cross plateform and abstract it:

      https://vstinner.github.io/python37-new-utf8-mode.html

      Windows and Linux FS encoding, of course, are at the center of the challenge.

      It's also the reason why we now have a __fspath__ protocol that allows any object to be converted to a file system path instead of having pathlib.Path inheriting from string.

    • nicolaslemOct 2018

      For anyone interested in learning why Python 3 works this way I highly recommend the blog of Victor Stinner[0].

      As for the article, this is nothing new. The problem is similar to the issues raised by Armin Ronacher[1]. These problems are well known and Python developers address them one at a time. Issues around these egde cases have improved since the initial release of Python 3.0.

      [0] http://vstinner.github.io

      [1] http://lucumr.pocoo.org/2014/5/12/everything-about-unicode/

    • __sJan 2020

      Victor Stinner (python dev) wrote a good series on trying to get stable benchmarks in python:

      https://vstinner.github.io/journey-to-stable-benchmark-system.html
      https://vstinner.github.io/journey-to-stable-benchmark-deadcode.html
      https://vstinner.github.io/journey-to-stable-benchmark-average.html

    • jefftkAug 2022

      Found some history: https://vstinner.github.io/python30-listdir-undecodable-filenames.html

      Includes "Modify os.listdir(str) to ignore silently undecodable filenames, instead of returning them as bytes", but not later work where apparently this was changed to use surrogates.

    Related

    Trevor Jimtrevorjim.com23 people

    Python is not context free (2012)

    Trevor Jim
    Personal · last shared 2024
    Armin Ronacherlucumr.pocoo.org417 people

    996

    Armin Ronacher
    Personal · last shared 2026
    PyPy Blogmorepypy.blogspot.com242 people

    Let's Remove the Global Interpreter Lock

    PyPy Blog
    Company · last shared 2024
    Victor Yodaikenyodaiken.com34 people

    Undefined behavior in C is a reading error

    Victor Yodaiken
    Personal · last shared 2026
    Graham Jenkinsdarkcoding.net44 people

    Facebook’s code quality problem (2015)

    Graham Jenkins
    Personal · last shared 2025
    Python at Microsoftdevblogs.microsoft.com/python71 people

    Python in the Windows 10 May update

    Python at Microsoft
    Company · last shared 2026
    Edward Z. Yangblog.ezyang.com165 people

    PyTorch Internals: Ezyang's Blog

    Edward Z. Yang
    Personal · last shared 2026
    Doug Hellmanndoughellmann.com44 people

    The Performance Impact of Using dict() Instead of {} in CPython 2.7

    Doug Hellmann
    Personal · last shared 2024