Skip to content

Fix: Apply low-level compression when no_hatanaka=True#166

Merged
PierreS-alpha merged 1 commit intoIPGP:masterfrom
skimprem:fix-compression-without-hatanaka
Jan 16, 2026
Merged

Fix: Apply low-level compression when no_hatanaka=True#166
PierreS-alpha merged 1 commit intoIPGP:masterfrom
skimprem:fix-compression-without-hatanaka

Conversation

@skimprem
Copy link
Copy Markdown
Contributor

When no_hatanaka=True and compression='Z' or 'gz' is requested, the files were created with compression extensions but the actual compression was not applied, making them unreadable.

This commit adds proper low-level compression for non-Hatanaka files:

  • Use ncompress module for .Z files (LZW compression)
  • Use gzip module for .gz files

The ncompress module is already available as a dependency of hatanaka, and gzip is a Python built-in module, so no new dependencies required.

Fixes issue where files like file.rnx.Z were created as plain text instead of being properly compressed with LZW/gzip algorithm.

When no_hatanaka=True and compression='Z' or 'gz' is requested,
the files were created with compression extensions but the actual
compression was not applied, making them unreadable.

This commit adds proper low-level compression for non-Hatanaka files:
- Use ncompress module for .Z files (LZW compression)
- Use gzip module for .gz files

The ncompress module is already available as a dependency of hatanaka,
and gzip is a Python built-in module, so no new dependencies required.

Fixes issue where files like file.rnx.Z were created as plain text
instead of being properly compressed with LZW/gzip algorithm.
@PierreS-alpha PierreS-alpha merged commit cdb8704 into IPGP:master Jan 16, 2026
@PierreS-alpha
Copy link
Copy Markdown
Member

Thanks for spotting the bug!
Your fix has been merged

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