was able to test on Linux successfully (7z v23+). fixed extracting of encrypted archives.#5
was able to test on Linux successfully (7z v23+). fixed extracting of encrypted archives.#5cielavenir wants to merge 19 commits into
Conversation
|
@harvimt ping? |
|
just for my info: 7zip 23+ is incompatible with CDEF_IUnknown patch. |
|
I thought I had already commented this, but to other's who are seeing this in searches or whatever, the reason this isn't merged is the way it's written it drops support for Windows... this was originally intended as a Windows-only project. I'm not opposed to adding Linux support, but the same code needs to work on Linux and Windows. Also I'm not really working on this project anymore, but people do seem to find it useful as an example if nothing else. |
|
Thank you for the comment~ After my company moves to Debian 13, 7z.so will become v24 and I will be able to remove CDEF_IUnknown patch and Windows can work with the same code |
|
will start annotation |
| suffixes = '', '7z.so', 'p7zip/7z.so' | ||
| prefixes = ['/lib', '/usr/lib'] | ||
| suffixes = '7z.so', '7zip/7z.so' | ||
| prefixes = ['/lib', '/usr/lib', '/usr/local/lib', '/usr/libexec', '/home/linuxbrew/.linuxbrew/lib', '/opt/local/lib', '/sw/lib'] |
There was a problem hiding this comment.
- 7zip v23+ is required, so p7zip should be removed
- adding path is encouraged to support multiple installation
| if pvar.vt == wintypes.VT_BSTR and pvar.bstrVal != ffi.NULL: | ||
| C.free(pvar.bstrVal) | ||
| if pvar.vt == wintypes.VARTYPE.VT_BSTR and pvar.bstrVal != ffi.NULL: | ||
| C.free( ffi.cast('char*',pvar.bstrVal)-4 ) |
There was a problem hiding this comment.
Exception ignored from callback for ffi.gc <cdata 'void *' 0x41a4a7d0>:
Traceback (most recent call last):
File "/devel/pylib7zip/lib7zip/winhelpers.py", line 78, in dealloc_propvariant
free_propvariant(pvar)
File "/devel/pylib7zip/lib7zip/__init__.py", line 68, in free_propvariant
if pvar.vt == wintypes.VT_BSTR and pvar.bstrVal != ffi.NULL:
AttributeError: module 'lib7zip.wintypes' has no attribute 'VT_BSTR'
| log.debug('initializing') | ||
| formats = get_format_info() | ||
| max_sig_size = max(len(f.start_signature) for f in formats.values()) | ||
| max_sig_size = max(len(f.start_signature or '') for f in formats.values()) |
There was a problem hiding this comment.
TypeError: object of type 'NoneType' has no len()
some formats have start_signature None
| kExtract = 0 | ||
| kTest = 1 | ||
| kSkip = 2 No newline at end of file | ||
| kSkip = 2 |
There was a problem hiding this comment.
TypeError: %d format: a real number is required, not AskMode
| def close(self): | ||
| log.debug('Archive.close()') | ||
| if self.archive or self.archive.vtable or self.archive.vtable.Close == ffi.NULL: | ||
| if self.archive is None or self.archive.vtable is None or self.archive.vtable.Close == ffi.NULL: |
There was a problem hiding this comment.
2026-04-30 11:06:19,174 lib7zip [DEBUG] [archive.py:104 close] Archive.close()
Exception ignored in: <function Archive.__del__ at 0x7fb50e0e6700>
Traceback (most recent call last):
File "/devel/pylib7zip/lib7zip/archive.py", line 101, in __del__
File "/devel/pylib7zip/lib7zip/archive.py", line 105, in close
AttributeError: 'NoneType' object has no attribute 'vtable'
| ) | ||
| for i in range(num_formats[0]) | ||
| } | ||
| return retdict |
There was a problem hiding this comment.
with
'zip': Format(classid=UUID('23170f69-40c1-278a-1000-000110010000'), extensions=('zip', 'z01', 'zipx', 'jar', 'xpi', 'odt', 'ods', 'docx', 'xlsx', 'epub', 'ipa', 'apk', 'appx'), index=59, start_signature=b'PK\x03\x04')
without
'zip': Format(classid=UUID('23170f69-40c1-278a-1000-000110010000'), extensions=('zip', 'z01', 'zipx', 'jar', 'xpi', 'odt', 'ods', 'docx', 'xlsx', 'epub', 'ipa', 'apk', 'appx'), index=59, start_signature=None)
|
|
||
| log.debug('starting extract of %s!', self.path) | ||
| RNOK(self.archive.archive.vtable.Extract(self.archive.archive, ffi.NULL, 0xFFFFFFFF, 0, callback_inst)) | ||
| RNOK(self.archive.archive.vtable.Extract(self.archive.archive, indices, 1, 0, callback_inst)) |
There was a problem hiding this comment.
to avoid lib7zip::GetStream @ extract_callback.py:163 - DEBUG - index not found log
| elif vt == VARTYPE.VT_FILETIME: | ||
| timestamp = int(pvar.filetime.dwLowDateTime) | ||
| timestamp += int(pvar.filetime.dwLowDateTime) << 32 | ||
| timestamp += int(pvar.filetime.dwHighDateTime) << 32 |
There was a problem hiding this comment.
obvious, was unfortunate that dwLowDateTime was used instead of dwHighDateTime
|
@harvimt diff annotation (each error message) completed. also now password is supported~~ |
Debian GNU/Linux 13
7z.so Version 25.01
On macOS/Linux, v23 is required. Windows works with both v22 and v23.