Comments (11)
What type of debugger do you use, Python- or C-level? This line calls into the C extension to perform the AES decryption, which then for some reason fails for you.
Decryption is also done in the test_encrypted_password
testcase - does that work for you, or does it also crash (you can comment the crashing test_encrypted_names_password
to skip it)?
Unfortunately I don't have a way to reproduce this yet.
from pylzma.
I am using pydevd as a debugger. I don't know C well enough to do a debug build. Sorry.
Four unittests all fail at the same line (698 in py7zlib.py) as listed above:
test_encrypted_password
test_encrypted_wong_password
test_encrypted_names_password
test_encrypted_names_wong_password
I am not sure if this has anything to do with it (I doubt it), but during the build I get a command line warning D9025L overriding '/MD' with '/MT' for each c file.
from pylzma.
I probably found the issue. Could you please check 2f48f6b to see if that fixes your problem?
from pylzma.
The build now fails:
pylzma_aes.c
src/pylzma/pylzma_aes.c(58) : error C2143: syntax error : missing ';' before 'type'
src/pylzma/pylzma_aes.c(59) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(60) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(120) : error C2143: syntax error : missing ';' before 'type'
src/pylzma/pylzma_aes.c(121) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(122) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(144) : error C2061: syntax error : identifier 'aesdecrypt_methods'
src/pylzma/pylzma_aes.c(144) : error C2059: syntax error : ';'
src/pylzma/pylzma_aes.c(144) : error C3409: empty attribute block is not allowed
src/pylzma/pylzma_aes.c(144) : error C2513: '/global/ ' : no variable declared before '='
src/pylzma/pylzma_aes.c(178) : error C2065: 'aesdecrypt_methods' : undeclared identifier
src/pylzma/pylzma_aes.c(178) : error C2099: initializer is not a constant
src/pylzma/pylzma_aes.c(186) : warning C4047: 'initializing' : 'Py_ssize_t' differs in levels of indirection from 'initproc'
error: command 'C:\Users\Ken User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status
2
But thanks for your efforts.
from pylzma.
Oh right, the MS compiler is a bit picky about variables in C code... Should hopefully work now.
from pylzma.
Builds and passes unittests now. Thanks!
However, I'm still getting an error trying to decompress a password protected file created by a recent version of 7z. Same as documented:#26
My real question is: Is it possible to create a compatible, password protected 7z file using this library with Python?
from pylzma.
Hmm, the test_encrypted_names_XXX
unittests use a file that was created using the same command you described in #26. Could you please provide a (small) failing sample file together with the password, so I can fix the issue and add it to the test suite?
from pylzma.
I tried and found that the errors that I am experiencing seem to have to do with problems surrounding an EOF error. This could be specific to windows.
Here is some code that I am using to try to troubleshoot:
This code demonstrates that the file contents that py7zlib reads in is not the same as what was written to the 7z file. When I run it at line 90 the string that is read in is not as the same as what was written - it is truncated. Then the pickle fails to load with an EOF error.
An example 7z files is here:
https://www.dropbox.com/s/xdhlxfg7g6563p7/info7.7z?dl=0
This may seem to be unrelated to my original statements above, but I believe it is the same issue. I just restructured the code so that the error is more obvious.
from pylzma.
Thanks, that example helped. For some cases, encrypted data was not truncated correctly.
from pylzma.
Thanks very much. All working as expected now.
from pylzma.
I'm not sure if it's bad etiquette to raise a related issue in a closed issue, so please forgive me if it is.
If I change the command line in the previous code in pastebin to include the -mhe
switch to encrypt headers, I get an 'invalid block data error' from Archive7z.__init__()
in py7zlib.py.
In what may be a side note, in class Header.__init__()
in the line self.properties = ArchiveProperties(file)
, ArchiveProperties
is not defined in py7zlib.py.
Thanks again for all of your help.
from pylzma.
Related Issues (20)
- Bugs Report : Incorrect stream properties
- Data error during extraction HOT 20
- Feature request: read 7zip file line by line HOT 1
- py7zlib fails with `IndexError: list index out of range` when opening specific 7z archive HOT 13
- py7zlib fails when decompressing lzma2 bcj2 7z file HOT 2
- Feature: py7zlib: archive file mode and format API HOT 2
- Can't decompress the lzma1900.7z file using py7zlib.Archive7z HOT 1
- py7zlib: _read64Bit() returns None when reading bytes start with 0xff HOT 1
- Incorrect stream properties (TypeError) while trying to decompress HOT 1
- How read a 7z file with volumes?
- Do not automatically skip directory entries
- Feature: Add support for streaming ArchiveFiles HOT 2
- Hope to achieve the function of encryption
- Recent important updates not on pypi HOT 2
- Requested pylzma==0.5.0 but installing version is 0.5.0.post0 HOT 1
- index error
- python2 syntax in test_usage.py
- "pip instal pylzma" not working
- Building FreeBSD port archivers/py-lzma fails with error
- compliation fails on OpenBSD 7.3 / Python 3.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylzma.