mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Update PpmImagePlugin.py
Bug fix when locale has not been set
This commit is contained in:
parent
20e7555e59
commit
800729e092
|
@ -25,8 +25,10 @@ from PIL import Image, ImageFile
|
|||
# --------------------------------------------------------------------
|
||||
|
||||
import locale
|
||||
locale_name,locale_id = locale.getlocale()
|
||||
b_whitespace = string.whitespace.decode(locale_id)
|
||||
locale_lang,locale_enc = locale.getlocale()
|
||||
if locale_enc is None:
|
||||
locale_lang,locale_enc = locale.getdefaultlocale()
|
||||
b_whitespace = string.whitespace.decode(locale_enc)
|
||||
b_whitespace = b_whitespace.encode('ascii','ignore')
|
||||
|
||||
MODES = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user