Giter Site home page Giter Site logo

Comments (3)

ikreymer avatar ikreymer commented on May 26, 2024

Looks like this is related to to the Content-Disposition re-encoding that warcio is doing...

But what is it that you're trying to do.. remove the non-ascii headers altogether?
I believe to_ascii_bytes() already catches encoding errors, so that should not throw.

The issue you have can actually just be reproed with just:

with open(warcfilebasename + ".warc", 'rb') as f_in:
        with open(warcfilebasename + ".warc.gz", 'wb') as f_out:
            writer = WARCWriter(f_out, gzip=True)
            for record in ArchiveIterator(f_in):
                writer.write_record(record)

The issue happens because:

Content-Disposition: attachment; filename="BIZKAIKO-AIZKORA-TXAPELKETA-2ยช-eus.pdf";

is canonicalized to:

Content-Disposition: attachment; filename*=UTF-8''BIZKAIKO-AIZKORA-TXAPELKETA-2%C2%AA-eus.pdf;

automatically, but for some reason the size is not adjusted.
This happens during the write_record, the iterator does not do the adjustment on read.
It should adjust the size though.

from warcio.

ikreymer avatar ikreymer commented on May 26, 2024

Now fixed on develop, thanks!

from warcio.

ikreymer avatar ikreymer commented on May 26, 2024

and deployed in 1.7.2

from warcio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.