Breaking Changes in Python-3.14

One of the reasons Linux is so successful is Torvald's insistence on never breaking user space.

The python people don't adhere to this principle and maybe I need to give up on it, I'm just sick of this crap.

Those of us of a certain vintage will recall the tumult of python-2 to -3. Suddenly, production code needed significant re-writing. We got an arguably better python out of it, but oh! the pain.

In 3.14, (among many other things) the python developers decided to make 'forkserver' the default instead of 'fork' for the Process() method (this is for starting a child process - https://docs.python.org/3/library/multiprocessing.html). Why on earth break our code in such a wanton way? Why not leave the default alone - there was always the option to use 'forkserver' if one wanted it. Or maybe they could have created a new entrypoint with the new behaviour Process_fastserver() or some such? Oh no! Just break it and make their customers patch furiously!

When we adopt a language, we like to think that what runs today will run tomorrow - C and bash programs that I wrote 30 years ago still run. Not with python - if you use it, buckle up and make sure your regression tests are thorough, it'll be a rough ride.

Move slow and break things, perhaps?

6 points | by wef 9 hours ago

2 comments

  • mattbillenstein 9 hours ago
    Why do you consider using forkserver as the default a breaking change? This should be transparent to most users?

    fork() is very hard to get right as it keeps a lot of state around from the parent process you have to cleanly discard...

    • perrygeo 6 hours ago
      This is far from transparent. It's a massive change in behavior. Fork may be very hard to get right, but every python developer using multiprocessing has already paid that cost - and expects it to keep working!

      With fork, you could pass objects that couldn't be pickled (lambdas, local functions, file handles, database connections). With forkserver, everything must be pickleable. That alone breaks thousands of repos of code.

      You can no longer work with global module-level objects, so it fundamentally changes how scoping rules work.

      It launches a server with some extra machinery at runtime - startup cost and hidden complexity just snuck its your app without you knowing.

      forkserver may be technically a better choice. But that's irrelevant. Changing the default breaks existing code.

      • mattbillenstein 2 hours ago
        Eh, not letting the language ever evolve is a sure way to death, ymmv.

        Forkserver is probably a better default, inheriting file handles, globals, and sockets leads to a bunch of subtle bugs - I'm not sure that's even a good feature, also ymmv.

        And fork() is still available, so if it breaks things, the solution would be to explicitly ask for fork() - and I'd say for most casual uses of multiprocessing, a user won't know one way or the other which is what I meant by transparent.

  • WillowAndrew 9 hours ago
    If you want things to stay as they are, just pin your versions.