Coder Social home page Coder Social logo

Comments (5)

goulu avatar goulu commented on May 18, 2024

can anyone add a test to reproduce this please ? thanks !

from pdfminer.six.

bittner avatar bittner commented on May 18, 2024

@johnsonice It looks like the error message is incomplete. Can you add the missing pieces, and fix the markup using ``` python (which starts a multiline code block)?

from pdfminer.six.

marine9357 avatar marine9357 commented on May 18, 2024

I'm trying to do it as well, here's the error I get :

File "C:\Users\Marine\Anaconda3\lib\site-packages\pdfminer\tools\pdf2txt.py", line 114, in main 
    interpreter.process_page(page)
File "C:\Users\Marine\Anaconda3\lib\site-packages\pdfminer\pdfinterp.py", line 851, in process_page 
    self.device.begin_page(page, ctm)
File "C:\Users\Marine\Anaconda3\lib\site-packages\pdfminer\pdfdevice.py", line 155, in begin_page 
    self.outfp.write(utils.make_compat_bytes(output))
TypeError: write() argument must be str, not bytes

I launched the command like this :

pdf2txt.py -c UTF-8 -o artscient -t tag structure_article_scientifique.pdf

Could it be a problem with the codec value? I also tried to remove the codec parameter, the same error appears.

from pdfminer.six.

TamasNeumer avatar TamasNeumer commented on May 18, 2024

Having the same issue both on python2 and python3.6

from pdfminer.six.

pietermarsman avatar pietermarsman commented on May 18, 2024

Closing this because there is nothing reproducible. Feel free to reopen if the problem still exists.

I've tested if the function behaves correctly on Python3.7 and it does.

class TestCompatStr():
    def test_bytes(self):
        s = 'Hello World!'
        b = s.encode()
        ret = make_compat_str(b)
        assert_equal(s, ret)

    def test_str(self):
        s = 'Hello World!'
        ret = make_compat_str(s)
        assert_equal(s, ret)

from pdfminer.six.

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.