Skip to content
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

ImageCms.getOpenProfile does not support Unicode path #4897

Closed
fireattack opened this issue Sep 2, 2020 · 1 comment · Fixed by #4914
Closed

ImageCms.getOpenProfile does not support Unicode path #4897

fireattack opened this issue Sep 2, 2020 · 1 comment · Fixed by #4914
Labels

Comments

@fireattack
Copy link

fireattack commented Sep 2, 2020

What did you do?

I tried to load an ICC file from a non-Latin path.

What did you expect to happen?

It should load the profile.

What actually happened?

It throws

F:\sync\code\python\_gists>_test.py
Traceback (most recent call last):
  File "C:\Program Files\Python3\lib\site-packages\PIL\ImageCms.py", line 395, in getOpenProfile
    return ImageCmsProfile(profileFilename)
  File "C:\Program Files\Python3\lib\site-packages\PIL\ImageCms.py", line 162, in __init__
    self._set(core.profile_open(profile), profile)
OSError: cannot open profile file

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "F:\sync\code\python\_gists\_test.py", line 3, in <module>
    lsrgb_profile = ImageCms.getOpenProfile('D:\\新\\sRGB.icc')
  File "C:\Program Files\Python3\lib\site-packages\PIL\ImageCms.py", line 397, in getOpenProfile
    raise PyCMSError(v) from v
PIL.ImageCms.PyCMSError: cannot open profile file

What are your OS, Python and Pillow versions?

  • OS: Win7x64
  • Python: 3.8.5 x64
  • Pillow: 7.2.0
from PIL import Image, ImageCms

lsrgb_profile = ImageCms.getOpenProfile('D:\\\\sRGB.icc')

Similar and fixed issue: #3145

@fireattack fireattack changed the title ImageCms.getOpenProfile does not support Unicdoe path ImageCms.getOpenProfile does not support Unicode path Sep 2, 2020
@radarhere
Copy link
Member

I've created PR #4914 to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants