2014-06-10 13:10:47 +04:00
|
|
|
from helper import unittest, PillowTestCase, tearDownModule, lena
|
|
|
|
|
2013-07-09 09:16:25 +04:00
|
|
|
from PIL import Image
|
|
|
|
|
|
|
|
import locale
|
|
|
|
|
2014-06-03 14:02:44 +04:00
|
|
|
# ref https://github.com/python-pillow/Pillow/issues/272
|
2014-06-10 13:10:47 +04:00
|
|
|
# on windows, in polish locale:
|
2013-07-09 09:16:25 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
# import locale
|
|
|
|
# print locale.setlocale(locale.LC_ALL, 'polish')
|
|
|
|
# import string
|
|
|
|
# print len(string.whitespace)
|
|
|
|
# print ord(string.whitespace[6])
|
2013-07-09 09:16:25 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
# Polish_Poland.1250
|
|
|
|
# 7
|
|
|
|
# 160
|
2013-07-09 09:16:25 +04:00
|
|
|
|
2014-06-03 14:02:44 +04:00
|
|
|
# one of string.whitespace is not freely convertable into ascii.
|
2013-07-09 09:16:25 +04:00
|
|
|
|
2014-06-23 10:19:29 +04:00
|
|
|
path = "Tests/images/lena.jpg"
|
2013-07-09 09:16:25 +04:00
|
|
|
|
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
class TestLocale(PillowTestCase):
|
|
|
|
|
|
|
|
def test_sanity(self):
|
|
|
|
Image.open(path)
|
|
|
|
try:
|
|
|
|
locale.setlocale(locale.LC_ALL, "polish")
|
|
|
|
except:
|
|
|
|
unittest.skip('Polish locale not available')
|
|
|
|
Image.open(path)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
|
|
|
|
# End of file
|