Skip to content

fix magfit errors#1695

Merged
tridge merged 2 commits into
ArduPilot:masterfrom
tridge:fix-magfit-bin-logs
Jun 17, 2026
Merged

fix magfit errors#1695
tridge merged 2 commits into
ArduPilot:masterfrom
tridge:fix-magfit-bin-logs

Conversation

@tridge

@tridge tridge commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

pickling errors with modern python

tridge added 2 commits June 17, 2026 11:20
magfit runs its UI in a child process, which pickles the log via
WrapFileHandle. That wrapper assumed text-mode file objects, but a
dataflash .bin log is opened in binary mode (_io.BufferedReader),
which has no encoding/errors/newlines attributes. This raised
"'_io.BufferedReader' object has no attribute 'encoding'".

Default those attributes with getattr() in __getstate__, and reopen
binary files without the text-only encoding/errors/newline kwargs
(which open() rejects in binary mode).
datetime.datetime.utcfromtimestamp() is deprecated. Replace with
datetime.datetime.fromtimestamp(tbase, datetime.timezone.utc).
@tridge tridge merged commit ea58423 into ArduPilot:master Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant