Giter VIP home page Giter VIP logo

Comments (6)

julian-smith-artifex-com avatar julian-smith-artifex-com commented on July 2, 2024

I haven't been able to reproduce this, but according to https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe#30313091, pythonw.exe does not provide stdout or stderr, and attempting to write to them may cause an exception.

Certainly the PDF file you are using causes PyMuPDF to generate a warning diagnostic on stdout or stderr, so i think this may be causing the exception when run by pythonw.exe.

Is there any particular reason why you are using pythonw.exe here?

from pymupdf.

wz93672 avatar wz93672 commented on July 2, 2024

I have a GUI application packed with pyinstaller, for sorting, counting, merging documents from different sources.
It was my guess too, that a warning and lack of stdout/stderr could cause that error, I can escape and pass it, but I have done sanity check and tried the example in a different environment. Didn't get the SystemError with python 3.10.11 and pymupdf 1.23.0. And I made mistake yesterday, I'm using python 3.11.9 currently, not 3.12.

from pymupdf.

julian-smith-artifex-com avatar julian-smith-artifex-com commented on July 2, 2024

I'm still struggling to reproduce the original problem, even using python-3.11 on windows. But i have found that print() copes even if sys.stdout is None.

In the meantime there's another open issue about use with pyinstaller, which has lead to some changes to make all diagnostics go through python print(), instead of variously being generated with sys.stderr.write(), PySys_WriteStdout() etc.

It's possible that these changes may help with this issue. But as i can't reproduce it, i think we'll have to wait for you to test a future release.

from pymupdf.

wz93672 avatar wz93672 commented on July 2, 2024

ok.

I've checked different pymupdf versions in fresh venvs. The error appears with new pymupdf implementation in 1.23.9, python version doesn't matter.

from pymupdf.

wz93672 avatar wz93672 commented on July 2, 2024

Fixed in 1.24.4. Thanks.

from pymupdf.

julian-smith-artifex-com avatar julian-smith-artifex-com commented on July 2, 2024

That's great, thanks for reporting.

from pymupdf.

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.