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

the zipfile cpython module does not work #4

Open
williamstein opened this issue Sep 7, 2022 · 1 comment
Open

the zipfile cpython module does not work #4

williamstein opened this issue Sep 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@williamstein
Copy link
Contributor

It fails all tests in the test suite, and trying to use zipfile to make a simple zip file results in a broken empty zip.

I'm extra motivated to fix this so that the asset bundling code for the standard cpython library can run as 100% WASM, rather than having to use python-native.

@williamstein williamstein added the bug Something isn't working label Sep 7, 2022
@williamstein
Copy link
Contributor Author

UPDATE. Right now a lot of tests pass, but also many fail. Unzip does seem to work.

Here is a simple example illustrating that creating a zip file is broken as before. The size of the entry is wrong.

~/cowasm/packages/cpython$ python-wasm
Python 3.11.0 (main, Oct 27 2022, 10:03:11) [Clang 15.0.3 ([email protected]:ziglang/zig-bootstrap.git 0ce789d0f7a4d89fdc4d9571 on wasi
Type "help", "copyright", "credits" or "license" for more information.
>>> import zipfile; zipfile.ZipFile('spam.zip', 'w').write('README.md')
>>> ^D
~/cowasm/packages/cpython$ ls -l spam.zip
-rw-r--r--  1 wstein  staff  1896 Oct 30 14:16 spam.zip
~/cowasm/packages/cpython$ mkdir x
~/cowasm/packages/cpython$ cd x
~/cowasm/packages/cpython/x$ unzip ../spam.zip 
Archive:  ../spam.zip
README.md:  ucsize 1780 <> csize 0 for STORED entry
         continuing with "compressed" size value
 extracting: README.md               
~/cowasm/packages/cpython/x$ more README.md 
~/cowasm/packages/cpython/x$ 
~/cowasm/packages/cpython/x$ ls -l README.md 
-rwx------  1 wstein  staff  0 Sep 20 21:26 README.md
~/cowasm/packages/cpython/x$ 

@williamstein williamstein transferred this issue from sagemathinc/cowasm Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant