Python 2 to 3 is the story of a language that broke compatibility and waited eleven years for its users. This is the same event seen from one of those users: a company with a large Python 2 program on other people's computers and a product that could not stop.
Gen 1
Dropbox's engineers describe the desktop client as "one of the most popular desktop applications in the world," and say that much of it is written in Python. By their count the application contains "over 1 million Python LOCs" and has had "hundreds of millions of installs." For years it ran on Python 2, most recently Python 2.7.
Nothing about Python 2 was failing users. The cost was in what surrounded it.
- The toolchain was frozen in time. On Windows, Python 2 still required Visual Studio 2008, a compiler that Microsoft no longer supported and that was not compatible with the Windows 10 SDK.
- The packaging was borrowed. The client was bundled with "freezer" scripts: py2exe for Windows, py2app for macOS and bbfreeze for Linux. The 2018 post notes that bbfreeze and pywin32 lacked Python 3 support at that stage.
- The language had moved on. The team wanted Python 3's type annotations, which its type checker, Mypy, could use directly, and the newer syntax for concurrent code.
The decision
The first two attempts were not funded projects. They were Hack Week experiments.
In 2015 a Hack Week team built a version of the client that, in Cary Yang's later account, "could sign in and sync some files." Many features were broken by the upgrade, and "much of the work was eventually thrown away."
In 2016 a second Hack Week team tried again, this time with Mypy, a static type checker that Dropbox had adopted in the year between. That team ported Dropbox's custom fork of Python to version 3.5 and added automated jobs that ran the unit tests and the type checks under Python 3.
The argument that won was about dependencies and not about elegance. Yang writes: "By early 2017, it had become clear that upgrading Python versions was in the critical path for several toolchain upgrades." The project was then officially staffed.
The decision that shaped everything else was how to do it. There would be no Python 3 branch. All application logic would be written in a hybrid syntax that ran on both versions, which in Yang's words allowed Dropbox "to continue shipping Python 2 builds to the majority of our users while we were testing Python 3 internally."
What happened
The work came in two steps, and the first one changed no Python version at all.
Step one: own the packaging. Starting in 2016, Dropbox replaced the freezer scripts with its own design, which embedded the Python runtime inside a native application. Internally it was called "Anti-freeze." On Windows the build moved from Visual Studio 2008 to Visual Studio 2013. This removed the tools that had no Python 3 future before the language itself was touched.
Step two: ship both. A step the team called Hydra let the client be built with either interpreter and choose at launch which one to run. With that in place the migration became a rollout:
- Tests first. Every unit test started out disabled under Python 3 and was re-enabled as its code was fixed.
- Types second. Files that failed the Python 3 type check went on a list that the team worked down. Type coverage of the codebase rose from 35% to 63% during the project.
- Then people. Teams that owned each part of the client held "bug bashes" on the Python 3 build.
- Then users, in rings. Clients were opted in "through a remote feature gate." The 2018 post gives the order: "We first rolled out the change to Dropboxers," then to a fraction of the Beta population, then to the Stable channel.
One rule governed the pace. All bugs identified as migration-related had to "be fully investigated and corrected before expanding" to more users.
The result is stated in one sentence: "Within 7 months, all Dropbox installs were running Python 3." Only then was the old interpreter taken out. "As of version 52, this process is complete," the 2018 post says, and Python 2 was removed from the client altogether. Yang's post marks the same moment: "This marked the end of our Python version migration!"
What was hard
Yang's post is specific about where the bugs came from, and it is the same place the language itself had its trouble: text. "String encoding in Python is hard" is one of his three lessons. Python 2 lets a program treat bytes and text as the same thing, and Python 3 does not. Most of the issues found in the migration came from that difference, in the places where the client reads and writes data.
The team also decided against one tempting shortcut. Adding the import that makes every string literal Unicode across the whole codebase was not possible in one step, and applying it to some files and not others would have confused the people working in them.
What made it work
- One codebase, two interpreters. Feature work continued because every change ran on both versions. Yang: "Because we preserved Python 2 compatibility throughout this project, we could continue to allow feature development." This is running two systems at the smallest possible cost, because only the interpreter was doubled.
- The switch was a setting. A remote gate decided which interpreter a client ran. A bad result could be answered by moving users back, with no new release.
- The blockers were removed first. Replacing the packaging tools was a project of its own, finished before the risky part started.
- Checks produced the work list. The disabled tests and the list of files failing type checks turned "port a million lines" into a countable queue. The first lesson in Yang's post is "Unit tests and typing are invaluable."
- Gen 1 was removed. The hybrid state was a means. After the stabilization period, Python 2 came out of the binary.
- The team told the story in public. The two engineers who led the rollout presented it at PyCon US in May 2019. The talk's abstract says Python 2.7 powered the application "until recently" and that a growing lack of features and outdated toolchains "made migrating to Python 3 a necessity."
The verdict
It worked. Every install moved, releases did not stop, and the old interpreter was deleted.
The limits are these. Both sources are Dropbox's own engineering posts, written after the project succeeded. Neither gives a team size or a cost. And the success took three tries over about three years: the 2015 attempt was mostly thrown away, and it was the 2016 groundwork and the 2017 funding that made the third attempt the last.
What to take from it
- Treat a language upgrade as a rollout. The question is not when the port is done. It is which users are on the new runtime today, and how they are doing.
- Make the old and new versions run the same source. A long-lived branch has to chase every feature. A hybrid codebase does not.
- Clear the dependencies before the migration. Tools with no future on the new platform are a separate project and should finish first.
- Let tests and types find the work. Dropbox's third lesson is its summary: "Incrementally migrate to Python 3 for great profit."
- Schedule the removal. The migration ended when Python 2 left the binary, not when Python 3 first ran. That is the step killing Gen 1 is about.
Sources
- Max Belanger and Damien DeVille - How we rolled out one of the largest Python 3 migrations ever (Dropbox Tech blog, September 25, 2018) - Dropbox's own account of the reasons, the packaging work that came first, the rollout stages and the version that removed Python 2
- Cary Yang - Incrementally migrating over one million lines of code from Python 2 to Python 3 (Dropbox Tech blog, February 6, 2019) - the two Hack Week attempts, when the project was staffed, the tests and type checks, the string problems and the three lessons
- Max Belanger and Damien DeVille - Going from 2 to 3 on Windows, macOS and Linux (PyCon US 2019 talk listing, May 3, 2019) - the conference abstract: Python 2.7 powered the application until recently, and why the move became a necessity
- Going from 2 to 3 on Windows, macOS and Linux (PyVideo recording page, PyCon US 2019) - the recording of the same talk
Last updated November 28, 2026.

