Rsrcfork

Latest version: v1.8.0

Safety actively analyzes 629723 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

1.3.0

* Added a `--group` command line option to group resources in list format by type (the default), ID, or with no grouping.
* Added a `dump-text` output format to the command line tool. This format is identical to `dump`, but instead of a hex dump, it outputs the resource data as text. The data is decoded as MacRoman and classic Mac newlines (`\r`) are translated. This is useful for examining resources that contain mostly plain text.
* Changed the command line tool to sort resources by type and ID, and added a `--no-sort` option to disable sorting and output resources in file order (which was the previous behavior).
* Renamed the `rsrcfork.Resource` attributes `resource_type` and `resource_id` to `type` and `id`, respectively. The old names have been deprecated and will be removed in the future, but are still supported for now.
* Changed `--format=dump` output to match `hexdump -C`'s format - spacing has been adjusted, and multiple subsequent identical lines are collapsed into a single `*`.

1.2.0.post1

* Fixed an incorrect `options.packages` in `setup.cfg`, which made the library unusable except when installing from source using `--editable`.

1.2.0

* Added support for compressed resources.

* Compressed resource data is automatically decompressed, both in the Python API and on the command line.
* This is technically a breaking change, since in previous versions the compressed resource data was returned directly. However, this change will not affect end users negatively, unless one has already implemented custom handling for compressed resources.
* Currently, only the three standard System 7.0 compression formats (`'dcmp'` IDs 0, 1, 2) are supported. Attempting to access a resource compressed in an unsupported format results in a `DecompressError`.
* To access the raw resource data as stored in the file, without automatic decompression, use the `res.data_raw` attribute (for the Python API), or the `--no-decompress` option (for the command-line interface). This can be used to read the resource data in its compressed form, even if the compression format is not supported.

* Improved automatic data/resource fork selection for files whose resource fork contains invalid data.

* This fixes reading certain system files with resource data in their data fork (such as HIToolbox.rsrc in HIToolbox.framework, or .dfont fonts) on recent macOS versions (at least macOS 10.14, possibly earlier). Although these files have no resource fork, recent macOS versions will successfully open the resource fork and return garbage data for it. This behavior is now detected and handled by using the data fork instead.

* Replaced the `rsrcfork` parameter of `rsrcfork.open`/`ResourceFork.open` with a new `fork` parameter. `fork` accepts string values (like the command line `--fork` option) rather than `rsrcfork`'s hard to understand `None`/`True`/`False`.

* The old `rsrcfork` parameter has been deprecated and will be removed in the future, but for now it still works as before.

* Added an explanatory message when a resource filter on the command line doesn't match any resources in the resource file. Previously there would either be no output or a confusing error, depending on the selected `--format`.
* Changed resource type codes and names to be displayed in MacRoman instead of escaping all non-ASCII characters.
* Cleaned up the resource descriptions in listings and dumps to improve readability. Previously they included some redundant or unnecessary information - for example, each resource with no attributes set would be explicitly marked as "no attributes".
* Unified the formats of resource descriptions in listings and dumps, which were previously slightly different from each other.
* Improved error messages when attempting to read multiple resources using `--format=hex` or `--format=raw`.
* Fixed reading from non-seekable streams not working for some resource files.
* Removed the `allow_seek` parameter of `ResourceFork.__init__` and the `--read-mode` command line option. They are no longer necessary, and were already practically useless before due to non-seekable stream reading being broken.

1.1.3.post1

* Fixed a formatting error in the README.rst to allow upload to PyPI.

1.1.3

**Note: This version is not available on PyPI, see version 1.1.3.post1 changelog for details.**

* Added a setuptools entry point for the command-line interface. This allows calling it using just `rsrcfork` instead of `python3 -m rsrcfork`.
* Changed the default value of `ResourceFork.__init__`'s `close` keyword argument from `True` to `False`. This matches the behavior of classes like `zipfile.ZipFile` and `tarfile.TarFile`.
* Fixed `ResourceFork.open` and `ResourceFork.__init__` not closing their streams in some cases.
* Refactored the single `rsrcfork.py` file into a package. This is an internal change and should have no effect on how the `rsrcfork` module is used.

1.1.2

* Added support for the resource file attributes "Resources Locked" and "Printer Driver MultiFinder Compatible" from ResEdit.
* Added more dummy constants for resource attributes with unknown meaning, so that resource files containing such attributes can be loaded without errors.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.