[KoCo-CVS] [Commit] KoreanCodecs/korean/python euc_kr.py iso_2022_kr.py johab.py qwerty2bul.py unijo
Brought to you by:
perky
From: Chang <pe...@us...> - 2002-07-13 05:44:23
|
perky 02/07/12 22:44:21 Modified: korean/python euc_kr.py iso_2022_kr.py johab.py qwerty2bul.py unijohab.py Log: (MFJapaneseCodecs) Raise a ValueError instead of UnicodeError if their optional argument "errors" has an invalid value. Revision Changes Path 1.6 +3 -3 KoreanCodecs/korean/python/euc_kr.py Index: euc_kr.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/euc_kr.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- euc_kr.py 5 May 2002 19:13:57 -0000 1.5 +++ euc_kr.py 13 Jul 2002 05:44:21 -0000 1.6 @@ -1,7 +1,7 @@ # Hye-Shik Chang <16 Feb 2002> # originally written by Tamito KAJIYAMA # -# $Id: euc_kr.py,v 1.5 2002/05/05 19:13:57 perky Exp $ +# $Id: euc_kr.py,v 1.6 2002/07/13 05:44:21 perky Exp $ import codecs @@ -17,7 +17,7 @@ global encmap_ideo, encmap_misc if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] for c in data: @@ -52,7 +52,7 @@ global decmap_ideo, decmap_misc if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] data = str(data) # character buffer compatible object 1.9 +3 -3 KoreanCodecs/korean/python/iso_2022_kr.py Index: iso_2022_kr.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/iso_2022_kr.py,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- iso_2022_kr.py 5 May 2002 19:13:57 -0000 1.8 +++ iso_2022_kr.py 13 Jul 2002 05:44:21 -0000 1.9 @@ -1,7 +1,7 @@ # A codec for ISO-2022-KR [RFC1557] # by Hye-Shik Chang <17 February 2002> # -# $Id: iso_2022_kr.py,v 1.8 2002/05/05 19:13:57 perky Exp $ +# $Id: iso_2022_kr.py,v 1.9 2002/07/13 05:44:21 perky Exp $ import codecs from korean.mappings import ksc5601_hangul @@ -33,7 +33,7 @@ global encmap_ideo, encmap_misc if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] new_charset = charset = US_ASCII new_shiftstate = shiftstate = 0 @@ -93,7 +93,7 @@ global decmap_ideo, decmap_misc if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] data = str(data) # character buffer compatible object size = len(data) 1.7 +3 -3 KoreanCodecs/korean/python/johab.py Index: johab.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/johab.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- johab.py 5 May 2002 19:13:58 -0000 1.6 +++ johab.py 13 Jul 2002 05:44:21 -0000 1.7 @@ -1,5 +1,5 @@ # Hye-Shik Chang <16 Feb 2002> -# $Id: johab.py,v 1.6 2002/05/05 19:13:58 perky Exp $ +# $Id: johab.py,v 1.7 2002/07/13 05:44:21 perky Exp $ import codecs @@ -48,7 +48,7 @@ global encmap if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] for c in data: @@ -82,7 +82,7 @@ global decmap if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" buffer = [] data = str(data) # character buffer compatible object 1.7 +3 -3 KoreanCodecs/korean/python/qwerty2bul.py Index: qwerty2bul.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/qwerty2bul.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- qwerty2bul.py 5 May 2002 19:13:58 -0000 1.6 +++ qwerty2bul.py 13 Jul 2002 05:44:21 -0000 1.7 @@ -1,5 +1,5 @@ # Hye-Shik Chang <16 Feb 2002> -# $Id: qwerty2bul.py,v 1.6 2002/05/05 19:13:58 perky Exp $ +# $Id: qwerty2bul.py,v 1.7 2002/07/13 05:44:21 perky Exp $ import codecs from korean.hangul import Moeum, Jaeum, Chosung, Jungsung, Jongsung @@ -144,7 +144,7 @@ # Unicode to key stroke def encode(self, data, errors='strict'): if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" r = [] for c in data: @@ -162,7 +162,7 @@ # key stroke to Unicode def decode(self, data, errors='strict'): if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" s = unicode(data, self.BASECODEC, errors) am = Automata_Hangul2() 1.6 +3 -3 KoreanCodecs/korean/python/unijohab.py Index: unijohab.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/unijohab.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- unijohab.py 5 May 2002 19:13:58 -0000 1.5 +++ unijohab.py 13 Jul 2002 05:44:21 -0000 1.6 @@ -1,5 +1,5 @@ # Hye-Shik Chang <16 Feb 2002> -# $Id: unijohab.py,v 1.5 2002/05/05 19:13:58 perky Exp $ +# $Id: unijohab.py,v 1.6 2002/07/13 05:44:21 perky Exp $ import codecs from korean.hangul import ishangul, disjoint, conjoin @@ -9,14 +9,14 @@ # Unicode to character buffer def encode(self, data, errors='strict'): if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" return disjoint(data).encode('utf-8', errors), len(data) # character buffer to Unicode def decode(self, data, errors='strict'): if errors not in ('strict', 'ignore', 'replace'): - raise UnicodeError, "unknown error handling" + raise ValueError, "unknown error handling" return conjoin(unicode(data, 'utf-8', errors)), len(data) |