GithubHelp home page GithubHelp logo

unrardll's Introduction

Hi there 👋

Kovid's GitHub stats

Top Langs

GitHub Streak

The best way to contact me is to use my email address which is present at the top of most calibre or kitty source code files.

unrardll's People

Contributors

eli-schwartz avatar keszybz avatar kovidgoyal avatar toddrme2178 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unrardll's Issues

Installation on Ubuntu 17.10 doesn't work

When I try pip install unrardll, I get this errors:

Collecting unrardll
  Downloading unrardll-0.1.3.tar.gz
Installing collected packages: unrardll
  Running setup.py install for unrardll ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIzbM3/unrardll/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrVYp_-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/unrardll
    copying src/unrardll/__init__.py -> build/lib.linux-x86_64-2.7/unrardll
    running build_ext
    building 'unrardll.unrar' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    creating build/temp.linux-x86_64-2.7/src/unrardll
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-l1RrwO/python2.7-2.7.14=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DSILENT=1 -DRARDLL=1 -DUNRAR=1 -D_UNIX=1 -I/usr/include/python2.7 -c src/unrardll/wrapper.cpp -o build/temp.linux-x86_64-2.7/src/unrardll/wrapper.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    src/unrardll/wrapper.cpp:19:10: fatal error: unrar/dll.hpp: Datei oder Verzeichnis nicht gefunden
     #include <unrar/dll.hpp>
              ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIzbM3/unrardll/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zrVYp_-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fIzbM3/unrardll/

what am I missing?

Tests fail when using a debug build of cpython.

eschwartz /tmp/unrardll $ ./.venv/bin/python setup.py test
running test
running build
running build_py
copying src/unrardll/__init__.py -> build/lib.linux-x86_64-cpython-311/unrardll
running build_ext
Modules/gcmodule.c:113: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x556e471ffa20
object refcount : 3
object type     : 0x7f0ea7d89700
object type name: type
object repr     : <class 'unrar.UNRARError'>

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized

Current thread 0x00007f0ea7ebe740 (most recent call first):
  Garbage-collecting
  File "/usr/lib/python3.11/collections/__init__.py", line 436 in namedtuple
  File "/tmp/unrardll/build/lib.linux-x86_64-cpython-311/unrardll/__init__.py", line 16 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 940 in exec_module
  File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1147 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
  File "/tmp/unrardll/test/test_basic.py", line 13 in <module>
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 940 in exec_module
  File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1147 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
  File "<frozen importlib._bootstrap>", line 1204 in _gcd_import
  File "/usr/lib/python3.11/importlib/__init__.py", line 126 in import_module
  File "/tmp/unrardll/setup.py", line 22 in find_tests
  File "/tmp/unrardll/setup.py", line 54 in run
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988 in run_command
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/dist.py", line 963 in run_command
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969 in run_commands
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201 in run_commands
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185 in setup
  File "/tmp/unrardll/.venv/lib/python3.11/site-packages/setuptools/__init__.py", line 103 in setup
  File "/tmp/unrardll/setup.py", line 86 in <module>

Extension modules: unrardll.unrar (total: 1)
Aborted (core dumped)

Originally reported at https://bugs.gentoo.org/923270

ERAR_BAD_PASSWORD is not handled

Hi!

I have a rar archive created with the latest RAR 6.22 -

$ unrar l /var/tmp/test.rar 

UNRAR 6.22 freeware      Copyright (c) 1993-2023 Alexander Roshal

Archive: /var/tmp/test.rar
Details: RAR 5

 Attributes      Size     Date    Time   Name
----------- ---------  ---------- -----  ----
*   .......         5  2023-06-30 12:04  test.txt
----------- ---------  ---------- -----  ----
                    5                    1

and when I try to do like unrardll.extract_member(file_path, lambda x: True, password) I got an exception

unrar.UNRARError: ERAR_BAD_PASSWORD

While with older archive like

$ unrar l LGsw55i.rar 

UNRAR 6.22 freeware      Copyright (c) 1993-2023 Alexander Roshal

Archive: LGsw55i.rar
Details: RAR 4, recovery record

it works as expected meant raise unrardll.BadPassword which I can handle.

except unrar.UNRARError as e:
m = e.args[0]
if m == 'ERAR_MISSING_PASSWORD':
raise PasswordRequired(archive_path)
if m == 'ERAR_BAD_DATA' and c.password_requested:
raise (BadPassword if c.pw else PasswordRequired)(archive_path)
raise

Would you add "ERAR_BAD_PASSWORD" into that logic?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.