+
    Bi>a                     >   R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHt ^ RIHtHt ]! 4        ]! ]4      P'                  4       P(                  R,          t]! R4      ;_uu_ 4        ^ R	IHtHtHtHt RRR4       R
 t ! R R]P8                  4      tR tR t] R8X  d\   ]!! ]PD                  4      ^8  d2   ]PD                  ^,          R8X  d   ]! 4        ]PF                  ! ^ 4       ]PH                  ! 4        R# R#   + '       g   i     L; i)z%Tests to cover the Tools/i18n packageN)dedent)Path)assert_python_ok)imports_under_toolskip_if_missingtoolsdir)temp_cwdtemp_dir	i18n_datai18n)
parse_specprocess_keywordsDEFAULTKEYWORDSunparse_specc                "   \         P                  ! R4      pRp\         P                  ! WV 4      p \         P                  ! R4      pRp\         P                  ! W4V 4      p \         P                  ! R4      pR p\         P                  ! WVV 4      p V # )zjNormalize the POT creation timestamp, charset and
file locations to make the POT file easier to compare.

z"POT-Creation-Date: .+?\\n"z-"POT-Creation-Date: 2000-01-01 00:00+0000\\n"z*"Content-Type: text/plain; charset=.+?\\n"z,"Content-Type: text/plain; charset=UTF-8\\n"z#:.+c                 P    V ^ ,          P                  \        P                  R4      # )    /)replaceossep)matchs   &0/usr/lib/python3.14/test/test_tools/test_i18n.pyr   #normalize_POT_file.<locals>.replace,   s    Qx,,    )recompilesub)potdate_patternheadercharset_patterncharsetfileloc_patternr   s   &      r   normalize_POT_filer$      sx     ::<=L=F
&&s
+C jj!NOO=G
&&3
/C jj)O-
&&3
/CJr   c                     a  ] tR t^2t o Rt]! ]RR4      tR tR t	R t
RR>RR	R
RRR/R ltR tR tR t]P                   ! ]P$                  P'                  R4      R4      R 4       tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R' t(R( t)R) t*R* t+R+ t,R, t-R- t.R. t/R/ t0R0 t1R1 t2R2 t3R3 t4R4 t5R5 t6R6 t7R7 t8R8 t9R9 t:R: t;R; t<R<t=V t>R=# )?Test_pygettextzTests for the pygettext.py toolr   zpygettext.pyc                    / pVP                  R4       F[  pV'       d   VP                  R4      '       d   K$  VP                  R4      pVP                  R^4      w  rEVP                  4       W$&   K]  	  V# )z9utility: return the header of a .po file as a dictionary 
":)#msgidmsgstr)split
startswithstrip)selfdataheaderslinekeyvals   &&    r   
get_headerTest_pygettext.get_header7   sb    JJt$D4??+CDD::c?Dzz#q)HC99;GL % r   c                   . pRp. pVP                  R4       F  pV'       d_   VP                  R4      '       d"   VP                  VP                  R4      4       M&VP                  RP	                  V4      4       . pRpKi  VP                  R4      '       g   K  V\        R4      R pVP                  VP                  R4      4       RpK  	  V'       d!   VP                  RP	                  V4      4       V# )z<utility: return all msgids in .po file as a list of strings Fr(   r)   zmsgid NT)r.   r/   appendr0   joinlen)r1   r2   msgidsreading_msgid	cur_msgidr4   s   &&    r   
get_msgidsTest_pygettext.get_msgidsB   s    	JJt$D??3''$$TZZ_5MM$))I"67 "I$)Mx((CMN+  C1 $ % dii	23r   c                \    RV n         V P                  \        V4      \        V4      4       R# )z Check if two POT files are equalN)maxDiffassertEqualr$   )r1   expectedactuals   &&&r   assert_POT_equalTest_pygettext.assert_POT_equalZ   s%    +H57I&7QRr   argsstrictTwith_stderrFrawc          	     J   Rp\        R4      ;_uu_ 4        \        VRRR7      ;_uu_ 4       pVP                  V4       RRR4       \        RV P                  .VOVN5!  pV'       d   V P                  VP                  R4       \        RRR7      ;_uu_ 4       pVP                  4       p	RRR4       RRR4       V'       g   V P                  X	4      p	V'       g   X	# X	XP                  3#   + '       g   i     L; i  + '       g   i     L\; i  + '       g   i     Lg; i)	z0Return all msgids extracted from module_content.ztest.pyNwutf-8encoding-Xutf8r   messages.pot)	r   openwriter   scriptrD   errreadr@   )
r1   module_contentrI   rJ   rK   rL   filenamefpresr2   s
   &&$$$$    r   extract_from_strTest_pygettext.extract_from_str_   s     d^^hg66"( 7"8T[[J4JJC  #.nw772wwy 8  ??4(DKSWW} 76
 87 ^s:   DC,	ADC?	+D,C<7D?D
DD"	c                *    V P                  VRRR7      # )z4Return all docstrings extracted from module_content.F)rI   rJ   z--docstringsr]   r1   rY   s   &&r   extract_docstrings_from_str*Test_pygettext.extract_docstrings_from_strq   s    $$^:KTY$ZZr   c                8    V P                  VR RR7      ^,          # )FT)rJ   rK   ra   rb   s   &&r   
get_stderrTest_pygettext.get_stderru   s     $$^Et$TUVWWr   c           	     z   \        R4      ;_uu_ 4       p\        RV P                  4       \        RRR7      ;_uu_ 4       pVP	                  4       pRRR4       V P                  X4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  R	V4       V P                  R
V4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zMake sure the required fields are in the header, according to:
http://www.gnu.org/software/gettext/manual/gettext.html#Header-Entry
NrR   rS   rO   rP   zProject-Id-VersionPOT-Creation-DatezPO-Revision-DatezLast-TranslatorzLanguage-TeamzMIME-VersionzContent-TypezContent-Transfer-EncodingzGenerated-By)r   r   rV   rT   rX   r7   assertIn)r1   cwdr[   r2   r    s   &    r   test_headerTest_pygettext.test_headerx   s     d^^sXt{{3nw772wwy 8__T*FMM.7MM-v6MM,f5MM+V4MM/62MM.&1MM.&1MM5v>MM.&1 ^77 ^^s$   ,D) D	B;D)D&!D))D:	aixzbpo-29972: broken test on AIXc           	        ^ RI H p \        R4      ;_uu_ 4       p\        RV P                  4       \	        RRR7      ;_uu_ 4       pVP                  4       pRRR4       V P                  X4      pVR,          pVP                  R4      '       d   VR\        R4      )  pVP                  VR	4       RRR4       R#   + '       g   i     Ll; i  + '       g   i     R# ; i)
z:Match the date format from xgettext for POT-Creation-Date )datetimeNrR   rS   rO   rP   ri   z\nz%Y-%m-%d %H:%M%z)
rp   r   r   rV   rT   rX   r7   endswithr<   strptime)r1   rp   rk   r[   r2   r    creationDates   &      r   test_POT_Creation_Date%Test_pygettext.test_POT_Creation_Date   s     	&d^^sXt{{3nw772wwy 8__T*F!"56L $$U+++Lc%j[9 l,>? ^77 ^^s)   ,CB;	8C!C;CCC	c                n   R F  p\        4       ;_uu_ 4        \        V P                  V R24       V P                  \        P
                  P                  R4      4       \        V P                  V R24      pV P                  RVP                  4       RRR4       K  	  R#   + '       g   i     K  ; i)-otest-s#   Project-Id-Version: PACKAGE VERSIONN)rw   z	--output=)	r   r   rV   
assertTruer   pathexistsrj   out)r1   optr\   s   &  r   test_output_option!Test_pygettext.test_output_option   sx    &C Tl;v 67&t{{se1I>DcggN	  's   A=B##B4c           	         R FX  pV P                  V4      ;_uu_ 4        V P                  \        RV,          4      4      pV P                  RV4       RRR4       KZ  	  R#   + '       g   i     Ko  ; i)	"""doc"""zE                def foo(bar):
                    %s
                docNr   z
r'''doc'''zR'doc'zu"doc"subTestrc   r   rj   r1   r   r=   s   &  r   test_funcdocstring!Test_pygettext.test_funcdocstring   f    BCc""99& B B ;  eV, #" C"""   4A!!A2c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z5        def foo(bar):
            b"""doc"""
        r   Nrc   r   assertFalser1   r=   r,   s   &  r   test_funcdocstring_bytes'Test_pygettext.test_funcdocstring_bytes   H    11& : 3  	VFVEu~%%VFGF
   	AAc                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z5        def foo(bar):
            f"""doc"""
        r   Nr   r   s   &  r   test_funcdocstring_fstring)Test_pygettext.test_funcdocstring_fstring   r   r   c           	         R FX  pV P                  V4      ;_uu_ 4        V P                  \        RV,          4      4      pV P                  RV4       RRR4       KZ  	  R#   + '       g   i     Ko  ; i)r   z@                class C:
                    %s
                r   Nr   r   r   s   &  r   test_classdocstring"Test_pygettext.test_classdocstring   r   r   c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z0        class C:
            b"""doc"""
        r   Nr   r   s   &  r   test_classdocstring_bytes(Test_pygettext.test_classdocstring_bytes   r   r   c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z0        class C:
            f"""doc"""
        r   Nr   r   s   &  r   test_classdocstring_fstring*Test_pygettext.test_classdocstring_fstring   r   r   c           	         R FX  pV P                  V4      ;_uu_ 4        V P                  \        RV,          4      4      pV P                  RV4       RRR4       KZ  	  R#   + '       g   i     Ko  ; i)r   z#                %s
                r   Nr   r   r   s   &  r   test_moduledocstring#Test_pygettext.test_moduledocstring   sd    BCc""99& BB ;  eV,	 #" C"""r   c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z        b"""doc"""
        r   Nr   r   s   &  r   test_moduledocstring_bytes)Test_pygettext.test_moduledocstring_bytes   H    11& : 3  	VFVEu~%%VFGFr   c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z        f"""doc"""
        r   Nr   r   s   &  r   test_moduledocstring_fstring+Test_pygettext.test_moduledocstring_fstring   r   r   c                L    V P                  R 4      pV P                  RV4       R# )z_("""doc""" r'str' u"ing")	docstringN)rc   rj   r1   r=   s   & r   
test_msgidTest_pygettext.test_msgid   s#    1102k6*r   c                    V P                  R 4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z_(b"""doc""")r   Nrc   r   r   s   &  r   test_msgid_bytesTest_pygettext.test_msgid_bytes   :    11/BVFVEu~%%VFGF   	>>c                    V P                  R 4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z_(f"""doc""")r   Nr   r   s   &  r   test_msgid_fstring!Test_pygettext.test_msgid_fstring   r   r   c                ^    V P                  \        R4      4      pV P                  RV4       R# )z2Test docstrings for functions with annotated args z9        def foo(bar: str):
            """doc"""
        r   Nrc   r   rj   r   s   & r   !test_funcdocstring_annotated_args0Test_pygettext.test_funcdocstring_annotated_args   .    11& : 3  	eV$r   c                ^    V P                  \        R4      4      pV P                  RV4       R# )z9Test docstrings for functions with annotated return type z;        def foo(bar) -> str:
            """doc"""
        r   Nr   r   s   & r   #test_funcdocstring_annotated_return2Test_pygettext.test_funcdocstring_annotated_return  r   r   c                ^    V P                  \        R4      4      pV P                  RV4       R# )z5Test docstring for functions with default arg values z7        def foo(bar=()):
            """doc"""
        r   Nr   r   s   & r    test_funcdocstring_defvalue_args/Test_pygettext.test_funcdocstring_defvalue_args  r   r   c                    V P                  \        R4      4      pV P                  RV4       V P                  RV4       V P                  RV4       R# )zyTest docstring extraction for multiple functions combining
annotated args, annotated return types and default arg values
z        def foo1(bar: tuple=()) -> str:
            """doc1"""

        def foo2(bar: List[1:2]) -> (lambda x: x):
            """doc2"""

        def foo3(bar: 'func'=lambda x: x) -> {1: 2}:
            """doc3"""
        doc1doc2doc3Nr   r   s   & r   !test_funcdocstring_multiple_funcs0Test_pygettext.test_funcdocstring_multiple_funcs  sL     11& 	: 	3 	 	ff%ff%ff%r   c                ^    V P                  \        R4      4      pV P                  RV4       R# )zTTest docstring extraction for a class with colons occurring within
the parentheses.
z\        class D(L[1:2], F({1: 2}), metaclass=M(lambda x: x)):
            """doc"""
        r   Nr   r   s   & r   test_classdocstring_early_colon.Test_pygettext.test_classdocstring_early_colon&  s0     11& : 3  	eV$r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z"        f"{_('foo bar')}"
        foo barNr   r   s   & r   test_calls_in_fstrings%Test_pygettext.test_calls_in_fstrings0  .    11& : 3  	i(r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z#        rf"{_('foo bar')}"
        r   Nr   r   s   & r   test_calls_in_fstrings_raw)Test_pygettext.test_calls_in_fstrings_raw6  r   r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z+        f"""{f'{_("foo bar")}'}"""
        r   Nr   r   s   & r   test_calls_in_fstrings_nested,Test_pygettext.test_calls_in_fstrings_nested<  r   r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z&        f"{obj._('foo bar')}"
        r   Nr   r   s   & r    test_calls_in_fstrings_attribute/Test_pygettext.test_calls_in_fstrings_attributeB  r   r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z*        f"{type(str)('foo bar')}"
        r   Nrc   r   assertNotInr   s   & r   (test_calls_in_fstrings_with_call_on_call7Test_pygettext.test_calls_in_fstrings_with_call_on_callH  s0    11& : 3  	F+r   c                ^    V P                  \        R 4      4      pV P                  RV4       R# )z6        f"{_('foo {bar}').format(bar='baz')}"
        	foo {bar}Nr   r   s   & r   "test_calls_in_fstrings_with_format1Test_pygettext.test_calls_in_fstrings_with_formatN  s.    11& : 3  	k6*r   c                    V P                  \        R 4      4      pT P                  V Uu. uF  pRV9   g   K  VNK  	  up4       R# u upi )z%        f"{_(f'foo {bar}')}"
        r   Nr   r   s   &  r   )test_calls_in_fstrings_with_wrong_input_18Test_pygettext.test_calls_in_fstrings_with_wrong_input_1T  sI    11& : 3  	VLVE{e7K%%VLMLr   c                ^    V P                  \        R 4      4      pV P                  ^V4       R# )z        f"{_(1)}"
        Nr   r   s   & r   )test_calls_in_fstrings_with_wrong_input_28Test_pygettext.test_calls_in_fstrings_with_wrong_input_2Z  s0    11& : 3  	F#r   c                    V P                  \        R 4      4      pV P                  RV4       V P                  RV4       R# )z%        f"{_('foo', 'bar')}"
        foobarNrc   r   rj   r   r   s   & r   (test_calls_in_fstring_with_multiple_args7Test_pygettext.test_calls_in_fstring_with_multiple_args`  s>    11& : 3  	eV$'r   c                    V P                  \        R 4      4      pV P                  RV4       V P                  RV4       V P                  RV4       R# )z)        f"{_('foo', bar='baz')}"
        r   r   bazNr   r   s   & r   'test_calls_in_fstring_with_keyword_args6Test_pygettext.test_calls_in_fstring_with_keyword_argsg  sN    11& : 3  	eV$''r   c                    V P                  \        R 4      4      pV P                  RV4       V P                  RV4       R# )z*        f"{_(f'foo') + _('bar')}"
        r   r   N)rc   r   r   rj   r   s   & r   5test_calls_in_fstring_with_partially_wrong_expressionDTest_pygettext.test_calls_in_fstring_with_partially_wrong_expressiono  s>    11& : 3  	'eV$r   c                `    V P                  \        R4      4      pV P                  VR.4       R# )z@Test that function and class names are not mistakenly extracted.z        def _(x):
            pass

        def _(x="foo"):
            pass

        async def _(x):
            pass

        class _(object):
            pass
         N)r]   r   rD   r   s   & r   test_function_and_class_names,Test_pygettext.test_function_and_class_namesv  s2    &&v / (  	"&r   c                    \        4        FL  w  rpV P                  VR7      ;_uu_ 4        VP                  RR7      pV P                  WC4       RRR4       KN  	  R#   + '       g   i     Kc  ; i)z9Test that the pygettext output exactly matches snapshots.)
input_filerO   rP   N)extract_from_snapshotsr   	read_textrG   )r1   r   output_fileoutputrE   s   &    r   test_pygettext_output$Test_pygettext.test_pygettext_output  sY    /E/G+JV44&00'0B%%h7 54 0H444s   $AA.c           	     (   RpRpRp\        R4      ;_uu_ 4        \        R4      ;_uu_ 4       p\        VRR4      pVP                  P	                  4        VP                  RV: R2R	R
7       \        VRR4      pVP                  P	                  4        VP                  RV: R2R	R
7       \        VRR4      pVP                  P	                  4        VP                  RV: R2R	R
7       \        RV P                  V4       \        R4      P                  R	R
7      pV P                  RV R2V4       V P                  RV R2V4       V P                  W84       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zCMake sure the directories are inspected for source files
bpo-31920
zText to translate1zText to translate2zText to ignoreNpypkgzpymod.pyz_()rO   rP   zpkg.pyz	pymod2.pyCVSz	pymod3.pyrR   rS   zmsgid "r)   )r   r	   r   parentmkdir
write_textr   rV   r   rj   r   )	r1   text1text2text3sdirpymodpymod2pymod3r2   s	   &        r   test_files_listTest_pygettext.test_files_list  sJ    %$ d^^Xd^^tw
3ELL r%!_w?$+6FMM!5)1o@${3FMM!5)1o@Xt{{D9'1171CDMMGE7!,d3MMGE7!,d3U)# ,^^^^^^^s#   F D-E-	F -E=8F  F	c                    \        V P                  R4      pV P                  VP                  R4       V P	                  RVP
                  4       R# )z%Test that the help text is displayed.z--helpr   s-   pygettext -- Python equivalent of xgettext(1)N)r   rV   rD   r}   rj   rW   )r1   r\   s   & r   test_help_textTest_pygettext.test_help_text  s9    t{{H5#&FPr   c                    V P                  \        R4      4      pVP                  R4      P                  RR4      pV P	                  VR4       R# )z5Test that pygettext outputs error messages to stderr.zN        _(1+2)
        ngettext('foo')
        dgettext(*args, 'foo')
        rO   r   z*** test.py:1: Expected a string constant for argument 1, got 1 + 2
*** test.py:2: Expected at least 2 positional argument(s) in gettext call, got 1
*** test.py:3: Variable positional arguments are not allowed in gettext calls
N)rf   r   decoder   rD   )r1   stderrs   & r   test_error_messages"Test_pygettext.test_error_messages  sP     ) "  w'//b9^	
r   c           	         R FV  pV P                  VR7      ;_uu_ 4        V P                  \        R4      V3RR7      pV P                  RV4       RRR4       KX  	  R#   + '       g   i     Km  ; i)z_
Test that the --add-comments option without an
explicit tag extracts all translator comments.
argzN                # Translator comment
                _("foo")
                TrI   rL   z#. Translator commentN)z--add-commentsz-c)r   r]   r   rj   )r1   r  r2   s   &  r   test_extract_all_comments(Test_pygettext.test_extract_all_comments  sl    
 ,C#&&,,V 5 .  6t - - 5t< '& ,&&&s   1AA0c           	     p   R F  pV P                  VR7      ;_uu_ 4        VP                  R4      VP                  R4      3pV P                  \        R4      VRR7      pV P	                  RV4       V P	                  RV4       V P                  R	V4       R
R
R
4       K  	  R
#   + '       g   i     K  ; i)z:
Test that multiple --add-comments tags can be specified.
r  foo:zbar:z                # foo: comment
                _("foo")

                # bar: comment
                _("bar")

                # baz: comment
                _("baz")
                Tr  z#. foo: commentz#. bar: commentz#. baz: commentN)z--add-comments={}z-c{})r   formatr]   r   rj   r   )r1   r  rI   r2   s   &   r    test_comments_with_multiple_tags/Test_pygettext.test_comments_with_multiple_tags  s     1C#&&

6*CJJv,>?,,V 	5 	.  T - 	+ /6/6  !2D9 '& 1&&&s   A6B$$B5c                b    V P                  \        R4      RR7      pV P                  RV4       R# )zT
Test that translator comments are not extracted without
specifying --add-comments.
z6        # Translator comment
        _("foo")
        T)rL   z#.N)r]   r   r   )r1   r2   s   & r   (test_comments_not_extracted_without_tags7Test_pygettext.test_comments_not_extracted_without_tags  s<    
 $$V - &  %  	t$r   c                   R R R^ /33RR R^ /33RR R^ R^/33RR R^ R^/33RR R^ R^/33RR R^ R^/33R	R R^ R^/33R
R R^ R^R^/33RR R^ R^R^/33RR R^ R^R^/333
pV Fe  w  r#V P                  VR7      ;_uu_ 4        V P                  \        V4      V4       V P                  \        \        V!  4      V4       RRR4       Kg  	  RpV F~  w  r%V P                  VR7      ;_uu_ 4        V P	                  \
        4      ;_uu_ 4       p\        V4       RRR4       V P                  \        XP                  4      V4       RRR4       K  	  R#   + '       g   i     EK  ; i  + '       g   i     LX; i  + '       g   i     K  ; i)r   r,   zfoo:1foo:1,2msgid_pluralzfoo:1, 2zfoo:1,2cmsgctxtzfoo:2c,1z	foo:2c ,1z
foo:1,2,3czfoo:1, 2, 3cz
foo:3c,1,2)specN)
)r"  z7Invalid keyword spec 'foo:': missing argument positions)zfoo:barz:Invalid keyword spec 'foo:bar': position is not an integer)zfoo:0zJInvalid keyword spec 'foo:0': argument positions must be strictly positive)zfoo:-2zKInvalid keyword spec 'foo:-2': argument positions must be strictly positive)zfoo:1,1z3Invalid keyword spec 'foo:1,1': duplicate positions)z	foo:1,2,1z5Invalid keyword spec 'foo:1,2,1': duplicate positions)zfoo:1c,2,1cz7Invalid keyword spec 'foo:1c,2,1c': duplicate positions)zfoo:1c,2,3cz@Invalid keyword spec 'foo:1c,2,3c': msgctxt can only appear once)z	foo:1,2,3z4Invalid keyword spec 'foo:1,2,3': too many positions)zfoo:1czBInvalid keyword spec 'foo:1c': msgctxt cannot appear without msgid)r   rD   r   r   assertRaises
ValueErrorstr	exception)r1   validr-  rE   invalidmessagecms   &      r   test_parse_keyword_spec&Test_pygettext.test_parse_keyword_spec  s   UWaL)*uwl+,!^Q ?@A%'1na!@AB%'1i!;<=%'1i!;<=57Ay!"<=>EGQ9a#PQRegq.!YPQ%RSTEGQ9a#PQR
 $ND4((  D!18<  L(,C!DhO )( $
 %MD4((&&z22bt$ 3  R\\!2G< )( %# )((& 32 )((s0    >E-E:E'-E:E$'E72E::Fc                $   \         P                  ! 4        UUu/ uF  w  rW.bK
  	  pppR .R3R.R3R R.R3R .R3. ROR3R R .R3R.R33pR R^ /./RR^ R^/./R R^ /R^ R^/./VR R^ /./,          VRR^ R^/R	^ R^R^/R^ /.RR^ /R	^ R^/./,          R R^ /./V3p\        WE4       FJ  w  w  rgpV P                  VVR
7      ;_uu_ 4        \	        VVR7      pV P                  W4       RRR4       KL  	  R# u uppi   + '       g   i     Kg  ; i)r   T_:1,2r*  Fpgettext_r,   r+  r,  )keywordsno_default_keywords)r=  N)r9  z_:1c,2,3r:  )r   itemszipr   r   rD   )	r1   namer-  default_keywordsinputsrE   r<  r=  	processeds	   &        r   test_process_keywords$Test_pygettext.test_process_keywords  s   .44686 .8TD&L6 	 8 WdOYY&We.6U^T"UEN	
 gq\N#GQ234gq\GQ#BCD!~66w>1&E'0!WaQR&S'.l&4 !+gq\.7GQ-G-I J J
 gq\N#
 :=V9N5+XXx2E  G G,(;=	   5G G :O384G G Gs   C8C>>Dc                |   V P                  \        R 4      RRR7      w  rV P                  RV4       V P                  RV4       V P                  VR4       V P                  \        R4      RRRR7      w  rV P                  VR	.4       VP	                  R
4      P                  RR	4      pV P                  VR4       R# )z2        _("foo", 42)
        _(42, "bar")
        T)rI   rK   r   r   r   z*        _(x, 42)
        _(42, y)
        F)rI   rK   rJ   r   rO   r  al  *** test.py:1: No keywords matched gettext call "_":
	keyword="_": Expected a string constant for argument 1, got x
	keyword="_:2": Expected a string constant for argument 2, got 42
*** test.py:2: No keywords matched gettext call "_":
	keyword="_": Expected a string constant for argument 1, got 42
	keyword="_:2": Expected a string constant for argument 2, got y
N)z--keyword=_:1z--keyword=_:2)r]   r   rj   rD   r  r   )r1   r=   r  s   &  r   +test_multiple_keywords_same_funcname_errors:Test_pygettext.test_multiple_keywords_same_funcname_errors4  s     ..v 7 0 64 / I 	eV$eV$% ..v 7 0 64	 / 
 	"&w'//b9R	Sr   )rC   N )?__name__
__module____qualname____firstlineno____doc__r   r   rV   r7   r@   rG   r]   rc   rf   rl   unittestskipIfsysplatformr/   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r$  r'  r6  rD  rG  __static_attributes____classdictcell__)__classdict__s   @r   r&   r&   2   si    )(FN3F	0S
r $ %*05$[X24 __S\\,,U346@6@"O-HH-HH-HH+
HH%%%&$%)))),+N$((%'"8*4Q
$=:*	%#=J 6DS Sr   r&   c               #   b  "   R RRRRRRRRRRRRRRR/p V P                  4        F  w  r\        V\        4      '       d    Vw  r\        V,          p\        V,          pM\        V,          pVP	                  R4      pVP                  4       p\        R4      ;_uu_ 4        \        VP                  4      P                  V4       \        R	\        P                  .VOVP                  N5!   WC\        R
4      P                  RR7      3x  RRR4       K  	  R#   + '       g   i     EK  ; i5i)zmessages.pyz
fileloc.pyzdocstrings.pyzcomments.pyzcustom_keywords.pyzmultiple_keywords.py
escapes.pyz.potNrR   rS   rO   rP   rI  r`   )z--add-comments=i18n:)--keyword=fooz--keyword=nfoo:1,2z--keyword=pfoo:1c,2z--keyword=npfoo:1c,2,3z--keyword=_:1,2)z--keyword=foo:1c,2,3z--keyword=foo:1c,2z--keyword=foo:1,2rX  rX  )z--escape--add-comments=)rW  zascii-escapes.pot)rY  )r>  
isinstancetupleDATA_DIRwith_suffix
read_bytesr   r   r@  write_bytesr   r&   rV   r   )	snapshotsrZ   rI   r   r   contentss         r   r   r   S  s%    r'*0 L 	 !C 	5+-A!I& $//+h&&$,!H"[0K!H,J!H,J$008K((*d^^!--h7X~'<'< .t .'__.'1171CE E	 ^ , ^^s   BD/ A,DD/D,%
D/c                  j    \        4        F$  w  rp\        V4      pVP                  VR R7       K&  	  R# )rO   rP   N)r   r$   r  )r;  r   r   s      r   update_POT_snapshotsrc  x  s1    "8":#F+v8 #;r   __main__z--snapshot-update)%rN  r   r   rQ  rO  textwrapr   pathlibr   test.support.script_helperr   test.test_toolsr   r   r   test.support.os_helperr   r	   __file__resolver  r\  	pygettextr   r   r   r   r$   TestCaser&   r   rc  rJ  r<   argvexitmainrI  r   r   <module>rq     s    + 	 	 
    7 I I 5  >!!#**[8 ) )  
2^SX&& ^SB"EJ9 z
388}qSXXa[,??MMO U  s   5DD	