Skip to content

filter_file: fix various bugs#48038

Merged
haampie merged 2 commits intodevelopfrom
hs/fix/filter_file-bugs
Dec 12, 2024
Merged

filter_file: fix various bugs#48038
haampie merged 2 commits intodevelopfrom
hs/fix/filter_file-bugs

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Dec 11, 2024

Fixes #48037

  • f.tell on a TextIOWrapper does not return the offset in bytes, but
    an opaque integer that can only be used for f.seek on the same
    object. Spack assumes it's a byte offset.
  • Do not open in a locale dependent way, but assume utf-8 (and allow
    users to override that)
  • Use tempfile to generate a backup/temporary file in a safe way

comparison between None and str is valid and on purpose.

@spackbot-app spackbot-app bot added core PR affects Spack core functionality utilities labels Dec 11, 2024
@haampie haampie force-pushed the hs/fix/filter_file-bugs branch 4 times, most recently from 0d2d615 to eb82f01 Compare December 11, 2024 15:52
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup file in a safe way
@haampie haampie force-pushed the hs/fix/filter_file-bugs branch from eb82f01 to 2620788 Compare December 11, 2024 15:52
@haampie haampie added the v0.23.1 PRs to backport for v0.23.1 label Dec 11, 2024
alalazo
alalazo previously approved these changes Dec 12, 2024
@alalazo alalazo self-assigned this Dec 12, 2024
@haampie haampie merged commit 9cd2f0a into develop Dec 12, 2024
@haampie haampie deleted the hs/fix/filter_file-bugs branch December 12, 2024 19:07
tdrwenski pushed a commit to tdrwenski/spack that referenced this pull request Dec 26, 2024
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object. Spack assumes it's a byte offset.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup/temporary file in a safe way
* Comparison between None and str is valid and on purpose.
kshea21 pushed a commit to kshea21/spack that referenced this pull request Dec 26, 2024
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object. Spack assumes it's a byte offset.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup/temporary file in a safe way
* Comparison between None and str is valid and on purpose.
haampie added a commit that referenced this pull request Feb 3, 2025
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object. Spack assumes it's a byte offset.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup/temporary file in a safe way
* Comparison between None and str is valid and on purpose.
@haampie haampie mentioned this pull request Feb 3, 2025
27 tasks
teaguesterling pushed a commit to teaguesterling/spack that referenced this pull request Feb 5, 2025
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object. Spack assumes it's a byte offset.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup/temporary file in a safe way
* Comparison between None and str is valid and on purpose.
haampie added a commit that referenced this pull request Feb 19, 2025
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but
  an opaque integer that can only be used for `f.seek` on the same
  object. Spack assumes it's a byte offset.
* Do not open in a locale dependent way, but assume utf-8 (and allow
  users to override that)
* Use tempfile to generate a backup/temporary file in a safe way
* Comparison between None and str is valid and on purpose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality utilities v0.23.1 PRs to backport for v0.23.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filter_file is broken

2 participants