Skip to content

fix error with Python 3.14 on Linux#37

Merged
tridge merged 1 commit intodronecan:masterfrom
tpwrules:pr/py314-fix
Jan 12, 2026
Merged

fix error with Python 3.14 on Linux#37
tridge merged 1 commit intodronecan:masterfrom
tpwrules:pr/py314-fix

Conversation

@tpwrules
Copy link
Copy Markdown
Contributor

@tpwrules tpwrules commented Jan 11, 2026

Python 3.14 switches to multiprocessing start method forkserver on Linux, which our code is broken with due to changes in Python 3.13 and our bad habit of running code in the main module.

This causes our compile/test subprocesses to die, saying dronecan_dsdlc.py: error: the following arguments are required: namespace_dir and ultimately failing with ConnectionResetError: [Errno 104] Connection reset by peer.

Fix by switching back to the old default of fork if we are going to use the broken forkserver. Our code needs to be fixed in the future to not do so much in the main module as fork is not the recommened method, though we probably do not fall afoul of its flaws.

Tested on Linux with Python 3.14, 3.13, and 3.12 that AP compiles after this fix, where previously it did not on 3.14. Also confirmed compilation result is the same.

Python 3.14 switches to multiprocessing start method `forkserver` on
Linux, which our code is broken with due to changes in Python 3.13 and
our bad habit of running code in the main module.

This causes our compile/test subprocesses to die, saying
`dronecan_dsdlc.py: error: the following arguments are required:
namespace_dir` and ultimately failing with `ConnectionResetError: [Errno
104] Connection reset by peer`.

Fix by switching back to the old default of `fork` if we are going to
use the broken `forkserver`. Our code needs to be fixed in the future to
not do so much in the main module as `fork` is not the recommened
method, though we probably do not fall afoul of its flaws.
@tridge tridge merged commit de47a89 into dronecan:master Jan 12, 2026
3 checks passed
@tpwrules tpwrules deleted the pr/py314-fix branch March 23, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants