anchor.diff: -{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, nose, libarchive, glibcLocales
  +{ stdenv, buildPythonPackage, fetchFromGitHub, pytestCheckHook, nose, libarchive, glibcLocales, isPy27
   # unrar is non-free software
   , useUnrar ? false, unrar
   }:
  
positive.code: assert useUnrar -> unrar != null;
  assert !useUnrar -> libarchive != null;
  
  buildPythonPackage {
    pname = "rarfile";
    version = "3.0";
  
    src = fetchFromGitHub {
      owner = "markokr";
      repo = "rarfile";
      rev = "rarfile_3_0";
      sha256 = "07yliz6p1bxzhipnrgz133gl8laic35gl4rqfay7f1vc384ch7sn";
    };
    buildInputs = [ pytest nose glibcLocales ];
  
    prePatch = ''
      substituteInPlace rarfile.py \
  
negative.code:   # the tests only work with the standard unrar package
    doCheck = useUnrar;
    LC_ALL = "en_US.UTF-8";
    pythonImportsCheck = [ "rarfile" ];
  
    meta = with stdenv.lib; {
      description = "RAR archive reader for Python";
  