Skip to content

Use io.StringIO() instead of tempfile.TemporaryFile()#568

Merged
slyon merged 1 commit intocanonical:mainfrom
Cellebyte:fix/tempfile
Jan 27, 2026
Merged

Use io.StringIO() instead of tempfile.TemporaryFile()#568
slyon merged 1 commit intocanonical:mainfrom
Cellebyte:fix/tempfile

Conversation

@Cellebyte
Copy link
Contributor

@Cellebyte Cellebyte commented Jan 27, 2026

Description

We found another one which causes issues in early boot stage of the linux kernel.
As the tempdirs are not mounted in that stage and the SRIOV configuration happens very early on.
Everything around tempfile or tempdir is problematic and fails with an exception.

To fix this I started using io.StringIO for everything which needed a temporary buffer.

Similar to #564 .

Checklist

  • Runs make check successfully.
  • Retains code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

@Cellebyte Cellebyte changed the title Use io.StringIO instead of tempfile Use io.StringIO() instead of tempfile.TemporaryFile() Jan 27, 2026
Copy link
Contributor

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, lgtm!

@slyon slyon merged commit f758e3f into canonical:main Jan 27, 2026
17 of 18 checks passed
@Cellebyte Cellebyte deleted the fix/tempfile branch January 27, 2026 15:34
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