Comments (10)
Seems related to #47244
from sdk.
I suspect the archive itself is corrupt or somehow non-standard. On macos, I see:
Closing as I think the issue is with the archive and not the GZipCodec
class. If on further investigation of the archive you believe its well-formed / something GZipCodec should parse, please re-open.
from sdk.
@devoncarew I updated the file. Now it opens with the standard macos archive utility. Could you check it again?
from sdk.
//cc @brianquinlan
from sdk.
I can repro. Python is able to decompress this file:
>>> s = open('test.csv.gz', 'rb').read()
>>> import gzip
>>> t = gzip.decompress(s)
>>> len(t)
68541
The bytes that Dart actually decodes are:
>>> x = [105, 100, 83, 117, 98, 67, 97, 109, 112, 97, 105, 103, 110, 84, 105, 116, 108, 101, 44, 105, 100, 83, 117, 98, 65, 100, 83, 101, 116, 84, 105, 116, 108, 101, 44, 105, 100, 83, 117, 98, 67, 97, 109, 112, 97, 105, 103, 110, 44, 105, 100, 67, 97, 109, 112, 97, 105, 103, 110, 84, 105, 116, 108, 101, 10]
>>> bytes(x)
b'idSubCampaignTitle,idSubAdSetTitle,idSubCampaign,idCampaignTitle\n'
Which is the first line of the file. If I understand correctly, the GZIP file format consists of concatenated compressed data sets. So maybe we are only decoding the first data set?
from sdk.
I get the same output as Dart when use the zpipe example after changing:
- ret = inflateInit(&strm);
+ ret = inflateInit2(&strm, 32 + 15);
The Python implementation looks very similar to ours.
from sdk.
If I extract the file and recompress it with gzip, both Dart and zpipe and decompress the file. How did you generate this archive?
from sdk.
@brianquinlan This archive is from raw data export API response of https://docs.tracker.my.com/api/export-api/raw/about
from sdk.
Yep. OK, I missed that Python deals with gzip data starting in Python code:
https://github.com/python/cpython/blob/fc21c7f7a731d64f7e4f0e82469f78fa9c104bbd/Lib/gzip.py#L622
I also found an example on how to handle concatenated gzip streams in C from Mark Adler himself:
https://stackoverflow.com/questions/17820664/is-this-a-bug-in-this-gzip-inflate-method/17822217#17822217
from sdk.
I have a straightforward fix for this but it will take a while for me to convince myself that it always works.
from sdk.
Related Issues (20)
- [dart2wasm] Port the recent VM JSON optimizations to dart2wasm HOT 2
- [dart2wasm] Attempt to execute code removed by Dart AOT compiler (TFA) HOT 13
- Analyzer Feedback from IntelliJ
- :memo: Requests for Dart refactorings
- [vm][cfe][frontend_server] Make "native_assets.yaml" reusable
- Option to disable implicit type checks without minification when compiling to JS HOT 1
- Verify that TFA inferred types are as specific as Dart types
- New TargetTypes for `@doNotStore`?
- [dartdev] Fails to report VM service URL on Windows when run from different drive HOT 7
- dart fix crash in [email protected]+0x14e HOT 2
- ☂️ [vm/ffi] Multi language debugging
- [resource_identifiers] Record constructors
- [resource_identifier] Extension types
- [breaking change] Add `Random.fillBytes` method. HOT 6
- [CP] Fix WASM error caused by incorrect return type HOT 6
- Do data classes require code gen? HOT 4
- dart2wasm fails inside sync* functions with a switch statement HOT 6
- Analyzer Feedback from IntelliJ
- Analyzer Feedback from IntelliJ
- Analyzer quick-fix: Add import with `show`.
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 sdk.