+
    Bi{)                        ^ 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 ^ RIHtHtHt ]! R4       ]! ]4      P$                  R,          P'                  4       t]! ]4      R,          t]R	,          t]! R4      ;_uu_ 4        ^ RItRRR4       R
 t ! R R]P2                  4      t ! R R]P2                  4      t ! R R]P2                  4      tR t]R8X  d\   ]! ]P@                  4      ^8  d2   ]P@                  ^,          R8X  d   ]! 4        ]PB                  ! ^ 4       ]PD                  ! 4        R# R#   + '       g   i     L; i)    N)GNUTranslations)Path)temp_cwd)assert_python_failureassert_python_ok)imports_under_toolskip_if_missingtoolsdiri18nmsgfmt_dataz	msgfmt.pyc                 (    \        \        R W4       R# )z-oN)r   	msgfmt_py)po_filemo_files   &&2/usr/lib/python3.14/test/test_tools/test_msgfmt.pycompile_messagesr      s    Yg7    c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )CompilationTestc                   R V n         \        4       ;_uu_ 4        \        P                  R4       F  pV P	                  VR7      ;_uu_ 4        VP                  R4      p\        VR4      ;_uu_ 4       p\        V4      pR R R 4       VP                  p\        W4       \        VR4      ;_uu_ 4       p\        V4      pR R R 4       V P                  XP                  XP                  4       R R R 4       K  	  R R R 4       R #   + '       g   i     L; i  + '       g   i     L_; i  + '       g   i     EK
  ; i  + '       g   i     R # ; i)N*.po)r   .morb)maxDiffr   data_dirglobsubTestwith_suffixopenr   namer   assertDictEqual_catalog)selfr   r   fexpectedtmp_mo_fileactuals   &      r   test_compilation CompilationTest.test_compilation   s    ZZ#==0\\'\22%11%8Ggt,,#21#5 - #*,,K$W:k400A!0!3 1 (((:K:KL 32 1 Z -,
 10 322 ZZsS   3D=&D(3D?3D(2D>.D(,D=DD(D% D((D:3
D==E	c           	     \   \        4       ;_uu_ 4        R p\        \        R,          V4       \        VR4      ;_uu_ 4       pVP	                  4       pRRR4       RRR4       \
        P                  ! RXR,          4      w  pppppp	p
V P                  VR4       V P                  V^ 4       V P                  V^	4       V P                  V^4       V P                  V^d4       V P                  V	^ 4       V P                  V
^ 4       R#   + '       g   i     L; i  + '       g   i     L; i)messages.moz
general.por   Nz=7I:N   Nl   * )r   r   r   r   readstructunpackassertEqual)r#   r&   r$   mo_datamagicversionnum_stringsorig_table_offsettrans_table_offsethash_table_sizehash_table_offsets   &          r   test_binary_header"CompilationTest.test_binary_header/   s    ZZ'KX4kBk4((A&&( )  MM%.	
 	
+!$a(*B/+S1!,*A.' )( Zs#   .DD	DDDD+	c                   \        \        R ,          R4      ;_uu_ 4       p\        V4      pRRR4       V P                  XP	                  R4      R4       V P                  VP	                  R4      R4       V P                  VP                  RR4      R4       V P                  VP                  RR4      R4       V P                  VP	                  R4      R	4       V P                  VP	                  R
4      R4       V P                  VP	                  R4      R4       V P                  VP                  RR^4      R4       V P                  VP                  RR^4      R4       V P                  VP                  RRR^4      R4       V P                  VP                  RRR^4      R4       R#   + '       g   i     EL; i)z
general.mor   NfoobarbazabcxyzMultilinestringMultilinetranslationz	"escapes"z"translated"z
 newlines 
z
 translated 
zOne email sent.z%d emails sent.)r   r   r   r0   gettextpgettextngettext	npgettext)r#   r$   ts   &  r   test_translations!CompilationTest.test_translationsH   s|   (\)400A"A 1 	5)515)51E5159E5159#457MN;/@#346HI$57H!L*	,$57H!L*	,U,=%6;*	, 	U,=%6;*	,# 100s   F--F>	c                   \        4       ;_uu_ 4        \        R 4      P                  R4       \        \        R 4      pVP
                  P                  R4      pV P                  RV4       RRR4       R#   + '       g   i     R# ; i)zbom.pos"   ﻿msgid "Python"
msgstr "Pioton"
utf-8z'The file bom.po starts with a UTF-8 BOMN)r   r   write_bytesr   r   errdecodeassertInr#   resrM   s   &  r   test_po_with_bom CompilationTest.test_po_with_bom^   sU    ZZN&&'WX'	8<C''..)CMMCSI ZZZ   AA55B	c                   \        4       ;_uu_ 4        \        R 4      P                  R4       \        \        R 4      pVP
                  P                  R4      pV P                  RV4       RRR4       R#   + '       g   i     R# ; i)
invalid.poz+msgid_plural "plural"
msgstr[0] "singular"
rK   z"msgid_plural not preceded by msgidNr   r   
write_textr   r   rM   rN   rO   rP   s   &  r   test_invalid_msgid_plural)CompilationTest.test_invalid_msgid_pluralf   s\    ZZ)) + 
 (	<@C''..)CMM>D ZZZrT   c                   \        4       ;_uu_ 4        \        R 4      P                  R4       \        \        R 4      pVP
                  P                  R4      pV P                  RV4       RRR4       R#   + '       g   i     R# ; i)rV   zmsgid "foo"
msgstr[0] "bar"
rK   zplural without msgid_pluralNrW   rP   s   &  r    test_plural_without_msgid_plural0CompilationTest.test_plural_without_msgid_pluralq   s\    ZZ)) + 
 (	<@C''..)CMM7= ZZZrT   c                   \        4       ;_uu_ 4        \        R 4      P                  R4       \        \        R 4      pVP
                  P                  R4      pV P                  RV4       RRR4       R#   + '       g   i     R# ; i)rV   z-msgid "foo"
msgid_plural "foos"
msgstr "bar"
rK   z"indexed msgstr required for pluralNrW   rP   s   &  r   (test_indexed_msgstr_without_msgid_plural8CompilationTest.test_indexed_msgstr_without_msgid_plural|   s\    ZZ)) +  (	<@C''..)CMM>D ZZZrT   c                   \        4       ;_uu_ 4        \        R 4      P                  R4       \        \        R 4      pVP
                  P                  R4      pV P                  RV4       RRR4       R#   + '       g   i     R# ; i)rV   z"foo"
rK   zSyntax errorNrW   rP   s   &  r   test_generic_syntax_error)CompilationTest.test_generic_syntax_error   s[    ZZ)) +  (	<@C''..)CMM.#. ZZZrT   )r   N)__name__
__module____qualname____firstlineno__r(   r9   rH   rR   rY   r\   r_   rb   __static_attributes____classdictcell____classdict__s   @r   r   r      s6     M /2,,J	E	>
E/ /r   r   c                   6   a  ] tR t^t o ]R 4       tR tRtV tR# )POParserTestc                B    \         P                  P                  4        R # )N)msgfmtMESSAGESclear)clss   &r   tearDownClassPOParserTest.tearDownClass   s     	r   c                J   R
p\        4       ;_uu_ 4        V F  w  r#V P                  VR7      ;_uu_ 4        RV R2p\        R4      P                  V4       \        P
                  P                  4        \        P                  ! RR4       \        RR4      ;_uu_ 4       p\        V4      pRRR4       V P                  XP                  VR/4       RRR4       K  	  RRR4       Rp\        4       ;_uu_ 4        V F  pV P                  VR	7      ;_uu_ 4        RV R2p\        R4      P                  V4       \        P
                  P                  4        V P                  \        4      ;_uu_ 4        \        P                  ! RR4       RRR4       RRR4       K  	  RRR4       R#   + '       g   i     EL	; i  + '       g   i     EK  ; i  + '       g   i     L; i  + '       g   i     Lb; i  + '       g   i     EK  ; i  + '       g   i     R# ; i)"")	po_stringzmsgid z
msgstr "translation"zmessages.por+   r   Ntranslation)string))rv    )z"" "" ""rz   )z"\\"\)z"\""")z"\t"	)z"\n"
)z"\r")z"\f")z"\a")z"\b")z"\v")z"foo"r<   )z"foo" "bar"foobar)z
"foo""bar"r   )z"" "foo" ""r<   )z
"foo\nbar"foo
bar)z"foo\n" "bar"r   )z
"foo\tbar"foo	bar)z"foo\t" "bar"r   )z
"foo\"bar"foo"bar)z"foo\"" "bar"r   )z"foo\\" "bar"zfoo\bar)z"\120\171\164\150\157\156"Python)z"\120\171\164" "\150\157\156"r   )z!"\"\120\171\164" "\150\157\156\"""Python")z"\x50\x79\x74\x68\x6f\x6e"r   )z"\x50\x79\x74" "\x68\x6f\x6e"r   )z!"\"\x50\x79\x74" "\x68\x6f\x6e\""r   )r|   z"""z"" "r<   z"" "fooz	"foo" foo42z"" 42 ""z"\x"z"\u1234"z"\N{ROMAN NUMERAL NINE}")r   r   r   rX   ro   rp   rq   maker   r   r!   r"   assertRaises	Exception)	r#   valid_stringsrw   r%   por$   r'   invalid_stringsinvalid_strings	   &        r   test_stringsPOParserTest.test_strings   s   
$
L ZZ'4#	\\I\66 "),BCB'2226OO))+KK}=mT22a!0!3 3 ((8]:ST 76 (5 "
& ZZ"1\\\88!.!11GHB'2226OO))+**955M=A 6 98 #2 Z1 322 766 ZV 65 988 ZZsx   "GA*G!F--&GG; HAG<7G)G<H-F>8	GG
GG&	)G94G<<H
HH"	 N)	rd   re   rf   rg   classmethodrs   r   rh   ri   rj   s   @r   rm   rm      s%        
WB WBr   rm   c                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )CLITestc                    R F@  p\        \        V4      pVP                  P                  R4      pV P	                  RV4       KB  	  R# )--helprK   EGenerate binary message catalog from textual translation description.N)r   z-h)r   r   rM   rN   rO   )r#   optionrQ   rM   s   &   r   	test_helpCLITest.test_help   s:    &F"9f5C''..)CMMacfg 'r   c                    R FN  p\        \        V4      pVP                  P                  R4      P	                  4       pV P                  RV4       KP  	  R# )	--versionrK   zmsgfmt.py 1.2N)r   z-V)r   r   outrN   stripr0   )r#   r   rQ   r   s   &   r   test_versionCLITest.test_version   sC    )F"9f5C''..)//1C_c2 *r   c                    \        \        R 4      pVP                  P                  R4      pV P	                  RV4       V P	                  RV4       R# )z--invalid-optionrK   r   z&option --invalid-option not recognizedN)r   r   rM   rN   rO   rP   s   &  r   test_invalid_optionCLITest.test_invalid_option  s@    #I/ABggnnW%]_bc>Dr   c                    \        \        4      pVP                  P                  R 4      P	                  RR4      pV P                  RV4       R# )rK   z
r~   z=No input file given
Try `msgfmt --help' for more information.N)r   r   rM   rN   replacerO   rP   s   &  r   test_no_input_fileCLITest.test_no_input_file  sA    y)ggnnW%--fd; BCF	Hr   c                &    \        \        R 4       R# )znonexistent.poN)r   r   )r#   s   &r   test_nonexistent_fileCLITest.test_nonexistent_file  s    i)9:r   r   N)rd   re   rf   rg   r   r   r   r   r   rh   ri   rj   s   @r   r   r      s&     h3EH; ;r   r   c            	         \         P                  R 4       F  p V P                  R4      p\        W4       \	        VR4      ;_uu_ 4       p\        V4      pRRR4       V P                  R4      p\	        VR4      ;_uu_ 4       pXP                  P                  4       p\        VR R7      p\        P                  ! WR^R7       VP                  R	4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)
r   r   r   Nz.jsonwc                 B    \        V ^ ,          \        4      V ^ ,          3# )r   )
isinstancetuple)xs   &r   <lambda>*update_catalog_snapshots.<locals>.<lambda>  s    z!A$/F!.Mr   )key)indentr~   )r   r   r   r   r   r   r"   itemssortedjsondumpwrite)r   r   r$   translationscatalog_filedatas         r   update_catalog_snapshotsr     s    ==(%%e,* '4  A*1-L !**73,$$((..0D$$MNDIIda(GGDM	 %$ )
 !  %$$s   	C"AC5"C25D__main__z--snapshot-update)#r   r.   sysunittestrC   r   pathlibr   test.support.os_helperr   test.support.script_helperr   r   test.test_toolsr   r	   r
   __file__parentresolver   
script_dirr   ro   r   TestCaser   rm   r   r   rd   lenargvexitmainr   r   r   <module>r      s     
  #  + N I I  N!!M1::<(^f$
$	  8s/h'' s/l^B8$$ ^BB;h ;<  z
388}qSXXa[,?? "MMO	 [  s   EE	