Summary: | Passing file objects to pycairo results in blank file on Windows | ||
---|---|---|---|
Product: | pycairo | Reporter: | rei4dan |
Component: | general | Assignee: | Steve Chaplin <d74n5pohf9> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | Windows (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Example script demonstrating the issue with file objects
Example output file on Windows Example output file on Linux segmentation fault under Linux |
Description
rei4dan
2010-08-15 03:28:29 UTC
Created attachment 37884 [details]
Example output file on Windows
Created attachment 37885 [details]
Example output file on Linux
pycairo 1.8.10 is the current version - try this version and see if the problems are still there. Could you provide a test case for the Linux segmentation fault. For PDFSurface, write_to_png() (and nearly all other functions) pycairo uses the same code for Linux and Windows. So if something works in Linux and not Windows its unlikely to be a problem in pycairo, and more likely a problem in the specific Windows code in the cairo C library. Try surface.flush() surface.finish() f.close() in that order (flush before finish) - does that work? Which combinations of the 3 work, and do not work? Created attachment 38680 [details]
segmentation fault under Linux
(In reply to comment #3) > pycairo 1.8.10 is the current version - try this version and see if the > problems are still there. I'll try to build and test that, but building it on Win is a pain. > Could you provide a test case for the Linux segmentation fault. This problem is still present in 1.8.10. > For PDFSurface, write_to_png() (and nearly all other functions) pycairo uses > the same code for Linux and Windows. So if something works in Linux and not > Windows its unlikely to be a problem in pycairo, and more likely a problem in > the specific Windows code in the cairo C library. > > Try > surface.flush() > surface.finish() > f.close() > in that order (flush before finish) - does that work? > Which combinations of the 3 work, and do not work? None of the combinations work. The problem with unicode filenames has been fixed, and changes applied to the git repo. For the Windows problem, use f = open("example.pdf","wb") # write in binary mode |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.