Fetching contributors…
Cannot retrieve contributors at this time
286 lines (205 sloc) 9.83 KB

rarfile history

Version 3.0 (2016-12-27)

New feature:

  • Support RAR5 archive format. It is actually completely different archive format from RAR3 one, only is uses same file extension and tools are old one.

    Except incompatibilies noted below, most of code should notice no change, existing :class:`RarInfo` fields will continue using RAR3-compatible values (eg. :attr:`RarInfo.host_os`). RAR5-specific values will use new fields.

Incompatibilities between rarfile v2.x and 3.x:


  • Fixed bug when calling on a RarInfo structure.


  • Code refactor to allow 2 different file format parsers.
  • Code cleanups to pass modern linters.
  • New testing and linting setup based on Tox.
  • Use setuptools instead distutils for install.

Version 2.8 (2016-06-07)

  • Fix: support solid archives from in-memory file object. Full archive will be written out to temp file. [#21]
  • Fix: ask unrar stop switches scanning, to handle archive names starting with "-". (Alexander Shadchin) [#12]
  • Fix: add missing _parse_error variable to RarFile object. (Gregory Mazzola) [#20]
  • Fix: return proper boolean from :meth:`RarInfo.needs_password`. [#22]
  • Fix: do not insert non-string rarfile into exception string. (Tim Muller) [#23]
  • Fix: make :meth:`RarFile.extract` and :meth:`RarFile.testrar` support in-memory archives.
  • Use cryptography module as preferred crypto backend. PyCrypto will be used as fallback.
  • Cleanup: remove compat code for Python 2.4/2.5/2.6.

Version 2.7 (2014-11-23)

  • Allow use of bsdtar as decompression backend. It sits on top of libarchive, which has support for reading RAR archives.

    Limitations of libarchive RAR backend:

    • Does not support solid archives.
    • Does not support password-protected archives.
    • Does not support "parsing filters" used for audio/image/executable data, so few non-solid, non-encrypted archives also fail.

    Now :mod:`rarfile` checks if unrar and if not then tries bsdtar. If that works, then keeps using it. If not then configuration stays with unrar which will then appear in error messages.

  • Both :class:`RarFile` and :func:`is_rarfile` now accept file-like object. Eg. :class:`io.BytesIO`. Only requirement is that the object must be seekable. This mirrors similar funtionality in zipfile.

    Based on patch by Chase Zhang.

  • Uniform error handling. :class:`RarFile` accepts errors="strict" argument.

    Allow user to tune whether parsing and missing file errors will raise exception. If error is not raised, the error string can be queried with :meth:`RarFile.strerror` method.

Version 2.6 (2013-04-10)

Version 2.5 (2012-01-19)


Version 2.4 (2011-11-05)


  • :data:`USE_DATETIME`: survive bad values from RAR
  • Fix bug in corrupt unicode filename handling
  • dumprar: make unicode chars work with both pipe and console

Version 2.3 (2011-07-03)




  • Make encrypted headers work with Python 3.x bytes() and with old 2.x 'sha' module.
  • Simplify :class:`subprocess.Popen` usage when launching unrar. Previously it tried to optimize and work around OS/Python bugs, but this is not maintainable.
  • Use temp rar file hack on multi-volume archives too.
  • Always .wait() on unrar, to avoid zombies
  • Convert struct.error to BadRarFile
  • Plug some fd leaks. Affected: Jython, PyPy.
  • Broken archives are handled more robustly.

Version 2.2 (2010-08-19)


  • Relaxed volume naming. Now it just calculates new volume name by finding number in old one and increasing it, without any expectations what that number should be.
  • Files with 4G of compressed data in one colume were handled wrong. Fix.
  • DOS timestamp seconds need to be multiplied with 2.
  • Correct EXTTIME parsing.


  • Compressed size is per-volume, sum them together, so that user sees complete compressed size for files split over several volumes.
  • dumprar: Show unknown bits.
  • Use :class:`struct.Struct` to cache unpack formats.
  • Support missing :data:`os.devnull`. (Python 2.3)

Version 2.1 (2010-07-31)



  • Don't read past ENDARC, there could be non-RAR data there.
  • RAR 2.x: It does not write ENDARC, but our volume code expected it. Fix that.
  • RAR 2.x: Support more than 200 old-style volumes.


  • Load comment only when requested.
  • Cleanup of internal config variables. They should have now final names.
  • :meth:``: Add mode=r argument to match zipfile.
  • Doc and comments cleanup, minimize duplication.
  • Common wrappers for both compressed and uncompressed files, now :meth:`` also does CRC-checking.

Version 2.0 (2010-04-29)


  • Python 3 support. Still works with 2.x.
  • Parses extended time fields. (.mtime, .ctime, .atime)
  • :meth:`` method. This makes possible to process large entries that do not fit into memory.
  • Supports password-protected archives.
  • Supports archive comments.


  • Uses :mod:`subprocess` module to launch unrar.
  • .filename is always Unicode string, .unicode_filename is now deprecated.
  • .CRC is unsigned again, as python3 crc32() is unsigned.

Version 1.1 (2008-08-31)



  • more docstrings
  • throw proper exceptions (subclasses of :exc:`rarfile.Error`)
  • RarInfo has fields pre-initialized, so they appear in help()
  • rename to RarInfo.header_data
  • dont use "print" when header parsing fails
  • use try/finally to delete temp rar

Version 1.0 (2005-08-08)

  • First release.