Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c_ssize_t undefined #5

Open
tripleee opened this issue Jun 29, 2015 · 0 comments
Open

c_ssize_t undefined #5

tripleee opened this issue Jun 29, 2015 · 0 comments

Comments

@tripleee
Copy link

I am unable to import the library on Python 2.6.6.

(.env)[0] 09:31:14 tripleee@sow:/tmp$ git clone https://github.com/dsoprea/PyEasyArchive.git
Cloning into PyEasyArchive...
remote: Counting objects: 367, done.
remote: Total 367 (delta 0), reused 0 (delta 0), pack-reused 367
Receiving objects: 100% (367/367), 23.01 MiB | 5.14 MiB/s, done.
Resolving deltas: 100% (198/198), done.

(.env)[0] 09:31:28 tripleee@sow:/tmp$ cd PyEasyArchive/

(.env)[0] 09:31:44 tripleee@sow:/tmp/PyEasyArchive$ nosetests
EE
======================================================================
ERROR: Failure: NameError (name 'c_ssize_t' is not defined)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/loader.py", line 414, in loadTestsFromName
    addr.filename, addr.module)
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/PyEasyArchive/tests/test_create.py", line 5, in <module>
    import libarchive.public
  File "/tmp/PyEasyArchive/libarchive/public.py", line 1, in <module>
    from libarchive.adapters.archive_read import \
  File "/tmp/PyEasyArchive/libarchive/adapters/archive_read.py", line 7, in <module>
    import libarchive.calls.archive_read
  File "/tmp/PyEasyArchive/libarchive/calls/archive_read.py", line 4, in <module>
    from libarchive.types.archive import *
  File "/tmp/PyEasyArchive/libarchive/types/archive.py", line 3, in <module>
    ARCHIVE_WRITE_CALLBACK = CFUNCTYPE(c_ssize_t, c_void_p, c_void_p, POINTER(c_void_p), c_size_t)
NameError: name 'c_ssize_t' is not defined
-------------------- >> begin captured logging << --------------------
libarchive.library: DEBUG: Using library: [libarchive.so]
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: Failure: NameError (name 'c_ssize_t' is not defined)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/loader.py", line 414, in loadTestsFromName
    addr.filename, addr.module)
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/var/tmp/.env/lib/python2.6/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/PyEasyArchive/tests/test_read.py", line 5, in <module>
    import libarchive.public
  File "/tmp/PyEasyArchive/libarchive/public.py", line 1, in <module>
    from libarchive.adapters.archive_read import \
  File "/tmp/PyEasyArchive/libarchive/adapters/archive_read.py", line 7, in <module>
    import libarchive.calls.archive_read
  File "/tmp/PyEasyArchive/libarchive/calls/archive_read.py", line 4, in <module>
    from libarchive.types.archive import *
  File "/tmp/PyEasyArchive/libarchive/types/archive.py", line 3, in <module>
    ARCHIVE_WRITE_CALLBACK = CFUNCTYPE(c_ssize_t, c_void_p, c_void_p, POINTER(c_void_p), c_size_t)
NameError: name 'c_ssize_t' is not defined

----------------------------------------------------------------------
Ran 2 tests in 0.046s

FAILED (errors=2)

Incidentally, e.g. http://nullege.com/codes/search/ctypes.c_ssize_t seems to suggest using the following idiom;

try:
    from ctypes import c_ssize_t
except ImportError:
    from ctypes import c_longlong as c_ssize_t

With that, I am able to get slightly further in loading the library, but not enough to actually use it.

candycanejane pushed a commit to candycanejane/PyEasyArchive that referenced this issue May 31, 2017
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

No branches or pull requests

1 participant