New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with readonly image files #352

Closed
ashkar007 opened this Issue May 10, 2016 · 5 comments

Comments

2 participants
@ashkar007

Hi,
I am using XlsxWriter to generate excel sheets. I insert an image file into the spreadsheet using worksheet.insert_image(). The image file is read-only (retrieved from source control system). xlsxwriter copies the image into temp folder (thus the r/o attribute is also copied). Then, when workbook.close() is called, it throws an Access denied error when trying to clean up the temporary image file. If I manually change the r/o attribute of the temporary file, it works fine.
Please fix as you see appropriate.
Thanks

@jmcnamara jmcnamara changed the title from Issue with Image files during workbook.close() to Issue with readonly image files May 10, 2016

@jmcnamara jmcnamara added the bug label May 10, 2016

@jmcnamara jmcnamara self-assigned this May 10, 2016

@jmcnamara

This comment has been minimized.

Show comment
Hide comment
@jmcnamara

jmcnamara May 10, 2016

Owner

Thanks for the report. I'll look into it.

Owner

jmcnamara commented May 10, 2016

Thanks for the report. I'll look into it.

@jmcnamara

This comment has been minimized.

Show comment
Hide comment
@jmcnamara

jmcnamara May 10, 2016

Owner

What OS are you using and what are the permissions on the file?

Owner

jmcnamara commented May 10, 2016

What OS are you using and what are the permissions on the file?

@ashkar007

This comment has been minimized.

Show comment
Hide comment
@ashkar007

ashkar007 May 10, 2016

Sorry, I should have put these details in the first post.
I'm using Windows 7. Turn Read-Only flag on/off on the image file (through windows gui) to replicate the issue.

import xlsxwriter as xl

def main():
    wb = xl.Workbook(r'C:\Temp\demoXL.xlsx')
    sht = wb.add_worksheet('Demo')
    sht.insert_image(0, 0, r'C:\Temp\logo.png')
    wb.close()

if __name__ == '__main__':
    main()

Sorry, I should have put these details in the first post.
I'm using Windows 7. Turn Read-Only flag on/off on the image file (through windows gui) to replicate the issue.

import xlsxwriter as xl

def main():
    wb = xl.Workbook(r'C:\Temp\demoXL.xlsx')
    sht = wb.add_worksheet('Demo')
    sht.insert_image(0, 0, r'C:\Temp\logo.png')
    wb.close()

if __name__ == '__main__':
    main()

jmcnamara added a commit that referenced this issue May 10, 2016

@jmcnamara

This comment has been minimized.

Show comment
Hide comment
@jmcnamara

jmcnamara May 10, 2016

Owner

I've pushed a fix to the master branch for this issue if you would like to try it.

Owner

jmcnamara commented May 10, 2016

I've pushed a fix to the master branch for this issue if you would like to try it.

@jmcnamara

This comment has been minimized.

Show comment
Hide comment
@jmcnamara

jmcnamara May 14, 2016

Owner

Fixed in version 0.8.7: https://xlsxwriter.readthedocs.io/changes.html

Thanks for the report.

Owner

jmcnamara commented May 14, 2016

Fixed in version 0.8.7: https://xlsxwriter.readthedocs.io/changes.html

Thanks for the report.

@jmcnamara jmcnamara closed this May 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment