Merge pull request #3537 from radarhere/pickle

Fixed pickling of iTXt class with protocol > 1
This commit is contained in:
Hugo 2019-02-20 11:50:30 +02:00 committed by GitHub
commit 65c55402b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -67,9 +67,13 @@ class TestPickle(PillowTestCase):
"Tests/images/non_zero_bb.png",
"Tests/images/non_zero_bb_scale2.png",
"Tests/images/p_trns_single.png",
"Tests/images/pil123p.png"
"Tests/images/pil123p.png",
"Tests/images/itxt_chunks.png"
]:
self.helper_pickle_string(pickle, test_file=test_file)
for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
self.helper_pickle_string(pickle,
protocol=protocol,
test_file=test_file)
def test_pickle_l_mode(self):
# Arrange

View File

@ -194,7 +194,7 @@ class iTXt(str):
"""
@staticmethod
def __new__(cls, text, lang, tkey):
def __new__(cls, text, lang=None, tkey=None):
"""
:param cls: the class to use when creating the instance
:param text: value for this key