mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 17:54:32 +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
|
import locale
|
||||||
locale_name,locale_id = locale.getlocale()
|
locale_lang,locale_enc = locale.getlocale()
|
||||||
b_whitespace = string.whitespace.decode(locale_id)
|
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')
|
b_whitespace = b_whitespace.encode('ascii','ignore')
|
||||||
|
|
||||||
MODES = {
|
MODES = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user