ñ"""Unit tests for the bytes and óarray types. XXX This is a mess. CommonFñshould be unified with string_j�.py (and nvlatter 7ñ modernized). """ import Š $os $re %syDcopy…functoolUpickl6ftempfi@unit§x @.sup…TÔ BlistëQ fromB ÎÀbigaddrspaceNñ, MAX_Py_ssize_t if sys.flags.–ù _warning: def check_ s(ò)$(@S.wrap CG÷per(*args, **kwA&Æ©É.{’€s(('', B<W¥)BFpreturn ‘ l�!�R elseÉq# no-op)²~ù Mnó class IndexablWK÷__init__(self, value=0¾." =‡<3dex=4|;‚ABase(eTest: K]q_basicsŠMAb = Jˆ2)!()8TÀassertEqual(%K(b),32Ab.__.__6i(x_Z ŸaŸvb"abcd"t^<À_method in (. , P.deep úáþ;&(aV Oa, b# #1a),ÙK(b))‡ìempty_sequenceð‘vG�1lenŽ0”=³qRaises(—ÿError, lambda: b[0]414 g0maxz>++~!o10**10ì!-o!/-2ä -#+?µ#€Á#fÀ]) def ótest_from_list(self): qints = µrange(256)) @b = 3`.type2LÀ(i for i in >,(ðassertEqual(len(b), SR&—'N)@def m¹\indexºš [I)†able(), 1Q254),f :_255)]â ¼P[0, 1ê454ûRaises(ValueError,\', Ã/-1{G}1]) ñ WlbufferXaòaarray.p('B', [ëG, 3]* Øóa, b"\x01\x02\x03"†pñ# http://bugs.python.org/issue29159²,ñFallback when __A__ rQñ exception other than OverflowiL×class B(bytesh\ !sB TypÂX 7ÐB(b"foobar")) C}ò\ssizeƒQ`b0W/''¯ 1ob'\x0055f5 E®'-1¤æÁ'0', 'ascii'‹½?b'05 ­ <¥psys.max¤4 + ½ÂÀconstructor_ž _eìsÏwVs60.0ØÅCÆ€EpassçE\O["0"± ˜O[0.0<&ONone=&/C( µ0A2#'b'„C#20, �='ignore> ÍŒ KÀ) seó!lf.assertRaises(TypeError, self.type2test, '') 90, eTŸs='ignoreJ)b'asciiC)B6, b�Û@def íò_constructor_value_Á(ù!):-  AV.BO[-1]D < ¿sys.maxsizeF3Ž5/-2�(10**100B'?256=)7='‘2E+(GœÐ@bigaddrspaceÒß�overflowÛàize = MAX_Py_sw!_tGù#(OIýaMemory )MO 6tryT_ð # Should either pass or r¦2 anPõ (e.g. on debug builds with©Nðadditional malloc() ùÁhead), but sq©n't crash.B bytearray(¹F - 4½except  ÝÍ _‘\mpare„Kb1 =ˆ—([1, 2, 3¸/b2'3'K�,ÒÆEqual(b1, b2ï!ßTrue(b2 != b3"O1 <=D "D  f >f /3 " ª�False(b1ð#?2 =#21 >juX ##iµ“start in K3"/op!%ö# Skip step 0 (invalidg$MeMÀes[1:]:  ñself.assertEqual(b[start:stop:step], %½type2test(L#@)) Y@def # _encoding(;!):!õsample = "Hello world\n\u1234\u5678\u9abc"3ñfor enc in ("utf-8", 716"[_ ã 1A 2B 30 F�÷�# check tÖõ ASCII whitespace is ignored1¶Ó 1A\n2B\t30\vwà for c ÷in "\x09\x0A\x0B\x0C\x0D\x20": ñself.assertEqual(útype2test.fromhex(c), 5())Jbfor c wò 1C\x1D\x1E\x1F\x85\xa0\u2002 /28‰üRaises(ValueError{–U, c) …ŸËö'0000'), b'\0\0'ÇB„?Typƒ Ob'1BD È/'aC//rtD/1a b cdI/ \xdœZP12 Kg 34'ír�data, posz(lÞù# invalid first hexadecimal character2ù('12 x4 56', 3),OosecondP"3xP4P5two£�s�žyNž«þ non-ASCII stringAR3\xffD’)BwithìM ±z) as cm6v@<¨e)^`In('atưition %s' %,Ç�(cm.excep)@def ò_™tÁиÃ6hex—9?, 1<E`(b"").­_), ""8ðbytearray([0x1a, 0x2b530]Bo'1a2b3¸€Æ\x1a\x2b\x30ŒJßmemoryview(b"F ržAjoinOŸª1").9 []¢. ³of<=b""?20lst,°[[b"abc"], V", b"b ]öQ¡= list(mapî.’W, lst& ú <™©3DÀ.type2test(b÷"").join(tuple(lst)), b"abc") ñself.assertEqual(µtype2test(bKOiterJ@dot_p= = @#.:�x#t? ([£"ªCcd"]³G.:cd¶>±memoryview(IAJ"?), Q†”Ÿbytearray“4P’÷ # Stress it with many itemsˆAq = t¥c"] * 1000£expected =9p + b".:De * 999+“dseq), K{2þRaises(TypeError,C Bf, NoneF!# 2ñ handling and cleanup when someöð in the middle ofÁà# sequence hasp wrong .'I»%):+c× 1"cdèFef"]Ña& ©jab"), b™@def Öa_countë³b¾P'missFppi'¨qi = 105Uêp%12w%9 5g"b.„†b'i'), 4\+ ss,2,w+/0)ƒi€Ow), QÔo, 6), «/p'.Ïi', 1, 3), 1 _B7, 91“iŽp+i¶;p, ³¼`starts*ÁWhello»_QFalseE.èñ').aÏb"anything")ljTrue(b3r0.,ÐFalse(b.startóswith(b"hellow")) õ self.assertFalse(b.start2a.G 3õ Raises(TypeError) as cm:_f Rf[b'h']€öexc = str(cm.exception mÿIn('bytes', exc$Ttuple$ŠÂdef test_endÙW)§b„ Ptype2+1(b'-'g+µytearray().Z¿b"anything"g0Truf1i.?llo,*À¶w† 0n\$O[b'og_find(@miss7ppiqi = 105kñw519 [e�Equal(b.sŸb'ss'), 2e +w*/-1+§$an7ŽOi), _@w), ‡PÞ, 3), 5¶sÙO1, 71b’Pi, 6)a¼Bi, 1»- †÷for index in (-1, 256, sys.maxsize + 1†<+]eRegex(±$BValut1, r€ must ben�range\(0sM\)',@‚,¡)«d'rž‹ž$j,t41,,ª90¿ )*ä] /0¼2¬¡ W3¾À 3), 1) ð self.assertEqual(b.rfind(i, 3, 9), 7) *.áw, 1, 3), -1) 0ðdef test_index(;!):J2b =|Ptype2(p(b'missFppi'uui = 105;w"19fL[ Ät–b'ss'), 2M,ñRaises(ValueError, b.9W, b'w‚5Á3an' £ _i), 1Ÿw[þ•5bñô(/1ñ3#3ss'œOi, 6]šiV*"<’”rZÙ•Wui?), •–:—6˜6(™08£ › ^œ 0052ÿ 47 ÿ/ñ ö g?modù§hello, %b!v…orig = bù40b %�Uorld'Ç +Uw,X .i1 †.°False(b is 3™(Í÷%s / 100 = %d%%ÙaÖ0 % söeventy-nine', 79UQša¤s1`(79_90Is(“K(a),nhÕ# issue 29714SÓRJ\x00$-™Gœ ¼b¼§ÍigÀlo, %b!')  ‘orig = b õ b %= b'world'ñself.assertEqual(b, b'hello, ,?!').f1/%b.°False(b is 3RAb = „÷ type2test(b'%s / 100 = %d%%�Åö(b'seventy-nine', 79RN Ò1](79\90Is(�K(b),žhÕ# issue 29714"ÐOJ\x00!ΓD– ¹ ¤@def f`_rmod(ó!):'Bwithð@÷Raises(TypeError+/¢object() %53Ã7abc·hf!Isv.-!._”ñ __('%r'), NotImplemented) §ÀaeplaceM˜€@miss?ppi•û#.rU@b'i'×aˆ`b'mass?ppa@!ssAxARixixiÇ`_int_ed Ñ; � œ„(b'a b')Ç@, 32Æ'<Ïsplit_stringv7VO, ' $¾I .,;S*Ús"H´ïunicodewhitesp¹�for b in ÆQ\x1CbAVa\x1D E 7Fb'ø�üÖ"Úó¸v(), [b]-Kð"\x09\x0A\x0B\x0C\x0Dª£–\x1E\x1F"Dm ü'\x1c\x1d\x1e\x1f']§rœ_;­D®œpartitionŸ'“W@b'ssOB(b'mŸeðissippi')) ð self.assertEqual(b.partition(b'w'), (b'miss‚ppi', b'@)) E¦def test_r<Y!):#2b =lPtype2- V)+: “XHb'ss•Š!ssiŸ)JiIRssippG'I'9!1 '&à_string_error(ù3ÀRaises(TypeE+,LVa b')¼_, ' ' LuM¢ìÅ?intÂB/32Á7L À|icklingwðfor proto in range(p+÷e.HIGHEST_PROTOCOL + 1°ç=b9‚b"", b"a!bc¢\xffab\x80Æ0\0\377\0\0"+H3"Sps = ¡‚dumps(b,À,q+Žloads(ps%w<, qé‘iterator_zF‰¡it = itorgeg.‡èQ±data = list/ Xƒ/it„�6"e.…d„¯(Æ3), ¸ ¼ÂPit), ÓÆâ�Žif not b¤G�continue_~next(itßd0N øC[1:]ü¿z±p_bytearrayçÍ Jz½aabc').Gð(memoryview(b'ac'))b�VPlQ cR rRÀiew(b'ac')),ñ b'ab') def test_stripñng_error(self):'+ð.assertRaises(TypeE+!, Ptype2N(cAc').V, 'ac')I*lJ6rJ• ?int1V abc /32%IJ/J ]centeûò# Fill character can be either bytes o öarray (issue 12380ø?b =*†f�for fill_MQ in (^,e\“1z—ƒEqual(b.Å&7,J…(b'-')),h; LyÆ`--abc-: /\ljust"'œÄ&0$&r&°Ä&0!--N,'){x&_v4 abxP, 7, äéà,Ã&J2JJŠz?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' self.assertEqual(self.type2test.maketrans(b'abc', b'xyz'), transtable) Nÿ€ = b'\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'(M&?abcMÿÿOxyz'D"\†M 4selœòRaises(ValueError,ºt©U@abc'oxyzq')©Q?TypPùq'def') Nð def test_none_arguments(³!):#Õ# issue 11828;b =¾‡(b'hello¬l%l!h!h!x!x!o!„ªÏ6.asÿ2, b.find(l, None)^K3-/-21Ð2, b.find(l, ÃNone, -2)) òself.assertEqual(0, b.find(h, 1?)) 434r5l5b ./-222`Æ’Çgoindex(Ç.Ç2VÇ2Ç`6Èr/É3Ê3Ë’_count’1'.É 2Èdx¹  @Trueœ¥endswith(o5‡ ˆ4Ó 8k JFals¥àRstartâä ª6l¦:p@t æ;èðdef test_integer_arguments_out_of_byte_range(½%): 2b =ÐPtype2F—(b'hello'Fñfor method in (b.V'I” É k?~ÃóRaises(ValueError,cF, -1õ6?2567!C9999ëIÖ`_etc_r¥ _correct_e§œ_messagesKß# issue 11828aÝx†&x'Ï 8”Regex(Typ<@r'\b·0\b'~ ,…d OÌ5tðu v(À self.assñertRaisesRegex(TypeError, r'\bindex\b', b. ?,  xx, None)5�self.assv rkw xRScountw vR£startswith{€R8end~|$ëðdef test_free_after_iterating(!):)L)ï.support.check7 , G , C`.type2>`LŽreversedP�Æœtranslate»;b =‹–(b'hello'”ýrosetta = bytearray(range(256)(Ñ[ord('o')] = Ae') ‘.úB³%b.«X2²T(Valu$q,ßsÛ75))·cÿž(., 0°Equal(b& ÏIsInstance(cË:ƒ)d¤Ï ŸFc, dEä Ç�êlm NLÔ K~(b'$–©\#µõ delete as a keyword argument, vÑ>?=b'Ç(ll¥S3¢}" õ class BytesTest(Basea, unit|CCaseà£[=ÉZ�getitem_es ^pmsg = "6ð indices must be integers or sl"›K—(àÀrror, msg):  ðb'python'['a'] ñdef test_buffer_is_readonly(self):'+ðfd = os.open(__file__,•O_RDONLY),Qwith )¢fd, "rb", b¶ing=0) as f[_nð .assertRaises(TypeError, f.–«into, b"")½lcustom±zclass Agñœ__bytes__2ˆÕreturn b'abc'Õ¢aEqual(Fc(A()),,}_ passCåO , P1GŸÄENone=ÂT6b'aA¼_index€/42º|'zå# Issue #25766BJG(strÕ“~“�'\u20ac'† Ì5á, 'iso8859-15'^O\xa4åL4731åó'`OtherB1Sub3(ó`¿ì wIs(type6>), pi ˜(xžq79), P‘# Test PyÂ_FromFormat(•x-bfrom_fqQcä1s =V°.support.im’_module('%Ï_WOcapi9 (<� R h èåapi, py_object$0( c_int, c_u Along Qsize_;s !cchar_poll& =¿.Q@.res~Bö0q# basic˜‘ŒW2(b'ë5'),N¼ %$Ò\°Hello %s !'Î_worldj 3*7 !'N#ÞÀ formatters  ó)self.assertEqual(PyBytes_FromFormat(b'c=%c', c_int(0)), ?-E\0')"b �ord('@')i@h+?255cO\xfffÿd=%d ld=%ld zd=%zd'3Ej 1)tolong(2t A�size_t(3â 0d=1ª2¨3ée-ê-ë&-ì-í-î-ïÿu=%u lu=%lu zu=%zuØuC1123ÛuÜ?456Þ%?789à Pu=123´0456´?789æEi=%iÿ¼¯ 0b'ise+-f%gEx=%xÌ_0xabcA †x=abc') Ñðizeof_ptr = ctypes.m·of(c_char_p.õif os.name == 'nt':J¸ö# Windows (MSCRT9Qptr_f†Ò = '0x%0{}X'.R(2 * zŽ :Fdef >Šter(ptr)|bpreturn j%9NJelse8Ö# UNIX (glibc)Owa'%#x' qaZœ5def.Iaptr=%pâŒÚã ('40' +÷0ö).encode('ascii')î�Hs=%s�b'cstr'‘ Bb's=&ñ# test minimum and max æinteger values/0max¥_&Ð_t(-1).value  ðfor formatstr, ctypes_Â, value, py_"“ter in ( <ÿ(b'%d', c_int, _testcapi.INT_MIN, str),4/AX4liHlongjOLONGk 7 nu×uoUp9z§issize_ŸPY_SSIZE_ @€¹?maxVpç†char_p, .6ptrùÂ)):Íñself.assertEqual(PyBytes_FromF[(@ b(a)[R €3ð.encode('ascii'C”ò# width and precision (õis currently ignored);ËÏb'%5s', b'a'º  Z#.3[_bcdef` Ubc') cc# '%%'Í5terÖ%o /%')O[%%]U ["ª!%c³Àint(ord('_') 9Ob'%_¾?%%s½ !€sInvalidƒs‚cartialOtingî ')m~…x=%i y=%+#2)¦/(3. 1x=2: ^òIssue #19969: %c must raise OverflowErrP<sìP# not=õthe range [0; 255]$¨RV)s(W CÜ s4'?-1)¾i>C256)7@def !_b�blocking(èDðclass IterationB'wed(list&ç_J…_ = None:ÿi = [0, 1, 2, 3SðEqual(bytes(i),ó b'\x00\x01\x02\x03') õ*self.assertRaises(TypeError, bytes, IterationBlocked(i)) Bò# At least in CPython, becauseD÷.__new__ and the C APIC0PyBlð_FromObject have different fallback rul•wintegerD"õis handled specially, so test separately.=•class IntâEnt):,!__•__ = NoneBaEqual((@(3),z_0\0\0pˆ3jPWhileA‡re is noÎ�-defined!B for2ing„±Q# subò&esaðly from other bux-ecrface 0,FÁan implement” may wellwA-cas¯Tm (asG 2.xG†str did)¢GthemÙ §*Sñu³,Qb'ab'·£á#”P+E! B\¹_array½�ba, bb =Ö:(¹ ZǨ/baò#cbb) Ò@yteAÄ‘Test(Base`, unity.CCaseéPtype2ËW1def¬ _getitem_e�(‰=’pmsg = "úð indices must be ¾ gers or sl"Pwith Q ýXRegex7msgrvoA(b'pì{')['a']»s»€j¿àÍYÞ"ØlnohashŒ JE1M¨(ÔçTM_api[phort_sakÁæ"Hello world\nÒ"s1ø+ b"\0"*(20 - len() ðtfn = tempfile.mk ( *ry@# PrK ?Xúopen(tfn, "wb") as f=+zf.write‘ Œ # 4™ readinto iriÀ û b = bytearray(20) ún = f.readinto(b"ÿself.assertEqual(n, len(short_sample)3 ‘list(b), 4ù# Test writing in binary mode³ù with open(tfn, "wb") as f:'å f.PeÓ BrB þ)C(), Ç uÆ!xt´õ is ambiguous; don't test1zfinally·+trÈ�os.removeó lêexcept OSErrorL;Qpass s1def€�_reverse(Ü)2 )†b'hello'n/ $b.J), None, —, b'ollehRrQ1') #©ñ even number of itemsËÙ~£w1x ¶S AFalsLpO_clearM hpythonü.8~½"')¾ó Ë/b'OIçappend(ord('r'áb¹(b.-p-ÔpÕD?opyC 8abcñ= .c9D b;·H WÇT³ðthat it's indeed a £ö and not a referencÕs¢"b'®Ubé7, bºy`IsNot( bµdµ =—d�b%Ý|regexpsà Gby(sƒðgreturn³0map‡8, s† 0("H¥�, world"ðre.findall(br"\w+", ‘3[byE@"), K]x¦¶@_set� Æž½–[1, 2, 3]‹¥b[1] = 100€; D1100FG-H2HÀearray([1, 1Ã00, 200])) öb[0] = Indexable(10ÿself.assertEqual(b, bytearray([10, 1TEtry:ah0b[3e0]òfail("Didn't raise‹fError"Šgexcept aEpass]!-1æ�g5256¥_Value�æ&-1\‹bONone ?Typ  \ðdef test_delitem(r).7b =ÐArang@del "N(B)dF?-1]G9F4Eð[1, 2, 3, 4, 6, 7, 8ù„�setsliceJ ‘list(b),  0Ár=Pb[0:5 D5, 1]z ` {4 5ã5, 9æt|O0:-59MÁIÁjÁ A-7:-+ab?101\[“;þ 2b[3�[%ø%À!3:R[42, Qµ8@™ÃQU'foo'i=  P2, 11�)1171b[:ˆÁmemoryview(bd¢0\ k03:4Å[,1\Âðfor elem in [5, -5, ÿ 0, int(10e20), 'str', 2.3, á['a', 'b'], [b bY[]]]:6úwith self.assertRaises(TypeError)/påb[3:4] = elem N1forà in [[254, 2556‰¯-256, 9000ƒOValu„ð def test_setslice_extend(ÞÇõ!# Exercise the resizing logic (see issue #19087)áö b = bytearray(range(100)"jHñEqual(list(b), 34¥del b[:10]iG!, ~K#b.òiO, 11¡ 7)ÝYÎfifo_overrunVPTest >ó23985, a buffer 9ð when implementzea FIFOÿà# Build PythonOÁpydebug modecbl…results.9 ¡(10Ppop()¾ð# Defeat expand„¥õff-by-one quirk\§]@ð # Advance start pointer OÀout reallocaàD2b +BAs(2)DÑppend exactly�@numb-‘f deletedssDˆ„Ó# Free memoryj , |wÖ9`verifi�+onÕBdel_ÓPReducH)äsize should no<µ=(ú} 8—S�= sys.getFof(b:í?[:1BLessf @ , K ¾ ed _ö% õð&indices = (0, None, 1, 3, 19, 300, 1<<333, -1, -2, -3 '30piÁS I" opßt !Þ0Ski#Åvalid step 0 "Ke( K;[1:è)8L =�7255À! ML•!ñ# Make sure we have a Y9 ofÙÏright length¹Q# butB0 di3†ent dataâtQ = L[i`:stop:"-*.Ÿ.reverse(ÍJ! =€ rQbx. Ó!b,ÙL#L)­YÀ del Lÿ[start:stop:step] _del b+ñself.assertEqual(b, bytearray(L)) bðdef test_setslice_trap(>!):"‡a# This)ð verifies that we correctly handle assigning GEQto a f1 ofð (the old Lambert Meertens ˆ%).>7b =À¶range(256))"@[8:]&Rlist(Ig8)) + Z $|iconcat ›gb"abc"—1”¿b += b"def"¨ G&JÏ1 !Isðx?xyzx)[6tryO"Kúexcept TypeError.EpassîJelseÙ`fail("£s#öunicode didn't raise_"¿_irepe›.E*= 3¨– B–:abcã*| ™hÀo_1chara x_ a*= 100^©|v"x"*100à&Â_allocº p-1.__ 6__(ŽrGreater»*), ¸Qq = [3’for i in Þê q¾6b"xÀ+F•"™(5ð, len(b)) # includÿPtrail Anull¾—N1if >@ not®:seq§%¢seq.appendk ù2nitC|t'g(Þg 3,E $(yyield iÈ2a =@bÇ6È,,Ÿ>Wa)+1)Ï: >k5o BLesss5i0„?= bŒƒ‡”�ˆûhðinit__(g()) ñ self.assertEqual(list(b), órange(1, 100))) 7!en6&99%Áalloc = b.__ 6__(C�Greater(%1, lL!) nðdef test_extend(7!):Œ@origcu'hello'a�ytearray(&z#a.LaW 0a, 6! +) B[5:]-& 6b''ö## Test iterators that don't have a __length_hint__Õ¹rmap(intvW * 25œßñint(x) for x inÉ-R÷F* 50´'/[-ö•é À5] Œ•Fì•tlôRaises(ValueError, Hÿ, [0, 1, 2, 256]¬@/-1?wen(a), Þ ÿ([Indexable(ord('a'))g @a, b% ölremoveöbÞbý#b.8{'l'_àbyGhelo¤@ ?dƒŽlambda: eÁB4žÕ4TypA ~('e"# :õ first and last\ µo; hÏuer"´bµz tÚT…'hM#j vpñs outside of the ascii 0: (}&27]èp�[126, 12789ücž1BŸ”c, bytes(NIvJxJ À6, 128])) ó def test_pop(self): õb = bytearray(b'world') /ð.assertEqual(b.F¿), ord('d'),0-w-$-2.r.ò Raises(IndexError, lambda: œ/10”9 )ßÕ#;ÿ for issue #6846 Ksb'\xff'R�, 0xff) :’lnosort•uµœAttributeòn!).J)blappendb ÷Ghellö#b.7åoŠ@, b'@oAÂ&R 10FNoned Ž5‡A‡ –len(b), 1?…G=TypBd)b'è”�Uable(ž{&,A'ž inZž wmsssspp`#b.:1‰i4 /-2 O1000!WÜ@miss7ppi¨,ƒ Í0%1Ê Ÿ`â?0, ‰2]copie'1# Iôò4348. Make sure that operations°don't mutat"!e Uñn¡# copy ther%s. l_b'abcDòIsNot(b, b.replace(.9`cde', ýYt?"[iÇö in range(256)]Vx//b'… ýx, x.translate(tyPparti_`ü _doesnt_share_nullstringza, b, cŽU"x").UV(b"y"ºh”"! Oc, b!fca•b += b"!"\ s RÆað# Same for rpartitSion õb, c, a = bytearray(b"x").rpartition(b"y")3ÿself.assertEqual(b, b"! c!PIsNotBcaŸb += b"!"s RÇV—ð def test_resize_forbidden( !):%eò# #4509: can't /& apö when there are buffer exports, eve°Ò# if it wouldP€allocateC³ underlyingH.‰0Furgñmore, no destructive changes toH…çmay be appliedK°before raisl–the errorobTr^F(10)çöv = memoryview(b\('(nJN¢b[1:-1] = Ræn + 1, 2*n - 1C?&10@orig”5[:]ɬÌ�Raises(B~EÌ,­7, 1Z3ÿ[i"U 92T+ï†T0# O` operaéRs imp=@(b.pop, ~ &ïb.remove, b[1]+>‹delitem(>1delOØG~p# deletõa non-contiguous slice|¨ ©ç :2é/b" 51delO±ˆ@Ã@.suplÑ.cpython_only£"ü_obsolete_write_lockè`from _.@capiJrort getK°_with_null_ï_Ñ @,@A()) O® itÑÌor_pickling2­± ôV'abc'80dat×list(b'qwertyÃfor proto inŠlðe.HIGHEST_PROTOCOL  †¤# initial ©¿#itž( — Cd = mrdumps((2!, ,,™ 4Ðit, b = picklÇe.loads(d) ¹b[:] = dataó self.assertEqual(type(it), Zorig)M 5Blist5a)) cù# running iterator0nex<g ðd = pickle.dumps((it& , Š), protošVit, b8 nM[1:]_empty ñfor i in range(1, len(ð)):Ü;ËúC�xhaustedG¡ÁRaises(StopIPion, :", P BvnL[;dtest_eó_G0 = .2_ Ðs.CommonTest.5œ1def<LÐ_length_hint(?oø# Issue 27443: _,ö__ can return negative integeéöba = bytearray(b'ab'xAit =É6(ba¤U÷–ba.clear($Ð# Shouldn't rêw an errdÍ â/X!, að class AssortedBytesAP(unitE.CCase#‘ # ñ various combinations ofìQs and ö7€p@check_Ps_wars!šŒrepr_strŽ#f#Pstr, &  ð f(gƒf()), "Vb'')"NT? =[0]B_\\x00G€, 1, 2545Tü€ ³q`1\\xfef€Q"abc"_'abc'ù "'0ù'''b"'"''') # '''­1@"'\":Ñr"""b'\'"'"""=ÿ]forma‹ýbýB2c',^Àrray(b'abc')7: ÿself.assertEqual(format(b), str(b))0O, ''4Wwith iùRaisesRegex(TypeError,g¢ úr'\b%s\b' % re.escape(type(b).__name__))éGÜq, 's') rñ def test_compare_bytes_to `array(¼O 4¡b"abc" == =(v), True@8?" !7#<7$¤ Hc" >n"Û7n6y‘cOFalsK‚8>§c¨78Gc" §Oc", o¶oNsepd¤Öæsep.join([val]Û`& \$) ~aFixedSUk(&.e-@Baseð): def fixtóype(self, obj): ÷if isinstance(obj, str!(preturn @ .type2test-õ.encode("utf-8"))X3 uper().fix94!) %ð contains_bytes = True class ByteArrayAsStringTqVFixed`, unit‹.CCase¸k¤0 = _aK\sX3$s U1Subº‰:á@def �a_basic}ŸSL`assertùC(issC*g,w@base×cC4IsIÃ*,()@�ƒ@a, b!ñ"abcd", b"efgh"ž P_a, _" SaTfbÕ7#öô comparison operators with é wssj†_a == _aX"_!= _b" ‡ ?b >¨`IsNot(Na'ncat ofàEqual(a + b, _ü )(QÍorepeat§2a*5¨#*5âýAjoinÒüÀ# Make sure  -ps a NEW¡ö ect for single item sequence.Õ# involving a@.§h that it islðthe appropriate Ê8Bs1 =vHb&g2%›0().ÎW([s1](Belf.Ó os1, s2!(r4(s2c\,£ajoà reverse, call †5 on s3´1§Ó¬‹3‹�âRpickl]äajûÑC…a.x = 10 ?a.y7—1òproto in range(„÷.HIGHEST_PROTOCOL + 1”4Ð.Tloads;‘dumps(a, Zf5u2NotZ0id( Oid(b.+i¿ Q#.x, b.x'y'y' tð(a), type(b))  ñ self.assertEqual(type(a.y), pb.y)) 2àdef test_copy(:!):@a = .62'–(b"abcd")$w.x = 10y7Gefgh7@for sÀ_method in (.,P.deep’–1b = ;&(a�±þ#NoÏid(a), id(b).,Oa, b# .x, b.x'y'y' \ž  &Ì |fromhexÏ9DÏ.*†'1a2B30'¬)Gÿb, b'\x1a\x2b\x-"Iso;b),<r¤�class B1¢P.base“ è›û__new__(cls, value%N$meqJ.8¡3íme.foo = 'bar'’return me)2A/B15L/B1… ³,²P2Pðinit__(me, *args, **kw Z"ifÄXÖ is not bytes(80?.__p s ’ x2xM2x Á±yteArraySub(aMWpass .s*s&`OtherB`+& TTest(7 `, unit¹.4Cas@¢! =Í´p‰= = a ™TÜ�override|Ñ / s#M & neŽ/=1 oi«’=4, Î !}source=(æ  M×?4, T"EÀTest(SubclasðsTest, unittest.ñ Case): basetype = bytes2.@ = BòSubclass if __name__ == "__main__"PhP() # Hò_getopt.py # David Goodger 2000-08-19 fromG±.support imðverbose, run_dockó, EnvironmentVarGuard 1ž ˜ñ sentinel = object() ó! G»7$s(@ Fãdef setUp(self[_o.env =—!()o)ô if "POSIXLY_CORRECT" in A^*5del[8!] W•�tearDown˜—.__exit__‹]J±assertErrorMÐ, *args, **kw ö1rRaises(h.LE@lÈá_short_has_argsbDTrue` 4¦'a', 'a:')hP›OFals: 9Àsot;b')ÎDlongÍsÎå³, option = 0 6€'abc', [?=']ÕP!bEqual(i¯$bc¬Y:Љ^PŠSd‹8d5 ü ŸM ?def‹?Ù:1d',e‚Rst_doU €`opts, Å{- []Û×P[ŸWps, [('-+?'')- p , P§‰1Š: ^ K‹1Œ#B¦=Ž#2 �/v À, ['1'])  ðself.assertEqual(opts, [('-a', '1')]) * .0arg.5]) $Añ = getopt.do_shorts([], 'Z€a:', ['1f/2'e R“'T–º\rror(š", ›�¡[“> ÍÙðdef test_do_longs(‹%):šÞ 0,”!bc+Pabc']¨‘N,-/?, 'Á5 ‘=(o['abc=” V6•d–dº—D½b”Oabcd7 Ëõ6# Much like the preceding, except with a non-alpha character ("-") inªÀ# option namP#atQùes "="; failed 3õ http://python.org/sf/126863Yµ afoo=42Ipfoo-barN/',0foo8/42Jµ( „—Ú&bcâ D é\+K¼ Iq# note:éðempty string between Óö and '--beta' is significant”ù# it simulates an Q�argument -€ ""') on®0`# commsUline.0cmd@ = [•hP, '-bž-Š=歹!'3"5a',Lh'Ü� rg¦'arg2']¢ S™=:�!['=Y3;,H?'')²¹#('ûn12')>ÎB&= IÀ', '')])  ð# Note ambiguity of ('-b', '') andaðbove. This must be Fõ!# accounted for in the code that calls getopt().9ðself.assertEqual(args, ['arg1y�arg2']) 2Rrror(U.à, cmdline, 'a:Êa['alphÅEbetaLÒdef test_gnu_=(Ž%):k # Test hanSgöGNU style scanning modeÑa = ['-vÊXÕ%--” --–F=2']ã%# gŒ`opts, # =H.ºwö1b:'Aö=÷©æt%])t )…#[(Ú0'),!fU'1'),9f'('ú>ê82')èð# recognize "-" as anUumentk“…-b‚6-']'î UJ-= �-ÒSPosix@_via +Çß/+aà £ö·›,# áõPOSIXLY_CORRECTïZ[env[""…"] = "1"*¼‹ø?\»@gülibref_exampleslsø"øE(Q fromMð Library Reference: Doc/libÃF.texI3An p0 us¬uonly Un…–options: 4£>>> importg‹‰ö'-a -b -cfoo -d bar a1 a2'.split(E6G“8C�d0bara'aHH}optlistWœÚZc:d:'‚:…Ä’c‚3foo˜%)]?�o'['³UuRlong j° names is eî|ly easy €'--condi =f-®Åð--output-file abc.e#-x‚~¥ð = s.split() ³ >>> args ò['--condition=foo', '--testing °output-filepabc.def -x!a152']Wh�optlist,q¢ = getopt.(†0, 'A[71...˜'“[�=ž%]):q([(Ý9à0), DC, ''g-è©:'')ãÅo' E""" "¶import type‚2m =ð.ModuleType("libref¥F", sèprun_docÂ(m, verbose)d@def õ_issue4629(self):‚àlongopts, shor�sšphelp=']C, ['‡WÖ.assertEqual(Yv1D'')¤$}x~0x´rRaises(‹!.G™jError,¦ü --Í ò']) if __name__ == "__main__"p@unitŽ.ñ() """Test the arraymð.� Roger E. MU+# .GQ fromß 0supP)tweakrefdpickle„operatorestruct$ys …warnings€«} ~_b_reconNRor asÛ ò sizeof_wchar =$.A ('u').item$  class A!1Sub(*0ÍOpass,`WithKw™6!�__init__,{€code, ne7S=NoneeŒ{.;0) É<Dô'ubBhHiIlLfdqQ'œ@Miscö(Ç.0Casdú ”'W_bad_L ‰¿*¶¦¥ñ2Ÿ, spam=42;!O'xx'8 ^Value¦û ·\emptyø°# Exercise lò for handling zero-lengthUXahB¨@a[:] ‚ç^Ñ�en(a), 0Ý$? + (:* 3Poa += aƒ° # Machine1mat Ðs. # # Search‚ "enum m+ð_format_code" in áModules/arraym ù>.c to get the # authoritative values. UNKNOWN_FORMAT = -1 UNSIGNED_INT8 = 0 S "™16_LE = 28@16_B3<*4(5>"32T6,7@*8(9>"64T,10-'11B,2*ó3 IEEE_754_FLOATX4.5cDOUBLE/60T7 UTF+#189ó#20°21 class Að ReconstructorTest(unittest.ðCase): def Ñ_error(self):ð.assertRaises(TypeE+!, o(_rl,:> õ"", "b", 0, b"")+e9?strfPú.n/''ÕHi o?0, B Vâ¨# n?±o6  –X|:/22pW`d", 16p;a")Ž|numbers�ª•cases = (Ah�(['B', 'HIYL'], Λ, '=BBBB'§±[0x80, 0x7fžj0xff])%@(['bVhil`,^=bbb]-^X³ �, 'e.È=hhhÇ! È% [ÀIGNED_INT16_ØBE, '>hhh', ú[-0x8000, 0x7fff, 0])$ð(['I', 'L'], UNSIGNED_INT32_LX]tryð a = array.arûray(typecode, values) ýexcept OverflowError:&5ýcontinue # Skip this test case.5ý b = array_reconstructor()^).&, ·‚mformat_Å>strÇÿself.assertEqual(a, b,jñmsg="{0!r} != {1!r};ÇÆ‚={2!r}".wF1)) R1def@_uni™(~)6ôstr = "Bonne Journ\xe9e \U0002030a 147"V:‡Js = (ú(UTF16_LE, "UTF-16-LE")ã%B%B%&32J/32J532_J032-J©‚1for ·5 in sÚ É¥encoding =0[.a;Q('u',* ýe<O!, P “{Astr.›!e(Fing)ê™êhd+ò class BaseTestI²# Required ñ attributes (provided by sub!!esS#NU: the1 toR%ñexample: an initializer usableÙ7he Ç ù3ypeFusmallerMqósame length as c, but 0>Obigg=/<ðoutside: An entry that is not¿x/mäbemsizeòmum guaranteed it!õa_f,p12  .š*Z4badõ Nùgturn a¼Üñdifferent from our ownä®!re9Z%s[qs.indexl. `)+1) %¬(&)]¥#_>ï ¶ÿ]–K¬‚!, 4 rGreater�$a.¦;ȸºUr±Raises(Typeì,£*l, Noneõ?lenù$�a.append?.‘?[0]©àmSa), 1†ÖgÀde, self.exasmple) ð self.assertEqual(len(a), 1exa3!) 5ðdef test_buffer_info()!): X¡a = array.°.typecode, ..W5Š÷Raises(TypeError, a.oF, 42 bin (UÿIsInstance(bi, tuWbi), kN�[0], intx/[1*�!bi%€-a)uqyteswapSr"ifVev == 'u'“—s‘ = '\U001'�Oelse1ú@1ç /âÜ ß÷ if a.itemsize in (1, 2, 4, 8àb w �4#.bw6 x:==1"±ºFa, bî#S9#Now<bš?x—žMcopy%`mport -ŒÄ l 9iF.&(aô/Ú!idP_id(b)*ÅAdeepcXíiÉ>jÍGœreduce_ex—ƒ"Àfor protocolwrange(3%Þ8ÞuIs(a.__†4__(@)À«±§gÿ , pickle.HIGHEST_PROTOCOL€-ì_reconstructorþu @¤, ¡K + 1¥€"^gcloads( …dumps(a,¡ø8–& . * ÃAú�Subclass$sÀ self.examplGe) ‰a.x = 10ób = pickle.loads( údumps(a, protocol)Mÿself.assertNotEqual(id(a), id(b.+Oa, bQ#.x, b.x' Atypew yà’def test_Ðð_for_empty_array(À!):+#5forê” in range ÷HIGHEST_PROTOCOL + 1<@Aa = Y._.’;cod‡rjñµA�Subclass· >ãƒiteratorG!ûOorigú , hw.exampl0dat2Plist(Dä@2 = e[::-1]³¤¡!¤# initial ÓX  it‡! = “ d'(2 , 8)'Ç4@it, æ‚_d$aa.fromò2=eRc(it), ~5 ^5c! +\92) ‘# runningó Cnextó n·O[1:];—i“p1, len(k)*IÐ[ŸexhaustedBçÁRaises(StopI{Pion, 5", r À(itorig, oriÇg), proto) úit, a = pickle.loads(d$úa.fromlist(data2ñself.assertEqual()‘it), []) nð def test_exhausted_iterator(@!):'˜�aarray.°.typecode, .†.exampleˆ „Aa), �56€exhit = ‹'(a/mp‘for x in 9@: # ÐA theGÒËÏ`next(eQ)04not4%ed)‚a.appendíooutsidÞ…ejé 1, [_]ð 6>- +GÇâ in ÊÖ-#a.M0ø/[0½ 0en(¼Q1+lenˆ0óŸa[0], a[1[ôRaises(TypeError, �T/_, NonÜ5 08më("µ?(-1Suy,¬ ,Z½˜y[:-1] +á.[:I-1:]I�my-/00t ‘a! ì Ú@1Ù_Ô Ù> tokAfileºB!2*\MaÜ` tol/óupport.unlink(sfTESTFN'`f = op_ !f, 'wb''6tryÙ—.q&(f%Šf.close(Ab =   +‘ÀN, 'rb')  ôself.assertRaises(TypeError, b.fromfile) 1�(f, len(GŠexample)-bñEqual(b, array.;¡typecode, /J2NotMOa, bpÒ=EOFÑ/, º/+1Lo†f.close(9‰finally:3sif not .dTHôsupport.unlink(�TESTFN) c”def test_­@_ioeÁ[)kô # Issue #5395: Check if 8! rÁ a proper OS8fŽÔ# instead of V.?a =Ú P = op5ÝÎf, 'wb''+trCIÙ 5, a©ØV�|1Œilewriteu A, 2*×ñLf%$"f.†aóºâb±A�rµ+Š�+nYbÿQ toÉOlist„4Á ˜C@a.to“F, 42“3 £51f"†, [None]n‚(À(Ö¾¼�Žlstring�¡# Warningswód when arguments are incorrect as Aq Clinicopò # handles that before the wfð can be raised.  ðnb_warnings = 2 Twith e.catch)õ(record=True) as r:8<Qt.filterF©("always",.2ÿmessage=r"(to|from)string\(\) is deprecatedR,cgory=D:BionW¬)“¡a = array.ñ(self.typecode, 2*zexample;b; +Eò assertRaises(TypeError, a.toïO, 429 b.+;7$rU(›/()bªEqual(a, b#úif a.itemsize>19DValu‰Z, "x"^AÒE+= 1ÚZž‡len(r), 2!) /°def test_toNQbytes)±%$!­” ª4 :642 hK U c , 0YK7s()K–© GcÔb <W^‘1, b^  ºI ..0  6, aÔ@+ �Orepr¥4pQeval(daa), {"(":)#})@ˆ  Ûcb¡('%s')" % •†i©/stü6Ltr(a_?cmp[® óÉ÷Is(a == 42, FalsI &!&p¡a &b== a, %  $À!= a, False)# ÿ self.assertIs(a < a, False)$=%?Tru$>#H >Hm±al = array.(¢¡typecode, ×smallerexampl†/ab=Gbigg<zZ _== 2*!' K]¾æ /aló0!= &¿ $˜ Ko ?2l, %à bàbLk?< a$=%>$ J&àÁdef test_add!):±aú0% \7;+p9o[::-1]iEqual(W*a,Ô d" +x s%) Uì4bad,/()ªðRaises(TypeError, a._RW__, b`4 S"bad"8¢i£+ ÷ìú?a +$ !2*¼Cíï2íÌ6Æ+�™½ ÁA �±ï9› ܇Yk¼ˆ4mul*À a = �5*array.ñ(self.typecode, £example) ÅassertEqual(!*a,^!5*J `%) BAa = š %*57X¢0H &*5 ¢0De’O(-1)•~?5 *ÍF[:1]݇Ï0Ÿ[a[0]] * ËgóRaises(TypeError, a.__mul__, "bad"Ñdef test_imul?%):‡¾5bó?*= ÚIs(a, b'?˜E*= 0´:–/a,)WI *= 100gQ/-1ÌMÈŠašxJŸÙ½ÚgetitemÝ2ŠSEntryÈ:[0]m/[0ÿ5.,-1k-kl7$1len8.E)H$-I Æ1ðÀ_getitem__)  ñ"self.assertRaises(IndexError, a.__getitem__, len(1£example)) G H-IA-1) L¢def test_swp!):l¡a = array.¢.typecode,‡ž50[0]8E[-1]²ðEntryEqual(a[0], a*’vž"-1í0ìZvcIýb ˆ†p%œ–GType•/__‚ 4o, None:#0=b:N ZÅ, L ×[ØÄ T‡ ¥Š p¿0del6 ¿-@del ˜bU¶aO(.F[1:]Oü-³ÿj´1?:-1µ> Æ¢¾à] self÷.assertEqual( *a,`rray.añ(self.typecode, Åexample[1:])9%) %möRaises(TypeError, a.__delitem__?4o, None: _IndexoR, lenÓÄ)H$-I#-1ñdef test_getsliceq%):Aa = ]cžÁsa[:], auÍC#ra¯èFq?:1]q#/:1Yq-r&-s$?-1:å$:àÈ?-1:èb"2º`"O10007bÉ ë3a[-U#':'9" & 8:[æ¯�2;7 §®Q�2 �extended©t# Test ( ÎÐing by compar ”with listeX¢# (Assumes öconversion works correctly, too©!"Âindices = (0#ð , 1, 3, 19, 100, -1, -2, -3 6100sÓfor start in K²Î"/op!%�# Everythöexcept the initial 0 (invalid step€=fef¸ ‹) ¹‡1(a[Éð:stop:step]),   ð list(a)[start:stop:step]) ;ñ def test_setslice(self):!¡a = array.°.typecode, .–.example)5@[:1]9(ÅassertEqual(e,p) +F[1:]ƒà^ŠS@Oa[:-Ä`-Å<Pÿ`‰A+ ŽJŠ//1:MO²ÃIN6ËÜÓ“£æ F2 DÊ:?000ÍD!2*éµ9/-1¶G´E:´6Og9:h´CG?1:0³C ·Àample + selfó.example[1:]) %) ¡a = array.ñ(self.typecode, D@Àa[2000:1000]@N/ÅassertEqual(z*a,w!2*J y¹-V ö#Raises(TypeError, a.__setitem__, slice(0, 0), NoneG"1Gb= 4bad€/()t,»bD,¸byðdef test_extended1R_del_.%):à indices = HDð , 1, 3, 19, 100, -1, -2, -3 6100®Ófor start in K\Q"/op!%ö # Everything except the initial 0 (invalid step€=fefO ‹)P"9®L = list(aŠ$ò# Make sure we have a­± of exactlyâÊright length{Iõ# but with (hopefully) different data.Ð3Q = L[£`:stop:@].Ÿ.reverse(ÙJ! =€QaxLI,Ix´.´/a, #L)  ?del>el Áèž%ªQindex×™Y: = jƒÇ @Q§Y….RxµH KL‘.@@(x),àÐU7ƒFValuÝDÊ5\soutsideÿa_countam… À for x in §example: óself.assertEqual(a.count(x), 2);7¿outside), 033Non+_ðdef test_remove(R)µ�for x in .¢ÛX = 2*&_!¡a = array.g•.typecodeû¿4Upos =zindex(x#|2(„[:pos] +8Š[pos+1:]Ž.î O¿ Ÿ,¶E2)) _é b¶ËxóRaises(ValueError, a®,…ït?û7÷1pop�ôà µ I£µ?pop ;e 6Typppop, 424 fA Ë�, len(a)g 5-6'-1 nTEntry ‹#0)æ$?[0]r4vÅ*a,n�aH1:]+o    ²1²2²O2³/[3Ä, v1Ä ¯ ü-9í  ¯# ë)[:tgßmrevers×ã ‚¦ Œk Œ¼‚HÇ7: oextendê À, a.extend)  ña.extend(array.ñ(self.typecode, óexample[::-1])) @ÅassertEqual("*a,e+rH%) Aa = ²¸±òpÅIk¿b¿4badz(gôRaises(TypeError, Ó7, b_+ õx/IfqÖñdef test_constructor_with_iterable_argumentÄ%):B  @3.ó{§¤ ç #a�`# non-w· ·°@ðG€�#10-ð# pass through e/0s rAad in _9%__w cl0A8Fw*%X T@ Uni3—TË', ÎAJÏ Vnext(„¸+B(­©È¥yield NonevÀ)BÀ�¼0verùŒtraverseS:try€•import gc“�except In 2³ðskipTest('gc module not availv'+ 'Pl = [¼E(a)]ŽPl.appDl*�gc.collec‘*lbufferö‚ œP®öm = memoryview(a€€expected!‡.tobytes!Âa%$, =O0 6[0]36[0]6ò# Resizing is forbidden when there are vUorts.Þó# For issue 4509, we also check after eacÚW that> th`ðray was not modified.  ó self.assertRaises(BufferError, a.append, a[0]) 6 7ÿ Equal(m.tobytes(), expected0g4extg/:1iIoremoveÐNopop, 013€fromlist¤ to /()oLàp q)"ifDõtypecode == 'u':bjf60uniA˜ š I~1ÿoperator.imul, a, 2{FlVGlqsetitemÛpslice(0Î?, aèO5del|ëPoë1K ºðdef test_weakref(Ã)Ö¡s = array..,vexamplejCp = P†.proxy(saÁÛpŠs 3q = None² h“Reference�len, p) 3P@unitæñ.skipUnless(hasattr(sys, 'getrefcount'),6i 'G· needs sys.82()'³T¡bug_7823698W÷for i in range(10tbwC'B',,'64ìMrc =ˆ1†i5 ¶?rc,yrüsubclass_with_kwargs ð# SF bug #1486663 -- this used to erró oneously raise a TypeError ðArraySubclassWithKwargs('b', ne A=1) 0ñdef test_create_from_bytes(self):&Y¡# XXX This1ó probably needs to be moved in a s� šÐ# generalized3@use h¥.typecode.pPa = aÊ.å('H', b"1234")&=óassertEqual(len(a) * a.itemsize, 4îñ@support.cpython_onlyL1ìof_with_buffer  ™ƒÀ,Ïvexample¨@base[5 = „palcvobj‡('Pn2Pi'1|_ .Œ©_info()[1]âÃ¥\Aheck=!ofÀU, a, …#+ O_"?out!àÛÍÏQinitipÓ0unigÝ"if¸Çv != 'u'þ]'qR‚%s(�z) as cm592 G'fooú2Tf°In("cannot .pa str",æ(cm.exception)[A¬EŒ’Bu', ½ }¾ �ÛÈ JelseMI G"foo2 ÏR/üobsolete_write_lock\S _epcapi im‚C get„«¡_null_viewyº!'Bàg‹B5,b<, a&üfree_after_iteratingÇ €2 , B,à),ÔØ w,×��reversed…9 Mð StringTest(Base +):J0setzÉc€super(). _$8© Àe, self.examcple) ñ self.assertRaises(TypeError, a.__setitem__, 0, /ðexample[:2]) class UnicodeTest(String °, unittest.aCase):|@type1a = 'u'Wò\x01\u263a\x00\ufeff%smaller, e,Obigg+1Wòoutside = str('\x33'%0min0siz!2 «@def Ö"_u÷(ÚYV`rray.aÒ, 'b', 'foo')[?Aa = &0('u%ã\xa0\xc2\u1234Ÿ/T.from‹/' !½\x11abc\xffzs©4.to|3”ªEqual(s, ' Z ˜@$a.‡ , �‡of_wchar7Ž'1Â="\'a\\b\x80¸ 00G 00W>Ç©lsÉ:>‰repr(a),"¼¶‘1\"\“•–\ë”()"Í™ò5”¬issue17223—õ# this used to crashº)ifXR == 4¬éS# U+Fñ is an invalid Ë„point in E 6.0_A.‘_str = b'œX·*Lelse}#PyeS_From ñ () cannot fail with 16-bit )_t‚—@skip� ("specific(326""Ë*^ MFValuN)3 st†eaNumber»1Basm"):7þŒextsliceü Ƭ†¯, range(5)š‚[::], a# 2$ݽ i[0,2,4]i ?1::G ?1,3E O::-1Œ Ÿ4,3,2,1,0K� ?4,2GO3::-H ?3,1� P-100:Ý� %.Ð-1], a[::-1])# ð self.assertEqual(a[-100:¡2], array.(,ÿtypecode, [0,2,4]))M a1000:2N I –10:-K-š L–ñdef test_delsliceÅ!):?a =ä wrange(5ä¥del a[::2]D D8 01,3¡ƒ$1„* ¼†'- (‡3E‰/10“l–)ø2,3,4,5,6,7,8,9¤#F¥ issue7788ü®%±9::1<<333] L©¯assignment«" ¨â o[42]*5Ä Í p42, 1, 357 G.Ã?-4]Ä _10]*3Ä' 0, 10, 2, à ¸6, 7, 8 ,10 Â4�Á1Áéò13œ?1, ‹ bG&[:$c0insõ2á02:3à5insâ"b[nL2,3)dc[2:3:3þÿiterationcontains/ m‘list(a), Ñ'@(F[20]- `BÏ] in a, True+‰b[0] not.ácheck_overflow ç, lower, upperÈð # method to be used by subcl›ðs # shóould not overflow assigning lower limit ¡a = array.ñ(self.typecode, [4&])0R[0] =KA# shyu‚ess than4 oãassertRaises(O¸hError,œ!, . �'-1Ÿ"P ò.__setitem__, 0,—&-1ãÎG?uppG4¨aGGBmoreG4G:R+G,E!) Ïàdef test_subclƒ!ng\!): ~É* =Ù!9à ExaggeratingAª(ª°OSò__slots__ = ['offset']“ ›Ô__new__(cls, ˆ‚, data, 7 Z:hreturn“.I 9wainit__ yÖ—# = ÕgÙaiÅ9" +•vm0’¡Hö[3, 6, 7, 11], 4\) °EntryEqual(7, 72(“Attribute`setatt"ó, "color", "blue"Hr„�frombyte8ÑQö('b', range(10)ºb) a*¼ßb, b) ÏöIntegerNumberTest( —¹R _e ¶ t/·‹¶a.append(42Bwith݉a2Typ\†µD/.0F'ñG42.0 Bableô)__7num‹â¡_num = num%5S/¬605subƒ^other70Int›B(intz0 - /}?addM+MfSigned (*¨pexampleãð-1, 0, 1, 42, 0x7fò] smallerexample = [-1, 0, 1, 42, 0x7e*Obigg)3)f)`outsidL123 eñ def test_overflow(self):†¡a = array.¥.typecode)'ölower = -1 * int(pow(2, a.itemsize * 8 - 1)51upp50 6iŸf.check³}!, O^*�Intable(24), ;ö) class UnsignedNumberTest(Integer$Ÿ›d17, 23£fzÍ.Ñ -Õ[ÕO0xaa×C0€*/ =ä/))°Y£ÄÁbytes_extend©¤%As = .·)/!é !, N61$a.n xÅassertEqual(<2,[ r+¿6à·reversed(s)ªÔIf[::-1]E$) ŒAByte‚S“`, unit½. CCaseðŸa = 'b'p5min‰4= 1]éeègBg PShort¥(Å#h^2ÅfÆ%Hh /InÄ)i\ ²dˆIf OLong‡(l]4‡eÄÀypecode = 'Lð' minitemsize = 4 class LongðTest(SignedNumber°, unittest.aCase):NptypecodK/'qa8a1UnsVeI(kQk !FP]U­`exampl¬ñ [-42.0, 0, 42, 1e5, -1e10]Ösmaller0 20Obigg/ ^Qoutsi3123 pð def assertEntryEqual(self, e12ÉÈ.5bAlmost6 0`¾A_nanXH¡a = array..×ñ, [float('nan')])¯b7#¶öIs(a != b, True[ $=$OFals%>H$ I compareƒ8w0str>PvalueQ]stead‚#Noµ@a.toÆfs(), b buSSÚFÁÍfb.D>UdU8¤ìalloc_overflowHðfrom sys import maxËg Ïö'd', [-1]*65536R:trydDa *=O!//.E + 1Zq Memory„ @6pas*Ã¥pfail("Ao@ of º$ >u cÖHed -e¦ expected"¼ }åð 2.71828183, 3.14159265, -1])  Qtry: õb * (maxsize//3 + 1)!úexcept MemoryError=Fpass-:lseðself.fail("Array of h3 > r¨ created -eò expected") if __name__ == "__main__"m�unittest.ð() # -*- coding: koi8-r” import 1a from ;1sup"áTESTFN, unlinkôoad, rmtree, script_helper, captured_stdouthM4lib$os &sy …ubprocesò tempfile class MiscSourceEn×TTest(Ç.qCase): Œ1defÖ€_pep263(†),ôÑ.assertEqual(5�"ðÉÔÏÎ".ek¹e("utf-8"),%¢b'\xd0\x9f£b8\xd1\x82e%d'8U� /\ð~\`(9f`kýÜcompilestring±# see #18826úCc = 5e(b"\n#Dð \nu = '\xc3\xb3'\n", "dummy Vexec"äed = {}\V(c, d" pd['u'],cKf3')Ìœissue2301Ë ÑÄÂÀcp932\nprintap94\x4e'¹ÂûaSyntaxûV as vH4 Å”v.text, "kPu5e74-úe(÷L4626÷®"éñ=latin-1\n\u00c6± ë ­#C\xc6°/c6°O3297¹ Aa, b¥ U0001010F'\£ ¸#aµfd['b']” ÉÓlen(d['a']), 23Vascii57 žÏL7820ð4# Ensure that check_bom() restores all bytes in the right order if ™#?‡2ñpydebug mode: a buffer starts withUQfirstµLrÀóa valid BOM, but next�`are diO2entÁ=1one#²fcommoni�UTF-16-LESq‘wRaises(Š€, eval, ˆdff\x20€o1twooÐs in common wóith the UTF-8 BOM ñ'self.assertRaises(SyntaxError, eval, b'\xef\xbb\x20') ?ðdef test_20731(J!):\õsub = subprocess.Popen([sys.executable,04Ôos.path.join( ÿdirname(__file__)@L� 'coding©o.py')]9xstderr=ºEIPE)©2errÙõ.communicate()[1]# UöEqual(sub.returncode, 0O,‡NotIn(b'‚l', errqe�Œ_messageyòcompile(b'# -*- ûÐ: iso-8859-15°\n', 'dummy “'–Eú/bf4! …_utf-8w±›ZRegex g'fake'w÷½ },|9Rƒ@ �?–BÇ¥&?BOM¢Œœ£!8>Ï*N‡ ×/Bbad_• »pmodule_ãF = ')'Bpverify_ 3(: -&o2p2q$™°(, Ÿ#| Ð__import__, 'iI.' +Kˆ+? = (@8`-bA ¨A + '+;EÅEÖ, "rb") as fpØ‘öbytes = fp.read([× Ò½!, B&, l'¤‘N\_valiUÀ d = C{} õexec(b'# coding: cp949\na = "\xaa\xa7"\n', d)6ñself.assertEqual(d['a'], '\u3047') ,ðdef test_file_parse(<!):„ò# issue1134: all en‹÷s outside latin-1 and utf-8 fail onEñmultiline strings.Plong ös (>512 columnsÊÖunload(TESTFN°rname = … + ".py"s”f = open(+e, "w",¿–="cp1252"U°sys.path.in:Ö(0, os.curdir&6try"jwith fçf.write("# -*-Áw'\n}26£'''A short3/! qA very t…ó %s'\n" % ("X" * 1000)�ö importlib.invalidate_caches(*"__,/__°Knall9Ddel t5[0]»Leunlink½ i ücK#o#[~Ármtree('__pyë-__3²error_from_N:ñ See http://bugs.python.org/UE6289öPinputÖìñascii\n\N{SNOWMAN}".1e('i'†¼øàRaises(SyntaxE¬j) as c¨�compile(}B, "<ËP>", "{3€expected£'š'Ôõec can't decode byte 0xe2 in position 16: " \íeÀ"ordinal not4¦range(128)ÍØÀTrue(c.excep[ð.args[0].starts(«/),qxOmsg=Fó ) class AbstractSourceEõ[Test:<‚default_ ñsrc = (b'print(9÷("\xc3\xa4"))\nÆéócheck_script_output(src, br"'\xe4'"¤À$rs‚_Q‡#§ì:iso8859-15\n''®8Žc3\u20ac´csecond7µ ¤ËwOthirÊ ó# Only first twoõ1are€ðed for a magic £comment. Õsrc = (b'#\n'ÿcoding:iso8859-15=õ print(ascii("\xc3\xa4"))\n')kñself.check_script_output(src, br"'\xe4'") 3òdef test_double_Š`_line(K!):'Áð# If the first #� matchesbsecond¯is ignoredeï #'olatin1K�c3\u20ac Osameø¶Ì ÈkµŸ_non_utf8è Ë-˜ s‹eaĬZ?isoÙr’ÿ7a9981480850009cc5577c6e1f573b4eÓð6801dd23c4a7d679ccf(6c674cf˜ Ó±ÿb0ba465637458c6990e5a8c5f61d4af%àe576d97ff94b87åß6f8050361ee3d„ða91ca5c11aa25eb4×Ï275cc5788063ÿa5f19741120c4f2de2adebeb10a298dd±7±6/ ±¯'\xaa'*131sd—ûÿ Using Larger Than Block-SizØáb'e Key - Hash _FirstÄâ ÿ95e9a0db962095adaebe9b2d6f0dbce2™8ÿ 'd499f112f2d2b7273fa6870“ð60e431591ee0b67f0d8a26aacbf5b77f'   ÿ'8e0bc6213728c5140546040f0ee37f54', Bÿ#hashlib.sha384: '4ece084485813e9088d2c63a041bc5b4'F Yÿ'4f9ef1012a2b588f3cd11f05033ac4c6Fÿ0c2ef6ab4030fe8296248df163f44952Óÿ512: '80b24263c7c1a3ebb71493c1dd7be8Óÿ9b46d1f41b4aeec1121b013783f8f352Óÿ6b56d037e05f2598bd0fd2215d6a1eFÿ95e64f73f63f0aec8b915a985d7865985}) »õ# 4.8. Test Case 7ÿ hmactest(key = b'\xaa'*131AAdata% This is a <ÿ using a larger thðb'an block-size w7and=< h=�B. ThG?nee< �ds to be Àed before be¼/us< ÿ by the HMAC algorithm.zåhexdigests = {i5�† 22†ÿ3a854166ac5d9f023f54d517d0b39dbd×Vÿ '946770db9c2b95c9f6f565d1¥ …ÿ56: '9b09ffa71b942fcb27635fbcd5b0e94 ÿbfdc63644f0713938a7f51535c3a35eŘÿ6617178e941f020d351e2f254e8fd32cÿ602420feb0b8fb9adccebb82461e99c5Fÿa678cc31e799176d3860e6110c46523e`˜ÿe37b6a775dc87dbaa4dfa9f96e5e3ffåÿdebd71f8867289865df5a32d20cdc¦ÿ6022cac3c4982b10d5eeb55c3e4de1ÿ134676fb6de0446065c97440fa8c6a5˜ 1def<õ_sha224_rfc4231(self):6._mz_cases(D2, 'H“', 28, 64ÿ g$56Jg"#56g56', 32g/38Î%Àb.sha384, 'sñ%ha384', 48, 128) def test_sha512_rfc4231(self):#'._1âcases(hashlib.?2, ' _', 64hü legacy_block_size_warningst÷ class MockCrazyHash(object™�Æ"""Ain't no Xõ attribute here."""Ï6ú�__init__{{, *args]+þGx = ï"1(/ U.1digVcize = A. 7ŒcupdateŠv†.)-v)C_C@kreturnŒ(¹Twith Žf.catch� Q'òsimplefilter('error', RuntimeWÛ ªg�assertRaiJ 3|›òhmac.HMAC(b'a', b'b', ôImod=* s?räfail('Expectedíç about missingD'D c.l9= 1Žä†_smallâ‚׺_U T&JÄéÐs(Deprecation;ing6ùkey = b"\x0b" * 166Adata @Hi Tµ ²Tú = "9294727A3638BB1C13F48EF8158BFC9D8h¹=Pkey, j #ͲEqual(h.hex ¤().upper()pB)  ð ConstructorTestCase(unitM."):ne@ignoróýzlnormaljÆ# Standard cka call.@˜×eed = 0:tryC fb"key"�except E:ion<e/("Ž rÈ"d JSion.">ö JŽ_str_keyüP a 8ñ of type str, which is an tá, because it eà!s 9$# CUbytes‚Ì�PTypeEÏ Ä HGMè €dot_new_nðVÀf type bytes# õwith self.assertRaises(TypeError):+2ñh = hmac.new("key") !ñ@ignore_warning�def test_ePtext(iRð# Constructor call + ,.Ct?try…aHMAC(b‡õ, b"hash this!")>�except E:ionK‘.fail("‹° argument r"d TGion.iKEó(Equal(h.hexdigest(), '34325b639da4cfd95735b381e28cb864'K 7¬_bytearray= 8!6), K ,,-o À‡mod="md5ïX&Œ]s^aïmemoryview_msgczE(Y ?EsO msg:`lmodule1Ñ C and >ã 0", æ�lib.sha1ç6UNð class SanityTestCase(unitâ./):îdefault_is_md5DMping if â 0ös to MD5 algorithmAq# NOTE:þ‘ whitebox}ñ depends on the¾ Í•internalsßxZdâàV_consšA# UsHö"d() in case somebody has overridden __eq__/__ne__‹Ô id(h1) != v2), "Noė뉟 instanceûeF1èV ah ! ''lÒÂ.l4l eÎ?ityÔ  ‚ Ó?szÖ°1.update(b"åÏ random textý“þ6(),ù+())De÷ÓEdoesó“ original‹œp2hexsh<$"H*y C|ªRmpareºl³!co8_¤îAnputÃõ exception handlingÈõa, b = 100, 200WqpRaises(ðbError,å ˆ , JÆXŸb"foobar"^=Y¼B¶%, hÁHncÀf.assertRaisóes(TypeError, hmac.compare_digest, a, b) õ# Testing bytes of different lengths-<Ò = b"foobar", "!ÿself.assertFalse(ƒ(F%))4Uñ\xde\xad\xbe\xef_d#eçDsameâ,õ_valueô?baz“#xˆ÷ "ab o1d\xeal#ÿ úrŽ?Truð8Ä\k 4 ÷QarrayãïÞ!, ý1yte7(õ!),+ t¨9‹Š Ÿ"lœ ÑE«6J*z®;F and¯Þíû(üT˜ ü3_b, a)© Ô|'ËËÉ4Ê ¢ ÜXܤ.¨ß!sG i%=èô import argparseudatetimtos.pathm drandom¥subprocessy @tempçbR def¥_#(#Æ,«"s)¾—with open ¢"w") as fp$æ@for >P`print(!s&fpk�fp.flush(N—goutputxX˜aif notÑVnareturn”uA"Wri%º{²%s" % (len(X™M)›Â`k„ Tðformat_shell_args(·3‚' '.join9o_oÔpcmd = [£ðexecutable, '-m', '»­!']ž¡cmd.extendO.+�Þ06 = :‘.run(cmd,>µwstdout=5OPIPE2 Ðuniversal_newØbs=True„°exitcode = �.„ ifÏ" ‘e2cmdU%ú@Fail¸oQs: %s‹1ed Ý… tA %s"xB!% ‡‘0it(@?~dÐ/a.splitü(%èhý3runk.„p, huntr^cs=NoneFdtmp = Ø0.mk \6try-Ã3tmpW)úÆN^Pmatch"b', tmpbAf #�+`? % »//oc™#@4gfinall3if Gð.exists(tmp):  ðos.unlink(tmp) def parse_args(): -qr = arg  .ArgumentP,7r()'@.add> ñ('-i', '--input',)T ÿ$help='Test names produced by --list-tests written 'L\ù'into a file. If not set, runR'¿ o¿?outÀÿResult of the bisectionb nb2maxáÿ', type=int, default=1: áMaximum number‚.zto stop�<(xO: 1)½ N½Oiter¼/00¾< XaFs·$00¹Á# FIXME: doc•ð that followingÖ`s are e e ,Ú2s =%!r.a_known 0.I& =;O`returnestDmainn=b@"()†!if3.Kšê with open(:v) as fp%)‘¼ð[line.strip() for q in fp]¡Felse<8„a_casesj–Æprint("Startò –!%sú‘s" % len(J)o8òaOAs: %-Âformat_shellÜ@ DBhR willð�when gettâ0%s æ#es�! "ç• "(-n/--€0 opn ),4ˆafter %s† =N=¨<#!% /P.max_Á"s,Ç4Ìb! =à"e_: �s>ƒs|P_timekÓime.monotonic‘hDA = 1ü6tryâWwhile¢& >£³F and! < sÓ[JSn3' =PrBmax( r// 2, 1Ú#0subH±Òrandom.sampleE!, ;0Œ‚[+] Iterò1%s:ó�8/%sŸ80% (Ë4,¼‚)Ž)®2r ‡pexitcodŽ2runõÊ%, TÓCG@"ranlj§2 % #‚"t0", { LÐif exitcode:  û%print("Tests failed: continuing with this subtest") C 4s ="s!òoutput = write_b(args. ,D []else:L ±psucceed´Pskipp²­P, tryPa new¡,seÂQ {áiteration += 1„ö except KeyboardInterrupt¢ Ia"BisecLi47ed!G(!) g �Ñ(%s):" % len(f)¨1for21 ins†P"* %s:64Zg2if z 9O¬ªƒten intoK1AdÏðmath.ceil(time.monotonic() - start_€'ifÇA <= @max_¤Â8�completedï5%s žPs andž;—5% ($`, date‡.ódelta(seconds=dt)R=¢sys.exit(1² �@Ï. after —@ò if __name__ == "__main__"¶ ò() # IMPORTANT:®ñ%file has the utf-8 BOM signature '\xef\xbb\xbf' # at,·ð of it. Make s0W is preserv�Ðf any changesBóre made! # Arbitrary encoded†ñtext (stolen fromÁ@_docò2.py). x = 'ЉЊЈÐ�Ђ' def y()ø1"""ñ€And agai¦� a commen¶:(0ðFpass #!/usr/bin/env python3 # # $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $ 9 aactiveÎq suite ¦2he RÁ module. # TPðcript displays variou±2ingÚ¼ð ser should verify whether #±yBó correctly. # import| iˆ‰Apad \|_ó (stdscr, insert_mode=False€Àncols, nlineøA8, 3ipuly, ul¾A3, 2(ifHÁmVæe!e'1 v'@over”e*+©Ñ.addstr(uly-3€ð , "Use Ctrl-G to end edit U.[éH2HBÿoK1 tydwàhe lower-right~Cner.ØSwin =}‚.newwin(0#, ?-ƒ|.ÂUangle†×1�-3y +{�GÊ‚refresh(­À box = textpò&ad.Textbox(win, insert_mode) contents = box.edit(ðstdscr.addstr(uly+ncols+2, 0, "Wð entered in theB?\n"?Trepr(l)"O'\n'ÚPress any key#�getch() ÊPfor iŠ‘range(3):åËHmoveÉr + i, 0v(€clrtoeolZ’def main(DU c.clear/Ãtest_textpad-c, Falsi ð True) if __name__ == '__t2__'Äðcurses.wrapper(P) docTºð""" Basic classÖ¢struction.3>>>CU0...ô âóeth(self): print("HelloÌ1...LDAC.__e¡__ is typeË %Sa = C 5C) 2 .m„Œ|$ð>>> Use *args notaÔ íra âtA: passBøBb<‚ = (A, By¬ÝA C(* Kÿª hγáa trivial metaW Œ M(AV’¼x@5 C(L*=M7È+MÅ Å@O*kwdÆÔãGword(2E= {'%Q': M}¯ ¯\¯>·B¶î1å˜ð with a __preparÍs°c(hoÖŒ þ@3!odæà[(3, *ø+ØÇP‹° called:", I , Wô_4¤return dic|°new__(cls, ¬!, þ _spaceŽ7NewŠ„ ?.__s ħDinit¨% Û,œj3 € ('C', ()) {ÄõAAlsoÆ� anotherªpobject,gðaclass=M, otherð="haha"): ...T passð'Prepare called: ('C', (,)) {'other': '[!'}A5New="�>>> C.__Sq__ is M;ATrue "Âbases__ == (z!,)! *ba = C(:a\C2ò Check that buildŒñ doesn't mutate the kwds dict. Ha�= {'metaÆr': type#P C(**-.):i&ÝJçò% Use various combinations of explicit keywords and ~ºQ N‹ Ô?M, ä1âT,lêS ÝB·ó¯ø!7UC(B, _=M, *$-Ptest._Xl.B'>, ˜—^2B, š€ ²g`for du U¡–7Ü=MD[ñTraceback (most recent€S lastîQ[...]¿ÄSyntaxError:,` argum8�repeated+q>>> AnäG way± ²"Ô“Ì2CTypeÊ'__Çp__() goÇPltipl6Plues ‰ôÅ÷kRa __p __Ð2hod3`returnca instr=,ed'×ÀLoggingDict(H“�ðdef __setitem__(self,š{, value/µô print("d[%r] = %r" % (key3‹b3y.g ü1...ÌRMeta(~UÂ@staticmetho.Ï7q(name, ÿÊH "»nˆ&C(I” M‘foo = 2+27Œà foo = 42 @...  bar = 123 1...ð d['__module__'] = 'test.¶_metaclass',uqualnam.C1fooA4-21bar#†µ>>> Use a lñ that doesn't derive from type. Lq>>> def6(��, bases, ñspace, **kwds):2pprint("o":"/<)( ns&asortedi\Ÿ.items())4'kw4ƒ/freturn²€â|0 C(­ = ÑRa = 4bäRb = 2‡è9R: C (²hns: [(û,ù0), 'öQ, 'C'aa', 42 �b', 24)]»Rkw: [ Æ·±(C) is dict#ATrue !“dC-¦F|üAnd again, with a __prepare__ attributv"=n 1 4ô$³LoggingDictÂÙAÝ.¹#= rd? Kê, other="booh"YX1@W hg Nvia_@', 'a' t8aO§2d['¥Ad['b£$˜-63ßÿ/('ûu0The½AaultÁœ0musï0finÎ ()&7hodüTò!{}ÝfòMake sure it worksã1subq7ingQ0 M(Y ! @amethod_Ä/ (cls, *arg|y¹d = super()Á 8 h7€["hello"£ ï L¡A½ ùMà^[gF$'C.&ø Test failures in looking up the&Ì’ƒ`¦õObscureException( ³;assâð FailDescr: ... deðf __get__(self, instance, owner): ...ñraise ObscureException&û>>> class Meta(type@û __prepare__ = FailDescr()@aX(metaL=L GApass2óTraceback (most recent call last8Q[...]1Ptest._a.Ìñ """ import sys # jP funcïð introduces __locals__ which causes various nðs to fail. if hasattr(sys, 'gettÇ`') andp.(À __E4r{} else—@'doc&Ts' : a} defƒô_main(verbose=Fals�Afrom# ó upû1 d=$s0S.run_z('#, y ) Q__namA= "_š2__"Ô9¬ò True) # Ridiculously simple·öof the os.startfileªòfor Windows. # # empty.vbs is an 5!(eÐ 4³a comment),Øòdoes # nothing when run with cscript or w n A possible^@roveT� would beBhave†–rdo someeð that # we can detect here,: make sure (š] only(?ñsucceeded, but also.³� actually£Ü.@unit› þ0$os :. osüMfpath ¦#= >ó_pibute(o'Q') ¤ TestCase(�.+ï±nonexistingÛ Ãê€.assertRεs(OSError, t7, "B™1") îbI \œ# We need òe child processjñs in a directorya£ó1'reÓPaboutOÐdelete. If we@runn‹‘under -j,EQmeansá¼P harn|†providedyñ isn't a safe oÔ.IñSee http://bugs.python.org/issue155268@more©2ail¤Ïw#ë°change_cwd(@.dirÇ.executable)±Cn1 = 3Jjoin= __Âa__), "+³;Ý("up, "openõi$¢�±Ša#) As = H¡¯Cloop0@ondiK"alW=qsum(i*iHir*ò(100) if i&1 == 1¹ˆ166650 `!neñR§list((i,j)UÀange(3) for ðj in range(4) ) [(0, 0), 1231 11, 11, 11, 2 2 2 2 ñ'] Test nesting with the inner expression dependent on"aouter ¥ù>>> list((i,j) for iÌÞiÞ¾ ¦3¶3¶3¶Á] Make sure„`inductŸðvariable is notºFosed ei = 20¯|sum(i*i¬B100)yV328350i:#200¶first classcOg = U4S'btype(gc<@Ñ 'generator'>f(O(´[0, 1, 4, 9°ÿdirect calls to next()‹3‹4cé1�4ðTraceback (most rec-¢q last):7ð File "", lineäÓin -toplevel-1 Þª`StopIt0ö ion Does it stay stopped?¸¢cÅ ÑÇ@runnwpgen whef!fi2funÙöis out of scopeÛsdef f(nX0...j return‡nü_4f(1îcÿ , 16, 25, 36, 49, 64, 81]{3�)õN+•D Éo4) if Ú|á2ôRy7 �ð] Verify that parenthesis are requiredäa{otement!wn¢A ...ñSyntaxError: invalid sÃwðused as a keyword arguÔX valuv�ict(a = ;lÆÀ SyntaxEñ¬rror: invalid syntax Verify that parenthesis are required when used as a keyword argument value >>> dict(a = (i for i in range(10))) #doctest: +ELLIPSIS {'a': at ...>}¹Ñearly bindingnÐthe outermostÅ-expression ¤Ex=10 g ¬ *i.®5x))$Ux = 5blist(gõ[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]°i£ ð makes an immediate check fK¦terabilityÌg6”±Traceback (0rec©±call last):Ëð File "", lineÒÓin -toplevel-0/ nBypeE`T'int'¸�is not iµ%lelÕ´/if³pinclude¬r2,4,6,8ìO>>> Âb10) ifÔ@5Q–1,3,5,7,9 ã1ÝÙÕÑÌ?inn€ ±\(i,j)u3j5 ‡4Œ÷ ¤€(0, 0), 1231 11, 11, 11, 2 2 2 2 Ãðre-use of tuples (a side benefit us�Ðgenexps over ¬fcomps)ºAQids =â(map(id, ((i,ii=¡„int(max(Ev) - min+0w|ù e¯'è aiÜ`²uAas lÛs²!(y°y–“(1,2)) = KuÄÄS†;ðcan't assign to ŒrÁ‰+Š[& #ð Tests borrowed from °1nspC0by ò_ÕVs.py A§## Make aø±¢acts like C?y=Šambda n:Ÿ'(nÆ…(7(O†ÁçÇô5, 6, 7, 8, 9] G�ás always retur¥Ë b6er:1pdef creÈ(v0...îS r = Œ5¬ prÝ"8“", next(rÉ&†rÅlSallerkÀ ... r =ð creator() ...É for i in r:ò print("caller", i?B>>> P^! 0F( 1 2 3 €4 GenerŸQs can[… other g!: 5{Údef zrange(n)¹Ñy Ùuyield iOSlist(P"5)âð[0, 1, 2, 3, 4] Verify that a˜@ exp¯÷not be resumed while it is actively runningÄ×g = (next(me)ˆÖ#10‡îeme = g®4òTraceback (most recentAClast0 F•ð"", lineæÑin -toplevel-X' i B+28B<«…ression>Nð°ValueError:cõ already executingŽðexception propaga )uv10 // id‡(5, 0, 2dìgûªzj&7(j~ i+35Aiô €ZeroDivi¤o“integer dñ or modulo by zeroÌ6 @ `StopItâion Make sure‘ANoneqÐ valid return &ueé+'&p[/, !‚] Check‘ öattributes are present•¤'i* ”3Ÿð expected = set(['gi_frame', _"']¤({÷ Ðin dir(g) if µð.startswith('__')) >=Ápò(TrDñfrom test.support imñHAVE_DOCSTRINGS;‰C@g.__O __.__doc__† 4Ð else 'ImplemÈ2‚(self).'Ûl‹VtypesÑsinstance(g, .qBTypeZçÃáe __iter__ sloͤdefined to_šÉ/^s®R84the P flag³1set½FerlyMcme.gi_ÝɬG(0,1 5Àing 0 ñ >>> next(me) 1Ñme.gi_runningñ 0 Verify that genexps are weakly referencable 4Jaimport$5refò g = (i*i for i in range(4)‹;Dwr =9h.ref(gb() is �ETrue[p6Xproxy8blist(pHó[0, 1, 4, 9] """ ¯ð@sys # Trace function can throw off the tuple reuse test. if hasattr(sys, 'gettG´') and sys.1():¶ __<Î__ = {} else@'doc&Ts' : a} defzó_main(verbose=None]Afrom" Ü up“z c_Ý"s.S.run_w(%#, t)ô#'te countH if!¥ ,"qotalref5"Ä�¾!gc—#Ps = [ïU] * 5 WBlen(/)SEà/²gc.collect(MfU[i] =ìÓ/Tprint— :`__name A= "_Ó2__" u åö)·±Test scriptQ›ñ'cmd' module Original by Michael SchneiderCû8cmdw@unit‚=io <Kñ class samplecmdƒ(cmd.Cmdm3�InstanceN2>ôPmycmdM Ooúíó©”parselinebI."""º(>", "''1?2�'help', '  7 " ;? z!?Pshell8 | Ž!command@G‡aJ > 9 ] arg1>B"2') JÛ onSØÕÀsadd 4 5�9*& #ñ*** Unknown syntax:g½ _empty˜›_!~defaultÀ"default") ò4 *** Unknown syntax: default Test for the function completed+1():-­>>> mycmd.! qThis isL "q method'G¡names("a")!['add']¢: 4"12Z]a‚Dhelp+' †_+& ߀Š-,heˆ/ âzsorted(²_(")k¢, 'exit', õ�, 'shellþ "doM ~s"testetÉŒ0No +B on  �:3add702tex§,adD�onecmd("(7jg±” Documented²mands (typeÁsû=ZAadd E x>UndzeF¾! ´Vèaprint_Ës¿ ð"header", ["comD1", ¢2"], 2 ,10X.{· 9 2 ±žcolumnize®q[str(i)×òi in range(20)]�ð0 1 2 3 4 5 6 7 8 9 1ñ1 12 13 14 15 16 17 18 19¶¾™~$, 0p1 14G1{1 152†1 16�‘7‹›8•¥�Ÿ34‰áan interactives¦, put someØ"in³ñmdqueue attributefôand let it execíÅ‚ includeøôpreloop(), post uÁemptyline(),aSparse ˜)Žs%këuse_rawinput=0cÄ0=["ž0, "s04 5' "=""md¼a³Hello from áM œéñinvalid number of argQϳößu/À=============á add help±ñUndocumented commands:D ±exit shell Vo� text for‚&òHello from postloo”A""" !pdef preb(self)‰Æxprint("C)'")<V=*>ñcompletedefaultE®, *ignoredŒ°This is the:< method^_e_U…RŒC1do_s;8, s>6assodo_add'Ñl = s.split()s\æif len(l) != 2txñ *** invalid number of arg;&s"M5ereturn`:tryU‡[Ð!i)!ui in l]1úexcept ValueError?”‚£ should be ” D—l[0]+l[1]E¼?c‚ ÛüøÈÌ0do_*‰7argO,ð True class TestAlternateInput(unittest.bCase):è2 si´ cmd(cmd.Cm§‡ƒëP,²7&°args, file=*s.stdout'M6EOFÏ K Ô6 ¦%2(±È&\§'‰ÿUnknown syntax: EOF'¼[›uZ_õñ_with_missing_final_nlê´i“ñ = io.StringIO("™ J&\n 2koutput820cmd—Eelf.q(stdin=q", �=H 9�.use_raw)… = False1cmdP7àòassertMultiLineEqual(aP.getv{5(),KH0("(bì" ?2\nB")) ¾1defG_¹¤_reset_at__ub2vªÀ2\n"  ñ"(Cmd) *** Unknown syntax: EOF\n")) )ð input = io.StringIO("print \n+*>out+I�cmd.stdinMU9ohF †cmdloop(Lò self.assertMultiLineEqual(?Å.getvalue(),KÒ(û9\n"  + ñ def test_main(verbose=None):hAfrom"q import A_cmd0sup€.run_docJ(!#, Oþ+@unit'ð(TestAlternateI\)”‘coverage( 3dir”„trace = Sš‘_module(''v !r= .T8õ(ignoredirs=[sys.base_prefix, Dexec]‹�Y¸=0, count=1v"('�>Flib; Ò.reload(cmd);Y‡)½¸“r.resultsHÄ¡("Writing Cage &B..."‡ƒr.write_ó (show_missing=True, summaryKDdir= ñ) if __name__ == "_+2__" �if "-c" iŠbs.argv"ä_LÆ`'/tmp/4å!elCiCúsamplecmdclass().TKelsepC0 # ]Ó iterators. ‹4sys ‰ ç.U¦ Ú&ÿ, TESTFN, unlink, cpython_onlyDòcheck_free_after_•4ingˆdpickleôcollections.abc ÌȰ of triple ]à (too big to i˜ðe) TRIPLETS = [(0, 3), 1 2gs0, 1, 0"41, -?1, -2-2-2-$ (X. [ [z-“[RZˆ§ˆ Z ˆ+[ ˆ .W(Õ-€ˆ-G"% 02)]ÉqHelper ÎAes ° BasicIterCæÑ›�__init__(83, nš.“nÞQi = 0A4nexA>0resAŽi-S ifDA >= Jnˆ raise Stop©aŸ:0zX5+ 1`returnW“ÿÔ “+KÀ IteratingSeòquenceClass: def __init__(self, n)h.n = n.3ter.+ñreturn BasicItereS`.n) ct? Se‚2sgetitem…7, iˆÂif 0 <= i < ¿ÏÓ¨iÑKelse#ôaise IndexError¾ŸUnlimitedÇ™ y uDefault,„Dpassp+No®eÚ1__i«ô = None # Main test suitejÐTestCase(unit.1): *ð # Helper to check that an dRator á³s a given sí@»8”0P, it,*Ú, pickle=TrueÏ×ÚP(H)n#…res = []zwhile 1I:try;0valôfext(itR°except Stop�^ationAUbreaky8æres.append(valTÉñassertEqual(res)x ÿ for loop generatey@for_2yAexprj{00er(O)PÝ ƒµ]0in 0 9#7qability†~eRitorg´‹¤òproto in range(5÷.HIGHEST_PROTOCOL + 1«ç3d =És.dumps(cQ+&it,zloads(d!’# Cannot p type e%õity because dict„Bs un­� as listÿo#). ˆn¾!),{  ¡4¶±(isinstanceŽ`collec!bs.abc.0?or)F·m™¾5ÐnÊ'‰continue/æ/, ã!BüE[1:]‘ b^ ÷!ofÌa() fune¢éÀf_/À(self): ð self.check_iterator( ÷(range(10)), list0) ;Á# Test that 3òx)) is the same as!x)5�def testnÐ_idempotency(Š!):%^\seq =zBit =X2seqZ54it2&it[à.assertTrue(it£?it2Êáfor loops overdas work€ Ã@for_0ÀY#!Yòseveral independenh�žf¢�;.ce¡aŽ3,�res = []NTAi in (o¥ j $k$ (`res.apí¦((i, j, k)›ÇûEqual(res, TRIPLETSÌQriple@ñ comprehension usingÍIèÓynested_2s¬?¾_ÛN  A 0�3gwithouQ© ?for$ÒFØò ì?seqæ#€a class Ô! _® __nawž Þˆ_4_ÓºIÀingSequenceCr œª`explicŒBter(ç�£ w¤Ê·©È •+s on a sè[/^ P?seqOFä/()š*C< dF  =±–mutating_ sm_pickl}zorig = h5*�PprotoǤI÷.HIGHEST_PROTOCOL + 1Ó=p# initi;·!or¯Ð itorig = Çiter(orig) ðd = pickle.dumps((it& , Š), proto4vit, seq:zloads(d&™seq.n = 7pó self.assertIs(type(it), u H2¢Equal(list5 ¹range(7))) j # running ûIator0nexFq µ?1, _empty’for i in Si1, 5):99Î59�xhausted=ÙðRaises(StopIteration, 8", ^ ârhàTrue(isinstancŒ€, collecµbs.abc.Ä:or)¶ñ ˜#[]Œôdef test_mutating_seq_class_eP_ (OnÐa = SequenceC0&(5qexhit =‰'(a/mpÙxÙ9S: # ~A theG eQ)04not4%edaâÅÞv0), B*p†, [5, 6]Ù.aTó0, 1, 2, 3, 4, 9¢ñ# Test a new_style {q with _x __ but no  ‚() methoâ¾@3E ± ,¯gobjectÒöRx A preturn óÆ X]�TypeErrorS7er,z ÿÁtwo-argumentë"()”callable þo£³–_$ ­îC;Œ__init__1ÆÊQi = 0n;n;6? ;?E + 1À if iŸ > 100: ýraise IndexError # Emergency stop6…return iðself.check_iterator( ñ(C(), 10), list(range(10)), pickle=False) Kñ# Test two-argument Gñ) with function-�def testr_(‹)é&çspam(state=[0] Ai = 1[0]Xi = i+1{@a that ¹qs StopIv _Ì 7Ÿif i == 1Wš™X\82]PexcepE� propaga fthrougbwÇøEk=p[kqRuntimeÀ³f «vres = [ì6try/3�for x in(Â+207)Õres.append(x)v$ ’ `¢ý.assertEqual(res P?lseAòfail("should havedy"Y›?ionü�sequenceøü ) L“class MySIC( FY±__getitem__Q;, i&l ru‘  �.~:, ö1³  _g from 5,Ç b_uÀ ûraise StopIteration õreturn SequenceClass.__getitem__(self, i):ù.check_for_loop(MyAñ(20), list(range(10)), pickle=False) QÑ# Test a big ,ñdef test_iter_big_�!):#È‹2v!00y Š qn empty³^ �}{[]), []co tuple]]ð(0,1,2,3,4,5,6,7,8,9\ ã,))}?}}.Íq ostringrsp"abcde"Rp"a", "bcd-e"iŸdirectory~Ldict|Q = {}0X‚for i in’¾t 2’[i] = NonÔ�+  n.keys( /fi ¯öf = open(TESTFN, "w"ž:try¬ Ì5?´øf.write("%d\n" %îlfinallTv.close(w•r• *€f, ["0\nÖ123\4\n"]FÀV5Ý` Xcunlink‰ êexcept OSError“ IpassP°)'s use of Èaators.—‘�builtin_0òÑÑ.assertEqual(% ›5.5�’ARß15(h'¿(deð"one": 1, "two": 2 0hre3ƒUdWdI`3Rúas(Type€‚¨1#42JaåzÀ, "r") — try: òself.assertEqual(list(f), ["0\n", "123i4\n"])Kºf.seek(0, 0d ?• �kfinallÝŠf.close(� oÚunlink(TESTFN0êexcept OSError?;Qpass Ëñ# Test tuples()'s use of iterators.(ñdef test_builtin_2(()` ›&ðSequenceClass(5)), t¶1, 2, 3, 4)¿C0C6 []k((PP"abc"S "agbBc"))LZðd = {"one": 1, "two":çP"thre!3}Q-ì2d),‘˜(d.keys()b5±Raises(Typeé7 , S2'42Ńf = open\V, "w"O �÷for i in range(5æöf.write("%d\n" % iP•r• '&‹'('2¾'eä@ ‚ e ›(9ofilter(2� )²(,mNone, 5/),U?@1, 51ûk 0)[+C¤/, 5O¹P]‹P+ VdÜ\H", ŸDÄ"c 9 jcƒ BooleanHÀ def _û_init__(self, truth): ." =% #£def __boolJCvreturn JBðbTrue = Boolean()HFals%) !šclass Seq·” Þ_*args›”pvals = #[H?ter܃JIter‡CGmrŽ.–+ –!)_i = 0#zÁ K¥L4nex3À’›Ks� = i + 1'¡if i < len§.yZÉ/?[i]_OelseµJ raise Stopá]ationNr0Seq$©ªPseq =ªA(*([ö1, bÏv] * 25)öó"assertEqual(list(filter(lambda x: not x, seq)), [M?*25J%i`O Pñð# Test max() and min()'s use of ?aators./{ðtest_builtin_max_3ßÂ.îa�SequenceCà (5á4×W303 Ïax(8, -1), 8( %in('-1{ðd = {"one": 1, "two": 2 0hre!3} Eå d)-?wo" (i( @ax(dî@ues(/3- 0in(®28), Þ÷f = open(TESTFN, "w§:try5÷f.write("medium line\n2%¯xtra large) `itty-b)mfinallˆfclose(ýÉr— É©@in(f©†ŒÞ‡seek(0, wS"axS ßa Åcunlink¿Ð except OS‹Error: Qpass ñ# Test map()'s use of iterators.%ðdef test_builtin_/Vself)[ð.assertEqual(list()ñlambda x: x+1, SequenceClass(5))),e £EÒrange(1, 6)))·ðd = {"one": 1, "two": 2 0hre%3}ZŸ�k, d=d: ( [k]), d›€d.items(™”�dkeys = ¼ d.5())Špexpecte¾ñ[(i < len(d) and ;¿[i] or NoneiN „§’for i in g63)]cöf = open(TESTFN, "w"F6tryO K'10  ðf.write("xy" * i + "\n") # line i hase 2*i+17lfinallqv.close(”²r² ‚en, f)),È@1, 2ï™ü 1cunlinkbÉŸexcept OSÇ/ziÇ/§Ç) &[]¡*?*[]-Ú‚2), 'ab'9÷'a'), (2, 'b')]øy±Raises(Type#a, zip,;©0Ýo0), 429$?zip¤GI[:ing3 @[(0,1 2," lc.~®l,+S¡d, d.valueDBP# Gen†òe all ints starting at constructor arg©cXš IntsFrom¡É�__init__(8,TCB.i =!G3terG@preturn G=4nex„=xUelf.i‚xQ˜uÀn i ó f = open(TESTFN, "w") Etry: ñf.write("a\n" "bbbGcc\n7mfinall;fclose(^|rE |õself.assertEqual(list(zip(IntsFrom(0), f, ‰-100))),ÄÈ Q[(0, Ò!, 20 D (1,ü_, -99a a (2, "%078)],± cunlink¿Wêexcept OSErrorÉ Upass _prange(5Iô [(i,) for i in &])I@# Cl§õs that lie about their lengths.yc.Ê NoGuessLen5ªðdef __getitem__(¨J, i)&Ћif i >= A±raise Index�†return iË›™3š(¦ �§3len£ `3`0a70b—l$[*args•ñH$Ël s7en(V)), 3u/Þ001 «e(2Àj)> Ÿ=!­ >4¡expected =/ i.0x0 Û(, ¬} ßAyA)€Ÿntx, y), Ñþ8ñ test_unicode_join_endcase„&):fr# This / in£Rs a U<õ object into its argument's natural*À# iteration,ðÀthe 3rd posi 7{OhPhooel¾c__initŽ[, seqþAit =w(%‹ 7Gi = We3tere`bC.=4nex¢=t:/.i”=i+1J== 2Dwð return "fool«ed you!" õreturn next(self.it) &õf = open(TESTFN, "w")Etry: Xóf.write("a\n" + "b7c\n8mfinall<oclose(~ rFò$# Nasty: string.join(s) can't know whether unicode#µ) is needed¾÷.# until it's seen all of s's elements. But in this case, f'sF€iterator…ø not be restarted. So what we're testing here iG¸ÚÙð manage to remember everythJ¿“ and pass tz on< .. Ò²got = " - "=¶OhPhooey(f) ü=ðassertEqual(got, Ó - b\n - fool‰? - b ¥cunlink¨ šêexcept OSError²;ót# Test Å�s with 'xó0y' J0'x ØRin y'81defÊÀ_in_and_not_‰Felf)mpfor sc5JI$üingSequenceClass(5), @©DiBwrange(5_†PIn(i,t Eñ"abc", -1, 5, 42.42, (3, 4), [], {1: 1}, 3-12jJ � p7NotsS’±Raises(Type‹°, lambda: 3Ö&12ª6‹7map7ðd = {"one": 1, "two": 2 0hre¥3, 1j: 2j}§k†då‰vIn(k, d¥#‡.values(#`v`i Ev, d)r ,#i3k, lkitems() ÔÕ v)p-LáZ(v, k0F0).""©+ 2%Achunò  �ùºf.seek(0, 0CøN>, f+HAIn((F90 N4 ”îÀ ÷ unlink(TESTFN) ùexcept OSError:'Qpass ò # Test iterators with opð.countOf (PySequence_C!).?“def test_)f(self)qEfromNƒ import ,AŽ4Ó.assertEqual(!ö([1,2,2,3,2,5], 2), 3é7(7)7ß"122325", "2"k464"0)W ×±Raises(Type’,, 42, 1Õ5!Gvôd = {"one": 3, "two 3hreu1j: 2j}‚¦for k in d» à š_d, k)¹ +�.values(SÂd4/2ji 15�0f =ˆn/V, "w"v:tryùñf.write("a\n" "bc :mfinall>gclose(' r “or letterãœ@("a"sb, ("b"Ø5("cWd", 0|Á€f.seek(0òE#f,‚` + "\nÝvÔûf `ÀQ[indexÀI À)À,L D! À)1)ƒ7À"in 73p¥ 7V5), 5å¥�VÎÆ{+, E0A-6Òƒ ñ}±%45ÔëB/6"§*ï)ï5 ÀindexOf)  ñf = open(TESTFN, "w") u try: ñf.write("a\n" "bcd7e\n@mfinallDfclose(g…rE…piter = &(fG¡ð self.assertEqual(indexOf(f.,³O), 17Þ7 ?, 0nóRaises(ValueError, ²$, ³lAT  :cunlinkðW‘except OSŠ ú Upass ð iclass = IteratingSequenceC&(3]úfor i in range(3)\µc@, i)z0@ >2-1)¶a# Test8òators with file×�lines().i‘def test_òy¼¸=>/ ?�¸4Typ÷[if, None@N=#42ñ8\ú(["1\n", "2\n"]e )2("3)4Õ)q{'5\n':µ}( }˜ò# Try a big chunk too·ec*or8 §�__init__($p, start?Gnish¯/*.)" =1·#' fiI2 = )iL�YtF¬4nex¬�1if yBi >= zþZrGR Stop*?ion§`result§!tr.¯.i) + '\n'0‡O+= 1 rreturn Wñz�ñGn EþWhateveþs Öå¡o*,å # ’ ¼(6, 6+2000)o\ §©À(TESTFN)  ô$expected = [str(i) + "\n" for i in range(1, 2006)] ;ô self.assertEqual(list(f), Y%) 1…finally:B™f.close()+tr'+Úunlink(TESTFN0êexcept OSErrorb;Rpass Šñ"# Test iterators on RHS of unpacking assignments.™’def test_$_?(þ)mpa, b = *4y# !(&1), Q)q, c = I›öingSequenceClass(3óV0, cY!0,ƒ\OŽõ# too many values¨‚nVCqmQFelse#½ö fail("should have raised U"Á¯not enoughÃE 2EÆmCMable„Á5len«OTypep=To †’{1: 42, 23"}.=´Ôç‘@”ƒf = openÐV, "w"�òlines = ("a\n", "bbWccc\n)(_¸>»s~#p.write(sŸ¸r� Kf§2 ˜s™Ú 8.EÕc?c,))Å2), {42: 24}óï (² 422Ñ@cpython_only€üref_counting_behaviorŠc1— C(object£Æ>A = 0Ya»__new__(cls4"Bcls.<I+= 1=rreturn s.K +h\del__¶F clú2!__Ë)__D%m •>Ñ%ð-= 1 x s= C() ö self.assertEqual(C.count, 1%_del x303�l = [C(),n]A3AEtry:2­Öa, b = iter(l(úexcept ValueError6EpassGÈlûA0) 'ó# Make sure StopIteration is a "sink state".1ð This tests various thing¶at weren't :ós in Python 2.2.1,J?pluDaalwaysKb fine.­1defy_\•`_list(è)!# £¶used to faiAa = 4†range(5)h|aZ =<;b),E2“a.extend(aG, 10eQ?[])æ\tupleçËæ(0, 1, 2, 3, 4†Ì3­#ostring®q"abcde"þñ¦€['a', 'bcd6e']÷±$mequencaH S8vClass(5‡ØS.)+…a.n = 10/Þ#ncallab?Þ iQspam(eG=[0]_º2i =&[0ö10[0]È%+1»`if i =Ò«qraise A¦1ionç€("shouldM°have gottenmfs far"qCueturn it†Ê',  IŒ2· ?dic�ñXXX For a more thoroughÚÀ, see towardP†e end of2ñ# http://mail.pV .org/piper/ú -dev/2002-July/026512.htm 0{1:Aõ:2, 0:0, 4:4, 3:3}HPfor bÙ a), a.keysûca.item v¢+s(+‡W°S1en(€9b))¯.ù‰�À def test_ó sinkstate_yield(self): ‡def gen(ûfor i in range(5#O% iJ2b =Jkñ.assertEqual(list(b), [/))2A[]) '±Vtest_ÙIn§5a =½9´¤oiter(at¦;œenumerateƒªFe = 2¯ÃeÃBzip($55),)x$L3720Ãð # Avoid a crash, when an mõator deletes its next() method.�°class BadIt(—or(objectÕÄ __Y,__ˆ preturn _<€<8del…2.__0 IMe1˜6tryZGÖ*) %)Epassaúexcept TypeError/+,Î  extending_³Q_with!zü_does_not_segfault5â# The code to L! a¤ K È¡has a fairƒ¼ð # amount of nontrivial logicCPtermsÇguessing how>°much memory�€allocate;÷ advance, "stealing" refs,?Pand to`shrink` atÐ end. This i¶·basic smoke@B ©Öthat scenario—f"+00¨ $õlst = [0] * 500†o,24M–lst.pop(0õ­(Ÿ÷ xÃen(lst), 760HÑ@cpython_only‰é ;Ÿ_overflow.3est1Ñe issue 22939Eöiå¡ð(UnlimitedSequenceCä(zð # Manually set `it_index` ñPY_SSIZE_T_MAX-2�0outž7oopqb.__setèÿ_(sys.maxsize - 2Û (i4/1h7‡ƒRaises(OTÖ /ŠÕ�# Check —: eÏplways rZd5yÀelf.assertRa÷ises(OverflowError): ‘next(it) ÷def test_iter_neg_setstate(self<Pit = &ñ (UnlimitedSequenceClass())RkEit._If__(-42XÔ.assertEqual(’?, 0&1¼pfree_af¡\ating¿ocheck_*,Û), Ól, (0,)neU0 dñfor typ in (DefaultIterE, No W/!RaÁAType½˜0typa% ±Smain(I€run_unitÊð(TestCase) if __name__ == "__72__"0ä() import math $os ]%syD_ast…tempfile‘ypes frome d0supl.!ðcript_helper, FakeP˜ cj â¤Specifics(œ.ù:ÜÒcompile_singlÔƒ, source<�&(B, "<0R>", " "½�InvalidSZ ÛcSyntaxÝ~¤ŸÅ§òno_ending_newlinÍÅ0"hi·<6ÁVexec"Zoo("hi\r*Èi\emptyëEA1oth\¶sJO\r\nN¢t·$(áp\nstuff]Ò`f():\n&OpassIþ this_is\rreally_old_mac\rS Qüdebug_assignment†# catch "rs to __9_NÃ>�8 ]5, ';� = 1', '?Ù'Ÿ…builtinshtprev = .O"„setattr(#tk7urei¹R , m“Y -‡‹óP_arguWo_handl ô# detect duplicate positional and keyword K ºsÿeval, 'lambda a,a:0÷=/=1?Àrror, eval, ó'lambda a=1,a=1:0') ÿ(self.assertRaises(SyntaxError, exec, 'def f(a, a): passB%¿ = 0, a = 1J,Â): global a;Q1') ×­atest_sÊ _eË(é!):!ûøð compile, "1+*3", "filename "nÿnone_keyword_argr&�f(None=1)k€ w¢duplicate_o_local}Zç[1ò _with_general_mapping_forƒs„tvclass M…‰c"Test >õ interface versus possible calls from eval()."YHö±__getitem__}W, keyõ( ifz == 'a'�™return 12e'A Key# „s„, value‹ˆäresults = (key- [5keyUа”list('xyz $fm = M(ô3g =<sÓæ('z = a', g, m2¦&ƒEqual(m.´¶, ('z', 12)/:tryV\b\±except NameR :m Jelse™õfail('Did not detect a£¬ˆ]dir()ŒOè añX…s\"gRÐQ#mQÛé2Typrçý¡mÜ=µAwS"Non-´ ‡ °yAc„�ûñ# Verify that dict sub�ões work as well30 D(- z©-QGƒ.ž¯Wd = D-TdaI�ad['z']‡Àdef test_extóended_arg(self): õlongexpr = 'x = x or ' + '-x' * 2500-eg = {}@code8£'' def f(xY!%s$,`# the �ñessions above have no effect, x == argumentyvwhile xæax -= 1øñ# EXTENDED_ARG/JUMP_ABSOLUTE here*ôreturn x ''' % ((,a,)*10)$NPexec( 6, ghñ .assertEqual(g['f'](5), 0) >6@test™¾l_order¤KðRaises(SyntaxError, €0, 'Müf(a=1, b): pass'hìfloat_literalsh # ��ing bad , ,°î� Ÿval, "2e" À3O.0e+6?1e-4Œ3-4e/21"¿indentationÒcompile() of 2ðed block w/o trailD†newline":² = """ if 1›Bif 2 Z² jðs, "", "ð¼a# This¸ð! is probably specific to CPython and may not gen"izë#(°other impleJàs. We are try×pto ensu�hat whenâ®`first øó starts after 256, correc'bnumber1@# inAqcebackswPstillÙaduced.lë«“_leading_l ÒAs256vÁ.join(["\n"]ÖÆ6 + ["spam"]ªUco = x­p'fn', 'u')Þaco.co_ÿþno, 2571ülnotab, bytes()’~U_withî]zeroeì0forC€["077787.20xj.˜e", "090!",Wu8"08&0A 98M1b42/qBADCAFE ’o12345678JBb1.1?4.2IB101jLCo153 Sb100e>3777 ?777H0&o Õ67"]•íÀ3arg¾ 3 Àeval("0xff")5,@777.-/77H -0.À self.asseÿrtEqual(eval("0ó777e0"), 777) ›self.asse`.1.0/Z)€000e-012[/09.5*?9.5„@777j-.0 ƒ0U/0jS.T e3©}9è.6 — 1 R Z0 nŸ!e-DF,³ DÀA0008m/8.Á6!097970b10y/42f6-0bh1$-6P0o777b?511coc^18) &ðdef test_unary_minus(7!): Iñ# Verify treatment of 1 1õ on negative numbers SF bug #660455Mö if sys.maxsize == 2147483647swå32-bit machineCóall_one_bits = '0xf'(Ë>Ç), 429496729ˆe=k"-" + C-D.elîý922337203685477580÷/64÷ þfÿ ÿ1844674407370955161 (N Jelseçeñfail("How many Ö´*does* this– have???"ï�ðconstant folding¢'-(y+2…# i.e. -‰8/ 32‡õ platforms. Should return int.lÆj1IsI}#ceχ%s" % (-ð - 1)), int)  ð.self.assertIsInstance(eval("%s" % (-sys.maxsize - 2)), int) A8if ñ== 9223372036854775807:+/ð def test_32_63_bit_values(Š))-õ a = +4294967296 # 1 << 32P'_b = -'cNæ28147497671065S)48SdS,eXõ4611686018427387904¯6¯f\0g`U`Y3 - 1Àhd4 5ðfor variable in ’.­ú.__code__.co_constsº—'ifN®s not None)-l ˆŽqBü sequence_unpacking_errorJ”# Verify 1 //9ö with "or". SF bug #75781õ i,j = (1, -1) or (-1, 1)CÃEqual(i jJFÕünone_assignmentÌ•stmts = [v='Xo = 0',+ß__builtins__.>•Œ(): pass^RclassÔ 1(a,)›,žp`l�range(10k‹ f(-!Rimpora §2x a­ sfrom x 'd" yIm] Ô¥Ô … += "\n"4Ã=àRaises(SyntaxEÒ°, compile, Aö, 'tmp', 'single'„K'Sexec'Ônø …Puccee# ‡/ B?os, Z?bar>_.path%Ǥ__future__Ðý nested_scopes, generatorÎ@(A&\nB)¨C,D4sysÀPstdinøAderr?outy5(6ð\nstdout)', ÷! 'from sys import (stdin, stderr,\nstdout,)', 9\;C?out9&s«a as si±1outo1erreº,H ÊI Ú][…fail = [s'œ0os,¬ ‰ ), (sys"4(os#$1if û.lower().endswith('pyc'ú+" =3F[:-14a open(%º, 'r') as fR€fcontentwf.read(�Qample°E = [¦ª ['Ûðx = 5'],  ð ['', """if True:\n Àpass\n"""], h['rclass Tob ª3bad�®  qnvalidSà{('1\n2'%)[W2�a = 13\nb/874Pdel xT?l y1�f()\ng()-€# blah\n8?xy ; px = 5 # G \nL6\n'Çð particularly_evil_undecodab@7elf~Ñ# Issue 24022¹¥ srsÀb'0000\x00\n "\nu\x9e\n'5�with temp 0.TeqúaryDirectory() as tmpdaðfn = os.path.join($—, "bad.py›fÑopen(fn, "wb"W*fpU+Æfp.write(src™õ res = script_helper.run_python_until_end(fn)[0]ãúÕü(b"Non-UTF-8", res.errŽ‚yet_moreŠOstil�f#25388y‘""#{v#\xfd\n"|ŸÀ_helper.run_ó python_until_end(fn)[0] ñself.assertIn(b"Non-UTF-8", res.err) .£@support.cTAonlyðdef test_compiler_recursion_limit(f!):-x±# Expected µ is sys.get:÷() * the scaling factorI÷ in symtable.c (currently 3)&AWe erÀ to fail *atZ"at‚Ð, because we §up some ofGŠ¢tack depth;1 in£· suite code7 SoVQcheck*‹ý÷and 75% of that9ð XXX (ncoghlan): duplicat tP hereKxa littlƒñ ugly. Perhaps it should bAosedïwC5...„,_í=£31usuccess4Gint(Ec* 0.75R <*`prefix|gpeated6/;b_ok = +R + re,9 * •:ƒ.¡…_single(N,+obrokenbÍ _Ádetails = "C¤�({!r} + é* {})".format(=u×,±Q ¨Qwith ØÁ„Raises(R}³Error, msg=Ÿ Nt@ ¦¢–"a", "()"�/.b ?[0] 3*a"~ ZÀ_null_terminSTBourc€ 4-4ø internally, but bytes-lik+ôobjects are accepted, which c5Fnot Y0“³Regex(Value”@"canD€contain ª"ž•�("123\x00wp GevalEzAÅmemoryview(b†O), "‡û4 = ¼Bo[1:-1]H —×`Equal(ï(^G), 2Ýq?4")nUO$23$n3a# Also]a when  ) 3‘exec() doTqðation step ó) self.assertEqual(eval(memoryview(b"1234")[1:-1]), 23) önamespace = dict(JexecH„ax = 123L%, ?7 �$±['x'], 12) €ðdef check_constant(=ñ, func, expected):.±Afor ,1 in&Â.__code__.coFs.2�if repr(6B) ==\.UbreakrJelseR£ò.fail("unable to findš`ant %r 5%r"GY4% (�íÇ)%°# Merging eÞeðs is not a strict requirement )¡the Python‡ñ# semantics, it's a more an impl9Ñation detail.7±@support.cpLQ_only¿¢test_merge~Aantsŵñ# Issue #25843: compile() must >×’which areñk;°# and have Ú¢same type.M#’Q’ý Çuns = {}_@K÷ = "f1, f2 = lambda: %r, B" % T,¸ýF8KJ, nsÙf1 = ns['f1']{o2pàUIs(f1,¤ h4 ù[Õ +_?/bf1()),,5�áY cFNoneY"0 .! ob'abc'E #Z”# Note: "É÷..." emits "LOAD_CONST Ellipsis",;vwhereas=& BfGLOBALCBq×}G"..`Q¯„ã0d�ß¡%*ZÞ4áP# {0}`�convertedäaíáñfrozenset({0}) by“…peepholeµ# optimizer P x: x.4{0}8Ê$* »*”True(f1(0„Xê?donï-³ó2butó€a differÝÐtype. ñ def check_different_constants( 11, W2): yns = {}÷ exec("f1, f2 = lambda: %r, L" % [Y, ns)KÚf1 = ns['f1'][2ð self.assertIsNot(f1.__code__“ k7�NotEqual:@$ ant11f ,2,2,É�Árepr(f1()), o/1)727E2)) R’þf0, 0.0b*+0.0, -.p(0,), (4À^Ÿ'a', b'a'‹(._1,é#éò ) cannot be used becauselu-0j) is3`# '(-0™vut whenõ is evaluated to 0j: we loose the sign.O /Oj2Xj.­ä3`7¦hU'2Øj'œ X2—ã ­0{0}IcconverIaŠñant frozenset({0}) byY…peephole.µ# optimizer pÄ x: x in {0}u&.0ã"û|- À , ¬)2,ð7.0}9•@True&0 2zlðtest_path_like_objects(Xóà# An implicit 4¡ for PyUnib@FSDe 6r()Üð compile("42", FakePath("@_|{Ã"), "single"¢ îstack_overflow�Àbpo-31113: S+ +�kõ a long sequence of # %ïlex statementsÉðif a: b\n" * 20à, "", "¿ñ class TestExpressionœ�Size(unit.!CCaselP# The(Bests³Q thatà¢u Q size†2de »Ò#Æðys within reasonable bounds (seeñ! issue #21523 for an example # dysfunction).�N = 100 Ðdef check_stañize(self, code):&KÐTo assert tha¡e alleged =ò size is not O(N), w‡@h< it( sm@rsn log(N£0àif isinstance(�W, str’&” = compil'õ"", "single")ÆAmax_§Á= math.ceil( €1lenj@.co_Z&)):.•LessEqual-X$, b)a�test_andYÁS~±"x and " * !|N + "x"P/orO/orNOand_R¡/x X€chained_¡oarison¶<µbif_els°WPif x 2Z_binopª+Pƒe@ = "‡…f(x):\n"¬r+= " 6x\n(& G>ð) class TestSâðSizeStability(unitž. 4Casñ0# Cš÷"t repeating certain snippets doesn't increase the £ # beyond w6"a ”D¦ requires.0 Ìâ,2Å, async_=Fal± EhCile_¢'(i$qns = {}™`script‡"‰Aunc(‹`"" + i‰ñ 7#if‰$NR« G B£½"B, "< ÂGexecÀ^z@, ns¥°return ns['wA']._Í"__b$« [0üÏTõi in range(2, 5)]Å0if 3Aset(Rz)) != 1åimport dis, io<‡ ouwÊio.StringIO(ËŒdis.dis(¦Ê1), file=out2*q.fail("Å”ôs diverge with # of consecutiveY6s: }ŸR"%s\nB" % î’Ðout.getvalue(6ç‘^=_ifLQu-m¥ Aa$À """ ð self.check_staàize(snippet) $ðdef test_if_else(5!): .e = """Fif x(a$nelif y&b&.se$c$~£Øïtry_except_barà/tr¹ ßX» ß»1Ÿqualified ÀÏ ImportErrorÌ J& ­I$dÑ>/asL^ as eÊ àtfinally¯% é` ò&OwithÁ. x¤ª’'Ohilew4÷J4?forI�for x in« H&?forF•oI7ï_break_continuCà Oif zLn ,bKu2šÀe  aelse: a(b$5"""àself.check_staÑize(snippet) (ð&def test_for_break_continue_inside_try_finally_block(Y)²R8 = ~˦for x in y./trNif z/¤»oelif u:Ø=„c ˆnfc·T®™ªRtèÙ'œmTL$oexceptud}‹t'MT±dOwith¯9P/ c„ÿdreturn)M(1àx ¢p¼ åHÒ ÝòpÀf test_returón_inside_finally_block(self): Õsnippet = """6try't#Z'Nif zAireturnFOelse1a,¥Ê .check_staCize(Ñ!) 8’def test_xoexcept@YÊ�Owith4/ cì‘`async_°ÿ4 4o x as ›$!, \l_=True¨?forª�for x in©^_¼®G^dbÞ:{ ôfor_break_continue/• $– –bFØ6¬ nelif u6à=‹; ô�W À‘':uq€ 1)¢&ò if __name__ == "__main__"ß@unitá.Ð() from test° import sup” syslog =. ’_module(" å") #skip if no>2ed /ð unittest # XXX(nnorwitz): This õn sucks. I don't know of a platform independent way # to verify that the messages were really logged. # The only purpose of t…�S°e code does“ô crash or leak. class Test(ã.ñCase): defàñ_openlog(self): C.•'python')!å# Issue #6697.Gð.assertRaises(Uni®!Enjrror, ^», '\uD800')�(œ7.!('È€b from Î&Ú>’LOG_ERR, NeÈLd_closee!}@ Ÿetlogmask$s!5.É\DEBUGLOlog_J8SMASK(”OINFOGOupto‘7OUPTOG y_noargsM%(–�úò if __name__ == "__main__"Fp() """ Qñ suite for socketserver.!f¤contextlib$io $os eselectUignal\…tempfile„hreading®› .Pqñreap_children, tp s,âxbose ;ñ).requires("network") TEST_STR = b"hello world\n" HOST =�’.ò HAVE_UNIX_SOCKETS = hasattr(ÖQ, "AF#4") zb_unix_!5s =è.}Unless([,³û'lT Unixþ"')³wFORKING®bos, "f ;_ inȳ ¢J&, q6,as+ƒ_alarm(n‚"""Call .ñ when it exists (i.e.Àon Windows).Û&ifjb1, 'G'c%_0(n)H€Remember,"l Ö ()ðavoid interferenc €ith mock¿__3à = select.seleòQpass P �oDatagr�3 g ‘ _ “Ó @contextlib. qmanager*ó simple_subprocess(testcaseKó"""Tests that a custom child 4à is not waitedÎñ(Issue 1540386)"""âpid = os.fork((1if 2= 0ÏP‘# Don't r7ðan exception; it would be caught by the »‘ harness.qL²os._exit(72r6tryj¡yield None1h�gfinall:Âpid2, statusÖ¢pid(pid, 0m‚˜SÀ.assertEqual% 2,û( t72 << 8jB) dbSocketæ£P(unitk.CÃC all@  s.™Þ6£setUp(selfü¼÷#signal_alarm(60) # Kill deadlocks after 60 second{L�.port_seeû0mX@elf.®P_fileA"[]B‹�tearDownŽ �0Did*�øQreap_¨Rren()]{`for fnÇ …÷' '³os.remove(fè:1 OSÞ K #  yh[:] = �pickaddr,i'to–5sroto ==ÓŠ.AF_INETyr�Y(HOST“ ž“°# XXX: We n¬ña way to tell AF‰šÂ its own nam8B`# like0�¸`vides 6==0ž-Vdir =|�fn = temp0.mk â(prefix='unix_—¶.', dir=dirDA ^}.append²"fnxRmake_z…ö, svrcls, hdlrbZm�"My‰(*«$[�handle_eü¢ð, request, client_l;ess=A0s.close_5(Ð)  praise õ class MyHandler(hdlrbase):#'Qdef h#[(self"pline = °.rfile.read)()K-&w&`write(()–öif verbose: print("creating server"U:try­"a = MyS-f(addr,æ<ú except PermissionError as eTù'# Issue 29184: cannot bind() a Unix socket on Android.ùõ²skipTest('CCØeÖù (%s, %s): %s' %@9’(svrcls, Ü&e)ÕiÂassertEqual(._1Cess,t.·@.get Wname(Mcreturn,¢€@reap_thás£Brun_b#$, ¡S§, testfunc?29HmakeEP.pick°î. Áess_family),~  ‡(ð# We had the OS mñ a port, so pullArealh¥ess out ofy#"Çð¨Õ¬ y;æÂòrADDR ="â¶"QCLASS#åBBt = ¢Qing.T¬(féA='%sÛding' %³ (starget=âŠ_foreverð # Short poll interval to Ö&ö finish quickly3Øñ # Time between requests is s\ù enough that we won't wake³ð# up spuriously to…Šny timess�kwargs={'·_·v':0.01}vðt.daemon = True # In case this ×Qtion `dwt.start÷ÝV—r runningÜpfor i iWWnge(3:0Kd¦client", iÂ0ªO j^1wai…˜µ­—.shutdownóXt.joi+Ÿg_close/ Á,-1®<(no©óif HAVE_FORKING and isinstanceØ¥€ËForkingMixIn[ò# bpo-31151: Checkv3ÙÀ {s until�ùall children completed%õDFals²„.active_>ÑŸSdone"”àstream_examineó(self, proto, addr): ²s = socket.((Ö.SOCK_STREAM)5‘.connect(NÀsendall(TEST74ö buf = data = receive(s, 100%Rwhile%öand b'\n' not in buf·¾L #u+v¥þelf.assertEqual(buf, ±¡s.close() ;ÿdef dgram_examineW/8DGRVÐif HAVE_UNIX_x@ETS ’% =©!AF$ as.bind•P.pickšÌ)` s.¡%to â10¦§átest_TCPServerñÿSrun_sý .6,0ÿStreamRequestHandler;{s3E]·…hreadingŠÀ ?ŽùÉ5ñ@requires_forkingH<ßFÝüwith simple_subprocess�Ô.Ç gK '?Ö Sunix_: BUnix}¯ =è|ó.p¶/àT’ ¬ ÕÑ Fòw ú  'ôaÀeamServer,  ÿsocketserver.StreamRequestHandler, =� self.s7¡_examine) 2Ñdef test_UDPS_(-!):TR.run_~(‹6€ 0oDatagr½}d2¸•Threading‹Á?Ê]ñ@requires_forkingz˜FÞüwith simple_subprocessÉ gK�ÔA‘ØSunix_= DUnixu´! ?í€.tz½å™ ¯ Ýh¢H÷x  × 9ü`Aap_t­sÏŒshutdown×õ# Issue #2302: 'ð) should always succeed in maA1 anbi‚# other zq leave Êouever()..„class MyVç#TC!bBpassLB— .¹N ¶es = []¥Pfor iî‹range(20C/ÃÓ(HOST, 0), My•)K²3t =Bing./("&dname='WBNing'G™target=s.e(ðkwargs={'poll_inter×val':0.01}) ú!t.daemon = True # In case this function raises.=öhreads.append((t, s)`@for R in t+:@v.start(3š§s.shutdownL8joi2Káerver_close() Òdef test_tcps öbind_leak(self)§ò# Issue #22435: the 4ñ socket wouldn't be gPd if Qˆ()/liste–†# failedIÓ# Create many\ s ðSwhichJQ will<€, to seef£aresultÚô#o�FD exhaus¼lVi §range(1024ì>Pwith �.assertR÷ë(OverflowError37 Q.TCPSWÅ((HOST, -1), / JüStreamRequestHandlerÅücontext_managerÁÑ«Ÿ0ž›3 asÂBìEpass^“Equal(-1,6.cñ.fileno()) class y�Test(unitÅ.CCase–0"""W that® s „Ð normal excepas from(h_1 toª _eñr(), andTxexitingDðlike SystemExit,Dñ KeyboardInterrupt are not�hed."""“0arDö!Î=æùsupport.unlink(lTESTFNRsync_ÆdABaseR+¬BValu�Šr.check_f(Q=-r?notv‹:elf\9õù¦-c(¦\False§‹?ing¨T¬?ing#?|(€ý'ñ@requires_forking= F46Ž#’ !À self.cøheck_result(handled=False) def c%cself, +!):%)öwith open(test.support.TESTFN) as log/3Ñexpected = 'H|ôr called\n' + 'Errorl* wH“ô .assertEqual(log.read(), eá) class BaseZñTestServer(sockets B.TCPß�__init__(mVsception#‡#ex5 = ®…super().Nã(HOST, 0), Bad)0Uœà.create_connec{‹.´‡_address�“EpassM:try€Ë.Ê–_request(|ofinall3sWclose1O€wait_donz=de϶#, p�, clientÀüQ_, 'a'Výmwrite(@Ô¨·73+” "CR2´[îèXÏ0k$­`raise Ë.} ('è }' Th"?ing  &aMixIn,ÒY 9ìß‘Ã, *pos, **kw$B.)D = tfX.Even… 1L¡…shutdownÆ]xƒ 4Z¡H¥0.se—â?2#(pòif HAVE_FORKING)‹OForkƒ $�½U ½SÔW rQ(unit�CCase:Ñ|_basicsº«} oStream ?] X3T‚.wfile =Ê s' /_4)no6.ž?… ACƒ¥i[/(Î/¢·³addCleanup(=_L-d.þ(„È5.ô’_family, +Å.SOCK_STREAMð IPPROTO_TCP) withW s: òs.connect(server.•_address)-ø.handle_request( ôlf.assertIsInstanceUÿ wfile, io.BufferedIOBase?YEqual:_?Cno, …~!) ¥Ðdef test_writz6lf)ìÁ# Test that Ž.'ò) sends data immediately, and/qit doese:ã# not truncate@õwhen interrupted by a Unix signal?ápthread_kill =³ð.support.get_attribuÃ98, '3'ïŠqclass H“ƒr(socket#rStreamR§">1Ï9(se-‘.sent1 = B!b'JB6\n'ÓB¡# Should b-tg€without Ô·iring flushZDzß„received‘r".XOline=úbig_chunk = b'\0' *{ÕSOCK_MAX_SIZE­x| 2y d£°.žATCPSo´((HOST, 0),ÈAu¤addCleanupSH_cloA|"= d€ing.Even¨Ó÷“_þ r(›um, frame&X9.seJporiginaÆB2al.P³al.SIGUSR1,oáñF7GpA€response™ENoneå ¨ Rmain_}‹'z/id+qrun_cliOÖ.{¡<P_famiJ.buSTREAM,©I$¶IPPROTO_TCPæ '  s, s.makeî ('rb') as ÷*er�4Ü-•nonlocal X ¨# =xv s7rdall(b'E[+_AaderSJ(100£`# The Æä1 sh]0nowaPblockFAin aœ½() syscall.oñ# But in theory, it cO ge ÏSotherÌsÂ#2ñen retried. So keepˆ•3theAu¯a loop, in™Õcase an earlix° happens toîPdelivO_ at aGðinconvenient momkent. ½while True:+òpthread_kill(main_ÿ, signal.SIGUSR1)>ÿif interrupted.wait(timeout=float(1))y}]breakYýnonlocal received2#p = len(Ã0er.E()) 0Òbackground = ÙQing.Tôö(target=run_clientå9v.start(øserver.handle_reques ;Ijoin:ólf.assertEqual(Kcsent1,Ɉsponse1)q 7#re%ÿ, b'write data\n'5l:;õ O@¬ÿ2, test.support.SOCK_MAX_SIZEƒ|@ ñ - 100) class MiscTestCase(unit{"):í1def”0_alW'lfvð# objects defined in the module should be_B%__Bpexpecte@%[]qfor nam2¢dir(socketczäaif not.K›swith('_')-Bmod_­š = getatt],Id5%if/Da, '__måø__', None) == '°' ù€.append(ïx%se”DCounÐ.J$, J˜«„shutdownDõ_called_if_verify`false(t4ñ# Issue #26309: BaseSœÒP f… even ifÌ*# nP is FqZ^Šy_ îB.TCP›4ç YÁ#, 2", ‹_address?Clreturn�Õã�0Ð }$q o`.6ZI+= 1[_?<rP)D = MS¹(HOST, 0), ]rStreamReHsr†# =/.6RTt_familyT©gSTREAME„.connect=ž˜þys.closeÑ  Rañúe', _~._rp if __… __Ãð"__main__": unið ttest.main() # Run the _Àcapi module 2s (1for&ð Python/C API): by defn, #÷se are all functionsYðexports whose name begins with 'kó_'. from colleD im:Ó OrderedDict $os dpickleerandom•subproces8(sy dconfig8…textwrapvhreadin!%im[1uni\¿Í ¥0supÀ.!þMISSING_C_DOCSTRINGS.ä.script_helper<�assert_pšª_failure, ´ok try: 8g_posix�except IlRError0 )ñ = None # Skip this.0 ifòmKöisn't available. m#= .,_3%('# ')jðWere we compiled --5²-pydebug orEô#define Py_DEBUG? ð = hasattr(sys, 'gettotalrefcountiA defÌÀb(self) á"""some doc"""Lpreturn %ò class InstanceMethod:Fid =#.i#m#A(id)M3x0 ()w”CAPITest(‡.qCase): _Û_½â[nst =Ç(¢ /.^�Equal(id(R0), _.id().ATrue*.ÁQ() is:5c9nst6™.__doc__,­J žTED `�ibute = "è(7 9ð.9,8űRaises(Attrf§P, set@‚X0, "-"[Ì�no_FatalNè_infinite_loopÅu³ðSuppressCrashReä(J0 p âtð.Popen([sys.executq, "-c",”4'%K/;'6L .cªÑ_no_current_tÒO()']€vstdout=4_.PIPE9pEqual(_Cvcapi.noJ ._ ‚__, Nonep4?Gtext�JŠÑ_empty� B�3&noÔ—Ó" "Th€… has no š.¾,NA_sÈ3Ïwith_invalidÒŒ7ú($module, /, boo)\n" %3an ‘- Hˆ® ?.__DI2— 2F ---Y  jAalso”oUp8H¢ "~!a çVI!zÑ"¿àsig)") ñD self.assertEqual(_testcapi.docstring_with_signature_but_no_doc.__doc__, None) V.Gtextr%_,[`õ"($module, /, sig)") "}!ôand_extra_newlines.ÛXzu\nThis À has a validŠ#¡ and some U U%")O§6,•parameter2@def ór_c_typeìðmatrix_multiplication(²%):ÁFM = .¥matmulType!vm1 = M(ó+m2R ~²m1 @ m2, ("Q¦", m1, m2)G64646 42l1lE'm1leo = m1Óuo @= m2 ‹oOi¼P4P ÖP@ ° ŸïÑ ±return_nullœout_errorð# Issue #23571: A func-¢ must not M` NULL Iáout setting anyZ!# b¶if Py_DEBUGs)pcode = öõwrap.dedent("""<'fimport¥ !Afromþ +0sup3MGº ð.SuppressCrashRe2(0!UÚ6'""%€rc, out,!2 = ­ð_python_failure('-c',  NúRegex(err.replace(b'\r', b'')aw ¡br'Fatal Pw‹Vor: aðß"edé'k O` br'T X/\n?  br'SystemE•¶: ·ÐÑ-õÿCurrent thread.*:5ð File .*", line 6 in ') Uelse:úwith self.assertRaises(SystemError) as cm7;ð_testcapi.return_null_QPout_e<({2hùegex(str(cm.exception),�4 'jO.* '<ƒed NULL ¨Á setting an ³1') H@def á_saresultßÜÎ)ð# Issue #23571: A funcÖ¢ must not L2 a N…z‹{ó¶if Py_DEBUGcõ code = textwrap.dedent("""<'uimport ¨ !Afromå +0sup3C. ð.SuppressCrashRe2( 4|$ùG #:"""€rc, out,ž2 = ¦ð_python_failure('-c',  =£Ùqÿerr.replace(b'\r', b''w ¡br'Fatal Pw‹Vor: aâÙOed a‡ b br'/\nÆ �br'Value›.$¥The above Šÿ was the direct causeÜ!of9`follow[U:�$Ÿ¿: H?óCÎ#ïÿCurrent thread.*Hÿ File .*, line 6 in @def çßä_,�_bad_arg($!):6q3ÿRaises(AttributeError, @af, NoneƒL%MN5ïMè¢class BadMq@Ò areturnïR8¾:!ª9ÄÁ' =Í(„ ?TypË\N*/, P5% O" ÏðTestPendingCalls(unit.qCase): ±©p*c*q_submit}g, l, n-&Wback(òð0#this function can be interrupted by thread switching so let's Cð#use an atomic operaU±%@l.ap¹(køfor i in range(¿;òtime.sleep(random.õ()*0.02) #0.01 secs on average^CR#try 'tÄú until successful.7@relyTvregularû to flush queue if we arw/un[ªwhile True¾®'if©_2Bing_‰®(¿ Ð<obreak;-)wa+±, context =Só#now, stick around/àl[0] has grown %108@counM%0;ìºlen(l) != nó‡ðbusy loop is whereR`expectc š%to_ó”#run our Ös. Note that£a only 1Kn th³0maiõ baif Falæðd support.verbose;: ù print("(%i)"%(len(l),),))þfor i in range(1000)Kya = i*i:ôif context and notï.event.is_set(O8IinueP©count += 1òself.assertTrue(' < ª)0,+ð"timeout waiting áò %i callbacks, got %i"%(n, )�if FalseÔúsupport.verbose_!) “ðdef test_pending°s_threaded(Õ"):+¶•#do every¨ò on a separate :[0Õn = 32 #total4s /es = []öclass foo(object):pas4•Í=#+.lNü.‹ì2 #submits per­A!nTÿ–En //.n¢TÍFinished = 0clock =fžing.Lock(±† )E˜(£H( O§€(target=«.Æ{Q cargs=(,h)¢ƒ-./)ÂTwith •SstartS"s(¿sm½�d.l, n,ˆºï³, 6try Ötvä¶kfinallLñ-ø kon4 C'=ñ.c*.f¹�U: ", hî3&if' =—�sìÚ.]Dµo3non syð#again, just us*ƒthe mainZð, likely they will all be dispatc %at<ñ#once. It is ok to ask�ðtoo many, because we loop until@findòFlot.T”(0can{°interrupted`Š 2°re are only&%  slots, sop"goš0wic_5at!v êâ%64àNâ'{%" �1SubÒðpreterTest(unitË.DCase(äs5Ðs(self): ð import builtins õr, w = os.pipe()õcode = """if 1:5MEsys,R‰, pickle)ú with open({:d}, "wb") as fQU?ö .dump(id(sys.modules), f™, 0Ú-Æ""".format(wG›_r, "r˜�ret = sup=ð.run_in_subinterp($R•ÿself.assertEqual(ret, 0%#No(Λload(f), A"ð ) # Bug #6012 class Test (unittest.RCase)ž@def (Öå_&ðcapi.argparsing("Hello", "World"), 1‰}€Skipitems�H‚#_s/ ‹1""")—qIf this³ò failed, you probably added a new " ýDðin Python/getargs.cãõt neglected to update our poor friend‰­ð) in the same file. (If so, sh on£5!) >W4òa few exceptions**,Ý@funcÁ brute-forceòUs allEðprintable ASCII*** characters (32ÇÒ126 inclusive—'%s,M€checking4õ)see that PyArg_ParseTupleAndKeywords() return consistentMòerrors both whe …£ is attempfPbe us°"nd*Fit iºfaped. ù'e Ñõ doesn't exist, we'll get one of two’‘specific ›° messages (,1for†,:x�); if itkLp± we *won't*t0]&--Š“either noxfor som@o7ä#weN%e ³"é3 noê"L¨&onL A and*•aWñere's a mismatch,+#8K&s.¡€ ** SoÓ0C havšñal funny semanticsRvit woul)¶à be difficultcqaccommoc€them her90Sinì‰hese areðJpwell-esù3ish;“properly ¹” ~ ()¬5canÁI*Qaway &_ ehem--th is really try|_e¢capi.parseT_and_á(", ,rYz$, 6B¹P_not_ܪped = Falsráexcept SystemEïNas e¸x#"awô 1 (impossible)�Ê(str(e) == s¾•AType“ŽÜ , # m ŸªÒ 0’optional_]ƒ = "|" += +Ü%à ŒéÐå0Ù‚: '{}'". ( ¼í‘ é Gamessag"¬¬Þitem_parity: Kð"detected mismatch between convertsimoC†PH3ÃÂÜh ({}),ðD {},ü5 {}ý ÈöQc, i,aÊ3pedˆ)1áself.assertIs(Ùµ;#, 1À1defã.L^À# Test handlÑáÕ%’  helper itOù ºuRaises(²/, èØFQ (),xf42, []1sBValu&t5l'', 42tÀssertRaises(ÿ"ValueError, _testcapi.parse_tuple_and_keywords, õ(), {}, '', [''] * 42)1ÿself.assertRaises({DQ42]) w@def Ó�_bad_use(„!):Çô# Test handling invalid format and ù7 in7pPyArg_P%T$CAndK"(ò oSystemn3$1,p1||Os?a']}W% 2O€O, 'b…W�`'a': 1v/$$^�ù1: 2‰OŠ•V�‡–�`ùŠ�V"�g‚þV|Ž˜[zOõ •üpositional_only�ƒ/ =•íÑ4”((1, 2, 3Oˆ'‡9, '(30P3¾6 Pwith N Ò“Regex(TypQ2œ� r'funcôö takes at least 2 ÷ arguments \(1 given\)'¸O¸¶4À,), {}, 'O|O‘O', ['', ca']) õwith self.assertRaisesRegex(TypeError,/6ðr'function takes at least 1 posiù al arguments \(0 given\)'):Oÿparse((), {}, 'O|O¯-@1, 21a'a': 37/O$7æ4Ÿexactly 2å1å /1,¶í5å|æQÌ:–%bSystem~ð r'Empty parameter name af /\$Rm8$U  ˆ‡keywordwvað]) class TestThreadState(unittest.qCase): )ñ@support.reap_t3s@def 3!_sIÎdÒ# some extra >-);@s dr˜` via _MAcapi^ìbgarget(S!idÙB= []§3Œcallback5 9‚.append(‘�ing.get_:())R—. îkÓe„a = b = ÑÊtime.sleep(17ó# Check our main0A is te list  3 K)s.^MaEqual(Õs.countð=, 3dªé"Couldn't find�Qcorre˜¤"DtÁ§3t =Úy…(&=ˆt.start(Zjoin(Êš;ÈÈ`_++W4if ë{verbose*8rin‰#fo uin dir(YTzaif not4Ísò!('Ž Æ1…continue14*0sub¤Á("internal",]=– |:Ø $pàPf" {Jæ}", flush=True€+¿— = getattþ�À)  ðtest() class PyMemDebugTests(unit#.pCase): 8ðPYTHONMALLOC = 'd3'ò # '0x04c06e0' or '04C06E0ñPTR_REGEX = r'(?:0x)?[0-9a-fA-F]+' Gôdef check(self, cod}�ð with support.SuppressCrashRe(©,òout = assert_python_failure('-c'a,{0 =¢.)Hõstderr = out.errrreturn 0.deàö('ascii', 'replace')ˆñ_buffer_overflowëç�=0'im _>Vcapi; m.pymemS&)'¿±regex = (r"ð memory block at addzõ p={ptr}: API 'm'\n"ëL r" ÿ16 bytes originally requested8@The )S] padCRat p-ÿare FORBIDDENBYTE, as expected.YBtailÖ \znot alldP \(0x€Ïa-f]{{2}}\):k0at [À\+0: 0x78 \*_ OUCH;1;/fb/2//.*P~öÐwas made by c#a]+ to ¡ malloc/re{ @DataGSp: cb‡žqFatal PÔõ error: bad trailing/"Øà³.format(ptrˤ1‘.compile(<ö, flags=re.DOTALL3†rRGa(out, 6 Ö¯api_misuseÑ1NÌÿ('›PID: AŒðated using API 'm',ó verified using API 'r'\n") �regex = ö .format(ptr=self.PTR_REGEX1passertR<R(out,?!) Wðdef check_malloc_without_gil(?�, code):.ˆ`out = .9( ôexpected = ('Fatal Python error:qmemory uÕator called 'Jm'—P hold�the GIL'ì4In(‡W, outì¯test_pymemñëó # Debug hooks must raise aα if PyMem_MÉS() isÊÈ/# ½"BÀ = 'import _¥Vcapi; .´)2•Ýf oobject0N OPPºb classʹøaTests(àÀPYTHONMALLOC»>d0�' @unitÈð.skipUnless(supá.…4¢, 'need pyF(')‘Pƒ“O_• „Py_DEBUG† †Default # ð" d*Úo%Pcompiæ1in –Q mode QEò if __name__ == "__main__"Žc3() ?4sys "R fromŸ%‹@ pw«šï_module('pwd')Íôhasattr(pwd, 'getpwall'), 'Does not have &()S wdJ( .0Cash—Nq_valuesŠzæentries = pwd.aÔ"“for e in +2Û.öEqual(len(e), 7P(¡e[0], e.pw˜.µIsInstance(-_, str2ˆ4e[1`opasswd0 b/d2d/uia�uid, int’Â3^g^ Àtance(e.pw_g§id, int) ÿself.assertEqual(e[4], e.pw_gecos/¶IsInstance(._, str3b5b/di- `?dir^6^_shell� `.b #û)# The following won't work, because of duplicate entriesE»for one uid= ‡Âpwd.getpwuid`zuid), eÐ�# instead‚ôthis collect all‰ {ðand check afterwards (d¨ñ in test_values_extended) ¾?def(Ê!):$g 5 = ÒFall(Æ!¼byname = {}<Rbyuidsif len(=ñ) > 1000: # Huge passwd file (NIS?) -- skip &ÚM¨·. hTest('@”is huge; ùMCped'EhDe iny­ê².setdefaultßÿÛ, []).append(ê>=uid=uÜ <Þ#á¢whether th¢åy returned by lš#8@each´ò is among those from6Ð,[à âif not e[0] orj== '+'9=¡continue #yD NISfU etc.ï-ÍÕ5In(y6namlL¨‘[ņ]M ˜L2uidKCuid]-lerrors$¯ÀRaises(TypeE,,7æ3f, 3.14Ò9?nam3 O, 4272all7Û€# try to]b some 6!°)s ,% ~Ñ(n, p, u, g, Ñp, d, s)§Ã ufu[n] = u}l [un0all?…Slist(Bv.keys()%Ui = 0U@fake =· s[%i]# whË)3in _ ¶Echar�ðfakename)  ò for i in range(len(chars)): "1if ®[i] == 'z'$.%M 'A'G#]break,elcZcontinueC/se–rchr(ordê�[i]) + 1)L©/elb‚namei = =+ 1N?try™@fake7` = all s[-i]Dÿexcept IndexErrorRý# should never happen... if so, just forget itfø§d''.joi* Añself.assertRaises(Key¨ô, pwd.getpwnam, M)=ð!# In some cases, byuids isn't a complete list of-` users¿&th À# system, soóð we try to pick a value not:gõ(via a perturbingÖÇ# loop, say)Èð uid() might still be ablei�find datagF thafÀ# uid. Using©ð .maxint may provoke the same@blemÇut hopefullyœDit w}Á more repeatŠ…failure.0xTuid =z6siz9ÀcNotIn(/Œ#*ê2uidê9uidé#-1¡Ú6’ idð because it has a special mean3hin manõuid-related functionsó«-CQbe oupRuid_t(] o2**128B!-;` if __ __�¢"__main__"�unittest.ð() """ Collect variou+Pforma#0 abÚ`Pythonµ°help debuggiK B!s.Nôfrom __future__ import print_{ Terrno $re 4sys ðtraceback def n› lize_text(‡0if w is Nonâareturn•&R= str?ñre.sub(r'\s+', ' ',V•JAò.strip() class $BInfoj­�__init__(a§:¢.info = {}à01add+`, key,ò'ue7 if‘AlTrR V»S°("duplicate:p: %r" % l"ifi9Àne: À return õif not isinstance(value, int):'+ ;str+/ù!# convert other objects like sys.flags to stringlA‰ =•)· (.E9p()FÝ! Ì@ ñself.info[key] = 8t€def get_ s(*ò5"""w@Get %ñrmation as a key:M@ dic’ary wheredPs areèUings.LX­ {K*@ for_,I@ in �ÇÀ.items()} Àðcopy_attributes(§P_add,›Æ, name_fmt, $@, *,c³matter=Noneøx(rTeï=5B(objY!, Få$if»sC¤…continue/¦% =­! %®&if¯1 isÜp V� fo§@ter(¤DC!(u MG'2modê_/6tryƒ0getx(2Í„except A¯VErrorC*¦ �all_func¦¦è ¹0 Ô¸D8¸A¸¾5º|  –ollect_syùœ„¿A = (T{Ö'_framework',1abi¹ ¨pi_versionábuiltin_module%s ˆyteorderødont_write_bytecode™executabl ’Bfloa®=Šrepr_styCAhashß1?hexØ‘implementã0.inuimaxsiz¯lmaxuniÛHpathM@plat¢ Xrefixmthreadº· + wi§TJ+`sys, '¿2%s'è<�cr/ðandroidapilevel',0, ' „JswindowsÏI ð) encoding þ$= sys.getfilesystemencoding() if hasattr(sys, '-¡eerrors'):26Eä = '%s/%s' % (,vI#(){�nfo_add('¥¢_H4', !) |ðfor name in ('stdin', 3out 8err«Æstream = getçE†Ï3if 'vis Noneê�continueƒ–Vg4, '!',J e5notÒc ta_¨ Y�ª4¦ •4%s.Aâ6 ”ð# Were we compiled --with-pydebug or ñ #define Py_DEBUG?Q. =Šâtotalrefcount'¦%ifAë@textã@Yes Éô =Á() present)'w7elsç@/No?smissing?i(À0', Fô ) def collect_platform(2Gtimport àearch =.ƒitecture±êð '.join(filter(bool,  ^c N'-xœ%('-°python_impl5�tation',<. é0Q!ì(aliased=True)]olocale[ á×#, Ägetpreferredõ^(Falsw�builtinsy"b.float_a§ __l‘ormat__(""¾ JodoubleK %L Œo²†"os'Bdef ¦_,s, value·÷0if … upÉñs_follow_symlinksŽdéHT 's#Éeffective_idl*`return¥ð(sorted(func.__’ __´ “®,< éN)øÏ¥ibutes = (ä'_º®¹bytes_envir" Ð8"f H�ÐAcopyš­€0, o¼ðos.%s', attributeÒs, formatter= ð#_attr) call_func(info_add, 'os.cwd', os, 'get1 (ui1)a g00 Tuname“ ’3defã‚_groups(!):�æó return ', '.join(map(str, +K&~5getR\P`if haso(Kglogin'œ6try©­"‘ = os.get(êexcept OSError:&# 1Ô fails with ".õ [Errno 25] Inappropriate ioctl0i#Uù device" on Travis CI'EpassJelse“VQ("os.Ì1", #s”cpu_countv 9tloadavg7rñ# Get environment variables: filter to listÙ#ðnot leak sensitive ÛY1ion(ÁENV_VARS = (FW"CC",YOMSPExDISPLAY&ùDISTUTILS_USE_SDKøYLD_LIBRARY_PATHLHOMEMDRIV 9HLANG9dø MACOSX_DEPLOYMENT_TARGET?™MAKEFLAGSSË …ØSDK_TOOLS_BIN:XSHELLJTEMP)RM XMPDIR!©USERPROFILŠWAYLAND_•q@for …`, valu£Hw.items(ؤ! =3g.upperÆBif (!4in 9'ö # Copy PYTHON* and LC_*«-1or Mp.startsô2(("<’", "LC_")Å”_ñ Visual Studio: VS140COMN€ ]«^Q"VS")–y2endw"D7"))x1b(a8q[%s]' %&Y§ <Xumask9'&(0â2os.$��!€", '%03oƒ,û |˜getrandom€ò # PEP 524: Check if system u.ñ is initialized[  ó &J (1�æ.GRND_NONBLOCKØ. stËà= 'ready (init·ialized)' ùexcept BlockingIOError as exc:+6ðstate = 'not seeded yet (%s)' %5 4ñ info_add('os.getrandom', I),‡/OSõ%# Python was compiled on a more recent Linux version`¼ö# than the curr-°kernel: ignI…v(ENOSYS¤D ifã¡.errno != .*.ôraise def collect_readline()82try gdmport ,Ç#I'0qreturn (mÀformat_attr(s, valuekbÑf isinstance(W, int#'Y‚ "%#x" %FfFelse„/OŽ~¥ibutes = (;ÿ"_READLINE_VERSION",oRUNTIM% {LIBRARYJ¹Acopy…v,]4, 'hf.%s', ³“Ý]Bter= _)ï0if 0hasF(Y', ñ ¯s&#  'À has been advCto C53.7<›doc = get€Ò'__doc__', ''Цif 'libedin{' in doþ¯(.plibraryS Dc ele5GNUra! @)T5gdbÙNi'² subprocess  f' =$ñ.Popen(["gdb", "-nx-O/"]Jvstdout=y_.PIPE8?err80uniž`al_newYfs=True€`ion = ðñ.communicate()[0]:\úÔÐ;±# Only keepD`first rCg `.split siFCgdb_*$',° Ù|tkinterÝ Æê_,�Ð,Bpass% ¿0$©4'TKOß5TCLZ\�3, '— [0Ê2¤ŸÉbtcl = EÀr.Tcl() ö patchlevel = tcl.call('info', '0') 0á_add('tkinter.,,Xñ) def collect_time(1Qadd):Vpimport  3nfoc@ime.!',  2())(áattributes = (;¢¦'altzone',ˆdaylightX (Ttznam:õVcopy_k¾’0, 'Hf.%s', &¢`if has(&Ð, 'get_clock_'·Afor Q in (V…perf_couk/3tD»' Z(KÂ+.X 1b%s)' %ƒÜXSOABI>cprefixl™…value = Æ.ÌñP_var(Ìü0if ^ == '¿‘ and not V˜i}# skip 5%=0%'…continueKñ = normalize_text(˜èÉ@[%s]†°,’ …²œssl, 'ssl", RBter= \ Ò\ocketÕª§@hostûø(§Cs# ð', hostname) òdef collect_sqlite(info_add): try rimport *3 �except IVError/qreturn (ò attributes = ('version', 'N_)/Vcopy_4–,}9v3.%s', ,H) ØEzlib@Ö(|Ó$ÀZLIB_VERSIONØuRUNTIMEÞ …0, 'Ø _expatÙ ófrom xml.parsers À:ë)UEXPATÔ,Õ p1, '× decimalÙ È_,Ë)¤__libmpdec‚?__'Òz4, ' Ø �testcapiÙ-Ú•call_funccô, 'pymem.allocator', _]E_get!ksname'ÒQ�with_pym8 UìWITH_PYMALLOC'�resourci,Plimitf[A for„ in dir(TA) ifp.startsÒÁ('RLIMIT_')]t==XÞ`key = <&ttW , 0@3„value = wQ.getrKF(key(w%('*Q%s' %O!, G KÉo_socke- 9çò±# all check;Ññlike HAVE_SOCKET_CANX�$0= [� �‹ 9!if ¤j¢)Z7, 'ª@_supìú9`YX5üT $ï('IPV6_ENABLEDˆqàµáN Ànc(info_add,ó 'test_support._is_gui_available', >, 'û ) call_func(info_add,X`python@™optimizedZ ö) def collect_c_!):x imµ¹ subprocess‘ysconfig dCC = sR.get_’_var('CC'Ì’if not CCcßbreturnG6try€Ahlexe.@argsk’.split(CC\�except I·VErrorL7#CC42ó.append('--version«õjÿp.Popen(5,�” vstdout=9_.PIPE48err4oSTDOUT6 0uniµòal_newlines=TrueÞ‡0 = Êñ.communicate()[0]Â"if„Fcode3U# CC ð failed: ignore e`Dþ@Ä0ext8ošvt" normalize_(¹ç8.à•", ! ¶+´—� = FalseŸ"40 = B.add¨5forý^Q in (3Ò#ños() should be the first, to check�getrandom.Btatu/Lc2os,{†builtinsé/>gdbnlocaleŽplatform@read�osocketOqlitd?ssl-y» 0?tim[Odate~tkinterI?zli OexpaÓodecima¿ Ncapi`resourc­'ccÈ2# CB�ing from Ss2plast as&õy have side effects.sø@_œP´úT ?Sà' e2E90ion¦6exc%ê0 = Y¬ðprint("ERROR: %'%X" % ({¢.__name__)³>öfile=sys.stderrŸ#¡traceback.o__exc(1 '# l‚.flush()—ÆÛhPdump_8>!, {CNonev¡title = "Pƒð debug informati÷on" print(title)“"=" * len!) )€infos = P.get_ "s(* ¡ = sorted(‚.items()"ñfor key, value inI!s:\š= ò.replace("\n", " "F)ÃÆ"%s: %s" % (Xm#â) def main()jšÓ = PythonInfoÁâerror = collecÝÇxAdumpñ¶1if 7Z›CEòion failed: exit with3ò", file=sys.stderrhE/ (1Áðif __name__ == "__Ï2__"v C() #Òñ test set -- part 6, built-in types from)±.support im@run_¤ƒ_locale „ions.abctinspectFpick4 B4sys'„Z@unit²T.mock"ðweakref class TµeTests(/bCase):œæHq_truth_Kcs(self÷X�if None: .™ ('a is tr”östead of false'”Iif 0906.8.:)''qO\'\'tYnot 1=1:Ô5 inåõ ä: ²1²>,'x·x¸@{A)1}¿¯{\'x\': 1}È ‘f(): pass©þMCSx = C&0if ffv:C:C:9sys<?sys>x<x: %2¯boolean_op1M0 orúa@Pã QP1 and� Œ:els‡'UEVf U¢ à>-=N'Âô¯comparisonô€< 1 <= 1q01 > o> 0 !=ÊGint _ À`0.0 < Xe!.0g!.0i !mŠ9 OfloaqÀ if '' �< 'a' <==Abc' d£b': pass ðelse: self.fail('string comparisons Eed')5¡if None isS Öidentity testNO1defð_float_constructor(•!):&­ñ .assertRaises(ValueError, ?7, '¦1?5\04_6œÂÜzero_division¾átry: 5.0 / 0.09ÕÃexcept ZeroD:ÑS "J� didn't rH5") lƒ„8K…!%6Jƒ‰‡&F{ // 0_ // 0}%|2%{ Ünumeric_types pif 0 !=P or 1 01.0 - F-1.0 <àœa('int/ v§ not equalÛ`# callÜ‘built-in Š÷ without argument must return,€if int()š03Adoesy:|"if¡>.@º=() B.›€�1.9) == 1z�1.1) andž-E== - -2P A �ßound properlyÉ1…!.0{Â-ª0*0ôz EHwork…¯O/B_to_² Q(§(f, resultL?PE+õ(f.__format__('e')9y4w8v'%e' % hs#Üñ all 2 digit exponents, both~ y9’tr# '%' šEtingÀfor i in ran÷ge(-99, 100): ð test(float('1.5e'+str(i)), 0ðe{0:+03d}'.format  G # Eõ some 3 digit exponents&ðself.assertEqual(nb100.__Ui__('e'xo+100')Cs'%e' % J²:;41~ 1~1~:~ -ý +€&')¢|?-10ÿ € ;2'%g¹0·f #+.�\1def| _n—°l_integers(ñéô# Ensure the first 256 /± are sharedW0a =$•b = 128*2ðif a is not b: sq.fail('\Váùif 12 + 24 != 369oint op.P(-24)1?-122U(-12)c1f˜÷12 < 24’,o-24 < Àô# Test for a particular bug in³• multiplyŽ‚xsize, yzÂ¥38, 356, 4*!if³(2*1*0!= *§ == 338912P!ð·÷mul commutativityÆå# And another.‰±m = -sys.maqE - 1pdivisorøú1, 2, 4, 8, 16, 32Ç“j = m // 4H«dprod =I * j1if "J!= mV=è€"%r * %r %rŽs%r" % (tA, j,JF, m)¶E€if type(h)5?into ˆexpected;Pto be,Å� Ín~™q# ChecklpunifiedZQegraltY�, Ù�‘ °.#ð%r) to be int, ¿not %r" % ±(prod, type 5)))7ñ # Check for unified integral2*õm = sys.maxsize:õdivisor in 1, 2, 4, 8, 16, 32:+«”j = m // 49+ 1!­% =9* j!if—É@ is :intfjòself.fail("expected;�%r) to beê,AL* x#ŠðassertIsInstance(x +.Eint,B¸'"(y6ò) should have return¹"ÛvO-x -w-x?- 1x-!2,sï x2x NÅtry: 5 << -5öexcept ValueError: pass Qlse: ,,õ 'int negative shift <<') 2g/>>g=$>>gðdef test_floats(Ÿ)âùif 12.0 + 24.0 != 36.0Æ9F op'6 (-8)9-I:())s9v°Üh! <ê¨2Þ1 < ³4Ïhostringialen('', bZ\'\')c"'a11}?\'a2Rbcdef767 < 'xyz' + 'a 'Ò Gâê concatenationº94'*3D0xyz]E`repetiB: *3E(0*‹'> *0*>@min(@¨'a' or maxcU‚min/max à OA!in�' and 'b'¤cc!d'7./s.in�q'x'*103mØ if '%s!'%xgJx+'!ÎSnastyK”ð matting bug') #óextended slices for strings õa = '0123456789'ÿ self.assertEqual(a[::], a)# ¿2], '02468'* 11::+_13579+ ÿ::-1],'9876543210/Z_97531+ A3::-,) P-100:%.´ 5?-1]  .7Š;fðdef test_type_function(œ!):"Ç«ðRaises(TypeError, :o, 1, 2…1 �, 3, 4) i‹Üint__format__‹&0(i,o$Çspec, resultµ¹ñ# just make sure we have the unifiedÁL† integer¼C¢%`(i) =='±"·“,9str,Jõ'i.ì>Òi©(J…, 'd', 'Š*–+@, 'cM \0Ñð# sign and aligning arePerdepþ%nt/L0"-"™ ‘B-1, -fÓ637- 9;++;; ;v;°t 7U# hex÷¶3, "x", "3">Xñ7<4d29- -! 8x� %F&KJE @--Ôint('be', 16) ,be  'N,BE'-(°P )Q-RØu# octalÎoÎççQ65, "=101¶-æ>?232'!-"B-"!À test(- 1234, "-o"ƒ2322") Stest(" " "-#-#"+E+"E#E‹…# binaryœP3, "bº,11·--�;­0011010010D(-#)(-Q)R R {8*S+S+S* S�õ # alternate (#) formatting#¤P0, "#t['0b0']-1”1<-?-0b 5| "A#+#!+C 10¡+ƒ!60Æ'A#012l10b0TUµS,--1W;3='0ouš/-#Û=?-0o 5! "`#+#!+C+¡!,44 # h20o01+…H1012,--,7x", '0x7×#-#?-0x 5! "`#+#!+C+ƒO+0x66g"0x5.00+6,--,Ã#56d.-M1e24Fv /]/“X“XMÊ3#-#s?-0X 5! "`#+#!+C“C?+0X<Ô$/0X“,--W5234d.-/1E“/]/“À test(123, 'Ã,', '123') Átest(-123, ' D1234 \1,234!5"-#D%56Fo23,456H&W'L7M“O,567O)š*õ# issue 5782, commas with no specifier type47‡a, '010:T00,00ü*@# UnAdAÕ for integers$N¡0**100, 'd§Û' + '0' * 100±1,+0 97;e100') dø # make sure these are errors&õprecision disallowedEð self.assertRaises(ValueEFö, 3 .__format__, "1.3"¹³# sign not We?'c'`$)+c_z²ÿ must be string`?Typ¿FNone¾ú:®À# can't haveaónó%),nó]P&,P]##'º]&#]‰C# en‹pat only¢ and float-}es work>Eî_#Á in ([chr(x)axñrange(ord('a'), •z')+1)] +L L ALZL)):L!ifã Ÿú'bcdoxXeEfFgGn%'4}a[0[^£FJ 1J6O(-1)M ìß;¼¶mat convert  # ³"Bto a#`'i h*v±  [0, 1, -1,a }Ô`5678902234 ]± aEqual(Z(¦,¯£F)G ÑI·E6902]J·ð, "0<20", '123456000C') òtest(123456, "1<20", '15*5*5"0>j–2000x515 ˜15 *5 ˜*5 /0=Ÿ!5Ÿ5Ÿ©ó@run_with_locale('LC_NUMERIC', 'en_US.UTF8;@def ÚÀ_float__form?aself):[#, Ö support for :¥ code 'n' 7!÷i in range(-10, 10X\Bx = l±7890.0 * (16* i‡+–Ò.assertEqual(‘.½ðstring('%g', x, grouping=True),°`mat(x,¦)[#?.10^r.10n')) ›'/in™;’ integers�V �‹ ÑL0, 3Ϥd¤{ªô# move to the nextÏ9est/Ùvx // 10îÕrfmt = ">20n"/l<c^ÖxÖ,½67 8 9 UöE2en(æ@(0, ÄV)), lx× 300, ÷II*Ir(2($(f²×_spec, result*= &f.“3@)Aõ@  }=>>€(0.0, 'fc"0.ª'ð^#©Àdefault is '=Rexcep?Pempty˜@mat ç_^ºX|C1, '1q@'0.0 ]Ðàfor issue 3411# àtest(1.23, '1'Z.23') -! "!gC"D g� 1.0, ' #, 1d-->+>+>>�1.1234e20‚CL+200Š-Gó?E- ظf(0+')$Ÿ% &ä ' 'Î Ï@H& &?A, '+&1+1.% ë?& '¿ð-# Python versions <= 3.0 switched from 'f' to 'g' formatting ,õ# values larger than 1e50. No longer./Cf = ‰&90�or fmt inre, 'F':&û"# don't do a direct equality check, since on some>@platÁûs only the first few digits of dtoa:úwill be reliablYÐresult = f.__`†at__(fmt‹¾Àself.assertEµR(len(<_), 98. *‡[-7], '.× \IU [:12], ('1àü!00ÉR12339&')w–/20—š,/20g Ð^e,\.e+KS1, '( c)QEQEQ(Q)<2ñ]00e+2e-[ 00ó  NoÖðmat code means use g, but must have€eecimal)ñ# and a number aft2e d)ö . This is tricky, becausMô# a totaly empty�“specifier’Û th„FelseWp# So, j¥µµa sign flag¦e1,Q +167%¶$ J.L.N)P(R¬# 0 paddin°Ð234., '010f',� '1234.0C') Qtest(Ÿ, '011f',+2+0<V0W-X-Z-3‡-ˆ�� 6/12¾256.!348#1.�p5') Nõ# issue 5782, commas with no specifier type4‚!.2`@0,.2‚@0,00 1.˜,²# 0 paddingWc LéN!1, 1,wÞ.-2-3-0[ Á\-/^/4�-Ž5ë51_2,345À"56363�,123,456575�4=¨%3,©±;+å# % formattingB€-1.0, '%ŠC-100ì%ë>×È must be strNòself.assertRaises(TypeError, 3.0.__F†__, None™;0„SotherÝŸvõ s shouldn't work on floats,þ÷# in particular intB($fo`_Ö5€([chr(x)x xñrange(ord('a'), •z')+1)] +L‰ L ALZL)):L`if not‡5matŸª'eEfFgGn%'.wkDValu§¡0, 0 V«DH\H0¥I0h1e100,1Û%-K7 1ey–+Àormat, -1e-1ó00, format_spec) ó# Alternate float(Eting%ÿ test(1.0, '.0e', '1e+00')"##.$1.0fFB. Q1, 'g</.1#/00£1.0%C>00%Dæ#".#èØ# Issue 7094:;]5 (b¯ified by #$E@ '1.¤/00)#*)QR/' x#'Oý .1ãL™&K% .1ÈJk#"F! .1ªP '100“Õ%$ ®E6902Íà2345.6, "0<20"Ò‘ ”$J, "1616*6*6"0>¢•1‹616š16*6š*6/0=¢"6¢6¢ç@def ç_ôá_errors(self):'b# int,ûó, and string all share the same à@ømini-language parser.aðCheck that we can't askO÷ too many digits. This is`ñprobably a CPython‚Aificåñ. It tries to put±WwidthF@intoBe long.ð.assertRaises(ValueE,3 , @1'*1{i + 'd'BÁSimilar with}Ÿprecisioni! .'coñAnd may as well_ bothn!hsyñMake sure commas areÍbllowed°various typ(&deÌöfor code in 'xXobns'ŠŽ�,&MŠó!inÏàl_sizes(self):# ÿself.assertGreater(object.__basicsize__, 0)4 Çtuple.__item23ð def test_slot_wrapper_types(!):'‘ަIsInstance‘@initŒ<".WJïDescriptorType¦L?strK5l•- inoG)PomethodR' ()² TMSZPJ RI) H0(42×D IdJž¢str.join, —²–Plist./ndG))''ŠrBuiltin‘Í+[]…B:¬Ëôdict__['from_bytes']ÙRClass”%[QO£žNGV__newÿD0 c¨ð MappingProxyTests(unitÏ.CCaseÀm*p*$ = ?Aype ?¼constructor @userM(iÛBpassPñ = {'x': 1, 'y': 2}s#QEquals.9¸( 4), >5 = •�x=1, y=2uc*ócollections.ChainMap(ÙC}, {Ûy-ÝpRaises(0qError, ÿ'?, 1<q("a", "3/")ÃH[H<2"]) dl aÀ attrs = ôset(dir(self.mappingproxy({}))) - "Ãobject())) 5õassertEqual(attrs, {")ý'__contains__',getitemOiter?lenMcopyb=getqs>keyXvalue1}) ÄÁdef test_getA!):õqview = " WÀ'a': 'A', 'b ?B'}RH`['a'],4)b)/B')ðRaises(KeyError, ] ._¿�__, 'xxx=á2ïO'a')“vIsNone(.W• X*Q, 42) i|missingm¤class dict! Ž’®#__!!__D[, key(,ƒreturn ".`=%s" %,�#Üá{8O(x=1/ D0['x´1 0['y''Z/=y¦x¦\ .Ñy+·Š . õî±True('x' ingU‡False('y&L«Y`customR¯ªó % £G{Dó ifà¶ == 'magic'ÌLß«Oelse6 ¤.’ZK»ý· Û$‹%0(('3',)› H,G >500ƒO8 '$';K; $;�s< %=®> &?D/}"¼"á e"v2c¡, default=ƒGqm E'FT%r' %Tðcustom = customdóict({'key': 'value'}) öview = self.mappingproxy(custom)"±assertTrue(R@ in B'omagic') ¯False('xxx( `Equal(p[~Â], 'getitem=ÙˆñRaises(KeyError,²3.__;A__, |=tQtuplezÏ), ('iter',)14len/?500)Π.copy(), ' '. 2get~2?getü ¿e7d7Ïdefault=Noneues¤ 02key/ .¾0 1') £ðdef test_chainmap(ˆ!):ÃÖd1 = {'x': 1}2ó2àð = collections.CZ¦Map(d1, d2~6H*”.É Ayî z& á�['x'], 1—'y'è¾+zÎ )bsorted1x', 'y'2œ" =² (Þ`IsNot( /, � £IsInstance-b@b(:.p/')“+y+û—àn€,zK ….´0())� ('Ž1 'y', 2)— LÑKJØ AâC1� í|ontainsíX’‘dict.from�O'abc!zaT %b%Ú!¦ÙÔ éÅÅ¿*þ.¹Ðkeys = view.kseys() âvalues = view.Eitem öself.assertEqual(list(keys), []e)m+z *ñmapping['key'] = 'Q'ÛvŸ7¤^Ö«(b,—A)]) ›Ðdef test_len(¤!):‘÷for expected in range(6"&ðdata = dict.fromÓ¤('abcde'[:@ª5j ­0en(J%),s21 = 9mRproxy6´+$ 0en(@ ]3ÿœiteratorsÏÆ = ('x', 'y'–á�V(1, 2tÁ = tuple(zip…", 0))“ÓAict(G. Ö4setÖ ©/.)_()), 6¾8pÉ9)~LcopyzÀoriginal = {¾€1': 27, b2': 51 q3': 93}ÐÿWQ‚wn O Ptype(%!),íF š&., o&1'%70¸ GÉ+O, 70r +Ð27) class CðCreationTests(unitô.bCase): 2PMeta(îé(ð __init__(cls, name, base ws, **kw2Š…super().: 5ÑÕ@staticmethodvnew__(mvvreturn }A‚ý�prepare…÷n?ÿy)`ns["y"71ýª.update(kw2å"nsº*Ó_ìÊm_basicÏC™Uypes.*F("C"] †@C.__¹O__, *+�(object,ëànew_class_subcÓlass(self): ñC = types.new_c#Å"C", (int,)))8ò.assertTrue(issub0‘C, int)) -•def test_Q\_metayqMeta = W <•Ðsettings = {":e0": &•, "z": 2}/ð# We do this twice to make sure the p¸õd in dict isn't mutatedIPfor i$wrange(2%—)ô + str(i), (), ½8<å„ñrtIsInstance(C,Ó+ÏEqual(C.y, 1%Oz, 2�Ÿexec_body†Æ{func(ns µns["x"] = 0<Æ , dÝ)'%Ox, 0H! FBB ‰�_keywordJ´#Test that #5 ar}t£%e Hƒk_ û(name, bases, ns, **kwƒ}return +%kw’ reA Ú5X",#šø� object)- O(¼¤= Æ_, x=0=�rÞ4("Xiqß {}, {"x": 0}S~default† ‡/‹o¬ }, NoneK __z__, "C"* É+(SS‚ö'`_with_6«XÏ=öš•!s=  [kwds=¾?z=2< «=^€¨ UpGMÞ�mro_entrŽF1 A:±ŒCÂç?$__JQies__1;1À re³turn (A,) fc = C(öD = types.new_class('D', (c,), {}+ñself.assertEqual(D.__bases__,f, Gorig1?c,)1 1mro[ñD, A, object)) Í•def test_¸`_with_4°entry_none(µ!):2á‹ A: passBC=Aw_eiüd!, k."re†ì„A, c, B‰/ BZ ‹h¤8 í\ë�B“Qerror0)” ~5Aì 5 îÀRaises(TypeE®©Î, g$› multiplŸ1Š/A2B.B.AÏ5fA1, A21ÆB_5WB1, B_¨�A(), B()%¿#, hUº/_2ÇŽ¼/A3ÓO, A3×V6Cí Cð(@A3, @_÷ñ# Many of the following`ñs are derived fromš_descr.pyòsprepareIW@q# Basic@mBmeta_QationOiõexpected_ns = {}2 A(Š]4yÐ__new__(*argsë, **kwargs): ðreturn type.__new__(*,6 6Ôdef __prepare.Z¶expected_nsH1B =s s.rõclass("B", (object,))tC,C,�, {"metaHf": A})kõ# The most derived ,ó of D is A rather tha €.¥, ns, kwds�u0("D‘\B, C)Ž[}Ïâself.assertIs(]AvA' Equal(len( C), 0þ©˜test_bad_²ƒ±#Ïs) must ¥a mapping.ñ� BadMeta(ÞL^@"emethod6‘ˆh =(|ENone@Pwith ¹<õRaisesRegex(TypeError,/G3r'^¾'\.�3\(\ü'G¨$`, not ·’+$'ÛA Fooö=‰ *ºEpassˆp# Also Îñ the case in whichISχaa· ±�<à>µa>Barµ/()·¸î±ð_resolve_bases(Ä8´9A: ðBC½gñ__mro_entries__d!, pkV@if A= MÚ(q&A,Wc = C,ã§�%*s.g()), (è6!c,8A":C: Î:A×® >Oc, A´%NA, c<Xx = (�yC’Ðz = (A, C)  át = (A, C, B) õ for bases in [x, y, z, t]:#+ñ self.assertIs(types.resolve_?("),M!) >ðdef test_metaclass_derivation(T)gõ # issue1294232: correct <q calcul=_™ðnew_calls = [] # to check the order of __*_D%ls>”a AMetaÕ�]À9³(mcls, nameäK, ns04g‘‘.append('_'s&ÿreturn super().i ³:@¸imethod±žprepare__µ±‡"{}´`_! B¾ 7gêc`‡nS�UÕAns['Ùù_was_here'] = Trueªgz&nszBA = ^^ˆÅ("A", (), {" "":¶}‚O£aEqual(B3, […]/s.clear(³˜B…B…ë…#6Ío«Bwithöý½ f?', ÆCÆCÆA ±# The most ž'edt"isÒ«Al5eñ should've beenH/ed…X =ïXï íeìY:Y:£. AZAZAA<5i2Is(Õ?, X8!Y! ZFŽcallableFT85`but noPÑdescendant of‹-ð = [] # to checks` order6 __* _ šsk�prepare_B„track __! 9¤0Not—'ˆno0(mcØw 4�…£.append('A\'�)¨ˆsuper().l -@§emethodôB£Ý§»name, bases4.§&{}K�# BÛ(ä nž_šA!fAŒ§ƒ(_(«_A/A/ ª{® 1!,q6(A)[)ØÇ=Á %Å TÿP !LãBB!à, type(B))  ô self.assertEqual(prepare_calls, ['BNotMeta', 'A 0]) > 1v.clear( `?new\-Xw¡C = types.%ÿlass("C", (A, B)‚4Is(Î,=/(C) œ2 2 OB, Aä 2*›ð# This is a TypeError, because of a metac3¥ conflict:Y$# $DÑneither a sub3B, no1perT‹CWwith úuRaises(Ž)nBD¿D¾uC,), {"¯!":·5}) lE=E=À}E±F"F"¯object(), $F²1F14C, ë8µ.:t#  5int, X­X­‡C, int()–\À types.new_cñ-lass("X", (int(), C)) def test_one_argument_type(self):&*ðexpected_message = '(ô .__new__() takes exactly 3 PÂs (1 given)'wQp# Only D0 itnô can use the one-Aå form (#27157)“4 .assertIs(Iƒ(5), intÞgcþ! MÏEpassMWwith RöRaises(TypeError) as cmB?M(5�ü Equal(str(cm.exception), F ©N©a, meta»/=M¶>N¶0 �ð SimpleNamespaceTests(unitU.bCase):÷n¼constructorhQns1 =+s.^(l?ns2&ˆx=1, y=2.3.u**dict(5’ �´v1, 2, 3�V2‡**{1: 2}®¼ len(ns1.__âf__), 0‡ /@vars0_), {}(W2WkW2W@'y':o'x': 1e3e3eã{unboundwÈ)},M ?ns1j mns2, {5 Ð�derlyingçØÓJÈÒ&Í.Oöa=True, b=False5Æmapping = nsØT0del(“09+ B` d¥ , 2(ÌmK~attrgetsmLS, w=3O‰vns.x, 1? «ons.y, zÀal(ns.w, 3)  ówith self.assertRaises(AttributeError): /Qns.z ðdef test_attrset(J.ñns1 = types.SimpleNamespace()BQ?ns2&Øx=1, y=2, w=33Ç1.a = 'spam'J01.bhw2.z = 4(`2.thetCBNoneÎŒÁ ðEqual(ns1.__dict__, 2(a=wP, b='j)™@2@ Ôq, z=4, Ž=Œ"))Ž \?del\N!@del +�I0!2.IJ_52.y i“vars(ns2)¦‡w=3, x=1�Pns2.y]6KŠûU›+Ð=E = 5š1åÉ-=5Ž1?ÑG ,{}pOreprm Ï Ö &`.x = "Ê"ùª_« @name)B"(áÄ ns( "{2$}(Ű2)".format(=E 0O\O@_y=5`PÏÈeP\"½CãO1�,¨­¼  , t§#4NotC2];%onesteda"6b=2§+3v<š|Q =ä 0hamQ?N»Í-3ˆ±¤W1R2‰ 4‰4iß=ns3, ham='?'= Àns2.spam, nsC3) ÿself.assertEqual(vars(ns3), dict(x=ns1)1Áns3.x.a, 1) Wðdef test_recursive(f!):xöns1 = types.SimpleNamespace(c='cookie't?ns20&3&8x=1)Ç1.spam = ns1–2332ãÅÔ :"nsW,Vn(V-7_ ÇZé ¸(2Px-è__reprí¹è€name = "§"óÎ "{}À , _=à...))".format(,=yIçI= I , ÑO™ xa(Í , +"2)+2Ú1as_9 Ø�Â''UEPwith MQ÷Raises(TypeErrord/flen(ns;?Oiter@)Çu' in nso„2ns[G]RMŒsubclassGo Spam(9 #BpassZ1t" =>×ham=8, eggs=9„!Isd(7!),7m(2+À{'ham': 8, 'bS': 9}eã_pickl=°breakfast="hƒ", lunch_èÀfor protocol brange(pü.HIGHEST_PROTOCOL + 16néE%{}´ s6tryÙ2ns_uBd = ¥.dumps(ns,¢ Iuexcept ô^ as e[r& (p³…) from eŽ…ðroundtrip = pickle.load÷s(ns_pickled) óself.assertEqual(ns, ns_roundtrip, pname7àdef test_fake_àspace_compare(O%):b÷.# Issue #24257: Incorrect use of PyObject_IsInstance() causedFÅSystemError.ñclass FakeSimpleNameŽG(str…î!__.»__ = types.4VÂoFalse(/_() ==|/))K?TruJ!JWwith š±Raises(Type î³<²±g5Ðh=>ÏS>Ï! Uð CoroutineTests(unit$.CCasež<¬wrong_args0 saÉñs = [None, 1, o!5()]?Bfor *3 in suðÊVRegex6,R3 'Rcéó.*expects a callable'çH 7(¶ LÝnon_gen_value@EµPKfoo(xÕreturn 'spam'-=è:,'’»ÓPAwaitÖ Ws0__a,__½>�( Uaw = SÜ$/awØqIs(aw, ÙÑ # decorateÅ second timeE5fooäF(fooÃ@hó¬_async_def # S that�i p€1s '=e def' s¥ # Õöout modificationÎ>ç1():W> foo_code =!._ )__ @flag|5foo!A.co_*N/d_7Efoo,Ž@a¡†ß‘;3Is( Àed_foo.__codóe__, foo_code) @ro =%()ðdef bar(): return U_coro#õfor _ in range(2):^Àbar = types.8–utine(bare'" =l @äself.assertIs(© , 1 C*`Equal(#1.crí’.co_flags ?.Slose(ý‘test_duckõ(dáêclass CoroLikeù>Csend4Y passÚ!_throw" c’xD”__await__Hª4ãß% =¬ä@�¥¡Gfoo(ñ«_Q+l ¦,()£#.»/Sz z3genß!ˆ}?Gen€…©Öo__iter¬(,7nexØBÿo°}Ô™ÐÌLf Ÿs�˜õ# Setup generator mock object¾ gen = unitè.#³.MagicMock(¡Dgen.;� = lambdac:Vû.__name__ = 'gen'!} & §ÀInstance(genÐôllections.abc.G⨠>6Q )VJsp6genÅ`wrappeQ˜Û wµ.,~_°WG·8 ž4## G� proxies '�÷Æs completelyÎ ª(Z$, ñ /Ù*co’ a§Ðself.assertIsó Instance(wrapper, collections.abc.Awaitable) Ôself.assertIs;ù.__qualname__, gen)> :uõ# Test AttributeErrorsV@for 4ð in {'gi_running', Sframe 4cod µyieldfrom',Jå8'crJ5cr_J4cr_J@cr_a(9'}:GWwith .zRaises(Ä)4xtgetattr[,Ú $ ås pass-throughƒ„ ¦ = object(Œ"Ô èF$ÿ-—+�:¯86Å5 4Ú9> 9<“:Ô86Õ5 4¸5ÞFk.close< Ð_called_once_ú(²Efsend(1˜�D ,¨reset_mock^Dnext- \ __/__` /_½`šw(1, 2, 39e3li 0f 3Ì -`­QexcepL€ propaga ZeÃD = E' ^‰áside_effect = 4B:try> «¬‹kj as ex= q2ex,nE?lse3cfail('{… did notòRe an Gion'&¶invalid argÐ \ZT2Typ O–.L`À self.aóssertFalse(gen.throw.called) ±with self.a0õRaises(TypeError):+2öwrapper.close(1HCs&s5_send(q $p¹ð# Test that we do not double Ò*õ@types.coroutineñdef bar(): return85per"0Is(VBper,5%) 'Œõweakrefs support cref = D.refKú0Is(#$),�j¯ð test_duck_functional_gen(ª×úclass Generatorðô """Emulates the following g1ö (very clumsy):ë0 ‹v7futuöresult = yield fu t,5* 20 9"""s�__init__î,W~ y._i = 0AU fu› •a3tera\³G \<4nex�< .ÓV(NoneŸGa?, vF:tryÍ8"ifòú?= 0%)` v is ƒ É!í,._.% w1wr„p StopIt•šion(v * 2X/> W Ñofinall8k/I+= 1:�_n�tp, *exc•DN= 10uPif tpn¡“OExit.*-tpŽzŽ„° d=X  7foo Cw('spam'F1 = 3¦]¤IsInstanceé", …_YWuYQasync[«à(è’Rawait~) +s90 = @¹Ÿ`Equal(%‰$, ê+ k2&20¶jexceptÚj as exß �èex.args[0], 14R8lse<À self.fail(ñ''StopIteration was expected') def test_gen(self):—gen_func(uyield 1,‚return (%2)fgen = Kõ@types.coroutine—sfoo(): V5gen¡wrapper = $Àó.assertIsInstance(.", m@_Gen2orWG¨ @8Ð.__await__(),Å:òðfor name in ('__ Æ__', '__qual•gi_code',­@°'gi_running>›gi_frame'v ¡�getattr(,‰)`i03gen.ûR1.cr´õ.Áý�EíT(next6O), 1^+”×.send(None), 1Wwith `ÉRaisesRegex(Ô|, 'spam( _"ð �7 X®Æª PExcepzO, 'h¥gthrow(- (7t # decorateû¶ second tim;Sfoo =ìY$� Is/()æ‰ ‡€ing_iterY /Í _ ÍyC –V)(ôX ª³ßªªPaPöÛ&ocF m[1genc¡$ 7 +Ý(ç(ÖÅCD(gen¨-1 ABèC@Truef!._ð__.co_flags & insaÿ.CO_ITERABLE_COROUTINE‚OFalsPG—g/è ©º¦2M £‘/Is® Õõpt|_objectl'6ùðyield @ótypes.coroutine @def 5():Õreturn gen() “wrapper =4ò self.assertIn('GeneratorW1ƒ', repr(@/))9iEqual((O, st6 ·True(set(di*€.issuper{mÙô'__await__', '__iter 3nexpcr_code#Êcr_running',Jqcr_fram&%gi1)gi=m 'sendE1losBð throw'})) if __name__ ==§rmain__'¥�unittest.¤() import à # For scope )ô*ing. g = "Global variable" class DictComprehensionTest(S.bCase):8Z€_basics(Cù4expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,lºÕ8: 18, 9: 19}"`actuallö k: k + 10 for k in range(10)0­®uA$, ·ó^30: ÉÈÇÆÅÄÃb7, 8: ­¬v§vºP if k vÄ©¬_isolation²kvLocal Vt ANoneÒ 22: 3 4 5 ¬N6òA89 ð£†k(â(… Kk, " ‡±, 18: 2, 19’27: 3, 289�36: 4, 37  381 39’45: 5, 46789Z54: 6‘Ò 552 56789’63: 7, 645˜ 662 6789!72à"7345L 762 77!79’81: 9, 8234L 852 8678?9: r _ ,0v *Œ7 *† X e¡q_from_g° ­�À 3: None, 4:’ None, 5: / 6$ 7 8 9 }8²actual = {gö for g in range(10).òself.assertEqual(?µ, expected)Y +õg, "Global variable") 0B‹ñ9: 1, 18: 2, 19’27: 3, 289�36: 4, 37K 381 39’45: 5, 46789o54: 6,L 552 56789’63: 7, 645L 662 6789’72: 8, 7345L 762 7789’81: 9, 8234L 852 8678F9: 9 ü°Ag: v8v8K0v *ŒV +× Z‰…Û¡def test_gvÀ_visibility(C!):&V|K0: '§O', 1@D2*/ 3@4*ð–@6@7@8*/ 9 Ak: g÷k +zB —½_local¼`v = "L%WB‘ Ù (Ø >B× )Ö >Õ )Ô >Ó )Ü'>Ñ )Ð ¤PÙkÙÏ(B ú-v,¹ýüillegal_assignment»Wwith [òRaisesRegex(SyntaxError, "can't J"ý ácompile("{x: yÁ@y, xÄð ((1, 2), (3, 4))} = 5", "<\/>"+X"execߨ)À coÿ.mpile("{x: y for y, x in ((1, 2), (3, 4))} += 5", "", ñ"exec") if __name__ == "__main__":9@unitI.ñ() """Sort performance b See &¢ñcommand line syntax.$¡tabulate()(`output Pmat. bP impf4sys Dtime drandomtmarshalutempfil-”os td = @.get °dir() def Q’floats(n)ùñ"""Return a list of n)2om ,€¡[0, 1)."""/Å# Generating&ðs expensive, so this writes them out to a ¸3 inKa³ð directory. If2(ð already exists, it just YH@back¬Ždshufflyaa bit.'ñfn = os.path.join(td, "rr%06d" % n)(2try!V fp5`pen(fn-"b"%æexcept OSError03r =C.s!omSJ³result = [ri³•range(n)]) €:  ™w™8b.dump(€B, fpÂ%Ÿfp.close(u = None 1Winall(Vif fpdzos.unlink(f‡r Epass¬ 5z as msgŸÂprint("can't´1", í0:",/Felse9M4 = cXload([S2# SœÉ™.›¼ô#10§iZ8ë$õ'k6[:iUBdel ¹ 9m.rever2€.extend()RV‰£assert lenp)sïrmP–cflush(é³sys.stdout.%cdoit(L% t0è@ime. p_counteæ‹cL.sortÅ/t1*õP%6.2fûò(t1-t0), end=' 'ã ‡Õr‹Sr"""Tê y` speedèPsQñvarious sizes. %2The‘ are 2**i4ýó (the argument,œ);O±displays i,D , þ=In”0arr%!of%€Ü¿òpoint numbers with|Qollow!¢roperties:»*T:âQ dataR\pdescend:/aà3sort: ascendiõng, then 3 random exchanges +sort: ascendi.$10/ at@A end0%0\òly replace 1% of:¤lements w/TCvalu€~PÓmany duplicat=‘all equal€!°worst case ºQario 1"""ðs = tuple([ch + "<ñ " for ch in r"*\/3+%~=!"])8ðfmt = ("%2s %7s"7¡ %6s"*len(V)*`print(0ñ% (("i", "2**i") +šs)pio:cw¥n = 1 << i1L = ‚floats(nf-jð"%2d %7d" % (i, n),–F=' '+fflush(°doit(L) # *ým�.reverse,\,D/EO# DoX.!úQdummyþu6(3)Ü#i1÷0om.Er&ý%2%âL[i1], L[i2] =%1]‘Ë3ËR¹ñthe last 10 with”2om —ܪif n >= 10Ñ`L[-10:‚[Ð×Aom()y ?10)ž–Ñ$# žW#at£œx‹n // 100L¥|½ ¼B ¤!ArAç@lotsÓž:* 48†del L[4:úQL * (À4Ùz# Forcefõto be distinct objects, else timings can beÕMöartificially low² Šó list(map(lambda x: --x, Lê(cÛdà /Ø�. Again,:Ï› —ÿabs, [-0.5] * n–V–ñThis one looks like [3, 2, 1, 01ñ3]. It was a badõZ#ÎÒ an older impPationPquick†Á, which usedÌgmedianJJbfirst,žÂand middle eYAs as?Vpivot"qhalf = A2U8´(%-ãg-1, -1;–L.extend(*„o"s, so th6pñare comparable. giƒ6`# sign antly fast6�f we leavæ amãFintsÞÈ—¤à, L)) ódoit(L) # !sort ñprint() def main():ñ"""Main program when invoked as a script. /ðOne argument: tabulate&¡ingle row.)5Two)s*òrange (inclusive)1VExtra3ð are used to seóhe random generator–1"""u�# default) e rk1 = 15 a2 = 20 òif sys.argv[1:]:9# oñsæFpoin\VkOdI!])]Ha2a:# t-rspecifyÅD+f2f"j3j!$5rivL\pfrom re6ing† }>xA †for a inF{Aö69069 * x + hash(a*$ê.ž"(x2r = (k1, k2+1)* !# X¶de the end ¬®ð(r) if __name__ == '__ý2__'ý ô() import array ‘unittest 5 A.sup(/ô_module, get_attributeFùos, struct fcntl = 7!('®') termios!9') b(ð , 'TIOCGPGRP') #Can't run ´ò s without this feature tryòtty = open("/dev/tty", "rb") except OSError1draise ð.SkipTest("UnableÈN Mb) else= # 0° if another‘pcess isY¡foreground}  Ã.ioctl(tty, ø.ö0, ""?¢tty.close(srpgrp =†ñ.unpack("i", r)[0]i2if (0notˆp(os.get;B(), csid(0)Qr 1NeiÝ�1proá×Qp nor³‚session ÑM""`attachoY4Adel "r,ÄÝkD ptyËIêÏpÐNone class IkÓ%s(æCCaseý^^_—Cself’B# Ifoü°has been pu_!to@backEnd, Í� returns—NF0ÀID instead oeeAJBp idg: idNË e%#tt.W™!8i‘ )[ð.assertIn(rpgrp, idñ(s) def _check_ioctl_mutate_len(self, nbytes=None):48Ábuf = array.U('i')ðintsize = buf.itemòds = (os.getpgrp(), fsid(0)Jõ# A fill value unlikely to be in `ids`Z+…= -12345#ifÇ€ is not ÎÍÑÀ# Extend theµàfer so that it8’exactly `!` U longiJòeL ([�R] * (4C // ã5lÐ.assertEqual(�dbuf) *2‹Ñ) # sanity »Jelse×�pappend(ŒXúwith open("/dev/tty", "rb") as ttyI¡r = fcntl.(ð (tty, termios.TIOCGPGRP,;6, 1hrß5[0]ª ðFr, 061In(DH, id¶Itest´°£DÜÿ I\_1024Nð# Issue #9758: a )%bl,4of !?µwouldn't beûñ# copied back afteruÅsystem call.-Å iÉ N2048ÉQTest €a larger¶Âfer, just fo‘orecordŒkŒ“signed_un ¬code_param›§Mot p|0aisû it¬P.SkipÄ÷('pty module required… mfd, sfd =S.íFpty(f+trå)ifÓªSWINSZ < 0 ±¡t_winsz_opÒ¿maybe_neg =EÑ<+se@ poRS& 0xf GîY L:Óý, = struct.unpack("i",AE+)*I"(Ö),/2ourOj?çHHHH",80,25,0,#6 # T bothÑñpositive and potentially negaÀ ´ Á5new‚éF®%, µS–JeP0fin¾ €Êos.close(mfd{sð if __name__ == "__main__"ÿB: unittest.main() PKÃiŸ=n*´filename_with_‘o†.txtsõwãåP::9out9Ou ƒ/PKC~<C:Œ@PK&�…s uimport% „operator4sys Ðpickle from Y 40supL’ class Gñ 'Sequence using __getitem__' ò def __init__(self, seqn)?Â.! =7L:i7ureturn >4[i]œI] œ"itöŸ protocol¢*»Wi = 0µgì¯,4nex,"if×�i >= lenþ#á): raise StopIÐ1ionQ�vC!lf,[%i]U += 1Fv;g<� defined Jb a gen^UY—for val iÀPyield$áX L'Mis±@ and¬?ter¾,zn ð~E@Testðpagation of excep sÔY’?¦A9d3 // 0ÛNÌEor mä?)Ée5P]l«ñ# Helper to check uabilityÿ_e q, itorgK8Übrange(5÷.HIGHEST_PROTOCOL + 19°2d =~ƒe.dumps(cQ)Œ'&it,zloads(d!½ò.assertEqual(typeQ3), )4 ‚list(it)æ ‚À it =÷ pickle.loads(d) Itry:znext(it*þexcept StopIteration;ú self.assertFalse(seq[1:]Le‰continue~4d =¯údumps(it, protoA&it)؈‘Equal(lisÔ%, ’° class EnumÐôeTestCase(unittest.1, PD1): ³penum = >ñseq, res = 'abc', [(0,'a'), (1,'b r2,'c')]H@def m _basicfuncZ(Á)`XÐ0typ]0lf.‚/`.seq))á4Ae = C -´�·_¦iter(e), eE %T W„;res>(‹.__doc__ÿ¦É øgcheck_! ôóoÓT¿getitemseqnZó ÎG1TÑ T[G('')î^yRaises(9 , d^ ±xOator²!I²I²;0gen!or† à \ i!Ig2j/Ig¹31nonn"blI³¾“TypeErrorlÉ7, Xº ÏŸillformedd-Nd“¡ion_propag”/Ì ÃZeroDivisionÔ“Ú!(EF“ Ú�argument–(n :t) # no Js ˆy 1B`wrong d (not j† Ž,¬¨6 # X˜õ@2, 3¢‡too manyêSñ@support.cpython_onlyº‘tuple_reuD'lfd # ˆ s an imple�ûð detail where tuple is“ reused õ # whenever nothing else holds a reference to it8ñ!self.assertEqual(len(set(map(id, list(enumerate(0@seq)", .1lf.VQŠ, min(1,Vö) class MyEnum�!):qDpass#1Sub,�TestCase(2º1): 6‚# =T?%_Empty8øseq, res = '', []<?Big: ñ = range(10,20000,2)ŽQlBzip(%"2), \£RèÐsed(unittest.ð€, Pickleê@def %b_simplÃ;=0" AL4±__getitem__÷7, i7&Šif i < 5@Âreturn str(iêÀraise StopIt¥1ion †3len‚a58ófor data in 'abc',s`5), tuûo!e(!t)), A()(k1,17,5k÷ 'hs)[::-1])rš)óARö°s(TypeErrorO¦versed, {}3õ# don't allow keyword argumentsò[‚[], a=1)ÿ[kÀ_optimizatioÿ'lfx¶�u8Utype(ÿ x)nŒiter(x))xäi»s¸„('hello'±)e½7(5)E< � opðæor.length_hint­s­�±HrúÒsý¬rxF), 09€úSeqWithWeirdLenNåcalled = Falseù‡È/__# if �J ^G!j = Truj#r)10ˆÙÑ ZeroDivisionà (° YKndexÅR?iG – 8(Âдs ›/, [, r) '!gc¤¸ Ná‘ B9 À ãreturn index •s = Seq()ær = reversed(s!s. )ñdef test_args(self):Wõ .assertRaises(TypeError,[Y?elf/â, [], 'extra')…P@unit†ð.skipUnless(hasattr(sys, 'getrefcount'), '.· needs sys.2()'“Û¬bug1229429áð# this bug was n.5 inÜA, it%inõ # PyObject_CallMethod, and7õ _new calls that sometimes.F�'f(lpEpass"¥Df.__Ãa__ = oyå=c =rSQfor iÓ{ange(10s6tryð1s&(fIuexcept : Â3>lse'Y fail("non-+Yable î€didn't rz&!"Š=–ŸEqual(rc,\i-Q_objm¬ ç"# Рs must havŠqlen__()Ù‘__getitem¶implementedÑÂclass NoLen(¦ j‰HÇc, i): Ð1ûCnl =K÷�C, nlù~•GetItem™ ï•’2’!gi“I—-gi˜Blocked– wš/ê^Å ( be%neåDb = ”áb߉plpickler�@data“�'abc', ršñ5), tuple(enumerate(!$))#k1,17,5Ws.check_r¾h�), list( ¢[::-1]) EjåStartTestCase("):¨ÜÜbasicfunctionãe’ ÉO.seqQÀ¯iter(e), e%Æí W1), 6resÙ¹ÔÌãÑK‘ = lambdaHP, i: ‚@i, s2=11œ0seqûnž , [(11, 'a—r(12, 'b …3, 'c')]o~ALong‹šÀlf, i: enumeù&rate(i, start=sys.maxsize+1) seq, res = 'abc', [('y,'a'), q2,'b'),AE  ,ñ3,'c')] if __name__ == "__main__":I�unittest.ð() """Test script for the gzip module.$” import @` from J 0sup".!`bigmem3T, _4GR$os tpathlib$io dstructaarray ¢#= d.…_³ ('ð:') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; PyObject *RetVal;‘flushmode,`FINISHÒunsigned longÂ_total_out; @Š2Šr/* zlib­Q.c --qÀ-compatible / ðression */ /* See http://www.çP.org/O!ñwinimage.com/zLibDllåpWindowsWò""" class UnseekableIO(io.BytesIO)=Ddef S(selfšÑreturn False k.Mtell*£aise io.Un¾¶edOperation;i;x, *argslB Ì@BaseÜ(´.CCaseK@file* GhTESTFN…1tUp†4ë¶q.unlink.L)<�tearDown!?¾¬TGzip(ÇBVòwrite_and_read_bac†,7,¹ e==·´!b_R0= bÒ( ›Awith‚.rAFile´Õ`, 'w'+úf) as fW>al = f.” X#ð.assertEqual(l,€(�)�r� g f.C(), j•2st_¬7UÇ/b'ýc1 * 50Wa# Try ?Q and -!o.& !f. (¥o÷if hasattr(os, 'fsync'Í<1os."(fÍ'o(v!‡f.close(² # |£ multiple !f callsµ :˜Ü]™S_Ö0ke_öX¨ƒ(ab.Path'²6ameQ ©B¤žú¡ÐIsInstance(f.“Ïr{Àle(filename,× 'a') as f: åf.write(data1)ÿ with gzip.GzipFile(filenameF¶d = f.read(Dñself.assertEqual(d, gG * 5l(ÐIsInstance(f.mq, str) ˜ñ# The following test_¾±_xy methodsa that ƒ acceptsBàthe correspondFðbytes-like object type*Sinput82andUAÅ^Pten eÛ!s Gñ(xy) in all cases.?1def—­°memoryview(û)‘�P_and_Pg_back(3}1B&0)kGm = $�§range(256)*?-ö .cast('B', shape=[8,8,4]T�C“ Úx_arrayÙ2VØ7Y..F('I'z48`Ðincompatible_ Åb# Test@non-¼:/òs raise TypeErrorýlñ # Issue #21560: attempts toH(e }�±=áshould not aff£Àhe state of “�¿Û8ÃÓ+[?'wb:,¾RØ%s(Ù²iG&''AK([ŒKc)fb ª»çrç'â Â- ä� D‰þ`# Try 46ing ¯•c?*50¿1Àµblocks = []SnÏE = 0Ï&¦while Trueÿæë1Q!if d8UbreakŸÍ–.append(d>Úo+= len r# Checkýòposition was updatedV°ctly (see iñf10791)ýj6 z�tell(), ‰  *’b''.join(Ó)¬(ð@bigmemtest(size=_4G,ñ memuse=1) def test_read_large(self, size):%)Á# Read chunk÷# over UINT_MAX should be supported, despite zlib'sLõlimitation per low-level call(ôcompressed = gzip.„(data1, =Ô¯f2ô GzipFile(fileobj=io.BytesIO(>âed), mode='rb'E ð.assertEqual(f.'(!, „!) ¯Hñio_on_closed_objectQ KñTest that I/O oper Rs on ; ¸ D‘s raise an�ð# ValueError, just like the corresponding funck_T.¼N WrªPto a $,—�n it for ÷@ing,^£E it.�*HwG(D‰,c‡name, 'rrƒobj = f. dŽEFalsÒ.2s…s;?Tru:Wwith -Rt&s(iÆ6LBfseek(0¾BGtellí`# OpenªÉÀ–À ¦w¦©ÿGe(b'Äglflush(ðlappendãD1# A21 to£�previous¬ìžòb7–ab') as f¤�"f.í�c2 * 15²WW‚î«æW 2d, šb*50) + S2*15)…'_many_<ô# Bug #1074261 was triggered whenŽªI•containedD # e,öÀbers. Creat¦$chA¢and verifyLî7 itMVworksòKowb', 9¥ 7b'a“iûi in range(0, 200rwF"ab"wð # append  ôf.write(b'a') õ# Try reading the fileð with gzip.GzipFile(self.%ðname, "rb") as zg:;bécontents = b""zwhile 104cztxt =O.ši(8192)>)]0+= 5 !aif notu: break#ÅÄassertEqual(M , !C*201%òdef test_exclusive_IC)¿*A'xb'*f6Èš¦data1 * 50ìVrVŸ.âfL?), i4pRaises(ò·ExistsErrorðº ïiD�buffered_×!erLTô# Issue #7471: a uó can be wrapped in a BM¥Reader forßå# performance.àÍÃãËi'::io.�!(fërëj@line[ ¶ Rin r]/&«¿%rs, 50 *Áa.splitó(keepends=True)×vm( od z19!) æ@vary'† lengths³# ¬P_PE = 0°‹(BL = Ô?(D?A QL ando*\ != 01ƒW¨(len(L) <=Bl‰8 = ˜¢ + 1) % 505 ¡s¢&#s(õ¹‰' TU4Â8s(1úɤif L == []¨<AseekO<9,úà“r? Ù ÄäPoldpoïf.tell(01Ì%Á\1¬2newkÀf.tell()  ð f.seek(oldpos) # negative  , ýif len(line1)>10:"&½amount = 10 Oelse6 b >y²2 = f.read(i)'òself.assertEqual±"[:01], H84newFposii�def test_"€_whence(r)Ø.%fwrite(kQ# Try](;P=1), ÎU cEòwith gzip.GzipFileö.filename) as fs4&10p«U(10, th!yS<ÆGòy, data1[20:30])® ñ;ö!, í|ì _, 'w'ñ÷ or pos in range(0, 256, 16~cßÜ ÿ˜Œ(b'GZ\n'Û2mod€WäåÐrÐSr@f.myò@obj.„f, 'rb'ßásupport.unlink‡"å�x�&x�k q1647484�1@for ůS('wb'Î Å­DÈBðTrue(hasattr(f, "7&")=04/ f.+!,  `paddedA_gete0ð!'b’ à÷?objèŒ Z»XÝì Mmtimæ�23456789QÃT'w', AÑW> f.ŸÂi UJReadT F+1, '’'+5€IsNone(f/.-”§X¯ $Ov5e. |J ¡@metaTà(self): ó mtime = 123456789 õwith gzip.GzipFile(self.filename, 'w',BJÅ) as fWrite:IP .w{(data1)jMopena2rb'SJReadRð# see RFC 1952: http://www.faqs.org/rfcs"V.htmlt•°idBytes = f`‰.read(2)¹óÃassertEqual(5°, b'\x1f\x8¤#*: IDb cmb a1a 4`ê08') # deflate\_flags_7 bðonly the FNAME %z is setuæu 64Õ 8ô, struct.pack('`s wereA0úheader ends hereéA# Ra;°than proces°e¥0ed 7`, let'™ ekoÆztrailerRÒÊseek(os.stat]Û).st_size - 8Ž_crc3274¢PCRC325$unAœ [¢)1]‚¸@]-Ëaf\xd7d\x83'ˆi ˆc 8mý©#))p�def test_ó_‰)q$# p supporíhžðntext management½Utocol£UHB"wb"çrf0fb"xxx"¨?f =Q (rb/r.close(AÀ try:  „with f: Epassúexcept ValueError0 ,:lseò'self.fail("__enter__ on a closed file didn't raise an tUion")ˆ:try[¾âgzip.GzipFile(nÿilename, "wb") asä51/0[oß ZeroDivisionê*?1/0Ó yðdef test_zero_padded_Æ)ìè'ñf.write(data1 * 50) |é’# Pad theƒf‹eûAopen“.�YaYq|b"\x00"sP² rY¶d = f.read(ÆòöassertEqual(d, ïÁ, "Incorrect1 inï" …Ïnon_seekable†�uncompresµ=MSQ„buf = UnG'IO¬ûOïobj=buf, mode=°W„ ˜€buf.getv®œ7K¦¤ ‹±*, ¹2zApeek`ó0 m&20´«�V¥þN•R™gsizes(‘ wh«;TruãPfor n]ûrange(5, 50, 10C+vyield n�Îv`f.max_µ_chunk = 33Ímn6 = <²ì"stŸn#¶if s == b''«Ybreak‰¤°%le^)), skÁ2+= % TPP100),� O /\,Zu) atextioh\lines²ñ# Issue #10791: TextIOWrapper¹7 ) €s when wDing Á.Ü.8 = ¼ñ.decode("ascii").split* (keepends= ôððtest_write()  ðwith gzip.GzipFile(self.filename, 'r') as f: 19ñio.TextIOWrapper(f, encoding="ascii"=t=Egñ assertEqual(t.readlines(), !) u�def test_—ñobj_from_fdopen°)`ô # Issue #13781: Opening a â� for writÐfails when usar¢## o‘ created õ3os.z%).,…fd = os.’BÐos.O_WRONLY |%…O_CREAT)> Xrfd, "wb;x ±¦²=f, mode="w:gÏOpassS; L h²m¢|.close(˘?"r+Ò&„Ò•G g.Ê,ÕFREADœk ØÓ5obj@"'wòn_WRITEoao[xo<‚÷Raises(ValueError˜}| &z'A¨Í¡ in "rb", E ×Ñw:} B…5Š4ü8ìµn ¾w¾a:xb"Ã`if "x"æ´ vÑupport.unlink¥Y.*Ø s äÀQbytesÆDÊ#5str1 = m�,Hã:try" T8G.�$e(�Gðexcept UnicodeEµ³ ]„ñskipTest("Temporary ™ö needs to be ASCII"”� h ¯é f.£Ïe(data1 * 50WrnÀ self.asserótEqual(f.read(), data1 * 50) ó2# Sanity check that we are actually operating on the right file. Hð with gzip.GzipFile(str_%õname, "rb") as f:~=¯self.asser± 4ð def test_decompress_limited(H)[E"""D%!edýp bufferÊ£should be @1"""c“bbomb =Îhô(b'\0' * int(2e6), vlevel=9U‹Ó�Less(len(Tü ), io.DEFAULT_BUFFER_SIZE) |¢io.BytesIO: úžlhAobj=g-‰ >A1), Õ¹3max[o = 1 +¯`é d_m�.raw.tell‚`,Dqò"Excessive amount of²Bwas µí3ed"+Q# Tes”†/'ò shortcut functionsa@5 62forxAin [07&2]Z±(Pargs (Ú�(1,), (6;9,)04Oc¹�0, *Mˆ/ ÀPtype(3c½!5ŠVE_mode=œ„ ˆ U”^Š` È1`ºqPbuf =~ çãRbuf, Õwq`bf.writK [ ëÔÒãbuf.getvalue()W D²# Roundtripî õ‚ N’I‰d‹ü_trunca%:! =òA1*50;a# Dropì�CRC (4 blA andøV sizekÙU[:-8]gǪS)? òRaises(EOFError, ¦Np<ïeäOĦ6, 1©@# In4€lete 10-~v headerk„i�ðrange(2, 10): ú2 with gzip.GzipFile(fileobj=io.BytesIO(truncated[:i])) as f: ðself.assertRaises(EOFError, f.read, 1) 6�def test__†p_extra(E)\ # ˜R data¬1an )a fieldLP!gz#õ= (b'\x1f\x8b\x08\x04\xb2\x17cQ\x02\xff'8<8p05\x00E‰#€bI-.\x01*r2\xd1Mxe 00%')`Ú`¾YUbEqual(J¼(), b'Test'R�prepend_ezPÿSee issue #20875«Aopen9. ¯name, "wb"ù€f.write(1øMrMó_buffer.raw._fp.Í () class óO @Base -QÁbinary_modesÅ!æñuncompressed = ´R * 50•#±¹ a O@ile_ž" ==$de¹_·'C*, •ð›iÚ�h#a X Uë¦RsC * 2ƒš% ZaExists”5�Ï6xb"éásupport.unlinkÝ¢&R ÁÈpŽlð�pathlike_¬]À2 = (ab.Path';>þJˆMó ùKH�x -Uð * 51) defó test_implicit_binary_modes(self): t# Test , , ,ñ (no "b" or "t" in• string).Eõ uncompressed = data1 * 50 #áwith gzip.open†ö.filename, "w") as f™ ˆf.write(`)SN/rbO@ile_�" =‹$de¸–(f.read()_�-Ð.assertEqual(³C*, • –éršh�g%agP–[ * 2)=$÷Raises(FileExistsErrorÖ¼„&x"æêsupport.unlink˜&¾ xn«j2def9Otext.ôé.F²de("ascii")ù‚2i_raw =9ÿ .replace("\n", os.linesep|/wt}v  ¿K %ýrýlO™à agOad6cùÞ1objN ÄTbytesüì;strì_;Á‹C½ F"Àp.open(io.By÷tesIO(compressed), "r") as f: öself.assertEqual(f.read(), unAu_bytes);ðwith gzip.open(io.B!ubvbtv*Qstr) ëðdef test_bad_params(2)Eñ# Test invalid %ñeter combinations.Nw9Cu÷Raises(TypeErrorZ/c{123.456ƒJOValuK 5ÿfilename, "wbt"XAxXDÿrb", encoding="utf-8ÁBi—Ÿs="ignorehGÌnewline="\n"í}µnon-defaultsÈõ = data1.decode("ascii") * 50¥2i_raw = �.replace(«P, os.¹;sepE½ rtÂ/16´ˆf.write(“ g‚ bryö_" =¿&ú)Z˜“j 21ileT 3;rawªr±B _eÏ�_handlerP¥U > >c1Þw�ÜÌb"foo\xffbar`U 3É,¢¯) \¾Âœ˜H¯B “explicit ,µ (universalæmode disabled)RðµÀwith gzip.op÷en(self.filename, "wt", newline="\n") as f: õf.write(uncompressed)"Ïwith gzip.opbrbrb—ðassertEqual(f.read–hs(), [{ò]) def test_main(verbose=None)¼ðsupport.run_unit-°(TestGzip, ÀOpen) if __�__ == "_T2__"I9f€True) im`….m� # Skip s Yðmultiprocessing wasn't built. \=.Q«_module('_;-')^@sem_tÿ implementation is brokenb añ.synchronize') fromÊ¢Ðscript_helperuBort ¶´_python_ok ¤contextlib”itertoolsrloggingk ”.handlersabQueueH9oCq%sy thA]XT time(rweakrefˆdpickle~PƒingError¤concurrent&rfuturesA.U._basS(;ÑPENDING, RUNN µCANCELLED, °_AND_NOTIFIaFINISH r,KBíŸExecutor)†ˆµ7P�BPool9 .Cget_Ó €rcreate_äu(state=ÖPexcepŽ•�, result ¢Qf = FÆ(M1f._E1 = Ü5f._K5 = X# =a³return f �¯_FUTURE = µ#) ‹. %&) ¥^ '2×o ? ¿) EXCEPTION? 2;1=OSÎï()) SUCCESSFULGqó=42) INITIALIZER_STATUS = 'uninitialized'-ƒmul(x, yý£Rx * yNósleep_and_raise(t*¸."(t( $ Ea`('thisõ&an Â%:WÏprint(t, msg\%"Jósys.stdout.flush({á#(xF~global CB = xôTKø3us(Q:62‘fail(log_X5if à is not None:  �logger = �ing.getLó('concurrent.futures') 80ôer.addHandler(Queue Plog_q)3þsetLevel('CRITICALWñpropagate = Falsexó time.sleep(0.1) # let some ¢Ñ be scheduled5ðraise ValueError('eñ in initializer') class MyObject(o!):Gódef my_method(selfEpass@ãEventfulGCObj(&? __q!__>S, ctxC mg†Àget_context( –.Manager(F{ .edq = mgr.p5() §S__delgb9@.set1 –²make_dummy_ñ#(_5freturn#ôBaseTestCase(unittest.?]QsetUpðë‰á_thread_key = @‚support.�ing_setupª7PŒtearDownS @×reap_children: %eœcleanup(*˜ðÒExecutorMixinñworker_count = 5~e(Æ_kwargs = {}˜  upß“UëïŽ t1÷üÌ¡if hasattr w, "ctx"eC”1 = Sa_type(·,Bmax_Ü!s=0 é,/p°.Á)/*e„(ÝBelse`�„0ÄC• ƒt_prime_Š•81`.shutd»–wait=True÷ *r = None8da.B() -Ê%t1�*ifC\verboK÷ print("%.2fs" % dt, end=' �‹°assertLess(%ñ 60, "synchronization issue:wó lasted too long"�½sàºÎ-x¿| ".A • Eô# Make sure that the ‘@ is ‚€y to do èð before running0c#ëðs. This should reduc]ðe probability of «@outshw}%s.N¯0= [µ.–€.submit(?ë , ì9TPfor _`Qrange.Æ—%)]6+Ðf in futures:' ñf.result() class ThreadPoolMixin(Executor!):?eö_type = futures.<6WpProcessXAForkN\A]ÊÑctx = "fork" žódef get_context(self¹1ò if sys.platform == "win32"Ý$7ð.skipTest("require unixAQtem")p-øreturn super().[Ã_Spawn>sV"tRserveÈz=[€‡vcreate_¼`ests(måÐ, bases=(BaseïuCase,),ßã GA6s=(ü×< J7 A)�ˆ*¡)<Dastrip_óS(nameÑ0if Á.endswith(('�@', 'S$s'I.46U[:-5]n-elMC'oA4A*seÍl% for exe inâØs9š� = ("%s%sÄ"£8% (`exe.__8X__), 5)<`cls = KT#, •�) + (exe, ¡F, {}8 globals()[qu] = clsýŸInitializó òworker_count = 2êLetUp;rõ INITIALIZER_STATUSu = 'uniŽ%d'-bIPkwarg Vdict(1 r= *F0=(' 7d',n£sá)òVtest_6rýåI = [¹€.submit(ô?v_status¨(v_tQrangeb.„")]�/,f,y˜ƒÆassertEqual(Ë), ýð) class Failiò ngInitializerMixin(Executoñ ): worker_count = 2 ãdef setUp(self+/¡if hasattrw, "ctx"!%ñ&# Pass a queue to redirect the child's logging outputx>v .mp_contex™4get.()1Blog_s!= 0B .Q‹5eö_kwargs = dict(i== i_fail,t©3O='.š&,)¸Belse…Fö# In a thread pool,2µ shares our;Ysetup•ð# (see _assert_d7ed(vl y = NoneH#·">ú‚super().c)tPtest_<¸>^BwithÛ áà'ValueError: eG in J'F:try|sfuture >Ü€.submit(~Rv_statusÏ;Ôexcept Brokenib‘# PerhapsØb` is alõ1y bB Œ`Ipass>'!zRaises(— 8þ{.result+ò# At some point—¿Éshould break¥ t1 = time. T’while notÒN"._=(ifLž - t1 > 5)ÎÁµ$("Zl]Ê after 5 s."É<­º.sleep(0.01!ò# ... and from this ()Ï guaranteedˆ ¨%ÖЙkÄt_prime_1 OU-@jClib. qmanagerLRSŠW, msgNi6&lfï á_ §Qyield\qY = []ª<;TruBIMq.append÷•.É€nowait() |Message&ÓR_.Empt2Bq“ çòLogs('concurrent.tús', 'CRITICAL') as cm0`4ðcm.output òself.assertTrue(any(msg in line for ßin output), !ÿ create_executor_tests(InitializerMixin)(~Failing/“ class EXÑShutdownTest:—@def mÃ_run_after_s%(ì)'Á.¢.&)H!ÿRaises(RuntimeError+ [_ubmit0 ±pow, 2, 5) ~Æ�interpreÈ # ÿñ the atexit hookºÕñ of worker threads and processesuó0rc,ç‚, err = ýö _python_ok('-c', """if 1K;ôfrom concurrent.futures import {je_type}r;Y-_sleep#Aest.Þh_h;©_and_printEú if __name__ == "__main__"Ê“Ãcontext = '{ )}'M& ifò)?= "H&F ÿ&(5g#Nelse‰[Smulti²4ing+Cget_¡ Ÿ<7 = *(…3°D, mpi=?1t.sí(‡ê, 1.0, "apple"w¹""".format($=F7.¿Mš�=getattrôp, "ctx"¸&))|!# Èsì9ás don't changeWv ]µcode, checkqP# std3•manually.ÅH–False(err„õEqual(out.strip(), b0Odß#˜ mÓo@™.registerøÏWlast(Á9?try8ކid, Noney8xexcept ÙLN2("r -e ÉPr- ÂÁ´´@À not context?: ýt = {executor_type}(5)+OelseAýfrom multiprocessing import get_contextRŒ( =*(…3°D, mpi=? ú.submit(id, 42).result(m¹""".format(i=self.¯.__name__,â3 ��=getattr(DÖ, "ctx", ""))|ó# Errors in atexit hooks don't change the l $µcode, check…õ# stderr manually.�ñ.assertIn("Runtimezð: cannot schedule new futures", err.dep(·QòEqual(out.strip(), b"rb -eÝ1") Š�def test_Õ±_issue12364 )lafs = [cyÄ·ð.sleep, 0.1) for _=r)Q(50)]l9 Bwhutdownù=f=&fs~:f%ó class ThreadPoolSIVTest(ƒMixin, EY&`, Base0CCaseêt_prime_æ Kpass;t‡¼s_terminate4 õû¦mul, 21, 2z)O6, 7([3, 14)e1lenž?#._¿K), 39#.s_ ¨t¨ ´N ¼Pt.joiæft”•_manager_gT“ûDwithÿ.Þ×û(max_workers=5) as &ÉA = eƒVi… òist(e.map(abs, Ã�-5, 5)))^Lñ [5, 4, 3, 2, 1, 02#4]r+å=™†8?del,R/ =2=(3O[Á$Ddel P1 úCð,â¡s_assignedÇ%lù Ÿ� 8', gð_prefix='Speciald'l(À = executor.£_threads Õdel executor “for t in /:7ù!self.assertRegex(t.name, r'^SpecialPool_[0-4]$')=‚t.join()mƒdef test˜_H s_default(i)|¨Á = futures.TÏnEÅæ(max_workers=5|=ö.map(abs, range(-5, 5)(ò% =.�5+ó# Ensure that our æ ôù is reasonably sane and unique whenFC# no�4ù_prefix was supplied.2LµEO-\d+¿ ô class ProcessPoolShutdownTest(�Ìõt_prime_– ëKpass"piÌes_terminate6äSö.submit(mul, 21, 2å)O6, 7([3, 14)‘Equal(lenž.�_Á)r�: = ˜2- !sqN�»p»Xƒ.values(~%p‰õcontext_manager_d{CEwith‡ø ˆV as eË�Ñl.í%v·Y_ist(eÆ%),*= ñ[5, 4, 3, 2, 1, 02#4]”6F-?del:Ç@Ølí.SqueueÌ4menhrC_$DI 6(BcallM )*r 7$D¹v# Make iuall theÍõ resources were properly cleaned byc#:+ê¢WGK6:T‡íf creat?_D's(GwÀt,  ðexecutor_mixins=(ProcessPoolForkM(, 3  =oserverC&QSpawn>ñ)) class WaitTests: –ñdef test_first_completed(self):$² future1 = .øû.submit(mul, 21, 2)323òtime.sleep, 1.5)�l done, not_ 2 = }us.wait(`+ó[CANCELLED_FUTURE,11 /2]ƒÄreturn_when=a÷FIRST_COMPLETED”öòassertEqual(set([8P1]), «ü/©2Aðu™ß_some_already°&}ÿfinished, pending€ �§AND_NOTIFIެSUCCESSFUL¡˜@ ©z¢.])2æ CÓŸexceptionl"oŠtlg£_and_raiseq==3©3Ë7*0˜ 3  —EXCEPTION�qÚ?), Ç3›ÇšÝ`divmodÝ?, 0àÏ9[¯ T Ps# s0 ¬‚1ÞÞðCANCELLED_AND_NOÿTIFIED_FUTURE,  õfuture1]), finished)3öself.assertEqual(set([CANCELLc E2E‘pending) Eðdef test_first_exception_one_already_failed(m!):7²T@1 = ó.executor.submit(time.sleep, 2n7Å#, Š# =Ÿus.wait(a.¤[EXCEPTION42/1]>Âreturn_when=¤…s.FIRST_G�¼ B*q9~t±âol¿all_completWÆdivmod, 2, 0t2Œ1mul2#21‹WЉ³[SUCCESSFUL}oAND_NOí kSÞ12×ALL_COMPLETED íHú9 '# 'ùð6ø)"·Ò?out|F6, 7x•®h:6…Ì: �6á#1,§ å^out=5Ö»/ŠZ¿TÇT� class Th¦æPoolWaitTests(uMixin, `, Base&kCase):^¼_calls_raceïñ# Issue #14406: multi-t…0ed 3` condiG †ð waiting on all  ²# futures. ð event = threading.E%()"3def7…_func():EAW.wait4ú oldswitchinterval = sys.get4 s F1e-6Œ:try~ò fs = {self.executor.submit(ë´ÿ) for i in range(100)}Ç(seÆßFsáôfs, return_when=ÖALL_COMPLETED®kfinall²ç 1´) create_ÙÀ_tests(WaitT ,Á­0ð mixins=(ProcessPoolForkM=C =oserverC&QSpawn>)âñlass AsCompletedÙãð# TODO(brian@sweetapp.com): Should have a ñ with a non-zero timeout.%Ä&C_no_(5ÌÌ1©N§mul, 2, 21àM23 a7, 6) …Ucé5¥Us.as_(.2ÿ[CANCELLED_AND_NOTIFIED_FUTUREËŸEXCEPTION#¯SUCCESSFUL$,62])ý?Ð.assertEqual(<ºˆ&q %@'$]–.sleep, 2-k_S¶0"Ú#orw·7( ,"50'4(®.1]t$Wout=0~ )C.addË-cexcept2s.TëRError<KFpass}³\X90 B/])%2  ª`duplic%ssÖÀ # Issueñ2 20367. Duplicate futures should not raise exceptions or give 5# d@§responses.ðIssue #31641: acJø arbitrary iterabl4‡õ1 = self.executor.submit(time.sleep, 2)jÕcompleted = [¤¤f for f inâE.as_0(ƒÓtools.repeat(�F, 3)`]T–õassertEqual(len(Oa), 1) -òdef test_free_reference_yielded_h(P!):2¯## 3ø14406: Generator˜Ukeep Rs=µto finishedïr`s_list(Fò0() "_"†range(8)ï4å.append(createÁ÷ tate=CANCELLED_AND_NOTIFIEDBIóFINISHED, result=42)R Bwith„R£sµçs.TimeoutErrorV:å…ê s ! , k[out=0IM;Ks.remove„4(ÿwr = weakref.ref)3delµ³@&.ò¨IsNone(wr(»‚[0].set_A ("†"˜  þiú öòî #if,…B!©g¨ƒcorrect_ø_øL_msg¨^Lô_FUTURE, PENDINGy©GRUNN(³ SUCCESSFUL;]]4 j as cm%Œˆ£ustr(cm.5Ä), '2 (of 4)ª4 unžS') Iä_©Ts(AsCÎQTests*class E Ì#ñ.shutdown() and context manager usage is”Qed by…AS@]Ã|ô©–pow, 2, 8y@Å4C256,.­Ô |�_keyword‡„1mul„!y=†À self.añ)ssertEqual(16, future.result()) def test_map(self):'.aGAlist6 .executor.Hçpow, range(10) ?)),D6 ­s•?ß, chunksize=3¢,O¡_exception#YAi = È 6Ãdivmod, [1, õ], [2, 3, 0, 5])=>›ÿi.__next__(), (0, 1)/1ö Raises(ZeroDivisionError, rž übtimeouú~es = []Í6tryuä�for i in%Xn.sleepJ;![0?/6]2eWout=5ºY–.append(ieïh2s.T. ßEpassýJelseÜøfail('expected M'p’,p[None, 3], ­1¡ü shutdown_race_issue12456¨0# I! # : /` condiÖD at Jõ where trying to post aæ # sentinel×ðthe call queue blocks (öis full while processe5õ# have exited).g U0strDA] * Þþ.worker_count +&>Û(>@'ñ.support.cpython_only]ñno_stale_referenceszLXð6284: check that ƒÀs don't unneñarily hang ontow&# k ñmy_object = MyO (®R_collfÿ= threading.Event0õallback = weakref.ref(�“^å, lambda obj: u1.seŽ6ð# Deliberately discar’Ål ñusubmit(f¦.my_methodø6del‡w@¦Uwait(&.0QƒƒUTrue(Jo "S!¶U not 8ƒ within n#."�bBmax_Ç£s_negativecÀ for÷ number in (0, -1): ùwith self.assertRaisesRegex(ValueError,4? ÿ"max_workers must be greater "G{than 0"®o­çexecutor_type(t=ð!) kð def test_free_reference(D[ñ,# Issue #14406: Result iterator should not keep an internalg—%# _R to rC…objects.'pfor obj�….Éò.map(make_dummy_9·, range(10)¯oõwr = weakref.ref(obj)f"0delj séóIsNone(wr()) class ThreadPoolEaVTest(xMixin, `, Base(CCase§yÀmap_submits_lBout_X…ing timeWã_reduce__(selfZƒ _czŠ!UnNŒ&u@Žr•', —OExit !ý~$&¤­Œ"! Ž&+— %7& !n q %Bfrom}‘e import É@ingE’qmu !("# ½¿'e"h=/Ati Ñc#Ӈմݺ;, (.', ×òxecutorDeadlockTestçÑTIMEOUT = 15 6@amethod΀sleep_id£§, x, delayÖ&(<ƒ®x_N“fail_on_d�#3, e§Wô# If we did not recover before ¿óseconds, consider¶%he‡#_0 isý$a ÷ state and forcefully clean all itsGµcomposants.„uhandlerÙutempfil® Te¶faryFil¤¶ ò(mode="w+") as f¶Wpð.dump_traceback(n"=f{,Šf.seek(0³tb = f.read«,@or p(–.×§es.values(©3·p.terminateIð # This should be safe to c\^Ðshutdown hereìgpossib"#µàs should have ãbeen broken. õ executor.shutdown(wait=True)%ö"print(f"\nTraceback:\n {tb}", file=sys.__stderr__;Óself.fail(f"Elq deadloE!\nF1) nðdef test_crash(>!):°±# extensive&uing forP± caused by @Æes in a poolóU.øE¥_cases = [ˆŒðCheck problem occurr’°while pickl›a task in?1theù_handler thread&à(id, (ErrorAtPRqe(),), 1ing@, "e#1 atR|Ie"),M/# ² ,un´©on workersI–bxitAtU5—B^ºProcessPool‚e "exit§q ©`Óa6bCdbbm!du&Rfunc †Oion k o, (), ^›a  (_•b¯SystemExit¹Zaraise_�£, (Runtime´9),  cÒrv•iresultz#‹óreturn_instance, (BŽe˜£¯x¢z¤yºq)Yrõƒ D ¾v½ /T nV _PßÏSÌØ £w ¥eyŠÖ…R„À result_handsler") ] õfor func, args, error, name in crash_cases:4Eðwith self.subTest(3)%)ñ# The captured_stderr reduces the noism ¹test reportpKt!@.sup".W(€9¢executor =³m_type(h3ômax_workers=2, mp_context=get (Fctx)_=dres = r.Bmit(s*t7ì[ÑassertRaises(Ÿær>tryƒñres.result(timeout=fTIMEOUT�=�except fuÈ2s.T=E/r à# If we did noÝÓcover before yŸ seconds,Ž…ñ# consider that?[0 is²ÿa deadlock stateP û”_fail_on_9(Sñ.shutdown(wait=True) o@def ¨_"[rÀ # <ÍÔpool calling >1 do:UcauseßjRif a ª ÍQs aft$eEV.5ˆ.Ê [Š/7 Y3>5 as' R ¬Mð # Allow clean upÎ šf?Œ_åª, delay=.1öõîé( ²÷BrokenProcessPoolþ?f“´) create_x_I3s(EÃDÝ7,;‡mixins=(~PForkM=” =oserverC&QSpawn>)íalass FUÓ`s(Base CCase+OPdone_ÈPback_q_Ì#.¹$f = Non Q5fn(&Õ@Drnonloca�qM PC! =½.UÚU„ò(kif.add_á8(fn 4setî5ù.q…Equal(5,ƒÀ_result) ó! def test_done_callback_with_exception(self): '"u = None"W5fn()gfutureCJ•nonlocal 'PI(& =4[.;5() >Qf = F{&()J.addð8(fn 7setýE'*&')+â.assertEqual((#6,),¡šS.argsž!N ˆxlcanceluBwas_?ledp+ Kk f�f.;rTrue(f.\(_$ žI mraisesD1ithïÀ.support.capšâd_stderr() as ðQBing_„l„FFalsõ'/fn" dûN$T(6„ Y,#0 = =*'e ÝSdoh!'VK¬¤  u š &³‹f·î¿,$ç†result(5Ô@ �hy0 ç+EIn('€!: €,}�.getvalue!‹2ýalready_successfu9?ì;+ Mš2 ?‚<›×·�5‡|àM lfailed>àÒL4PORUàexception(Exceóption('test')) öf.add_done_callback(fn óself.assertEqual(CD,), 1Q_exce`q.args) ^@def n ]ð_already_cancelled(c!):4•6wasu = NoneU5fn(zgfuture>B™nonlocal KD# & =ËQ.žÎ5Qf = Fq(!cTrue(f<(e#D ž�úOLrepr4C¦aRegex(%ùPENDING_FUTURE),Ñ"'<Øÿ at 0x[0-9a-f]+ state=pending>'öqORUNNq1OrunnqŸCANCELLEDä.ñæu¯AND_NOTIFI‚V ÄêŸEXCEPTIONã ÿfinished raised OSError  ‹¯SUCCESSFULŒ/°eturned intŠ X³  f1Ïbreate_Í(ÆÄ/f2*Ç*3* ,4, _7959¥FINISHED, h=  e6@ƒresult=5Sÿ:{/f1À%Af1._V', 0�False(f2V2VƒT©3S3S© U4U4U Õ· 5c5cÿµU6UÀlf.assertEquñ'al(f6._state, FINISHED) def test_cancelled(self):"ö .assertFalse(PENDING_FUTURE.9/))5ORUNN5ïTrue(CANCELLEDk 6¯AND_NOTIFICãŸEXCEPTIONz7¯SUCCESSFUL8qOdonel4g0 ,Í1]> W1 Q2 LrunningO7R" ¸2  ·5YB ]5a6 dÿesult_with_timeoutpòRaises(futures.T1aError,X[ \rt#, p/=0bl$ Ûl!C6ÚpUQ}"OSÞ cGoEqual(k>(ÝL, 42˜w|successwñ# TODO(brian@sweetapp.com): Thisá õiming dependent.Š–×notification(¦ð # Wait until the main threadZ@wait[1for¶`Dè†.sleep(1Èrf1.set_5(¢ = create_M(É=*I3t =‘ðing.Thread(targóet=notification) ¥t.start() øself.assertEqual(f1.result(timeout=5), 42FDjoinE’def test_6Ð_with_cancel(]%):lñ# TODO(brian@sweetapp.com): ThisH õiming dependent.CnÜ(_åð # Wait until the main threadZ@wait[1forµ`Dø†.sleep(1ö3f1.ÚBöf1 = create_future(state=PENDINGC3t =‹Qing.T•_(targ±$rRaises(u1s.Cu¥ledError, Ê , ÓËJ/t.ÆPexcep6É9 ÊÙ6 …T5ƒm= …_FUTURE.w¬09o/RUNNINGo- càŸCANCELLEDsa¯AND_NOTIFI€ °True(isinstQ­(EXCEPTIONÊ"?0), ù!OS)Ù~¯SUCCESSFULn S None„�D»|success»/B9vE!œ`_condik"+Af1._E½ = FINISHEDb%~3 = _(_On.þTy_allÄ(Çg q&f1c…á@Å @â.support.reap_÷ s ó_ 26tryx<pun_unit’(__name__Uofinall9uqchildre 4if @a == "_‚2__"zaB() #ñis a helper module «aÏQed_imäS The4Ðmports this #ó module, and thisð^ tries to run various Python library functions in # their own thread, as a side effect of being imported. If:� spawnedHðread doesn't complete in TIMEOUT seconds·  "appeared®ðhang" message # is "nd3theáñ -global `errors` list. That à remains emptyK0f (&Çonly if) alletested®4. ­q= 10 iò6ingtempfile"’os.path š  = [] # TžÀclass merely›a‡!7its‚! TÒevv}®íQholds†¦±lock, so ifc²called by T#°To do zB°s it will bLÈ waiting forg#'s”Gë". è�Worker(tOQing.T õ ): def __init__(self,�c, args(, C.9)P(G.î=Q !]! =d ‹1run†v N!(*<0) Bname´°Á[P‹ð# Bug 147376: TeAñaryFile hung on Windows, starb$in§E2.4.N3("th.J¿", lambda: !ò().close(), ()),ñ¡áThe real causeÝb´ ntÊ@.abs"()(i e ªŸ÷-;", p, ('.',ƒ~"]:Ž2tryCt = 9É[â!t.+(Sjoin(¯ü§.is_alive(×f�.]2("%h ‡ % âQgfinall§ð del t # Test some Unicode :ð semantics # We doi² many opera�!on7`s otheca’ atÀ!irPõs can be used witht¶characters.ˆ , %@, ti¨dshutilu­EdataÊ@unitž` from ƒ.supportæd (run_'°, rmtree, c ae_cwd,±óTESTFN_ENCODING, wUNICODE#ÑABLE, create_¯å_file) if notJŽsƒk'¤s? H t0.en2(x2ING݃except (ÂESa, Type ;C# Ei¢éqsystem _"‘is None, *%¤{#Ç×"be7 ed:Ü÷ Reðraise unittest.SkipðbTest("No Unicode filesystem semantics on this platform.") def remove_if_exists(filename): if os.path.exists(`n!%–os.unlink>€ class ŸšF™ (unittest.4Casið# The 'do_' functions are the actual 90s. +ñy generally assum) �#’ already Ùc etc. aDo allZSð we can given onTb singlPðw[cshouldM`. RB_do_;a(self,2A)R¢ß.assertTrue(oc)V2 is�x2 VaccesÂ,Û_R_OK)6 ý©0absxC«C$¼>Í…os.chmod§v, 0o777¬ºGtime"ONone! (1.@(),  G�# Copy/rK{» ux6sam\ çBwcopyish˜èG- # S ‘õ appear in glob output0 vaY,==\.žI)[0]þ2basû ™rlistdir0yH , 1 =‘e.splitn»_T= @dir(EÅ¡# Normaliz%# u+ñ strings, as round-tripping£Z1via %OStö # may return a different (but equivalent) valueëåddata.n™b("NFD" ºß[8 €f) for fý6]ñgý0In(Šš=)(#¯ps that ‚ , ,Á"on°£ to anotheÅõ1³j\A1 21# SD€ be ableV.ðÂ- eik LJdAd?1¢1)) # mustA2os.oÄ©– + ".new"ŠrFFals´ s/2)4 ç 3P1 + 'o'<¡–À, filename2)# ðself.assertFalse(os.path.isfile(ÿname1 + '.new'))=?Tru<F2)) 4¦hutil.copy]$, hP2 + "h"g–os.unlink1&ð # remove using equiv ³.tð# And a couple of 1Us, on7;ach6sª+yª NeexistsG� 4 E 3�£¬Mo ñ p‰ñ <&1)pð# Note - due to the implementation�l,·Ðit tries a reÔð first. This only fail ÷ Windows when onG‘differentgð systems - and tJøtest can't ensure thatBaSo we (ñÇ`2 funcÊ¡, which isç th‘GmostŒ`likely ¹bQ(1Ã×\Ì ;¼U °b.>ðdef _do_directory(Lp, make_Ëq, chdir !):46if ƒEdir(1%)grmtreeCZos.mk;6trylGÿwith change_cwd(•)Àcwd_result =§0get4’%á*Ã% Röunicodedata.normalize("NFD", *o G 𖋤UEqual1bas�(‡,L?kfinallf[os.rm“”€# The '_Y'Iñs 'entry points ¥Àparams' - iej atfF¼top-level 'K°would be if1y‚ld take TD±<_H#le°™~pK_if_ø™Ðcreate_empty_CÓ$ ‹}4�8c3\ 1SßÐTrue(not os.póath.exists(filename)) õ # and again with os.open."4f =A,vO_CREATL¦os.close(fEtry:Ktõself._do_singleS3kfinall7—os.unlink1Xð# The 'test' functions are unitá entry points,ñósimply call ourJ_.EÄeach of the A‚ combinal°we wish to AM1def ç_: s(ý).u'ö(TESTFN_UNICODE5if öENCODABLE is not NoneUe� Y>*) ©­directorie¨`# For ,É'equivalent'€²# Make dirRµencoded, ch0uni5eck+™È`# (orÉ.//>5etc,Åext = ".dir"b4do_ÞycV+ext,\w{P# OurÎ y Aó that can't use a non-—"@»"²¼¢,å*175) œSmain(�Drun_10(__æ„__) if p == "__62__"òd0() ‹ is–ða sample module$Qd forping doc:4. #6m*)is(4how,¤ handles aVŸ@no ##òstrings. class Foo(object):ëB# A :8."Œ__init__­@pass­àest properties@boolð mised by PEP 285 importÀ‰Q from 0sup"*$os¿”BoolTest(•.DCaseÏ­EA_sub× ² |&0 C(±÷8âòexcept TypeErrorï +/ls€`fail("lq should­4be °Sable"‡Y­ÕassertRaises(~ð, int.__new__, U3, 0< _print foÒCpen(~.*V, "w"ø’QÁFalse, True,:=fo(#foú jrjüñEqual(fo.read(), '�€6\n'c)‹Àose()  ð os.remove(support.TESTFN) ñdef test_repr(self):Ñ.assertEqual(%‘False), ' /')/ 1Tru.- *eva1), a`3]A)),  Ú/stÙ$nØ.j0, ''M?intL$s0åhIsNot((0q,‘O), 1S ' 1OfloaÀ&’O, 0.Ä ,4Æ.š?, 1Y+ ÌOmath‹+’/, à $+\#-!L $+LBabs($P (0]+& #)�- ?, -i ™'� '.¾~ßv ~EC, -2—ËI_+2, 2äI$3$2I 2T3“™ð #w   ¬h(øSS ( S $‘#z® 'Øz ’T ) V�%l ( SNüv%ÀEqual(True*1c, 1) ÿ self.assertEqual(False*1, 0%VIsNot%./) OoTrue/1sN$ušLš%š%è ’$M4 5(2æ@%2, ,æ tæ%™€‘for b in m:À"i"z0, 1, 2" Þöb**i, int(b)**i½.2Ò2Vbool(7'…a…§ É ye(a&b, u2a)&|)± :(a|8|8^8^8ÌaœW« « â{:êzÞz$ z+ dd z zz+ zz˜ a) b: É):n#@` z:zni a)¢ z:zn£ öR(1==1pÑ ""0,™#/0D />1Ë /1> 0"ˆ /0!E!Í›ux = [1]Ðself.assertIsó(x is x, True) Òself.assertIs$0not(False) *@1 in&N 0$Jr s 1 pM) 0)v›¥x = {1: 2} eüÈ éL/, L '!8ðdef test_convert(\!):½,ð Raises(TypeError, bool, 42_$D(10)vUY2Is(&%/-1&pí— "hello"Q"&R)…B^Ìkeyword_argscHwith!hXRegexm'D§ argument'§RDCx=10Á}_formaÚ ÂEqual("%d" %E_, "0"< ,w/"1+ xW,W G|hasattrB L%°[], "append½UÒ9Is(3`wobble3ð „�callable… &?len` +ÚsŸisinstancu (î¡~ 4|5i?inth41˜¦ÉÎ02 Ç�issubclas� N(a/, ·[?int‡ contain… z%{}]ï «&À{1:1}, True)ñ def test_string(self):ÿ.assertIs("xyz".endswith("z"), True)1x1OFals2 ï0123".isalnum(c I@#$%.`.?pha\.\ ¹_digit]M%is-\ ._lower[0XYZå-[ ·oecimal^‹d/`numeric`/`  ì_space[O\xa0.Ou3000w‹· X‰Otitl·x+W ü?upp)Ë-[ .SstartÐ34g6‚booleanƒ`Equal(p & 1, 1x×NotIsInstance.`1$Is&[Ò� �|�.�|M�^�0Ñ.�^� ¬fileclosed£6try33ö f = open(support.TESTFN, "w"²* a"f.a#, ‚#(AË*kfinall¦›os.remove§)\typesô!# õ are always true.7 for t in [wõ, complex, dict, float, int, list, object,Aøñ set, str, tuple,{]s Is%(t;Tðdef test_operat³or(self): õimport operator'¤.assertIs(ÿ.truth(0), False)01), Tru/Pnot_(.^/�]ßcontains([], e718n`lt(0, �Ì0—_@is_()Y� 6•Çjis_notqBr:3¬;ÿdef test_marshal 3º Ÿt.loads(Qdumps´)€ 2@´ñƒ¶opickleµ1´òfor proto in range("÷.HIGHEST_PROTOCOL + 1¤= ñ8° ï,göIøJ!) Î ÿlvaluesp# Test öòspecific backwards-compatible À F`¨™TEqualB ý@col=}Ÿb"I01\n."«DèøE0EšíDÖ‰.E‰)ÿ2), b'\x80\x02\x88.'% L9Lª íconvert_to_booÝñ,# Verify that TypeError occurs when bad things are returnedh(�# from _að __(). This isn't really a €jW, but?Õit's related.÷check = lambda o: {uRaises(±,^6, oLûclass Foo(objectÏ"³Z Úëx —(W)Œ*m?BarmÀ def __bool»__(self): Åreturn "Yes"Öcheck(Bar()) Ëlass Baz(intK¯def __boolk‰Tjzj#Ls) must § a c¶ not an intI�OSpamž+1R›RJEggsM?len-d ñ .assertRaises(ValueError,ì , kfütest_from_bytesÚT0Is(0.-õ b'\x00'*8, 'big'), False)ø@ àabcd', 'littleACTrue( Œsane_lenžp# this Ä jÚ ð s our assumptions about _B%__›=ðwill start failing i}€ changesO!erN@úfor badval in ['illegal', -1, 1 << 32]ØcYAEë¡ åºwŠ>tryV° (Að#‘except (E‘ion) as eqDYK� \`>len_1%¢Equal(str(�2), 4len9,éŒ_blocked1ePu = None<|5:Typ4å1^BÊ“¿ »%10Jû—(BØM~Üreal_and_imagêfj.3?, 1²'Q?, 0'…Is(type(P ),N,U,Q§€(S¨ R}Õ-W- oSmain(¼ðsupport.run_unit�Á(BoolTest) TÐname__ == "__>2__"I/P() # 4` case eðthe os.poll() func‰@ imr4 os •subproceserandom Telect•threading4ime à îð test.support iñTmport TESTFN, run_unittest, reap_threads, cpython_only try: select.poll except AttributeError:'draise \·.SkipTest("@ð not defined") def find_ƒ±y_matching(r, flag)†Q = []nðfor fd, mode inÊd°´"if&CBJ±.append(fd)Pqreturn À class PollÃ%s(ÖqCase): 7ÀK³_poll1(self°jð# Basic functional -@ of 0q objectI/áCreate a bunch(ripe and9Bthat;òworks with them.�FGp = s&()åNUM_PIPES = 12xñMSG = b" This is an(.""â_LEN = len(MSG5oª6ersšMwrit…r2w = {}V2w2rÖiÏUange(°T_Prd, w<†os.pipe(�Ãp.register(rß�p.modify(C&oPOLLINC4wr,P*:OUT+Q r +wr>µ2w[rd] = wrª`w2r[wr&rdÂ3bufk-cwhile g ê›Qy = p½ &_8/ =‡ ) ÿ!ifÕ N †ÎqRuntime5P("no ½s¼ üŽJing"$ëÒrandom.choice ½ .0os.G e(¹«+Š?ead ̾› = M&@_rd = /:ers�buf = os.û0MSGÑ '¾Ð.assertEqual(íobuf), 0�Ø' h¢os.close(râ0) ;‚J rd |Ep.un¶ 4$ Cörå6movx= àÁ¦, [MSG] * n3 Ü5_¾sæ=as NVALÈ�invalid f›–descriptoá@FD, À7&FD!wçÞðp.register(FD)  Ór = p.poll() ð self.assertEqual(r[0], (FD,õect.POLLNVAL)) 7öf = open(TESTFN, 'w'U×fd = f.filenom4p =U ‡Æp.register(fH²µ&fd;wf.close}M_, (fdÿ5“os.unlinkÿõ# type error for invalid argumentsD•ÀRaises(TypeET&, +6, pñ4 $una6…†# can't p non-ex�•nt object/´5Key³_9, 3/CTest/Gcase0oll4µclass Nope: ¢Fpassª&jAlmost(Cdef £=)J‚return '&'U06¡¹Ó,¥_(), 0°CÂEð°# Another tD>r[ú . This is copied from the/K`select_Pmodif0rto use O’ instead.<v_ 2(@ cm'ÿñ in 0 1 2 3 4 5 6 7 8 9; do echoŽðing...; sleep 11ne'›ˆ@proc ub Qess.P} cm§÷hell=True, stdout=s)EIPE,IM‡bufsize= j§.__enter__HìÄ.addCleanup()Pxit__ë(neò<-¦•Cé !Q9( pŸ6IN gv@touty±(0, 1000, 248ú16000) + (-1,)*10`fdlist3Œ‡(ZlL if/-G= []…continueócPflags,m9[0]"2if !&6‹:HUPªM@line¬P.read ± 0if ~ != b""D$Ýafail('Ãñ: pipe seems to be XÒd, but still 'gs dataPþ Ý/elß.INš·½Þ 1notâð:  bbreak ýself.assertEqual(line, b'testing...\n')8‰continueYelse:icð0fail('Unexpected return value from select.poll: %s' % fdlist) H@def –_" 3(W)n#Õ int overflowŠ1hster =e(Ö!P.regi*#(1uyj$ƒRaises(ObuError, ? —, 1 << 64B•x = 2 + 3“–if x != 5Âk,d÷ must have occurred'[õ# Issues #15989, #17919i½üv, 0, -1C$ÙHŸmodify, 1‰%A‡Ñ@cpython_only Wœ_c_limits_¢_ó capi import USHRT_MAX, IN U ]÷T~$áD»? + ì"cL.#C‘%EF…Ñ@reap_threadsô!edT ôçr, w = os.pipe/ÉüddCleanup(os.close, r6%w%‘rfds = []—.÷for i in range(10ä d“Gdup(n—&fds*wˆ.append(C« ž!fdŸ:fds¼=E4fd,qgPOLLIN¸Bt = ~fT�…(target=J ºwt.start‰:try„ætime.sleep(0.5;õ°# trigger uvõarray reallocation„.ê ›+4.un9 K $"w:OUT£ÂŽj0RunÔi;hfinall À # and makñ e the call to poll() from÷thread return ùos.write(w, b'spam')!‘t.join() ò@unittest.skipUnless(^qing, 'Tjñing required for this 8_b@reap_:s[1def"_½ñ_blocks_with_negative_ms(self):1Æ\ð imeout_ms in [None, -1000. 00.1 e]BFð# Create two file descriptors. T½Àwill be usedc un¢‰G„º�.Õb insidªú ?úr, w = os.pipe(‡@Ñster = selectR%P.regi.4(r,/cPOLLINÇ®V…2 = ”Bing.Æ€(target=&Ns•, args=(tv.,)«Uo.start¦ \KJ=0.1JíÀ.assertTrue(‰:«is_alive()Ô0# WѤ�L" sÅ1 un§Xs and"Yends.–!•ÏÄOFalsÅ�ªos.close(rMUw) 2 ma¢ÔDrun_¥ð(PollTests) if __name__ == '__72__'8�2() 8àest import sup .ð_module("dbm.ndbm") #e if no72ed 14 os £C|€ðerror class DbmÔTCase(G."):©\setUp2Tä NÛu.TESTFNû'Dd = ‹Q.openM.>C, 'cϹ3¹•‡rtearDow= ¼asuffix¸‘'', '.pag2dir+b'­„junlink’2 + R mst_key<°ã‘REqual~!d._V), []°_»['a'] = 'b'\�[b'bytesmb'data#Á'12345678910(ü '019237410982340912840198242>– w½aIn('a';f.d´#b$ ÏIÎXq# get()n�setdefaulawork a¹­ïdict interfaceºsÀ.get(b'a'), sb'b') ñself.assertIsNone(ßd.get(b'xxx').^Equal-•, b'foo') kQwith ^põRaises(KeyError):*œ)!d[‚]? �”setdefaulµ D [î]1¡d.close() Iòdef test_empty_valu;Ç€if dbm.nÿ library == 'Berkeley DB'õ§skipTest(")ñ doesn't distinguish the € €! "›>Q"from2»absent one"Ú6d =²BopenàÏfilename, 'c; Œ¬keys(), []_!['®u'] = ''­ÕIb8 Q 4In(!,`d(¥[2ïÕ¿Ü4 •;[QmodesƒU@for Ð in ['r', 'rw:n']R:tryqífI8< €except eÎuMfailCücontext_managerò8DI—j as dbw@db["5 b b"�"ÙÍr?r')r—o‚list(db.Ìb“Y€K*b€,cmòj]btr(cm.­Uion),,| ñ"DBM object has already been #d"¸>byt¶RcRQdb[b'T‘ key \xbd@úÈnÀ( Ž %¸TTrue(©¾º/db58÷› ö €junicod�À with dbm.÷ndbm.open(self.filename, 'c') as db: õdb['Unicode key \U0001f40d'] = XvalueFPwith w|r|£ÿassertEqual(list(db.keys()), œ0.en³E()])‰ÖSUTrue(À Ü@o in dbE#< Ôa…)],ÅÉ Æ †C†}2Àÿ@unittest.skipUnless(support.TESTFN_NONASCIIòÓ'requires OS ?� of non-< ýRings'÷@def x¤_nonascii_ù)ó$ =Z ™Ê~ for suffixè¡['', '.pag2dir6b']^7‚•ddCleanup…unlink, ‚+^Ã;J.Á Qb'key¯!b'"'ÅŽcôany(os.path.exists(c ‘• )Ù'ùi­ ó%Äè&.4], K ) if __Iò__ == '__main__'üøA() #Žð interactions betweenó, float, Decimal and F*@ im1 UdrandomDmath 4sys óoperator from daSp2s D!fv#s #‡,ðF # Constants related to the hash6plementaæ!; ñ(x) is based # on0Aredu Ìrx modulJûprime _PyHASH_MODULUS. ³0ys.wa_info.B%us(=INF$ôinf class HashTest(Y.CCase Fpcheck_eŽ_j@c, x, y&c!# (Á both that xÄay are >Qtheir&es ¢…w1x),3?(y)*ð"got different hasñhes for {!r} and ó".format(x, y)) òself.assertEqual  ðdef test_bools(+!):=€.check_e:ë_hash(False, 0b (‹True, 1)j}integerm!# Ba that o€ values vK›„# exact N´ði in range(-1000, ÙBݧi, float(iB/ D+F+«Ò# the currentæñis based on reduction modulo 2**n-1ùGsomeHñn, so pay special atten=Ñto numbers ofr'M;V.N A;10090n =>Ui - 16#pif n ==”(E+n)<'ynyny3U-n, -i ‹d,D(`+F+‡?D(-X-F- ±U ›õr&±#Ò4domõof various sizes:Á_û3e =MR.rand*'30Òu“'om&P-10**×0®t*U7!ñainary_JŒ # ˜ñto corresponding FraªsRˆDecimals®EÝðare distinct but ‚ericallyèr shouldt%'saði“0.0, -0.0q“f# zero:7D(0y)^/, *'3'Y¼F‚¦¼‘infinitieWÀ nans ó self.check_equal_hash(float('inf'), D 3) 6 -7 %) 9õfor _ in range(1000):^0x =ò dom.random() * math.exp( *200.0 - 1¡J¥¢x, D.from_å/x)6F6·ðdef test_complex(vÓ## ð numbers with zero imaginary part should � Œ1 todÍñ# the corresponding Á\‡ñvalues = [0.0, -1 õ0.40625, -5136.5,bf]ù,k"('Ð]tÐÌnl:0.0Ñ#–÷¤ &z;Œ<,G(u)Y„�decimals…âr that D%¢ instancesõhave different representations&S# butŸ‹as givežAsame¿.¦�q'0', '-!0.›!e1 •000e-10']95=4s.* D(+±0XrD('1.00á1]/02-b-c1d4S123e2Ç0230ûöË_230e15 0iñ–16m$£oV%AfracÔ&Ðspecial case ‰2Ñ where eitheró‘numeratords2# opdenominõ is a multiple of _PyHASH_MODULUS>±passertE�(\(F(1,3&))6INFÅCk-1, 3*yF-G7C0, 1F0‚iö:¢ô‘_normaliz€«ATest�ða bug encountered while chang&AlongÖ.fÐ # ó* # Given objects x and y, it should be possible for y's ð # __hash__ method to return À(x) in order·ensure thatD*"==5‚y). ButCðs not exactly equalO7theGÄresult of x.—÷(): there's some internal normalizationF…to make ©@ \@fitsÑ‘a C long,/iŸD¡� invalidÍð value -1. ThiL�= ™P must‚areforePchangEe—'of@N¬uany x. õclass HalibutProxy:Ó5defÒj(self) $rß"'hK/')GAeq__E0, o„LE == P³Ux = {,½5()}x®€.assertE Ò(len(x), 1) øð ComparisonTest(unittest.CCase¡…_mixed_c6sÎ&):�#Ûaed lis{�distinct Bïs“Övarious typesU#‘Ð, float, Frac�•, DecimalÞN_=Us = [‘=™('-inf'),¡D('-1e4250 j-1e3083‹F(-22, 7JZ-3.14**-2:0.0[1e-32JTrue&lF('1.2›D3ë<1.4ûF(275807, 195025¿Oÿ 41421356237309504880168872OÛ114243, 80782NüF(473596569, 8461oK7e20ù¼D('infinity¼]´´€i, firsth§enumerate(§û4`second2(f[i+1:]l-*QLess(n", D É/]4‚Greater(_Üf 2i 7*¡›4lex—® # êas withòlex are special: I2ityÆn·1ityeIòalways succeed, butev-Jõraise TypeError.Åz = 1.0 + 0jAw = sv + 2.7jsïvê 1,7‘, F(1), Dø1$óÐEqual(z, v)  ô self.assertEqual(v, z) "ñ for v in 2, 2.0, F(2), Dµcomplex(2):19U#NoX_z, v)&~DLwLwÊR(1, 1Ë1ËË91),¥‡ý ;, w6 op7Öoperator.le, t g*gtK€ðRaises(TypeErrorG., \7mò if __name__ == '__main__'‹�unittest.¤() import U fromc.mock #Tpatch0„builtins"rltÁter class CPBteMezÂ""" Trivial "@usedW�Ging E.>ar. """Æ�spam = 1 !_h $2 oVTestR†(Ò.CCaseÖ def setUp(Šb5stdÉ/ =’(úC.1Pdict(¿O=int“€ egg=str=#M6Me= )O™# forces „to bind í WQspaceƒ±5c('', 0duæ™B ~ A(+•dEpassq(oB(list()š ATruep.ª2use+nsÒ7CFals8ã.5Ê_(A())AM„, B((1,)Æb€global_m®!es÷( # ‡_ with×IasortedN E o_'di')vÊ� [x+'('o xüDdir(`Ð) if x.starts£(O]ž˜/st˜:O˜ Š n )óakaksajadhak'), [],)§Äa customized‚Àce sðelf.assertEqual(só completer.global_matches('CoM'), [(Ue('])*^o/egh 9eggaÿ# XXX: see issue5256~&í$pÕdef test_attr@!):!<##õ with builtins namespace'6¥6std¨ fo'str.s: $ö{}('.format(x) for x in dir(str¸­ °if x.starts¿_('s')é³ðtuple.foospamegø' [Qðexpected = sorted({'None.%s%s' % (x, '(' ™ÿ != '__doc__' else ''Î ûX&)}0€AT.'), ¶L-_M: Nh�Ïa customized“�IOe.sp˜ ,/am> I?me.PÔÁ¿wmro(', .ÝÒ/0Me.ø š8 €:._hFÌI ì?m_=%H·WZTrue($“T?, x'Ini@e.__S__', t6@ew__‚62³ pÕ†.object(›ˆ, "me", pcreate=Ó¿ ñAUOme.mb Í6 Ó'z‰ Às('egg.s'),   ÿ['egg.{}('.format(x) for x in dir(str) C ñ if x.startswith('s')]) 6ñdef test_excessive_getattr(self):&`”# Ensure ð) is invoked no more than once per HUibuteF–class FooY]•calls = 0)™@property³-ba 1·.PI+= 1; ¦return Non–0f =”(Jåcompleter = rl$.C¦(dict(f=f)5{ÆassertEqual(8 À('f.b', 0), ?ar'@fÉ<, 1¯ uncreated_d¬AAttrzss like Jô ies and slots should be Ÿµd even when9ó# they haven't been }æ on an instancPæ!__xÆ__ = ("bar",ýƒr_Foo()v uàP@unitØ.mock.patch('ñò _readline_available', False¼�B_Á �ÙI�BÊ/\t< w. 4('a;=!1·?as <Rs', 2=An»)pùOpass½F>÷?$el»Oelifú?xOelse}$tr}\try:'Güduplicate_globals½Ñnamespace = {3§' :Jð, # Keyword vs builtin B >''?4Ïtry': lambda9ø£ l¨memoryviewp1CalÏ ­?on-D�Ellipsis�N6N J}˜À completer ô= rlcompleter.C Ó(namespace) öself.assertEqual(8 ã('False', 0), BoIsNoneC õ1)) # No duplicates�0# Sžõ or colon added due to being a reserved keyword?ÌìÍ/ 'Ï8_', 1);L4try}Otry:z@wN@openö"bracket "(" because we overrode the built-in clas~?¤memoryviewÆ ;J „Ellipsis‰(T:Ð` if __-ñ__ == '__main__':l�unittest.Ô() import dis "q from -óbytecode_helper 6B¡TestCase – ¬Tranforms(&1): ‹1def^`_unot(Â)¤ßù# UNARY_NOT POP_JUMP_IF_FALSE --> QTRUE'W>[VxS€if not x2nUdel xF“`TNotInÉ([5, '¢µ4 Ì<m9í)Fü elim_inversion_of_is_or_in\õfor line, cmp_op in (ö ('&Àa is b', 'is7O',),'n'5/in'F+ûNF'N Ò—0 = ñBile(Ø'µgsingle`ÚÔdEä, 'COMPARE_OP' fÿglobal_as_constanºÀLOAD_GLOBAL Ua/True/‰º"\CONST!`Ã+f(í1x =1&ÓgreturnÍPgP� P;h;Ó<m¡func, elemk1(f,Æð), (g, True), (h, Falwse)): ÿself.assertNotInBytecode(func, 'LOAD_GLOBAL'):7åCONST', elem) =kdef f(ˆð'Adding a docstr õmade this test fail in Py2.5.0'Q϶return NonejÝÚ3Ö0ÓhÓÏ °_while_one(Eàá# Skip over: RHõ trueconst POP_JUMP_IF_FALSE xxác 2o* 1Ï Epass;Elist1for˜Q(æ”M', 'Œ'ÍQà5í& gá¯ABSOLUTE',V {@ mppack_un otBlineŒá÷”�('a, = a,ìŽN',),(b* b,ROT_TWO)3, c,5, c/0HREê Z ùp± = compile(¼¯'','singlewCð¥ ß1Ï'BUILD_TUPLEh:eUNPACK;:ž0folΠ_of_tuples êOants± ý = 1,2,3', (1, 2, 3)¯Ð("a","b","c")* 'aˆ¼.c'0@a,b,´ZðA, 1,a\ Œ§q), 3, 41  0E ÙHÉä;r# Long Û° should be ÷ued too.,JÝQrepr(9ÿ(range(10000))),ò¡œX# Onei2the²@, on¬ r È "UvalueºQload_µ°s = [instr J ±in dis.get_€uctions(ñ …“ 1if 4£.opname ==j„]„§Equal(len(™C), 2ˆbð# Bug 1053819: Tuple of constanðts misidentified when presentcith: 1# .ò opcode_with_arg 100 unary_ñ BUILD_TUPLE 1 8.JõThe following would segfault upon compilation8Ædef crater()˜Ÿ5(~[&ÿ0, 1, 2, 3, 4, 5, 6, 7, 8, 9,.ÿ™A],) ¯ÿðtest_folding_of_lists çconstants(selfñfor line, elem in (N#€# in/notE ÞÅqLIST sh¤b·ëded to a tupleŠ 'aJ³[1,2,3]', (…*))uC('a wÁ["a","b","c"3p'a', 'b/c'9`in [NoÕ01, 7 õ 7p”): 9L0ý# = "e(['«‰single')_ŽÐ.assertInByte@(â, 'LOAD_CONST'Ÿ</No?e '#/se"M/SE!Ÿfrozenset%{%E}', (#({/}‡0{0 >:c�/b'D@in { ) BQ<@{/ ? Ä€ä�K2, 1D ƒŠ6N?SETÂ,ÿð # Ensure that the resultóö actually works#é;f(aïqreturn _&˜5g5»À1, 2, 3}  ñself.assertTrue(f(3)) < ¯not f(4)) # gE gABðdef test_folding_of_binops_on_constants(‰!):3œõfor line, elem in ( ð('a = 2+3+4', 9),  # chained | ?@"@"*;o'@@@@'@?ëeck string opsCõ a="abc" + "def"', 'abcdefOCQ = 3*‰/81…ü # binary power‚?Ç/12>?�multiplyB@13//D3C�Ïfloor divideF 4%Eˆ_odulo@2+3', 5„ È?add=013-}=�subtractBì(12,13)[1]', 1 _subsc‡p13 << 2Ã@_lshif€Q13 >>@ |Ö@r@0& 7B@/an?! ^=/10>=/xoú|=½= <ìáòcode = compile(û'Svsingle'³/.Õ`InByte@(â, 'LOAD_CONST'? <[PinstrV�dis.get_quctionsH   uaFalse(5ø .opname.startswith('BINARY_'Gð# Verify that un”öables are skippeœËq'a=2+"bd257'b' Ëðlarge sequences do F±result from€5ingwÞ�"x"*10000Þ ÷­HæeNotIn(l , ‰2.coˆs4 01<  ?Iposi1Ïg :¨ª/É® ìæ<Pinstr�dis.get_quctionsâ  9uaFalse(5ñ.opname.startswith('Uõ#')á=Â# Check thatÍSworksÓ¥marshalingbè‹negzero(�…return -7HgÝ"Ù,bVerifyÚ unž÷ables are skipp˜ Ý™", =Š �P"abc"¬0abcUµNEGATIVE'),+ù?('~1hINVERT/ Nðcode = compile(li÷ne, '', 'single') ðself.assertInBytecode(ÿ, 'LOAD_CONST', elem<�opname) mð def test_elim_extra_return(€!):&––# RETURN {T NoneS --> 5_7f(xGKa% x'kë(NoîfërëIòs = [instr for ±in dis.get_–uctions(f>‹ "if>.$R == 'ö�_VALUE']³£Equal(len(�O), 1`jump_tobóJUMP_FORWARD toNZócond, true_value, fals v-@ if AX else9嘭»Ì 4‡ABSOLUTE59É€2ÉSafterÌ1/ðEliminate dead ¹ : ás immediately F õcan't be reached‹J¯!1,¶2ßÍ#1:L% 1<å22vwhile 1ï4r / 3.f…48Q5f6F'E4zš6z2zn<¬àà# There should%RøBthe ‹Uloop.K\%K Ø& Àen(returns),S 1) òreturns = [instr for ±in dis.get_–uctions(f>E"if>õ .opname == 'RETURN_VALUE']{óself.assertEqual(len(�a), 2) +ñdef test_make_fun‡Ð_doesnt_bail(J!):.‹2'f(†g()->1+1+Epass@ˆ% gd®üNotInBytecode(f, 'BINARY_ADD'¶üconstant_folding­ô # Issue #11244: aggressive ; ;.�Aexpr´´š'3 * -5',- P2 * (,4)1(m3) * 4Ž-1, 2, 35O1, -O2, -4L * 6lñlambda x: x in {®õ-5) + (-1 - 6), (w *™WNone}JoÙeI= Éú = compile(e, '', 'single'ðHL!N ~ŸBaFalse(F)á.startswith('UN*')yD“E,PUILD_Dð class TestBuglets(unitš.kCase):³žbug_11510öÔ&edäÀset optimizah@ was‘m„ d ¥ the tupleâ»# unpacking?ñhich would fail if?hÈhad duplicatKõelements so that1alength“¥unexpected„pÕx, y = {1, 1}+Ä[!Þ!ûRaises(ValueErrorP°f() if __g __i¢"__main__"Þ @() -ðBEGIN RSA PRIVATE KEYðÿÜ- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,2D5DD30B9D440DBB 01gIwpy3XxPGsY0PoK59vAxdLhkVj3odO0Z1ULamUzIte6ThKL1HqnZiUlXpYKfK XqHVVeQ1xouxiDRNFLJ4CqBG4HbRtqTkl+sfaNTVveL18lOOMAZy6W3dCGAnWOTZ Z0RJyZlQxxjNQLuko4tIvFkrShXIgdiVFjwAhRU0KTUb7UQ2xfFA9R0Kfde30pzz zSjb/OmYqAIhkdvafGXvJxzZAorQkU9akDh+uJ6cht5B/RGZsbKACYDSv2WSV5yW r+fKVYcTup33r0Jj8hAD6fVY15K8BJknpkF9HfSlZnmmr2WDaffLokOOnCV/I1ie WD7ENA7K//48km5D3Ogh2b2/0Iwuzjq8Mvd8aR39N9nINbGR+HNT85pawoo1S0W9 pQTU4XTmxfXjtR2287C6XZyQ/tBwvNDMFPôÿÿÿÿÿ!VhlxsGOdLYwoV5e/L1t1qIfkTlbuvd JaMzOhSSLjiC156IFoH7PTPe+g75hw2b32XJURFGlaYknHF7P4BmCiwXOQYo5CCo MQGGlw5qBCqODrIsc03wpL2jUzgvyPqLyaw395ITuSoGX+WO7vUQaGW0Tz/sOoTs 3pK+bTi2QmqZMe7xBOj07CYMMOo4QPrM6NpbObt+Jja2UXaxvKa9BwqCEQzA4pQZ 8ZHHfEWIaDffKTGkAlqm+S8qCtsrEZJhIn3aI/ikzK8v+YkWw6w+8t/tR1V8ET/s CoYGIR7I8WhdfKAwgx2QT5bt1jkYKJyKPm4Iacp2mNh9gNFVq+JSKF318e7BrR3+ wyqMkDxRYnov3ybtf6kiICxPREDqa6UG1xRq3SbWz6NnIF/1hoHs79YlSYbMfXNU ffIxBaXNCcH6jM9duP2YRnO29jLwfLM/mmokTBBjyOBaKZia9GPa4naXoATXW3z+ Xx4EKIUkKdb53kiV6NtEKMPialAnkeoHTEjyLPgaV8mCHLvGQbnxbYwvpPJH0e2f CWgiw6ci4ROOzcZ7HJHIDUprwK0xRKn43hoI44fivlSHOFX6da6o3wIqhEUqMKwL JQDS1GORRk1ndRXP+7Ub1dO+Vo/DqO1VcTr2o5RwZ1LWPnzLqbCG50mvTLH4djB+ +hf6vlmnFC30N3yUFXWE5vS10nJHYP88dD9CB2RsaWzpxD9Zxl+PKcRsppen6HyO u3b71a/TBOkJcI+lkOatEFvbuqzBAqhMceMctO+Dl55RFsbxfIw/IXZjdP0PYZ0C t20DrIdBsvl9F/mfYpmkV4DF7yci78DqnRBcxylVNF2vwX7o+2fq/TsEwsHn3KnT kvcF5Cq8Vr5C8ugWX8JfveNym0BjLu6Lr58qS4a6qCNGEGPFKyB+xkm4KEScbarQ aLbEbfulMM7q9//sEOOLexIx7mNoLd29Xzn5hsLCAZLWX6wMq6JVJ/zbBOAHDbBT yhi03yd5Kvw3swSt4QZj+uR3qTFwxkXUFiVvrSfxRZoyKsxsLr9Z7D8aoH9Rkb2L 6KjZ31nt9Drh7NJfh6ReANBW6INdDW0Y2mbzoDozLszAYjVfuUUEE76iJqXY0N4W kNr0OQQTUtDpVk0AZZZvy17xV+rkqGgwlOqTvHbwFYEQvgwVz4EKUw== -----END RSA PRIVATE KEY----- import errno from http import client import io import itertools import os import array import socket6¤threading ôunittest TestCase = .p from (˜0supmP her4ðos.path.dirname(__file__) # Self-signed cert õ for 'localhost' CERT_4 = SPjoin(g`, 'keyB_.pem'[ @fakeZ�^a 2bs×p.python!B.netÌ ö_odotnet}2�Á # constantsBsñing chunked encoáP_starpò ( 'HTTP/1.1 200 OK\r\n'£Transfer-EC:U%)a §hello worl3 7d! 8 xand now'22 asomethàðompletely differenñHt\r\n' ) chunked_expected = b'hello world! and now for something completely different' Nñ_extension = ";foo=bar" last_"0‚7dƒa"0" + ,N2+ "5€trailersHÀX-Dummy: foo`2: bar"ãnÞCð HOST = support.ñ& class FakeSocket: def __init__(self, text, file3ð =io.BytesIO, host=None, [ )JNâif isinstance(I7str"&! =hñ.encode("ascii")”$‹.) �& =© #Adatañ'Àsendall_calle0ZQ_clos¬ZFalse!! =  ! = [nZ” ä"�A+= 1=4@ += X@make«Yßmode, bufsize• q != 'r'ô&b'¾tðraise client.Uni °mentedFileM¬¥¡# keep the†ú" around so we can check how much was read from itêж@elf. ~á w8".©4»r #nerf (9ureturn @PN<q ¥gFTrue;f 6Fpass#¡setsockopt(÷, level, optname, valueu?S EPip³(¾&):_À¸pipe_trigge€P# Whe`() is ˆed with 7", eEPIPE.­….zngP–Áê "if± J!in¼áOSError(errno.¼œ, "gotchaak]Ò“SNoEOF(µƒ"""Like !˜tJ±s Assertion¤‚ on EOF. @This�u|ò below to test that http.šÀ doesn't try%U Bmore^•punderlyÔÂG²n it shouldÒ1""":®G…Cn=-1Ð)&= ì.,ô!if˜ =k[ !('}tr triedËP past'Z¼‰/±ðline(self, length“=None): õdata = io.BytesIO.readline(self, length)12if 4V= b''IPðraise AssertionError('caller tried to a¦ past EOF'Zareturn^ð class FakeSocketHTTPConnecZŠ(client.×:"""B subPWusingV¢; counts c[0() ®Qs""" òÃdef __init__S*argskõ'.@�ions = 0<uuper().DÇ'example.comüEafake_sï_e0 = MÆelf._create_r1 = ? Ã-»@"""Cø the number of time is invoked×t8øE+= 1¬Ís�)” ÈžÇ, *pos, **kwªO!(*€ 3):ÀHeaderTests(4Cas÷Ô±test_auto_h)s}qs# Some ° are added 5@mati(ôy, but should not b'%by ð# .request() ifmyQòexplicitly set.[­Ã¡çingBuffer(list§.Ð` $.ìU = {}œ@aappendo, itemD kv)×tem.split(b':ÂJ if3Š(kv) > 1  #có is a 'Key: Value'oy string¥7ðlcKey = kv[0].decode('ascii').lowo:Á.setdefault(P6, 0‡f4[))] å'•.CÑDfor îrú in True, False)0{'’'Content-Œ€', 'HostûAccept-encoding� z? = 1(Ž8<.‘' =5d('blah7!_b±? = È f0bodÚT'spam'Ëf ÇG,ifg X$E[]Bptr(len(…) ÓÆP'POST~@/', 1,¹s9BaaEqual(J’†½C], 1šªc_!_0©&):a2(L³QCheck2Àst):  ðdef __init__(self): Zlist.% $;ù.content_length = None+oaappendmo, itemsAkv =ù.split(b':', 1)M¤óif len(kv) > 1 and kv[0].lower() == b'™-™'ãKÃÎkv[1].strip(Ñ ¨ñ# Here, we're testing that methods expecÇa body get aB ¾ò set to zero if the7ñis empty (either~f or ''¹ bodies = (œ,‘a_with_Šâ= ('PUT', 'POSGATCHQ3forÊ,‡n¹ýrtools.product([-;iesüðconn = client.HTTPConn÷on('example.com‚¼8ñ.sock = FakeSocketäü)²_buffer = C²L±PCheck5|2drequesÈQ, '/'Ây^CÉassertEqual(JN€ 0}, b'0',3t'Header¬-­ô incorrect on {}'.forma£ ˜)‘0For5#se¸sž€ make su¥� tais not{Ewhen¤#Jøsqòbecause it might "unèÀed behaviourº&th"•# server.`85out–!TA 'GEœaCONNEC `DELETE¹@HEADpOPTIONS WTRACEj-Î4 in ~ <x°–òë:°,Q°·_¤_¹IíQato '',PÐ's considered!õbe "present but3#'A" ra'ðthan "missing", soIÉ[É@woul·I, evÔ§ˆc don'tÖ ÓÑ.abÀNone)  ñconn._buffer = ContentLengthChecker() +2úrequest(method, '/', ''*ùself.assertEqual(HOL~".c|!_l}}, b'0',3t'Headerª-«ô incorrect on {}'.forma¡ ˜%) Vý# If the body is set, make suref!.?Bfor ó in itertools.chain s_without_d,0%):Pû = client.HTTPConnection('example.comnLúsock = FakeSocket(Noneÿ)uó. †ô.1ôJÑdef test_puthI(²ƒ4.{ %4put;‡'GET','/A#š'Ž-V', 42˸^KIn(b-q: 42', Rì÷@'FooÀH barÑ cRFoo: % [º Z0BarZw\tbaz\tì \TBar: '^�AuthorizahïBearer mytokeno :+: 8€BIter�}A B})7 : pA\r\n\t BµV ZRLatinF'-O\xFFt/!: ,åIUtf8hoc3\x80l2k/o0C1-ø1rol×Ïnext\x85lines6): 3wðEmbedded-Fold-SpaceË isœ� allowed�@+: >Œ#6TabŠ/\t‹4Tab‰Ð\tallowed', cãonn._buffer) cöputheader('Key Space', 'value'-öself.assertIn(b-": +!, Pfe f-fáb'Nonbreak\xa0Co 5woFw 5w»ódef test_ipv6host_Á£!):$â # Default % %÷ on IPv6 transaction should be wrapped by [] ifMsit is a?uaddress ñ#expected = b'GET /foo HTTP/1.1\r\nHost: [2001::]:85' \C´ð b'Accept-Encoding: identityK'8w  = client.sQConneÛ'('qÎ÷ock = FakeSocket('R".s# k�.request(çUê=†)PTrue(Aô.data.startswith(/5)) ]Cq102A::] ETsì$Gv“malformed�s_coped_}¢ (µIssue 19996Ž€body = "PÃp 200 OKp0FirË0val3: n aSecond¼"P rb`JrespÆrResponsB )w.begin(=Ôv`Equal(P5.geݵ"')ÚÃØ9Ö:Ójðparse_all_octets(Š ^�Ensure no)$id‰afield 5 ªas the Prd %E = ('–#ñ"!#$%&'*+-.^_`|~—!ue•ö # Special token characterÒFð'VCHAR: ' + bytes(range(0x21, 0x7E + 1))'\ †Ÿ'obs-textC 80C/FFC`fold: Ie 0ed Þ sÂð\r\n' ÷ b'\tfolded with tab\r\n' ÿb'Content-Length: 0% )Cösock = FakeSocket(body ð resp = client.HTTPResponse(; )v.begin(ðself.assertEqual(O».getheader(¼'), '0'@ Lmsg[:]:zð"!#$%&'*+-.^_`|~"{_value ?€ ?ÿ vchar = ''.join(map(chr, range(0x21, 0x7E + 1))÷ ½`'VCHAR.c9 03?], 3�IsNotNone§Ÿobs-text'¥EIn('#!, å6msg˜Cfor Ê?in _Ò=[R5]):°úVPTrue(%�ed.starts*,('­ 7±‘1ƒ space',¹ 8o3endm€¤%°òdef test_invalid_ö s(ÁÔJconnd÷Connection('example.com›4.‚ ½'#ñputrequest('GET', '/')  Ýò# http://tools.ietf.org/html/rfc7230#sŒÑ-3.2.4, white2g is noMòlonger allowed in ôe names)•cases = (ŒB(b'I*®0Nam’0b'V<V›,1/n/ˆ“1/n/ ./\t/-:é:/.Ã+;]×1/n/-”-')f�1/n/h!ðname, value in ‡cases: úwith self.subTest((name, value)).92ðassertRaisesRegex(V5ÿError, 'Invalid header'KO‚conn.put& }ñ class TransferEncoding¨CCaseXñexpected_body = b"It's just a flesh wound" Âdef test_end| s_chunked(W£ñ = client.HTTPConnection('example.com')[4ü.sock = FakeSocket(b'$pputrequz¬'POST', '/%¤œa._makeêP(), ee¾b=True)åŠc_, _, Ú„._parse_w‚«V.dataÃ3!)U `Equal(,V —–{ƒxplicit_�Ýy3# e" z `”Añ# this shouldn't actually be automatic“-}Õd because the¥ # *Åing code hasÑðly stated that i¬1tak,•are of itI£°Þ4r ${'=->A': '¼Ced'}“K#_,«s/"ôNotIn('content-length', [k.lower() for k ins�.keys()]V%[Ò&],ÓB˜ sP, str˜>|’€AX.ê \0.deeÅ('latin-1'),­Ù ÿ ôUser-specified TE, but �`) doesð�‡5ingwÌ$Nzñ/À={'Transfer-÷Encoding': 'gzip, chunked'}, e)#e_Z=True!ðbody=self._make_5())EÀ_, headers, 2 = .ö parse_request(conn.sock.data?,ô"assertNotIn('content-length', [k.lower() for k ins]IcEqual(–µ['Transfer-,],H¢_Î'(é"),é�expected!) …def testÿE!):}Ȱempty_linesÒ�(False, ‚+/=ö = client.HTTPConnection('example.com'È8uÿ = FakeSocket(b'(ª¥B³'POST', '/'ó Æ= ) @&,Ct ] � ¸p.W>¾ ±\ 7E �'î3# CÅLÅ] and ‡ð SHOULD not be sent 9theËs# same Ÿ ¯=#N­À*(Z…c# Zero“ð iterable should½õtreated like any other*heÊ!4Æ $#(±¬CUûW—±#EI‹¶�, b"0\r\n"”Þ°9", ê|=xìi ,P.spli? @ËPidx, 8À enumerate(sZ¹#Ä�ing handl ‘Cs,/(if¬Hvidx % 2M(0yie�,''B2S< len’O - 1?´j + b' GOelse4 ø+�qõ@f@s = V¶YA" =5[0]ØxU = {}Ðn = 1 ö while n < len(lines) and·[n]) > 0: ±key, val = 5ü[n].split(b':'),ú = key.decode('latin-1').strip(0àheaders[key] =f9un += 1 }óreturn request, YÓ, b'\r\n'.joiõ’[n + 1:])>ödef _parse_chunked(self, data) •body = []tÕtrailers = {}Un = 02! =M6’ !#  b9®FTrueƒ•asize, ª‘F:n+2˜'r = int(2#16ð0if < ==ñ` Rbreak8-Ã.assertEqualpd¦)é3å‚.append( Oy23ò # we /should/ hit the endò, but check agains!Þ+ofK‘òso we're not stuck in an infinite loop t;getI‘malformedÜ fif n >XFÐ I¿#b'©&ð) class BasicTest(CCaseR¼Átest_status_Ý¿!k # 6b HTTP (Èxn@ = "#°/1.1 200 Ok§UText"áðsock = FakeSocket(?åàresp = client.S�Response(; )g.begin NO€.read(0)Îö') # Issue #20007š3elfŠaFalse(<—isclosed(‰f*(¡&ÚPŒ‹"/·~-m“d%dß‘ п400.100 NotØO7sRaises( ABadS¨aLine, á»Î4badÒLreprÑ6exca U'('�ˆ¿Êpr(exc), '''9`"''")'?O‹€partial_ös‰@# ifñhave Content-Length,púñ knows when to ±0 it¢,p¨×ósame behaviour a60we ƒúñwhole thing with%ÿÀTP/1.1 200 Oðk\r\nContent-Length: 4sText" õsock = FakeSocket(body) ð resp = client.HTTPResponse(; )v.begin(ðself.assertEqual(Oÿ.read(2), b'Te'.RFalse.¯isclosed()*X/xtX?TruW�}Äêd%1d) Nðdef test_mixed_ s(!!): ‘ # ñline() should update the remaining lÖ‘, so that7‡() knowsNõ(how much data is left and does not raise IncompleteReadB @ = "ø¯/1.1 200 O` 13]aAnotherloPo xt›ôuÌð\[ …?y-qpartial{Ointoºif we have A , üi‘ when to ©0 itÎ,=#´òsame behaviour as6wÎ!ad#@wholáÙCwithÎI†æböb = bytearray(2*An = µÖr&(b- 7n, < b1s(bk7$�Fo‰öbs_no_c_DƒÖ#nod6�present,®÷$etžÒbe gracefully dâ¾R# all�1wasÜÚ§J?À resp = cló ient.HTTPResponse(sock) ¶resp.begin(ñself.assertEqual(&ïread(2), b'Te'.RFalse.¯isclosed()*X/xtX .1†,?Truƒ­«©ðd%1d) Qðdef test_partial_3ð intos_no_content_length(e!):8Œ¢# when no ð is present, the ¸ò et should be gracefully †BQÐall data was ‹€body = "ð/1.1 200 Ok\r\nUText"-yà = FakeSocket(? -_ = cll"öb = bytearray(2WAn = ˆºE&(b= ¢7n, < b1s(b7½$�F õf0¡ˆÓ¥Ðs_incomplete_ߟ"if‡ñerver shuts downñconnection beforeQwholeuâ-â™deliveredä.isÝGž¼Cb!-Lb@: 10ÎÒY }Æ>¦}9™=ÿ:1Àal(n, 2)  ðself.assertEqual(bytes(b), b'Te') &*öFalse(resp.isclosed()*An = ¦readinto(bGqOn, 2�'xt�f0f?TruË®õóOí(;d%1d) Vðdef test_host_port(5!):tõ# Check invalid )A#ú!for hp in ("www.python.org:abc", "user:password@$"mN€òRaises(client.I‚SURL, óHTTPConnection, hpØI—R, h, �õ("[fe80::207:e9ff:fe9b]:8000",ò< "70", 8)8  80  ÿHFD0C"=JÖ O:P *?c = (ÃTòPh, c.Ë-0 (p(X0pÎonse_headers7W„'ó with multiple message =õthe same field name.•�text = ('óõ/1.1 200 OK\r\n'&Äÿ'Set-Cookie: Customer="WILE_E_COYOTE"; 9ÿ Version="1"; Path="/acme"i�Part_NumblðRocket_Launcher_000S`sŠqNo bodyÖ1hdr7’  Ÿ.',2'õ c©‘s = FakeS8(ðÄó@RespV'(s#g.beginþcXRr.getl&(""> ù=^, hdrü!adøõ€Test thaðe library doesn't attempt to read a“ny data õ"# from a HEAD request. (Tickles SF bug #622042.):õsock = FakeSocket(\ú'HTTP/1.1 200 OK\r\n'"ÿContent-Length: 14432(,<ÆNoEOFBytesIO“àresp = client.��Response(® , method="í"8v.begin(0if P‰.read():ñ self.fail("Did not expect3qWhU1") D�def test_Y`into_hbSf # Test thaðe library doesn't attempt to H/ aÙÿÿb = bytearray(5ò™�(b) != 0ü2èÐ.assertEqual(‹üs(b), b'\x00'*5*�too_many*@ers(E-Aqers = ',ñ .join('Header%d: foo' % i�†ófor i in range(H@_MAXɳERS + 1)) +hO�text = (õ3 + ¡k¬:@rÄ#F´RaisesRegex²úšException9ù r"got moreoEn \d±B", r “œsend_fileŒ ed°b'GET /foo “ ðHost: example.com §@b'AcÈÿ-Encoding: identity5 ‡Transfer7chunked6 é�±with open(_ëú__, 'rb') as bodyJconnº`Connec…'('ï'Èg› I\ $\.)zA»(s@', 'v!',§ K;2Tru.p.startsö(Æ`), '%rY%r' %w{\BV[:len<#],3ed)Wý@;±b'this is a- Conly2zÀxample.com')# õsock = FakeSocket(None) Sconn.% Æend(expected5õself.assertEqual# , DW.data.1ocko = b''baarray.e('b', sFt<¥io.BytesIO¾)nËð def test_send_updating_file()!):'�+(pyield '²D0e_two' sclass U…F„Ûio.TextIOBaseyšmode = 'rw@d = �(w¿Aread×ë, blocksize=-1X.±return next16.d)¨ákÄöonn = client.HTTPConnection('example.com'Ÿw ç&""å 3  jΦ Ù  Aiterù ÷�GET /foo ãç/1.1\r\nHost: å5' \â[ð b'Accept-Encoding: identity6ñContent-Length: 1aL3·onetwothree‘ØObody·ib"one" Ð_b"twob"6Í¡óYðrequest('GET', '‡2', åJ, {'<†': '11'}RÙ Ü>0_Fä"""Check that %P) res‚òs the configured� ‚6.""ihõ = 8 # For easy debugging.¯zñci%R"a" *Ø×f + b"bÚ­.Ï"PUT", "/", ÍJ, {"Ço": "9"ÆÈÆall_calls, 3ä & =ä�.split(b"<…", 1)[1]_â (C :#… > "Àhe configureód block size.""" õ = 8 # For easy debugging.-òconn = client.HTTPConnection('example.com',pY=c)IsŒö= FakeSocket(None i.%9öexpected = b"a" *hf + b"bÚDôend(io.BytesIO(@)lðself.assertEqual(qÿ.sendall_calls, 20 edata, _ ²�def test_NÀ_type_error(t!):$ˆõ# See: Issue #12676Çt£4?d&''#Pwith ‡ûÀRaises(TypeE£ž¢Rðrequest('POST', 'Ü0', )ò|chunkedê!Ò"_ò€ Má_start + last_1 + fed_endß@respdª�Responseßê, method="GET"7v.begin(&!]x.read()ó(cclose( # Various :‰sóûfor n in range(1, 12‚1ˆž ; "Pn) + t1 @R2 D'x' ('�foo\r\n'*xÝm=6tryàeÖÿ^dexceptX@IncoI¾teRead as iK sŸi.partial“elÊ_message = 'oP(%d b-§†)' % len8³O ‰grepr(iÚm u</st;Oelse[fail(Ó–ÿ~ofinall§ }ɽBinto~àbPán%]bàÇytearray(128I Àunk + chunkeƒd_end) úresp = client.HTTPResponse(sock, method="GET"7v.begin(@n = P¶.readinto(bôself.assertEqual(b[:nexpected], 25n, 2'r…close() Ø # Various �e sizesõfor n in range(1, 12):ýñ = FakeSocket(chunked_start + last_1 + e\Hž` ; dèm = memoryviewei†fm[0:n]2&+­Ÿm[i:n + i+ &à‡ 6iä+J.èËxËï('', 'foo\r\n'Îxm·=:trydÖ4 !dexcept¡þIncompleteRead as iTU�.partialge�Ê_message = 'o‚(%d byteT”)' % len(9 BS ‰vrepr(i)‡m</st;Oelse[fail(Ów'‚ofinall° †ddef te €ed_head(û… =9= (m'x±/1.1 200 OKà "ôTransfer-Encoding:t-'1a¿hello world1 (% 1LeOHEAD} q `^Šg(), b'á+pstatus,ƒç ¶V�son, 'OKWQTrue(+!is³?d()UCFals*(&?c»d%dý�ø…ð_chunked_head(sself): õchunked_start = (!ú'HTTP/1.1 200 OK\r\n'"óTransfer-Encoding: T- 1a¿hello world1 ()•ósock = FakeSocket(�ãq+ last_$ +¬F_endDàresp = client.�Response(_ú, method="HEAD"8v.begin(öb = bytearray(5@n = j¶.readinto(bÿself.assertEqual(n, 0bçs(b), b'\x00'*j Mwpstatus,ÛY+Ïreason, 'OK',QTrue(+¯isclosed())CFals*(&?>»d%1d) õðdef test_negative_content_length(Cò !GïóCQ!-LQ1: -’–H¹ È>?GET= ¼ ]1(ë€43—ð7°incomplete_‰/" 10¢Å"56tryÎÁ]"édexceptÑIòšRead as iCB}�i.partial_Òe 6…repr(i),‡& "�!(7. s �÷, 3 more expected)1J t/stsX_˜OelseXjfail('õà'Õ_epipe”DEPipå d"³ñ/1.0 401 Authorization Require@"6çðtype: text/htmlÆ *@WWW-Wðenticate: Basic´€lm=\"exaS!\"< $b"hOÒ0conx`Connec¹(UK.com4.ÔÓÐRaises(OSErroOr, ðlambda: conn.request("PUT", "/urlubody"))Gbresp =40getVonse("ðself.assertEqual(401, ).status+ÿ "Basic realm=\"example\""ÈZð getheader("www-authenticate¾¿ñ# Test lines overflowing the maxñ size (_MAXLINE in http.client) J—def test_F_Ý__(!):,Eð = "HTTP/1.1 200 Ok" + "k" * 65536U\r\n"8Ûm|.>ARespp°FakeSocket(^¢|€‚Raises((½ã.LineTooLong, ABadS–)¨_beginì lì (Å'¼úKç'"÷X-Foo: bar' + 'r''04E%4$[. chunked:óTransfer-Encoding: g aI+ '02a$Ï'hello world0 t,N.®‰Lread•œearly_eofsí¼x4� with no ÖÆ termination]K©«|sock = ~ l²; B[ ;O.øv(), b''@æQTrue(*Ÿisclosed(CFals*(O?�d%ˆŸrror_leak‰Athati et is not 2ied if Me failsV¢ V`Connec½#('&G.com!Òöf= NoneLUlass Hn ¹[í�__init__ÝË, *pos, **kw,0�nonlocaló‚{›Çð # Avoid garbage collector n£: N ÂÀnse.__init__ó(self, *pos, **kw) óconn.response_class = R 'ýsock = FakeSocket('Invalid status line']÷quest('GET', '/!˜ñ .assertRaises(client.BadSSaLine, ¦4get©cBTTrue(".closed)SÒ@.filú/òñ def test_chunked_extensionJ!):&Bñextra = '3;foo=bar\r\n' + 'abc ,–pected = X0+ b1%' .› m5‚start + |D+ laª¨Vded +cneDHTTPê(pæ, method="GET"<7v.begin(zQEqual{².read(), exÚ0E–"()ç g¼missing_endiò"""some servers may ´ up a shortôõ encoding stream"""W˜Ý«$ { sð) #no terminatuEcrlfLölr„�trailerso”See that $P are àÏ and ignored\I& +|Ñ€@# weyquld havñched the end of ` 6mƒ;qb"") #wPAd toE5endDTàJOsyncÔRCheckÖ‚we don'tÒDpasth¸p-N,§0dat'" ’nh s}e#Oü$2now(2our½®€yçbòç+O.¥ð e("ascii")) #we read to “the end Ñresp.close() ñdef test_content_length_sync(self):(Aó"""Check that we don't read past o1 of CS!-LS¥ stream"""Qåextradata = b"!apected ÆHello123\r\n#ðsock = FakeSocket(b'HTTP/1.1 200 OK1 Œ@: 10c' + exh ”)§6  = client.]�Response(~ê, method="GET"7v.begin(SÐ.assertEqual(].C5(),ˆ0#Jõ file should now have our 4†qy to be ¾ r´.Rwô2 #w?JÏJ«>Á[linesH C°òð1”(2000), [„]ý¢1ùÿ1õôó¢¿o_boundüÿ6 (1òý «r\6'b"cÀw have our eñxtradata ready to be # ð self.assertEqual(sock.file.4T(), eFB) #w?Juthe endJÑresp.close() �def test_Jð1_bound_content_length(€!):/’lU = b""!apected ÆHello123\r\n#Âð = FakeSocket(b'HTTP/1.1 200 OK1C‰!-L‰@: 30b' + exh!*3 H)ˆî  = client._�ResponseBê, method="GET"7v.begin( „]A1(20‚�25´20 # ±Ùö should now have ourå+iF_ª,no ò # Make sure fd returned by 1¥ is valid.«pserv = 2et.(v”.AF_INET,+µSOCK_STREAM¶IPPROTO_TCP\Á ddCleanup(r $ûrv.bind((HOST, 0)PlisteœÕresult = NoneW@run_f7er(>Ìð[conn, address]ù§erv.acceptu,Rwith 0P.makeG‘("rb") as &er 6a# ReadS÷request header until a blank li¹9®while TrueY 5# =| ¼)aif noti .rstrip(b"Æ"-UbreakQ sendall(b"Õ4ðConnection establishedhâM’nonlocal Å m ç9D th62 = Qing.T†(target=H,X.starì  '×join, float(1Ž Üþ (*w@.get5[name(:.÷("CONNECT", "dummy:1234+ç2l0onnUí:try'γ5øDtus,–&OKSs í5no=AÒ8 ‚&s.*€proxied k'\nâ)kfinallćs.detachì,ž]=¬kGÀ thread.jocin() ð@self.assertEqual(result, b"proxied data\n") class ExtendedReadTest(TestCase): V1"""_ä peek(), read1 Cline„-Qs = (;Gö'HTTP/1.1 200 OK\r\n' Éhello world!(‰and now ûfor something completely different/oz<°Á_expected = [q.find('“ø'):].encode("ascii"AQchunk@ù Transfer-EVSing: F¬+'a”' 3F 9Z 2Mo DCo"0± # terminatËP %ñ # end of trailers"!)  def setUp( )Ä�ñsock = FakeSocket!.ãÄ&àresp = client.´�Response(A , fsod="GETû7I.beg�L .fOQio.Bu‹g er˜Fp.fpy®.20 = & ÐQtest_{&Ô)0 = <�ó# patch up the b}Àõ so that it returns not too much stuffK0old{—@.fp.p myW(n=-1�ˆýA&(ní–if n >= 0£–e p[:n]i &10˜2 = Ž>5vall = [0ªwhile True{Ñ# try a short+ }Ìkí3ÎpN{™�úGreater(len(p), 0@.#¬pn unbou’ƒ&$p2‹ˆGu zA2), )9 ÿ(p2.startswith(p2DnextŽÞ2*•Ž;J, p2‡;els•ó, g 5#``False(4 '¯all.appendŽ0ot 6ÇUbreak kËâb"".join(all),ŽWQœÌ,"ƒ3_Ðtð_verify_readline(self.ðresp.readline, self. ôs_expected) def _verify_0(/$, %, 4:48…all = []¦while True%)u# shortNs2”% =9(5)1if "2and š!= b"foo"eK,0en(0^) < 5"&Ûp.assert¬/ú.endswith(b"\n")„¡all.append- aif notœpUbreakÐz÷Equal(b"".join(all)e™Atest–1“)cà" =Ø fgdef r(*õ1rese:1(4Æ›BLessŸ«len(res), .–return reË+Sr = Rv6r(rfb h7«¯_unbounded´Jdata1ÊPö'“ öB3L�t  Ñ·  X&10ÀÝ Óó k,, _<O0@£–f§—1(0), b""B‹]peek_Np§.$(B[ 00, }ðp)) class Exteë\ÌTestChunked(ø1"""+ s)Ï#1( Ur() in cKQ mode5=#7(ëö'HTTP/1.1 200 OK\r\n'ôTransfer-Encoding:])-a«hello worl3Kd!\n9.Mnow )2Mýfor something completely differentDCo0± # terminat\g,#ò # end of trailerR$) øðˆrg›@a si«8ð class that uses ñ!an arbitrary read function and buffering """ñdef __init__(self,;:!):"..S% =# !ámainder = b"" a:ClineaWlimit^‘data = []1pulen = 0E3 = ‹j6try¯Cªwhile True3idxÅÅ.find(b'\n')L#0if *^!= -1E"_break8Á`+ len(»Q) >= úKj!4 - @=- 1_#Q more( !=r.append{ "‘L ad×(1notoµ À0 #eof condio o+ò++=á ¼j[:idx]› ÊV[idx:Bs`return‹`.join(\JjexceptØ Z?b""<^ðaise class OffâPTest(CCaseã�test_allEð%# Documented objects defined in the module should be_M%__jPexpecDö= {"responses"} # White-list dmcdict()tHñ# HTTPMessage, parse_headers(),I”&À status codeý§stants areOPinten�ally omit¦åfor simplicity/Qblack©ÇdŠI", "Œ%"}5L1nam˜dir(clien_h0if $ñ.startswith("_") orS} >vcontinuØm—_µ” = getatt€,Xn2%if% =S, "__ò_", None) == "http.Ñ"—õP.add(ßoÉóassertCountEqual.=$, A)«©A ¯W R1[­ü .NOT_FOUND], "Not Found"i.B_con= pñ# Make sure we don't uð backward compatibility ÛE 3.4äaŽº'CONTINUE',üSWITCHING_PROTOCOLS#¬PROCESSING,OK|CREATED_ACCEPüNON_AUTHORITATIVE_INFORMATIONEÐNO_CONTENT',  ÷'RESET_CONTENT', Ÿ 'PARTIALÌMULTI_STATUS;|IM_USED3­PLE_CHOICE7üMOVED_PERMANENTLYAMFOUNVœSEE_OTHER.®NOT_MODIFI‹�USE_PROXcýTEMPORARY_REDIREC­BAD_REQUES®UNAUTHORIZrqPAYMENT;.IR ŸFORBIDDENÇùpMETHOD_ç^ALLOWTœCCEPTABLEY_²¯ENTICATIONŸò}_TIMEOUúnCONFLI-=GONxoLENGTHj�PRECONDI�NFAILØ�¸½TY_TOO_LARGj(2URI%q(HOST, (Uport,;?s`"_aaC=(''/6%))7JrwKect(±assertEqual®(�.sock.getŸname()[1]i P@unit ò.skipIf(not hasattr(è0, 'êS).')Ýár 'http.75 Z‚defined'ʇ*ˆ!?‰>¡# We don't5ñ anything here other than the constructorò@barf,%asÙ # this codW esYàdeal with sett1ðup an active runn@SSL Î'erN0for+°ssl_wrapped†ÕP() toDðually return from. class TimeoutTest(CCaseøMPORT8QsetUpp&ú¬™0 = y!etˆ3et(`AF_INE òocket.SOCK_STREAM F‹.|0sup`.bind_ zÒ8~’.listen()Ý`aarDown8²l.close\Ì3¤œAttributeX0# TÝ will provettj �� through [ZÖ�and into;F×+#Äóault -- use global} kO"0 IsÕ˜`getdefI3(‚¬s$&30}Etry:h›Ò) IsíREÔ ü0finÎ u!«í[8­¯7(, æ(.óD# nop�!doø”h9Œ”…ç¡==u+@opÐ?Àonn.sock.getótimeout(), None) õhttpConn.close() •# a value,à = client.HTTP>âection(HOST, Tl³Test.PORT, ~?=30yvonnect(ôself.assertEqual(y“.sock.getQÏTÍð class Persistence—(bCase):ðódef test_reuse_rec•‹%):‘# Should (E or +õ depending on header from serverDhUs = (‹ÿ('1.0', '', False), oÿ: keep-alive\r\n', Tru91Y X S�SALIVE:nS4 nPfor vÇ3on,_,‡!in½s¨RPwith À@.subñ(?=G=­ç?=msg©'ü¡/{} 200 OKô ²%O'{}'ÿContent-Length: 12F¯Dummy body%„).formatù]¨÷Ð = FakeSocketåN(msg5d¯ Is^(G¬-Àrequest('GET›`/open-I'8Î"ÿ`respon¯D as  ÿÏžMEI1 is R, notKxCaW.read¨c,?§Ns, 1™ .I@subs]3nt-Lq2 ifs else 2)0dis‚`ected(QK&0makI seU [(texteò"""Return BufferedR9ùthat raises ECONNRESET at EOF"""Qòstream = io.BytesIOm &•Áainto(bo Ž»IsizeJõ4g#, < ];2if >?= 0ŒÑ P¯ResetErrorVrS k‡—4 = Ö 'àreturn io.BuffóeredReader(stream) •tests = (ú(io.BytesIO, client.RemoteDisconnected),5Ámake_reset_ro2, C,@ionRWError7)ABfor �ñ_factory, exception in ©:0¦õwith self.subTest(2= )48Áö = FakeSocketHTTPª[(b'',�©AEP.requxþ'GET', '/eof-response'5­ÆassertRaises²!, R4get@? qIsNone(4Nsock-*# ×.,ùect() should be automatically invokedeì#reRé REqual©0sions, 2†1defݰ_100_close('¸7° ° b'÷€/1.1 100�«tinue\r\n')ô# Missing final ‹9g•A', hûñs={'Expect': '100-conŠ&'}Eé.m  G±ÅO½ a classfS~bCase):`Ú\setUpÑòif not hasattr(ô!, ºS‰'‡˜@skipià('ssl support ‰Wired'U�@servøÀelf, certfil¡PAfromR.ssl_.As imVBShttps}return !êi=rÉ_øaibutes2é�# simple•ð to check it's stor�µthe timeout’4h =ªG‚(HOST, T1<d.PORT,C?=30’ü#h.j , (pÙÇžnetworkedÆôDefault settings:¤‘s a valid� �Áa trusted CAb›…5sslïxcires('‚ƒ`.trans¿°_internet('Gà-signed.pythonÌL.netqTF V, 443SÌ•« îrssl.SSL0 asó^_infoµhõ mõdØMàEqual(exc_infoñN.exception.reason, 'CERTIFICATE_VERIFY_FAILED') def test_networked_noverification(self):-1÷# Switch off cert v.'¥import ssl0supÂ.requires('nt%')$Twith )ðtransient_internet('Žà-signed.python¾W.net'¥©c@xt =…²._create_un¯3ed_!(~7`h = clvÀ.HTTPSConnecV} e, 443,ÈJ{= ‚"×est('GET', '/"VÀresp = h.get LonseÇM.clo>ð.assertIn('nginx', DL`headerèjrver')˜&Vê@ªðsystem_must_validk'dðtrusted_by_default_/(¡È2# D´ settings: ?1 a k…sfrom a X1 CAz-¤8w"3wwwoL.orgk4 :( Xhð1J�nt_type =Ò-M-h¢CÃtext/html', e„_OgoodíáWe feed the se„sß$asïaâl}BSSLC}ú (ssl.PROTOCOL_TLS_CLIENTSaEqual(I1xt.«qy_mode,ÆÏŸ_REQUIREDEúcheck_hostname, True;oSload_t1locÿ!s(t£v_vjdotnetL  E¼B/xtHW_string) #:f[{ /ba aa "CA"À that is unróelated to the server's cert ¥import ssl0supõ.requires('network')$Twith )õ"transient_internet('self-signed.pythontest.net'):G…c@xt =…R.SSLCö (ssl.PROTOCOL_TLS_CLIENT…>ñ .load_verify_locations(CERTZlhost:`h = cl·À.HTTPSConnec8¾ s, 443, ¶= [ñelf.assertRaisesÑúSSLError) as exc_info×h~×est('GET', '/~"a_dEqual(M`.excepÈ .reason, 'ñ IFICATE_VERIFY_FAILED') �@def ¡-�_unknown_+(j´Á# The customLq isn't 2mñdefault trust bundlei»t�6Rmake_°Ã¿ ò#',÷.Ò¥¡+� /™FPgood_ÌOnamešr(valid)› Aatesè >�;Â/slÆ:Âÿ µ´öddCleanup(h.close1ó·nonexistent›Àresp = h.get Vonse(H i# l$9Ú%¿status, 404´/ba1doe·"!:Dfakehýê$Cs';7²Certificateà Ô@5q# Same _åexplicit checkìF=TruB*)ðwarnings(('', Depre÷cationWarning)): ðh = client.HTTPSConnec1ù ('localhost', server.port,AL ƒcontext=€, check_R¥name=True)Müwith self.assertRaises(ssl.CertificateErrorÄö.request('GET', '/'X0# WZ |õFalse, the mismatching is ignored˜¾.A1 = C'¿ up",wsÏs(('', DepreŒ†Í5hS·nonexistent^Àresp = h.get Vonse(HI.cloh÷aEqual(8¶status, 404Rc# The •+'sTS settÉðused if one isn't pZEd to¶+# ö.c̵ øA!¿Þx5Qk£`# Pass[ ,toDð should overridefW#ý$'s­tE¬ÑKCò@unittest.skipIf(not hasattr(É;, 'Õ/')´b'http.7  Z“availableó@def ~Å_ì(k‘0# Cæ� invalid 9) À$ðfor hp in ("www.python.org:abc", "user:®Zword@$"mN€ 3ÐI‚OURL,ã\, hp)˜R, h, žÿ("[fe80::207:e9ff:fe9b]:8000"S“/ "70", 8‹8 0443 _, 443H Àwww.python.oÿrg:", "www.python.org", 443), (2Dð[fe80::207:e9ff:fe9b]�”PàQß÷¾)):$ùc = client.HTTPSConnection(hp)+ÿ self.assertEqual(h, c.host( p(ðport) class RequestBodyTest(CCasež0"""ò cases where a r5ñ includes a message body.""" ² def setUp(´TZ.connöõÖ'example.com'Ø9�.sock =  ßFakeSocket(""4¦ýget_headers_and_f³áf = io.BytesIOÑ„V.datamðf.readline() # E the57üTparseŠ&(fXdreturnh6, f¼ test_list_~škõ.# Note that no content-length is automatically calculated for©÷# an iterable. TÒ÷will fall back to send chunkedCõtransfer encoding.a5= (ð([b'foo', b'bar'] €3\r\nfoo 0bar 0'^*((F)F‡1foräp, expec'"in ÐCwith� ubD(�˜àÁ !=A�2'')45=ÕÐ('PUT', '/urly6odyÿ7Pmsg, @=3*¶ƒNotIn('C‹¯Type', msg6LÁ8$£msg.get('T…#-E…S'), '­jë¸Jù", ì#()XîŒsmanual_k_k˜1SetVŒncorrectœ"so¶Ñwe can verify%Q# it €ðnot be over-ridden b-–e librarylÒr.ô@"PUTô«"£4 {"½‡ð": "42"}) mesósage, f = self.get_headers_and_fp() "ðassertEqual("42", mesF<ÿ("content-length")>ñ4, len(f.read())) jðdef test_ascii_body(z!):Œð .conn.request("PUT", "/url6"|£é'ªtext/plainñ_ðo_type(îsIsNone(„'�_charset1] k\ b'5', ^ ]olatin1^(O\xc1b­5b.f_bytese# b"Â`fÿ�__filejô addCleanup(support.unlink, fTESTFN4•with open2"¶, "w") as f’–�f.write(¹µIDÚf¡tUÙ3c Æ@Ý Gá5S# No 3#ð will be determined for Ðps; the üG5ðsent using chunked transfer encod‰instead.DÀl �=­~ Q�-�"$Jpb'4\r\nô0f _inaryÀsupport.unliónk, support.TESTFN) ªwith open("Õ, "wb") as f:.5ÿf.write(b"body\xc1"OrOöself.conn.request("PUT", "/url", f^Ñmessage, f = =úget_headers_and_fp(3&ó assertEqual("text/plain", R.Hïcontent_type()GyIsNone(:oharset5|zchunkedyÿ("Transfer-Encoding"‚NotIn("C­v-LengthQ·‚tb'5\r\n¾ 0�', f.readÈð class HTTPResponseT¢qCase):  def setUp(k)0d@ = "B°/1.1 200 OkjAMy-HµÛ: first-value\_÷fsecond-1UText"*ðsock = FakeSocket(†£ð.resp = client.Ÿá(@.†.begin()òÃtest_getting� —©uf%(''p¬-7, '&(, '”#.qÿ, 'some default�3 qnonexisRš_p@_str4}5sNo-Such=C', 'GÊ 2<¾“iterable_GÀ,[ÁÌ?s']#, 5 C(ƒ~2”ƒK?outE2.°! ž›Í?intÒ+H?=42˜%g`Tunnel\ s(b׳aS—_ÒA = (Ëð 'HTTP/1Ð.0 200 OK\r\n÷' # Reply to CONNECT —'HTTP/1.19 5JHEAD2ðContent-Length: 42j')) öself.host = 'proxy.com* àconn = client.“±Connection("B U5�._create_ 01 = 2ñ(response_text) ¤²def tearDowk!):$HZw.close(3^.*, dLh ¬ó(address, timeout=None, source_—›úreturn FakeSocketÝ , 1=A•[0], port&1]MK � àst_set_tunnel_\_P�_headers¤¢(÷pdestinaÎ ý(Ku = 8888|aõ' = {'User-Agent': 'Mozilla/5.0 (compatible, MSIE 11)'}M›.ÉÆ(b3ost�,<n —=2Tq�request('IP', '/'+±assertEqualL­1ock<,Óx9ÇT__PORT@é$, å?ost>�> >Tk„Øtest_disallow TafterPœp# Once ð ected, we shouldn't be able0º… anymoreÜD(Ø Raises(RunÜSErrorÇ7.‰k '; ÿLƒect_with¶ ñ°t(Yå0¼’SIn(b'Û / rNFdata¯Ê# issue22095à‘1Not_\Host:]:¬'b MMJE“p# This ñ«¨ðremoved when CONNEóCT gets the HTTP/1.1 blessing ñself.assertNotIn(b'Host: proxy.com', %ñconn.sock.data) C�def test_ðect_put_request(7!):(n.(ñ .set_tunnel('destinationn)0Q�'PUT', '/'*ÅQEqualzk±ChostÆ 9Ðport, client.E__PORT@;ŒCONNECT Õ}ý’CÀG‚E0ˆW‘_debuglog „ñexpected_header = 'X-Dummy: 1'K‘Ðresponse_text%üð/1.0 200 OK\r\n{}›'.format(^$Qâÿ#etžkevel(1M$t_createURion =…(¬Nn ô€with supôö .captured_stdout() as outputÑ Ù¥ slines =Fñ.getvalue().split(À'°O: {}n!, Dò) if __name__ == '__main__'½@unit¶.ó!(verbosity=2) #!/usr/bin/env python3 # -*- mode:a # Reó suite and benchmark@v1.5*àThe 3 possibleð0comes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3)UBmð(needs expansion) # # { —‚does not¿ð correctness, just speed. <ò # first element of²rtuple ieTregexÅ;x`second!òa # string to match it againstg:'ðcode will embedPDRKðinside several sizes�€padding,léQ how  " #}b0per¹£s on large¢Es. .³[í#+±mmon prefix?1('P(P|Perlœ ),!@# AlÖâ.(/)0·# Grouped a676<|Tcim7 q6u¬A)\\1ªéŠ'âÓBackreference­ð([0a-z][a-z0-9]*,)+@�a5,b7,c9,=`# Disa ¥ùfastmap optimiz1GL ðA few sets Ä ('Python', :), ð# Simple text literal $O('.*@ _# Bad; /.*}o# Worsx(y)= xð. with grouping ] # Test suite (for verifying correctness) #+h‹/ðis a list of 5- or 3-tuples. The 5 parts `a # coF1te %ò are: # element 0: a str{Pntain Ðthe pattern #t01: /ñto match against525÷expected result (SUCCEED, FAIL, SYNTAX_ERROR)t3¡ñthat will be eval()'ed to produce a tZÑ.G 0is ?Ân arbitrary ÏÁ expression;ÇšavailableC@varisG  "found" (Rwholeû), and "g1", "g2", ..� up·�"g99" coxy "en¾3eac9,ç+thŽˆ‘'None' ifAiÿ wasn't given a valueE [ErrorFPindexL1 oupjrange;aalso "w1s",„breturnv‡!m.R() (a‡)!4:¸ "!ofä4uat’¦?B Iü`two doù™‡ eØ÷‘reported.V2qregex i-€rto workÌl [4Ps can‚AomitQ uQs = [ ß1?P<�?P= exten_s"Ð('(?Pa”I² # Begins�wa digitB!BØn illegal chaŒ?fooM Œ J•R# Samú0s, $fLAform# Fw>a)(?P=T-aa 71=2!2›4ïi¡`ackref’undefined: ºKåK2'g1/),1"¿>?ÉÄoctal escapeÀ#\\j¹}ÊaerenceLÀ('[\\1]', '\ð21', SUCCEED, 'found', '\1'), # Character ('\\09', chr(0) + 'A %),< 14p/'au%a'+ð(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\11~à'abcdefghijklk �r+"-"+g1{ , -ksŸñ# Test \0 is handled everywhere$Q(r'\0 fÃsr'[\0a]e0~Xor'[a\0.^/qFAIL), ¥Éñvarious letter escapes"Çña[\b]\f\n\r\t\v§9a\bá $í a]Sò[\f][\n][\r][\t][\vÖ 9 $]õ# NOTE: not an error under PCRE/PRE:×uÉ^°YNTAX_ERRORÉËcA Perl 2 # ð c\e\g\h\i\j\k\m\o\p\q\y\zL!ceXPmopqy #¶Y0xffC@\377“ f%C255)3ö# new \x semantic®Ix00fXü» Uˆ"00‰ 01‰11…0ebO6', 16254·4¢4 ¥ˆåv§6ª5¬6¯õ÷((r"^\w+=(\\[\000-\277]|[^\n\\])*", "SRC=eval.c g.c blah\0n\tQ2.c"ßFG"¶óthat . only matches \n in DOTALL modŒ@'a.b/ acø'[(- \n.Ò*q'acc\ncN _{4,5}$  \r�sD(?s)¿’3%nb!'3 ª8È oÆ@Ú/'a¯e ')œ÷ Šñ ‘"Unãód right bracketA@ 7'›A€Empty paân70abc:Þàbc'), ('abpc', 'xbáFAIL), ('a?'ax_bx', 4ðxabcy', SUCCEED, 'foundiV cb/*Œš]*Â/07bc'½`/bb35++ 'aó f1ü nqŠž?ž1žd/• Ð?FàT^abc$SJ¯/f zKÈ /{¹ L—Lx/@+"-"-tu¤ X- a.ÌN-î \…Æ.‰0xyzd02 2@[bc]¬$l&bd#qa[b-d]e´b1 Nc%O,ceONaëfQa[-b].-Ñ?[\\/ñ# NOTE: not an error under PCRE/PRE:º#¼7[b-‡·YNTAX_ERROR} ]b‘¨! /\\ ?bc)! ( '�¦]¥]Ía.b//\\1^¢eTbe…1…@^-b]N0'adOdV1-1 Ô$^]OVmÀEED, 'found'ð , 'adc'), ('\\ba\\b'ð-', SUCCEED, '"-"-,/-a,Yy…˜xy', FAIL¢/yzxxU 9@x\\Bß6ö B>'*zT Å&Bxo a9a)B))S y|yB[ \\8:B bI, X›Pab|cdW9abc�Cfoun¿.‡/@()ef\d -p+"-"+g1 'ef#$žÄ@a\\(!'aM—a(b-Error·B\\(*= <‚/ab.(l0œ' b"2Q((a))Iw2'F-a-a£o(a)b(cAWbc-a-¶@a+b+ò_'aabbý3q(a+|b)*�H¯Ñ7ab-Q8+8$?8 )(2µÅSYNTAX_ERROR{Q[^ab]Å?cdeó0'7aC@©€a|b|c|d|i'e/(0)98=€abcd*efgþ  qãÍ€xabyabbb¬7©#ab21 0(:)'9?fcde-cd>À[abhgefdc]ijÞh£Ö^uT`, 'xg1&6'xyfS(abc|²¤ƒeÀ, 'found+"-"ð +g1', 'ef-'), ('(a|b)c*d0abcóSUCCEED, 'found+"-":Xbcd-b<ƒb|ab*)bc>?', =Vabc-a=¯a([bc]*)c*=.bc>S(c*d)A¼Ã2(\-bc-dL/+)L7_*)(c+˜!(-c˜Á[bcd]*dcdcde¼ fÚa?+4%'a EFAIL(�(ab|a)b*ÅŸ(a)(b)c)(ï#g1}34²(-b‹“[a-zA-Z_] R0-9_]!Nlpha`HÐñ^a(bc+|b[eh])g|.h$%.bh>�vbh-NoneEñd$|ef*g.|h?i(j|k)k_effgzMTl)-]/ijZij-ij-j®:', ó?bc+Ü0bcdG.rܱ) ($a)°Vèðmultiple words of text%@uh-uî Æ /' P, yea6\ *vq.*)c(.*>§ @x)W-ab-do0\\(I , !\\RP(a, b S#g2PIbP0[k],abíRa[-]?ÝLÞ4Yq(abc)\\AabcaÜ4Bˆ@([a-É5p^(.+)?B~A bAera+).\\1Ç?aaa!7a-aj,^(B #õ )c-+;FaAæ üá 8Àound+"-"+g1'ñ , 'aa-a'), ('(a+)+\\1'ó ', SUCCEED, 'found+"-"+g 9%).9/ba: btD)ba*u<’a|a)a\\1$³z î/|a>)+z'u[abc]*)öOcabc5 #-'®�)(b)c|abý°·2&Q-Noneø1)+x aaG! ùE[ac]=c= Gcx-cwÐ[^/]*/)*sub1/_Ád:msgs/tdir/ïtrial/away.cpp# <-G o.uð.([^:]*):[T ]+(.*)|ôtrack1.title:TBlah by[3G -d-d-cØ€[^N]*N)+O�abNNxyzN‚%-*I H(-N2¨×?'abß ;bcx¢è@w', FAIL¡dxyz]*) |'x-špa)+b|aa6'95aacñêñ# Test symbolic groups °('(?Pa_!aaY¶YNTAX_ERRORÃ-,9$idM-QCq)(?P=idŽa#� HŠGxG »éõoctal escapes/memory reference«@ M;ð\\09', chr(0) + ' “ B\\14U^ :3åaôð(c)(d)(e)(f)(g)(h)(i)(j)(k)(lV1~² defghijklk �¶1{'bc, -ks'ôAll tests from Perl+�,¾ºbï-x-  axÏb_xabcy7}Ðababc', SUCCEôED, 'found', 'abc'), ('ab*c, SUCCE. b/#7_ Ž)Q'abbb 3ÃA{0,}.8+5Õk ,10GFAIL…Kq', &{1¡;õT83."O{3,49#<4,59 !?Š1Šº ¹E{0,1ƒ3b] ²FL7€2_^abc$˜/f ¬K- /{) Ë—Lx'$†pS( a.Âv-x4W(ax#.?xyz0ò2X tPa[bc]¬$œ'bdöb[b-d]eL1 Nc%O,ceONaëA[-b].-Ç*a-\-a.Z¶YNTAX_ERRORe0[]b|! _e]º]ka.b/^âe”1eÅ1b1 Å@^-b]Ž0'adOd–1-1 OÀ]b]c', 'a]c'ð , FAIL), ('a[^]b]c', 'adôSUCCEED, 'found12b|cb//b'.6^/@()efrd -p+"-"+g1 6ef-d *aõ-', SYNTAX_ERRORƒO(*)b! $ /\\7 @a\\(5!'a­–a(b-Error³<*= <wa.(l0ôPa\\\\Z"'ab20bc)HGað'!1(a)C) r½2jVa-a-aR(a)b(„Afbc-a-cC@a+b+”_'aabbExb3P{1,}b9 **MBa.+?S/bc‹a(a+|b)Va»Au7ab-8B{0,} Äu9;+8$6;$?8 O{0,1æ; )(m©Q[^ab]v>cde<<)'HC@¢€([abc])* Q'abbbKê #äB:"'aB (cd€a|b|c|d|ë' ;Üe±0)™˜=�@*efgT  qeO@xaby&zX $b21 ÙÈ)E š7fcde-cd>À[abhgefdc]ijÞh @Ö>^(au tS(abc|ú— d(a|b)c[ YÀ 'found+"-"+ðg1', 'bcd-b'), ('(ab|ab*)bcaòSUCCEED, 'found+"-"+=Vabc-a=¯a([bc]*)c*=.bc>S(c*d)AOd', †2(\-bc-dL/+)L7_*)(c+˜!(-c˜Á[bcd]*dcdcde¼ çža?+4%'a EFAIL(Æ?)b*ÅŸ(a)(b)c)(ï#g1}34²(-b‹“[a-zA-Z_] R0-9_]!NlphaáHÐñ^a(bc+|b[eh])g|.h$%.bh>�Ûfh-NoneEñd$|ef*g.|h?i(j|k)k_effgzMTl)-]/ijZij-ij-j®:', ó?bc+Ü0bcdG.rܱ) (%a)² X2g10è7'((9#\\(,‚ò<# Python does not have the same rules for \\41 so this is a syntax error # Œ ‹4Za‹Q0!ùGû!ïq ?¶YNTAX_ERROR15?i)8 5ª96Þ‘0 ïrðmultiple words of text%@uh-u‘P /' P, yea6ÿ **q.*)c(.*º"abJ @³©x)W-ab-d0\\(I , !\\RP(a, b S#g2PIbó0[k],ab�Ra[-]?€Lýür(abc)\\],bcxn0[a-l5À?i)abc', 'ABðC', SUCCEED, 'found', 'ABC'), ('(?i)abc XB1OFAIL/AX _BX', <_XABCY� AB§À*Á2ô3"(YZ$*?i/BB8 vO{0,}=&+:·­+¬4Í QíD{1,}C#C1(O{1,3M'O{3,4>(=4,5>]?³"6´è îF{0,1’8l½Æ‹�7P^abc$¶Â3õ ¾!S M3‡ˆ T§ T„1 »|Y ,/a.d1úºX[2.*?d?XYZC ì.ÀOXYZDZE[bc]¼h!B­+BDb[b-d]em5¼"/CE�?ACEWVA 7A[-b]2-e-d1Ànd', 'A-'), ø ('(?i)a[b-a]', '-', SYNTAX_ERROR), '/]b%#kAðSUCCEED, 'found;DEFp+"-"+g1 :EF- *ao ?(*)o$#X/\\dAa\\(B A(D òÁšA(B-ErrorÇ@*A@Ae3\\(2(t4 {B\\\\h/\\j 60bc)Pg !abÓ% 1(a)KAM(2rZA-A-A+R(a)b(�E\BC-A-P1+b+°OAABBI€B7P{1,}b=! **U" Ba.+?[/BC—/.*6"_{0,5}: a(a+|b)ÎAG²;AB-º<@{0,} ?$+<(¾?(?<¶1O{0,1ö?Z-None7 )(·{ Q[^ab]Ô>CDE‡@ð), ('(?i)abcó ', '', FAIL), ('(?i)a*ñSUCCEED, 'found *�([abc])*›ABBBCD', 7p+"-"+g1>#?-C'F#bcHFJCD-AD�a|b|c|d|egE… w4!)fF7¼KEF-Etpbcd*efg=~ABCDEFGB !abg@XABYZ; t65 4q(ab|cd)¨kèjCDE-CDBÀ[abhgefdc]ijÑ>HIJD æ^} rq(abc|)e‡¢‹  d(a|b)c‡? \BCD-B@€b|ab*)bcÅ>ABCÞ"=ABC�([bc]*)cžABaBS(c*d)†MŽ2(K-BC-³P/+)P;_*)(c+ ! SÂa[bcd]*dcdcdš_DCDCD»A \C+Cb_|a)b*á #Ÿ(a)(b)c)(ÿ#g1•34£L-A-B£“[a-zA-Z_] R0-9_]ANLPHA„L ñ^a(bc+|b[eh])g|.h$).BHB•Œ{BH-None ñbc+d$|ef*g.|h?i(j|k)�OEFFG¤Q�)-aSWYÖIJ-IJ-J¶ã1è0BCDwARìlÄ(%a)ô 2g10 ;'((=#\\,BÀD, 'found', õ'AA'), #('(?i)(%a)p\\41', .o, FAIL4ñ!', SUCCEED, 'foundL!z yx'> =??:(P)QgØNE|b|cRC£RCRðmultiple words of text�iUH-UH'V 3+ðMULTIPLE WORDS, YEA:\ * ‹P(.*)cSYABCDE¿ r+"-"+g12)j-AB-DEO0\\(M , !\\P(A, B ›"g2Mo%B-vì2[k]e #”2abc2?BCD¬&\\¸#\\S€CD-$&-\\ë»YO(bc)[ý%\\ R›BC-$1-\\Bã`a[-]?c"Aš8Øq(abc)\\ZABCAB8I 6o[a-c]*9pa(?!b).†0abaó›  ad x_a(?=d1/c|30:b|5 (..I'aceàe–2*3/+?4ï(c|e){1,2}?|d)>A + g%c«p^(.+)?BrApÖyð! lookbehind: split by : but not if it is escaped!-.<IÁ¿1234abc5678|cvDv8uda-fA-F> y0123dñ# not an error under PCRE/PRE: ¡q[\\d-x]PÈ £Oâ(r'([\s]*)([\S3Ë€ing!1972?€g3+g2+g1&ð%  r'(\s*)(\S!s*'Q$Ïp(r'\xffrI\377�ž†chr(255)%öew \x semanticsJ)00Lö!# k !ø m5±t\n\v\r\f\a¨ C('\"¶(,, Hr9 IÔ09)+#101327fñ (r'[\t][\n][\v][\r][\f][\bxã_t–b@¥#ó post-1.5.2 addition+ñ# xmllib problem1Ï´([a-z]+):)? KY'smil7`g1+"-"Ê3´QNone-/”ñ # bug 110866: reference to{¶fined group†Q.)\1+÷uzTð1869: search (PÃðCRE fails on thiôe, SRE doesn't)h!.*—pabc\nab b Êð2468: various expected syntax erôrors (r'(', '', SYNTAX_ERROR),P[\41]"!#âUCCEED, 'found,ô# bug 114033: nothing to repeatPP(x?)?9xP+x'Põ"5040: rescan if flags are modified inside patternj€?x) foo n?foop rö618: negative lookaheadY°K/, È d/[m3y“30748: ^*yí be an error ()^*ýt[Ð3283: minimizªH„ problemKð "(?:\\"|[^"])*?"', r'"\" ÷ùko477728kP^.*?$ ñone\ntwo\nthree1JFAILW_83789W€a[^>]*?bZ a>LO9057#^a£×., IP70582ݼsted groupsSÁ^((a)c)?(ab)ða•M’g1+"-"+g23¹QNone-&ab,a/erÆ€ (capturà�Óin assertions2ð'^([ab]*?)(?=(b)?)cu ab™��(DO!(b)C,OÇÐclass Base:  æx: Any = 15.0 Õ y: int = 0 ¥@dataclass¥ C1(Base):KzC1[x5\@o = D%()Dñ6self.assertEqual(repr(o), 'TestCase.test_overwrite_fields_in_derived_¡¡..c x=ïŠ, y=0)')„/C1‚L0C1(€~_, z=1„?x=5 K‡5†Adef WMp_named_Œ(ä 7U: strÚŸc=C('foo'ä c.8#, (<ñ# Make sure the first parameter is not · 'D%'.=ösig = inspect.signature(C.__init__’Yõ= next(iter(sig.i&s)+fª#No­{, eó# But we do use£q if no s¼Uºmxn<3æŒ/YÙ,‡0ÖŒ_compare†C# En àat order=False !vdefaultÖK0¹pêF7(fj? C1D úfor cls in [C0, C1]/Qwith ú0subæ‡(cls=clsx\' `cls(),a(�+|pidx, fn€õenumerate([lambda a, b: a < b,ö: >=?*>>+O= b]+Â[idx=idx0 4hÿRaisesRegex(TypeError-U f"§ðsupported betwee›ñstances of '{cls._…�__}' and"Álðfn(cls(), cls())3 õ@dataclass(order=True)5 C:7Epassöself.assertLessEqual(C(), C()I'|Greater*Rð def test_1_field_compare(@)‡â# Ensure that ºñFalse is the default.VµéÝ0W)ox: int"hÚF1F úfor cls in [C0, C1]1Pwith æ÷.subTest(cls=clsöŸ'tFpcls(1),b'(1v-16Not404²pidx, fn¶õenumerate([lambda a, b: a < b,Tn >=?*>>+O= b]a‘idx=idx0 4žÿRaisesRegex(TypeError-Uðf"not supported betwee›ýstances of '{cls.__name__}' and"Ál fn{(?0)) /Q[Œ1!(CjC¸ $±) R€(!¦á™y'|S,‰ÕosimpleÔgâyç9U YHúK50, ­ œ�×Ð14, 2 7 71fn|:"01, "Ÿ/wBÀambda a, b: Ÿa <= b, ÿlambda a, b: a >>+o= b]):ÿ with self.subTest(idx=idx0Â4ÿ assertRaisesRegex(TypeErrorîUý*f"not supported between instances of '{cls.__name__}' and"Álåfn(cls(0, 0), %) 'õ@dataclass(order=True)* CWex: int$iy for idx, f×Ë enumerate([õ=4 7k 7>%éD(T(fn(C^ )]<û Î$!M61))B;p1), C(1¢6-6lwl q?ó 7qE;Ý;10, ;›§1-q0Ýqñdef test_compare_sub00es(Gœ1# C$°isons fail 1@, ev±f no fieldsd›Õ# are added.¹}* B­iš87C(B²yFpass*±Óø(fn, expected) inß(üà False);x LH , y)êÅ$PEqualÆ B(!WC(0))Üý ÐÀe([lambda a,Ï b: a < b, “lambda a,6=7">6#i= b]):¦û with self.subTest(idx=idx(Ù,ÿ assertRaisesRegex(TypeErrorMÿ!"not supported between instances of 'B' and 'C'"–Iñfn(B(0), C(0)) âðdef test_eq_order(çA # ðÑ combining eqh-.D\por (eq, õ, result ) in [+#ƒ(False, ª'neither')'ýTrue, 'exception)"PÎ?nly'.X'both$]÷ 0eq=åâ=+Ù$ifü(==´ ]*0 CValu1ñ 'eq must be true if ‚1 is'‹a¿@dataclass(à ›/2/ C¹%MpassBOelse7‹ ‡ƒ „¡ Œgš0þ.¹€NotIn('_ÿ_', C.__dict__)k??lt_?*e?*g~+g~*eliYfc)<`#<ß Û<Z#<x W×ZNü]#?À__le__', C._¯_dict__) ÿself.assertNotIn('__gt__', C._?#e?_else:˜“ò False, f'unknown result {Q!r}' Dð def test_field_no_default(â)i¡@dataclass8& C$‘x: int = Q"()gQ3÷Equal(C(5).x, 5%Wwith *õRaisesRegex(TypeError,ƒXÿr"__init__\(\) missing 1 required "H÷ "positional argument: 'x'"…Cî UR¦ = object(nm<pU=ZU@Is(Cy%¾†c = C(10Š6µc9"<ð# If we delete the instance attribute,"`should"An se+F P3.udel c.x•1Is(’Ë%!C(k '¨¿not_in_reprø4K=†LÜ×O•™rñ(c), 'TestCase.ÙÜç..C()'pÝs å®yн?, 2Z NÁEy=20Å ÊcompareÍ.0ÅØle#, \'=4Yª?�C(), C(0 (Q1, 10-1-4NotX3,46Y,&‰0èFChash\rulesH # dö all 6 cases of0# Ba=True/Q/NonedH4# <#Pfor (@ _,-*,Ãu ) in [/$(G.ú1 '�:' ).+5+À' ),  p(False,  °'absent'), +2Tru4+2Non! V+V{field' �)]:�ðwith self.subTest(hash=³_, compare=)<Ôð@dataclass(unsafe_;=†)i-(. CF‘x: int = ¸(s{!, Xí_, default=5) eáif result == 'M'r1# _®ò__ contains the�.Y¥*±assertEqual.b(C(5))¢n((5,))û*el˜™T‡° is not preO1 in£¢& /se�f'unknowne{mB!r}'Œðdef test_init_fC_no_³(BHP# If *=ät and noá@ val%2theøÏ• won't be£,# !†instance%ª7� ˆœlÅ.÷NotIn('x', C().__dict__-y�oy0z(£6t'"10›»z»0¼)-ïDvarsïó {'t': 10, 'x': 5, 'y': 0}ü g|_marker+5str1  Œ8z: 5BreprzµöAthe_Zs]6s(CG#‚!ò is a tuple of 3 items, each½¹ # Ìöin __annotations__¢n3IsIÁ(Ž,iŠ@for >‘ Ä R°(type(f), FGô*Ën(f.name, C.­&27len­O), 3. ×3[0]o6'x'– ` 2Í,22M�aattr(C£–\ª ¸ŽKW-Àthe_fields[0“].repr) ÿself.assertEqual(the_fields[1].name, 'y'2�type, stdòIsNone(getattr(C\][False�Oinit-[True -é2ézé?2].é ¾5hasè?z')»?2].èW¤2ÑÒ‚def testÂp_order(ã!): õ¥@dataclass& B$( a:Æ… = 'B:a',bbc5c' 7v7C(B� ^7C:bCÈ «3[(f¡òf.default) for f in ÅU(C)],†_ b[('a',ã)(@ ('b(’( c(B:c')])DC(D:C#D:OB:b'º;E(DyEyd^?E:d.E…ó k dCâCÙ«_UsÙñ# We only have a , ,³ibute if a )† value iò# specified, either directly or via aWV withM.a^–= object(ó xex: intR¯y" =}(Ù= ^'#z:v$ =ç GtG¬G=100©fc(ÄxÄ*y*¤Is (C.z,£Ä{ŒVC.t, Ÿódisallowed_mutable_ÍàFor the known ótypes, don't allow mutable default values. ñfor typ, empty, non_ õ in [(list, [], [1]),7>ÿ(dict, {}, {0:1}9¢set, set()v>)]: ú with self.subTest(typ=typ)(Å@# Ca5òuse a zero-length10-]ðassertRaisesRegex(Vd_Error1RL f'®`{typ} ¤yfield 'á6ƒ'x is no ?ed'ú?¯@dataclass`n Point:@ x:H" =I- Jp# Nor ab-a .`’y`Xy`¢c‘Check sub ® also failÁÕ1Sub @): pŒS"ì$.*�='>"„c'"z“J HzÀæ/()Á@Beca…@thisË0a C˜äVar, it can beÖÖÊè/ CÂ%z:hp[typ] =Σzx£ Kódef test_deliberately_i_ s(êd# If aT* isÐin the known 5 ofS3# "ñPset),0¶n it's okay¤�M‘ ‡¹Œ__init__Ÿö¶v.l = []9à@dataclass  �class C: µx: Mutable õ # These 2 instances will share this value of x.8Tlst =O%()§o1 = C(lst2÷self.assertEqual(o1, o25ö1.x.l.extend([1, 2]?!P/, JpIs(o1.xˆ2.x)$ðdef test_no_options(\)[ñ# Call with data|&(),@)&¢2intz¶j &PC(42)£.42¡~t_tuple ñMake sure we can't be compared to a ;´ ²VPointý¦0x: ¶ yÈ#NoñI(Ø2), ÓE¦# And that´±°önother unrelatedzÄÀ)P3), CÁ#3)Á5”BTestà1som^°the problem„�th named™0 do¶ehappen’# hereòm/3D¸ŠzËuÎÌJDateaByear>I^month#da5W6À3D(2017, 6, ~z( y 3D²2@ Àª/# 6funpackpô§ò RaisesRegex(TypeError, '8'5c£x, y, z = Ÿ�(4, 5, 6‡aõo|4¡same field1us isn'tF@# eb¶Â‡*v1ÇàE = 0U¿¯ 0 " †00, $),=v1(H@func|p_annota ‡SIbdummy #5and×6öuse as a default0FøEpassògf = F(šå‘validate_@K(clsãø# First, check _Áö __, even though they're no½h4#  ½à self.asser÷tEqual(cls.__annotations__['i'], int) ¯self.asser< j<?str<!k<F:!l:Ofloa´"z>™complex) õú# Verify __init__. õsignature = inspect.^9 ×ù# Check the return type, should be None.�‚5Is(g.AÆ,= Ësêeach parameterbsÌ7terb/ªs.values()Ð!� = next( s!ð# This is testing andó ernal name, and probably 0n't 4*ed¬Ìw.K''ƒ ¤ 4 â2RiO.RIs ÷.LDbpdefault1CPŸZemptyÈyùOkindBúPOSITIONAL_OR_KEYWORDR†'j"”.¬k @# DoA for2ÿ since it's set to MISSING+2glÞ„ ñRaises(StopIterc,%,ƒ6s) Q¥@dataclass÷5 C:‘ i:: ij: str†k: F = fÀ l: float=÷field(default=None) ºz: complex=+õ3+4j, init=False) 8÷validate_class(Cõ # Now repeat with __hash__.?R@data;ñfrozen=True, unsafe/©-5 C:CÁii: intij: str‰k: F = f‹l: floatóJódef test_missing_”f(self)Ûó# Test that MISSING works the same as a ?¥ not beingâÏ# specifiedv)WxW ‰’Ûºõ.assertRaisesRegex(TypeError,j°@r'__gs__\(\) ß 1 required 'H÷'positional argument'Y€&C(þ÷NotIn('x', C.__dict__Ö²Š<D¸_<$%¤D%D%Ý�_factoryå-Gí^"# øíÿ (which is really3Fo, too)93=Aÿ},óU¾q1DreprfÀ selfó.assertIn('MISSING_TYPE object', repr(ñ')) def test_dont_include_other_annotations(self):37¥@dataclass& C$(ei: int$r2fooR0 ->! 5&‰return 4;™@propertyQ?barQ5;Ò3èEqual(list(C._ø¿__), ['i'])9`C(10).ÔO), 4)obar, 5'\i, 10¦0pos¦"itî8õ# Just make sure it gets called½¹U%__o,__q¥öraise CustomError(ÚWwith hR,'s(-SM#C(ñ «dU = 10ç@Ã"if¥0i =EUFè>Y # f:-in²á, but doesn't ~Ö. This is jusUñ# checking thatÍ&õused correctly.7C(5gP# If ðÐe's not an __�0__,n¡ woŽ3getXU®(<f=False ¢ÿer# Creatþ"e i¨7÷ö¯ : ÁxÁ? = \$þex *= 2i­z†C().x, 0/#2$4ÄD# Maïù÷if we're frozen,¹ ca¹)se7¯attributesÈFO=TruÉ &A=FÛ�InstancerE_ÜaÒCsupe*çH!):i�G0 by2Fault28BPÚ|@&*¦!(BöÀ deû f __post_init__(self): u.x = 5 öassertEqual(C().x, 5)$õ# Now call super(), and it will raise.S¥@dataclassK C(B–/de»x.è¤Wwith ÍR”Ûs(CustomError{'C(>À# Make sure I-I1 isõõed, even if not defined in ourä1# ç "p.KÍ'QGtestÌstaticmethodÅflag = False~À Sex: int7my@€ -¬ Ð aR�nonlocal « ?v = True¯Ù(&)<¦c = C(3, 43 (cbc.y), ,-y_`Ó ~iÀ ¦ÿ‚ƒ¦;® �;cls'(Ccls.„ñjC(+l>aÈÀnáL_varàØC’âVars are ignorÅ_7ÿ, __repr__, etcÈ °�Q = 10³O4z: �Q[int]"0$w$+20$t$3$s${P = 4$‘¦5· ú(c), 'TestCase.y!.<¦ÿs>.C(x=5, y=10)'Sòlen(fields(C)), 2)�Â# We have 2 +” £P€C.__annoò–ons__), 6Xu# And 4zsOŸc.z, 1000ÃPc.w, “$ 0t, “$ !s,“$…C.z += 1¤ ðÀc.z, 1001)  ¢c = C(20) ÿ self.assertEqual((c.x, c.y), (20, 10)/0c.z#/01$ ow, 200w oc.t, 3$ As, 4$Àðdef test_class_var_no_default(Ú!):)í€# If a C+³Var has no .ñ value, it should not be set on the f.QQ@data& Cuy%x:ue[int] /¢|òNotIn('x', C.__dict__)+ç¶�_factoryìat makeã˜sense forÿ•to have aLe. When¤A# wiÀcalled? Call-@yourÇÂ, since it's)V-wide.HwithmõRaisesRegex(TypeError,w9@'canžÀ'ôB§« ¯› = field(tC=int¡7 Ð#¹¶ ¸´BU = 10�è4C3'10vrn =V\x (nfrozen•Make sure›òs work even if we're ?ÅÖ(V=Trueúã5int=Éjy: intUz+"0y$w$[ `t$[OE5º [ûrepr(C(5)), 'TestCase.nð..C(x=5, y¶']Alen(U0s(Ca 2)• B# We¢2€sâ ¬O6Æations__), 5Wv# And 3ïNÒ® Ò"Õñcan still modify\—‚õ 's only instances that areµ-# œ…C.z += 1$Ðself.assertEqóual(c.z, 1001) †c = C(20Ðself.assertEq6ð(c.x, c.y), (20B)/e S�c.w, 200w ac.t, 3$®ðdef test_init_var_no_default(b!):(Ùó# If an InitVar has no .õ value, it should not be set on the class.QQ@data& Cuy$x:te[int] .¡VòNotIn('x', C.__dict__)+å´�_factoryêat makeá˜sense forý•to have aLe. When£A# wi Àcalled? Call+@yourÆÂ, since it's'V-wide,Pwith *ðõRaisesRegex(TypeError,w7@'canœÀ'òB¥© ­› = field(sC=intŸ6Þε´ ´°AU = 10šæ C '10 sok =UYw # ”¥int = Noneõ‚bZparamÏ, -�D__poš_�&, E §bf"Ax is€ G# 7x =M"*2*½iG Çê¿· O±inheritance÷ñ# Note that this deliberately–s%a )A neeZo¯$# ‰ 0À function ifi­¼”^q# It c©1jus«qused inâRrived˜@, asâgwn her¢"JBaseŠex: intÃÇpb*ìñ# We can instantiate by passing`šP, everEoughf"# ^ûÜþ@b = ¥(‡2)µðvars(b), {'x': 0}C) ¥@dataclass• C(Base):1iy: intö init_derived: InitVar[int]e;±def __post_3�_(self, Cbase K yB0S.x = +< ’,y,#y ,]šõc = C(10, 11, 50, 51)NióassertEqual(vars(c), {'x': 21, 'y': 101}Uè0tesÑfault_factoryïÖ“# Test a õ that returns a new list.Ž« ¥x¥!y:L¹ = field(deœ=iÀ>!c03 ,c1 gc0.x, 4"Vy, []W#?, c‚ IsNot(c0.y#/.yFõastuple(C(5, [1])), ýƒ ashared:†ol = []•R�ambda: lš�—AÒvarious other¸f flagsŒo# reprŒ!ñ ,[o=Falsej€0(C(a'Ð_Case.ÿï..C()'R0C()H&Ùe# hash €(unsafe_G=Tru«Æ úNú dý_([],)ÖS( 7())Ö#Ê¿ (see also B�_with_no?k  û(Žõû~•# compare£;^¦qC(), C(ÿð def test_ódefault_factory_with_no_init(self): Ã# We need a 0 0õ a side effect.0$•= Mock() ¥@dataclass& Cnuûx: list = field(®=b , ¯g=Falsefó# Make sure the >¼öis called for each new instanceÉUC().xªÓ.assertEqual(†.M¥_count, 1)0> 2Æ“def test_»§@not_oÿed_if_value_given´±that we can^Ó if it's beenýÞ Æ*/inÅó÷ ¹ at¡am has aË•function,v"# Ô3notÓF,Ö is specifiedëª è ¶C(10).x, 10 &`>Y~derived,ÖSee bpo-32896¯=Foo±?dicìéYwBar(Foo}2y: I1K P0Foo¯O, {}vaœ&yÏZµzµpæ ®6Baz®côõintermediate_non_5¹QTest Ø an$9 Xfdefines�# annota:ps does /(p&s.kùA6int8ƒ?B(AÏ(`;C(B;z ;¯c = C(1, 3ô (c�bc.z), ,‹r# .y waOXializëÁö RaisesRegex(AttributeError†¶q'objectÒDno aC'ì6c.yéP# AndÊ’we again Íu a non-#C, noÂ… are addÌÀ class D(CG): et: intµd = D(4, 5)òself.assertEqual((d.x, d.z), ,!) .ðdef test_classvar_default_factory(L‚ð# It's an error for a C>ãVar to have a @¡ function.pÈPwith W£ðRaisesRegex(TypeEY,/3t'cannott¼|'¸BQ@dataé ]* Cf0%x:Ùã[int] = field(h$L=intP5is_n DqqNotData; |BpassŸ†*iFalse([/0)÷*¥,œa53())Ãy uxÛž8D1Ed: C5qeI†c = C(107Gc, 4¨k;TrujC )c)“?c.x,U?d.d+W4d.e~àqhelper_À s_ƒóœ_instance¥ò # Check that we can callÀs() on eitheÏ4or OÀÑ# and get baQÆe same thingí%ç�y: float5ùD(C),Á…C(0, 0.0ª,PexcepÂ" ¹P is rÒPd if �ÏUed a 5 or¯%# 4  #& 'RWtype € ü0î´0C: ¡�{FC}dG(ùnasdictÃQBasicsÌ(ð ), it should return a new Gfionary¯»+ΩÐ, 2) ó! self.assertEqual(asdict(c), {'x': 1, 'y': 2}) 6 A/XIsNote/�c.x = 42o¥/42¦ vIs(typey0), è!) eòdef test_helper_•Ð_raises_on_cl$ s(ù!):4 "# *¡() should 3a on a 4… object.3Q@data& CW[ex: int$yHwithÀR®õRegex(TypeError, 'q§ instance'ÃYÅC²\>?intl ­copy_valuef3+öList[int] = field(default_factory=listûÅinitial = []“c = C(1, /4d =c( Wod['y']@**„e{@–.append(1/jëc.y, []˜ lnestedù“jUserIdËZtoken¼vZgroupW U•name: str¤TBid: ƒ1u =q('Joe', ¦Id(123, 1)Nu 5d}3': R�'id': {'è2['ß}9î{4u),Fu”Qu.id.I? = F){'� 2ÂI(ÿbuiltin_containeríÙ*GVô V@ pusers: -[ˆï^ _Tuple_.`_, ...eODictd-B[strÞcaü@Alicþð1) b = óUser('Bob', 2) ÷ gl = GroupList(0, [a, b]"t"PTuple#(#)#d#1DicEö {'first': a, 'second': b}5ðself.assertEqual(asd>€gl), {'i0ò0, 'users': [{'name': 'Alice', %51},ÏÖUS?2}]ªtª(UªP)ªdª§³Bù_ gA}}) ½òdef test_helper_ ð_builtin_containers(8!):5ç¥@dataclassf Child(,’d: objectt?jParent@cSZC‘ÉB(ˆa([1]))…EP': {'â0[1]‹Lo{1: 2}ORVfactoryK ax: inta´yyc = C(1j$Ö@(c, ë_ˆ€=Ordered= 7d, )ñ([('x', 1), ('yÖ]”JŸIsNot(d, €…c.x = 42èÁD/42Â`(type(Ç<tª*q# Basicg‚s for as)ñ ), it should return a new ..C"E = 0N&ÆG² K‚ (c$O1, 0âA-Ûc1%=y /42pÁr"),]þª�±_raises_on_Öe#ÆÂ4ð on a class objeSct. ¥@dataclass5 C:+ix: intyõwith self.assertRaisesRegex(TypeError, 'qº instance')l¥astuple(C)p]?Qint) `ódef test_helper_Ð_copy_values(ئ6+öList[int] = field(default_factory=listýÁinitial = []²‘“c = C(1, /Ct = Ä&(cÛ¯Equal(t[1]?(_IsNot(�axg–.append(1.g�c.y, []• onested�jUserId_Ztoken¼QZgroupçW U•name: str¡T@id: ,%Id1u =q('Joe', ¦Id(123, 1) Nu 74t, KE/Í5u),%uwQu.id. E = 2¶ wH €?2))Ä ÿbuiltin_container`My°ÊGö‘ V¹@Ípusers: -[ˆŒ^ TÍ_.`_, ...eODictd-B[str~caœ@Alicž±bvBob', 2fgœJ§(0, [a, b]"Ï"à#(#zQgd = #Ÿ"ö {'first': a, 'second': b}X˜Pgl), E6[('Í,¾]|GtG(GîGdGÓ PÞ$('¡}H9À cla·ss Child: ¥d: object ¥@dataclassz Parent@cSZCò self.assertEqual(astuple(C(‰ ([1]))), ( U,),))qAc{1: 2}D GHódef test_helper_„�_factory(d)Î÷C$9ax: intby¢NT = namedõ¶'NT', 'x y'âžgnt(lst„M°return NT(*i¦c = C(1, 2ECt = ×A(c, oà6=nt)ì ‘ t,bN&�IsNot(t,_ :…c.x = 42®š- 42éaÁ Is(type(t)Ä)vOí�dynamic_³œ_creationípcls_dic¦‘{'__annot)¡s__': {'x'ÔB, 'y %},ܦ}0# Cnae the .3acls = ·”'C', (), „ÂC¥Make it a † F61 =G(cls>$vAcls1hH$ asJ\#),þ1ü#2}cc Ï_using_fieldoFŽc¯default=5)šÎM1(1)˜5˜Üinit_in_orderƒßaø¹–b2 = yM`c: lisI—† , ›j=False>d> 2e�o/=4df24¬1cal’%[]êßbsetatt<,Ã{, value¤?�.append((ë(,CC.__QS__ = qÑF0, 1â Ãp('a', 0/³?[0]- b'O!, ¡à[1]) sóelf.assertEqual(('c', []), calls[2]) s.d.3.ÔNotIn(('e', 4[X f*Q[4]) †ð def test_items_in_dicts(š!):#¬¥@dataclass& C$(ea: int$ðb: list = field(default_factory=Æ, init=FalseÆ>c> 2dƒ o/=4de20xf = C(0[0# Cÿ à&î’�'a', C._F&__?*b*AT @In(':' “0C.d6ÆHTH9e, #�Instance&`#c# ¨9c.a`DHAHb‚ñ`IcI…L ¼d' d¼­¡alternate_†àmethod_construW À@# Si˜@__poí÷nit__ can't take params, use a Vy5# w kø. This is mostly an example to showE0howit8¥technique.&nx¹7¦@»<ðfrom_file(cls, Gnameè*´# In a realÌp, creatSnew ië ~;  and popul/@'x' y4¡tents of a}ò9Pvalue†œ] = 20`¹return cls(.ÑF)F C.‚û'[÷ƒ').x, 209! §P_metaõ_°RM8“sure the ' 8qread-onEd ofÌæ# zero lengthùiùPñD(Ä„s(C)[0].“Ž!?len4 ‚Wwith mðRaisesRegex(TypeErr_or, ù'does not support item assignment'):Iñfields(C)[0].metadata['test'] = 3 /@def _0_)×_mapping(selfZó# Make sure only a *ô can be passed as Lhãõ# zero length.Pwith i.<÷rtRaises(TypeError€G@ÊUclassB* C‘i: int = ã(—2=0)$Øöan empty dict works¬}yu5{})¶óaFalse(¡ ´0ŸEqual(len46, 08`VRegexe‡k „_ non-‡H ÿ: 10, 'bar': '42', 3: 'three'ªz3zâ8â–7, 1¶<½!],¾y39î</O(KeyŽ0# Nª¶xistent key-ÖòUbaz'] s¢z)ocustom0 Tr%&,"<úSimpleNameSpaceÃy�__init__�k, **kwk2 __·Ç__.update(kwç&P0getAS S"ifhª== 'xyzzy'�Qåreturn 'plugh'ØsgetattrÆsƒ(œ3len˜’K ì"__4ë©- ”g(a=10)`�°Û� 1^ðself.assertEquaól(fields(C)[0].metadata['a'], 10) õwith self.assertRaises(AttributeError):07\5b']'õ'# Make sure we're still talking to our custom mapping.?‘OEquaÏPxyzzyÓ‘'plugh') Cðdef test_generic_ý clâ s(\ÑäT = TypeVar('TBç@6UDÒ LabeledBox(Ga7[T]S*•ontent: T=l;ò: str = ''¸"Xbox =c&42®¼©Rbox.ck/, *~,x1y±# Subscript¢�he resulùöshould work, etc±PAlias¸Fist[ b[int]]Ý •œextending“S“&S'ÿ¬ FBase¦<, S©x£By: S²ÀDataDerived(eë-, Anew_0õ 0FF[strAAc = %P(0, 'Í#1' 2 Ïastuple(c), ;òÕ7Non†Ì ÂÐlmethod¶.breturnTyñ no[floatög10, 1.© ê'c.Œ).p¨2ÿlynamic²O fParentQN ÆChild = makeƒ!('°', [('y', T«ñ 'z', Optional[T], None)],ÒXrbases=(™…7], –ö , namespace={'other': 42}VZ1Is(�Hƒ(1, 2).z‹‰0… 31, 363c3� Æð# Check that type ai!es„® correctly‰”T[ ¶^éFx, 1³{0MRO0oluœi Pr¢.__mro__, I", ™”“, object)ˆ¬mìses_pickleable´åglobal P, Q, R”ð@dataclass Ð class P: ix: intyE = 0Q@data@/ QNõ field(default=0, init=False)ViRiÉList[int] = oÖ_factory=listnwq = Q(1e.y = 2�ñ samples = [P(1), P(1, 2),7a, q, RRµ[2, 3, 4])]BBfor F3 in sÌ#Pproto"úrange(pickle.HIGHEST_PROTOCOL + 1)=Èòwith self.subTest(r=!, ^=?CBnew_.3 = ~Tloads‹SdumpsXQ)8C‰³assertEqual5F.x, f/.x=y=y=DIsNo;9˜F = 4Õ†another_., '094v< ERy) Å3FžðNoAnnotation(unittest.CCase;@def _b_}Vout_a:-8"ŸõRaisesRegex(TypeError,23’"'f' is aßö but has no type …"�NYCTfC!) ›÷)_b›_in_base(‰…B…f†|ªFr`# This‚ still an e¾ñ: make sure we don'tGq up theBÆ,# ­ù@the 0§.24I8;C(BìÀ6U_not_ÿ Îa# Same,ާ Ìu not a DÜÁùEÀ  ñ"'f' is a field but has no type annotation"): 3`# This<ûstill an error: make sure we don't pick up theE g0 in&É base class.2Q@data K C(B¦­2f =ÞR() *ðTestDocString(unittest.CCaseF“def asser,óEqual(self, a, b'eð # Because 3.6 and 3.7 differÔñhow inspect.signat!5orkÈñ # (see bpo #32108), forðtime being just comparehm withGöwhitespace strippedF¿.ÖÐýa.replace(' ', ''), b!) b+Ð_existing_doceñng_not_overridden("ºŒCYñ"""Lorem ipsum"""xdbx: intŒ Î0C._“I__, H À·_ýs²%Opass’bf˜OC()"�2one‘�%$’_x:int— 2two—(&˜·yÏ« ?, y²3hreK´@à z:irÇ, z:str€ _ï�_default$+O = 3¶!/=3ª__none¯(¡Union[int,4 (None)] = ÅN@`Type]= Ù BlistÈ(@ListÇ]´:¤ (ð_factory(self):  ²@dataclass ! 5 C:õx: List[int] = field(default_factory=list) 8õself.assertDocStrEqual(C.__doc__, "C(x:X#=)"G€def test1Òstring_deque_�b)©ÍF«Ácollections.B©k_with_/(¾,‡šÝ/ � ÐTestInit(unitœ.CCaseŠ´ base_has_i/ îMB½f;_/,__ H….z = 100kpÉð# Make sure that declaFS thisê÷doesn't raise an error.F� The issuJPwe ca6”override ¸r in our],Fö but it should be okay to add?�to us ifEC6 ha� # ¢l¥û#(B˜ –x: int = ?•c = C(10)¯f¼¶_c.x, "óNotIn('z', vars(c)¿o …€if we do>ú0an !a, the ñߎï# gets calledö(Cf=FalseÅdC1<#z#0ýÍ 1_noÓ Ñz¼ i» ¨tC().i, †ƒj)2…J%efª Ð ’Ui = 3;N¥3+N@writéÒ dA# If(Û5has�P, use`‘no matter)…value ofŒ!# o&=.!= :Jí寭;, xp'•x = 2 * xB  3)i6<ž)>Truä©À__init__(sel‹f, x): åself.x = 2 * xõassertEqual(C(4).x, 8) %õ@dataclass(init=False)* Ctex: int$Ž`def __B0__(yª-5ªb10) …ðTestRepr(unittest.CCase„ _r&…¡è¸WBÜ%87C(B_cyV = 10`@o = xQ˜.–®Po), 'Ðâ.Æÿ..C(x=4, y=10)'ÀbØ;D(C ·'0,Ž?D()� oD(x=20‘ EYE½ •i^¹C ECEpassAú_C.D(0ý&!i=‰ˆOEKEC.E(ÔÅ/noÈ # &2 a )‘with no _-p__ and RÉ.ï,(èãAIn('¥>!es�¿ÀÂÅ object at',˜<›g(C(3))ãóaòR™‘^Ú V$¡return 'C-–'Þ3ƒá,/ìjU±overwriting× wƒ# If the5has€, use itamatter)…value of™"# &.ª"&ÎþÜþ$x�xç¿?Tru¦&¨YO*©À_(self):  ´return 'x' ð self.assertEqual(repr(C(0)),)ð ) class TestEq(unittest.aCase):M@def p_no_eq(Xk#?2 a Lñ with no __eq__ and eq=False.N4Q@data0()" C|.ex: int$„Ü#NoßÚ , Lf = C(39ec, c) YÎ/anÎLáe4aw, otherh%êe == 10½ ÝûC, 10ádÉ¿overwritingÒcIf theÒ3has€, use itàamatter'…value ofˆ # ô.Vð$æï´"3kO1), O%1;‹ƶFTrueXÏN4Ï 4�ñÏ¢CÐN5Ð 5�Ð Å�OrderingËôfunctools_total_o:lvUthat 4.4q works úBthis8î /ùPwOlt__. ‘# Performªýõ "backward", just to make…ì�# sure Ôöis being calledÞ*˜@R.x >=Á�ALess‰O, -1ç" Ð'bGreateÕ/, K$NÕ\ÙMþ1no $ ö ions are added by defaultâ(<òïb# MakeŠÐno order methóods are added. ÿself.assertNotIn('__le__', C.__dict__)/ t/g^g^Žõ# Test that __lt__ is still called+ö@dataclass(order=FalseÙ5 C:1 ix: int3defk(;Š, other)8<qreturn gB²# Make sure9S meth›?n'tž@o4øñtest_overwriting_JPwith WõRaisesRegex(TypeError,,„'Cannot t³e attribute…'Hò.*using functools.totalÁGing'À� .7Tru-#15A¤ 1Upass ÔKW”w�'Kw?e__K€°Kœ´K�– oK=½�Hash(unit].CCase�4�_unsafe_h-[ ¡«&=±À clawss C: ix: intey: strñself.assertEqual(hash(C(1, 'foo')), !) ?�def test_ p_rules(O)„#çnon_bool(value¨ð # Map to something else that's True, but not a H.}=1if X† is None|areturn:2I(3,)2J0ÿ\àÑ(case, unsafeó, eq, frozen, withkresult  <�.subTestQ=V=bI=eq,£• ƒ= w*2if “þ != 'exception'.¬Ì"&·@dataclass(±½"ŸÌM ÞkŽ_›,__Š( Ô ‹æ~Fpass‚«Ä# See if theÑ’matches wMŠexpectedAA_== 'fý$# ^‘ containso@func4¯ we generafjäoDIn('PÚ', C.__dict__u6:@sNotí(5[L] 6*eläßâ!istñpresent in our ˆAg!if1Ë?Not  ÇOnoneË0setf5¾”‘è :sa–'~ p# Creat&ç�õ should cause an Eéñ# This only happens > ==x?¼(æ­Ð0ð RaisesRegex(TypeError, 'CanÙõoverwrite attributek'´ƒð@dataclass(unsaÃfe_hash=unsa ò, eq=eq, frozen=?) �class C:!8Qdef _k�__(self)0 4�return 0 ZOelse@òassert False, f'unknown result {F!r}'Vö# There are 8 cases of`7# a=True/a˜ # 4?6ðAnd for each of the·´a different¹(ifmJõ is defined or not.'XÌ7, (¾,ª,^˜,aC_no_G£õ) in enumerate([fJ([5 ''O''),J^DJ(C”Lnone˜”JL 'fnH/ J5�JŸexception1S�SL¦9Sù#K], 1IRtest(ø ÷Ñ, ),?(eqN)\"j$zûrÏŒ_eq_onlyvr# If a ¾»0s _.%_,«�ñautomatically addeda0�# and se²W NoneÉðnormal Python behaviorCtA¡related toÖ‘ees. Mòàwe don't interX withFöthat (see bpo=32546).…@1[à classW C: ii: intúdef __eq__(self, other)8Cpreturn %R.i ==)%.iNðassertEqual(C(1), )%+No(E4)) )ð# And make sure things work in÷s case if we specify?õ unsafe_hash=True.¼@dataclass(%ª At6.0)™ hâm4), 2 Nñcheck that the â#esÿõ is being used, despite5$# e$/eqT#, .Ä{]J_3 and® 3)®3k ®1(û‡)“uÁtest_0_field¥€y¦afrozenrD Epass³*–(()sqv%1=xê 4  4, ê12223o@'®]x¨Œ_no_args€u# Test ,¡es with nofõ = argument. This exists to)#  at®{+ð parameter name†xchangedF!or²±non-default„Š’behavior 7!s,*&DìÂability keepMC’s}Fway.ƒ¥JBase>_³5µ<.6301PR# If Ë` or eqíANone³nx¼Ö value (do noµˆC any%ðe decorator). ð for frozen, eq,@base €expectedƒ in [ @(Non)ÿobject, 'unhashable'),2 Bi20Fal•d `.`Ò,0TruÅQ¾2^ð‰" 2d9È ö'`"%ðQ" 2^"] "?tup? -_- “¾ [.[,Q?, '‡ -Y-9]: 0òwith self.subTest(«=²=µ¦=$, µ= )):Sºý # First, create the class.+#if@ is ¥t and eq]aQ@dataR Q0 C(²Ÿ#mi: intB-el•† }(eq=eq)Kf�0 À‘C/se? F�1 að# Now, make sure it Ues as¬wÀ9 ==SÝ�c = C(10ÆHù assertRaisesRegex(TypeErrorÚo type'�Æ:(c)°PŸ ½ç'·Ü”aEqual(WÉo), 301a‚c’# I'm not�Àwhat test toÿ use here. object's ñ# hash isn't based on id(), so calling%/()C wo>ÿtell us much. So, just check the?€function¶Ed is³.2ðself.assertIs(C.__Ã3__,8-) @ý elif expected == 'tuple':*-j`Equal(i‚(C(42)),o(42,))j/seV»õ False, f'unknown value for¡$={«ð!r}' class TestFrozen(unittest.RCase)t@def "_f(ÊÙQ@dataM(!V=Trueà" CL1fi: intT†c = C(107fš0Xc.i, "Wwith 'rRaises(Î×InstanceError®}uc.i = 5§D k#€inherit(0S2E7D(CyÌjId = D(0*4d*s&qd.j = 6P·C ÞdÞÿ 2d.jÕD#¹Á both ways: › anWõermediate normal (non-§d2# š1and=Lout @": B_nonðmEÙ£‚5int’_RP in [&,º]ËI@.sub�(C=wcV $– ¤ ¬)ifmÛ Ê'`I¾N pas@/elâI)N$ý’Regex(Typø,,/ƒ'cannot ç 5â <p from a�zen one'wn{…?D(I?C*> }˜um‰ ™}'Àself.subTestþ(intermediate_class=K): Q@data0 . C4C}i: int 5 if ‹C`­I(C): passLOelse;^I = C}ýwith self.assertRaisesRegex(TypeError,hÐõ'cannot inherit frozen 6ƒm a non-Oone'jbn(-o=True)’?D(ILP7>“def test_©Â_from_normal(L?for«P in [•Š, False]�bsubTesty&ß^Øæ\j»Ø·9Šd = D(10 lÎ!(F‚rInstancÓÖ,rd.i = 5$0non4zen|derivedò# See bpo-32953.H]  7x.@yV = 10]=;S(DÒ vs = S(3.Úó¿Equal(s.x, ! 8y, qps.cacheŠþ“ð# But can't change the÷±attributes.‡Þ¸&1s.x´EI(yI 1Vc1 , 0)1i³overwritingqb° uses __setMÂ__ and __delY ß""'Cר e mÊŒ Èý ¶ÄÙ04ÿ (# Àwith self.asÿ sertRaisesRegex(TypeError, ð'Cannot overwrite attribute __delY__'):Où@dataclass(frozen=True)$* C9“ix: int,8defs[(selfw'Upass A�GFalsŽŠ†‚2setõ‚ß, name, value�¦ò.__dict__['x'] =-E * 2¤' as®òEqual(C(10).x, 20)Ë~Rtest_RQ_hashƒvë xê2Anye>ð# If x is immutable, we can compü@the �õ. No exception isÓ0# rx%d.1S(C(3)Ò mkdDing fŒ@an e¸OWwith 9ç@ 'unyÇ\ type¬P(C({}— "àTestSlots(unitv.4CasäŽosimple‰þZ ð0__sgª__ = ('x',$;x: ›ñThere was a bug waa variãPin a U%•ssumed toˆó# also have a default”1(of%.5ÿs.MemberDescriptorType)�Wûðr"__init__\(\) miss ð1 required posio÷al argument: 'x'" ^)C(jWÄ0reaÉö n instance, and assign to xØAc = Œ»r«c§&10ºc.x = 52 5œ''t†PanythúFelse’÷ A�ãÀ "'C' object¯7 noÀ-'y11c.yº»ãüderived_added_fieldðö# See bpo-33100®’T– JBaseü ZD¯(b ÕynžDd = BF1, 2× ù (dúqd.y), (,Ó± add a new :`ØU„3—d.z = 10 �x“Àset_name(selSf): ÷# See bpo-33141. õCreate a descriptor.vclass DJQðdef __set_name__(self, owner, {1$.! =#e + 'x'i#X5getSƒinstance]W4if %Ê is not None±]‰return 1v¤@ThisV÷the case of just normal2€ behavioo_r# dataE@codeMð involved in initializing f„@DYRCæ¥c: int=D()(Ññ.assertEqual(C.c…x, 'cx')íÑNow test withàfault value an±ðit=False, whichÏ5theoã# only time t=ñreally meaningful. IfªXusing>bKthenö will be overwritten, anyway´0�field(deî>,—‡KHts().c, 1næhV_non_ðEáé# PEP 487 sayspö should work on non-Is /# ÝrGÞHj”d€q¤lookup_on_3u(&75J*FpassBHd = |}°n attribute¯è� , ²Ftypel(d.]ƒ = Mock(>bË# Make sure -fcalledSiC dT‡ é Œ.…“_count, 0¿Œ[‰0“D? -0is ¶;6?D()= Š =: 'ð TestStringAnnotations(un ðst.TestCase): ó def test_classvar(self): ð# Some expressions recognized as C9÷Var really aren't. ButFð if you're using strpannotatYù, it's not an exacA‡science.UQTheseÀ÷s assume that both "import typing" and "fromA *÷ *" have been run in this filx0forU@estr"$('u[int]',`C) *)V*Tx O&  .Î 0?strþ 56inga1 a 1.ï[ba 1ÈöÌñ# Not syntactic$Ávalid, but tÃOwillBš be treatss d '<Ú.H 1+*oPwith 7À.subTest(typ= 04Q@datat ÷& Cƒ0 x:F] 9…# x is aÿÐ, so C() takeYO arg5?C()NñAnd it won't appeaðAthe ¤ð's dict because,fdoesn'··#YapNault¹@ðassertNotIn('x', C.__d#__¢°?isnµ¢VÏ%'t'&LW1t?var€ $M Êx1o˜Ç ¼/esã–xÆ?Varj 4d6À class OC: ½x: typestr ý# x is not a ClassVar, so C() takes one arg.=òself.assertEqual(C(10).x, 10)lðdef test_initvar(4)¨q# These$ðs assume that both "import datacžÕes" and "from‘(# " 5ö*" have been run in this fileÎ4for "õ('InitVar[int]',e Z( )( Q)Ru M% /.}¥|4?str vi5 i 5!.[ji 5# kåñ# Not syntactically valid, but tåOwillBä be treated asæsª ‚Ká.é!+M­€Pwith Å“.subTest(\= 04@¨ þÕ ¹'$an(µ‘doesn't cGž a memberCÇÀÿ RaisesRegex(AttributeError3Û  "object haU$ aK_ 'x'"@lC(1).x0/sn5²VÁ4'dc& x¥Ces.x61 etyping+x ý�Hr L`there ´™K. xMHñòvar_module_level_² ä$ .Ï ;ð1 from . óimport dataclass_module_1_str from . -2)V.žor m in (€,”,>œ. *2>2|>)):Sûwith self.subTest(m=m${ð# There's a differenceÎ�how the CQ‰Vars ared@ð interpreted when using strÖannotations o‹;¡# not. Seel›2ed Àís for details.|úif m.USING_STRINGSaÍc = m.CV(10)EOelse7 5Yý assertEqual(c.cv0, 20) cdOInitc‚;þIV(0, 1, 2, 3, 4)ä©‘field_nam@Â('iv0', 'iv12/3'ˆ¨´R= > B�ôRaisesRegex(AttributeError, f"object has no a 6 '{m?}'"pt@# Si34s is an Õm, it's;3UinstaMò10get³F(c, {š&P# iv4»Ñabnormalf”þ In('not_iv4', c.__dict__EÅ9I=g#­¾ˆ_so it‰ò# won't exist on��ó?Notö! ’ „TMakeD¤ (unittest.CCasei@def €_simple($ CÎEake_nO('C'.¿[('x', int)( B ('y(Tß(default=5))]; öñ space={'add_one': lambdaˆ:v.x + 1} aC™ï.¿@(c.xJð y), (10, 5)) self.añ6ssertEqual(c.add_one(), 11) def test_no_mutate_namespace(self):(,õ# Make sure a provided 0r isn't G%d.8uns = {}õC = make_dataclass('C', l ¿[('x', int)( B ('y(ÿ, field(default=5))]; ÇE=ns)Œ'.aH{ns, {})>=bas/Úu Base1:PØEpass&2&3+ù ¼1s=(©,°&2)vc = C(2ÿIsInstance(c, C$e(2e4‰ž@N\ ‚ x:K(„?�} „ Pwith ïŠ÷RaisesRegex(TypeError, 'required positional'"| Ï?1, ãišà²Ñ(c.x, c.y), (¡ �init_var(<éÕPpost_!7, y obx *= yÌg+_ šÏInitVar[int]Ë ¶ ¯E{'__î@__':ÿü}“ ˆF2, 3Tp�ÿvars(c), {'x': 6},Alen(€2q »÷¼ƒOCr„O, 10ˆ k('z', 6Ý]?20)E ]-m1j 1jÀ) seó lf.assertEqual(C.y, 10) -se"qz, 20) #ðdef test_other_params(5!):!GõC = make_dataclass('C', $ ¿[('x', int)( € ('y', CU�Var[int]Á6 z6ÿfield(default=20){ ]d ¦init=FalseMð# Make sure we have a repr, but no 7.I �NotIn('__"Æ__', vars(C)_.+Z +Z‹qrandom à ö don't workŽWwith e÷%RaisesRegex(TypeError, 'unexpected keyword argument'ó 7[| # xx)‚ø­no_type©‘Point', [‘nF'z']vÖc = C(1, 2, 3([¯ðc), {'x': 1, 'y':6'z': 3}<ôC.__annotations__F¿'typing.AnyQ  ~@)¶@}gØ J¹á Q¸?int  þH¯qinvalid´‘_specific  j�for bad_Ëo in [(Å ·?, 4( ]ͽ …subTest(u= ê 8tA2r'Iò È,: 6LUf ['a',]•Q# And¯ )qthings ͆no len()í"ÌKOfloaÝ ¯lambda x:x L]0hasYðlen\(\)'):  ðmake_dataclass('C', ['a', bad_field]) .òdef test_duplicate Ñ_names(self):*.Afor ?3 inRV'ab']"&Pwith :‘.subTest(4=N,0ðassertRaisesRegex(TypeError, 'F¹ ™ ®/d'QU‚!,  ckeywor%@for'SAsync Await sUÃmust not be Ás >Ÿ†.’} �[Ì'ïnon_identifier$ () 0x,y*02@3ÿlittle johnny table5[“be valid Ü/er9eŠ-=2…2AŸunderscora �# Unlikeæõdtuple, it's okay if ׉es have¦V# an p. '_Š_$'aafunny_Q "ñ# No reason to prevent weird >Ûxs, sinc´’types.neweÆ allows themÂ�F÷…a—J= NKC = :/X 'b2­Ô‘Equal(C._72__, Ç1) P +ÀReplace(unit˜.CCase™°xÀ @dataóclass(frozen=True) 5 C:ix: inty§c = C(1, 2Lö1 = replace(c, x=3ÿself.assertEqual(c1.x, " yav’def test_È(Q)¸Q@dataÎé2züö = field(init=False, default=10ê7t310) Ú1P/ (cP€c.y, c.zAt), £@, 10&0)¦? �‘!c1B1C!1.D@3, 2@D·Wwith Kö RaisesRegex(ValueError, '5'µú 1·, z=20, t=5Sg;b „ £ò# Make sure the result is still ˜.0µ FŒtInstanc%ò"cannot assign toq[ 'x'"5=F = 3Šž„we can't�À an attribut¼pat does"eexist,´ó# if we're alsoBging on; 8È. Test thisCðhere, because settA‚Cs on.# i+s Cð andled slightly differen ’from non-s›sx4Typn@r"__–€__\(\) gyån unexpected "Ó#ÿ"keyword argument 'a¸ #í3a=5 å�invalid_s__nameñLíŠË S?JzJzmÅ Doobject@U,'°CKÞˆcÀr, 'dataclas÷s instance'): ñreplace(0, x=3) ÷def test_no_init(self9¡@dataclass/O* C]ex: int$(y� = field(^ó=False, default=10‡0…c = C(1)E‚c.y = 20ª#ô# Make sure y gets theOv value.@D1 = öcö5]è÷.assertEqual((c1.x, c1.y), (5, 10)Ÿ´# Trying toUæ y is an erroryWwith aÐRaisesRegex(V¤E06, '­·h2, y=3,b;]æ?var;CJçVar[int] = 100ß d2†V¿Is(c.y, d.y×#gEËu: can'tè·säCTypeã1r"_X __\(\) got0"¤Ö÷"unexpected keyword argument 'y'"¨DëÒ 3x=5  ##9þ‰ í ##: /ty: InitøÐ ônû4, 2ø°# In our caKõ˜$anf–h no-opS<ó$c,â (cc5ðk\e7ò if __name__ == '__main__'@unitN.ä() import enum 0insÓTpydoc ?ó threading from collections Z²OrderedDict$k’Enum, Int ¡Meta, Flag Âunique, autoF$ioD‚StringIOdpickleðdumps, loads, P3ingùòHIGHEST_PROTOCOLA?0supudatetim\ ¢delta try^ô�except Ifx)"ó = None # for ¿…sWÌ€Stooges(&XPLARRY©Iã@CURL2ƒMOE = 3 �E–¢ion as exc”` =Õ~3Int!o(int, †À MOE = 3‘ except Eð ion as exc: IntStooges =R try¤class Floa# (f r, Enum)%DÁLARRY = 1.39U@CURLE2.72ïMOE = 3.142596š yœ#ag¾_(Flag”|‘އ d†ò # for pickle test and sub2sG0Str6M(str@0'ac¢ñs only string values'­XSName(Hêò BDFL = 'Guido van Rossum;‹2FLU#ßBarry Warsaw'÷ mðPQuestB=$('ð', 'who what whenÿ re why', module=__name__)z T ~tAnswer |z him this tzïthere because'm E keTheorykkðrule law supposip', qualÝó='spanish_inqui „ ^„]?docG`Fruit(J`TOMATO�.ó–BANANA = |2CHE§3€Ë‘pass defÔ_àð_dump_load(asserñó, source, target=None�#if@ is \”-# =>¬Iórotocol in range(HIGHEST_PROTOCOL + 1`I‰(˜ s(£$s(”pO= $))©)ß8ionßS, objz«"Vwith °YTÎÂTobj, ¶¿" ðTestHelpers(unit!.4Casñ# _is_descriptor,Ssunde d  ~ì 4W(self¡~6fooË´/ @attrÄõ('__get__','__s —delete__'\<±obj = foo()–‡.<ºFalse(enum.à(  7tŠ , <, 1"#lfY?TruX �&J "þsû a_(=_aaèÐ wU"))—ýSaQW #__k _ak% 'à_a_', '_',  …'__', '_8): ,ñself.assertFalse(enum._is_sunder(s)) 2€def testd7elfPàfor s in ('__am…a &~v7TruuY!))t,Va×aÎ !__bñ{+%',MQ#3®! #ðs class TestEnum(unit7.fCase):P`setUp(!ApSeason(D¼©SPRING = 1שSUMMER = 2©AUTUMN = 3AWINT.4‡.w2 = «v–ÿKonstants(float,  E„….7182818^D PIˆ‰.14159260TAU7U * PI’s5 = ˜‘Grades(Inu 1UA = 5U‰FB = ùCš $D� UF = 0�x2 = —ÿDirectional(str/ÅAST = 'east'^”"WE,wePNORTH5Znorth62SOU8sou°‘7 = ºñfrom datetime importœ €Holiday(+ÙqNEW_YEA“{013, 1,³ÀIDES_OF_MARCÏ2'*¯·l3 = ¯“qdir_on_™ OÉ1 = JËÿeEqual(�‚set(dir(5*))H2['_vs4doc umembersPodule dh'ÓÞÆ ¹ ¬+']€ ˜OitemF.Œ ü` 'nameÖ_valueÕüwith_added_behavioráúu2@this.;thacRthese:oseI^@wows é´¡return ("W'Â! I'm %s!" %nìÊm QSq, d sÀ__', '__doc_ô_', '__members_Rodule@this%»these']), )õself.assertEqual(3Ðset(dir(Test.[)Q%…['__clas”2doc‘7__mŸ@nameŸAvalu owowser©�ódef test_dir_on_sub_with_behavio@per(Ñ!):6Âõ# see issue22506ª° SuperEnum(8<vœinvisibleY!ñreturn "did youoMme?"ibb(q l¥sample = 59Ê›!Su].E >£�enum_in_u.SUMMEReAUTUMNë0], ¨sL‚for i, sB0in (rerate('` X P H�'.split()ÁRr¡&(iÒ ½£e, getattrc‰<9çb#No~?e, &™ e.A} mµDIn(ePÚ•Is(type(eV+�InstanceXª1strZ'bC.' +¼f9 ÔT1repO#''.formapXX |ë_d‚{Å‘˜´¦'7 �à, 1) w÷ith self.assertRaises(AttributeError): õSeason.SPRING.name = 'invierno',w\.@valu]!2 Uð def test_changing_member(Á¥¡" =ÙAÅ–(`WINTERíËreally cold'œa;œ_deletionŸbclass —W(Enum»¢YE = 1µ1UMM~2©AUTUMN = 3¬4 BD‹spam(clsxFpass1X€True(hasß(¼0, 'J5'))z3delÙ.IOFalsJ3¨!EN5?DRYK5™7i’Ö�bool_of_ 5_Empty4¸Án·Y(;/))tIŠo Countu…zero = 0} on² » tw(¸Bfor r2 in` cÂ2 Àinvalid_‰s7FVYÜò_Wrongòámõ9õc@¶_create_= 1IhAïget_mixins_ = ÔK€find_newjÖK1anyj9ñ %€# plain Œ˜Ðs are always Eï"_Logic"!tr² 36f÷1 = ÿM èW.DT$P%õ# unless overriddene²AReal_à(Enum):  Átrue = True @falsF ùdef __bool__(self): Apreturn %#•._value_)*9p.assert|°(RealLogic.’(‹)£*ò# mixed Enums depend onv-in typä‘class IntuQ(int,: Í�E = 1¸ÞyE = 0 ÎXÍ (S!) QaÑtest_containsC™‘Season = w:�Y2In(’.AUTUMN, 4BwithF2ðWarns(Deprecation7ing} dNotIn(3[G'¼'bëSval =Ô&(3Ö ?val<POther1( æ on¥1; two = 2x`ÿGK.twomÎomemberÕUð Raises(TypeError, lambda: 'B' inµÏÞK3F2žM4ŸcomparisoÔ § Ö ¹ƒSPRING <"q.WINTER’ÅU*2> 4­J»„NotEqualy„3, 1Ü/{OPartv2 tICLIP…J¯BARREL = 3�{.h5*!< T¥Šóíenum_duplicateË ±mSUMMER+b = FAL&E = 4‚ANOTHER_ y£lst = listÐ/ôñ TIlst,[ãv#.È +¯Í+¾ +]�#Is®.AðAUTUMN) óself.assertEqual(Season.FALL.value, 3) /oAUTUMN1 #Is]S(3), h9a010oSPRING0Àrname, 'd'5àçä [k for k,v in¬ð __members__.items() if v.h~ != k],J'K'‡rNOTHER_Ã',!) ?ðdef test_duplicate_b(}!):#¨Pwith À÷Raises(TypeError+/ûclass Color(Enum#ured = 1b�green = 2�blue = 3K4ÑD®Šrw% 9wÀeason.SPRINGS))) õ!self.assertEqual('{:<20}'.format(Season.SPRING),9@ 9;str=1)) ?’def test_cÐ_enum_custom(�!):'[ðclass TestFloat(fg, Enum&*•one = 1.0<{two = 2�_~_tk, specTB…return '„¥ success!'jµ EA9o.one),JŒF}wIsValue¡‡, member© }ɾ.Þ  .v\” 2dat}o¡Holiday = y  Äc'{}', /ï.IDES_OF_MARCHŽ >:?,Ô€*^B.>B.šÆ*_%Y %mK,Do %M:00Jj ëÅÕX”KonstantsZI‹q \1O.TAUT7 È9 D: <: 4: nÞ8 ?5.2:$f8ÿH=)E·g²Lhash§dSeason¢6Īdates = {}[(ÿ.WINTER] = '1225'&aSPRING&?031&3UMMLO0704LaAUTUMNLF1031&HaEqual(¼©71, '6!) ª1intǽfrom_scratc)÷class phy(int, Enumî.api = 3ZÅtau = 2 * pi«ÐTrue(phy.pi <]O.taužœinheritedÄ›0Int•Ÿ5ass„3Î7ÌTOfloal0n….1415926Ùv6zx FÓz3­|;~ÜG1strÚð?strÕð6'Pi…}F'Tauò z 1Strx¡v7tÎ5�ðdef test_intenum“(self): ÷class WeekDay(IntEnum '¥SUNDAY = 17#MO2BTUES/3DWEDN4CTHUR352FRIJ6RSATUR%7 Ùð.assertEqual(['a', 'bCc'][å.¸], 'c')?ôi for i in range(Aâæ)], [0, 1, 2])‰¤lst = list2f len(lst), b)1 '6, 7*Ptargez'°è ® €p`P' L v.split(l�, weekday"¢enumerate(3;, 1F5e =hiKJ »?e, # oint(e)(ee.name¬yTIn(e,¡&Zïlst.index(e)+1„ ïTrue(0 < e < 8WqIs(typeÑÝ� " IsInstance±?intV*Ù¦Àdef test_int¹¿_duplicates Y3TEU÷*RHn$Is£.�,.8^8ª3(3)d'4W kW0k,v7C÷.__members__.itemsm´Aif viP != k}'µ4', � Ûfrom_byÛÐ Isû‡Stooges.3 b'\x00\x03F¤big'), Int+6MOE!Wwith VûRaises(ValueErrorHs5s ¶Bfloa¸7a2['mÙ%']tAldunder@ASeas ¤æTTrue(º'¼, '__eq__')tPiteraÊ?_oruç{µšSUMMER = ŸAWINTˆÍšAUTUMN = µiSPRINGùä“êHRlist(ß-),[. #, ˜�ˆ]N 5Ÿreversed_> ÆOò.«)ÕP .ËÐ " %‚]% ùñprogrammatic_func:'¾Ô´SummerMonthÔ'Åöjune july august'K lsÇåI ¾! len(lst), i)5 +X, 3,  p�[8.Ú J.ç À.august],  Ylst, E )õ*for i, month in enumerate('june july august'.split(), 1):B\°e = SummerMI&(iaÿself.assertEqual(int(e.value), .#No1e& Tce.nameË€XIn(e,¬*ps(type(¢Ü!) úð"def test_programmatic_function_string_with_start(6R— = Enum('>', €!, K6=10µ·lst = list(? w { len(lst), 45 +?, 3E p.[I.d J.q ~]ÆÛC0¦´Üÿtï0ÛÖ[×ß lyß&']Ôÿ@£Óÿ´*Þ¼2¼CÀ) seølf.assertEqual(len(SummerMonth), 3, # +se;!' [8Y.juneJZ.july�august],J>lst)'€for i, m²ð in enumerate('w j ]õ'.split(), 20):C´8e =ë&(ib ñïint(e.value), .#No]e& €ce.nameÌ€:In(M*ps(type(¢�!) úðdef test_programmatic_function_iterable(û-I� = Enum(O&'%'½(›p', 1), aly', 2 «J, 3)Ù]©lst = list³‹¶ Ýllst), çU5ÌÉ1äkþŸfrom_dict@€OrderedD^¸°ÿÿ Àth) ð self.assertIs(type(e), SummerMonth) )ñdef test_programmatic_function_:M!):/3E— = Enum('ð', 'june july august', JU=int)H·lst = list(? wÄðEqual(len(lst), 45 +;, 3Ô pª[I.ä J.ñ þ-],J>lstÆ€for i, m©î in enumerate([·.split(), 1¥¯8e =ò&(ia ð?e, #S.namešOIIn(e *�-À_with_start(Ñ­¨ !, U6=30½²ÿ?'30°”³Òßfrom_subclass¶ ?Inta¥ÿIW‘À self.assðVertIs(type(e), SummerMonth) def test_programmatic_function_type_from_subclass_with_start(self): H^Ç = IntEnum('ð ', 'june july august', sNA=40)“K·lst = list(? ð self.assertEqual(len(lst), 45 +;, 3$Œ pª[I.ä J.ñ þ-],J>lstÆ€for i, mÅî in enumerate([Ö.split(), 40)©°8e =&(ib ñ?e, #S.name›OIIn(e *ºsš1.__ðN.pŸ@propertyjÀhõEAE # ð () is updated to includeUF¸™type infofóð"{}({!r}, {})".format(7,ňN ;_<<å³iÔ4strÎS# str#ñnchanged, even if it relies on0l½() fallback-BbaseÕp_str = & ._ -__(!if c.__objfÆnobjectÆí›\©ö c+gÁ &#8ðsimplicity, we only de`fine oçperator that ù # propagates expressions%ù def __add__(self, other):&V¡temp = int)1) + 0 /Ñif isinstance2ø, NamedInt) andt ~‚ereturnF(t%ò'({0} + {1})'.formaµ“.__name__ç/),Mø)Oelse§ 8 7¤class NEI(k, Enumib__qual¤€ = 'NEI'Òð # needed for pickleàutocol 4h-úx = ('the-x', 1¼yvy', 2) ¤Ð.assertIs(NEI ew.«P1E¸Q(repr90x +íd.y), "ò1('(•0 + †y)', 3)"P´globals()['4E'] =òæ)"EI$%EI7NI56¦('test', 5j º9NI5!3_g¡_dump_loadÇ"ñ,, 8Y¡EI.y.valueo¡a3Is,CØ4)ÔÜ31sub€ñes_with_reduce_exу&oG(int¶  Ò¥¦ž0__n`»(cls, *argspt0 =  +;#pif len(?o) == 0·ðaise TypeError("[©½÷ must be specified¹Šþ$-Û ½/Q._intk = %¾@ = _ #O cîã_protojH1.__ ýX.z@_OertytÊoh ÿENE # ð () is updated to includebP™type infof²óä"{}({!r}, {})"37#Ï9 BF;u<`int.__åÀ)) û def __str__(self): ð## str() is unchanged, even if it relies on the rep.�fallbackO¯base = intŒ0 = &.™ (!if +Ð.__objclass__£nobjectÆÕareturn<0.__©ö c+g &ð # for simplicity, we onlyT in êe operator thaðù # propagates expressionsdž3add¨, other¥BtempV« +b(0 U ¹‘sinstance2ö, NamedInt) and it ] F(txñ'({0} + {1})'.formatƒ“.__name__ç/),Mø)Oelse§ 8 7@T NEI(¿k, Enumib__qual¤€ = 'NEI'Ò¡ # needed`pickleàutocol 4h-úx = ('the-x', 1¼yvy', 2) ¤žÐ.assertIs(NEI ew.«P1E¸(ñ90x +íd.y), "ò1('(• +Ç–-y)', 3)"P´globals()['4E'] =8æ)"EI$%EI7NI56¦('test', 5j º9NI5!3_g¢_dump_loadD"ñ,, 8Y¡EI.y.valueo¡a3Is,CØ4)ÔÜ31sub€ôes_without_directâbsuppor$’5~G(intÅ ¯á'³&ˆ0__nJ»(cls, *argsK)_0 =  B;#pif len(?o) == 0¡ðaise TypeError("[“§÷ must be specified£ŠèÛ ½/Q._intk = %¾1 =  #5O @ëIertyyò¼tR¡EÚ#E#”ðis updated to inûclude the name and type info ðreturn "{}({!r}, {})".format(7�(self).__M=__,B Q =<%Âint.__repr__†)}…def __st:‰ñ# str() is unchanged, even if it relies on0l½() fallbackO¯base = intŒ0 = &.™ (!if +Ð.__objclass__£nobjectÆÊ¨\© c+g; &ð# for simplicity, we only defin êe operator thaðù # propagates expressionsdž3add¨Ž, other)ßBtempV« +b(0 U ¹‘sinstance2±, NamedInt)îit ~S2F(t%Ô'({0} + {1})'& ä·ô)1ø ÓdOelse§ 8 £@T NEI(¿k, Enumib__qualÄ… = 'NEI'Dwúx = ('the-x', 1˜yfy', 2)ýÀassertIs(NEIúBew__†O1E“(Ì90x +Èd.y), "Í1('(” +¢–-y)', 3)"P´globals()['4E'] =å)"EI$%EI7NI56¦('test', 5j º?NI5! ¡EI.y.value6h\ñ_pickle_exceptionË.KñRaises, TypeError,x�CPg6ingG¾¡F1subEôes_without_direct£Ñsupport_using¬b@sG(intò ± „“0__n?»(cls, *argsKO0 = Âå;#pif len(?o) == 0q‡… ("[cÔ÷ must be specified˜Š6Þ Û ½/Q._intk=Ã%¾ð = _args  Àreturn self ™@propertyÐdef __name__(4)): >RP._int. %EOreprE # ð() is updated to include the Xé and type infof‹ð"{}({!r}, {})".format(7Ä.Ó,BF<%`int.__å)}%/st$ 3str#ñnchanged, even if it relies on0l¹() fallbacknã¯base = intp_str = & ._ -__(!if Ð.__objclass__Ænobject/{3\© c+gÁ &ð# for simplicity, we only defin e ÜŠator thað # úùagates expressionsdž3add¨, otherBtempV« +b(0 U ¹‘sinstance2±, NamedInt)îit ] F(txÔ'({0} + {1})'& ä·ô)1ø ÓdOelse§ 8 £@T NEI(¿k, Enumi`__qual¥__ = 'NEI'Dwúx = ('the-x', 1˜yZy', 2ê•reduce_exð[proto‡j ‘getattr, Ä1.__Ê1__,j.C)égÀassertIs(NEId ew1ðœ1Eý(690x +2d.y), "71('(þ + –-y)', 3)"P´globals()['4E'] =}O)"EI$%EI7NI56¦('test', 5j º?NI5! ©EI.y.value \ò_pickle_dump_loadqK,  4œÿ3‘tuple_subÉeþ` SomeT((.«4'>¡ # neededÅÜ‘utocol 4Ç-Pfirst¼@1, 'ôfmoney'n)`second*Ð2, 'for the swhow') ÷ third = (3, 'for the music)õself.assertIs(type(SomeTuple.first), a 8xInstanc;�second, tI7WEqualm¯,®@µglobals()['•F'] =£ùtest_pickle_dump_load(¸Úì ?Adef ?ñduplicate_values_give_unique_enum_itemsV!):<�÷class AutoNumber(Enum $\žÝ8ª»__new__(clsdQ¹` = len"P.__me”…s__) + 1µ-Øobj = object.\*.A_ = i $`returnO ¸\int__=„:1int"j/ËL bCVlist(‡-),"[,·.� ˆ]I—ÂgUO), 240r.^?, 34'Isæ9(1)²i)Ù‘inherited<€from_enhÄdØsNÒÔŒã WColor‹A�!re�Ã^greenÙJblue ïÞsA), [ b.red, Y O]yLsmap(int4)V�1, 2, 3]@Omixe=?Int@F)inÉ,«‡4objfÐügÀolor), [Coloôr.red, Color.green ƒblue]) óself.assertEqual(list(map(int4ñ)), [1, 2, 3]) < def test_e6@ity(J!):\Áclass AlwaysZ@a__eq__9w, other@%»return True\ÐOrdinaryEnum( >Ua = 14Ÿ é›H(), N/.a! ),ã,()Ñordered_mixinê¥#O#ÁÆ)/ge)1if ä!__XR__ isV. „_c>”value_ >=<H15éNotImplemented&ºtº]¹4ls] %r"L �% (a, e)% Páo †yred = 1S@greeŒ20blu(3Bwith¼wR&s( k�8”˜ œ@gren¶2åžï¤ oPlanetØöMERCURY = (3.303e+23, 2.4397e6xxpVENUS ,ü4.869e+24, 6.0518,REARTH,T5.976,\37814-0MARXYR6.421…l3.3972,pJUPITER, 1.ƒÚ7, 7.1492e7±aSATURN±‘5.688e+26±<268,1URAÞp= (8.68±5 L5559,rNEPTUNE„2024Xl2.4746,9¿mass, radiuß×$1 = |0 #b•kilograms± ´T# =] 6Zmeter3™@propertyI­âsurface_gravit£QpÂ# universal +úational constant (m3 kg-1 s-2šFGëš.67300E-1® �2G *Ý !/ â.êcCÁ8bround(.œ.è¯, 2), 9.80G A·?, (à)œQgnore¼Mžôeriod(timedelta, �À 'G'' ù different lengths of time&'6ùef __new__(cls, value, period):=nQobj =Xndelta.=)4!._Y2_ =b$u# =~ $©return objp_ignore\!'P¸* i|:rs(¡ÿfor i in range(13õ@ò ['month_%d' % i] = i*30,  s W5W JweekV@7, 'T /32«9daySj, 'dayP�OneDay = -1T OneWeek = ‡_M 2 = ò self.assertFalse(hasattr(C4, '®&')ˆ6?4i/óTrue(isinstance›.,Û =Ž.ýC is D/30Ù9T48A28) „òdef test_nonhash;(%ñ÷ class AutoNumberInAList(Enum'´Q¨ "�p = [lenP.__meV‘s__) + 1]š+ hobjectý*ÿÛáEColoÜ î Ëkred = á^greenJbluea¼pEqual(lP�H), [i.red, n k]Cenumm|Hzip(G,Ž+3)â©6+= sg »`.-1, [� 2)Is|(0 , F •ðconflicting_types_resolved_inJ©°LabelledInt¢`(int, á ¬{, *args%ÁÕ0, lX0 = &¤)in¡w�NDobj.OPÊ@˧  á’unprocessÑð1, "Unprocessed")  ò payment_complete = (2, "P# CD") 4øself.assertEqual(list(LabelledList), [é.unprocessed,  �/])h 9 S16;(1)€Gãðdef test_auto_number(ô%):›÷class Color(Enum&`red = @(™0blucVgreen5jymzf .rW b,š.TQ 3¿red.value, H -`.2Ý §.‚/3a?ame_¢ñ_generate_next_Àû _(name, start, count, last ‹preturn 2m¼¤_'red'’À' 3 Å''Ë�_inheritÓ€AutoName49ÚF±… ¹¦ýoogarbagËq¾ †š˜f-e1š�¯_correctedŸµ˜§ 2¼"½ ¾8tË@TÀlf.assertEquó al(Color.blue.value, 2) åself.assertEqu.Tgreen/13) 0ð def test_duplicate_auto(D!):#V÷class Dupes(Enumñfirst = primero = E“%osecondOthir† Ê[ƒ.p,�.XJ�], list(.R)) ÁàTestOrder(unitø.kCase):Ïsame_members… _od‘_ = 'red y ­'Q9= 1,9= 2<O = 3£Ï_with_aliase°wçrverde =Ê BrongD yå ò RaisesRegex(TypeError, '¸ ˆò does not match Z+_'Ä"ÔÆ:Ø +ÜÊ ùú˜ï_has_extra’„z purpleø÷ &:  -ØB … Oenumj¦c:*ÆK = 4¸3}@Àoes not matcçh _order_'): ûclass Color(Enum*:ù = 'red green blue'J+ == 14== 2HM = 3­purple = 4@verdV2 ÄðTestFlag(unittest.CCaseÔ0"""�s of the -as.""" bFPPerm(5ÖpR, W, XŒh, 2, 11; 2‘BLACK = 0ZD8ED hGREEN @BLUEc3PPURPL@RED|wMOpen¨OsWŒ)RWo)ACwCiR1<<19f@def E—_str(self$0 = . ²ÀassertEqual(="b.R), ' /')0W0W0X0X0AR | �i/R|k;D}OR|W|�5(0)²0² ~ªCd3Ý—3 Ì™(š WÕo <EXE'(~L�c(¬ ¬"0.RO›  'W2/WO2%ACd/AC2QRO | n%CE</CE<W<|­~r�CE|AC|RW<OCE|Rdr ä#~(¦"#_? %?±5?rep(>¸< O: 4>Ë 6Ô6OW: 26Àl(repr(Perm.óX), '') ñself.assertEqual(repr(+AR | W?oR|W: 6AJ‰�R|W|X: 7L6(0)…O0: 07~¼R7p39 õOX: 59 ä.~q¶± BrK87((~p«9qOpen = @  R#1.RO� Æ,W8/WOÂ8&ACpOAC: ý8QRO | &CEB¯CE: 524288 =WG|ÄJ9J~K:…CE|AC|RWG9ÒGIRCE|RWÒ9OˆR!~(? YZœE WEÍ2PŠÀdef test_or(’!):öẠ�for i inö04jb F�(i | j),K€(i.value )�?C1., D¸?CyIs(type‡tÎé DÆFi, i;Ç= … 9.î,P 3 ?and¡ARW =R.œNþ-RXXWWRX'Ä�s = list²ð) + [RW, RX, WX, RTE(0)]`oBZØY¢|(i & j)2& j­À óself.assertIs(type(i & j), Perm) �for i in: D?Fi, i;$?RWX& jRWX & LqOpen = s ‰Éa.RO & 2CE, ARO) 3Ðdef test_xor(<)Ôùd 1Åj:bgòEqual((i ^ j).value, i  > CªDª(^Î?(0)Š _(0) ^Ž+^…Ž&CEç"3Is(¶ 2ÀoinvertÃARW =õB.R | Wà-RXXWW:« X'î�s = list(VÐ) + [RW, RX, E(0)]}_~B¬-~iÁ *‡*~~_h‚f 9±4 ºØW˜~&7.WO™¢ 3 1WO|1kCE) & =HqÖOboolõf¼‹fTrue(f±�òO"D€¨fó", )¤ÿ programatic_function_stringå`Flag('Ŧ', 'R W X'»9lst„< z  len(lst), P)G.$<, 3–-Pst, [/".R-#.W&X]eN@i, n £enumerate(Ó‡.split()½Ç…v = 1<ö1-`.2.‚/4a}_garbag» 9R˜ðsRegex(TypeError, 'Invalid Flag value÷: .not an int.'): ûclass Color(Flag*vred = 'E'B#áblue = auto() ÷def test_cascading_failure(selfhƒBizarre…Qc = 3Ul‘4Uf = 6## OE.c | d ‚ñ.assertRaisesRegex(ValueError, "5 is õd validG$", O, 5)Sm2¦2¦S@1¦1¦S Œ¡duplicate_« ‰§Dupes(Enumuöfirst = primeroðPseconŸaÓ Othir†�qEqual([ƒ.p", XJ�], list(!)wbP^Émbm mÅmb ÀSrepr(�ƒ(7)), '<³.d|c|b: 7>'±ú@support.reap_threads¶ýunique_compositAñ# override __eq__ to be identity onlyS†@Testðp'onÍ3/twö·4Ofour+?fiv4?six3_seven@eighžxÿ{w, otheràpreturn ѱ'8%Jahash__LE%#0._vW_ ð# have multiple >@ads áPetingÀ 0leteûr member!’!seFset(aiµUFalse¾»cycle_enum(¼’nonlocal >6f:try7ûfor i in range(256R%¤U.add(u&i)­"�except E?ionm1ailÓ6TruÒ:9= [°À threadinûg.Thread(target=cycle_enum) þfor _ in range(8"]4ñwith support.start_ti#s(%):-hEpassõ# check that only 248 members were created3õself.assertFalse(^}failed,€'at leasj"e ž -S whillÔing compositeŒ'�þEqual(256, len(seen), 'too manyGÎð') class TestIntFlag(unittest.CCase<0"""“s of the 0as.""" èLSPerm(;¡X = 1 << 0,W1R2S_ColorTwBLACK =S0REDBP•GREEN = 2…BLUE = 4PPURPL@RED|zOOpeny)ROvWÅÙreAC = 3pClR1<<19i@def p`_type(Ù6M0 = . F™ 8f8/ öF¶ðTrue(isinstance(f, 0)b¡1f¦f, f.value)% VSA.W |\-.Xd;` 13hÙïÙ0Ù<Sa.WO | 1RW, f Û) 33�h?str b=AR 3 0W0W0X0X0Ri/R|k;D}OR|W|�8µ?8|R·5(0)3018181 ~ bË3Dþ3 3™(špWÕo <ð | Perm.X)), 'P£erm.-8') ð self.assertEqual(str(~(P)¡R | 8)), '?W|X9 (6(~04/R|6j6¦qOpen = ­  ¿"0.RO¹ ¸ 'W2/WO2%ACd/AC2QRO | n%CE</CE<W<|­!(4–|4p ~'C�CE|AC|RWm<M_CE|RWrQ#~(¦ST®E \E·‚'(~[ )¨àdef test_repr(²!):ƒ2Ú ( ™># .R¡< O: 4>\ 6W6OW: 26X6OX: 16: uoR|W: 6A1 | J‰?: 7L8Ço8|R: 1(ÌmO0: 0t(Í7O8: 87~æÛW|X: -5: j:3: Z?: -"¸W]ð}œ Cê­_-8: -> ²‹D1 ƺ<f-ô((~ô=9…Ô.í í#È< ‚,�ð')  óself.assertEqual(repr(Open.AC), '< r: 3>') 6/ 8QRO | 6&CEB¯CE: 524288GWG3|WOJ9J6(4)‡O4: 47~¿&RO8�CE|AC|RW~/-1CWCoRW: -2=�?-º¼ „ÆÃŒB~Q ŽQÑK/90ÖU((~Ž V5CbÀdef test_or(j!):}bPerm =€ �for i in 04jb ài | j, i.value  ÿ7 ;(<)0CsIs(typeD,Ê tÊwrange(8� “’ ‹ T5„È= Ânqj | i, sf ª(/k=£0)eaFY!Is Ji, i©$0$ 0ûH'â â ].è,u 3E?andFARW =xB.R | WN¸-RXXWW:RX'p�s = list(Éð) + [RW, RX, WX, RE(0)]}·BÿØY[8i &2& jY , 'i is %r­ P' % (¼) X(Y³a`0ÖaÖ ®À%r' % (i, j)7) ùfor j in range(8):*ðself.assertEqual(i & j, i.value T56)4=sIs(type>o, Permnqj & i, s5(/£=£0)£aiaº ]Y!IsâJi, i©$7$ 7ûHqOpen = K âÚ0Is(a.RO & 2CE, ARO) 3Ðdef test_xor(<-Þd 1 |1 :b x^x?^ jž³e(i ^ jÛ»CáD á«ÊF Î úX È= Ân2j ^F^íf k6k¨£0F)?^ 0" 0×"'^"&CE³T6f:tryçiU›range(256R%¤U.add(x&i)"�except E?ionmÓÀ= True û threads = [ Qing.T&ý(target=cycle_enum)4þfor _ in range(8"]4òwith support.start_s#s(%):-œEpassõ# check that only 248 members were created3õself.assertFalse(^}failed,€'at leasje5 -S whillÔing compositeŒ'�þEqual(256, len(seen), 'too manyGÎð') class TestUnique(unittest.qCase): Æ@def !_u)P_cleao'lf]@1_C+Eè ˆuone = 1/3ºtwo = 'dos' re^54.0noer(Ints^singlvAdoub2^�1rip3`dirty(Ž�#ðRaisesRegex(ValueError¤—res.*one'>w ÙKDqØ#OSW„¾ >Ï 'T".*s±.*turkey.*tU'iã™t ]—šM = 3ν 7\_name ÌÈoSilly(ÈÄÀo’×l.*\ovÕñ = 4 expected_help_output_0docÁÒ"""\ Help on PColorì¤module %s:š(#.-R | v , ©Ás=None, *, mC Ctype & =1) |\x20[0An mŒeration.ÐMethod resolu"q order:<›K¸übuiltins.object`ðData and other attributes defined hereo²Z0bluÓ<~.L: 3>]ƒgreen = '=: 2(6red&mred: 1$à---------------$ð' | Data descriptors inherited from enum.Enum: |\x20:Aname € The € of the 2Œ member.9Jvalu:;ê$ 7¶ùMMetaý"__Ý1s__NðReturns a mappingÒ'!->èMLEThisG‘lists allŽW�s, includiõaliases. Note that thisOi–àread-only view�ª„internalnöD.""" expected_help_output_without_docs = """\ Help on class Color in module %s: c(O)œ0(,$£s=None, *,C@qual`Ctype pstart=1PJ[ðMethod resolution orderÊ­ ¬+™übuiltins.objectÆ@ðand other attributes defined hereo —�blue = <ú.L: 3>]Vgreen'=: 2(6red&mred: 1$ ý$ô-) ÷ úŸ$ 7®â áðTestStdLib(unittest.€Case): K maxDiff = Ì>õ(!):+/Ä1íE = 2&B = 3K@def x·_pydoc(selfNÁ# indirectly'a __obj€¬r� if StrŠ ._ÐQ__ is°™+utext = @% __ªm0els PGW œ/s T“ =ÇuingIO()0œQer = ".£2er(2= -G. Presulö4A.get´‡().strips†€.assertE¬(<,1ê)Â0insgB_get(sˆÏpmedict((ãÀ ('__ûclass__', EnumMeta), q('__doc'ÿ'An enumeration.'0bmember[Õself.Color.__9Qodulel�__name__*wblue', \+Zgreen,-s±.__dict__[']1:red\?red)"va³j[\%))‹�result = ‘Ã(inspect.getO(6ÁassertEqual(l¢s.keys(), Vmåfailed = False„™for k in F: 6#ifUc[k] !=+:[k]'+fprint(vp'\n%s\nb key: ² ex"ed 9' %Ž>Ä('=' * 75, kúF[k],£$, #)XNp=''ž6Tru2if  ç€"("¹° does not e� Ãp!e ú‘ above") Ê“def test_ó_±2ify a_attrsý){Á# indirectly>a __obj;!__XSfrom Xö import AttributÛíE = [9=-(3='_•O¾kind='data'Q=‚defining4’=object, =$ŽvœtŸ˜xß�…µ…�propertyýî‡0 Š>‰‚� {}?', u0ˆ.UK |Í}>V~ù;C øv÷ ÀEnum, objectû =Enum.__dict__['name']),  Attribute(#þ='value', kind='data'5Dádefining_classp�, object }T~]�$ñs.sort(key=lambda item:. )0ñresult = list(inspect.Œ2ify•ü_attrs(self.Color)@påfailed = False‡òfor v, r in zip(Ç", Ÿ%):)3šif r != vºprint('\n%sð' % ('=' * 75, r,o–), sep=''ØM°6Tru¯2if  ‚""("¹ð does not equal ex_ edp!e ­± above") vô MiscTestCase(unittest. @def q__all__œ¶Øsupport.check$`, enummñ2# These are unordered here on purpose to ensure that declaration 3a # makäÿ difference. CONVERT_TEST_NAME_D = 5CBA ¿àis one should óo firstE7F{e0IntôConvert�c)_²ü_lookup_priority˜³atype =‰.n#._G(éË#'U’G ('X._ßð', '__main__')[__óF__==]�dfilter1ùx: x.startswith('Ò'ò # We don't want the reverse  L�vary when&r}ñð# multiple possible ¹ s ra givenKT. ItøgalwaysG reübá lexigraphicalTgÑUcase.<ÀpassertE°(S°1(5)9*, ÛAA') D–ÎQ—Oÿº&En!â¡has all ofŠ@desiaÒ2andÊs}.|sFÀ-„8Aâœ.íÀe.CONVERT_TEóST_NAME_B, 5) ôself.assertEqual(test_type.CONVERT_TE;C;'D;'E;å# Ensure that ®ÿ only picked up names matching the filter.û[5A for>v in dir5<!if4�[0:2] not=å('CO', '__')],w6 ¡[], msg='N´PotherÞ)n ‚ð* found.') if __¯P__ ==d�main__':h@unit.ñ() """Test suiteâôprofile module.""" import sys UpstatZóos from difflib @€unified_!$io‚StringIO§1supw>r„FN, run_q‚, unlink6wcontextrumanagerÉä6le��func, tim:‚ class P8(….qCase): iMr3#= .= $g %`methodÊÁs = ['print_s<{callersAes']Dòexpected_max_output = ':0(max)'ªÐdef tearDown(ö)+„Z(w)0Eget_]Y ;ƒreturn _ñO~B@ᨃ2do_$wing(cls†aresultØ›-p = cls. 2ilel(­v, 0.001šastart_" =Ñ(B”.runctx("øñ()", globals(), loc 7™r.appendzW() - n.@õÖ ½sxáð«y0 .S(Ħ, stream=sw1ó.strip_dirs().sorOA("sti"5�getattr(e&, ©)�Ð = s.getvaluea›plitlines/1mod¢ˆ0estc2.__P__.rs9¦('.', 1)[1óÊ0# OÐÐcompare againÀ� originatÙ}ÍÏãeáIñ Prevents outside code (e.g.,#io!) Nqcausing³CD# un I:puth[ !.r…!()l$ ifp0in  ý p¢'\n'.join(A)À~1wf ð_cprofile(self):# õresults = self.do_profiling()&„expected'Dget_w_output.JÃassertEqual(e–[0], 1000Y•fail = []kñ for i, method in enumerate(Xunames):6ÎDa = •['W!Db = ‹:i+1šif a != bU8¥ò.append(f"\nStats.{c"}  ¹"‘<1f"{Ãb erclass.__ÍO__} > ã "does not fitêvation:"Qp´0ext´ùunified_diff(a.split('\n'), b¿ Ælineterm="")q0if l 6ç°("\n".join(1)) cÀdef test_calkp_convenÍsçÛó# Issue #5330: =q and cP¬ñ e wouldn't report C funcO c!edwñ # with keyword arguments. We”A all5Ging ˜.C1stm2[Y¿"max([0])",,tO=int!¡**dict(key()*d/,) j A/, nÖðŠsé· = StringIO©0 #ilòÖ(timer, 0.001I4 .r» x(nñ, globals(), loc 3s�A = p .œ(p¯, stream=s1q.print_4 ¸!re›.getvalueÛÝ!In¬.uC_max,i à"±Zˆ{0!r} di·ómax:\n{1}".format=res:"ru~*Ùwsilent(y¶†`moduleh§("int('1')C,0, ff¦ame=TESTFNb=óTrue(os.path.exists(/ ó7elf¹ÐPctx("Yÿ?()"@ ­FÝh &/ *Qregen ubD, cl% =§ð.rstrip('co') ñ: print('Regenerating %s...' % filename) results = cls.do_profiling() "0new3Q = [] with open(KÁ, 'r') as f:#Z¸for line inS€.append(&Ž!if;p.startsq¦('#--cut')b*abreak y+ œwœ`.writey#s(Ž‚fP("_Pr ÷eOutput = {}\n")Àor i, methodè@enumq e(N!s¶b'bð[%r] = """\\\n%s n´(Ýì`,Äg[i+1])žÇ€'\nif __‰ð__ == "__main__":\nRð()\n') @contextmanager def s4#t(ÆAstdoBsys.  6try�Æ = StringIO(žQyield7ofinall;`‡AtestºŠ€run_unit(­aTest) 0×”°if '-r' notªŸBargvD]—FelserLÁe_expected_o0(__J__, ‚ð # Don't remove this comment. Everyth›óbelow it is auto-·Bed. ö-6 rÔ !['@t_stats'‘P 28P7.9726_0.999Göee.py:110(__getattr__§1 269.996 ”999.769 K025(¨CfuncGÐ23/3 149.937’€6.519 1Y1x56.639 GÃ35(factorialHÀ 20 19.98  Ú HV48(muB 3B6Kù93 599.830 299.915Š•55(helper‡° 4 115.984X81‡611E#73E1F‹P-0.00‹ '�4)73F#84F¦2_indirectO�8 311.97=3•A7 3Ñj8d$88O F3 63FP 7.99¡Q79.96tÛ c98(sub#?"""¬gcaller®2:0(^))<-þD0(4)ƒ–ß4 :0(exc_infoKI0hasH IÍÐ ø profilee.py:88(helper2)(8) 399.912 $ð110(__getattr__)D° <- :0(has@)(12r11.964 " cb98(subŠ@)(16Li79.960а25(testfunc"aù<- :1()(1) 999.767FÆ35(factorialG)<-kJ9Ü o€(20) 16f7L$84¯°_indirect)(zy139.946èW48(muâ/ èž¡#55y1 % 4–~9–#73JŸ“Joº(4) 599.83   ’H�HŽH œH1 "µÀ ` ÀÁb""" _Pé÷Output['print_callees'] = """\ Æe )-> ü27.972 ‹O 66 tR)->[J! ¾ ñpŽ&^ nŽ“ "+õhj 19.988!ˆ JÚ#+ ·Ê¦1nþ!…  hÕ(±×¿T ->×qappend)×y -0.004j²  üæø&ÐÉÐ  ÐÀ:0(hasattr)(ß8) 11.964 ñ profilee.py:98(subhelper)(K79.960 &c8-> %ð110(__getattr__)(16šñ27.972""" if __name__ == "__main__":¹ ð8() # # multibytecodec_support.py # Common Unittest Routines for CJK c6ps # im9$os$re %syuXó from http.client @ÒHTTPException&ˆ®$io6òBytesIO class TestBaseü„encoding]‚= '' #º 5$%• = None(ñtuple (with 4 elements);Gtstrb;Âmust set. 2 $Qs to ÓÑStreamReader G‚s‡‚G#@‘8�roundtrip<º1A#zE if Ñ is possible Ê0uniSGÀhas_iso10646@0= 0GUthis Nõcontains whole 91mapNpxmlchar_—Í(¡refreplace>ƒunmapped ô = '\udeee' # a ¼° point thatàBnot <.V0def ‚Up(self)Ùi0lf.Ec;ð#2 =0rs.lookuM.2Fe = @+Ý(d… ((r% (s? .owriter. .AincrÌ"al· : @»@ —b_chunk£ ¢X!_lƒE= []|‚for b inc) ½6Öb.split(b"\n"ª^qlast = *Z.pop(rassert &U= b""€>—@1 + a*"inYµ5«Ô.å0nd(0L$ÝÀnative, utf8èYzip(*=Ë5uòg(A:)[0€“ÙrEqual(ud.7Š'utf-8') ,K» o„ ]…,¦` (u”)¼errorhandleð source, scheme, expecteduÅ•s–äif isinstance(Gs@Àðfunc = self.decWode Yelse:üfunc = self.enc5¾if expected<�result = Eý(source, scheme)[0]m!if+2 isq deqY™’òassertTrue(type(r)AHtr, )o GSEqualC,×,7; B'%a.¯ÿ(%r, %r)=%a != %a'B&% #n4ing2", Þ‘% Ã)ûíÒX _bytesZ]zZŽVR Raises(UniÙaError,ó+,  5ð def test_xmlcharrefreplace(V)"if3Æhas_iso10646Ù¡skipTest('Sñing contains full ISO =b map')‡?  = "\u0b132±60 nd eggs"°)½™R|me(s, "Ù" ä�b"ଓ 51N912;{¯6ccustom2_v?elf9Yð from html.entities import ¦point2namekÀÀG(exc¸Mðif not isinstance$$, _¯e 8<r‹Q Type"ð("don't know how to handle %r" % ~ ÊZl = [Ä€for c in-ð.object[exc.start: Jend]—Œ�if ord(c)< -1àl.append("&%s;Ÿ 6[O]ùT1#%dUF Eðreturn ("".join(l),Sc.end¡�Ðcs.register_eë ("Ì.Û>", NÝ%J 1sinFqh.ð else:  ñsin = "\xab\u211c\xbb = \u2329\u1234 6a" 6ñ sout = b"«ℜ&r ð = ⟨ሴ6ng;Añself.assertEqual(¹encode(sin,kw ñ"test.xmlcharnamereplace")[0],¢!) J@def -ñ_callback_returns_bytes!):+a/#myNG(exc =@ (b"µ", exc.end)BÉòcs.register_error(±0cjkŒ5", d9henc = r"abc" +°unmappedunicª + "def", [ŒMm`enc, bX¿@'Ïwrong_object'&?ret#1Ñòfor ret in ([1, 2, 3], [], None, °+()· ÀRaises(TypeE›,_‚ l” 'Õ.Ý'RlQ_indexv%€'x', int™v>w"‘o'abcd'ƒo'efgh'  9; 'A, (b`xE3 9);0‰ÿsys.maxsize + 1;1I¹21 §Ð_./GBA5»Oward#&ifr¦.limit > 0÷r—%E-= 1}!Ö'REPLACED', 0d#Nelse^9ŸTERMINAL' ƒ5= 3‚å$À self.asserñ tEqual(self.encode('abcd' + °unmappeduniÏ + 'efgh', �'test.cjk.')6!(bp€REPLACED| ‚TERMINAL€Q 9)) …@def _ñ_callback_forward_indexÝ!):+³/×myreplace(exc ”return ('ˆõ', exc.end + 2)Iðcs.register_error("‹ò5", k9Y_asser] oÉI A¿_outofboundL&¼f', 100@1€Raises(IéE€,·Ì Ä…÷ ° a²incrementalarÓUTF8Reader = áAgetr†('utf-8'õ for sizehint in [None] + list(range(1, 33)) + \{­ð[64, 128, 256, 512l624]÷- isŠFm = ¨�(BytesIOÊÆ.tstring[1])¦;o;0 " =€* 0zwhile 1 i'if`s not )-sdata = Ø.g(P p.OelseH^9!if�vH]break¦Ce = eC¡e‹.write(e‚ 7/£getvalue()ñÆ#0]Cô˜_˜ de ÂW€ “rÂO, -1ÆQ‹õ±&õÛõ æÆ(µÆà™X%ÐCu = ².(’½À ð ostream.write(u) ôself.assertEqual(/Ágetvalue(), %£tstring[1]Cðdef test_incrementalencoder_error_callback(A%):yRinv =V°unmappeduni:�e"^%()JY¿‚Raises(UIE‰E‡B, e.˜³, inv, TrueÄ!e.®Ïs = 'ignore'`K(JY, b''PWreset¦*×mpreplace(exc„�return ('3Æed', exc.endë”cs.registc ('‚.$ {U', tezNõC Åu# againJt-^2st_élreadersPUTF8WCr = K1get–r('utf-8'àfor name in ["S1", Hline 6s"]ÙË;�sizehint?õNone, -1] + list(range(1, 33)) + \@ û [64, 128, 256, 512, 1024w7i:·¡er(BytesIO.Æ60])î<ü6 = /?0ófunc = getattr(,:^zwhile 1.wpdata = R(>C*pif not 1K%_breakW?Ù&==Ð/s"J?ý s({œOelseKF ¤Òr�‘ÜQnfï ('1', Ý sRY ??e? $q '#YÓã+"1" ,cb#K4if 1 is[ Wà daÿta = func(sizehint) _else:-&daH/) 'pif not *H_break?ÿame == "readlines"JÑostream.write-({Ý! KF ¤ôself.assertEqual(6Ágetvalue(), %£tstring[0]*’def test_³²ðr_reset_no_pending(=)ññ # Issue #23247: Calling 8ñ() on a fresh S W ¥r instance³# (without k¥a) must´Ucrash0¦¶ = BytesIO(T»" =é(0 %.¨ð class TestBase_Mappð@unit.CCaseý€pass_encQ = []š+devsupmaps'#co$<�\setUpd6tryqè„r.open_m¦ñ_file().close() #Êñ it to report the error earlysM°except (OSEq, HTTPE3ionî)z@skipq("Could�±retrieve "+$0map”7url_³,c return sup³ã±urlresource.[‡  ["if>P.endstw('.xml'ˆë_XG_ucml‘x.8gplain($B�`unichr*ð lambda s: ''.join(map(chr, öeval, s.split('+')))ñPurt_wg&{}ÿœj) as fz@for Ç< in4^" 8Z! =Y½p#')[0].¥3p()ÍLbif len_ != 2w†continueù=!cs0 = >I4if +<= 0x7Fj�setch = b—$([5~& 0xff]Â'el[>[!10`(a˜>> 24), (B16) z%),ñ× >8= VOÊÈÀtch = bytes(ø[(csetval >> 16), (ß8) & 0xff), <6-])7Uelif u�= 0x100:'m&¹ch = bytes(¬8«!¼n /se]�ontinue {1univŸrs(data[1Ëqif ord((0) =Ì�fffd or ¯ in urt_waƒ í5[E1] =/.chªñself._testpoint~2ch,~)0Adef #ð_mapping_file_ucm(?)›Pwith Y.open/v() as f,®0ucm¦ = f.read(íðuc = re.findall('', VLfOq, codedTc‰±@chr(@uni,ÍD¯?ØN�.fromhex(d*4W?odeWy'ÌsupplementalZÃ~À`zsupmapsÊz*6 ̘.,õP;if E not€€pass_encÅ5)WÂ.assertEqualá0.en+Û Ding)Aw/dew5strÁ”‚vÆÁ_errorhandle§Ü‚ðsource, scheme, expˆS`à™ –äif isinstance(GGc;0funþ'0.deV d/el” 7ëe7%if² °u£2`result½1unc/Ö#Õ1+¢True(type(N¨) is str, GfC—rC '%aeù(%r, %r)=%a != %a'@À %% ÔÜ|4ing#, ›O% ¨)ûý”e‘@©“Àlt))  øself.assertEqual(result, expected, / ÿ '%a.encode(%r, %r)=%a != %a'B±% (source, •NÓing, scheme, ›O% Ã)))3Yelse:Öt  Raises(UniпError, funcšò ) def load_teststring(name)iôdir = os.path.join( 0dir)ô(__file__), 'cjkþ"s'½†with ope9FPdir, @� + '.txt'@’rb') as f~ßPÏed = f.read(W_-utf8\ Ysreturn w , $ô import fractions…operatordrandom%sydstructDtime @unit†p from  y0sup�.„_grammar&ÿ (VALID_UNDERSCORE_LITERALS /IN<)vDmathiðisinf, isnan, copysign, ldexp INFVöloat("inf") NANðnan") have_getformat = hasattr(f:F, "_Ö__") requires4 = 6Ê.skipUnless(Zýg"c |s±| Å2Å�$ D  #locate z b4 K€ values _Ç º0 orärcurdir E` Q2, '*{/Rcasesq� class FÌ1SubÚ[Dpass&_Other+qGeneral-Cp(†@Test1): &Ü®¢()|î A&q3.14), F, +B14.0–,!" T? "^ ÂV¼ÀB , " 0x3.1A˜: -;/p-=#+=' ++H"±%+-7À self.aóssertRaises(ValueError, float, "-+3.14") oself.a7-7"O.nanl_+.inf6.2-3 ;Typ=/{}7gRegex(5Å"not 'dict'"€Cÿ# Lone surrogate“†'\uD8F0'“ÿ(# check that we don't accept alternate exponent markersw�"-1.7d29n?3D-xaEqual(¢±(" \u0663.1p4 "), ƒï¹ AÀ\N{EM SPACE}2NFð # extra long strings should ÁÅbe a problem*«öb'.' + b'1'*1000› ?ðdef test_underscores(Ë!): –öfor lit in VALID_UNDERSCORE_LITERALS.2!if­`any(ch8?G§'jJxXoObB'f8}H°lit), eval( Ý48 ölit.replace('_', ''))J¡©_in INê3P('0_7Tñ09_99'): # octals areærecognized herbÀzcontinuM4…PíÁ# Additionalò cases; nan and infÐÐever valid as!gerals,J@onlyþ2theñÀ() construct(buWllow ˆJõin or around them.øãW'_NaNœ5?Na_5OIN_FjO-_IN6 GINF_l9# CrÀhandle bytesªßues correctlyBÑb'0_.\xff9') };ð non_numeric_input_types(selfC): ÷0# Test possible non-numeric types for the argument x, includingHÑsubclasses of2áexplicitly doc=²ed accepted_.B=ÿ CustomStr(str): pass#pBytes(b' QArray+a /WÕfactories = [!_,G —lambda b:ºb.decode())-å´ ¦memoryview]œ6tryÖ¼Qfrom ªr import 1 exˆ! IZError@ zJelse5†.append(u¥('B', b)) rJUf in < Sõx = f(b" 3.14 "):ÐÐwith self.subµ( 7(x)Î('ŒñrtEqual(float(x),\ Y1]6ñRaisesRegex(Value!ÿ, "could not convert"RrÔf(b'A' * 0x10 ‘def test_$_Ø(¸P.‘Ç1öb'12.3')[1:4]), 2.3Ý?O\x00C, @,A@,4@:heÞŒ_messagee&wcheck(s{à Qmsg='Çú(%r)' % (s,)) as cmÞR*s£ §rstr(cm.¡;ion>4'ˆ± string to fE: %r�„êf'\xbd'‡?123½ 123 456 6*b'{¤#Máascii digits (Ša came  o= '!Zq'\u066314%å# embedded NULwÌØN 245r*00 # az“3S{ XUTF-8L ´:3a0'5Ð@support.run_xð _locale('LC_NUMERIC', 'fr_FR Sde_DEÖØfÀwith_comma(sself): ó6# set locale to something that doesn't use '.' for the decimal point Lñ # float must not accept2cŠspecificB8 buFÀit still has•G1norxÅython syntaxÍTimporÎfŒ�.ƒconv()['È_È–'] == ','Úêself.skipTest(31 is]e","') s3ÁassertEqual(Ñ(" 3.14 "), )2+1-1 c’?.14.$3.¿0-#e3/O000.22323b2.5e-1gO0.25—0ƒ/0.-òRaises(ValueError,Ù , Â,»9 /+3:%-:&A0x3.®-;pX=+= 525.Â2”\AlmosN .2Ëû .0û«‘def test_wìpersion(˜ ý’Make sureïAcallr_;ñ__() work properly`÷class Foo1(objectX „F y!¦return 42.<Y26X>3XÀnew__(cls, vþ;=0.€·^7.__5!2*7 0 * 4µˆ,__ÞzeWå# Issue 5759: §Ë0ed ^atr sub‘Ðes (though itö%on €# unicodJ.%).@*{Str(strQêDìV) + 1Ö;.vðFoo1()), 42.)  òself.assertEqual(float(Foo2()), 42.) +w with 2ðWarns(DeprecationUing):3;2 d\3(21)f/ñRaises(TypeError, Ÿ¦, Foo4(42)œ6 epStr('8'hE9.) ›PclassJ5¯adef __i0__(X ÐÔ•return ""O)J·¡time.sleep¼75()‰å# Issue #24731Q �'`OtherFÐ1SubN(ÏI0AtIs(type– ()Æ›ú–5 *FÏIk9), Œütest_keyword_args” XRegex;'D« argument'ØXœ(x='3.14'‚¬is_integer€úÇFalse((1.1).1¨1Tru,+X¡_"nan"4=inf4jb]0asrÉ âqfor f, Q in [;þ(0.875, (7, 8)),!-"-#�0.0, (0, B011.b\23, 2c]'“%.aÀ_È#()ÑéÊèiá¼range(10000%¢ = random.(ŠC˜ *= 10 **'pint(-10Û*001pn, d = †a¡ ÓÚ÷(n).__truediv__(d), fÒR[£ractions.F Y URÀÜ1R(*+_(0.0)Vì†0R(5¼^?2.5^1^ À R(*float(0.ó 5).as_integer_ratio())) õ(self.assertEqual(R(4728779608739021, 2251799813685248),@GÏR(*float(2.1|-}4-~#2100, 1à--/.0ä!aòRaises(OverflowError, .^'inf'L©H -IZValueŽ?nanŽבdef test_»Ð_containment(î!):&!±s = (INF, - 0.d6NANá‚for f insEIX§–In(f, [f];"7(f,è#?{f}E �{f: None(6ô[f].count(f), 1, "[ÿ'%r') != 1" % fq 2&) C ó# nonidentical Šãers, same type EentsY °True([f] ==]Â0%r]¸@[%r]»wfSAuBq, "(%r,ü E0{f}D {f}, "{%r}†A ·H NI!= "“E’ L/# — #³l, t, s, d s6øy 3olàl¬Pnot eÅ` to it- sDtDt­E#sEsa/} D#dDdD`K‹¾1And�ASignŒg, a, b’ð# fail unless asqb and a¢b have theA‘sign bit;n#÷only difference from ‰° is that th 7estAñdistinguishes -0.0|E0.0.&½ñÒ�((a, copy’ (1>|a)), (bàb))) @supñ%port.requires_IEEE_754 def test_float_mod(self):"ð# Check behaviour of % operator for S÷ 754 special cases.DñIn particular, cSPsignsOGzero/Umod =bU.mod Kžñ.assertEqualAndPSign(¿ÿ-1.0, 1.0), 0.0):Ee-10=C=0w%9&1¯ï (ì;iO), -e$?Ƹq$, ?~l;#¨y2oO@supž>powž¾õ builtin pow and **?¡Sºð taken from section F.9.4.4¯rthe C99î@fica!£rpow_op “,�F.pow[_ x**NAN is =áany x except 1)+ÿ²True(isnan(n`(-INF,F&))P62º?NAN6Ò6?0.5¢ ·l5$  A"¬"5NAN? #÷<**yGyG9+-01I gN6?2.06 Nµl?0.5lÀertTrue(isna÷n(pow_op(NAN, 0.5))) úself.assertTrue(isna5?1.0525!0INFj  ÷2# (+-0)**y raises ZeroDivisionError for y a negative odd integer ì íRM(M", 1�, -0.0, -ÿ ’ED E×¥finite andà J¯but not anù:à jù>rE'>‰+Dˆ ‰‚eis +-0GOposiG�EqualAnd5Sig;=Jv:B¹A_0.0) ¾¼,ÅŽÐGG0ÏAÌA$�(@€ Pù-1)**+-inf is 1û"10Å , ¸B$A B0# 1œ«ðany y, even if y¶Qan in‰y or nanCÇÆ.Ai"A;H$A+G$v‚)@//5)€!Àop(1.0, 1.0)‡, 1.0) ñself.assertEqualAndÿSign(pow_op(1.0, 2.0)@)?INF@*4NAN@ Áð# x**+-0 is 1 for any x, even if xù a zero, infinity, or nanK -INF, 0 ' -2NA)�A)?0.5Ã+0Ã,@/Á+B-Ã-D-?NANÁ+�-D)B*…B*ÈB,?0, B)ÊA+5‚+G.Ê.M.ÏE –áñy defers to complex powðÒûe negative x andCùnon-integral y. ÷T(typeü¯t-0.5)),{C @?'ß%Ð1.0, 0.5)), c—omplex) ðself.assertEqual(type(pow_op(-0.5, _)), c@$90.5? €Ð# x**-INF is éfor abs(x) < 1, ¬1And´KSign³PINF),Pî B00, “B%/0.A.wÄ  3'0 1>1!5INFï?0.01 2ðB"A. Ä1\9is 0a'œí"-A(@/5!, Á,3^2í lÐ;´A@-[€ �1# ()0**yÀÛ�ù y a negative odd integer=ÿQ-1.0)‰90) D �"0.ày~¯but not an‰1Ì7E Ë2Ëy K}KOposiK4JÑJ }J:I‡I#HA 3INF�ðINF for y positWive ñself.assertEqualAndÿ Sign(pow_op(INF, 0.5), INF)@#?1.0@*2@ �#”ÿ**y is 0.0 for y negatì&-m?0.0í$-îA(oA ïÿ"basic checks not covered by the special cases aboò  , )ú/25=#, -Ï ÈxC , RB$A.|ƒ$Q4Q!C}%61.0‹ÍÆCJ)BA.¾ÌÅ$‹HA2HA/0.!B}XW AG(A@-Á D#:!,  Aö# 1 ** large and -û; some libms apparently@ðhave problems withsõ¯P-1e10¸ñ jÀCB*üD,À.0, 1e100), w1.0) ù# check sign for results that underflow to 09ñself.assertEqualAndð Sign(pow_op(-2.0, -2000.0), E _(type>ß5)), complex)C ˆ ?, -‰FÍD 5D ÍÌ"o-0.5, ™%=˜,IÊ—#DcRC•&CÊŒhò we don't raise an exceptio”subnormal‰,îá# and validate¶ûs. Tests currently disabled, sinceCüthey fail on systems where a �› from powE is flushedúzero (e.g. Debian/ia64.«#4 True(0.0 <\-Bï1048) < 1e-315?Ò@'7>¾o7) > -À^À'lA'�%Að @requires_setfÞ‘t class F @FuncsÇäCase(unittest."):O def setUp(L%):•b.save_aôs = {'double':float.__g€4__()b '=D&)}žŒtearDown¡*&._ƒ-, ¿[Ÿ]C'BÀ]) def ótest_getformat(self): ö.assertIn(float._/Õ__('double'),5<÷ ['unknown', 'IEEE, big-endiadlittle%])Nƒ˜‚RñRaises(ValueError, } ¿, 'chicken'ÈF?TypE 11) Adef §s§”for t in Ž1, '˜'Ë�5.__Ie__(t, ¢®.1if }Rsave_ s[t] ==É i?<<ñ7‹BM®E 1 º/el¼ @¿^ ¼/seŽwxÉh{>@œ«(ü Yÿ BE_DOUBLE_INF = b'\x7f\xf0\x0<' L4éytes(reversed(S'))c8NANc8c4c`NAN)) d[FLOATÆ8¶ # R´cP#P¡�# on non-'A plaÛðs, attempting to unpack a bit pÑrn # represen'ðan infinity or a NaN should r ö an exception. @requiresb‚ class UFfÐTestCase(unitÚ.{ò_setUp��D = {õ:ßÏ À  �'float':ó.__getformat__(3)} - &s&ÿdouble', 'unknown')1 F 01ñdef tearDown(self):~4?.__z-b.save_½3s['–]ŒBsA']) …�2st_Yý_specials_dont_unpackµñor fmt, data in [('>d', BE_DOUBLE_INF),aæ 1?NAN1 08˜]32²serialized_>�roundingProm _×pcapi imÉ� FLT_MAX¿ bcEqual(UWõ"Çx, spec) andD3x._`1__(!}bqÓ.assertEqual(Kñ0.0, 'f'), '0.0&')8š¿ðault is 'g', except�` empty 1mat–‘s r/')1D1, '213g4h#µõpresentation typ€0 in—À same way asG¶(issue 5920Æ¥x = 100/7.* xÖfstr(x)C0 -Ó1>121Ä1A1AÌ-9 {: : µ;é:g3, '::fB, '+t+épt :t[3# %AEtingR %§D'-10·%¸qconversÜo¹4ingaOfailhóRaises(ValueError,™0, 3è9"s"Sother#ýcifiersgõn't work on floats,u # _Òparticular in?B($fo`_Ò5@([ch0x xÀrange(ord('a •z')+1)] +L§ L ALZL²HQif no5matŸ¦'eEfFgGn%'à.Ók”„VDH(H0µ ‘+Oe100J2/-1K(Àrror, formatû , 1e-100, format_spec) ô self.assertRaises(ValueError;?, -LMÅ# issue 3382ZbEqual(ˆö(NAN, 'f'), 'nan'”2 F2?NAN25INFd?inf2daINF') Éñ @support.requires_IEEE_754’def test_Ü_ Pfile(Ë!):$q“with open)A) asB604¿for line in"&!if%p.startshW('--'|&…continue™i=KFrip(—$aif not$ ª!^_ñ hs, rhs = map(str.strip,NÎ.split('->')wãfmt, arg = lhs,'rÉoñmt % float(arg)�8-9P'-' +À÷÷L5864ñŽ…Ñ(123.456, '.4Ð5 Y1234.9�.235e+03=(5.v=4èðclass ReprTestCase(unitÌ.PùLreprô2 s_Ê" =îÔos.path.join( î_)}__)[0],1SA 'Xèing_points.txt((+ƒ £à Ü x S#Rð®  v = eval(s o "v,+N'v)ýÉs.close({@›ðskipUnless(getattr(sys÷ó_Tÿ_style', '') == 'short'oñ "applies only when using :N [ ["á&{ #ÄG introducedèðPython 3.1. One a¶t’# of this„ð is that we get some degree(cstr ->´'->EPround„òping. In particulaúÐ any numeric ¯'ngDý0ain 154öfewer significant digits, those exact sam~##à (modulo trailS`zeros)/ uld appear!·the output.ŒðNo more repr(0.03) -‹> "0.029S"! õtest_strings = [ û)# output always includes *either* a decimal point and atEò least one digit after that6ù, or an exponent.@j'0.0',1L0.01'ý345­1.23456789¥0ð# values >= 1e16 ge5û.ý*10ù Ýtm'1e+16²Ke+17Q# ...ÄTso do¬j< 1e-4‚?0.0p/01Ë«9(9.Þ>e-0“eù designed to provoke failure if the FPU roundingâù# precision isn't set correctly,ý'8.72293771110361e+2ªý7.47005307342313e+2•û2.86438000439698e+28¤ÿ'8.89142905246179$ü3.08578087079232e+3�]@for Ý :â!neY'-'+sÿself.assertEqual(s, repr(float(s)))0 Z 3 6ò# Since Python 3.23¬@tr aÒ�denticalq žO, st­<§?ð) @support.requires_IEEE_754 class RqÐTestCase(unitz."):œ2def“€inf_nan(m)™|òRaises(OverflowError,ÙV, INF…5-6 VÈ h?NANh JType1�INF, 0.06š?, 17ÿNAN, "ceci n'est pas un integer"…‹0.0, 1j)«mlarge_«ckó [324, 325, 400, 2**31-1 2F100]ì�»lrHð (123.456, n), 123.456)  ôself.assertEqual(round(-123.456, n), #) 6;R1e3008 55-326 7hÿ150, 300), 1e1503›13073;Òfp-3.1415h8 j�9j�Q.4e-3k!156!) ¢ðdef test_small_n(¯!):�ð for n in [-308, -309, -4Šš1-2**31, -F100]IM\ '0.o5;-7:43749Œoverflow:íƒRaises(O*qError, d, 1.6e[8? H-1.7@�P@unit×ñ-.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',J‚ ñ "applies only when using : [ [ ["Ö2‘previous_\_bugs=ð# particular cases that have occurred—0bugjEorts°z{ÿ562949953421312.5, 1)æ 1Ècb3b a&.5`#¯-half-evenÝ @25.0PI), 2Ùª304040506`60708`8090!10a‚Y‹�matches_�~_formatZv«ó uld give the same results asÅDAtingÿûi{ðrange(500): ÷ x = i/1000. ð self.assertEqual(float(format(x, '.0f')), round?0))C1C1C2C2C3CE3)) Êõ for i in range(5, 5000, 10):%9Jÿ0Brrandom.(Q”Ï’def test_‹ _specials(²“r# Test &öting of nans and infs.åU÷(fmt, value, expectedUèY±with both %Ri/()G Lmt %bZ, fmtìPfmt =ù[1:] # strip off the %zú ¬¦È\ÎlAàmÑin ['%e', '%fg".0".6e.20g',?2'%#,#+#B3#.2DC#.15Z.3g']Ap‡„= '%+' +û is" "ŪINF, 'inf'Y"-#-$ ŸNAN, 'nanF# # When ask}góa sign, it's always provided.œ)reò%# )zositive`Î9", Î+Î$ó %Ñ+õ$-%÷ usö0' '‚ ú± code, only�Î can be negaÛà# Others haveC?pacÿÿX«$ÿÀ '-inf')  ô test(sfmt, NAN, ' nan') $-%&@def "ñ_None_ndigits(self):!C÷for x in round(1.23), , > L=LP_ú.assertEqual(x, 1¶# IsInstance(6int* ™'78†-78™™2o ¼™ðV # Beginning with Python 2.6 float has cross platform compatible # ways to create and represent inf ðnan class InfNanT @unitÍ.CCaseÄåÌinf_from_strår±True(isinf(³†("inf")) - +.-.�infinityŽ3“3õ·— "", +4)5�b")), " k8o¤ :Ÿ:?") ¯2INFä4!+I¥¥j äí I†oŸ+iNfInItYÞƒ-INFINIT:®â ½©3ö£4“™5˜8¡]' 9¦9–òRaises(ValueError,ÁI/o"5³6¡ðo") selfó.assertRaises(ValueError, float, "in") Oself3+4 -4 infinit I97_-INFI6¥_ys") HO+Infq?-+i6 $+-©q-P4ityãðdef test_inf_as_str(;/):ñEqual(repr(1e300 * )~5-.6ÌŒº|·8‘ 674k ÷�nan_fromù ±True(isnan(n�("nan"))p-+.-.ƒ Š", “4‘5˜5kPNAN")!Ö40+NA^j ‹9-NajkT5•ž3<4;ÚOnanaí¨6ª6Ÿ#Ó-hÙ=+ k+¹l…60--nðu›À_as_str(selfC): ôself.assertEqual(repr(1e300 * ¯0), "nan")9 -2:;/sts#8rðdef test_inf_signs(õ @copy*ÿ (1.0, float('inf')), 1.0;-<-= P@unit˜ñ .skipUnless(getattr(sys, 'y_‘ñ _style', '') == 'short',JÊ ñ "applies only when using :Ô [ [Ù,?nan,6# WLðthe dtoa.c code, 92 ofcp('nan')v5uld¯õ# be predictable.› �QUŒ$<Œ¢ fromHex =².hhex to class HexF•TestCase(É[0MAXU_h('0x.fñ8p+1024') # max normal :MIN;p1p-1022- èX# min;JTINY<70.0J;7suby?EPS= ð0') # diff between’ and nextDA up ÈP‘identicalwc, x, y"˳# check tha>1s xPey are ?B, or&Aboth_@&ENaNs°if isnan(x)4 t8%#==1 %)ereturn]`elif x…y¦�(x != 0.0k ­x¬ 'y)ü_Æfail('%r not± to %r' % (D)dHO_endÛC‚².MIN, ldexpàZ)Ô 4V 5/745 :EPS4/522 —MAX, 2.*(Ÿx1023) -²\970))ÿÝinvalid_input  E = [Ò†ÞAi', Œðisspelt infinitFà&and5"-I" ‰0'++ñ žl'-+Inf* --� *\+-NaN*Ñ ö 0 1ôd_.0p +'®/ - K-+ ~.p-+5fú # double signs=-D \+Á-\ 3&.p+21+Ž 4-43.r!0xú # no hex digits before or after point†@0x1,Qò # wrong decimal,­ character6.paó1p\uff10', # fullwidth Unicode— K2xa!0x!1.±0Kp \n 0x2Ù n \0h§ùembedded null byte is not end of stringH]õ for x in invalid_inputs:!µ:tryùresult = fromHex(x)5þexcept ValueErrorC:pasÔNelse'ð self.fail('Expected float.{÷hex(%r) to raiser9; '“·ò'got %r instead' % (x, ØA)) <–def test_õ(‘)¨vã¡_pairs = [7g0('iýZ INF)E('-I/ -!áM NAN; 1.¥=1.0ï-0x.2', -0.125:J-0.0¯é Î'4 `,\t#\¥?\n ' #-\vKrдÇdinp, e!7in ˜­™.@leadøî $(_trail) -N Ðlead + inp + �trail) ñself.identical(got, expected) 4ðdef test_from_hex(6!):T`MIN = V.MIN;%AX&AXDTINY 4EPSBEPS;€cð4# two spellings of infinity, with optional signs; case-insensitive G¨óÕöHex('inf'), INF+,/+I-@-INFZ[/iN‡I^¸NFINITY2-g2Â�-iNFiNite3o# nans²± ±0nan•?NANVO+NaN---&nAZèPvaria“õs in input format%^1ª?1.0×+/1.V?1.0,p.0°0±/0xXxY ?+0x;?0x1;X.P—/x1..¹0O.1p4�o0x.1p001?1p+L-/40ÀmHex('0x1p00£'), 1.0) ÿself.identical(fromHex(' 0x1p0 0"\n21`/\t11ap0.0Á?0xA//aP^/#beŽ9¾B1/bEbqXBE0P-4R•d_xB.Epc_.BEp8•w.0BEp124Þõ # moving the point around"Upi = öÿ0x1.921fb54442d18p1',ð0x.006487ed5110b46p11�/pi=ñc90fdaa22168cp1‰=1±9yÒ3243f6a8885a3ww ð7v î6; ì5; ë”ë ê3t é¢t†/, ;)3.ÔK)6.Ã-Ã)c.Á-ë)9.q-a832.ÀÍ'864.°-K8c9.®-ÁH192.^-8G324.­-%íÀ0x648.7ed511ó0b46p-9'), pi) ÿself.identical(fromHex('0xc90.fdaa22168cp-10<ü1921.fb54442d18p-11=_# ...‡KJl.8p-47KÄÿ3243f6a8885a3p-48;’6487ed51194:959îM8p-58í_0p-52î$<3<6c90ï<4< Þ8=5= ý# results that should overflowGãassertRaises(O&sError, àÛ, '-0x1p1024' ?>_+1025?#0+0X~/30?#½O+110@$~”234567891 Œ#o+0X.8p *@x0.8ŒM$`-0x0.4A6Ã#10X2Á3?$0x2.~?$o-0x2.0�)A+0X4@2Á%91.fNÐ&XO9(0M*›$J+0x3êš6&34/97�%;x10?p96M$3-0X˜Àfffffffffp96c0') ð# ...and those that rouÕo +-max float1øself.identical(fromHex('+0x1.fïp+1023'), MAX)A;-0XA$7pA-BA�fNM�u# zerosáP0x0p0Î?0.0Î.?1001-21-d X0Ô4•d52d2ÈÇ”234567891 qÔa-0X0p-7¡1k4¤-\—1102mfngo4 722h21107kÎx0p-107Î47Íf˜6Ë2Ìoþ2i rBÚ‚# valuesæõshould underflow to 0,!X1:Ø3“} f0-0xgÕB Ž0S0ÁOTINYŇ.6-7| z Ejr# checkvð-half-even is working correctly near 0´@DC/0710X2¦232Ø™43/X5363ð2*TINY) ó self.identical(fromHex('0x7p-1076'), 2*TINY) 5/X85!95 /xa5 &Xb53Ô/xc5 /Xd5!e54Ÿf5!/106F-0x16O-0.0O-0X24'x34{O-0X45 /x55!657-0XR-7T7V7X7xZ-[(-0\7^7x`-a7-0Xb7d8Dð# ... and near MINcGx0.fdŒ 22§?MIN0HfH  H@H0vH0ôH/e1H0H0îH"À.fffffffffffó fe6p-1022'), MIN-2*TINY) ÷self.identical(fromHex('0x0.f/e8H4aHŽ$cF2eF1/f0F22F24F2 4¤#f2sf+A &A !A91.0 �A A A A  E +� F F% F$13F% F% !F% &F% ++­®õ# ... and near 1.0.Ê@f0p01.0-EPSÑ /f1AXA2A �/f3A Àidentical(frÈomHex('0X0.fó4p0'), 1.0-EPS) ÿself.identical(frA5A//2C 6CxÇ7C/8C M9C/aC bC ÉcCÏ €d= ze= zf=IX1.0=)1=xz2= ·3= zþè zú= ô= î= ô7ÿ Eý?1.0h P=! š b£+¾ {²A N°A$®A ‡¬A ðA$´A øA Ã!10ÀÆAÀ self.ident÷ical(fromHex('0X1.0ó11p0'), 1.0+EPS) «self.identAxA2A ‚3A-4A Ã5A-6A 7A Ã/7fUÒÙò'8X3/2*5 ð8ƒ ˆ­ l 9¯/aC/bC ÉcC/dC/eC þfC -20C;ðdef test_roundtrip(É!):û"xtreturn / to5Ex)) @ðfor x in [NAN, INF, cD.MAX &IN -CTINY F0.0]•{(q8x, §™,---°#Íð should exactly recover x, Þõany non-NaN float x.ÿÕimport random7iprange(1Ó Z3e =6.=)p-1200,  ám.:om( s úchoice([1.0, -1.0]+:tryiAúx = s*ldexp(m, e3þexcept OverflowErrorDEpassUNelse'Ø ^_›½Œsubclass¼1 F(– `=ð__new__(cls, value):  ôreturn float.__new__(cls, value + 1) 5ðf = F.fromhex((1.5). %))#ÿ self.assertIs(type(f), F"ÇEqual(f, 2.5g‘class F2(—%):]ˆÐdef __init__(n« '+Ë.foo = 'bar'É2Ê#2Ë ±‚ìpgetattrôò'foo', 'none'),£P) iáòname__ == '__main__' �unittest.ñ() # Test the support for SSL and sockets im4sys J Ò T %I)DTelectDtime Hdate$gcouTerrnoUpprinKÕurllib.reques”threading5”tracebackuasyncor‡tweakref„platform…functool“Òsysconfig tryecÁ¡s except IBRError&ä = None ssl =….CÐ_module("ssl"Þ�PROTOCOLS+´orted(ssl._À_NAMES) HOST#Š.� IS_LIBREÜ = 7ðOPENSSL_VERSION.startswith('LibreSSL')9*È1_1_0 = not P,4sl.(Rý_INFO >= (1, 1, 0M1M'`1) PY_ÀáDEFAULT_CIPHER•R.get_ o_var('3@') ódata_file(*nameèÔos.path.join( 0dir*!(_7R__), ; \Ñhe custom keyRÀcertificate i‘s used inC_ð are generated # using Lib/fP/make(_Kàs.py. # Other ] s Gòsimply fetched «ðhe Internet servers1y #4ñmeant to authent¬æ. CERTFILE = '@"keyv×.pem") BYTES_*Äos.fsencode(`) ONLY K1sslÔL%>KEY$3key#o)No–P &EKEY)ß_LZECTEDzéSasswd�T4Ò®4°KEY_PASSWORcú"somepass" CAPATHw cat[#Ä8@) CA Ÿ_NEURONIOIå, "4e1295a3.0"4#CABÛ{Àh", "5ed36f9ð 9.0") WRONG_CERT = data_file("wrongcert.pem") #ñ'FILE_INFO = { 'issuer': ((('countryName', 'XY'),),)-¥(('localit*ïCastle Anthrax6ÄorganizationdñPython Software Found"FFcomm@Š@host/¬q'notAft×ò 'Jan 17 19:09:06 2028 GMT'Ø,’Before': -9-1-¢serialNumb]ôF9BA076D5B6ABD9BUsubjectWU!?(('S.öQÐ1Alt¸.@'DNS% �Tðversion': 3 } # empty CRL CRL† ­Qrevocõ@.crl®ð# Two keys and Éñs signed by the same CA (for SNI tests) SIGNEDj0keyL3 ,Â_HOSTNAME = äZ T D@OCSPë€'http://‰Aca.pÛ C.nett/ocsp/'WA'caI‚sA@pycaÄG.cerH rlDistribu__PointT �V’0 CA¹8` ”Ðour-ca-server0éhNov 28¼/27é6ÿ82EDBF41C880919Céÿ O2æ|4|2}@fake|n‹ ?ECC[?ecc]I_ECC`¶P-ecc'£SOXµificate as kðpem, but without extra text in s¥IŒAœñcapath", "ceff1710¹#ÕQã all kinds of lP alt ÿð s ALLSANFILE = data_file÷("allsans.pem") IDNSANSFILE = data_file("idn'ð& REMOTE_HOST = "self-signed.pythontest.net" EMPTYCER*Rƒnullcertz>BAD$7bad#¾NONEXISTING+æXXXnonexistingU:KEYÊcbadkey!^NOKIAMTnokia#ULLBYTE&wullbyte£> DH<cdh1024OK%S_'Âos.fsencode(ü@) # Not defined in all versions of OpenSSL OP_NO_COMPRESSION = getattr(ssl, "O"P", 0)9ÀSINGLE_DH_USíg8 ! 7/EC9#;ÿCIPHER_SERVER_PREFERENC},MñENABLE_MIDDLEBOXAd É+Kñ2 def handle_error(prefix): exc_format = ' '.join(traceback.fð_exception(*sys.6�info()))Gòif support.verbose_c1Ãstdout.write�' +})¨±can_clear_on#s(§ñ# 0.9.8m or higherwñ return ssl._OPENSSL_API_VER/ó>= (0, 9, 8, 13, 15jñno_sslv2_impliesz3_hellou/7hutpf_INFO u7xtühave_verify_flagÞh&G8, 0Ü_i¥secp_curvehaif not/@HAS_§LQFalse]Qctx =-@SSLCô xtwÓ.PROTOCOL_TLSï6tryPÂctx.set_ecdhˆ ("”b384r1"1Wp ValueE�? �(elUÿ True HAVE_SECP_CURVES =  eñ!utc_offset(): #NOTE: ignore issues like #1647654 ò# local time = utc + O)!ifÒ.daylight andA@ý().tm_isdst > 0ô-%ñ.altzone # seconds`ù$)%Ù@asn1(²_ >OSomecøb@, seùA8207nx!.iæk=k9ŽÙ fm_ñ"%b %d %H:%M:%S %Y GMT"[)d%@date». @strp×R, fmtB8ðt.replace(second=0)  ðcert_time = dt.strfc(fmt) $ö" # %d adds leading zero but ASN1_TIME_print() use(UspaceH5if pµ[4] == "0": p!' =-·:4] + " " +A5:] =freturnðR # Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2 def skip_if_broken_ubN¢_ssl(func)Âð if hasattr(ssl, 'PROTOCOL_SI''å@7²tools.wrapsGËðdef f(*args, **kw ?$2tryw àssl.SSLContext‡.…Ô3sexcept 6^ErrorT1if IðOPENSSL_VERSION_INFOÂÀ(0, 9, 8, 15)PËgñplatform.linux_distribution()Kð'debian', 'squeeze/sid+')Uôraise unittest.SkipTest("Patchedûíúbreaks behaviour"J  �Õ%Felse6öunc needs_sni =¢¡skipUnlessWðHAS_SNI, "SNI support :e–` this ÜA") Ž _8€_socket(,Ç�_version=ÓúqTLS, *,®7pAreqs4àCERT_NONE, ca_os=None=Sipher#Bfile2F key} Üc¸ =Ì ÉÛ¯J¹€ is not ¨‰ "=RÞ'wÑ.check_hostnaFFals¾' verify_mod5$_‡âv8—E@loadÓJ@loca$s(t åEM4 or\Ô d `chain( M,?gÈO Rset_c)(AôwšçÁCing_2q(servero€=SIGNED_«CFILEö£"""Create 4ødclientH$, IH', Ì5t»4"""¸<0ertŒ ˆ^T $‘_HOSTNAMESEelif‘U2V2W oþQValue¿K)$Àtext = ssl.Sò SLContext(ssl.PROTOCOL_TLS_CLIENT) client_c,ñ.load_verify_locations(SIGNING_CA) 6dserver60 = dSsbSERVERs =s´cert_chain(2ert0£#kreturnà$, ^ðð, hostname class BasicSocketTests(unittest.bCase):@def Ñstants(self):#]žCERT_NONEŽOPTIONAL‰REQUIRED¢OP_CIPHER_Nª_PREFERENC\öOP_SINGLE_DH_US!if¨†HAS_ECDH¨¬: <÷OPENSSL_VERSION_INFO >= (1, 0úR NO_COMPRES2ÒÁelf.assertIn¤˜òSNI, {True, False}P2ª3æsl.OP_NO_SSLv2} 3_TLSv1_2T ?, 1h_j鞸QEqual8Ü,âö3µ°Ìprivate_init³Pwith ÇœûRaisesRegex(TypeError, "public constructor"äJI!.sz() as sxñ2SSLv,(s°Ístr_for_enumdõ# Make sure that the *¢�` have D0-li2Utringã…# reprs.SprotoÛP5TLS!&�1tr(6@), 'riMethod}'Ð3ctx_:@dqIs(ctx.!Qcol, ,lrandomÖviÆRAND_status(‰Äêupport.verbose£÷sys.stdout.write("\n Kå is %d (%s)\n"¼Ú ð% (v, (v and "suffic‚ ¹Ÿness") orF o "in>{ødata, is_cryptographic öpseudo_bytes(16 Þ@len(P?), ( n†, v == 1[Jif vbX–�ΓÀ else:' ðself.assertRaises(ssl.SSLError, õRAND_bytes, 16) Aõ # negative num is invalid"__Value]?-5):dpseudožAB if hasattrÔ1, 'Èeegd'):% ¥=Typ¤fegd, 1¡:Y'foo'A[padd("th?ö s a random string", 75.0w 6b7¨ object= Ÿytearray(GK)‰;ò$@unittest.skipUnless(os.name == 'posix', 'requires É@def >_ì`_fork(‡š†status =ƒ(Crif not Ôðfail("OpenSSL's PRNGÓ insufficientpWness"Ü÷rfd, wfd = os.pipey#pi¹ ‘:= 0�:try¿Æos.close(rfdDSchild!òq(16)[0]“4KÖ¨Equal(len(Q)Ê0 os.write(wþ 1 d¾w¾Áexcept BaseE ?ionþk_exit(TOelse. *”�ddCleanup¬|-, }#_,Rû×waitpid(pid, ~4V>h‹( 1KW@readù‰ U½oparent. m N+ Ï62Notûã*, C3ö¬parse_certõ#Ñqe that Áuses an 'uno²ðal' function in _%c,Ÿò# provided solely forLrÀ, to exercish e ‡xificateE¦arsing cod÷ô1 1sl.Ž_i0_de<æ–CERTFILE)¨2U_INFOL p&tSIGNED_`à), ó SIGNED_CERTFILE_INFO %) ÷(# Issue #13034: the subjectAltName in some certificates@À(notably pro7õs.developer.nokia.com:443) wasn't parsedC‘p = ssl._Àtest_decode_r`(NOKIAÈ)2õif support.verbose:ãðsys.stdout.write("\n" + pprint.pformat(p) + Zúself.assertEqual(p['9'],lp¯(('DNS', '  /')C CVforumL&')°z ö # extra OCSP and AIA field½î0ð'], ('http://ocspgPisignÌ'',�C!caT/rs, aéSVRIntl-G3-aiak/oG3.ceryÿrlDistributionPoint…?crl…!rl…Adef ®Ð­ð_CVE_2013_4238()›é ULLBYTEìVçà = ((('countryòÀ_US'),¨ô(('stateOrProvince5oOregon9 ulocalitgBeavert5 €organizaÔkñPython Software Found" JQalUniâðPbCore DÀOmentM dcommon‘anull.p–ð.org\x00exampleH ÀemailAddress‹ER-dev@ AÝY§¼²0 iør/`‘÷OPENSSL_API_VERSION >= (0, 9, 8Û1sanL?alt?com!(' @UZuser@ZŽ‚P('URICÆJ ŸL7IP ¡Ÿ192.0.2.1Á 0¥2001:DB8:081\nÇ,elÃñ# OpenSSL 0.9.7 doe<ør IPv6 a5!es¤ÀubjectAltNam7e ù%san = (('DNS', 'altnull.python.org\x00example.com'),ALp('emailC@@@Tuser@E?orgE0URICphttp://J ŠL IP AddressSŸ192.0.2.1| 0Õ')) òóself.assertEqual(p['subjectAltName'], san4ð def test_parse_all_sans(H%):W‘p = ssl._1õdecode_cert(ALLSANFILE)3BŠ.¦(öl—€('othernÛà, '= 0.9 ð self.assertGreaterEqual(n, 0x90)-u# < 3.0=BLess53460007 major, minÿfix, patch, status = tT ‘EW ~"3y" LŠL "?256NÑL JLœ'6êa/, S (&15ðô:# Version string as returned by {Open,Libre}SSL, the format might change lõif IS_LIBRESSL:ó «ñTrue(s.startswith("e¢SSL {:d}".e(ñ9)),IMæ(s, t, hex(n))ÞOelseƒí‚.‡ Œä˜Åñ@support.cpython_onlyðdef test_refcycle(2)Âð# Issue #7943: an ®ñobject doesn't cã± reference K s fg:@# it].¢rsocket.(†.AF_INETVs+¨Rwrap_'&(s!øwr = weakref.ref(sEith ò heck_warnings(("", ResourceW)ºfdel ss·Ü9Áwr(), None) &V®þped_unconnecteda Methods on_+kS ¡ propagate�originalm¢ð# OSError raiseG6punderlye3 ¹ƒ!Ì+Õƒ¿&ss1�çþR�#s(ŸÆ, ss.recv, 1½3÷_into, bytearray(b'x'zFOfrom} 7�Masend, »¾º6ý‘'x', ('0.'‚H áNotImplemented&‡T?msgç 0 [¬0], ã0|À.0.0.0', 0))ñ def test_timeout(self): ó!# Issue #8524: when creating an SSL socket, the G0 ofGƒoriginal.õ should be retained..5forI÷in (None, 0.0, 5.0ž¢3s =T.‰(•.AF_INET)W.C.set¥( "BwithRwrap_M–(s) as ssN1Ä.assertEqualVf, ss.gm+))r errors_ssli yx ÚªvðRaisesRegex(ValueEY,÷©à"certfile must‚¯specified"6@ssl.¨,tP, keyKŸ=CERTFILE¢M ÿserver-side operations½H_H_=True½ƒ { ¾$, Ù6=""ËÐ C#/, BÐ÷ ö|ó "can't connect inl´Omode®©#s.Eì, (HOST, 8080)à3elf…1(OS·*cmÁ¶4(t *ƒ<l°NONEXISTING5™'€cm.excep®�.errno, g.ENOENª¡Ô]2èÝâôúÕ èC}Ž@bad_u_—Ùûð"""Check that try‘`to usez@ giv«Qlientðificate fails"""# ô certfile = os.path.join(  dirname(__&`__) or*ucurdir,HOc)-psock = 2et.(ðelf.addCleanup(!f.close$awith s)õ ssertRaises(ssl.SSLError):q— test_wrap_P!etWÁ »= !) TAdef P`empty_(�sÁ"""Wrapping ­1an . . N1"""Nž>A.badL_\`("null-\.pem"z‚malforme2~p badly 4Qatted‡ñificate (syntax e8˜ ?bad—?key– ?keyŽ?key$�tch_hostÄd¢Å0ok(Ë$, % —Ysl.maF 0ÂOOfailQ ³CCertŒ»—  ç —,ÐÈ©Äc# -- H 7•&--#Ôõ$ = {'subject': ((('commonName', 'example.com'),),)}üG % 2ExAE6Om'Î8Y'www.kF&#E?orgk"XÒ?*.a  4foo#ÂObar.$ c@X z;b# onlyÿð wildcards when they are 'Wthing<õin left-most segment>/f*/Ó Š¶ ?uK:‰BaÁ# NULL bytesõbad, CVE-2013-4073,,Ù'íó.python.org\x00Ÿq8 #²ðraise an error?  ó fail(cert, 'example.org') ! "³null.python&'õ # error cases with wildcards%iõ" = {'subject': ((('commonName', '*.*.a.com'),),)}>Štbar.foo)$EX V;¹?a.*· aµÜ\×"a.B9#cõ doesn't match IDNA prefix 'xn--'4±idna = 'püÇÎ�.encode("$R").defascii" C ¿#oki‘N9'x*w[!On--p_»€òin first fragment and ‰ðA-labels in sequ'õ# are supported.fÔ²2www§"ö~°L˜1www�{, E1F/?ftpE/öÌŠó # Slightly fake real-world <+ÖõnotAfter': 'Jun 26 21:41:46 2011 GMT',8v" ‚linuxfrz„ A1AltYj@'DNSb@? |„(;Šv3 ƒ('othernÞ5')ß ' Ÿ … õ# Not a "DNS" entry‡ ‚$p# When ­se is a ¦C&, ¨! inEused@d¢ $ # ˜_istin?ÿDec 18 23:59:59?ðuntryName', 'US'o),), ÿ(('stateOrProvinceName', 'California'F„locality?ßMountain ViewBÄorganizationF¯Google IncCFcomm=amail.gB@.comB%)}­ok(cert, '($Dfail&g'H v# Only wå is considered(HX "õ# -- IPv4 matching --©ö = {'subject': ((('x±texampleëú@1AltbGN'DNS?{< °'IP AddressBÏ10.11.12.13'w V(BÏ4.15.16.17')¬ d¥Ì1B €"?8')"I^net')£6£ðif hasattr(sockeYµAF_INET6'):iúÏ5LÓ l$(ì Ÿg2001:0oCAFE\ní C3A`0:BABACî¯ÒuW:cafe¯ #{3::baba#ø0200%,ebH%û ÐMiscellaneousžh˜# Neither Cnor ¯o0þnotAfter': 'Dec 18 23:59:59 2011 GMT'ÁôEuntrz USê64÷š¬�ß«€No DNS e; inŠg but a®›/99›‡À (('locaÿlityName', 'Mountain View'),), ”(('common@ðmail.google.comBC±'subjectAlt9³: (('othernˆÅblabla'), )}‚­ok(cert, 'g %ú# No DNS entry j† and no µ8Zþ = {'notAfter': 'Dec 18 23:59:59 2099 GMT'Ô'Íu€ßP, 'US 6\ô(('stateOrProvince>�CaliforniP FOlocaÕ+¦organizatiÛGÖ@ IncˆÖÕDfail×9ÒaEmpty ¢/¿5ert¹ðself.assertRaises(ValueError, ssl.match_host_ä, None, 'examp¨O(-{}MNô4# Issue #17980: avoid denials of service by refusing more than one Ýõ # wildcard per fragment.l ÂôŠ¡Ia*b.ù7,),Ž]with ReRegex(i’\£Certificatr &…"partial¿ùs in leftmost label are not supported"):Jl È5;axxÓ;_www.*]ÌcçÐly be present ;the$Ñ/su+?a*b^†too many*ô:xxcÇ *ÙMEsoleá p€out addim"als è/')û À('commonNameó', '*.com'),),)} õ with self.assertRaisesRegex(%,ý ssl.CertificateError,&Àr"hostname 'rò doesn't match '\‰9"):;]"_?b(cert,E%) -õ# extra checks for _inet_paton())àinvalid in ['1P1.2.3 �256.0.0.2127 Z/24']ž(R(Valu Î3ÒšŒ ¡Spaddr �›q192.168� �°]True(iT)iðif hasattr(sockeV›AF_INET6'º6A•!::ý 2001:db8:85a3::8a2e:370:733-ýT¤ ¯ðdef test_server_side(ç�##  YAwork! äsZŒQctx =¾¡SSLContext5öPROTOCOL_TLS_SERVER5ó/.RQ() as^ © @², ctx.wrap_E,A , =¯Ðt="some."=ÿunknown_channel_bindingIphould rí ÄDEU typeBs@ Í.F6 s.v5(('NG', 0Œxs.liste©c^ðc.connect(s.get…i(`·Luó(c, do_handshake_on_Jb=FalseÚsØKÝ žµs™ ƒ"W-W"/cclose(ËP@unit½ð .skipUnless("tls-unique"”ïÿCHANNEL_BINDING_TYPESO&"'E#' ! «óing not availabležVBtls_~ ÖC# unVCed se¡eturn None`£^%’ _Ýs¾�.Ö Is(œ"Ip# the sÈŒ-š ¹,ÔW= ößfile=CERTFILEÞ$Àinding("tls-ñunique")) def test_dealloc_warn(self):!%Bss =&Âwrap_socket(.•AF_INET))=¶r = repr(ssPwith fð.assertWarns(Resource¦ing) as cmˆŒENoneaöupport.gc_collect(mhÐIn(r, str(cm.ë½ing.args[0] geüfault_verify_paths = ssl.4�¡Equal(len(DO), 6(¢IsInstance),l!DeœV›PšÕbñEnvironmentVarGuard(^:env_ù env["SSL_CERT_DIR"] = CAPATHr )BFILE*0ERT ,Ý!¿´%D�.cafile, žg.5 =,Æ$P@unitúò(.skipUnless(sys.platform == "win32", "Windows specific"z?�enum_cert=ate%ÑPTrue(-5G"CA"<5@ROOT7u8ðRaises(TypeErroþ=sl.zÏ E<ü? C, ""YD�trust_oid9(se�ðfor storename in (ô2, "Å Ž)9 ³(G½}ý8-j, list/‘0ele�( †U8z, tupleX 6Æë5N), 32Cq, enc, E3 = 0ÝYèAGbyteo/3!n(f {"x509_asnçapkcs_7}�?’¨Ç, (set, boolÁudif isiÄ27sete'!@�.update(bõserverAuth = "1.3.6.1.5.5.7.3.1".´Ù7`eXB/rl -BÀ�Ë'rlï 4Às(WindowsErró or, ssl.enum_crls, "") * =#e("CA")#ðself.assertIsInstance(9f, list*ðfor element in #:GqK3v, tupleO 2£Equal(len(1O), 2.«/¯[0], bytes5\ñ [1], {"x509_asn", "pkcs_72}) C€def test€1object(å)øñexpected = (129, 'serverAuth', 'TLS Web S Éentication',@÷'1.3.6.1.5.5.7.3.1'Ô3valÓb_ASN1O—4M´ägTval, »0(Ÿ.nid, 129' šshortname6 Clong5* H o¥= BLkôRaises(ValueErry7 øÛ±€.fromnid5q©ÍCŸF, -1ŸWwith %YRegexð"unknown NID 10"4“7sl.=p(.suioQrange J6try�[>obj%ei`-vexcept ÜPEpassÑ4>lse'˜2objF'inOF4S:str´: W9Hÿ(str, type(None))~ YOame(ð ÄöêI\ ᯭ)Kµß»}]À"unknown obj÷ect 'serverauth'"): ø ssl._ASN1Object.fromname(5!) 4÷ def test_purpose_enum(selfUkval = Wñ('1.3.6.1.5.5.7.3.1')T‹Bð.assertIsInstance(CPiÜ.SERVER_AUTH,\H_EqualC?val7Ÿ.nid, 129; PshortX,ŽAŽJ Eoid,:>m4¡2¡oCLIENT¡* C¡7¡/30W;¡oclient¡J¡!m¡cüunsupported_dtlsgseqocket.s(£.AF_INET, ¬SOCK_DGRAMöddCleanup(s.close!Wwith —úRaises(NotImplementedError) as cxU%Rwrap_…à(s, cert_reqs=Ù–CERT_NONEto¾ótr(cx.exception), "only streamáes are -"Q0ctx%Òsl.SSLContextÂROTOCOL_TLS_»6û,Ictx.úZá6*Tqtime_ok! , dstring 7ampŸ…6sl.H¶to_seconds(J)K 6Mfail€uTRValueF @"^”ˆP@unitoÿ .skipUnless(utc_offset(),a'local2ð needs to be different C UTC �œ_0Azone ýñ# Issue #19940:¿Añ() returns wrongæÝ#¶results if Âzð is not UTC ñself.cert_time_ok("May 9 00:ó 2007 GMT", 1178668800.0) DôJan 5 09:34:43 2018D�515144883DE–def test_‰°to_seconds(_!):)q¨¯string = "i0Ws = 1uY ü\F, tsâú# accept keyword parameter, assert its name^—Equal(sslnáö=€)�ð both %e and %d (space or zero generated by strfQÇñ@0© ûcase-insensitivèÃB?JaNþmBU �Qfail(‘:7)úc # no  h€F€"EF?GMTB@ UTCFˆtÏ `?zonŽ3eÿ) # invalid day“ oU G_monthI ž%24âž IOhourHT09:60f$Øuminute K‘newyear_t™p2307680R"o# leapê ¬°Dec 31 23:5…¬hga# same¶Ustampr ‹[Z19Ý(, [Cø&59Ï,‘(99ž³ allow 60thþø (even if it is not a?Ä�/60�'90É## �82nddñ for compatibility withHP.strp(Š1Š1BG6:62D · ™®ñ special treatmentÔ5theVvalueg÷ # 99991231235959Z (rfc 5283u ”!59F9Å253402300799þÐ@support.run_Xò_locale('LC_ALL', '') 7“06# `vÀconds()` shoó uld be locale independent 2def õ_february_name():#*ðreturn time.strf ò ('%b', (1, 2, 3, 4, 5, 6, 0&))higú.lower() == 'feb'xòself.skipTest("Êð-specific month ±� needs toñ"¼Àò"different from Cÿ'e"­#-3C“Pcert_ñ_ok("Feb 9 00:õ 2007 GMT", 1170979200.0)— DQfail(Ü †O + "[¯Àðtest_connect_ex_error(dÆòserver = socket.(‹.AF_INET¢²addCleanup(?f.close&@portS up `.bind_ /q) # Re< ö but don't listen1 = ÈRwrap_–� «,<š¡öreqs=ssl.CERT_REQUIRED¿#.å à rcÞ.\q((HOST,Í)Iô"# Issue #19919: Windows machines or VMs hosted on"Ä#,@some[#s vÅEWOULDBLOCK.1åUs = (óerrno.ECONNREFUSED, ºuUNREACHŠTIMEDOUTM1wô=¡ssertIn(rcTðors) class Context»`s(unitá.bCase):@ßñ_if_broken_ubuntu_sslÙánstructÜû for protocol in PROTOCOLSMcsl.SSL—(2Ó0ctxð 'ò¤Equal(ctx.F , izO_TLS9ÐRaises(ValueE¨8—O, -1:%#42T½ -QN-Q¿’6 2 ìliphers—s wg_CLIEN˦Sset_cUV"ALL"¤ wDEFAULT#Wwith ÈÅ`Regex(3SSLÌB"No h@ canŒ—selected"Œ wô^$:,;?*'dorothyx"Ì:)ãUnless(PY_SSL_«ð _CIPHERS == 1,  ð "Test applies only to Python default ciphers") >¡def test_p&_q(self):#'ðctx = ssl.SSLContext(òPROTOCOL_TLS_CLIENTY6k¥ = ctx.get_$Äfor suite inœxF@name}% ['%']™!¬ð.assertNotIn("PSK", +i*?SRP*?MD5*?RC4*E3DES+ÔP@unit‘q.skipIfeñOPENSSL_VERSION_INFO < (1, 0, 2ò0), 'OpenSSL too old'þä‚5á/Gtx.s×s'AESGCMxr„s¾Det(d¾ õdñ ²:¡Ö0In(Zò256-GCM-SHA384'ás2 4128262562kbñ_if_broken_ubuntu_ssl6options3 # OP_ALL | ‰NO_SSLv2…3 is the²Qvalue”È#= OŽ7OP_S 3)&# ÆÁ also enablewTse by| vB|= (fpCOMPRES‘¿õ CIPHER_SERVER_PREFERENCE |FÀòOP_SINGLE_DH_USEE$EC<ðENABLE_MIDDLEBOX_�A}@cEqual(9,�Õ¢" |ëèUTLSv1†V! |3hÓif can_clear_q(‰Œ8= (6& ~×›Ã; Ž3_5= 0ë1# UG has±3Âoced on-: ‰0ƒ É JelseWwith S€Raises(V[ErrorB‚ ØÙÖÿverify_mode_protocolã"€3# Dd ²¸Šš€,;–CERT_NONEQ (GÐsl.CERT_OPTIOSNAL õ%self.assertEqual(ctx.verify_mode, ssl.CERT_OPTIONAL)= ,& =-…REQUIRED,i<iONONEe!8aWwith £õRaises(TypeError):d9ùENone#NOValuO542 N3ctxZ°SSLContext(–öPROTOCOL_TLS_SERVERÒÍÙ 9QFalseÿcheck_hostname)�oCLIENT�" ¡?Tru …def test¸_Ç�s_common_Ë(NÞmГ-u !if3þ HAS_NEVER_CHECK_COMMON_NAMEyY0 = €;¬áâÏCœ=é-1 = $qr=ÆqpJelse`º�Attribut¾(š7P@unit˜ñ.skipUnless(hasattrØçù, 'minimum_version'),ü}ò "required OpenSSL 1.1.0g"Õtmin_maxT#q ¨I Ë[BTLSVÛ÷.MINIMUM_SUPPORT=ÀèÎ×f(ax1f/AXfM¯„°zTLSv1_15 ~525Ñ  Ñ ‡-ÀEqual(  òctx.maximum_version, ssl.TLSV Rv1_2 2E ) ?(in?, =@úMINIMUM_SUPPORTED? ~?UTLSv13õself.assertEqual(Ÿ� Ï�)Lf · f ¶ 3 =ô?MAX3š/\¦Ù¦/In£ ,xÄ{ `eSSLv3}9 »”a» Z»-_2½_¿Wwith @õRaises(ValueError):ö/óY = 42¥b°SSLContext(e’PROTOCOL_�1E�gŠÍ R31Fo" ¯o¢ Ôð @unittest.skipUnless(haveºify_flags()œ E"ver*ò need OpenSSL > 0.9.8" @def k [‡3ctx²ar_SERVERW‰°# default vÜÕÀtf = getattr§ö, "VERIFY_X509_TRUSTED_FIRST", 0R— ê‰NÆDEFAULT | tfD 3Ù4åCRL_CHECK_LEAF³y E{_CHAIN|!ÀFY_CRL_CHECK“_CHAIN) õctx.verify_flags = ssl.VERIFY_DEFAULT.üself.assertEqual(?,>mõ# supports any value\ K ŠøCRL_CHECK_LEAF |h¯X509_STRICªy wãWwith 'ùRaises(TypeError):xõQNone %ð def test_load_cert_chain(`I3ctx-°SSLContext(ÅöPROTOCOL_TLS_SERVERªð# Combined key and cú in a single fil¡ Š�CERTFILE,DPfile=¿eà4F8âi B/, U€L“"OS‘n as cm— ·°NONEXISTINGd¬ñm.exception.errno, v.ENOENT;›QRegexÁ1SSL¥·, "PEM lib"ø² J(BAD¢gCZEMPTYi # SeparateTήª ä1ONL| , 6KEYU/ÚŸ.´1@`BYTES_4 F LzCôhGÏP �:KEYœhéß# Mismatchinge9B/¼3s m�— CA*0_CAÒ¸û# Password protect›G.ŸU`õ‚ECTED, pPÀd=KEY_PASSWOSRD) ÿ8ctx.load_cert_chain(CERTFILE_PROTECTED, password=KEY_PASSWORD.encode())P0‡ l¯bytearray(vÇ @ONLYË , BÐÇG4�— ù.with self.assertRaisesRegex(TypeError, "should be a string"):„FTrueP‰�(ssl.SSL‡q-@"bad1"v ÿEValu`cannotllongerþõ# openssl has a fixed limit on the‰ buffer.>ü# PEM_BUFSIZE is generally set to 1kb3eReturn’° larger thar*is0¡Öb'a' * 10240043# Pâ• callbackËpdef getfQ_unicó (rµV?Ä+s(ô=LFJf ‘TöÚH�g‘Ohuge9p(qx€O_typH9y�exception~ó% E'Á eü'ƒ�class GetŠCallableÝ& __0__(W v½Ä± DƒC!çl°ðñJUsH4�L( ¯(�ÀTFILE_PROTECoTED, ðpassword=GetPassCallable().get)@õwith self.assertRaises(ssl.SSLError):.uðctx.load_cert_chain(CERTFILE_PROTEC¢ h†t@_bad| ±Regex(Valueÿ, "cannot be longer"“5Ohuge�5Typ�ÿmust return a string“6bad_typ—ÃException, "h eµ�6eb(õ# Make sure theêP func�ó isn't called if iteneededPL ,X=Ú_ŒC‘def test_�°verify_loca… s(×*cctx = ÚqContextéµöOCOL_TLS_SERVERí£ _õ,tcafile=3Ç, capath=NonêldBYTES_?r 9x) @# , þR—!OS) as cm˜ ©°NONEXISTINGBf¸•Equal(cm.dp.errno,O–no.ENOENT;¡¼c«¯, "PEM lib’ °:BAD¨ƒy†, CAPATH¡4…$AZéð# Issue #10989: crashÎôðsecond argument ³¦ is invaliâc[[aTrue) ’ìlcadataé# =ϲqopen(CA¬!CAfLfKaÜ×pem = f.read(Z3derO2PEM ato_DER "(c&6pem: ƒ�NEURONIOÑ …ð neuronio_pem = f.read()  ñneuronio_der = ssl.PEM_cert_to_DER ((bpem) =Å # test PEM3ctxI±SSLContext(XõROTOCOL_TLS_CLIENT)6ñself.assertEqual(ctx.†ö store_stats()["x509_ca"], 0?.ñload_verify_locations(cadata=caM¾½t!1t 4v)2v # Éõ already in hash tableN›:w¥# combined#Gæ = "\n".join((Ä), ÁùZ3!2ñwith junk around the¦s7˜["head", z"other"¥, "again",~{9•, "tail"]*@�JK9N8DER‘N ÇF6der¾5; 7@$ŒÐ3Й${ÎA+b"Í7der¿Y‘ƒ´ô/¯error case¾-ŒÀRaises(TypeE`/, mâ²gobjectig UQRegex`3SSL]ó"no start line"): À ctx.loóad_verify_locations(cadata="broken") ð'with self.assertRaisesRegex(ssl.SSLError, "not enough M5"):FMoctx.lo}b~ :‘def test_7 dh_params(�]cctx = �qContextœöPROTOCOL_TLS_SERVERÙ�XfDHFILE#ÿif os.name != 'nt'ÒClBYTES_I± @S(Type8‰‚9f, None?½Ñ(FileNotFound…) as cmÞöNONEXISTINGCERTi¨àEqual(cm.excep^�.errno, g.ENOEN;¤ÏŸ”Â?’@skip_if_Õ±_ubuntu_ssl^Ísession_stat]Ôfor proto in QS*�5"&:tx.~A), {ž0Î'number': 0,connect __good# ¿renegotiate* acÓ i ?_hOhitsf_misseotimeou<®cache_full]+})t´set_default/Mpath! # There's ñmuch we can do toÁÐ that it actsl†expectedÏð# so just check-ðdoesn't crash or r|F an [9CLI}|éP@unit‡.PaUnless_°HAS_ECDH, "ó disabled on this OpenSSL buildTvÏt_ecdh_curveÔ7ÏX³"prime256v1‚Vø)b*´û » pñ9 »?HValu4 yg, "fooã AÀses(ValueErrñ or, ctx.set_ecdh_curve, b"foo") @needs_sni€def testñ_callback(self):!4ðctx = ssl.SSLContext(óPROTOCOL_TLS_SERVERg7 # Š¥servername`° expects a sÕable, or Noneu„ø.assertRaises(TypeErrç])B.?, 4E1/""F17ctxS¯Pdummy8«Vock, ¼‰Epass"3˜(�µ* …¡[œ_refcycledÁ# Reference !×s through theá3ûÕ are detectedßå# and cleared.Ã5o,²=¬6Az P<ðwr = weakref.ref(cÕ0delñ), >¶gc.collect(ÕW�Is(wr(),xÄòücert_store_stats°QoCLIENT~PEqualÐ.k%),Äó{'x509_ca': 0, 'crl  }bµQload_Væchain(CERTFILE&ˆMÿverify_locationsŽV1ŽA0_CA%!81©,2}gaget_ca­cI gV), []ë # ûõ% is not flagged as X509v3 Basic Constraints: CA:TRUEªyc¤ Xbut C¬­àa CA cert ð ctx.load_verify_locations(CAFILE_CACERT) -ðself.assertEqual(Bõget_ca_certs(),-1ñ[{'issuer': ((('organizfûName', 'Root CA'),=A =dalUnitCÐhttp://www.ca‰O.orgQdcommonEÿ CA Cert Signing AuthorityIÀemailAddressÓŠsupport@� ßq'notAftÿasn1time('Mar 29 12:29:49 2033 GMT'@šBefore': A(30A0A¡serialNumb…J'00'Áà 'crlDistribu`PointsÐ'wsxÎ/revoke.crl'Ó€'subjectA Ô‰ >/R3J%õversion': 3}]) O›with open�e as f:'1Öpem = f.read(¾Ñder = ssl.PEM°q_to_DER F(pem,ê´True), [der§‘def test_Uqdefault] s(Q)§3ctxŒ±SSLContext(›÷ROTOCOL_TLS_CLIEN€o\&X:�öurpose.SERVER_AUTH&�h�þÿ#œ×öRaises(TypeError,% Ðf, None C"'U'ÅP@unitEò(.skipIf(sys.platform == "win32", "not-Windows specific"“ FóIS_LIBRESSL, "LibreSSL doesn't ±“ env varsGÑO_envÕ3Ù�ð.EnvironmentVarGuard()ã6env>å�env["SSL_£õ_DIR"] = CAPATH )ÀERT_FILE"] =· CERTFILE ù ctx.load_default_certs()%ðself.assertEqual(6) _store_sta4ó, {"crl": 0, "x509": 1 0_ca1}) [ÿ2@unittest.skipUnless(sys.platform == "win32", "Windows specific")F If(hasattrJó<, "gettotalrefcount"), "Debug build does not share environment between CRTsn@def ³_1b_env_w¥(/!):¡jðctx = ssl.SSLContext(öPROTOCOL_TLS_CLIENTxch™u0 = )Œf'æwith support.EÐVarGuard() as1èm�env["SSL_mõ_DIR"] = CAPATH)—*¤'„[vi] += 1p”ÃW¥ñ_ø"_c¹�_optionså,}êe1! &ÌOP_NO_SSLv2,ý2if )úCOMPRESSION != 0np C,‡  0 ‘ßSINGLE_DH_USE�" B� /Ž/EC�/D’1 ”ÿCIPHER_SERVER_PREFERENC-#M¦:ØÉfcreateüäÜ×Á0WM“‚protocolò÷@9²verify_mode<W�REQUIRED=BTrue Ûheck_hostname,Ö7ctxÍñopen(SIGNING_CAøfˆ÷cadata = f.read¥;vcafile=`’, capath=5ì s†=ðÀ self.assóertEqual(ctx.protocol, ssl.PROTOCOL_TLS) ‰self.ass9²verify_mode<ÛCERT_REQUIRED=_>ð_context_options‚%) hQctx =ˆäcreate_default7(£ûurpose.CLIENT_AUTHmlãFKNONErߣdef test__ÛfstdlibÚ_elf): 0 �ó_rPFalseÆû.check_hostnameŸ jÿõÿ¢+v1h•ú;ßü"Ü$,A  cert_reqs=# ‰F ÃL=TruÈ`N?x‘lVpgQP s¥ ›(ÎkBSSLC ijhý½•Z ó¹# Auto set Ï!¼ Ù0 = ""è¶:©£‹Œ#øæÚ¸E¹2ÀRT_REQUIRED)3 õ&# Changing verify_mode does not affect check_hostname>Jctx.z = Fals#Zÿ= ssl.CERT_NONEK±self.assertd()P-QEqual-‰,ˆ9¥# Auto setLhf = Truænm a,š –REQUIRED)±Œ ¯ê s‰OPTIONAL, © °hÝ5Œq# keep ª m"©¨?jP# Can2set¯Ì[ with+… enabled;$ªõRaises(ValueError):,¤ðÍt,(É9PxËÎ °Êðdef test_context_client_server(Uø# PROTOCOL_TLS_CLIENT has sane defaults õBSSLCb(wG~u_?9Ä ÐaSERVERÐÿdifferent but alsoã*ZãË:Ú ¼ustom_classÙÁ MySSLSocket¦ Gpass Q<UObjec<< /tx! >AsslsªÑ" =‚¾�Q.sslo˜ *žÇZRwrap_\(.B(), `_side=� ) ý:ock-áIsInstanceNà, MySSLSocket)# ûobj = ctx.wrap_bio(ssl.MemoryBIO(), )=ð8self.assertIsInstance(obj, MySSLObject) class SSLErrorTests(unittest.qCase): [Ðdef test_str(d!):³`# The e) of aTõ doesn't include the errno<1e =̇Ÿ(1, "foo"Ò`Equal(j/e)(!e.l6, 1Mñ# Same for a subŽ¡ZeroReturn˜E{]¯lib_reasond1estAÂlibrary and -± attributesP•6ctx[qContextGöPROTOCOL_TLS_CLIENTPwith ßCaRaises8¢v) as cmÿnö .load_dh_params(CERTFILE]XÉÓcm.exception.×, 'PEM'6ø, 'NO_START_LINE?8tr(l]ÐTrue(s.starts‰("[PEM: ZQ] no $` line"‹)#WÄ’Check thaʶappropriate4•P is rdÔÁ# (this onlyŽ etFthemÖü#qc¡`_hostn'u= False�#¤verify_mod¼êU_NONE(?‚ socket.(7s6ös.bind(("127.0.0.1", 0)É[šs.listen(cØ b7ðc.connect(s.get†Ó(^ác.setblocking(î hËøŒGRet(c,ó, do_handshake_on_u=J+ ôœT f�WantReadx7 nD(c. !!s%ý"ŠÜPopera¦ó did not complete (read)NQ# For,™atibility¥,~ÂïðSSL_ERROR_WANT_READÇDA¥bad_serverÅ †àcreate_default»%¨RValuež Ü'³ð,  ôserver_hostname="") õwith self.assertRaises(ValueError):,4üctx.wrap_bio(ssl.MemoryBIO(),  ;? ”Ï.example.org ?TypŸ[žõ\x00evil.com") class ðTests(unittest.qCase): @def À_read_write(�i\bio =M=@Bbio.7fb'foo'ÍGÈ`Equal(+gœ-WFq7bar4‹0Z tzt�2), b'ba-1-Y,+')Û?eofÔ»QFalseº?eofÜÚLCB< _å :ä žŸfËO•N?Tru^5 K Ýpending&"J6, 0mÁC3C÷for i in range(3e:13Å£G3-i-1dXxÁh'i+f «ª¦ 0¯Ïbuffer_types²|ÃJ‰§Œ -G�ytearray(°?r')Õ Rðbar') bióo.write(memoryview(b'baz')) óself.assertEqual(bio.read(), . .ðdef test_error_types(?!): Q±bio = ssl.MtOBIO(lÀRaises(TypeEO , x¯, 'foo'7ONone6?Tru6 ð1) class SSLObjectTests(unit'.CCase?Ïprivate_init@Pwith r±EXRegexJó"public constructor"…¤¢¸ó€ÔðimpleBackgroundÌÛ1"""!P thatw±nect to a sIõ server running in the b`6"""e\setUpB@= ThžqedEchoSWû(SIGNED_CERTFILE:ã_addr = (HOST,‘X.port/¦­.__enter__»€ddCleanuž+pxit__, })Ð@_con ×Ó!Âwrap_socket(.•AF_INET),nÊ  cert_reqs=ä¶_NONE) as s©7(s.•.(( #Ð{}, s.getpeerq(Q 2tFalse(s^Cside)ñ# this should succeed because we specify/Proot o>Q�REQUIREDw a_š s=ŒoING_CAs4 (n/ô\_failŽ7# T�"Œñhave no verification�Bs. Cß5ion� # A¿ure crashes»@, so÷in an independentL$… method.2s =“=Gÿ� _.closD ¢�3SSLï"/GeRy0?ed"j 5 ¹È$lf\âÐ) def teóst_connect_ex(self): ÷# Issue #11326: check 0õ) implementation:òs = test_wrap_socket(.•AF_INET),<} ÿ cert_reqs=ssl.CERT_REQUIRED9 a_<Õs=SIGNING_CA)jïü.addCleanup(s.close!÷ssertEqual(0, s.BÏserver_addr)<àTrue(s.getpeer�A()) ‡2def)Ïnon_blocking“Dnon-7 šñshould allow handshakeu[ò# to proceed after the �Å gets ready.2Ô‰ 5do_4_on_N=Falî D.setn(>Orc = Kö"# EWOULDBLOCK under Windows, EINPROGRESS elsewher¸ra“pIn(rc, •gerrno.:#, hœ¤# Wait for4efinish¥rselect.p([], [sf], 5.0é8# N…jI`while [ƒ:try(s.®(gUbreak\pexcept ÿSSLWantReadError` ÖÒß ÖY_WriteZ+^ Zõ# SSL establishedÍÜ.3 ˆ@withÔNtextÃrSame asf3`, but 8ð a separately createdM™0ctxÝ�sl.SSLCon(pÆPROTOCOL_TLS«YOctx.þ)¢s®iÔ.f™¦6¥ {}¦ n*!# £ü»† hostnamf‚ ½h�="dummy"÷%š³verify_modeœ #s# This ðsucceed because ó we specify the root cert õctx.load_verify_locations(SIGNING_CA).Pwith 3Âwrap_socket(.õAF_INET)) as s:Bwö s.connect(self.server_addrj(©À = s.getpeer(#A°assertTrue(#!) n“def test_m_½ ‘text_fail)œà# This should "ñ because we have no )i&LBs. CÐ1ion{½#Añ ure crashes ThreadedEchoSô , so run txöin an independen¥#É… method.c0ctx�sl.SSLConÙö(ssl.PROTOCOL_TLS0¸½cy_mode;ÕCERT_REQUIRED[?s =è;ÔöaddCleanup(s.closeˆ´±RaisesRegex¹°SSLError, "Ê ifhesyQEed",kha!, m b> ncapathV Bï•qs usingW`>z` argumºQNOTE:&Àsubject hash:�algorithmø been changed betweeMÐOpenSSL 0.9.8)€d 1.0.0,`�a resultgŒè directory musKÀcontain bothZsîˆ of eachâp (same 0ºent, differÞÒfilename) forÇtô to be portable across Å�releasesËR÷â*v=CAPATH (ý…åbþ0# S¨·�a bytes ’5HjoBYTES_p©8Ldata8ŒHopenF%fn»€pem = f.Ú3derž@PEM_ q_to_DER F(pem®ÐÀxt(ssl.PROTO£COL_TLS) ùctx.verify_mode = ssl.CERT_REQUIRED,Sload_1ölocations(cadata=pemZPwith _Âwrap_socket(.õAF_INET)) as s:p£ö s.connect(self.server_addrj(@cert½€.getpeer(#A°assertTrue(#%) nq# same ·5DER0ctxYàsl.SSLContext(%_PROTOQK'deçšQ”ð@unittest.skipIf(os.n_ò== "nt", "Can't use a ÿòa file under Windows"È@def SP_make&a_close)6ò # Issue #5238: creating ZÂ-like objectìNÅ() shouldn'tý€# delay jE#thœ lyS"real¾q" (here£"ed\7itsK´ð descriptor, hence "pN]á þ%).CAss =`_T=K!fdì.«'noAf-X f.e,õ# The fd is still open1Òos.read(fd, 0ÛÂd# Clos3SSLX–ƒ e $efd tooP-ss‚pgc.coll7a@áRaises(OSError}eG“ªDÐEqual(e.excep �.errno, c.EBADFd¿ýnon_blocking_handshakÇë.ØTs.setuf(Falsekx V,a  =`_reqs= 0ONONE5 &doðC_on_Û=�ê³addCleanup(à±@counî0£ wh6× Â:tryÈ?E+= 1@(s.¤ÔYbreak7û7±SSLWantReadT{ se•.q([s], [ÝfT_WriteUPYUÀ if suppo×rt.verbose: ð&sys.stdout.write("\nNeeded %d calls to do_handshake()ñestablish session.\n" % count) eödef test_get_server_certificate(self)�_, 0, *3.K`addr, Q¿=SIGNING_CA{\_fail€Ð# Connection !ñ ure crashes ThreadedEchoSËñ, so run this in anö^Ñ# independentu method"í žò á|ciphersÍAwithyÒ_wrap_socket(.•AF_INET),�à ió_reqs=ssl.CERT_NONE, ‚Æ="ALL") as sÕG2s.cY¥¿)s°aDEFAULT´&ñ# Error checking can happen at instantiaQƒor when :ingüÚðassertRaisesRegex(l1SSLiS, "NoolÇbe selected"ItPèï©:ock¬<?s =;" <! ’) ö^$:,;?*'dorothyx"D 4 9 ]!caY�s_capathh"# ›€s are loα on requestU~cctx = xqContext‡öPROTOCOL_TLS_CLIENT¸@ctx.T±_verify_locø"s({v=CAPATH1ð`Equal(B)Ìf(), []1Ò%Ñ5G hostname='´l'Æ%@0ertA€.getpeer8(Ç#üPTrue(#"?lenC), 1 ¡@needs_sniÆc¾P_setgþ p0# C¹� that the›íP of a 2ed Fq‘replaced.kÎ@ctx1ñosl.SSL213Octx2iÀ ctx2ó.load_verify_locations(capath=CAPATH) ²s = socket.(†.AF_INET*òwith ctx1.wrap_'ð(s, server_hostname='ul•') as ss:ovóss.connect(self.@Faddrn)’assertIs(7Qtext,‡, p_sslobjk4‰ =S2§~ 2~ 12) añdef ssl_io_loop,…ñ, incoming, outgo ðfunc, *args, **kw )Tà# A simple IO Sp. Call 9(8ñ) depending on the error we get—rñ# (WANT_READ or òWRITE) move data betweeGA andVUBIOs.O¢timeout = µc.get('V', 10G°deadline = !á.monotonic() +&ou©@counX0l¦while TrueÓ!if= P$> n ,0“`fail("ˆFout"¥!Åerrno = None~”I+= 1>tryf re¾¡ 3`except%Q.SSLEª;as ÚtRif e.’°not in (ssl6q_ERROR_ÂÏ,b<<þÂ>Jrais�=™ x’# Get anyJAfrom8îñ BIO irrespective of/¯,h P¡send it toI�ƒ‘Ubuf =Qj.read(Ô6.Jzall(buf@# If]rre's no;ô, we're done. F-kW@need•_�#ú{Pd putÊiZ  Ðõ…!is†�Ybreak)%el6$==Z $I;¤º.recv(32768Õnif buf?Ón.write^$?elsÝ>G_eof»üif support.verboE¢sys.stdout?ð("Needed %d calls¡ co;¹te %s().\n"8„ 1% (é,_0.__ô6__)¦return retðñtest_bio_handshake÷ÆdŒ¥ðaddCleanup(sock.close)  ósock.connect(self.server_addr) &ö incoming = ssl.MemoryBIO(#_outgo# 3ctxA°SSLContext(PöPROTOCOL_TLS_CLIENTY–ÿassertTrue(ctx.check_hostname,QEqual-Áverify_mode,¿ÖCERT_REQUIRED=YSload_1ölocations(SIGNING_CA.�sslobj = 7”wrap_bio()$, …, False,LT c0ED_›×FILE_HOSTNAMEqž Is7Robj._‡a.ownerÞ?obj4DNone8�cipher()+version,tZrshared_as6õRaises(ValueErro»Æ.getpeercertœòif 'tls-unique' inȰHANNEL_BINDŸiTYPES:i=(Is§øget_channel_binding(d Àssl_io_loop(5,뎿do_handshak�É-*)µ_ 6Ä Ž€“‚2 h€?tryÕ‘ un¢QaexceptE¡SSLSyscall‰ j’# If the ± shuts downCTCP =áion without seP) a‹�# secureECùmessage, this is reported as SSL_ERROR_SYSCALLMEpassåYU1SSLÒñ.write, b'foo') ?€def test½a_read_&Q_data)÷À`ocket.!et �et.AF_INE¶‚ddCleanu4X.clos}~"Ö9ø0sl.ŸQ_NONE=ÂÅaµÅVæreq = b'FOO\n'˜. _Àck, incomingó, outgoing, sslobj.write, req) ñbuf = self.ssl_io_loop(sock, incomB L¦read, 1024LFû assertEqual(buf, b'foo\n'(nðunwrap) class NetworkedTests(unittest.qCase): â@def ð_timeout_connect_ex(®!):' ó# Issue #12065: on a 7', 8÷ ) should return the originalNñerrno (mimicking(ðbehaviour of non-SSL lUets).>÷with support.transient_internet(REMOTE_HOSTÂÆ2s =ñ0_ZÍ:et.•AF_INET),v@ÿ cert_reqs=ssl.CERT_REQUIRED=ôdo_handshake_on�f=Falsex‘ý.addCleanup(s.clo%C.set—A(0.01I rcÓ.´2j, 443)20if 56= 0“—@skip]'("|ú responded too quickly"[?�In(rc, (“.EAGAIN, ÂWOULDBLOCK))½@×~tUnless(ó IPV6_ENABLED, 'Needs IPv6hú°get_server_ÉÌificate_ipv6w '5Ë.google.com'}_kql-, CŽ „G __failL ýF (©€, host, e , @=Non;ö0pemE?sl.Ð(>MiÓVt pemEi.´B"No ˆlˆgª%s:%s!" % TˆA, caæ s=Љ—=%ifŸvverboseó¢sys.stdoutqÉ("\nVerifiedûAfor ü› is\n%s\nP ,pemÐ lÕž6try�O%öBFILES`exceptWæ.SSLError as xh#$ûÈ6 :xxlið\ðGot server certificóBate %s for %s:%s!" % (pem, host, port)) from test.ssl_servers import make_httpsñ class ThreadedEchoS4!(tBing.‚): 1ÿConnectionHandler04ò"""A mildly complicatedLñ, because we want it to work bothwG�with and ñ out the SSL wrapper around…socket c¨E, soJ@thato1can-3ÁSTARTTLS funÛ’ality."""úƒòdef __init__(self, d,kv…, addr):m8+.*# =3!þrunning = False!`% =k!{! =‚>ÿ.setblocking(1)% sl5j = Nonƒ . LÚdaemon = TrueE³_iF .:try?CžR‘.context.Uæ9et(Ú@54ock·`_side=Ÿ ¿-ð .selected_npn_protocols.w!ndÃpÐ+/()`/ala , b†except (ªñResetError, BrokenPipen) as et¿# We treat H6`though´}were any#¤gp - Open³ðon Ubuntu abruptPloses‹C[q° when asked'9€an unsup4ed  .H à is raised in ’1.3 mode,zÂJ0triÀðo send session tiŠÿs after handshake� h›õ://github.com/openssl½issues/6342‚Þ±0 _eí¦Otr(eˆ9if :Ohatt€¾"leXC("\nÊa: bad—¤�attempt �‚" + repr(£Ÿ) + ":\n"  ˆ°c0(BoreturnCqssl.SSL“A, OS !¡ may occur€e wronglzs, e.g.±« # g s ¬ÿPROTOCOL_TLS_SERVER ð û- # XXX Various errors can have happened here, for example ÿ*# a mismatching protocol version, an invalid certificate,Jþ-or a low-level bug. This should be made more discriminating.Oà bpo-31323: StEðthe exception as strƯto preventFóa reference leak: server -> conn_O&->\GÀ-> traceback;Àself (Connec�‚Handler)a E3.}.z.¿�d(str(e))79if :mhatty:'êh…ÒC("\nëa: badî­ñ attempt from " + repr(gÞaddr) + ":\n"Ž$@runnyn= Falsg%ê_stop(H_closeoreturn]Nelseû oÕhared_ciphers\pelf.sslw).s#(sþontext.verify_mode == ssl.CERT_REQUIREDš•G# =ăpgetpeerÿ6öQupporwƒbose andFÁ/.c Cñ sys.stdout.write(" clientÚ1 isúðpprint.pformat(“ÿþW"_binary× NTrue÷AÛDCert —ÛR1lenÔ²)Üo bytesâ9 Ù«Ì,£7:®~±1nowµÚÐÊk`†selected1is `[N+u*PJT_npn_R(jšß" m�def read\)Kf –R dM ‚? =êock.recv(1024)ŸFe,B§1U‘­À else:  ôreturn self.sock.send(bytes) * def close()%):!#if?jslconn!4".s.G)BOelse7”45�?runŽmårunning = True7�cif not²ñerver.starttls_sŠ4Pwrap_è(]R tRwhilesšd>tryP msÈ×Jead(;"ñstripped = msg.+Î2vTù # eof, so quit this handlerß,¨JFals€)ôN—" =?F unˆá:ïexcept OSErrorä,ð# Many tests shuë`e TCP è¿ection downöFáwithout an SSLJ60. T:ocausesC Ø” to raise ]Ÿ errno=0!F ?pasgkÀt®o = NonÁ,žA elj¿ == b'over'‘0óupport.verbose andþ .–_chatt8‡ósys.stdout.write(" èr clientÚdí?\n"fTô%º.ˆ €ðáÛêNŸSTARTTLS'ŽrSYTread •S fromf , Z•_OK...c­Ob"OK, ÎÁœ Ÿ-�%¬º þ?END®aÀstdout.writeÿ((" server: read ENDTLS from client, sending OK...\n") ÿself.write(b"OK,qsock = 8ÿsslconn.unwrap(f . = None’óif support.verbose andqù.ußectionchatty:Mö£sys.stdoutéAIÿ is now unencrypted; el§ÿ tripped == b'CB tls-unique'“9àU! ™(¿our CB dataö N$ áget_channel_bi{&(" Prepr(^ÿ ).encode("us-ascii") + b"�Oelseq (R4 g n)k!˜ctype = (#Ã"[w") or "m"� Ããv%r (%s)ùSback Ò` ¸ �% (msg, ÍÓ, msg.lower())í S80²except ConnͯResetErrorbÿ# XXX: OpenSSL 1.1.1 sometimes raisesPý|# when ÿt shut down gracefully.CÌ*Žì qÑs ži*"ß r0` by peß{}\n".format(F JžNaddr™9_closeñ!@runn‚n= Falsîý/OSð^J€handle_eAc("Test)Ÿ failure:A³Ôd0# n‚Àlly, we'd ju‰ÿ top here, but for the testFpharnessEà want to stop Ïthe server Rself. �.stop() (Ðdef __init__(%ò, certificate=None, ssl_version; f5Breqs 0 ca.òhatty=True, connectionc@Falsv‚tarttls_·=MÃnpn_protocolr> al:dcipher4qcontextÂ%):. if¢û-.4$ =$7Oelse1 ‚ssl.SSLCv(dDg (if�€ is not ¶E«Gù.PROTOCOL_TLS_SERVER)Hôð.verify_mode = (ñ 12ert ‘ �šCERT_NONE…`_ `* ¡@load¸¦@locac#s(›T÷Xïa_chainú1 V �X Iset_0( \ å] 1( _X*(J�Ö# Q ý'  1s; =  /0ock$qocket.s(¡@port$ up `.bind_ 4 1jflag =gÎPactiv¬ Šzelectedã_ = [])  *chared_w![z_errors±threading.T . ï�daemon = °7Senter82 –(h{Event()[JW.wait”preturn F mx¤^*argssØAX.joinì— , } î.! = ›Ê2JK1run6 ›ûock.settimeout(0.05 œ`.liste±Á�W�àif self.flag:  ÷# signal an event õ self.flag.set()Rwhileuactive:?:try�newconn, baddr =B¨sock.accepc3òif support.verbose and:_chattk8ñsys.stdout.write(' server: new†Ùection from 'ÂBt+ repr(Ć) + '\n'6ehandleåBConnoH(\,‹LJ_.star"jW.join¤‰ exV b®et.timeout›Ipassÿ8ÿKeyboardInterrup;Æ_.stopzQBaseE…i;as *¥â6 ÃZ'î/ãing failed: ' ÕeÎKà¢�close() Adef ö )R.ñ = False class AsyncoreEchoSŠÁ(threading.T "):^ó# this one's based on aA².dispatcher/`X/ (+\1“7¨_with_sendAEƒ__init__ÍÊwertfile0ŽÒ = test_wrap_V,§±_side=True,r?c€= A0do_%�shake_on_×Aect=Ï 6 .#JR_ssl_¦ =  +!do.®Ÿ)¤cAable¤”Âif isinstanc%.�ÿ, ssl.SSLSocket;g 7@.penÔf() > 0-º0le_¤_ G1breturn Þ_X¬”_0ò.úŠ(ÕWantReadError.WrŠuÔ Îa`1EOFDDC G£Kðexcept ssl.SSLError: ]raise except OSE:o as erA if°.args[0] ==ÿno.ECONNABORTED{Žþ return self.handle_close()”?lseI>p_ssl_ac¸Éing = False GCdef fPread(9)T"if‘ S(ÁCA._do,\Oshak¿bdata =sžrecv(1024nšÏupport.verbo,ð sys.stdout.write(" server: þð %s from client\n" % repr(‘)�@not "zÎÇ!eËSAsend‰Ÿ.lower())Ëj6Ì."ÒOK \òd connection %sL{osocket½ea‰�ÿ�__init__3«, certfileú{% ='Kh0ockx¢.©(£.AF_INET, ºSOCK_STREAMGj‘J›Pbind_NJ, ''4ûasyncore.dispatcher.Øw 5i‡listen(5Px#leþeØ»«_obj, addr"û÷ 8newôI3%s:üq mC%Hìr!¤à³à,( LU²m0fla(6NoneactiveC,CíÑQEchoSU(f÷0.<.% thŒQing.T MÃdaemon = TruÛð3strç\€"<%s %s>ß6ò.__class__.__name__,~¡}ZOente\�fstart(ÂPEventª.&gW.waitÔ› ×mxÛ*Sϲ ®À(" cleanup: óstopping server.\n") Pself."(õif support.verbose:07ösys.stdout.write(" cleanup: joinl threads(s4Ásuccessfully€eqõ.# make sure that ConnectionHandler is removed from socket_mapúñ asyncore.close_all(ignor q=True) -°def start (^Æ, flag=None)H.! = :]2Ring.T<KJ`2run R�active = �TÑèp1n‡G.set�awhile S 7:tryL!floop(1Pnexcept5Hpass7/opØ UFalseÙ¡×—A() €ëó _params_test(client_context,õindata=b"FOO\n",e¿achattyñ5, cJ ¡, sni_name÷Kqsession%1"""yƒLaunch a§j2 a Éð to it and try variouÆ1adsBŸ!s.Z¡stats = {}>2oqedEchoS?(,=$+8  þ7E@Cwith=•b.wrap_·(..()‚ÑAhost¦¯“›f) as sz´#s.±`((HOST4X1)¶'Âfor arg in [`Â, bytearray(Ô), memoryview]sL-ifn%)¿ $sËÜ èEp: sendè@%r..ß3 % Ï Bs&:arg…0outwP = s.+„ùS܈“ %r\n" % ¡º$if3 !=ýs.lower(̽°raise Asser|mError(/2Q"bad ÷<<%r>> (%d) received; expected "\n>Ð  ô% (outdata[:20], len2), %%in6‚.lower()>9)))>ús.write(b"over\n"ùif connectionchatty:@„þif support.verbose$(£sys.stdoutu÷" client: closingn.�ístats.update({‡÷'compression': s.(5r'cipher+ &�peercert(4get-Ðá_alpn_protocol9ŠselectedD nCB5ver (s-s_reused¨@j'4- &}B s.Û&e(ÇŠ['serverbs'] = .3sø HG "Frshared_ G ?qreturn ˆ• def try÷r_combo(Í,óêexpect_successM7„³sreqs=None,&0_op›5s=0Z)‡1"""¯³Try to SSL-Ô! ut*¶±*'*¹!*.EJIf *±ð* is true, assert thaeÍ Þ#edßÏif it's fals8 Rfails{Also, i�Ša string…!it�4he ÜÅ  actually ÿh by thµw? 1ertƒV†a¡žÀÁsl.CERT_NONEqvtype = ¸s'5: "3"$„OPTIONAL(,„REQUIRED,, }[�È]žÀ Úformatstr = (ùð and " %s->%s %s°r or " {}d$ ]%%) (5get2k_name(´àFB áB 2Á>}scontextóBSSLC �Þ 5.§ð |= client_optiòons server_context = ssl.SSLC( Ÿprotocol)5´.options |=O .ð2# NOTE: we must enable "ALL" ciphers on the client, otherwise an ¨ƒ# SSLv23"Ñ will send an°3 hello (ra<3 th2´ñ!# starting from OpenSSL 1.0.0 (see issue #8322).»#ifp!. " =+ÑPROTOCOL_TLS:4®Ç5Cset_é(÷)Êfor ctx in (3,J™)\ò tx.verify_mode = certsreqÒ€€tx.load_ò_chain(SIGNED_CERTFILE -VAlocaÑ3bING_CA.6tryˆPstats1B¿params_testÌ ,'~ðchatty=False, connec••3# P�ð mismatch can result\!ei±Error, or aˆE# "C^5Ðet by peer" e- dexceptF öif expect_successàQraisenF!OSAV as e+ F¦ e.errno !=ŽÖno.ECONNRESET: e*lsV?not ` Asserdœ(°Y!"C� 1%s ï“eded withµ"-!"H0% (eDget_KT_name7)); §)»jelif (Ÿ@ is 2Tru˜);and,{í·['version']�7á A".—:YÞed %r, got %r Q %¿,Ì(ts�ð ) class ThreadedTests(unit”.bCase):|ñ @skip_if_broken_ubuntu_ssl±@def 8§_echo(selfó�"""Basic"3 of„,®‚ng to a �&""ë if supportË(bo°ûösys.stdout.write("\n"Ó8&á…‚F&ifŠ@in {;+°�_CLIENT,Õ zSERVER}aS�+in5û`lf.subh(�=s_[dNAMES[ E`ˆ5/“=extðéÀ servô er_params_test(context, / ±chatty=True9wnection%) Htclient_`v server°hostname = ’4ing(Fáwith self.subTºXó =ssl.PROTOCOL_TLS_CLIENT,h …SERVER):¡ð• `Œ=Ç >B Qö=,> JaC@sni_W=`M Ìt.check_(… = False¤{[{› {_ÐassertRaises(ØêSSLError) as e²pV¶"‡5U3øB¾0G 3ñIn('called a funŽð you should not !' °str(e.excepÎ)1¤~   ›E )`Ñ̓°ÐÿÍc1def3Ð_getpeercert(J_ðif support.verbosGe: õsys.stdout.write("\n") $öclient_context, serverôhostname = testing%()E5ñ = ThreadedEchoSJ(Z=$=æ, chatty=FalseJCwith„ È ­Ò.wrap_socket(.5(),œ  ðdo_handshake_on¥Bnect�Kç7= j) as sÔ�Ps.conmd((HOST�f.port)+õ# getpeercert() raise ValueError while the Òm isn't}# done.jÀself.assertRc&s(d)Æ›)s.› X(s.g>=Ó? = H›PTrue(7€, "Can't  žificate."Haciphern �`if sup‰{.verbos[´ cápprint.pformat¡Ž) + '\n'ŠB""CBion  Â is " + str(S.Tñif 'subject' not in¹Q“fail("No 8d field9J�: %s." %ÜÅùñ!if ((('organizationName', 'Python Software Found">'),Jzæ[ü]«òÊþ"Missing or invalid ¬&C?; "_Ÿshould beî »›ÀIn('notBefor9õ1qAfter',0bO0sl.Sñ_time_to_secondsÒ[z]EacD�C¸RLess(˜!, [ÃP@unit™€.skipUnl)ÿhave_verify_flags ")ó need OpenSSL > 0.9.8?1def°_crl_check(¢c1 )Œ5Àt() ó% tf = getattr(ssl, "VERIFY_X509_TRUSTED_FIRST", 0) ó#self.assertEqual(client_context.verify_flags, ssl.YåDEFAULT | tf) P+# µshould pass%ñserver = ThreadedEchoS(y=$ˆÖ, chatty=True¾Rwith *:^Ú ËÂwrap_socket(.9(),=A q¤_hostname= j) as s‰Hós.connect((HOST,²f.port)Í+ðcert = s.getpeer('º('€, "Can't  < Ÿificate."¨ðCRL_CHECK_LEAF 9€out a lošæ CRL file failà \'8 |=) a*FÖY ´°RaisesRegex²Ÿ.SSLError‹"à …©Ned")‰^�  Q# now% aU. Theð is signed by t%A.A "O_¢÷_locations(CRLFILE™Ü� ²ïJådef test_checkä(ºR`if supÁ"Jbosenøsys.stdout.write("\n îS! =Ž4ing(,¥# correct 0oiŒUÀÀname) as s:  ûs.connect((HOST, server.port)) .ð cert = s.getpeer('ðself.assertTrue('Ð, "Can't get <Mµificate.") mõ# incorrect hostname should raise an exception7ºñ = ThreadedEchoSÏ’(context=$_�, chatty=¥ÆCwith:^ dclientCÒ.wrap_socket(.9(),=A ›ñú="invalid") as sŠIŽjRsRegex(zƒssl.Certx_Error¨$"H˜mismatch,¶� is not ¨c for 'µN'.")²¶q ¹“# missingŠ_D arg;cauU, tooETNñø° _Value� > f"checkŒrequires5ŽÍ ’Ðdef test_ecc_É(tÞ Drsl.SSLCt(söPROTOCOL_TLS_CLIENTp Að.load_verify_locaåÏs(SIGNING_CA9öset_ciphers('ECDHE:ECDSA:!NULL:!aRSA'>Q = ]ðED_CERTFILE_ECC_FNAME˜NúéfSERVERr # ÜA ECCF §Yja_chainû žœ/# ,D f N Î F¿i ;pÓÚAh ¥n ç()[0].split('-¤.s Qçc[:2], ì0', õãºÀ_dual_rsa_ec£c(self): ò client_context = ssl.SSLC(ÿPROTOCOL_TLS_CLIENT)Aö.load_verify_locations(SIGNING_CA9ö # TODO: fix TLSv1.3 once ~õ can restrict signature|#ŵalgorithms. Ù1.opŠ" |âPOP_NOÐEv1_34õ# only ECDSA certs Oñset_ciphers('ECDHE:6Ö:!NULL:!aRSA'ì°hostname = õ ED_CERTFILE_ECC_HOSTNAME ooserver—fSERVERr # Šð ECC and RSA key/ÕV pairÚ kÁ'a_chain» °f<)à¥# correct rshould < ñ = ThreadedEchoS(µ=†Ö, chatty=True«Rwith *þ@ ßÂwrap_socket(.5(),›= q_å= j) as s‰L°s.connect((,²f.port)Í+¨´€.getpeer('ôp.assert('Ð, "Can't get <ñžificate."Eïn ç()[0].split('-îš wi1c[:2], 60', ?-ådef test_check:L_idn¼`if supŠ.verboseQósys.stdout.write("\n"g e,Þˆ ;pIDNSANSçv.Ik”í_0modQ¢N•_REQUIRED¡j.JL&ruE&0º Y¾ ÷ , when specified in severalDÖdifferent way�5idnöUs = [3´ð('könig.idn.pyth{st.net'›ß'xn--knig-5qa0 Ì(1a-bbAð sgäßchen.idna2003.pythèontest.net', ÷'xn--knigsgsschen-lcb0w.idna2003.pyth?)@(@ ? ? bA€/ @q# ('kö@@äßB<8< |(# þ9�-b4a3dunA þý@ �.}€T}] õfor server_hostname, expectedu in idn%s:AAñ = ThreadedEchoSV (cÿ2xt=$_é, chatty=True)MCwith“ fjDÒ.wrap_socket(.(ë:™þ©[) as ðLûself.assertEqual(s.NL îKó.connect((HOST,o.port)3ðcert = s.getpeer(+©9ô¼(vÐ, "Can't get ‹ µificate.") áÄ# incorrect bõ should raise an exception7Va0@N ]Y7c0"=" ß.example.org"Z‹²R£s(ssl.CertWjError)ÅMW@def ×p_wrong_±p_tls12({YB"""C›Ãing when the � rejectsˆclient'sþû„Launch a:çðCERT_REQUIRED, and check that tryt!to²Þ%q to it C!a  ~|u fails.=5""" .�±à, hostname = tóesting_context() õ# load client cert4.(_!ø_chain(WRONG_CERTN´require TLSUåauthentication_eserver_ðverify_mode = ssl.[•_REQUIRED7#[à1.3 has differ»•handshake* Àómaximum_versioneBTLSV•.TLSv1_2 A¢ñ = ThreadedEchoS·(%HW=1Óð, chatty=True, connecH)xRwith L5, \"j ØÂwrap_socket(.=(),<@q¤_hostname= y) as s:K:tryTó# Expect either an SSL error about theÙ@ rej)ngYH'/ , @§ low-levelJß reset (whichIö sometimes happens on Windows¶u#s.us((HOST,«j.port)/aexcept§BSSLEã>s e`if supC.verbos$}õys.stdout.write("\n[Ïis %r\n" % e‰/OS„  e.errno !=‘Þno.ECONNRESET´�FraisLÎ)–ˆ?or Òl#ñ self.fail("Use of invalid´Ð should have &Ced!"Rð@unittest.skipUnless(`BHAS_ôä3, "Test needsa"j@def ?@_wroC ert_tls13(”)> ˜>Q! =P� Eu¹…fI 7?min3f ª@A�_V¿^ Ô[2çXÝtperformDxþ exchange after òßÅÀ(HOST, serve§r.port)) Itry:ús.write(b'data'2!jread(4þ except ssl.SSLError as ea`if sup�.verbos$h“ys.stdout’5"\n[Ïis %r\n" % e‰/OS„ ±e.errno != ¾.ECONNRESET´�]raise/Î)`socketˆ?or Òl#ðself.fail("Use of invalid cert should have &aed!") ¿ðdef test_rude_shutdown(Q)ûÄ"""A brutal $fÔan SSL servergC an wh5õin the client when attempting handshake.15""" �listener_q`y = th ¦ing.Event(ú+Ogone*VCs = zG– Pbind_ƒ(s, HOSTBÚ4# `u³` runs in a£’. It sit@n ac…() untilŒ#!ma'ÜÐ connects. T.0it §‘ly closes1¸,G‘and sets ›_�` to let<mGknowEª[Ž:˜5ð(' "s.I¿8.se±!0newo`, addrw.'•'. dszÄySÊf,orË:�\y.waiµLwith@êc;µ#c.h ((= , K „(u¯t%­@ssl_GöÖAwrapFet(c"+©©µ$Epass0e‡:‹'ñÝ"to³d0ì0—'TtÄäT „(target=%Òht.star  $�èÐkfinallúst.join(Œ#"\O�_verify_eØ * sÉŒ?Kp_contexEC(öPROTOCOL_TLS_SERVER ŒAð.load_cert_chain(SIGNóED_CERTFILE) òcontext = ssl.SSLC(÷PROTOCOL_TLS_CLIENT;ñserver = ThreadedEchoS(W=$_å, chatty=True)„Rwith *: <Ò.wrap_socket(.9(),6:cç_hostname=SIGNú_HOSTNAME) as s‹Q>try°s.connect((D,Íf.port)è+dexceptqPErrorre]ÿmsg = 'unable to get local issuer certificate' ô self.assertIsInstance(e,ƒrCertVerD1ion“¸¼K�Equal(e.v:¯y_code, 208Ïmessage, msg<ïIn(msg, repr(e\ ¤GIn(' ¬‡ failed'H8ò @skip_if_broken_ubuntu_ssl�unittest.(àUnless(hasattr05, '2oSSLv2'š ð"OpenSSL is comp’ òAout ?@ supC"@def ~�_protocol™0v2(“)<B"""CŽ0ing0$anOœdñ various client options"""êF$if€â;bos ósys.stdout.write("\nª?6try©Pcombo#.!‚  I,cú’_OPTIONALO¥0\�REQUIRED\+—TLS, Fals?if d'3'ûÓ)3yy!]TLSv1J#�3næP specr€}"noà�_implies‹3_hello(õ@# NoHVv2 =>fsll use !3 <p on recö‚swA%¸‹q_q=gaOP_NO_ó?5‡À  ôclient_options=ssl.OP_NO_SSLv3) )ðtry_protocol_combo(,�PROTOCOL/92, µTLS, False,HPƒqTLSv1) <ñ @skip_if_broken_ubuntu_ssl•def test_‘¡TLS(self):!pð"""Connecting to an çò23 server with various ˜ 5"""Iöif support.verboseeiösys.stdout.write("\n"L if hasattrD5, 'µŽ'³N:try_� | Ž\f, True‹Kþexcept OSError as xpð# this fails on some older vers=û of OpenSSL (0.9.7l, for instancw{I $ Q‹"Ò2¼!toà#Ñ unexpectedlyѦed:\n %s\nãT †% str(x);Æ 3Ʊ 3Aw‰ ù ÷E"Qv1, '”'•ZaßCERT_OPTIONAL2X?-]Á@e�REQUIRED@=X4@]@7# S¼€specific÷º+k[w& ová# Will choose |WÄÀL_TLS, True,/ úserver_options=ssl.OP_NO_SSLv2 | %3)Mðtry_protocol_combo(,ÑPROTOCOL_TLS,>¥v1, False,Hœ•�TLSv1) =ò @skip_if_broken_ubuntu_ssl�unittest.(àUnless(hasattrª5, 'ší?3')•ñ"OpenSSL is compiled without ?’ support"#@def ~$Ásslv3(self):¢úô"""Connecting to anOšdó various client ®5"""H$if€†.verbosedhósys.stdout.write("\nªÍ â Ï''öL3ißCERT_OPTIONAL_D†REQUIRED_?if %'2'¼í)2yƒ!dP7åÓê�;“ ÍPif no‹¡v2_implies‹3_hello(FA# No÷D2 =>æ†will use<p on rec”s’%H EI g�L/2)›_tlsv1 n t“'0L $_NŽb” 3”Àprotocol_comùbo(ssl.PROTOCOL_TLSv1, óSSLv3, False) ÿtry_protocol_comJ3TLSH,HOðclient_options=�ROP_NOž!) <ò @skip_if_broken_ubuntu_ssl�unittest.(àUnless(hasattró:, "õO_1")–ò"TLS version 1.1 not supported."@def uátlsv1_1(self):›ëñ"""Connecting to a {ò.1 server with various  .Ga TesDÐagainst olderM®Us."""2$if¶†.verbose•™ósys.stdout.write("\nÝö_BÛ' 2.1'/R9if —'—x'2'5/�#K{{3{7>$2ý@2#_1BO šÌ�#R �Lœ¬ö)>2)2)2)2)±2Á32, ]/2'“ )ð 3|<92K bKEÀ$ À ƒ; ÀÀocol_combo(søsl.PROTOCOL_TLSv1_2, sóSSLv3, False) ùtry_protocol_combo(6L3TLSJ,JQðclient_options=YTOP_NO¢%) >ˆ К' ?.2'Ö0#v1ØLœn5?v1_š$8yœƒñ def test_starttls(self):Óõ-"""Switching from clear text to encrypted and back again."""Eñ msgs = (b"msg 1", b"MSG 2 �STARTTLS 3 +4 4END5 '6"Jñserver = ThreadedEchoSŸ(CERTFILE¶ ï _S_=True:ochatty1Ponnec';„’wrapped =¿QRwith ž«¼grsocket.(M ì.setblocking(1c�s((HOST,bj.port)+`if supŠ.verboseˆlúys.stdout.write("\n"Gàfor indata in 'Gko."" ¡p: sendÚ£%r...\n" %� ¨>3if �¤ <éÓC'1outð!= 1« ¤&/elR s.´(c¾s.recv(1024ŽB#= �ï.strip().lower’#ife == b"µøAmsg.6sšg(b"ok"E¸$# ;P ok, 1 chJ¿secure modeºis{R*�2 %rêa!, Ú&2TLS'O %Éojó" =rM_¥s/#ÿƒuÀ elifÿ" indata == b"ENDTLS" and msg.startswith(b"ok"): "# 9P ok, /ÿch back to clear text;ÿif support.verbosecvÿsys.stdout.write(R*ÿ!" client: read %r from server, ending TLS...\n"M %)#ÿs = conn.unwrap(&½ped = FalseJ/elú"eO\n" ÷� ©Œ@closx3`ection} 53if 0 8ÿšb"over\n">K`s.sendÇ4r·eÜi,åòdef test_socket~W(selfMA"""U%>Rreate�‘anage SSLo<Fs.""º]â = make_https_qö , certfile=SIGNED_CERTFILEAQ# tryzVonnecµø ôF'\n'XDd open(tÊ, 'rb') as fçpd1 = f.¶rqd2 = ''Uàñ# now fetch the same ËçSHTTPSñ80urlIú://localhost:%d/%s' % XA.£õ, os.path.splitËF)[1]ë0conï� = ssl.c“_default_5(caˆfING_CA@ñf = urllib.request.url<@url,þ`=K9;tryI1lenKÁinfo().get("7›nt-length<@if d5P(int(W) > 0®~’¨,�#: $ B³O$’ %d bytesàcremoteö_ '%s'Ý ³% (len(d2),3)ÂkfinallU$f.à“Íñ.assertEqual(d1, d2) Áˆasyncore“V`"""Che5´he example 4� integra0ó] Uð"\n") ióndata = b"FOO\n" ñserver = AsyncoreEchoS¥(CERTFILE).Rwith 3:Jòs = test_wrap_socket(.&()G2ó.connect(('127.0.0.1',^[.port2`if supŠ.verbose„Vùys.stdout.write(¦"ñ" client: sending %r...\n" % i- ®O3out^zs.read(;·"¢S2 %rœl b3 !=¿�.lower()#�elf.failAbad Ð÷<<%r>> (%d) received; expected Q`3% (™¤[:20], len/),›# Á2Æ:} sêPb"ove' 6@clos!®0ion' d s.&eù<r _dy72defpPrecv_ÅW(selfïp"""Testº0v()Xönd() and friends.""¦ sYa"\n") �ïP = Th±/edHòAÐcertreqs=ssl.ƒ__NONE<±ssl_version?ÿPROTOCOL_TLS_SERVERI ca‡ s=€6¯hatty=True1Bionc;VFalse]p*ƒµa_side=z3Ofile0ca_6M0_! fCLIENT^ss‡@HOST(€ñ# helper methods for standardi%Ž* µ signatures&r»_)__into¢b©úytearray(b"\0"*100¹K€count = x"cvPb'À ret÷urn b[:count] ùdef _recvfrom_into():"-ý b = bytearray(b"\0"*100))cº, addr = s.Zb1?retžó# (name, method, expect success?, *args, Gªvalue funcjRsend_D]s = [¸ ('#P', s. ÿ, True, [], len),1%to3€to, Fals6`"some.Oess"D 5allE9all{Ûambda x: None†]” *«whether to54 !¨! #© ¦ –. ('#Q0  C�"',¡ x,9|�]s Lúdata_prefix = "PREFIX_"9Pfor (S_¢7B¥_¥!, £ ®&qret_val8U) in F>ods‡ in›@ = (£+‡ú).encode('ascii'år>tryX0ret²)(l-/0msg ´öing with {}".format†>ñself.assertEqual(retÉ„¯), msg=msgI0out¾o.read('4if *2!= ßo.lowerò¢¦_fail(Á#a"While¿ 0<<{¡:s}>> bad ¦"H 3<<{¦ :r8ÿ({nout:d}) received; D %bed <<{èL inK%\n¥Ž ÚÃ=èž=^[:20]:ÅS=len(7 €+ º=gA ninFè@€except V?¯Error as e)#ifQá'‡=`Failed«LIsoÂEùðto succeed.\n".ðformat(name=meth_ ?) ö if not str(e).startswith(R:S¯self.fail(#�°"Method <<{£`:s}>> 70ed lß unexpected "J óexception message: {exp:s}\n".C ‘†3, exp=e6 =L)) 9Efor ;p, recv_eöect_success, args in#>odsk indata = (–_prefix +dþ).encode('ascii'ª>tryX»rs.send(c8#0outx& =§ (*º/4if 22!= Y�.lower()„eGPWhile‰beiving< UAbad °G 3<<{¨ :r�£({nout:d})_?ed;‹³2<<{êL inK’)ž=i[:20],i9 ÅS=len(7)3º=gA ninFê{½ÿ ValueError as e if–1'‡?”Failed toäAž �ü1to Ñ7ed.ï ` ¶“ÿ1] ‘# consume"L{s.read(Ó!# ô-1, buffer) is supported, even though+#9notgš@= b" ¢‹ rð = bytearray(len(dataG)) ÿself.assertEqual(s.read(-1, buffer), len(data< 1!, , hù# sendall accepts bytes-like objects1ùif ctypes is not None:#ÇuG# =,2.c_*´ 32sx!= .b.from_½R_copyí 9#s.Ä(C M‘Q)‘Make sure!ùmsg et al are disallowed to avoid•Ð# inadvertent.1cloK!of„û and/or corruption?òof the encrypted6istream+Öò Raises(NotImplementedError, "€msg, [b"*"]#IArecvI?100C! ¿™ çaa_into,Ž`array(p qú.write(b"over\n")ÜÔUValueËK, -1VzS 6"ad6 Ë s.å#e(„�def test_e`_zero(�)*°server = ThÚqedEchoS–(CERTFILEš.0.__×Hr__(+¦ddCleanup(+axit__,¢5ð = socket.create_connec�ƒ((HOST, IGportbÇ'.aoù [ûRwrap_e÷(s, suppress_ragged_eofs=False<}]l # R/3ñ(0) should return no*-ø(ó g ^¯cv(0), b"") /ad)Qqï2# S·@rblock iò‘other endvaÑt2Oing(=Ö%!cvsDrS)), 0·Ð4non€_w×!,¡Ðcertreqs=ssl.__NONE<±ssl_version?ÿPROTOCOL_TLS_SERVERI ca‡ s=€’6¯hatty=True1 À coónnectionchatty=False) Åwith server:òs = test_wrap_socket(.9(),26 ZR_sidez3ÿcertfile=CERTFILE3 a_6s3Ðert_reqs=ssl.kO_NONl±ssl_version;öPROTOCOL_TLS_CLIENT^As.co„s((HOST,nl.port)+Ãsetblocking(ª dû%# If we keep sending data, at some point the buffersAñwill be full and+Rcall  3úbuf = bytearray(8192¸’def fill_r*()K®while True s.ÎJ(buf[ðself.assertRaises((±ÿSSLWantWriteError%6ARead5(),·)) ÷°# Now read Qaoutput5©discard it5ÇÂï Ïs.close(l9eðhandshake_timeout(ùHõ# Issue #5103: SSL 4 must respecú¡ L¢Ž2 = ÈgAF_INE¾õhost = "127.0.0.1"J½H up `.bind_ (cõpstartedMhL¦ing.Event($‘finish = ò†P Q‡r.listenIIq8.sec‡Ö%[]ÇšBnot ˆ pr, w, eðqelect.s"([ˆC], [60.1×]#ifóK in f I# Le»ùhang around rather than havingÁ@Q# it _ðd by garbage colµOion.7s.append¿Ê.accept()[0]Ð1for=Ë9.N æ�ItT �(target=Gh!t.5Ø`ed.waiÕÇ:try€ {c¹Àñ .c>=;(0.î"þPect((& , ý Î(0# Wowattempt³yjime ouB6ü õTRegex~™0, " dB"ÿÀ  øtest_wrap_socket, c) "‰finally:!Šc.close(//tr+2 = _.(Š.AF_INETC]< = ›(š(þ.settimeout(0.2Jð# Will attempt handshake and :M outÝôself.assertRaisesRegex·7`out, " dB-",D úc.connect, (host, port)ºv+Ùfinish = Trueškt.join¶eserverÑ12defƒ€_accept()ó# Issue #16357: &±) on a SSLSWñ created throughb#$‡Context.ˆ5().$cEcsl.SSL0ö(ssl.PROTOCOL_TLSD3Ã.verify_mode?ÜCERT_REQUIREDcc.load_5þlocations(SIGNING_CAb2¡cert_chain,0ED_gFFILE1G†  å = "127.0.0.1"­0H up `.bind_ (csa-", `_side=.?_.1%) •0evt´çhreading.EventgPremot…6Non’ypeer = yd(h,0non”"l L , >�"7|r.listeäp# Block™3the©Dwaitœqion to â‰c0evttÚ’›P  ¤+c.send( wrecv(4)N LTV�(target=å¦ht.stark‘# Client ÙSuntilæa setupõ£perform a óçã;äcQ=- «Í(Ê6ð(ï%vb'data'Ý! @_add=$0get‚8nam”ÉÐ Š (lëö# Sanity checks;8£IsInstanceç , °Ï5`Equal(Ø", »æ0get$w@enotà šôŽÐsl.SSLContextó(ssl.PROTOCOL_TLS) ò with context.wrap_socket(.p()) as :;B?ñ self.assertRaises(OSError5*cm37IÖ.getpeercert(‘Qñ Equal(cm.exception.errno, ±.ENOTCONN) ˜ðdef test_do_handshake_enotconn(ª)�ø0 = !BSSLC 0ƒÓ1?ýno_shared_ciphers-client_4†, server¡hostname =‚4ing­ó# OpenSSL enables all TLS 1.3 z“, enforceQ2 forUä"c�!.o2s |ÊPOP_NOèEv1_341# FUòdifferent suites on Pµ and master6ËE.set!†"AES128"½  -7256-<ÑThreadedEchoSR(b=MLÁ G ¦É,Ú= q_Ü= Ž ‰L�f15 s.�”ect((HOST[h.port)]grIn("no ±7"8N _e�Ls[0]Üversion_basicå5""" B!ws�ASSLS.C5().-CMore,âare done in thö_protocol_*() methods>wÿ•v_CLIENT!:e.check´… = False«' verify_mod´•CERT_NONE,Ф*OFILENCssl_0=d‡_SERVEREqchatty=È{+ O¬ÝA <‡vFIs(sæf, Noneh-è1_sslobj/çZðif IS_OPENSSL_1 E4HASßÈ=àself.assertEquû al(s.version(), 'TLSv1.3') ýelif ssl.OPENSSL_VERSION_INFO >= (1, 0, 2):<Kïself.assertEquy2yÿse: # 0.9.8 to 1.0.1e *InÛ(Ü'å:2')æ¢ÿIs(s._sslobj, None+ C-žð@unittest.skipUnless(CAHAS_j1_3,*! ";¡ requires 1ò.3 enabled OpenSSL"š@def 0€_tls1_3(ÍŠ‘context =ÃBSSLC�€PROTOCOL”NŒ3þ .load_cert_chain(CERTFILE*Éoptions |= (×ôPOP_NObAv1 |†_2Dkó with ThreadedEchoServer(­=a) as s Ž@%Ò.wrap_socket(."()A <ós.connect((HOST,e[.portO/õ�åcipher()[0], {à+§ÿ_AES_256_GCM_SHA384').ðCHACHA20_POLY13054?2564 b4128b.}yŸXÇ@Ýqhasattr{г, 'minimum_N/')ô‹"| 1.1.0gtmin_maxT client_Ï¡hostname =^4ing(1# cG£0¤¿9.ç”BTLSV‰.ê@ë >(ax%>_~#¤S only£%œ^ @žß’Ò a˜Ù‡ÍàZt „ = Ž&9 5r$1.n¼�#ÀæÀt.minimum_veñrsion = ssl.TLSVe Cv1 ò server_context.maximum_v->5_1 Añwith ThreadedEchoSR(R=aR) as :C‹Geclient�Âwrap_socket(.9(),=A q¤_hostname= Ž ‰Hós.connect((HOST,²}.port)){óself.assertEqual(s.@æ(), 'TLSv1.1')5"# ëD 1.0^æ 1.2 (mismatchf½PO.min¢2¦ @â@ª•€~ >~>]¼Ô3pRaises(¦�SSLError˜e˜œ+òIn("alert", str(e.exception)) �ô @unittest.skipUnless(hasattr£C,;, ' '— ò "required OpenSSL 1.1.0g"êy´HAS_SSLv3, C!s @ sup’B@def º„_min_maxÄp_sslv3(r)S ˜„æ$, #! =U4ing(±Œë›·Ý ƒ>-Y |…Y¼¶;0´ž pECDH, "| å s f-enablò ©üdefault_ecdh_curve¦ñ # Issue #21015: elliptic .ð-based Diffie Hellman key exchaSnge õ # should be enabled by default on SSL contexts.8² = ssl.SSLC#(ÜPROTOCOL_TLS)3ö .load_cert_chain(CERTFILE*”# TLSv1.3ˆõ s to PFS key agreement and no longer has KEA insÝ# cipher name½¢.options |ÆPOP_NO´Gv1_3DPPrior‚@Open³1.0.0, ECDHa`s have$HBóexplicitly using the 'ECCdraft'E÷ alias. Otherwise,D4our0DlistÀaprefer”c-based%sCÖautomatically!ifÅõOPENSSL_VERSION_INFO < (1, 0, 0):J<R.set_e4s("Ò:"Ñó with ThreadedEchoServer(E=a) as s m@%Ò.wrap_socket(."()A <­ós.connect((HOST,ef.port)§+Ðself.assertInÖrDH", s.èq()[0]) ñ@unittest.skipUnless("tls-unique" in]öCHANNEL_BINDING_TYPESßv &"'Eà' channel bind?�not avail±h@def ŠR_tls_~a8_8(ÙȆ"""Test k jA."""é�( up4Š.verbosejósys.stdout.write("\n")@sclient_È…@host©! =É4ing(F / =P $>g—§chatty=TruwS3ion;WFalseª¶‹ )  ÖrxäëÕn_J= 4Q# get½Mdata§0cb_ .g·v_   g ˆ*\" gotÓ £ó: {0!r}\n".format(¼)ÀGö# check if it is sanB&\5…sNotNoneV £íF³sion() == 'ô',_•Equal(len_N, 48Q&el¢À û* self.assertEqual(len(cb_data), 12) # True for TLSv1 ý# and compare with the peers version5ý s.write(b"CB tls-unique\n"),J”þ_repr = s.read().strip(2 Ù C,c Ó j ú.encode("us-ascii"))º# now, agaiìÿ client_context.wrap_socket(Š./()¯ôserver_hostname= }) as s:Yòs.connect((HOST, An.port)CCnew_ röget_channel_binding("¹·`if sup_Ž.verbose•x�sys.stdou »&Ó"got another � � µÿ: {0!r}\n".forma`Lä!ò# is it really ¶ ±€#No\M/, v :•IsNotNoneˆ hc]cq() == '¥?.3'lò .48ò/el¹M ?W ’³ pdef teséQmpres–Ñ)� …$, Æ! =K4ingçPstats–pparams_{(` B‹ pchatty=÷#, 48ionGJsni_™6·  " úcW:: {è'['#'']Ö†ê?In(-@, { mó, 'ZLIB', 'RLE' }êP@unitcÿ.skipUnless(hasattr(ssl, 'OP_NO_COMPRESSION'»i]"ssl.3q neededpAthis]` _disabled(ãiÀ_context, hoó stname = testing_context() dclientõ.options |= ssl.OP_NO_COMPRESSION8oserver8 stats = @pparams_ (‹,#´,{ºðchatty=True, connecÐG@sni_:2=hoC0ðself.assertIs(sÎñ['compression'], None) i1def}B_dh_ì(B!):Ã÷# Check we can get a»õ with ephemeral Diffie-HellmanF<  É  #«ÿ scenario needs TLS <= 1.2n5uTLSv1_34ñÎW.loadhDHFILEg _ÿset_ciphers("kEDH"+ �¸†¨ ÁÉ"["U"][0]q1parj—.split("-:òif "ADH" not in 2Pand "c:DHE.ÈÌÛâ.fail("Non-DH }S: " + 3[0]P@unitúò.skipUnless(HAVE_SECP_CURVES, "‡ósecp384r1 curve supportÏ LðIf(IS_OPENSSL_1ó, "TODO: Test doesn't work on 1.1.1K³Qecdh_m´Î •", ‚U autoƒ% Ò– FlF. ›"„À‰?ðECDHE:!eNULL:!a:N' |"`1³—Ÿ&úæ�Á#~ÐÝk(â*ª Eá,À("ECDHE:!eNUÓLL:!aNULL") üserver_context.options |= ssl.OP_NO_TLSv1 |&_1Fstats = Nôparams_test(clienta,#q,C�ðchatty=True, connec¦GÐsni_name=host %) 7#˜2 / ±õ curve mismatch)Ï \0 = ÿ4ing,(u E¡.set_ecdh_tÏ("prime256v1© 4�secp384r3 ðciphers("ECDHE:!eEEtry:9Ùs'Jb+(K/aexceptŠSSLErroréEpassúJelseõ"# OpenSSL 1.0.2 does not fail although it should.L~úif IS_OPENSSL_1_1_0_%Pself.O$("ÄÓ5didl"1def¯ð _selected_alpn_protocol(N)e.(ð) is None unless ALPN7useÆ  EMKI4ET¡.assertIs(Î#[' ~1'],T¬P@unit\a.skipUh(­@HAS_p0, "ó support requiredMì C_if_ÇAuses 3s by theaÔôŠ7, È Eös(['foo', 'bar']�z¼ æH Àpn_protocol'ð#], None) @unittest.skipUnless(ssl.HAS_ALPN, "ð support needed for this <!")L1defñ_alpn_protocols(self):#sfserver ð = ['foo', 'barµmilkshake']7P_rs5V(D1], S,),%bp%€6, 'O€http/3.0¶ E4.0'c™Æ8fclientê, expected in è7H:“context, K¡hostname =‰Cing_(£E 9N.setµ ¦ @ ‰@"Îsp}:tryÛ@statÚžaparamsð(OÎ Ö;N;!¿chatty=Trues¯connectionB%@sni_Ê=Ó €pexcept ©ßSSLError as eTeð(Fif (vsù and IS_OPENSSL_1_1_0@>)|*÷ VERSION_INFO < (1, 1, 0, 6)ù>ò# OpenSSL 1.1.0 to Ñe raises handÿ eÚ ƒQñ.assertIsInstance(>, 5/ls!ñ msg = "failed trying %s (s) �c).\n" \ŠÓ "wzÂ;ð, but got %%s from the CGs% (str(®8 , ŒI3ß)N‘result = ;#[' ¿‚:TEqual�OÎ3},% A"‰"ºkº ºs'][-1]¶bif len5/['@ý) else 'nothing't I  ! A" }dd1sel3'_nl k"# 'Àed_npn_protoð col() is None unless NPNcused öclient_context, serverôhostname = testing%()Etstats ==pparams_0(` C�øchatty=True, connectionG@sni_Ê=ÓÀÑelf.assertIs(Î#['ºñnpn_protocol'],Q!) qP@unitæa.skipUeð(ssl.HAS_NPN, "sñsupport needed for thisP"…1def_n�s(self):lœŽrõ['http/1.1', 'spdy/2']2+Œ0Q(?&, V,),2e%] 2 -Eª,0abcÊ1def(#°ÙE¡äôs, expected in ûEH:õ+I’IM.setÂO�sÌ? ˆ?!?©wF¡{3Kñmsg = "failed trying %s (s) and ‰c).\n" \’=c "wasÿ9ð, but got %%s from the AGs% (str(Õu ,  Œ A0�)ô`result½<n é ¥TEqual[Jý , L,% "Á"�îF� �o'][-1]€dif len9;ÿ) else 'nothing'Ü D–Ü "ÜX@def q™Jörsl.SSLCÅöPROTOCOL_TLS_SERVERÊp ö.load_cert_chain(SIGNED_CERTFILE86oth^x @ wÀn(SIGNED_CER“TFILE2) ò client_context = ssl.SSLC(ÿPROTOCOL_TLS_CLIENTAö.load_verify_locations(SIGNING_CA9Ôreturn server�X, oth   ¸ðdef check_common_name(self, stats, !):.é1cerÜ`['peer%']!=Ò.assertIn((('ZSName'N@,), 6Â['subject'])�¡@needs_sniPŸ@test‘_callbackŸ’ˆalls = [„ ªtelf.sni<#s(�ò Ø./@host‚ = False¿/´Š 0_cbùd_sock,¢”, initialtÒGî¢s.append((Qž9 9(ifgÆ is not NoneÅ(1sslš.µ 5…) [R.set_“ËšxbCKh €_params_Ú(–#‘,‚†¿chatty=True0é¤ö='supermessage'Ge# The ãñwas fetched properly, and theɵificate was±Ò# changed for*PonnecÇ.&.aEqual(øX, [("�"()]¯1CERŽ4‚š selectede¸�I(–t, 'fakeí'¶‹ YŠ] xed withx=q�.¤G‹(� :`²4ED_¤—_HOSTNAMEj0# C…¢ disabling0ñGlê ™Âpú�™'notfunnyŒDCertacdidn'tZ€%P@³ … —Ài def teóst_sni_callback_alert(self): ñ# Returning a TLS 'ð is reflected to the connect+eclientFøserver_context, oth.0 = ….�2Es() M„def cb_r˜¹“sl_sock, nÔname, initial]ÛâEõ ssl.ALERT_DESCRIPTION_ACCESS_DENIED^ÌR.set_pN(¢)CBwithäÐassertRaises(†öSSLError) as cm‰®QstatsOÊparams_test(C¦,{GÏchatty=False5©ýö='supermessage'ðÏëòEqual(cm.exception.reason, 'TLSV1_ˆ |'þ`@needs¶Ð ýy�_raisingÉi fails±1on “á‘handshake*2ureó.t<ïRÎ4�Æ?1/0�Ÿ s\Ù­˜5, \r:ñ support.captured_stderr(È ÌÚSSSLV3ÌÿHANDSHAKE_FAILUREñIn("ZeroDivision2", >³.getvalue()²Swrong,__typeI1 1¢ terminate5ê%on#CÀn internal eÉ=Q´ å (U"foo"Ø íP †¨ ZuÀlient_contexÿt, server_context, Ïchatty=False5õ sni_name='supermessage')uÿ2self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_INTERNAL_ERRORLñIn("TypeError", stderr.getvalue()) ƒð def test_shared_ciphers(—!):#eclient3 CP hostç! =N4ing,(ë EE.setoö"AES128:AES256"4 ¬ 4 -õexpected_algs = [ÀÄd0 , - !£# TLS 1.3 ù are always enabled1ñ"TLS_CHACHA20", FAES"]g€@stat–Ópparams_}(¢"i‹DÎ!= ƒ#['‚ óU'][0]ß—ÃGreater(len(KF), 0`@for ý°, tls_versi´tbits inMM àif not any(alg'B K Í‹>¢Pfail(: Ïàread_write_aftîÁlose_raises_èB_P = Th‡qedEchoSu(u=$%(, ]ÌåCwithm @I 6Ò.wrap_socket(.&()�U ›H= ñAôs.connect((HOST´m.port)+}(ØBúR— (V›²0, sü{d, 1024O8 ö£, b'hello'vé|endfileûõTEST_DATA = b"x" * 512Š€open(supå.1êFN, 'wb') as f£!f.Š((YǼ¥addCleanupSŠunlink, c8>² = ssl.SSLCÄ(ÍPROTOCOL_TLS3Ã.verify_mode?CL…REQUIREDècP.loadÌ5@loca�Îs(SIGNING_CAb2¡cert_chain,0ED_gFFILE1a  ‡ 8ŽH u=Àket(socket.sûocket()) as s: ýs.connect((HOST, server.port))/Ðwith open(sup$Ñ.TESTFN, 'rb'eNfilehw`s.send (^%ðelf.assertEqual(s.recv(1024), oq_DATA) �ödef test_session(self)€äclient_contextß¡hostname =G4ing( ƒ# TODO: dñs aren't compatible ±TLSv1.3 yet�Ð �ñ.options |= ssl.OP_NO_8"_3Ò5`# firsaœ1iona4out„`sstats =¸€_params_({ üCr@sni_=( {ƒ#['%']YŒÌSTrue("8.idGðuGreater'time, 0,?out/ `has_ti[#if�÷ENSSL_VERSION_INFO > (1, 0, 1Y1à¼`P_lifeÇO_hin�aFalse(ÉF–_reused']£>_&s¦«.1ions¹¡M1ess& ['accept']ײ 1@hits/0{!# ¨–]ì=÷/, § ò6=2šÄ61/˜ @ú@ion2à ,l„50.idûz 2/³TIsNot¤2, GÒ _.8i=éý@9out•¢another onš9|.úOion3ÐNotEqual(sessóion3.id, session.id) óself.assertNotEqual((32/ó ss_stat = server_context.6(s(3b_&ß['accept'], 31@hits/51) Ãt# reuseße again­s®ôparams_test(clientÁîÑ,C+õ=ð, sni_name=host ØQTrue(š#[';_Å8d']1°4¾Etats,%']œÀ^Oion4ò 2q‚¼zGreater3U.time8=:out@8outCoD4däÝ o2o@def ;_µ�handling(ˆ%):—[  ! =P4ing‡: E2, _, _2xu# TODO: Uõ does not work with TLSv1.39 lñ.options |= ssl.OP_NO_4_425 j7ñ = ThreadedEchoSL(L=$æ, chatty=FalseºÉ+z¦ ÒÂwrap_socket(./()êXq_ÂéZ as s‰1#�ðis None before <Ushake/M•“^,B.2X9à.connect((HOSTŒo.port)h"’“¾ èwM§ºðRaises(TypeError)ReRñŸ = objectˆ Fptr(e.extâion), 'Value iba SSLS®#.'óm­Tus¶ À Ð # cannot seûssion after handshake ýwith self.assertRaises(ValueError) as e:9HBs.seg#= (\ýEqual(str(e.exception),3[ /'CÙI.') IÙò client_context.wrap_socket(.(†“ôserver_hostname= -s-› ˜fbefore™S and .th¨€# connec3 w“©stablishedø¦˜.Q‚((HOST, Ô~.port))S#Çü0.id=?.id;85ß_reused, Trueõ2ö7#÷’dre-use$ œòa different SSLC¤ y,E¡>1 ,Ô S;¯refers to Úò def test_main(verbose=False)p`if sup¿.à im• warningse•plats = {.�'Linux': `form.l�_distribu„ ¶H'Mac0{mac_ver%xWindows)Zwin32+}Œû´t.catch_(ö°t.filter(M%Š'ignore'œ r'áA\(\)�ô'R1fun˜ÿs are deprecated .*gƒPendingD'BionW— ’ @for j , m1 inœ|s.items Í»! =.(K!if@è*6[0]-!â = '%s %r' % (†W6Ybreak$?els@B€ = repr( h (‚qprint("ýAssl:ðing with %r %r" %  ÿ(ssl.OPENSSL_VERSION, „_INFO)) <tprint("ÿ under %s" % plat+ÀHAS_SNI = %r/o6äOP_ALL = 0x%8x87Etry:¥ž ©ßOP_NO_TLSv1_1OVûexcept AttributeErrorhAass zñfor filename in [ŒõCERTFILE, BYTES_"@ONLY , 4KEY+;:fSIGNEDS !2,uING_CA,73BADW ADPQ EMPTƒ]àóif not os.path.exists(fä))åñ!raise support.TestFailed("Can't read certificate, SJxtests =B`ontextVÔs, BasicSocke1SSLœ!’MemoryBIOö…SSLObjec7òimpleBackground/0 Th­e>]š%ifâðis_resource_enabë—'network'Í’.append(N [)Utou_info =`¢ing_setup(– èm€run_unitk (*s.gfinall2]’cleanup(*†€) if __Êò__ == "__main__"õdP() imò4 io Ushlex Ttring¦à # The orig¦ Sñ$ data set was from shellwords, by Hartmut Goebel. 2ð= r"""x|x| foo bar|foo|/  %$ 8Ê0blae fasel$Bbla|q x y z$0xxx€Ay|z| 0 \xPB|\|xˆ-\  \�2º6:B ýa"bar" ®1oo||q "foo" q "bla"|#%9bar#] !UB€U'bar'€€a'foo' q 'bla'||| 9 #a !r/B` blurbñæ ²a" baz|Ï |;�Ä;'; ;Â""|""| ''|''�"r„!""ŸN&''2"" çÎQ :I'' '@p4a \""|\…@"\"|Éà\ bar"|"foo\ bÐar"| "foo\\ b  6\"|\4"5$\"•"|bar|\|"! d dfadf&|e*\"* +xB , - +)°\''|\|''| ' ]''| Œ »Q³ df'a\ 'df'-\|d \J"'Sfoo"|%\x3\|x•x4xQ A "| ­´xx|foo|\|xx\¨,¨4 x\k Û \û Ë8# ,5\'' \/}J 4Q"fo'o"4|4£ 'don'\''t“s?& ?'|t ‰ú^ ��#bar\nbaz¢ñ :-) ;-)|:|-|)|;ð$ áéíóú|á|é|í|ó|ú| """ posix_data = r"""x0foo©[u/  %$ 8p blae fasel$Bbla|q x y z$0xxx€Ay|z|  ä"|x†!\ ó%| rˆ .)"“6:> U " ¼ ²"_"bla"Obar  ý!ooÌ r^'bar'r""' Z'bla'rr fáà ` blurbÍéíŽj!z|habarbar|[7‘² ' 7‚""|| ''|ž"fr)|ÿD 2"" ¸À|2G'' '8K0| "‰ÑârT÷  <pD\·\1¹yU8Wd &�'Ú ( ) '&:\'|e˜�}N•�hòT_S… !\xXÀoo\x"|foo\x|‘ "foo\ "|!|  xx4 xx\\3S xx"|D1x\xW\ x\x\+\}6bar7z\foobar&.\'(')'AR1'foTÀ" 'don'\''t'÷¨6t<? \\?0\| ±S\ bareæ u!0foo3�#bar\nbazf|Ð :-) ;-)|:-)|Ç Ã¡Ã©Ã­Ã³Ãº| ð """ class ShlexTest(unittest.ó Case): def setUp(selfñ .data = [x.split("|")[:-1]<' �for x in 83vlines()1X`posix_&^kdDj*@item‘vpöK T[0] = ð.replace(r"\n", )í R„X"Y‚^š†,@§, comments–‚Ñ range(len(Ö)#ÜPl = sü$f[i][0]V=_‡7*ÒassertEqual(l�?I1:],-1 ÿ"%s: %s != %s" %. ˜ h1)) <@oldS!0retB_6lexüö(io.StringIO(s)Íötok = lex.get_token(šwhile tokÙæret.append(tok/Q ¦return retÙ‘ÚPßÉ0"""  €¡ting with yp parserð€¾,;R.,mýGTruecŠaCompat4†cøibility interface}��¢Ielf.Ýqj*0]\H –\1›> ^89l, 81:]¥BaSyntaxÒÿAmpersandAndPipeWPhandl×Aof s?ëxof &, |dñ# Could take these forms: &&,.@&, ;!;&AÐ # of couróse, the same applies to | and || #'ðse should all parse-Aeoutput4ñ for delimiter in ('&&', '|;8s0'||8&;Y;|'):9ñsrc = ['echo hi %s fbye' %�,6l6/%s4]45refjžGhi',` M{ ; ss:srcÀŠ¡s = shlex.ù (ss, punctuation_chars=True)’<þresult = list(s!òself.assertEqual(ref, 7ñ, "While splitting '%s'" % ss) mðdef testSyntaxS) Semicolon(]‘Ð"""Test handlNAof s8bqof ;"""]Â1# CdCtakev°forms: ;, ;&&1?theœ/;¬;–Íœ^4“ÿP�Redirect’%>’of cour/?<, +><�ß?outÚ 0 / Ê? 3ý¼OPareù&*()hÉ’(T]hi )'Ü!'(Ððhi)'] ref Ð= ['(', 'echo hiS)'] åfor ss in src:¡s = shlex.ù (ss, punctuation_chars=True)8úresult = list(sòself.assertEqual(ref, 3ñ, "While splitting '%s'" % ss) eðdef testSyntaxS)pCustom(Z)ÂÐ"""Test handlKAof s5_awith c@ Ï1"""g@ref B0~/a6&0b-c ±--color=aut] ||dW*.py?fsLÈ"~/a && b-c <a || d 3}1w} 6"|"_Ext1¯TokenTypesm`that t'Cs arÉ ft8Ø as expected.l‡eource,!•(Ž’"('UF?c',0A [('Ð�a'), ('&Øc b½G2 ('ñ;_a')])„ ¥Ñ êk€observed¨ÔVwI�tÙQ.get_«(CÞif t == s.eofA#]break'90[0]»-s.ÂJt�='c'MOelse3 a3ú.append((t, tt)â 6| nP÷pInWordCü 8any._@remo´�from wordz `'a_b__b SF='_'ÞÚÕNotIn('_', s.f+‰®2, [ :'_ ?c']áWithWhitespace— w1_òè, behaviour is,+ V  %&%,# yn™False, soåll be based on¢#Û „YrZ2^Xã)À s.whiteóspace_split = True x# white"!is#Q, so 4üting will be based onB Cðself.assertEqual(list(s), ['a', '&&b ||Qc']) @ðdef testPunctuationWithPosix(Y!):(Ãæ"""Test that p1À_chars and p8õ behave correctly together."""Oõ# see Issue #29132¡s = shlex.Â('f >"abc"',c=Y,…)Hf >!abã} \\/\\�C\"“ÿEmptyStringHandling’ 0ars>@of e;! s<Gs is‹hK/edŠE1999BÐexpected = ['-)2$2forб in (False,×<Y@"'')ÕÔ kÕKã0 = +(s õs&$, Ë.Ý"''", 'ß · z †\Quoteåpsafeunq‡Öó.ascii_letters +í`.digitÅ'@%_-+=:,./'ª÷8unicode_sample = '\xe9\xe0\xdf' # e + acute accent, a + grave, sharp sP�Hª"`$\\!' + df³ —áØ`(''), ƒ�} Ö .0w9), žB 'ö¢ file name€ "Žäuà unmÛU!%see % u),¡< "š1"21†'"†'‡Vˆ0'\"9 '@á # Allow thisF0 to¸u·ƒwith oldÉñpy if not getattr(Ð1, "øs", None2è@methuuPdir(S/€$94if 'p.startsv(í!")’ A != zCompat"Â1del”e,Y ) ¹ __Œó__ == "__main__EÐunittest.mainóL() # A test suite for pdb; not very comprehensive at the moment. import doctest import os 4pdb$%syEtype @unit‚(…ubproces"ðtextwrap from conClib f’ExitStack!$io‚StringIOf0sup«ñ # This little helper class is essential@0ing!s under ø.`.%_m¢_FakeInput)óT.mock%‚patch }qPdbTest5ò(object): """Cñ manager that makes̤dPdb in¡Ñs easier.""" Fðdef __init__(self, i¡ei." =;Senter< 5ñreal_stdin = sys. xY6 = †p)+ãelf.orig_traceO1getô() if hasattr(sys, 'É') else None¸xóH*exc½™þÉ’1if •—Ùï  *@) y$ópdb_displayhook(ˆ1"""’$smwcustom ,ŽBpdb.ÙE>>> Wófunction(foo, barX0...ŸnåCòPdb(nosigint=True, readrc=False).set}(—IFpass€Ywith µ[3.j'foo', <¥&·_œq[0]>(3)OH1-> \‘(Pdb) fooç17barå&0@2 34RþÖ Zèbasic_commands]íÄ"ß"0 ofØR %_2T«='default'r­2fooþò¸=:i8Å 0 O+10†Pénever_executed?V`'afterK'uK'...`returná†.upper()€ ”«]hx&Qret =èÛ{_2('baz¯ç7ret§àwith PdbTestInð+put([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE ...� 'step', Fú entering the function call7Gargs7vdisplay2 2Glist2/jsource1b/šc|backtra.uÆ.×p up to _Ë*()eGdown–7 9ª_2() againA6nex¨ # Ap@»o print(foot3vzor loophY ©h inã­7Tuntil8�# continu¡r out ofîA ­`execut@«â;barâcjump 8w!# ßover second fkTreturŽ"# ¢Á Tretvaà$# $;KvaluU5e',I5]): / /3> <_.S5pdb ñ_basic_commands[1]>(3)'¹z ->Ù! =I—‚_2('baz'HQ(Pdb)K™�--Call-- ‹Z0]>(1‹ÌMm-> def‹ófoo, bar='default'#™Üafoo = ¹O0bar53îq 1 ->p{1 25{]4 3bÃi in range(5Á1 4Ji{8 5Äâ9 6 g%10h7( bnever_A#ed8‹`'after%5 9# '4...! 10“foo.upper|Q[EOF]y–!bt 1... æ2[£8)f*->Q^D+(puÊùÀ= test_functñ ion_2('baz') (Pdb) down°> (1)'Rfuncta\a-> defI_ñfoo, bar='default'):}ŒAnextŒ"2Œ’print(foož n?bazv'3vùfor i in range(5ìOstepv'4vìiêQuntilm01234w"5‹ 8bar�åz'6z {)10|ojump 8y'8y~©'after forlRreturn!†1...1--R#!--�".10žq->'BAZ'U2-> ˆ¸ foo.upper( Rretva.52�continueH1BAZe""" îåpdb_breakpoint.(�@"""TcL LÆ related to =1s. b/>>NQ0...ÍÀ import pdb;ó.Pdb(nosigint=True, readrc=False).set_traceþIÂ1 23"4)»’First, neÜðclear bdb state that might be left ov9Árom previousFs!øOtherwise, the new0Køget assigned different numberUfgŽ=B¸x.¹2 = =”¿bplist = {};Bbpby’ = [None] 1NowßÎúñ . NORMALIZE_WHITESPACE isT’ed becaus“E“Ðoutputs a tab’kð"stop only" and "ignorQ1xt"Âð lines, which we don't want¥0putÙGhere¥€with Pdbâ³Input([ # W?: +Ình'¿J 3',œdisable 1¸L1 10ðcondition 1 1 <À 2', ...Ÿ 'break 4 ,|clear 3Z ¼condition 1nenable_ /ŽcommandsÓlp "42"_`print(�, 7*6)',ñ # Issue 18764 (not about ¿zpoints)3 (3), P2-> è1`R(Pdb)¼! 3�BðP 1Ÿ€$:N`2dis»bDdwk<±ignore 1 10mWkùnext 10 crossings of….3´‰a 1 < 2FNew set forDœ! 4:X2X)N¤`3`:¾�Num TypeòDisp Enb Wherí81 � keep no1/atË%KE8wonly ifš ìAhitsÂ2œ_yes //3]IìöViDeleteAôÿ)Àt test.test_ñ-pdb.test_pdb_breakpoint_commands[0]>:4 (Pdb) condition 1B4Å 1 is now un&1al.'=cenable:E &d v  1 at #%0(4)TP_funcÃ(ŠA-> p¢2¬CzCM2all«As? yY2Á)gt! 5id4a)Nß&onkXÐo0®'5® 3®/-ß_ñ""" def do_nothing():;EpassJsome$242)#J6lis,GÀ"""Test the !Ä and source X@ of | y@>>> “Tžc_2(foo›0...„z importC!C,.ä ''ß2...\=^'more?cod.to*?mak*a)OlongOistinuseful1¯return fool» gApdb;§óPdb(nosigint=True, readrc=False).set_traceTIQret =¯v–_2('baz')�€with Pdb7³Input([ # ú: +ELLIPSIS, +NORMALIZE_WHITESPACEÛt!',/" #‚dfirst Z /Fstep/€ into seÆ5d0c}�ªing to EOF˜c@ 1,3œÇïspecific lines/x-;øinvalid argument,À 'next', ð # step to import ...� 'next', *Oover,H ,úinto do_nothing\qlonglis` # ª all lines*`sourceIAsomeKi 5Ï of functionA`fooxxx;ÒPû that doesn't exi ¥continue',Z5]): „ test_!()`> (3)" F�-> ret =Dc‚_2('baz'jQ(Pdb)Ey2 1ãj def:(¹5 2% P pdb;ó.Pdb(nosigint=True, readrc=False).set_traceïp 3 ->L¶Q[EOF]±ÀC�--Call-- FZ0]>(1F#_2Ÿ.-> c_2(foo…—xEÏ E 9JÍë3pdbS3 ".*²4 4*'C...'M5W'more6H'cod77'to:8H'mak:9&'a9$10'ã”'i5ing! 1Ÿu'useful/* 1L' 7 3¡return fooR �¢A 1,3o!! x“0***¬ ±525 ¬ds, î¨ lyAstepˆ .%..u�.py(...)Z Î[¹ý_5"Ô2pasÃNÀY3a0do_áᥠ[xrint(42÷`ßZÁà """ defð test_post_mortem(): """Test  ñ traceback debugging. .r>>> defN¤function_2M0...TB try^11/0Dofinall)Àprint('Excep`?!')~ |°import pdb;ñ.Pdb(nosigint=True, readrc=False).set_ò)() 2ä ¥0NotOXched.§€with Pdb\àInput([ # docWù: +ELLIPSIS, +NORMALIZE_WHITESPACElp'next',EE´step over e#Ú-raising call<b:<`get a Üó +5lis- # { code oñ )['downŸNinto&o#` :¥continue',]Ð^‚z_Ñ ÄIý ZeroDivisionErrorÆ÷ÀCorrectly re{þ¡3> <åÿ.u3pdb �q[1]>(3) •!-><¬`(Pdb) ø"¾# dÍ� by zero(£P!btj1... ó2]>(10)¦ ÉJ´0ɲ4-> ø½V10 SÕ1 2!Ý.t 3 ->Ph5 4" ö íQ[EOF]Ðß œ?@» A > ͪ ÿ ª9 5B9 �'K ¸"De""" ’pdb_skip_s¹ðhis illustrates the simple case of module ðskipping. >>> def ¡_module():0..."ï import stringÐpdb; pdb.Pdb(I0=['.ù*'], nosigint=True, readrc=False).set_trace()Y>öng.capwords('FOO')²ùwith PdbTestInput([@z'step',‡continue]ë½>°> (4)Ù#->@ Ôc`(Pdb) ´t¡--Return--ƒ/a->NoneM‰)1‘""" # MA for 1ing4KB of ;ò that makes a callback mod = types.HbType('51_toE�') exec('�”foo_pony(E•): x = 1;WQ(); r) ß ',…Ð.__dict__) I¨_A_[ñÿ"""This illustratesäså=ÿ into other codeTšBp؆Œr M|'Nmod.~|,Üxã¤(£TÌEàpass # providåPomethÓ@to "„A" toy} X5f OCall "�&2)wá-ý ….3x å t*ûƒ ‰\  Œ”Àules_with_cañ8llback[1]>(10)() -> pass # provides something to "step" to/á(Pdb) continueô""" def test_pdb_ ô_in_bottomframe():2´Test that "-ð" and "next" work‘’perly in G Hñ (issue #5294). UE>>> …„functionr0...íð import pdb, sys; inst =ò.Pdb(nosigint=True, readrc=False/IÓnst.set_traceL 2bot­=jB._ge ()lphackerya ge pe rightè7ÔQzprint(1ƒ23&4))€with Pdb‡pInput([–0docĹ: +ELLIPSIS‡'œ*',|break 7Ö C,]C®_íš3> <È‘.$5pdb Ÿq[0]>(4)0 T!->*.Õ1C¯05¯3sªvB¶`point K/at5)!:7Tfµ12˜+7é òƒ\3y08y 4ky ü4}pinvoke(_sod, argÐa"""Runˆ(.>¹€getattr(Ǩ ", B)C ›@run_þô_incorrect_argument-0"""1run–€runeval : :` firstÆ@‰[pti =a'2',]5³R2ptiŒð,ò'run', lambda x: x=TyÙó (most recent call lastYðTypeError: exec()¯û 1 must be a string, bytes or code object2¨ $¬4?val¬91ð def test_pdb_rðun_with_code_object(): """Testing run andPeval 3 3 3ñ as a first argument. F2>>>/0PdbOñ'Input(['step','x', 'continue']): # doctest: +ELLIPSISK0...˜ð pdb_invoke('run', compile('x=1Q€ qexec'))B$> ñ(1)()...`(Pdb) š¡--Return--=a->None"@x 1à Bõ9x=0 — + ?val  Ì‹�""" def ¯Ñ_next_until_r94_at LevenZP thatÎð stops after a H/H/HÓ issued at a adebug WjŒ¤function_2ÏI2 = �2œ D BQimpor¹;¾ò.Pdb(nosigint=True, readrc=False).set_trace(‡y6ª â)1endçQƒ“from bdb ½¥Breakpoint#.‚@å?ñ ÂbCúÄ!',Pâ@ê' äL ¥# y' o‘I p9•q]µy =w3> (3)6ñZ!->R_v* t 1ß¡+B0]>:Ûxkþ-Z0]>(2þçE-> x0|¿zH‡*‰ ‡‰¼�2~�Þð> (4)6ùfunction() -> #_2á(Pdb) continue,`> (2†o�-> x = 1i|Ì1--RÙ!--‰13‰R->Nonë�2o�a-Ž5uŽÿ�16�;end— �""" def’_�ñ command_for_generator():?ð"""Testing skip unwindõtack on yield for =s"^#" _ OE>>> ‚4geng0...áM0,>nv2V4Â2°import pdb;ó.Pdb(nosigint=True, readrc=False).set_traceðI2t =CÁ ¬:tryvÖ0if ž(it) != 0"&°raise AsseróYError\%H Ðexcept StopIt¿žion as exj°if ex.valueŒ1"gŒöprint("finished")‰€with Pdb7éInput(['step',µg#4 i #¯3|#']LA•_§ ?pdb¬2 #´O-> i¯%ç}3 ¯À) -> tryñ: (Pdb) step°> (5)3¡function()W`-> if ;Ÿ(it) != 0�--Call--5Œ*R0]>(1Œ'ge‡1defÚ·(()…žx32xqyield 0atp73p‡return 1qå1--Rh5€"->s?-> ƒ `StopIt8Cion:§ñ*}7 }lz�continue�finished U""" (>pdbô”coroutineCð"""Testing skip unwind‚tack on Efor = s "�#" S ƒö>>> import asyncio  N†0...ÔU awai:‚.sleep(0Š#/¡ ‰Lmain‰ÄPpdb; FóPdb(nosigint=True, readrc=False).set_trace9 ¯[ñ ÷×<dloop =I°.new_event_ h .run_untilèaplete(zâ H1Lclos²tprint("Z&")²€with Pdb2€Input(['�!',\¸Ë#KF #3¯a#']gØL­ôû „S[2]>(„£S#->p.ìÂ(t,ZˆƒtoˆÄ³ �*€| €Àncio.sleep(0ñ) (Pdb) next°> (3)3(bò -> await asyncio.sleep(0€=4€+ÿInternal StopIteration/2Lmain 4Astep{¡--Return--¥* Ša->NoneY«�rcontinu,�finished9�""" def50'þdgen():3ðTesting skip unwindðtack on yield for Ncs"„#" … O•>>> imporh{ Ÿa�0...g1F±#ž2f>ì4‰Ò_x in Ž“�print(x)\C \ýPpdb; ±óPdb(nosigint=True, readrc=False).set_trace�¥­Ä‡C@funcÍ<eloop =ê new_event_ h .run_untilSaplete(aâ#]\.clos²0"’"9€with Pdbk€Input(['W)',ðv#„F #ŒF™#']]3L­ô> ¸_gen[3Ç,OCallÅ'‡Ä1écêú8£ S)2àÌ….gx6 qàÀ> (2)2ácoro() -> "ñ for x in agen():¡(Pdb) step�--Call-- `> yield 1xÌk-*3)kRawaitø¢io.sleep(0z�continue~2�finished �""" defú�y_returnz”generatorNó"""Testing no unwindng stack on‰;so! Ÿ"e#" à E>>> ‹¼0...áV0,Im�2Vufunctio2°import pdb;ó.Pdb(nosigint=True, readrc=False).set_trace~I2t =LÁ ¬2try�-Ö0if ž(it) != 0"&°raise Asser¿YError\%H Ðexcept StopItÆžion as exj°if ex.valueŒ1"gŒtprint("h&")‰€with Pdb>€Input(['•)',µg#4,kRw#']€óa_†öº”[ƒ3 YO-> i�w54ót?5tR �� R0]>(1Žõ-̇O~ ™:É07‘ &� 98x ‰Àration as exñ: (Pdb) step°> (9)5¡function()Yø-> if ex.value != 1��continue,�finished �""" def�‹‚²coroutine()Võ"""Testing no unwindng stack on yield for ;s"à#" á …ö>>> import asyncio ¢P†0...dU awai:‚.sleep(0#/¡ ‰Lmain‰ÄPpdb; ÖóPdb(nosigint=True, readrc=False).set_traceÇ ¯éñ ”<dloop =I°.new_event_ h .run_untilvaplete(zâ H1Lclos²tprint("\&")²€with Pdb2€Input(['!',\¸Ë#OnextF ú#']»oãD‹Ÿ"¡b[2]>(3Ÿ<U#->¡r.… �--Call--5Š,)1ŠqŠ_N �‚02‚­‚Õ5Ž ‚ 4†Ò .9¯-êsn" 4d3éàtarget breakpo‡`is not_cÛ@W/-ge¯¦0,12ÒU@ „ 6CBi inŸÄ1|iª‘9‡/ 4qÀ 'step',  ... €'step', #Écontinue']):)ñtest_function()`> (3)4 X±-> for i inY5(�`(Pdb) ʃ�--Call-- �+R0]>(1�$geão-> def†Þ! 4|01ˆ/4ˆqyield 2b oReturn6€"->t?-> ƒô+ t rprint(itú§ Ÿ�finishedU""" ¹?pdbŠ”coroutine[ñ """Testing no unwindng stack‘2se! "#" æð if target breakpoQ°is not reac¤@õ>>> import asyncio {z§»0EawaiO{.sleep(#818$28$/3)ÝLmainÝPpdb; RðPdb(nosigint=True,Lódrc=False).set_traceœ fE‡ s ôdloop =�°.new_event_ hF.runiaplete(zâ :1Lclos² "Ð"9€with Pdb§Input([Õ¡/ 8ûm€q&[2ûø2-> ¿4.dôô7[‰xôp‰‘€ŽT¹ü�!�–8–3Iˆ Ànue 3 ó8 finished """ def test_pdb_next_command_in_generator_for_loop(): <@The 1 1õ on returning from a Bð controlled by a for R!. �E>>> Œ4geni0...p� yield 0,n/ 1B}functioG°import pdb;ù.Pdb(nosigint=True, readrc=False).set_trace()|¿Bi in=±¶úprint('value', iCvx = 123¾õ with PdbTestInput(['breake)',…d'd inl' ¶J #3�"])7ºr¤®`> (3); _!->s´j(Pdb) k”B~¯point 6 at¢1Q0]>:1]v$2R0]>(2˜Z)->C|æ¢^„6ˆ „³· …ðInternal StopItzRion: .—2)-Š65¥©% &¹ Asubi>$orF="""¯)in }'a =š5subÓ]Õ£ øF?Ç r®qMxBBT bžOstep¬ # À 'next',€ ... 'next',#-Écontinue']):Lñtest_function()`> (3)1 U±-> for i inVS_gen(�¡(Pdb) step€�--Call-- �(R1]>(1�mPo-> defƒ v,2vâx = yield from�bsubgen<} a¯qvalue 0 •,˜ �return x` {áInternal StopIâaion: 1-�(%)€,5¢¥§1123ä<U""" Aôpdb_issue_20766Ðq"""Testññ!reference leaks when the SIGINT handler is set. f'>>¦¤ »3i =Œ<Êwhile i <= 2,Wpsess = É3Pdbo;!ò .set_trace(sys._getframe()0ð print('pdb %d: %s' % (i, jó._previous_sigint_êI0i +Ëû€with PdbE„Input(['†  'é3Ýo[0]>(67 *hUÔ1: :· ÎÁ  µ2µPd classò�Case(unitG.+{³arDown(selfÀóupport.unlink(srTESTFN)Z@@_runÐ@,s_args, ÒsTåelf.addCleanupUòrmtree, '__pycache__'#‹pcmd = [C�executabl.ð-m', 'pdb'] + pdb_arg3s õwith subprocess.Popen(&] cmd,xstdout=>?IPE(/in'8err(fSTDOUTQP) as ª:Œˆ¡, stderr =#ð .communicate(str.encode(eands))D@ =Añout and bytes.de4! 1ir16err1creturn`© �ò def run_pdb_script(self, %, ±õ‚"""Run '#�' lines Ë1pdbÀ@the '?Q'."""rÔõfilename = 'main.py'I'Q, 'w'~f†Hò.write(textwrap.dedent(šdôelf.addCleanup(support.unlink, j49_"$([(]IomoduleI s .³ ñg’art of a M>¡._F t_HEáRrmtre‹3è7_×�íYQ+ '/_Z)__¤Oinit6 # 6�os.mkdir�ý@™þ;pasJ6Ò9f7-V,, ŠWsR?N'-m'6M`_asserf±nd_function:¯ _content,  ¶, expected)(C,< = +)ËZˆJoTESTFNTP™å = None if not°j else ù3\[0], †&1]u�7_EqualP,š8.fiWC j)(;tes�a_empty šwŒÄ¡'', 'foo', b _found]GÆI"""\ÇGfoo(©(N -?bar-Oquux.À w """, Z'bar'(6 4)!) 6ñ def test_issue7964(self):Wõ'# open the file as binary so we can force \r\n newline?AwithBð(support.TESTFN, 'wb')Ofmqðf.write(b'print(" Àing my pdb")h%')búcmd = [sys.executable, '-m', 'pdb', |]< proc = sub Pess.PîF(cmd+•xstdout=)=IPE$/in#8err$jSTDOUTIÜŒÀ.addCleanup(¦.Œg.close+¢±, stderr = ,‘communicaQgquit\n<`ð ssertNotIn(b'SyntaxError9V1  �"Got a s6 e7P runn±¹ÿ script under PDB"z\13183{;=å ‚°from bar imS Ï›×Gfoo(ÈCbar(ƒ.Onope/Opass\H ºPv ­^ H1fooD-5""" ¸_ands ýdQbreakvcontinu™Esteps2"¡~œJÕIdJ"§0.py·w ÷textwrap.dedent(bar) 8elf5ý„unlink, g2æ<‚run_pdb_‡($, ›?qFUTrue(1ëñany('main.py(5) À->None' in l= l ØPsplitD7s()±L�'Fail to ¹Q into˜ caller aft` retur戓‰â\13210hp# invok³"(°" on a non-½ñ thread triggered an exceptioni¡JÂside signal.øì• óBz«5ing—!6pdb“(Pstartô %€pdb.Pdb( örc=False).set_trace(.]x = 1�y 3t =qQing.T{ð(target=start_pdb)  ôt.start()""").encode('ascii')) +õcmd = [sys.executable, '-u', support.TESTFN]5 proc = sub åess.Popen(cmd,%bxstdout=)=IPE$/in#8err$jSTDOUTIÕðself.addCleanup(¦.Œg.close+¢±, stderr = ,÷communicate(b'cont\n'5`ðssertNotIn('Error2O1.deo)¡�"Got an e:ñ running test script under PDB") V1def!À_issue16180(ë!):[£# A syntaxYõin the debuggee.*e0= "W¥f: pass\n"!•ands = ''pexpecte5!"Siû:8hR£’.run_pdb_w($, e\4In(oO:outQc'\n\nE’£:\n{}\nGot µÿ'Fail to handle a( =}.format�;)) ›Ìreadrc_kwarg�õö = textwrap.dedent(""?¬ imwP pdb;R.Pdb(Yó=False).set_trace(7Çprint('hello²ª%÷save_home = os.environ.pop('HOME', Non&6trydBEwith—temp_cwd(‰%)ú'.pdbrc', 'w') as fT/ôf.write("invalid\nYmain.pyZ‰ :Yb./ 1% 4áP(,0 + 8W~:^Ü£°•6q3Ya?R"NameHs name 'ûú' is not defined"M�„çkfinallË6if oþú+[']úL_MÅ}_header Æ = StringIO(|2orNobody ý§s... blah,ŸÀ with ExitSt÷ack() as resources: ò.enter_context(patch('sys.stdout', /))Aû .object(pdb.Pdb, 'set_trace'H#‚(header=qòself.assertEqual(“Ò.getvalue(), 4‘ + '\n') ­ðdef test_run_module(L) ñscript = """print("SUCCESS")"""G8‚commands*intinueEquitI»V`err = ‘.¡5pdb¥–$, v †True(any²° in l for l ká.splitlines())y>()ßÐin l for l in� ‰¦"¢0b.xq2b.yz~I«@, "gš@ ["Nz ±ŸŠ‚ ‘S �U/# u1ß # fail­8gc # gc˜�b.x # b.Y À from bÿ import y # b.y  „from b.z8*8ðz.* a/gc.py a/sys J Bðmymodule a/b/__init__@x y z )i¢z b/unusedC\!b/Z!b/Xò"""] relative_‘_test = [2"a.°!",Ã["__future__l "a", )b4b.y z4D.b.cceC&.d!exCgc"]›C], [ T"""\ kalC ÷$.b´Ñy, z # a.b.y,Bz a/]O8Wtabsoluty6 # $mX ­Ž gc # gc�O_L óôxñxŠ#;cÚC;:.7zEʽ ¿ Á g‚ cã |ev"c.›càC_! ÈMdMdè!c/…¦eR ׆/_2ˆu5sys/a.ƒd7:.c.r£f6˜Ÿa.anotherŸFm1sysocsys a/vdC ¾ Âò òÄcî`5 lT›+"!f *#Õm1f Ó_b.c.f<.=x<»À  ó from ... import another # a. ³ a/b/c/d.py e f ò"""] relative_KÀ_test_3 = [ t±"a.module",f["a", ]T.bar"ð"""\ a/__init__vU òdef foo(): pass a/€<1foo³n 2Obar 4[j*Û�bytecodeêÒ᯷p"" ] ¢ñopen_file(path):iÐdirname = os..%$2try-–Ãos.makedirs(+)&öexcept OSError as e6áif e.errno != v.EEXIST$^QraiseOpreturn µ‹c, "w")Ëócreate_package(sourceÒ’ofi = NonH ½Âfor line in 5`.split#s(Aˆ!if,ó.startswith(" ") D ;\t">B ofi.write(aò.strip() + "\n"6'7els/jif ofi#]jclose(JÒñÜäjoin(TEST_DIR,ß–)Fgfinallðƒ{‘ class MrðFinderTest(unit™.4Cas ‹1_doËð(self, info, reñ=False, debug=00lacígths=[]hÿRhis, s ôissing, maybe_mñ! =od+K ?0Cmf =lfí.ú«=bDPATHÇÍvD7repö ©D3mf.Shook( Jthis(#ifaN2mf.|T() ##Yð# This wouldn't work@ñ general when executed sevotimes:OoeR = syp?[:]&5 = M'ž³»__.¹¬HQ¶ traceback; ¥.print_exc9À Àsys.path = oK ## xreturn ómodules = sorted(set()))+Vfound)4mf.( 'â# check if we 5@whatòexpected, not more IlessEñself.assertEqual(H%, r .sõfor missing and maybe< :Cbad,'“= mf.any_B_>( ˜At+ Pne3‰finally:Ÿñ shutil.rmtree(TEST_DIR) %ðdef test_package(�)AP._do_%(% Aš? #=O_newA, ‚ÿabsolute_importsL .—relativR .R/_2¦ T,_2ú &?s_3V 3V4V 4V}bytecodjPbase_t|†U.join²V, 'a'ìUsourc2>"+ ÿñlib.machinery.SOURCE_SUFFIXES[0]ÿÆ‘}K BYTECODM÷with open_file(¥P) as ]~€.write('dBing_e÷finder = True\nû³py_compile.i0, cU=Ø8Šos.remov� ñD› ÊSreplaƒ m4oldQoÎ2, 'ì7.pyà?new<Jspam:0supñ.captured_stdout(‚joutput„ ô¦¥, debug=2,³  4=[(ù$, Ç')]~ã —.getvalue#àa = "coHÿ name %r changed to %r" % n¬×4In(W", ÎÀf test_extenóded_opargs(self): Vexten•_test = [!(I"a",[[ "b"]K], [™"""\ a.pyBW /%r# import b bQñ""" % list(range(2**16))] # ¥ constants[A._doë(ò) if __name__ == "__main__";@unit+.`() # T9ðpackages (dotted-B µ2) D sys o „tempfile„textwrapr` from |X@ supò4 # Helpers to create and destroy hierarchies. def cleanout(root)Ü´ps = os.[2dirB@for !1 ins4ËAfull;‘path.join=,-)C, if_$ isb=)±7not Ulink(!qIÁ dJelse-–os.removeN.m†r0fix$ls if°builtins__"6lstc4lst`7"__*øAÏinitializingE .I¡return lstô‘XXX Thing÷D # #“° without __T/__"*Jõing submodule #*~global #PdefinA¶variables #MBVother& h—JAS via /œ1 # @’Ø 2AØ! (ë edAV*.q classSDPkg(û.dqCase): ¸Â\setUpÖäÍq = None./0pkg 0sys–" =W@sys.yBâ¤s_before =„.vsetup()§�tearDownªa0[:]GCelf.ƒ´à\óAup(*Ír‹¨1if ‚: # Onlyïr if theDõwas actually runvìjJÒ`# deleblóso1cerëc%edxž‹DZÓ‡¨t‘ «8\À.pkgname in ÷name.split('.')] @for !É in modules:!,ƒdel sys.![1!] 'ðdef run_code(self, )Eñexec(textwrap.dedent($ð, globals(), {">0": &})^cmkhier\Wdescr]ðroot = tempfile.mkd !()�¼¸ðpath.insert(0, 5!¢if not os.'Qsdir(#ÄI os^`Aø`ntentsK¨ @qcomps =n�…a@fullZ! =¢b@or cYF Y <ÉTjoin(T:, cmTif co°ns NoneVóG D?els5xf = ope|:"w":³t.write(‡"¤5and±Î[-1] != '\n'µ\"Xxf.close%@elf.ô |‘# package·c is th !of ¥first item±ÂC.pkgÍ W[0][04atest_1ÖÏê¡ = [("t1",–0), ÷ __init__.py", ""Èp'Bò–import t1Oy2yÄu2ƒ  ŒP'doc kt2'"),-?subH= 2Yð"Docstrings are omNòd with -O2 and above"Í@def o0_8(™!):†¥ E = [O("t8Z 8˜Ò"+os.extsep+"bÏ'doc for t8'—~º%t8œ¼.d3t8.,6, "st") if â == "__main__"ü�ò () Here we check that `__}à` is provided:8”>>> type(#hã ¿idpickleRsys XCest 40supfð py_operator = support.importõ_fresh_module('operator', blocked=['_E]) cÐ = support.imLe Jò class Seq1: def __init__(self, lst)!`.lst =43len3.¡return lenM9)4sgetitem8>, i;p7[i]95add5_other91 + "|B?mulB*B>r?v4 *  mt2(objecXuÿKvOV‚TestCaseÒzqtest_lt¡GqcBelf.Ÿô assertRaises(TypeError, <2.ltï2�, 1j, 2j:gFalse(`o(1, 0),..1Z1Z=Tru³2Y+Xy¯e¯CeIá e¯e¯,ý?Ku *-®+X­ƒ2X ­/eq­•C%O__eq¾%r—q Syntax˜–GÛ/eq  Xðqeq, C()>ÀÀerator.eq(1,c 0)) ÿself.assertFalse(operator.eq(1, 0..=Tru-1Y+X†2Y,ZáÀdef test_ne(é!):ûç0 = u.moduleçclass C(object8<Wa__ne__V{, other%)õraise SyntaxError`twR%as(Type$$, œ?.ne©2X 4Q, C()> Ž!neæ`+_ÞÈ �Y,Z‡+X{ºgé±g± 2�, 1j, 2j­g­+û©Ä (-¬+X ÙY¬,Z ­tha"¾é­ ts2 ­tZg+û©Ä ).®,Z¯†2Z ¯?abs°B?abs±abs, NoHVEqualñ¸o-1), 1g.- ÿ/ddÿC/dd˜°2addÿÐ, None) ð6 self.assertEqual(operator.add(3, 4), 7) def test_bitwise_and(B!): $@" =\emodule.pôRaises(TypeError, <o.and_)4 b, None@ äÒnd_(0xf, 0xa) ëpconcat(¸æ=[¨6äB ê6ò('py', 'thon'), 'py lB�[1, 2], [A]), ", H Seq1([5, 6E07])QO, 7]ØISeq2N?2([Nhl13, 29countOfD\ÿ± 7C Ø7(È1ËÏ1, 4], 3), 1E-5Y @delitem@aa = [4¢_2, 1]o"u?, aÔ:Y Is~Bo (aEr‹!a,ÕÒ (�floordiv)¯g]?, 5Ÿ;ôãÚ8`(5, 2) pOtrueðE\ï :î7í,.5à?get$�range(10ºÀ.getitem)  ñ)self.assertRaises(TypeError, operator.getitem, a, None) =7 @lEqual(4`(a, 2) 5ðdef test_indexOf(B!):U@" =\emodule.°\§ç7äC ê7ÿ([4, 3, 2, 1], 3), 1?‚MValujL*, M-0)>Overt=D[º # in65Œv(4), -5Û_lshifÛC[Û6ÛO, 42@ 4 (5O, 104_0), 53< t�,-1V?mod.B?mod© +?modM¼5CN ?mulØC/ulØ$ulØ%¾Ú ä0mat ó!=[á‘>vclass MÅÉé"__i!__¤w, otherÍ)breturnO - 1ðb½M() @ 42, 4ä1neghaO26negí�‚2neg 9Ëœ.¸5 g.-/".O‚À self.añ0ssertEqual(operator.neg(-0), 0) def test_bitwise_or(self):#=0 = u.moduleamôRaises(TypeError, <_.or_)3b, None? ßÀor_(0xa, 0x5å,xfç?posàB?pos¡?posÚ¸Ó5f --.-/ðÕ\.ÑB?pow[Dwõ[ w[? Ø@w(3,5?3**7q 1h6l, 2, 3©orshiftQB[­6QO, 42@ U4�(5, 1), 3e‰ MValuisT,-1UcontainC]8[óDFTrueË7�(range(4a8OFals9 ,5)*setitem€ƒa = list”/3)� w?, a:'H IscJu(8¦{ÚÏa, [2, 1, 2]'Ü\Indexh`, a, 4i ƒ?subp§yÀ(TypeError, óoperator.sub) øself.assertRaises(TypeError, 3b, None?hEqual(3±(5, 2), 3) pðdef test_truth({!):�:0 = u.moduleçclass C(object8<ZŒ__bool__X rßq Syntaxà[oµú9[;7_, C()<FTrue5-/(5+?[0]-MFalsY0,[Y#]·¼bitwise_xore½ b?xor$`™x§™¾�0xb, 0xc)7Ÿ/isßña = b = 'xyzpdq'7tõc = a[:3] + b[3:]?is_ 6�is_(a, bÞ-.c)õO_notùx?notü Ú!is¸ ,ç.a,ŸattrgetteÞ›AËûEpassî!&A(Ï`a.name2farthur26f =w’'1'B@ysf(a), 'P)Hf(¯, a, 'dent„[30sur¹=;çOrankc „Attribut¤Of, aÆ¥.X¡¦TÐ=Cîæ# multiple getù˜record = þ .xXûyYzZ­¡Ð('x','z','y')ð(record), ('X', 'ZcY')) ð!self.assertRaises(TypeError, operator.attrgetterK x', (), 'yJKõclass C(object):k�def __getK0__(xk, name)-rŠq Syntax‹K7 ¯&±å('foo'), C()) Iõ# recursive getsfa = A(! a.¥¶ = 'arthur'*m.child06fthomas6?f =X&('7'~ð�Equal(f(azV)È„AttributÍBf, a²6�ô,•("4, ' k##,  ëz^nZ+hZ ]IcÀ«Ÿjohnsonj>¨ p]V� ;ÐtO5, '‰ÌX’test_item£\VÆ1 = Ofmodulej=_ABCDE;Z2K9¶/'CNP]fL(o, a, 3.Wsize=3 èÐ/10W BInde€ , >s¢ìjìOfú-42éû'¨ÿ ¬?, a+n.—8.×dict(key='val.ª7key'yâMÀ f = oóperator.itemgetter('nonkey') õself.assertRaises(KeyError, f, d) +õ # example used in the docs#ñinventory = [('apple', 3), ('banana', 2�pear', 5 Porang+51)]NÏgetcount = oÍ1ÆôEqual(list(map(D%, œÿ)), [3, 2, 5, 1]Gusorted(;d, key=T%),«N7[('Çò ]dPmultie6getYudata = ×Qstr, 4_(20))Ã:€2,10,5)(Vp2', '10/5'NCTypeZ3 'xÖ^?ðdef test_methodcaller(|%):DP0 = u.module ªŒaÈ<F, 12@vclass A¬ðÕ1fooÇ÷, *args, **kwdsÖ*preturn &R[0] + 1î%S"bao, f=42Jf:/z(‡¥¢['name'], a'�p&A(f‡+_('fooS SIndex6Of, aU0, 1/꣮è@f(a)`"êfyJ(?, aV.fspam=3a/?bar/Ô4­TzX5¨\"Ê @z', G ='!',»o='eggsä(50 .qinplaceb ) ­‡C(object8(€__iadd__ ]£, other): §"""V*–:n:/nd:¯floordiv__t"?`lshift¶?ðlshift"  Àdef __imod__ð (self, other): return ""!" ":/ul: /ul:2atm=t"=#orv±/or93pow:v?pow:`rshift=:"=0sub:/ °?sub:Ÿtruediv__:">x)µx)Ÿgetitem__8õ 5 # so that C is a sequence'uc = C()[ñ .assertEqual(operator.iaddX�(c, 5), "";n;/nd;†floordivv@l& @>,mo¹/mo¹;mul/?mulvU´m>!orxò/or:1pow;,iâX³y;subykyZîzx.ómzbconcatócL{ñtest_length_hint§!): ï[1 = wWmodul›×lass X(object8<`e__initÿ[value'+\1 =  ƒ K¨RKqif typeÉ.K)X×TRraiseÞ/ y%Oelse;×¾¶¥Ư([], 2), 0Î9ÿiter([1, 2, 3])), 3)}0X(292|àX(NotImplementaed), 4# ò'self.assertEqual(operator.length_hint(X(TypeError), 12EWwith JgRaises4:+wcu"abc"))+VCValu‹W/-2TbLookupàU1!) ³ð def test_dunder_is_original()Y" =6bmoduleG!�names = [ Q for ein dir¢�) if notp.starts4a('_')]”M?Gsˆ¤– = getatt],V�+Ù-a'__' +4a.strip…0 + j, NoneL2if O Žg-“2Is(& , ¨Ã) class PyO§œTestCase(`, unit‘.$‚nd = py_Š5 @/ÅskipUnless(c!Å, 'requires #')�C~�!m èWdPickleÈ3pAcopy]Ã, obj, protoçKò support.swap_item(sys.Ds, '(',ŽFJp‚d6 w.dumps(vqu(2vrreturn }r.loads( dv¾agetterI p.¼_AbøEpass"fa = A(Í–a.x = 'X'" .yYzZtH?t.u .v<V<Ñé“ in range÷.HIGHEST_PROTOCOL + 1 Ì�õ0subQ(K= ,0Ff = (F('x'û $f2Y�fˆ%Úm`repr(fO ª0 4¯f2(a), f(a. # multipleÒ¶JÏŸ, 'y', 'zÙ��recursivÚðt.u.v')  ð f2 = self.copy(f, proto) $òassertEqual(repr(f2), )4Ñf2(a), f(a)) cðdef test_itemgetter(k!):‚«vmodule.,µa = 'ABCDE'2forÕ÷ in range(pickle.HIGHEST_PROTOCOL + 1y}Bwith �subTest( = ,0Ff = ˜.(2rh¡õ# multiple gets2$ Ío, 0, 4Óz´E®methodcallG IQvclass Aˆj1foo£ÿ, *args, **kwds preturn &R[0] + %1]dS"baöo, f=42Jf:/z(‡¥¢['name'], k'�?&A(á;^Šf('bar'�-Az¡positionalÝ  ­: = ÕŸfoo', 1, �keywordØ­À5²ŠÓ �Qbaz',ã�='eggs', $o='spam)q# Can'tß$á consistently Z€m ¦.| HªÑPyPyOperatorPà¯VCase(ÀckleTestCase÷, unittest.TestCase): module = py_operator2% @IÅskipUnless(c;Å, 'requires Ó') class PyCOddPickle�(·*• ¶+?CPyŸ¶'œ…l;Ck>µò if __name__ == "__main__"p?p() # WršPn to ¡ò interrupted system callsó~fering with our many buffered # IO implementations. http://bugs.python.org/issue12268 # # It was suggested that this code could be merged in³±_io and theÀs # madeÓpwork us´ásame method as2Pexist bsignalB1 in @_io.ÖšQunablV@get T¡le process.sjòalarm or setitimerÌPway #–‘reproduce‚PEINTRI@blem0@ThisY0bas ¥est suite =èÕ1pro:` prior`i^ñ patch reliably on Linux50OSXâô - gregory.p.smith import os eselect0#ub y9‚@ # €0gaall ofðthings we're about ë!ryf¬”up front.V5_io _pyio u0os. 'posix', 'ø%s 9!a þ.?®qFileIOSûI*[0defñsUp(selfà_#._� = None å3ŒtearDown6iN&lf9ã K¡.poll() isS†q:try ? ki?‰îexcept OSErrorAFpass»@_gen³üe_infile_setup_codeÎ’"""Returnu0° = ... lineû8 fÂhæDader.u£1sub΀eses sho`overriò:,/!di— nt–…objects.ï5""" r›3 ('ó %sUio ;'$|'¼2io.°(sys.stdin.ðno(), "rb")' %  ðself.modname) ð def fail_with_process_info(.ñ, why, stdout=b'' 1err BFõcommunicate=True):2P"""A ñon way to cleanup and“ “ò useful debug output.»u£Kills the »ð if it is still running, collects remaiN“xPBtest‚ñ an error message includingy ”FArgsé¦�why: Textç±go after "EVtfrom IOÁA" inXn. J‰…£: standardÌ<­W)soJN0far’ÐØy@±Ñ`: bool 0en Ý� we callÖ%B() oΟ ƒ @killPi"óather additionalÞ 5"""J0if ª.½p.poll()JNoneŠðtime.sleep(0.1) # give3Àfinish print”D<:try[ ‰¡terminate(iQEnsurkJdiesN‘except OSYHpassò‰‚ªD_end% + =$@/()A3 +=õ? !3err!9err!P!('Ê ‡Þñ %s:\nSTDOUT:\n%sSTDERR Y\n' %kÑ7 (ƒ”.decode()Þ)Ñ_½@_rea¥Èðdata_to_write, À_and_verify_V ŸñGeneric buffered3€ method a€ harness5÷validate EINTR behaviorªTAlso 'cÐat Python sigåÀhandlers are¸D dur�¯M c ßB: St;!o ð£ÈTchildjA forÕ=ingw before senD a¨K0nfiÛ¿Bwas Ã-d,O†Ì@a fiìqnewline°@clos¡ºinfile pipe! ° : Single "LP" of Çí/|r-le‘pobject 2d 'w'�¤ ðresult. This wRbMðexecuted as partŠ3a pÞ#ubýY fed ©ä Òa_setup™¿g”0ate¡7ile#ÆÐ# Total pipe ðIO in this function is smaller thaóe minimum posix OS ð# pipe buffer size of 512 bytes. No writÅhould block.Bñassert len(data_to_00) Anot ‚:O b, _, _îÍect.select([ý‚err], ()F0.05*N 11endH*al! 5k1I+= 1¡#ifñ!Z> 200ÄzZkill(f%' ('a4er I ed¾|eiÊ&.'J#%á assumes anyth„pnexpectD2hatbç[Q willíÝ#%à a newline. Tóhat is true of the traceback printing code. ðsignal_line = self._process.stderr.read %()68if 9¥!= b'$\n':"_N”fail_withWñ_info('while awai–O)',AE�=8À%) =ð# We append a newÀð to our input so t1$a à— call canGAñon its own beforeZ0EOFm…seen andP0we'" es×JŽjf{ówas interrupted by aXj„fKðdata stream has bˆwreachedÞrtdout, - áÁcommunicate(j=b'\n'è `returnCëºË@'exiô‹rc=%d' %{hsÙ', Êf=FalseÄr# PASS!P# Str¡format forΚÀ_and_verify_â2 us•‚ methods\ù _READING_CODE_TEMPLATE = (íð'got = infile.{H_Hº_name}() ;'2Pexpec4= { =!r}(qassert a$= *:, (Ps.'"~ e�ed wrong S_.\\n"Cm%d %r\\ntÅ %r" % (got,‰*))Eœ�def test_ ”($)L5"""Ó) must handlesl‚not lose³5"""DO%._c:ing’Ãÿ _to_write=b'hello, world!‚‘ =i.\y}Q ='~1o ±°^s_/s(`Z/\n`qsa[r\n', b'¸_\n'])h?allfdNÀrite=b'helloË\nworld!', ý)read_and_verify_code=self._READING_CODE_TEMPLATE.format(IXQÐmethod_name='?all}4ôexpected=b'hello°U\n'))j # Jñ() is the same thing aseall().1ÇPtest_:>ing·Üdata_to_write€³I0Pz-ÿ class CTestFileIOSignalInterrupt(`, unit0.$aCase):N0modÌ„ = '_io'e Py(fB!pyhÎg�BufferedѾñ def _generate_infile_setupï((+e’"""Returng0ð = ... line of '´ to make a œ¡Reader."""7NrKÀ ('import %s®Eio ;Yðio.open(sys.stdin.¢åno(), "rb") ;'PTò'assert isinstance(QZ, io.‘M)' %Aö.Ù!) )ÿ/M$  Y.ñ() must handle soðs and not lose g Z%._mœÓ›HΣ$P n«OTextÙ,b~§K˜_Wrapp¦zh =i¹pt", new3_=NoneÇ ±ÆÀst_readline(ƒself): õ("""readline() must handle signals and not lose data."""@Op._test_HEing(c5ý _to_write=b'hello, world!',0Iò_and_verify_code=iþ READING_CODE_TEMPLATE.formaty�QÐmethod_name='ô~5šexpected=°a\n')) ´Edef úN s(¦^s_[O\r\naqsb[cb\n', '¶O\n']h?allfa\_nZ"l 0\n"Tñclass CTestTextIOSë¯Interrupt(`, unitô.$CCaseî0modZ¢ = '_io' e Py(fB!pyhQ if _Ö@__ =‚_main__'å±â() Certificate!BData úñVersion: 3 (0x2)éðSerial Number: 00?õture Algorithm: sha1WithRSAEncryptionN@IssuGð C=US, ST=Oregon, L=Beavert ð O=Python Software FoundaKD, OUñ Core Development, CN=null.p@ð.org\x00exampleâ/emailAddress='R-dev@ #­…ValidityýNot Before: Aug 7 13:11:52 2013 GMT1iAfter 121ŸSubject: !’®ö Public Key InfoV1'?rsa04ò-Key: (2048 bituzModuluspð00:b5:ea:ed:c9:ÿfb:46:7d:6f:3b:76:80:dd:3a:f3: ÿ03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97Bð16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03]_26:e2Bð88:a9:cf:79:cd:f7:04:56:b0:abP32:6eN/c1Bð32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27/d4Bà56:31:88:52:ad�Pbd:7fB 06?P1f:ccE/b8B€a3:8b:8ck�d8:29:1fÿ@b:f5˜ 06Oca:0 45{7¹ð0a:9c:bf:bb:b9:ae:0d:16_60:75„@e:06ƒP9c:7cÒ�dc:92:2f� a:e0:4b:0cð90:6c:e9:37:c5:90:d7:2aP97:15é�80:8f:5d„Q7b:49!4• d4:€2c:1c:5bW!b5Æ9„á68:43:d3:33:78±@2:60GP3c:44Ö a1ce”ðf0:0f:d1:5e:87:9e€°cf:62:fc:f9Y0c:65:1Œ±f1:93:c8:35‚f ec 47ŠPef:be�dŒð82:1e:2d:9a:9f:98:5a:67x e1Z 70§/cbJ€d3:c2:ceN 45V€27:dc:e3T0d4:ð8/2fB±9e:77:b8:14‚0:c4:36:…Pae:6a _8c:daB]2f:85¦õ Exponent: 65537 (0x10001)*úX509v3 extensions_õ Basic Constraints: criticalJµ‰CA:FALSEHúSubject Key IdentifiersHàpA:55:C0é€FF:61:CD A3ëÿ 0F:EA:5A:9C:24:38:22:F7:5Cwo^UsagejñDigital Signature, Non Repudiation,®ÏEnciphermentcÚÿAlternative Namr*) {*ý.WARNING: The values for DNS, email and URI are WRONG. OpenSSLNRýdoesn't print the text after a NULL byte.CÞ)*NóDNS:altnull.python.orgÚ:@°URI:http:// 3÷IP Address:192.0.2.1, ¥2001:DB8:01‘ð Algorithm: sha1WithRSAEncryp,/A°ac:4f:45:eféà49:a8:21:70:8eô :88:59:3e:d4:36:42:70:f5: ÷&a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44@ð3c:b6:0a:71:d6:7f4÷08:61:9d:60:ce:75:cf:77:0c:d2:37@ð86:02:8d:5e:5d:f9:0fLPb4:16’÷c1:3d:23:1c:f1:11:b3@€56:6e:caºð 8d:34:94:e6:87:2a:99:f2:aePcc:c2À'86@Pde:08h°7f:c5:05:faë€81:a7:82L3χ34:f4:ac@ð3e:40:fe:89:57:7a:294à91:7e:0b:c6:51O€e5:10:2f€°60:76:cd:95(P1a:be�àa1:b0:fd:ad:52¤Pd7:1bØ'60€Pð1:c7:17:c4:18:4f:2dÕP25:a3Æ€4f:b7:92'*e2 25V 54¥8´ b3qð61:a2:f7:da:ed:e1ÉP6f:2cÕÀP1f:d81 c5bñ05:ab:c9:09:62:49:a9:14Æ5½ cc'@P4a:19´P99:97€1d:81:5f!cfÃ@8:96w 51Ø'3d 0b´€65:12:ebŒP70:80úP48:72 c6ú da†Wcd:8e@P5b:baz 2fÙ b4k 56º€5e:3a:43¡P63:04› 2aÀ c1Vaà -ðBEGIN CERTIFICATEð6- MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx Dz-òNVBAgMBk9yZWdvbjESMBA)ð0wwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ eXRob24gU29mdHdhcmUgRm91bmRhdGlMAgMB4MðCwwXUHl0aG9uIENv,ð RGV2ZWxvcG1lbnQxJDAiBg’³MMG251bGwuc5ðLm9yZwBleGFtcGxlõ ZzEkMCIGCSqGSIb3DQEJARYV5sWRldkBwªõub3JnMB4XDTEzMDgw NzEzMTE1MloI’wgcUxCzAJ–²YTAlVTMQ8wDòI DAZPcmVnb24xEjAQ)ÐcMCUJlYXZlcnRBjMCE5gwað FNv ZnR3YXJlIEZvdW5kYXRpMBIDAeMðsMF1B5dGhvbiBDb3,ñRldmVsb3Bt ZW50MSQwIg›´DDBtudWxsLn5ñ5vcmcAZXhhbXBsZSm4kq -dCQEWFX5e1kZXZAI~`zCCASIüðJKoZIhvcNAQEB BQADggEPAŽðÿfQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL 08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAM(ð HRMBAf8EAjAAMB0nðdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDAL=ñHQ8E BAMCBeAwgZðdEQSBiDCBhYIeYWx0bnVsñ�bC5weXRob24ub3JnAGV4YW1wbGUu Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251 bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA óÿçEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9 i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ= -----END CERTIFICATE----- ''' Tests for fileinput module. Nick Mathewson ''' import os import sys import re import fileinput 0¥collection9fbuilti„tempfileNóunittest try: MÁbz2 except IpRError#­bz2 = None7Ogzip89„ from iopòBytesIO, StringIO!­i0˜PFileIâ, hook_encoded.tpathlibTRPath åA.supOKÿverbose, TESTFN, check_warnings9òunlink as safe_/ojÖmock # The æõmodule has 2 interfaces: the üñ class which does # all%òwork, and a few fun! (Iò, etc.) that use a global _state # variable. i’BaseTests`# Writ:ðcontent (str or bÆP) to jØŒ`return¡e# �'s name.Pdef w\£Tmp(self, c@, *,4àe='w'): # ope©� in text0 ise� defaultUÖ1fd,g! =zq@.mks¦%()&rÃ.addCleanup(Â.âB.Awith…(^Pmode)f%v!f.Ñ(È?ýhÁLineReader: •�__init__)]­ò_linesread = []6•@propertyD& E÷«– ]1[:]L"cfinall. 0�ê®~,÷Ñ Ó it = iter(¦(a.splitÄm(True)Eüo.oPsize=®jq = next&v.it, ''Yàself._linesreaód.append(line) preturn  €def readñs(self, hint=-1):":U = []…size = 0¦while True8<0 = [.j(’#aif not– <³sm•ç¡k+= len1if !!>=ïw x+Qclose'ñpass class BufferSizesTests(Base °, unittest.CCaseDY!_b=_™Œ!±ð# First, run the 2ò s with default and teeny Jã.½C÷for round, bs in (0, 0), (1, 30m.$t1¶ðwriteTmp(''.join("Line %s of föÐ1\n" % (i+1) gi_ªrange(15))ï/t2Z2Z 0Z3Z3Z³4Y4Y1²^if bs~×3ðassertWarns(Deprecation;ing´¸:N_-ð(t1, t2, t3, t4, Ÿ;elsÃS"wÛ ˆž., Ž#=0�=Œópat = re.compile(r'LINE (\d+) OF FIL"')Õ°0tar921 +å!*6’Œif verboèñprint('%s. Simple iterp� (bs=%s)'çs\ +0BÛðfi = FileInput(+s=u ),›á6=bswË` = lis92fi.s>.dEqual(áos), 31) ¡ines[4], 'Á5À'9%30:1:?4\n: 0fi.Ü?no(� 0fi.2@name,'t4̰ÿtatus variables°1°7us = "x"Qüs�Cs !=a6'J2\n'æC/fi á 2«Àual(fi.linen£o(), 21) ñself.assertEqual(fi.filelinen.6-PFalse-pisfirst0/()+ Pstdin'€µif verbose:›ðprint('%s. Next“÷ (bs=%s)' % (start+2, bsvCfi.n.(ŒäBread´Ñ, 'Line 1 of hO3\n'> :&22*µfi.close() ÌàSÝ3ÝÐ = FileInput(«ös=(t1, t2, t3, t4, '-'), bufsize=bsŸAsave�q = sys. ©:try‚#Ö = StringIO("+?!\n2<"rÉ+ps = lis´  ~Alen(2_), 33- „ines[32]LJ jè@name!'<¿>7Qofinall0k ÿBoundary conditions4 ý~Û0> FNone.5Dm(¹bInplaceM5M¹6out%5outm &/fi•B), i‚/=1›¢@for j in fiŒ H×ne[:-1].upperç%;/“ŸÉ 5ô„å !Ã0[-1ß ’ºÑm = pat.match3 òR#Noà:m, ®N)"}Óm.group(1)), /“hV• class UnÀ&4RaiÝÐdef __init__(tö, exception_type)÷.+ =/’-pinvoked��ðdef __call__(selàf, *args, **kw C): õself.invoked = Truearaise "ñexception_type() class FileInputTests(Base °, unittest.qCase): Z@def ð_zero_byte_files(išBt1 =}ÁwriteTmp("")C¼/t2 3ø The only line there is.\nW48Ffi =õ(¹ò=(t1, t2, t3, t4))é¦j�= fi.read(ÃñÐ.assertEqual( ?, '¨'<0fi.?no(), 1) ·-@nameX/t3Ü QFalseÜ– ’-0V ì¿4,qfi.clos̪—1ð s_that_dont_end_with_newv¨wA\nB\nC9¯wD\nE\nF&_ )¼‡¶s = list(fiRÒs, ["A\n", "BC D E?F"]H0fi.yb3- )`6) ##b cbunicodøœü).p# XXX AH,ô string is always returned by ".kB So4Èthis needed?$e½(")&Pencod~�= sys.get dsystem(24if XNone:Rš!˜= 'ascii'" 1strm;)uu O^§å/noðÇíGC\nD#ßÜ't2ê ·‰…-èýo = nex#NohE0fi.Aù¨ @…˜ B zÍopening_mode€&ry¿H # invalid /ð, should raise Val—ueError ù fi = FileInput(mode="w")%µself.fail("+ð should reject invalid A— argumentG£except Val†:bEpassñ# try opening in universal newlineg0Qt1 = ¤ñ writeTmp(b"A\nB\r\nC\rD",1G="wb“àwith check_warlòs(('', DeprecationW*))¯ 6„files=t1gUf3ê¶s = list(fi”ìÁassertEqual(*0, [öp", "B\nCQD"]) .ðdef test_stdin_binary_´(Tæñmock.patch('sys.6r') as mC ð.buffer = BytesIO(b'spam, bacon, sausage, and 'Üœ_S['-']b;'rb3,PÜ.0˜ 9‚detachedÿB Borig&ž>‡”:try=a8'èåFalse(hasattr(\2, '�/')sˆ ofinall(d à’_B\_hookà Á# cannot use|6¡kinplactŸ <(5=1,@ú=lambda f, m: Nonev±YÓaise if both ]% "A‚ "Rø¾ˆ·s are givenš“ / £s/=1á{+p for beò�callable¬úclass CustomOpenHooklŒ__init__TœpinvokedèQc%E­Ew, *argsF' LITrueK$areturn(HÔtC…á("\Ëcìñî$ =ÿÀpenHook()  ðwith FileInput([t], openhook=custom__‘) as fi: ;Õfi.readline()üself.assertTrue(K°.invoked, "_^S not 1") K•def test_cY)‚ÀBÒ(TESTFN, 'wb'©&«öf.write(b'A\nB\r\nC\r'²$# ñl TextIOWrapper buffer.�%Mü123456789\n' * 1000TåIssue #20501: ʱ) shouldn't¿ whole filemG\x80³ ò .addCleanup(safe_unlink, H´+ëh"s=&,Ý-Zœ=ò_encoded('ascii')g :tryyKªiEqual(6 , ”Ù37?B\n7!C7 except Uniã De_ErrorÌñfail('Read to end of» �uÇ~Raises(hÔú$# `8thed +zlist(fizwu ¬0) –Ð_binary_mode(GÎH¢#D¥Zð3 ª4='r+ Äi¯D™ƒ4u68C\rk’�'Pücontext_managerýQt1 = ˆ}QTmp("6nC"­.t2&wD\nE\nF&I À(t1, t2‹”Ms = ’ž*0, [�p", "B\nCD E6F"]¹ H0fi.XOno(), 3- )6) _W]s, ()‚‚lose_on_Ã?ion…ÀwriteTmp("")# Etry: úwith FileInput(files=t1) as fi,0Õraise OSErrorJdexcept 6ñself.assertEqual(fi._ha, ()) Eâdef test_emptyð_list_specified_to_constructor(X)kÉ/[]É;“M'-',—¬_getitem__xö"""Tests invokingN'._7!) ¢±the currentùTõ line number"""At = ­ writeTmp("*01\nU2\n"),_ Ê/[tõretval1 = fi[0]E�q±-$, }v1 2M1M2MÃ5¿invalid_keyw,Àan index une…1 tou¿0 –RƒY°lRZ‘s(Runtime`½&cm寵hEb2cm.’ðion.args, ("access¡êÿs out of order"ò ?eof~, _i but a€end-of-i… /''ó$pIn#n0end^Ñ� reachedf@next @_oseRÿ_deleting_backupyLq() whenÕ0attRA to Zeög „y would â�. This � pxpectedRbNðsilently ignoredÇn@os_u´Âk_orig = os.# replacemenñUnconditionally'(�  Ù;«; /K €addCleanmcupportš·, t + '.bakt8KkA, in»Q=True¾D©ñ(fi) # make sure®†•is openeds4@Q. 2À fi.nextfsile() …finally:òos.unlink = os_ e_orig (ð,# sanity check to make sure that our test scenario was actuqE hitLöself.assertTrue(tõreplacement.invoked,7«"¸!()mCnot 6"")»1def–ð_readline_os_fstat_raises_OSError(•)‚"""TestsQäing FileInput.Lwqhen os.S2() U U.¼ò This exception should be silently discarded."""Àð²’£o]!?  = UncondinƒRð(š+tr@t = æ.writeTmp("\n"1“Fwithá(files=[t], inÂ=Ùv) as fiU;1Í�ûÙ,'fitÌŒ[8OÊL~_ŠÉ7Q?as ÈP@unit_€.skipIf($ðhasattr(os, "chmod"),  B doeMSexistÃ0;SG_¤ê.1os_ˆ�±Í¼Ù [Z~Š2È}Ñno_when_ValueÐÍd×Qclassº!nos3(1xvŒ__init__\ G.5&, v Y`Ñ^›“__call__(çwuïÀally_raise_Võ alueError = FilenoRaisesVC() öt = self.writeTmp("\n" AwithFõInput(files=[t]) as fi:IPà_backup = fi._ #:try48*ð = unconditionally_r»_» M<PresulÆ0fi.n'noÞ!!fiJv 9¹ð# make sure the õ gets cleaned up ‡ù# sanity check to>ðat our test scenario was actuàE hitLˆ¿assertTrue(  •.invoked,Bð"�{Cnot 9&")É}bEqual(Yp, -1, "Zô should return -1C1defçð_readline_buffering([)€÷src = LineReader°n'P01\nA2', _3\n']úÔopenhook=src. ´�.uø2jsÊF, [] [ 00fi.*3#()�O1\n'7 gÕ8p!2n"/2'l!yÜ µ= PÛÖb]7ôPitera³õÖ0nex ðQ këE gæG�d(StopI8 , O, fi 6íÀ sel÷f.assertRaises(StopIteration, next, fi) 4sel7ñ Equal(src.linesread, []) 1ðdef test_pathlib_file(?!):!U‘t1 = Path°.writeTmp("@lib 56.")„ö with FileInput(t1) as fiTX‘` = fi.–(C!ˆþÇ$9, 'x'4 !fiúno(), 1-Íh1@name`Pos.fsLôd _inplacl ôÈ l#, \_=TruezWðprint('Modified %s' % K ­@open   òf[Y ÿõ\n') class MockwZR"""A áthat mocks out¶i .3ñ for use during unit Fs"""2�__init__~†les=None{õ False, backup="", bufsize=0,Yä mode="r", AhookO„›s25lesFó$ =ý ˆ# =‘ š �0 =  ¬% =· !N0 =  QinvocÃ`_countÖ`collec×ös.defaultdict(lambda: 0GóÀreturn_value@&{}¢Mclos\6 z!["-v"] += 1CZqå ŠF0IÙ2 § } ³&["3wsN1w0w3w§/noì.s1q…u2y5 }îD/nou1qpisfirstñïÀts["isfirstlÃine"] += 1 Âreturn self. ñ_values["isfirstl6 2Àdef isstdin(3!):Lñ.invocation_countF/x2ð! class BaseFileInputGlobalMethodsTest(unittest.CCase–0""": E@for * + s Qthe gOP func·4 ofÒPfileiv¶ module.""" _setUpå_orig_state = F.bv,à 03Lu = Mock¡}tearDow¬E ŽxÄ( =¾êxõassertExactlyOneI.p, mock_†_^1, mÐD_nam¾T"# J` that ‘(Q with`given 7P was €…ked once»bactual‘, =|´e�]F�hEqual(W:, 1Ä7 Ãpno otheŠƒexpectedûds wereÁ?e7totÂKlen(BÆ)DºUD, 1)nFœ›¡(Ia ƒqGUnitbãG.)()@ŠNó_is_not_None_and?>m 0"""®ø7ingkqW whenZ€ is not p(± and its   attribute/Ealso4A. EÀø RuntimeError toM’be raised¯áa meaningful e0qmessagew‘ð¸ )à to *not* be�Qified� pinstancq ( #.à‡= object" ‚4 = 5Û}URå(s( v) as cm¡\ävM\#("#ð already active",), cm.excep°V.argsáI4Is(º,6, "Ž&")À™@•N?but•A*is*ÂŽ}Po creyÍàreturn ð a new fileinput.FileI ð object with all method parameters passed Gó explicitly to the __init__()Aø; also ensure thatA‰Ô_state is setNõreturned instance."""@u = MockË-()# ._ju = None~=i$ñself.do_test_call_21() #Adef ¿@_is_b(6!):"+÷"""Tests invoking‚OW when’*is³` Exp©i&0cre7Band -â•/ í â J.íÒâLØ í¬j8r¨ Æ6¨¨»¤nsd�# Q,7óXgivenTØunmodified to>ðØ.]b. NotPQ this…° depends on�OÀmonkey patch�'ofßb€ done by„MUp()‚3s =Ø e_placeobackup_ufsiz5?modˆopenhookOä # �Õ´Ñödifferent values for each argumen–�result =K’!s=A, inô=", ê=,—þb= 2=$, õ= yU#W•ð.7/waHåžÿ.ÖRrtIs(ú,ùN<, "a"†á/'toJžq() wereµed directly�#ø�ï" ±–2s, ¸.¬&s" 4±6" :Ûo" 7é§ñ# " :¨ "1#làopenhook, "opeðnhook") class Test_fileinput_close(BaseFileIÐGlobalMethods/õ ): """Unit tests for G.GQ)""" ,1def(ó_state_is_None(selfNR`ns thatN÷ does nothing if"XkI` is c‚ /! =#6 ¿¨�.assertIsW(,{)è?notì"ƒinvokes J= onÀŸÂ and sets �=¥üõinstance = MockÝ%()F Ó4 = 6$˜#ôExactlyOneInvocation(K1, ";"y;^®@next·±/J´&ˆD.LN whe¸œ.=’ Ensureúñit raises RuntimeError with a meaningful exmessageN.} modify?½@ {¨RŸ(Ÿr) as cms¨PñEqual(("no active Kð()",), cm.excepI_.args<Ž‚š½Ò1notOÖ ÕZo3e>e once,,ð returns whatever ',ñ Møto point to a different object.ý“_retval =%;Ý^#.Ç”_values["^T"] = k± 0›ž-Oªti§>ª(r,¶� 3,_�Ê?nam�/À.filename()"ñ"" def test_state_is_None(self):"&ð"""Tests fileinput. ·name() whenK@ is K.Eñ* Ensure that it raises RuntimeError with a meaningful exmessageNýand does not modify‡5"""3³½£=¢ {ú�.assertRŸ(Ÿv) as cmX UPñEqual(("no active Žÿ ()",), cm.exception.args)D IsU(i=.Ë)Î?notÒ9j�Ö hinvoke,¤3Õexactly once,èñ returns whatever'/, ñMüto point to a different object.º“_retval =%(†ðinstance = MockFileI #.Ç�_values["¯^A"] =£ k±%Ô4 = s$ž- O‡ti�OneInvoca^(W&, šè>2Is(r,¶/ŽÅ,Ä�) class J_(Å_lineno(BaseSÐGlobalMethods0Œq"""Unit²Qs for—pH)Ö0Û&JÙøYô%׌»ÎÕ*_Ó~šfð = object() ð instance = MockFileInput() #ò .return_values["lineno"] = u_retval9PfileiM`._statdL$36 = -M�ôself.assertExactlyOneInvocation(U$, ”½<2Is(n,°-’¿,-å) class Test_( ¾EBaseMÐGlobalMethods4!):÷"""Unit tests forVLQ)""" 11def-‘�_is_None(åS±0"""esNW whenM@ is M.iGñ* Ensure that it raises RuntimeError with a meaningful exmessageNýand does not modify‡ë} ! =¢S{üRŸ(Ÿr) as cmoXeWRñEqual(("no active Ðð()",), cm.excep…_.argsJW(k= )Ò?notÖ;nƒÚ hinvoke2.·‡" e~e once,02 ¡s whatever-.?s, ÷Müto point to a different object."ž|# ='?iã'þço·Þ% =-$} ë7À°€qï@"|ó+¼1)Ë÷?no(ó2?no(ï4Jëüðno() seó,lf.assertEqual(("no active input()",), cm.exception.args) %seD±IsNone(file=‘._state) -‚def test�_is_not_2D!):&V–"""Tests J —no() whenM€ is not M.Gø Ensure that it invokeX@._Øexactly once,Jðreturns whateverO’, and doe…mmodify¤Mõto point to a different object.""".š“_retval =#(€òinstance = MockFileIºD#.±’_values["\A"] =®#nog9*/&ù4 = {SÉ- Ü$—��OneInvoca�(U$, Ã<2Is(n,ß-ˆ¿,¾�) class —_(õ_isfirstline(Base}ÐGlobalMethods5Þq"""UnitQs foršuM)6å(çT2 O7N3 ñraises RuntimeError with a meaningful eqmessage¸–/ ì/š! =ÕS{ý RŸ(Ÿv) as cmO\´.XS Œ ÀØ* d~Ÿ“<3aq9Y±i’$†7í)†ù “"Ñx', ,ð_retval) õ( self.assertIs(fileinput._state, instance) class Test_(ð_isstdin(BaseFileI>ÐGlobalMethods1õ ): """Unit tests for I.IQ)""" .1def*‹�_is_None(²PTbsKW whenJ@ is J.fDñ* Ensure that it raises RuntimeError with a meaningful exmessageNýand does not modify‡è} ! =¢S{ù«RŸ(Ÿr) as cmiX_TOñEqual(("no active ÿ ()",), cm.exception.args)D IsT B)Ì?notÐ8h€Ô hinvoke){å exactly once,æñ returns whatever$/, îMøto point to a different object.·“_retval =$(ƒi¡u = Mock„#.Æ“_values["]S"] = i® ,*q$œ-N„ne�OneInvocaX(Ç%, —ä=2Is(p,³.•ÂÓ‡‚RecorderF�Œ__init__w“RÀ¡_count = 0:Ccall:0, *:`, **kw ÂKA+= 1LÌ#Vlast_s@ = (J#, R ¢ðhook_compressed(unitw.-CCase�“ D ›_setUpÎfake_open = \(Ïempty_stringP0do_»Á_use_builtin_l("", 1Oono_extIƒabcd", 2M@/ð skipUnless(gzip, "Requires üRzlib"€ù¬ gz†_  ‹�originalÄ! =H./ïZ" =¡G/#2try¥Presul‚ñ À"šà.gz", 3) × finally: ðgzip.open = orig$_ 'ñself.assertEqual(Afake)ÿ.invocation_count, 1)=Vlast_Bò, (("test.gz", 3), {}))�Q@unitòskipUnless(bz2, "Requires bz2"~@def -�_bz2_ext_²¼) ó =?….BZ2FileÃ4bz2: = ý%+trYóresult = fileinput.hook_compressedé²2, 4µš¨ … ·:œª^Á«}0lah~ y«1do_¢±use_builtinSó("abcd.blah", 5ÿT gzR2Z!G]6X)‹Y!wBz2", 7Zä,¯name, modeš/{.replac-Ý<H“!­�ß”y“   ¡^½z +((è»Ñ@staticmethodDyç1newt__func¼QsiS� 9 = N&lreturnœ±class Test_V…encoded("4CasRq"""UnitQs fory—AB)"""Qöž *0ing1fbject(soerrorsN1ed(Ring, D=<âE = Is‡Recorder… }ÔZ~ _z @5àÑÂS_ †zn / ç³…•ÀEqual(fake_oó pen.invocation_count, 1) €args, kw� = fake_o7Vlast_<1àself.assertIs(7ï[0], filename)) 1], mod%‡ô.pop('encoding'), ] 8Qrrors6 4bFalse(7 ¡def test_e7(è%):ÎPwith ö(TESTFN, 'wb') as f&Uüf.write(b'\x80abc'ƒòddCleanup(safe_unlink, Y�J“bcheck(”÷, expected_linesŸ/£ FileInput(’"s=UwU='r',Ò3 àPhook=_vÂed('utf-8', †=)üiýQœ` = lis†þW?aEqual(. Ú¡À'ignore', ['S]V÷WðRaises(UnicodeDeEÔ /YostrictY!breplac{k\ufffd�(™backslash1]ØÔgsf'ð# UTF-7 is a convenieݵseldom used8 ô ÿA\nB\r\nC\rD+IKw-ª0× Î $±¨ E µ;©/7'š\r<‚A\n', 'BC�D\u20ac'®²Warns(Depre¥?ing­/rUmXl+‡_Value*rbÒr: C\W'Að class MiscTest(unitJ.bCase):6ci /,. ·M/Mœ�4, U0 /incINT =  DINT,+ þGûGøH�� ' , - òOlong÷ 0 = 8e ',- ÷K ùÀssertEqual(t s.T_LONG, s_MIN) tU1 = E_MAXöself.assertEqual(0,/!) 1ðdef test_py_ssize_t(A!):r?áPYSSIZET = PY_ /_Tw8,7 Î' _%IN†•Ö8 _-9P@unitßò .skipUnless(hasattr(ts, "fL¡"), "long Ânot present"­+ )K@ = L$',2r~U/UV;$G ­5L4MZð!## make sure these will accept a plain int as we1s au´Es]E = 3';, 3:¯O = 4F ,3, 4Òôübad_assignmentsû€integer_Y¥ibutes = [pÔ�'T_BOOL',±YTE', 'T_UB !SSHORT" #$IN! A !H']8if 7'7'*ç ˜.extend([6ð�#']pBð# issue8014: this produced 'bad argu…0 toGæernal functionÁ#UerrorÌpfor non‚öin None, 3.2j, "full of eels", {}, [] ž>æ Å ö ,0±ÀRaises(TypeE’P, setL , Œ šìinplace_string~dòóSTRING_INPLACE, "hiʘ:"T_K_", "sK2delÙãKõ) class TestWarnings(¸kCase):°Œbyte_max ôwith support.check_wVÃ('', Runtimek)¿z‡p = CHAR/+1|/in|<Àts.T_BYTE = ñCHAR_MIN-1 def test_ubyte_max(self):"òwith support.check_warnings(('', RuntimeW);?âts.T_UBYTE = U(C)z cl]D(C):–I? ß override of D 9D _still&"D&?E(D& e N™%EOset(ƒ!E(ç4nowo_, tooo IFals E` ?F(Eãk,€,$F'_{"barLFEL8barLO nowH PEF)) 0)ûtest_descriptors_with U8e|aC(meta Ï=abc_ABCMeta�™@propertyFJT@abc.qz $ª­�return 3(¾@foo.setterhS, val Mú , ¬0@C.¯g¯ópsuper()9 h” DD” @D[C”5°:, 3ˆô# check that the #V's __6__ §P does4 `# righLðing when presented Ø aÔ"uesÀfails truth :ingQ)ïNotBool(objectÛ‹__bool__+À û raise ValueError() ù__len__ = __bool__#ðwith self.assertRR&s(S)):0^Ÿclass F(C €def bar(W#'Mpass\ñbar.__isabstractmethodÄNotBoolè9õfoo = property(bar) c—ðtest_customdescriptors__o¾ùD9d�__init__Bÿ, fget, fset=None, ._,! =3·Ù&0set&=set&�RgetteŸ, callablxvreturn Ô(1,”Whsh*Ìth@Îê&wfîr(getatt#v?, 'MŽ', False™“;or RsôR S[aC(meta Ï=abc_ABCMetaÎ@² Z@abc.Î $À3foo- 3(R@foo.éh�, val): ù  €2TypÒ?, C)D}0@C.¯ ¯ópsuper()9 2” D”?E(D©[C”�!(ES°)ïSC_abcñ ë # evùes can be ABCs, too.,&/ A¨$x™\1 ›Equal(A._À¯s__, {"x"}¬�(type, Aµ—’ 01Äg_Ð;m˜@regiò¾tion_basicsÀ class A(meûtaclass=abc_ABCMeta): Ipass5Ÿ B(object2yb = B()Fñself.assertFalse(issub\o(B, A)/O(A,)2ðNotIsInstance(b^Œ +Z .ÿB1 = A.register(Bª?TruØ.}_Ô (T Ñ‹{Is(B1, Ó–O C(Bí_c = Cí æCŽã.À1ìcZé1c, T ,”def test_äA_as_`_deco(1 _ A(meV$@RˆŠYn8 Sm .-�i ©b�ð ŒÎo+0Is(1}?C))¸3isiîß_invalidation¹B¡9»©i6/›Àtoken_old = é¡get_cache_ ©… ×.O_newH³’NotEqual(BRold, ?newÞxÝ. LÔÀt_registrati÷on_builtins(self): Áclass A(meta Ë=abc_ABCMeta,7IpassAùA.register(int)pÿ.assertIsInstance(42, A)O(A,),¡True(issub»�[0b 3NO B(AB?strI C(-: <  ""ÅI)¾, 0str[ ¤…0b3Ca3C, _Ã’def test_Wÿration_edge_caseÅNÁA) # should²• silently£#/A1$d0RaiưRuntimeErro”1E@‚ÿcycles not allowed€�B(object¨Ad!(Bå)okS!C*C€_7 C61 zqer_non_é:B Þ”Regex(Typ¢"Can only 1er �Ees",·ŽrU, 4) 3 êdßtransitiveneshCó lAùgA9û/ BÍ' IFals]OA, B‹/O(B,)2B aBÀ C(metaclassû=abc_ABCMeta): IpassÙA.register(B)¯class B1(BHñself.assertTrue(issubCz(B1, A)]/ K(A,)2L_ C1(C�&B1Ø/C1|IFals¬KC, By«/-(B«2 /B1b1c oCo/oÄa%/% 2% 0f 3C:intP`MyInt(,Hç2{ ÐIsInstance(42_ ¢� )V -–def test_–ð_bad_arguments(K X!aA(meta [sxPwith ZûRaises(TypeErrorq3¡0({}ñæ # unhashableÓ-`+Q`ªNo __mro__`ð# Python version supports any iter”4 as?.ÿð# But it's implej atHôdetail and don't emulate it in Cq P…. C©½P = 42Яis not tup:;0C()›-`ÿ all_new_methods_are_calledb6ù�B(objectO¹counter = 0›Aµ_®__(cls>&$B.DM+= 1E#QreturXer().T 0®0C(AdÆ ›:eEqual(Œ8, 0ÍÀ C()  ñself.assertEqual(B.counter, 1) %ð def test_ABC_has___slots__(C%):*2VõTrue(hasattr(abc.ABC, '?/')fÿtricky_new_workse“ðwith_metaclass( ‹, *bases“—% % _(type'+]_€ñ_(cls, name, this__?, d;?areturnk(:5 ),�.s¤Ñ, 'temporary_¶©', (), {})J A: ...B+C(D0abcå¿Meta, A, B)èIpassfòH2C._°G__, T") U°ñTestABCWithInitSubP(unito.!8Cas§›_¿dinit_s>� µWˆ(=š Ä›¦J = (pùsaved_kwargs = {}]  ReceivesC�K+dÏ)__Á_t"**` ÌšŽsuper().> «,³ƒ.update(a½/r(ÆÒÿ, x=1, y=2, z=3©*—z, dict(UÎS°LegacyAPI, R J 15_Py4 7R_Py =ñtfactory¼ /[%ûget_cache_token)²C± °C¯@_py_^?ABC³8V ´` if __ëò__ == "__main__"òÑq() from` iÞðt support, seq_ß#s ; $gc ‚pickle oPTupleï(Dp.Commonœg2`11�†ì_getitem_errorw€msg = "t8ð indices must be integers or sl"(¥ —ðRaisesRegex(TypeEnS, msg§Q{()['a']¥pconstru™ Î )à) # caó*lling built-in types without argument must return empty õself.assertEqual(tuple(), ())&út0_3 = (0, 1, 2, 3r_bis = <-aPTrue(@ is 7*‹+[]�R (�2É</''dQ'spam,p's', 'pa/m'fõx for x in range(10) if x % 2),n›ñ(1, 3, 5, 7, 9)) +ðdef test_keyword_args(â!):!A  åó RaisesRegex(TypeError, 'D3'DHÛ�sequence=d…\truth~�super().§"ð9notu¶ ](42, ý?lenv t<o()), 0% 0,'1'#,3©Oiadd­ !butQ2 = u{—ju += (‘ 8uo]-u2‘?mul‘ !~‘E*= 3 Œbœresizebug–ð # Check that a specific bugP@_PyT¹!_RA ()ô•squashed.�®+f(Û•iE•+00"juyield iKÚJ3ist>0f()lU ¼=has3�# See SFÚð942952: Weakness§) <�Q# Thev should#½÷ be non-commutative=#9€ spread-?ÿclosely spaced values7`õexhibit cancellation±çs like (x,(x,y-¡ñbe distinct from eleÃðAes: æP(x)!=I((x,L Th\�est exercíÆ those cases À# For a pure�1dom[ü and N=50, the expected number of occupied ðbuckets when tossšÀ252,600 ball¾“to 2**32 . E0is 3p592.6, ¢b‹67.4‹Àcollisions. c The #ü'standard deviation is 2.73. On a box with 64-bit hashFü&codes, no collisions are expected. Here we accept noEÇmore than 15Hñ. Any worse and the…P func² IÐis sorely sus€%. #EN=50 õbase = list(range(N))ñxp = [(i, j) for i in 4j]2binps =#+; uxp] + \=� w!xpƒur + xp +½@zip(™¾‰`= len(�1) - €set(map(Ì!, ;÷self.assertTrue(Kb<= 15)Oàdef test_repr(5%):ζl0 = tuple(RÖl2 = (0, 1, 2a,@`.type2T7(l0 7 2†1±ñEqual(str(a0), ›/l0Ý,2,2, OYF"()"¢ �)V"ð"²8Á_not_tracked;7, t>‚# NestedBñs can take severaleýqs to unL~0gc.µ7ect~ºµFalse(gc.is› t)™ð8ò6I®ŒWùñ@support.cpython_onlyrV¾@_litEsy vòTest GC-optimiz"of‡ 8TÆòx, y, z = 1.5, "a", []. ¼ ë(^ /1,    B! 2ŠI�, (None, å!, ÿP, ())t@ 1obj]° a(1, x)&s(2, 3))0# T s^òmutable element?qalways Ýøed, even if thosË 54not2P righl%w.µ•SN(([]Ä1 /{};c) <£Scheck¤qdynamic£b, tp, µH„À check = selòf._tracked if alwaysò else self._notCed ¾check(tp())/[]_set()�[1, x, y6€obj for ?in , b!šÏtuple([obj])W2/tp5 3V!([zØ[û$ o{x: y}$ (V/, | ==ñ@support.cpython_onlysdef tes^�_dynamic($!):"nó # Test GC-optimization of 1ñally constructed Ø%s.BQ.²Èj)‘, False) 0®�subtypes¯ S must\C be mß�class MyT6(’ý"Epass/ÌB_, TruÍbug7466Ʊrying to un´Ä an unfinisheá could crash Pß ª=ÝÂ(gc.collect(„ài in range(101#D®repr_large¦CˆP the &)P list46ect<R+(ncÁl = (0,) * n}x1s =Z&(lNéassertEqual(s,8$ð'(' + ', '.join(['0']b)&)'R•010)7Q # B our ŠEcoded 1(10»ßOïiterator_pickl6AUser"*ƒs don't « 9u†yet sincz#nòy are based on genrubdata =C)2›Ö([4, 5, 6, 7]¹Vproto ‚ûe.HIGHEST_PROTOCOL + 1¼€itorg = Ì(vXO2d =Ï�e.dumps(0!, p +&it,zloads(d!}öÙQ3), 〠4,Lit),&ÆÖD�znext(it²þÀt, proto)  ñself.assertEqual(ûtype2test(it), Àdata)[1:]) I@def -ñ_reversed_pickleL!):$(\ata =NÕ[4, 5, 6, 7]),òfor proto in range(U÷.HIGHEST_PROTOCOL + 1ei„itorg = �(²\#Cd = Qadumps(4,t‡+&it,zloads(d!D?Q3), )4 E,x Ï)~£§1nexÐ Ÿä°2üno_comdat_folding4ñ# Issue 8847: In the PGO build,óMSVC linker's COMDAT Píð# optimization causes failuresf÷ code that relies on distinctGAfuncC¥addresses.õclass T(tuple): passBwithýHûRaises(TypeErrorÅÔ[3,] + T((1,2íkÿlexicographic_order>U21100‰…G1, 2b¨#7, 0&c&3#'ð–Less(a, b  òb, c) if __name__ == "__main__"L@unitp.óH() # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """Uc ˆ#ipëô module.""" import Ž$re ¤contextlib<Dools„operator“y¢weakref jÔBaseTestCase(‰.QÀ# One big chIìZQ overF’original ì" iÁ0# e¤0 reõ2ing* tr)ñ to assume users *don't know[arules*€#Rwfóconstitutes an RFC compliant IP ud`# EnsuäR"se�€s are em°d correctlyâ0allÈ evNDcaseÈ me1movÅño a more systematicÌ“ structur`allows|Ç�%Ro mapK#di‡ to1JRÒ3Not^!if)w"orÚÀrefactored sL$at0es P�€multiple¿¡blems get $ðified differently, thñ#at's OK - just # move the affected examples toónewly appropriate test case. FñThere is some duplication betweenJðoriginal relativeXSd hocGY‘suite and4ánew systematic{‚s. Whilem×redundancy inH0ing‘ðconsidered preferableÛðaccidentally delet2wa validH,‡»£€will likÇ0be ‰óced over time asH¤tÀ a-}SifiedF@aAerty5ñdef factory(self):µ raise NotI¨²mentedErrorŽÃ@contextlib. qmanagerBY±assertClean9b÷ , exc_type, details, *args|1"""Fˆ`Ensure6!epìódoes not display a � bdRfault¥@ Wraps unitU`.TestCUžRæesRegexr~0if œS¸$ =Â! %&BPcm = P.f(ÿ)7 with cm asï t@yiel6ņ## Àwe produce cmõ tracebacks on failuref if^B.excQ3.__@ __Ì[JNone€Î@TrueÇ C†suppressL)„ 0Add" JÞaÕ>QValueC§hreturnsw2ipaz.D,R § ÙqNetmask–å 2L;"""Ù>Ù* DÙ3ãInstancesEqualÛ{lhs, rh°PCheck‰@struQu7sžÄequivalent iZÆdq. Rlhs),ã†ð) class CommonáfMixin:§ús_empty_ Ìr{€*Ó"@ can1be M"A<@œ'""�¡floats_rejƒÿre.escape(repr("1.0"))€ <1.0�ünot_an_index_issue15559‰%# ó­_1ð_ makes for a very nasty interaction wiƒth the õ2# bytes constructor. Thus, we disallow implicit use as an integerJðself.assertRaises(TypeError, opera\qindex, - fao_y(1))Fh;'æxyðdef pickle_test(ž�, addr):!-òfor proto in range(4÷.HIGHEST_PROTOCOL + 19=Bwithõ@subTdK= ,02x =/$�Œ#3y =¹d.loads’‚dumps(x,±_5â­ð Equal(y, x) class Common§›Mixin_v4(1): �:3á_leading_zerosAÖn’InstanceswW"000.a", "0." @s192.168D1@K.1")§"inÞ�0�ß3232235521, "† opacked&½�.fromhex(40/")¡ H�c0a80001H° þnegative_ints_rejectÀómsg = "-1 (< 0) is not permitted8AIPv4\Aess"E‘!CqAddress?÷(re.escape(msg)¼:]',-1òOlarg¹Ï%d (>= 2**32¾F# %aÆ ƒ »Bbad_9|_length@Œ=BBadL#* lL² = b'\0' * $ŠTËÿ%r (len %d != 4I×@ % (™,�)èO ì.î û3@ ?5) ë6ëI10::¹_, "::áP000::ª:àÝÀssertInstancóesEqual(0, "::") ôself.assertInstanc+¡32322355214‘c0a8:1") ;ðdef test_packed(G!):Yóaddr = b'\0'*12 + bytes.fromhex("0ŠN„.b °0000²’¥ìNb6æ0h ¿']Ûæþh?!:1ˆ5Nþnegative_ints_reject^ðmsg = "-1 (< 0) is not permitted as an IPv6 ÀAess"hÑWwith ¢÷ AddressError(re.escape(msg)Ñ:5¬factory(-1 Olarg¹ß%d (>= 2**128¿F$ %bÈ … Ö3badÚ|_lengthá²6BBadL#* m€@$2 * $�WÎÿ%r (len %d != 16JÛ@ % (š,‘)ìO ð.6#Ü &15@ ³7) class ‘ôTestCase_v4(Base€, CommonƒMixin_v4tœP = ip°ƒess.IPv4R ä�network_p�Sd_as_4 ìpÏ127.0.0.1/24Pa"UnexpÅÁ '/' in %r",–µG³¥ i�”œess_split± �S"0 q. $"E·�4 octets¼ À%kRrtBad–"S¤ "742.´K&#   .Š' Š.'.) t?.42P.�)À assertBÓadSplit("016.C") |assertB&"  /00 Tx0a.0)$ ._bogus O.com$/10ë 0J £92.168.0.1tŸñ def test_empty_octet(self): Â$ÃO"Gaddr"&Pwith :.,ðAddressError("E_ _õ not permitted in %r",nL |0 ipƒess.IPv4~(%) ]›2Badǯ"42..42.42:$ ..æC .ÿinvalid_characters5, <ü msg = "Only decimal digits)/A % (M", ⊠ëre.escape(msg)ˆBH"oy0, "Z'0x©:"5a4®´ -0-- º,+,+,1-42Y  +1.+2.+3.4,/+1±�1.2.3.4eƒ°+ ::U?4::V aX). žcoctal_I¯_ambiguity£1AM1ous€3al/fr) valueŸâ£a£ ê³7«³J?016sµ001.000.0081308"^—_lengthr2–t most 3 mcZÀess(addr)  ÷assertBadOctet("0000.1", 2") 1, 3ð 12345.67899.-54321.-98765<1") > def test_omÑ_limit(self): b$ baaddr, 4)-qmsg = "¼ñ %d (> 255) not permitted in %r" % (D , QÐIPwith Š.|û AddressError(re.escape(msg)ƒ> ipRƒess.IPv4<(ù%YjP257.0f", 257� )ó192.168.0.999", 999W,PlpickleKÐ_' ('Kl0.2.1'B|weakrefC.‰.factoryK£) class ûôTestCase_v6(Base€, CommonƒMixin_v6OX9 = M6R @�network_p,Pd_as_mã¢S6\ …±At least 3 M Åý¹ ?msgî9ò% ´/":?Ð?":1�FEDC:9878CPïtoo_many_colonO.rmost 8 M QPhÿ9:8:7:6:5:4:3::2D :10:0/ :\, †H2:1:èÐ# A trailing w¢ess is two¥E 3 ¶442.  [’Exactly 8µZGtout '::(Ò  Xg>i3ffe:0 ]ÀssertBadSplió t("9:8:7:6:5:4:3:2:1") ÿassertBadSplit("(ÿ# A trailing IPv4 address is two partsW ƒ442.‹-a.42") eÓdef test_bad_‹ _sÄÑ_v6_too_many_–ñ _with_double_colon(self):J N T"&òmsg = "Expected at most 7 other mÅ '::' in %r"eC}.oAE¡Error(msg,W x9 ip‘ƒess.IPv67(%TÍÿ1:2:3:4::5:6:7:8=�repeated27A)2one`permitD$n�3ffe::1: Ï1::2::3::4:5²Ÿ2001::db:N sK#::&$ #n/1:L' :'0db8'˜[©leading–0LJ¦ ':' only d!as›2 of~tn:)Œ :À¿½ )( Éœ¢ õ£0T@¤‘£ó"z7) Ÿ::1.2.3.4% €¯!v4Õ/_iÅÀBadAddressPa÷rt(addr, v4_error): ð with self.assertAddressE+¶("%s in %r"@ , P FQ ipƒess.IPv6H}%) se3Bad ñPart("3ffe::1.net", "Expected 4 octet…'?'")L…27.0.1",.£ k>mµ?2.3g%O.2.3eO.4.5i)@m‹!1.pqð Only decimal digits permitÁ¯in 'net' "ˆ )su¦0ð def test_invalid_characters(´†+]VŽg, part'qmsg = "º?hex¶#%rù@ % (D÷—E< ëre.escape(msg)ƒ>0Ó)@goog(, -0*/-08(+(+(!-1P1P1Ö@.4::) .ó'1234:axy::b', "axy"/Òý_lengthö/¦At most 4 L ±ûì2msgj& cí%0::0G›1&. ’02001:db8£¡-80::1¤ 8§\ickle¢§!.p_Î!('Q~'ê|weakrefD.Š.factoryLø) class NetmaskTestMixin_v4(Common“ """Input vbò$ation on interfaces and networks is very similar"""Ý®0no_} Ä¡‘Equal(str$Í,c')), ' =/32&rsplit_nåDËiðaddr = "1.2.3.4/ƒ32/24" ó6with self.assertAddressError("Only one '/' permitted in %r" % addr): LL�factory(a  m�def test_Pess_ec s(0)C'Š3Bad�G—, details-qÁ 37w.§ €c"/", "Žñ cannot be empty")à98:%Pbogus=PExpecv�4 octetsq ¯google.com<110/¯r�::1.2.3.4q1Ïdecimal digi¯ ;û256", re.escape("256 (> 255)"))AÜvalid_netmask@ØÁ‘Equal(str$íô'192.0.2.0/255.U0')),ÊÎ 6&4'óPfor i»range(0, 33¢ù## Generate and re-parse the CIDR format (trivial).‡Ñnet_str = '0.Œ/%d' % i'" =Ê×:­Ò!onet), 0¾ €expanded:� ¹ j °Œ œàP.0/%sâCnet.è) ðZero prefix is trea/3as ‰— "†0i}Û1hos«ù. The ambiguous±# cases (/0&ˆ/32) areÏ sÐ"if�k(32, 0|f×A(32 - i  §P0¶ô :JdÎNì;§m ê�msg = "%r !a )œ¯sˆÊ @l“Kmsg)r>äp`"%s/%si²pÂ1›3Badh"(">Ú(/-1*+*À asserótBadNetmask("1.2.3.4", " 1 ") _asser+?0x1+/33*B254._5.256701.aÄ/ P1.1.1æb?xyz3¯40.255.0.0fÄ_4.12850¤ 27lhpudding/Q::") ãñdef test_pickle(self):._'ö('192.0.2.0/27'') ÿ31') # IPV4LENGTH - 1d8 ;õ class InterfaceTestCase_v4(Bas#, Þ!ƒMixin_v4Üõ factory = ipaddress.IPv4UgpNetworkDe5S �œsubnet_of„õ# containee left ofrF­eFalse(Èõ@('10Ć.0/30').y 371úF4'))ü¡oinside  ?TruŸF0Ÿ OrighA‹¿larger thanF æ¯æG)'_super¨e{ªTd-.¢92L­@À).supernet_oKf( õself.factory('10.0.1.0/24'))).õ# containee larger thanr*PªassertTrueq m0m¿.supernet_o¦9!30¦}Âdef test_subGÐ_mixed_types({!):*Pwith .¬÷Raises(TypeError+/óipaddress.IPv4Network/‰ B6B‡::1/128'l›)Y—Ù›)].¯ + vÛ™3Y•Õø) class NetmaskTestMixin_v6(Commonnò"""Input validation on interfaces and n~ñs is very similar""" à bplit_nƒ Ñ‘ = "cafe::ŠQ/190"G‚ ñA#ð("Only one '/' permitted in %r" % cÛMs ´Pess_e† ·Û±3Bad�(3›, detailspÁ 3§  €c"/", "Žö cannot be empty"¥98:%¡google.comBÿt least 3 partsu 1.2.3.48"0/¯m 234:axy::bq2�hex digi¨k×¼ù²`# We otñsupport CIDR for IPv6, because expande+~‘s are notmÄ # standardj.¤­‘Equal(str>(û2001:db8::/32')), 'NŸiËrange(0, 129¦¡# GenerateâÅre-parse theäÖmat (trivial)­Îïôstr = '::/%d' % i�À self.asôsertEqual(str(self.factory(net_str)), ' ù# Zero prefix is treated as decimal.1^/assÉ'::/0%d' % ixHñdef test_netmask_errors¶!):#Ÿ'fBBadN+Q(addrÈ9-1�msg = "%rŰnot a valid÷/4" % e8Wwith ÕlE–û(re.escape(msg)r>9l`"%s/%si ª%) s Ô¯"::1", "")$+'?1::N/-1&+&? 1 M/0xN?129N1.2.3.4+pudding+ ˆ<‹ƒªlpickle¢û_'ö('2001:db8::1000/124'®/ñ7') # IPV6LENGTH - 1‹kp=(Aõ class InterfaceTestCase_v6(Bas#, ù!ƒMixin_v6ñàP = ipƒ…ess.IPv6UgpNetworkDe5SB“0subÏ,of–õ# containee left ofrL‹eFalse(B«õÖÖ0:999::/56').{ 59¶aaa::/48')) ¥oinside¤ ?Tru£j£AOrighI5?bbbID¿larger thanN òO¹ò"ˆ)ø¶?per¸4ÀFalse(  òself.factory('2000:999::/56').supernet_of( 1;Åaaa::/48')))0õ# containee insider%MºassertFalseo ¦k¦C�right of¨1?bbbNF¿larger than« ?TruR½ø$�Â)) class FVñFunctionErrors(BaseTestCase): Ddef üŠ,(ö#, ÷�, kind):1…ñ"""Ensure a clean Value;õ with the expected message"""Böaddr = "camelotðmsg = '%r does not appear to be an IPv4 orU6 %s'Uzº.ÒC›•( p, msg, � ØÜô(!)$€test_ip_1ess!v|x#ip1.<3, ""aŸinterfacec">5, " gnetworke"<3, " a0 @fnóools.total_ordering”L2‚stObjectL}a__eq__ˆw, otherWñreturn isinstance("), MðM/ltM ä ¯oSmalle°5 N±g±Ú ComparisonÊ`s(unitœ.Ù v4e6 = ƒ9@AddrÀ1„]v4net%N%Mintf&Iª(6s6s6s6s6s6sø$v4“bes = [÷@, v4A]$ov" 1+13net(6LÐ1, v�$L1LÛ]5&ð4_objects + v6_oð bjects v4addr2 = ip óess.IPv4Address(2)'>net&vNetwork&Nintf'•Interface)6l )6v6v6v6v6vÆñdef test_foreign_type_equality(self):*õ# __eq__ should never raise TypeError directly7‘other = og(@P0for@ in j.!sq% assertNotE›a(obj, WM ,PFalse)? ==+ T.ß(Zÿ, NotImplementedk@One__@s_mixedq ðEnsure none of the i<0nal;·· accidentalu�# expose3�right setDñattributes to become "ô"¢J›?lhs› %r% N1if MKs rhß…continue‚@lhs,K)³SOsameR ³?objØ sÜ,oOLess+|Greater.øÉŒorderingŒÉÎ(A1..Ë,] ?2),)5net(c'X( PÎ) )yÜyÑP y£ý¿2+ (&º+è (r¬?lhsz)W.ØN>òú(ž<|~(P=Q=RI³Á0ain,~•¬u0v4_îKesseÁ In¾ôF4netÄ Q6QÐ6net) ò for obj in self.v4_objects + [‡6net]: óassertNotIn(obj,B/). a6a4a/!) bðdef test_mixed_type_ordering(¥)¸Š5lhsëè!à%r% )ðif isinstance(lhs, ~˜(rhs)) orrl rM�continueØÇ.lð Raises(TypeError, lambda: Ù < }@'>@,/<=A,>AÃÛforeignÝ pother =ÌFect(€Ãsmallest = S Oá$Blarg#L "'<Bwith®ŒÜT!< ½õK$>K7/<=L7>L×@TrueB3 < ‹À+BFals,>,W=,X-$< `²†>,†/<=.Z-H=`key=ip›Ness.4)™æh ™'1™#À.assertEqualô(v4_ordered + v6 ?, ÿsorted(self.objects.Fõkey=ipaddress.get_mixed_type_key))qYÿ assertEqual(NotImplemented, H (’1)) Pñdef test_incompatible_versionsÄ!):*¨õ# These should always raise TypeError. v4Ï' =�0ip_qess('1.'Ù\v4net0network06M 1a8::1]6] ,»cRÞ%s(ß", Ø¡.__lt__, v†Æ<g<!7netw?netv:u:íÞvÔw<x<³dv:uí� class IcÐUnitTest(unitÿ.fCase):\setUpÞDipv4É RIPv4AıW2.3.4„=�interface?IA//2D BN2�0@#…�hostmaskB„ 0.t1/0.255Ô66NsMð'2001:658:22a:cafe:200:¸¯/6_4b!//6U/6_U6U¶:LÝPORepr;¸"/0'1.°4/32')"3r]åF/')3 {7�'::1/128x Ctð# issue #16531: constructing ±P£ from an (· , ’q) tupleKS6T XQ# /32+W-ipÏ’x92.0.2.` ðIPv4Network('19ã2.0.2.1/32') óself.assertEqual(ipaddress.IPv4Network(('19@Ï', 32)), netH/ip?*¯3221225985G*Î W'255.' )~hL†@õ# strict=True and host bits setrWwith †õRaises(ValueError):,› 624)ša4¹XA† `Aë »/0'&CeN3m�OFals‚ onet = X>O0/247-I24),ÌÐ EÄt)|e¬„eÅ/1'€ 3BÂ49¹À255.255.0'),/ õstrict=False), net)Cõ$self.assertEqual(ipaddress.IPv4Network((3221225985,<†T'255.?0')BÁ†U# /24Zip = ÄAÐÆ('192.0.2.0'=net1õ17/2444@'ó 5¹%/ip|g54„g…O 24)H(?) G¸T ¦Interface(Ç21',KE ‘ E1Ú‡Ñ5†7Éó# issue #16531: constructing IPv6Ÿ£ from an (±Ñ, mask) tupleK€def test6T(à!):-e# /128=6=§2001:db8:: >Ÿ&('2e6…tABŸ', '128')= Ùeüð(4254076641128259285690398495“¿826560, 128Ž>?(ipéµF/96´/D³2ÀPv6Network(  û (42540766411282592856903984951653826560, 96)), >Enet)ÿ!self.assertEqual(ipaddress.IPv6Network((ip, '96'Z[õ# strict=True and host bits set(Zip = wAƒæ('2001:db8::1'µWwith ºõRaises(ValueError):^ø ]Ô ^77c4P‡Ä1�CÄ•¢OFals£ =net¤GF/!^¡[ A!1'ú½DiÇû=Ðw? •Ñ× ÅIÀD96),”+üU# /96Ú ªInterface(ÁB ªI$f �¿É¼ù·†‘# issue57ƒdef testö€IntMath(Ùɪ4=A('1.�') + 255u ¶ A_2.0')d ;¿1.1') - 256|#0A|6ø#� + (2**16�  üEOffffû:/ -‚)À('::1')) ó def testInvalidIntToBytes(self): ÿ*.assertRaises(ValueError, ipaddress.v4_int_to_packed, -1)F/B�G2 **�¯IPV4LENGTHw 6½2 F½6½6 mternal˜Yip1 =ÿ2v4AŒT('10.'?ip231333231¶Equal(list()c_find_7ñ_range([ip1])),ûã P[(ip1p61)]Òl%I3qa, (ip34}52N‚3v 0128MQÿ._count_righthand_zero_bits(0, 128)?ñ"IPv4Network('1.2.3.0/24')", reprr.ipv4_n'1)) ¶±sMissingEqVersion7UÈclass BrokenCBase:.Apassh b9$ =B˜'127.0.0.»Wwith !¾óRegex(NotImplementedÌ"�2.*vµ"ƒv.ö�Cßô›?ô¯¹ û3Get³ ò} 1int$ A.Id¿), 16909056ª/stŒKÅ'§?˜ 6ÙM€E ÿ42540616829182469433403647294022090752Ï‚"ú'2001:658:22a:cafe::•Àf.assertEquaÿl(str(self.ipv6_network.hostmask), {'::ffff1') 3ñdef testIpFromIntf!):Su±assertEqual †ÿ4_interface._ip‚ôipaddress.IPv4I6 (16909060)@�svipv4 = 7$ipòµ('1.2.3.4')¢/ð2001:658:22a:cafe:200:1C åƒ,‚@int(.…_Ý&))“P6P 6Pä v6nõ = 425406168291824694335477624820979466258 ‰2P¾6¾“ ¼`/Æ&E=�.versionK4d Š.0j6j6‘ !aPacked$x …�K!&ipÂó(b'\x01\x02\x03\x04'™P˜�ÿ('255.254.253.252'L 5pÿff\xfe\xfd\xfc'þ } u2 çJÒŒ#20R6\x58`2a\xca¤'80<o1').ipq'`R2:3:4f:E@f\x0�½ÁO4' +»û‡Pf' + 00' * 6� ¶:§W1X‘\GetIpîk2ò6Uip), YÚ+@ü+@B‚JúB6| l!¹w'´À58:22a:cafe:ñ200::1') def testGetNetmask(self):"ñ.assertEqual(int$ò.ipv4_network.n>ï), 4294967040)E?strE T'255./0'J�6�ƒÌ ÿ3402823669209384634449278633580586598Å 0elfwÛprefixlen, 64cOZerodJ@zeroÀ…ÿ = ipaddress.IPv4Interface('1.2.3.4/ V¥ ­¤ @_àT_from ßstring('0'), O_True(N„is_validöEëB .0/')HOFals‹!inœID_ipv6_¨ 6¨?::1¤ R¤ @˜¤ Ñû_‘NetAndHoss›anet = ÇõGT$b^net._ßT7;å:G128.–>B} ?O.127C-?255CÈ Ó‰BFh˜/('A5pxt8<>6�>­6èN àNGP('127À1.0/Èwþ /•u2u²GetBroadcas¶ÖýÚ b@_‘¿), 16909311eMâMÒQ– ›QéQiGÀ 4254ó0616829182469451850391367731642367) ñself.assertEqual(str(õipv6_network.broadcast_address),CJû'2001:658:22a:cafe:ffff1') Cñdef testGetPrefixlen‚!): X‘ ¦·ôipv4_interface.¬pFO, 24ê D6D .64©�Supernet¨žs;().©3© “4“I\œ�1.2.2.0'pw{#ipòd.IPv4InA('0.E/0'){”  ENU Cdrí�hE6EIEá:Q ÿ6D?::0@ NMLIV­3®)3¯1?B¯3/°0°—! ¸6¸"¸ # 8:#Äœ4œñRaises(ValueError, ÿ¶. x4 pÒ_diff=2, new_=|6j/25= •9©3len¿ƒ !(Š#2)/ 4e÷sW|À  ònew_prefix=65) ñ self.assertEqual(òipv6_network.supernet(?Ålen_diff=2),GOGŠA2)) EÑdef testHosts…!):Rhq = listU.ipv4¡/()Õ‘254, len(+* òipaddress.IPv4A Ñ('1.2.3.1'), C?[0]oE 6254G3-1]èw9 = G"6N�ö ('2001:658:22a:cafe::/120'‘£0U.+ 5+!6+Ÿ8"R /ffDó# special case where only 1 bit is left for ëhYs = [z02.0'ù3 E1')]fpstr_argi'RE/31' 4tpl (!V', 31á^¶º,!Š$ip$(u)N)£N¶•RGŽN Ô] à? í¹7ú.o', 127¹)â\ñFancySubnettingJf Uasorted' qsDs/3)ÙN?27)¥òRaises(ValueErrorô 7À óself.ipv4_network.subnets(new_prefix=23)) 2õassertRaises(ValueError, list,,3>pl¯len_diff=3F Q µ7µÔEqual(sorted(�6ÿ �?4))‘N˜?68)™N(¿q¾?p /- ²µA8)) HÃdef testGetS›¶!):?.’Ý…ÛÚe))[0].²O, 25ßMAstr(Qpt|ÐfV�_addressE Ÿ'1.2.3.0'�C?1].�C128'ˆòîjj#65N Ö±ForSingle32»àsip = ipCb.IPv4N­(4H4/327(P1 = [¿åx) for x in ipâ%)]Óõ22 23: DH1, [—]Ï ©#, =2?128 6 B::1/ÅÀjh”* ,sĹ§Ó  9:ipsÖçs0/26', õ)64:128 92]éY/v6¶ Y¶*v6¸À['2001:658:2ø2a:cafe::/66', ´'2001:658:2'O4000,8,c,1]) †ñ def testGetSubnets3(self):¨sð = [str(x) for x in *ã.ipv4_network.-F(8)]Aóelf.assertEqual(%J[:3] ó['1.2.3.0/32', 12/])^?-3:_0253Ea;2545e 4lenÇc), 256P1Dipv6ò = ipaddress.IPv6N)(ög:/120'Úyct.€Š8¨_:1/12)2)R ·¢!fdR @ V/fe*f*¦ øHEýFailsForLargeCidrDiffXûRaises(ValueError, listÝ\{¬interface.…'9)Mn4dO/6_Ò/65Ó>«He`ÖopernetØ/WÅ Ò �kÔjjj#65Ô!Negativßh/-1 >Ée'À  ðself.ipv6_interface.network.subnets(-1)) -1õassertRaises(ValueError, list,,0 >oe:ðdef testGetNum_Addresi=!):$V.ŠaEqual(Tipv4_]Tnum_a@_, 256É?¼Dj))[0].RŒ� ?128kª«supernet()ce 512) i:õ6õÿ1844674407370955161U#ÿ922337203685477580v u ô3689348814741910323@Y�ContainsíQSIn(ip:d.IPv4Iÿ('1.2.3.128/25')î©�?Notk o4.1/24i? l�# We canR Òões and string as well.T&J1 = ˆ?37'Ò1In(@,– ãissue 61, bad °ö comparison on like-ip' uobjectsªö # with identical broadcastëØ'<[FalseãN÷áã1.0.0/16').__c/5__(yj #B0BC5'))¾~?Nthy‹1str$šÎc[5]), 5~“SIndex“ö‰Ã.__getitem__Ø-#Š˜Š4 ÿ'2001:658:22a:cafe::°n °{1 << 64UGÑ5Òò # http://code.google.com/p/ºA-py/‹ås/detail?id=15ÜË ç“72.31.2555 ?240¢W128,¢¦.prefixlenMt_�! =PP £)'1‡ ',Ù5F6[0]¿À self.assertóEqual('172.31.255.128', str(addr[0])) ¿self.assert9'439�_list[-1?$: œc , 3 ¬sdef tes¥¶!):ÈÅQTrue(õipv4_interface ==/3 ipm”ess.IPv4I3ß('1.2.3.4/24'3OFalso p3pG6à/::â*? ''I ? []4"2)µÜ± ì6ì pÿ 2001:658:22a:cafe:200::1/6ñt;õt õÕp!ó ¤ó 4óø/Noûw!ü�  ko–'n.ùùp3 ÷3 Óö#4_» u ätAddressß5l ›hÿ1ý1û â2À != ð- ipaddress.IPv6Interface('2001:658:22a:cafe:200::1/64')) <ñself.assertTrue(dipv6_iL5 !=/3s 3s,w 4òŸ1.2.3.4/2n ? ''? []352) KjzÒ x A#('ngþ1ü1úñ def testSlash32Constructor{/): ªEqual(str(øý6W/255.U')), 332'– œ?128�*Œw0128x©±'/- —0•*/!0.� /0.¬CollapsingÂ#ê“ only IP õ es including some duplicatesZip1 =Ý4æ@1.1.‰12/ 1á?ip3/ ^4/ 3^5/ 4/6/ ëÇ# check thatSõare subsumed properly.Pc¥)edk_›(2ý�[ip1, ip23456þ«Tlist(^9d),VZt¸€4NetworkÁÛO/30'6  6 4/Ë]Íf�Ša mix of…Rand nx’˜À ip4 = òipaddress.IPv4A @('1.S3') z#ip5 = 0”Interface2J4/30565à check that žõ es are subsumed properly. ™collapsedp_H ([ip1, ip23&4]çôself.assertEqual(list(G5d),q[tNetwork05]) Aò# test only IP n0s 9ip1Ì¡ Ug0.0/24o?ip22 1232 2242 329 È42ó# stored in no particular order b/c we want Cø»… to callC•# [].sort.ip‘ �U2U#�^”5is ?ip6ÎO$¤  ð ô=twoøwpernet'ûÓ� ˜ú"T?3')ãOsameð_õ Î81/3«½ŠFK1[ip€( ?2])û '1ð‚sf¸@ñ×4essF1™îiÍC.ip_¸¢“bÇ6r˜2001::/106Ç222 Ç 2$96<À # test thóat ipv6 addresses are subsumed properly. ãcollapsed = ip7._Àes([ip1, ip253])Bôself.assertEqual(list(Bpd), [ip12õ# the toejam testoµ_tuples = [­& (£$ip�A('1.='),2Õ2_::1')/a²IPv4Networkbo0.0/24e EIPv66¯2001::/120m"/32m"8m]Dfor Å1 in$m:%jÒðRaises(TypeErrorý¥?ess%PD1]) r1defÀSummarizing(~)‘9#ip›ÆB\l#ipnet&n¼&sde)Ne_range69ip10F1.0' ?ip2. C255'ý» � jps only «€0 & QŽPclass"7Aá °6?e@÷%tyH||versiont…return 78 ip_invalid5IPvˆ'R))î>lDValumKU =(š¤§&2)�#ks that axPy oveÕ4 & ip6 failsÇž �;9Óª(8¦ƒa /24 is¨'iz¾Ÿ{xo2))[0]H V8ßô F an‡!4 .T³isn't on a DÖ byte boundar~&8T„å â[ã 9j> 78')e# all!¢ ?Õû0U '|ð ._ALL_ONES) selfñ.assertEqual([ipaddress.IPv4Network('0.�/0')], õ list(summarize(ip1, ip2))) 5fip1 = h3ip_sw('1::')*2*_ffff: Kõ# test an IPv6 is ¦¥d properlyyIselfØ/[0 ånL†1::/16')é žórange that isn't on a @Ö byte boundar³/ip,2VÝé(3ip_›ÀÛ: ú:2W28')]+ð exception raised when firs!€ greater1on lastÈR:às(ValueError, Õ© "(È­�.1.1.0')E *E0E÷ 1andë@ are"3IP ˜/esÿ?Typþ,±üþ% E þ µ¶‘«´ÿ not same versionµJ (' ® °²1defZA5°Comparison(Ç!):%S0Tru•.Se1') <=;?I81.1WtT2t/::ä"77à5 PÀ ã ipaddress.ip_ ñ!('::2')) def testInterfaceComparison(self):'+É.assertTrue(]i@A('1.…/24') ==@D@)>~e16') w&¼ú'w}'?}%1µ }%¶” ï_::1/6i$<ô:a ; 80€çëY1::2&ê!O2/48K"ê›u! 1/$O u)$u\¿9Ôš5ÉNetworkÇò# ip1 and ip2 have the same n= +Ç2=NCIPv4ið02/2 2632'?ip32 #2.de:à1 < ip3) ó self.assertTrue(ip3 > ip2) $ð Equal(ip1.compare_networksG), 08ÿ# if addresses are the same, sort by netmaskm2), -1)8 2¥1¥Ý3p3pKpe1._getHÏ_key() < ip3»ƒip1 = ipcb.IPv6N�ö('2001:2000::/96')?ip261636 Iffffq›d1à•†#‡:† ©[r'r# Test üõ ing different protocols.øö# Should always raise a TypeError+R&%s(%,P 7Dipv4? ‚>6>�Mipv6ðùInterface('::/0T,v4/4/!0. 4¼z ó Ô€.__lt__, 6›8g8 6p4p8p4ŸP# RegüPion t8Æfor issue 19ü Ç$ip�÷('10.1.2.128/25q@Fals¸T$Ü$  |o3.0/24zOÍ22y2$yÁ�Hk2œG¯À:UmÀ 3ÀœäÀ3HkÕÔ% /28%—0.10.0/31«ÝÀtwork('10.10“.10.0') ðip3 = ipaddress.ip_network('10.y10.2/314441ðsorted = [ip1, ip23%4]‹(un(#4#23(./(Ëðself.assertEqual( Ded, Y+“fp2k:–éIs(ip1.__lt__(ttU0')),®æNotImplemented× l2l@“…# <=, >=~JTrueáU .1F') <;Ø ;òtI?2')tOFalsé 2éZ?::1p!7áU5Å/::M!6m Ã¥!) ¤òdef testStrictNæ s(·!):"€FðRaises(ValueErrorª) , '192.168Ù8/24ú”N`::1/12¦–¸}Overlap²Yother‘CIPv4à°('1.2.3.0/3Qâ425 :2.0Í5 / j2.64/26NaDipv4i$.oÙaj < 2=x]2m+3)ÌEmbeddedIpv4µ†string =õA0.1'©Y$ W€Interfac+2v4_CpÜv4compat_ipv6=6=�'::%s' % e FÿAint([Àpat_ipv6.ip)ó, int(ipv4.ip)) ð'v4mapped_ipv6 = ipaddress.IPv6Interface('::ffff:%s' % Hv_stringKùself.assertNotEqual(_A.ip,;ƒ‚7vRaises(„AŒ ValueError@¡,PÙ�'2001:1.1') 3À# Issue 67: óà with embedded#4 rñ not recognized.@€def test<¯�TooLarge(Û!):'�õ# RFC4291 2.5.5.2).;83ip_„ÿFFFF:192.0.2.1')÷ D —c000:201'  ñ2 (part 3) x::d.°®¯+C®…v|Versionl R¸O".v:?, 4ĉ76†76BŒÿMaxPrefixLength’iga.max_pElen, 32›@;128¥oPackedœ.p9pÿb'\x01\x02\x03\x04'½�GIPv4hÿ255.254.253.252').zïff\xfe\xfd\xfcz Òa#20ßR6\x58ç`2a\xcay'–å A1® (�ŽR2:3:4™:*@f\x0Œ˜°14\xJfÑQ + Öo0' * 6æ¾R::1:0¸0n|�'Š ì]IpTyp†9netìøip_network('1.2.3.½2 3?ess36e /::g6Sg5Î:ÐIPv4Network, ótype(ipv4net)) òself.assertEqual(ipaddress.IPv4A %, ?@†6Network@666Àðdef testReservedIpv4(Ñ!): ã#"" nˆs' øfTrue, þÕip_interface(7S`'224.1ÿ/31').is_multicast]LFalsf›a('240.PµOr%%) Í-q192.168"17¶private%S9Pê³t'10.255c· 11®/.0M@´½³þ_72.31þ;S2° œÝ ‚Ëp'169.25sB0/24k¯link_localÔoò�‘_00.20•. µP•E?5.1•v –™ *šOí D'127�Á3/32½oopback)�vh4ˆ?/16c‰d@'128ØÚl²OÜP00.64k//1F4RÀ.0/10').is_g“lobal) õself.assertEqual(True,&õ#ipaddress.ip_network('192.0.2.128/25').is_private)Lk9b3.0/24igÔs# test ©/es‚  Ô6A('0.d¿unspecifiedÑ OP224.1QŸmulticastOoFalse,P4Ÿ/.0PÛO 1Ooreserví ž\# Vt239.255 nO-½6168^|¾P 9¡P\ÔD '10c³ 1®°=P72.31¬°3S5À².Mp 16pƒ4.100.20m€link_loc @ oop#5pQq=(ÀZ#7.˜ì¶°Fœ203.0.113HŽ:$27û3.25¡�loopbackëêW127.4+O P8,Ožû † '\1defŽRQPIpv6(û/):… cqbffff::…FàTrue, ipaddresós.ip_network(2**128 - 1).is_multicast) ùself.assertEqual(True, ipaddresN�'ff00::'LOFalsM?dffMš$%ecM¯site_localç#‚#™ 'feff:ffm nbmc5 ¸±|cprivatei6[ijf 4'fb¾VP-eP$%eaVOlink¼= OcL æ 7³d.O'fec}³òinterface('0:0::0:01¾�loopback¹Q::1/127O*§'—$H2‘1I-J¿unspecified-M#::vL2v Oè µëB2001ã80:h gHglob¹s# test Ž%es`Àqual(True, iÃpaddress.ip_ ó ('ffff::').is_multicast) ÿ self.assertEqual(True, iL¯2**128 - 1N1_'ff00šOFals›?'fdçè"E'fec4¯site_local5#‚qq 'feff:—¡m nbmc5 ¸±|T6'fcprivatei6[d jf 4'fbÃP4eP$%eaVOlink¼= OcL æ 7³d.Ñ}³’0:0::0:01V�loopback·#?'::HI L'::2‘à%":0J¿unspecifiedÞ– ß L™ó# some generic IETF reserved Å%es/¨1USÆù°network('40KR1/128P›ðdef testIpv4Mapped(ª!):Ú hs"':*¡192.168.1.NQpv4_mhÀ,  Óipaddress.ip_ ñ('192.168.1.1')) *ÿ self.assertEqual(>ÿ::c0a8:101').ipv4_mapped, NoneO OffffT�¥� Û?ðdef testAddrExclude(ì!):RI1 = U°network('10+f.0/24'à4246434 ?2.1h44}6essœ e51Íë2001:db8::0/3276754G 3Àsorted(list(¤ 1.Sess_ezU2))),}� [‡ o64/26'@ Ç –128/25')]ËÇðRaises(ValueError, Í , ¸Î3DJ?TypI4I55IÖÏœo1)), [Aä6ä)O0/30ã(4¦b" O6/31~(O8/29?(_16/28@(_32/27@(`8ãLHashxy\h% ÿ–interfaceìˆ FŒEŠDˆŒ þð),  óhash(ipaddress.ip_ ô('10.1.1.0'))) 3U# i70ÿself.assertEqual(O ¥.2.3.4')),@V@4?int½nX._ip)Âoip1 = ó o?ip2/6::'¥dummy = {}=[&Dipv4\�] = None(6( ?ip1B=ip2~¤1In(Œ!, ¥Ç"05ip2"¯ñdef testIPBasesQ!):Æanet = Dfunetwork ^2!'1ªð0/24', net.comp�&ed• W/6_W0Rai˜¢ValueErrorVñ_string_from_ip_int, 2**128 + 1) £Þ2v6N»oHelperé ’ éô2001:658:22a:cafe::/6õæwith_prefixlenù0G[ffff:/:'hhsnetmaskq:n}q?hosr"*Žstr(net)®4®4@ ® —/¢;C55.20ÝFuD 0.8255@DAW8üCopyConstructorÌ  ,z¹?4 141,3]¾interface('ê`200::16 F4Ft3.5.RIPv4Aÿ ('ñ71.1Ö@6161¤'£ ÄT01, 2›'3'4' '5,ÒÒdð5)) selfð.assertEqual(addr6, ip òess.IPv6Addressð)) def testComp)aself):'+'_Qees = {ü'1:2:3:4:5:6:7:8': j/128',6¡2001:0:0:409/:87 p7ƒ9 ©90¿<§3§`0:ffffå5Þ5:ð810:5q&m:6L…l7KÀf\%”#/0+0Ô )1'1Sxû658:022a:cafe:0000F/66'‰n:98:& ^“::1.2.3.4„o02:304оk:7 Dá::7:6:5:4:3:2:ø0z 6U 606 j ::à 60 6 6}²sfor unc,Fed, š in list((‡.items()IÀ\ ³Ij, str(¼¥Interface(ŒF�)×ðExplodeShortHandIpStr(}�Ô;1 =/s'lE:1')}323b1ü 0:5ef5:79fd:0:59d:a0e5:baI3I‚Network(IK:/96|434|È192.168.178.jõ r]n }¸x 21.ejd$qløq2'::<)Ž¥# issue 77š馻�¿0À f  2€m rýpÀ addr3.ex“ploded) ôself.assertEqual('192.168.178.1', addr4.ex:;ðdef testReversePointer(N!):"`;`1 = ip ö ess.IPv4Address('127.0.0.1'�)2363¨2001:db8::5w ÅY`27.in-TS.arpaÎ21.r·"_p¸J§U8.' + @'b.dó S2.ip6š3¿2³1ˆüIntRepresentation‹ ÙÑ16909060, int.`.ipv4_nOess)ñ42540616829182469433547762482097946625,¡ ý r6r2ÓŸForceVersÎbàip_network(1).žoion, 4Ð=_IPv6N>96) œ}WithStañ fX!ÿface.with_prefixlen, "1.2.3.4/24"¦KnetmaskpbC55.20m"?hosn1C255"?Çq_ipv6_#|= '÷658:22a:cafe:200::1/64VduMs[ffff::†õ-# this probably don't make much sense, but it's included forð# compatibility N b"íÍî:ëú'êÅMáElementCachingn'b# V4 - ÿsure we're emptyÖsNotIn('ç@1', ú ._cacheVFŸbroadcastH,L‡ ÎóÁpopulate andP!˲4Ü À ipaddress.Ió Pv4Address('1.2.3.0')) ñself.assertEqual(ò ipv4_network.broadcast_aI,>E#ip$..Iy?255{�hostmaskr 0.r°õ # V4 - check we're cached"ÿMIn('ü1', # "_EUEÆ< ‚ó# V6 - make sure¨Uempty%„§0Noteª 6̪H­?ˆ­õpopulate and test!© `Uh^6×ÿ2001:658:22a:cafe::hÃ6_interface.…�>F/6ipv Ø  q Zffff:% �¶Ž:y~ °o”)@qÂ3f]ÒÂ< ¢ E>‹!F91def–aTeredoã!):ºõ# stolen from wikipedia ™server = ÞVæ65.54.227.120'oclient8§192.0.2.455t£A = 'Ûð0000:4136:e378:8a63bf:3ÔGdd2'­ðlf.assertEqual(ÿ(server, client), Óipaddress.ip_ q(teredo"). )C1badð = '2000::4136:e378:8õ63bf:3fff:fdd2'9ÿself.assertFalse(|_yo1:0001}M¾U# i77ÉRIPv6AQ(Ð1:0:5ef5:79fd Æ9d:a0e5:ba1'TgEqual(EIPv4Sÿ94.245.121.253'Ú  –Cß5.26.244.94')B åðdef testsixtofour(Á!):jR' =‹f Ø2:ac1d:2d64::= 0=ŽjO p172.29.Q/00M Ñ.ÂÝÁ-ò if __name__ == '__main__'<@unitY.ó () """Test the interactiv ôpreter.""" import sys o Uó subprocess from textwrap Eddedentast.sup^ ðcpython_only, Supp@pCrashRe);ä.script_helperiRkill_M Tö spawn_repl(*args, stdout=³Q.PIPE8errÃSTDOUT, **kwŠa"""Run=P³¡ REPL withñgiven arguments. Àðkw is extra keyword$�s to pas�ðopen. Returns a PJqobject. ¦£ # To r—�ñout using a terminal,  "·qcommandWñ# line option '-i' andÞä n@ setÀ’''•ð# The directory ofêâv[0] must matc+ $ŽQ„áexecutable for~p() callzÅÑto succeed as)ZLðpath may be used by Py_GetPath()MBbuilå÷default module searchJèõ!_f P= os.ed.join( 0dirV(sys.ÏC), "3"ìAcmd_s7= [W`, '-E'1i']€)€.extend(Ð)bõ# Set TERM=vt100,6 raÈaÊeí�2 in1Q() ofi#‹Ð.support.scriô,pt_helper. env = kw.setdefault('env', dict(os.environ))1ñ['TERM'] = 'vt100'ö"return subprocess.Popen(cmd_line, executable=sys.,A�hstdin=X?IPE3ðout=stdout, stderr?err: ñ **kw) class TestInteractive ðpreter(unittest.$qCase): ÆÑ@cpython_only@def +ñ_no_memory(self):òö # Issue #30696: Fix the i| }÷ looping endlessly whenO2no jñ. Check also thatXñfix does not breakoLm`ò an exception is raisedIÇõuser_input = """EÐimport sys, _Icapi"91/0Áprint('After }".'�XPÇ2_noü*(0&t(it¦ ¿vdedent(L6 = †.encode()çp = spawn_replðwith SuppressCrashRe(Ø!p.üo.writeŒ2outoRkill_z&(pƒi¿.assertIn(bM", G7p# Exit Ðð 120: Py_FinalizeEx() failed to flushbpout and #er_Å ƒ"p.([P, (1,`ò)) if __name__ == "__main__"'p3() O„builtins`collec¡„datetime#…functool!K4lib"uinspecto ÇEcachLòos from os.path K… normcas'e_pickl dshutilc%sy˜Ftype textwrap(0uniCGdata“ T.mockÒwarnings try[Âôconcurrent.futuresͱThreadPoolEÀ2or ‰! IÓRErrorJ+‚ = None '÷@.supì_Drun_Ýù , TESTFN, DirsOnSysPath, T°KÿMISSING_C_DOCSTRINGS< U.scri•2PZ_ok, ÿ6ureÖ9;ï_fodder as mod' 2(2)-@ú_i_¢Cy_to` # Fèðions tested in thðis suite: # ismodule, isclass `method €function �traceback Bfram5Aode,Iabuilti+aroutin �generator6 X getmembersFÐgetdoc, getfi–¡•getsource�comments0EËAtree÷ argvalues, formatargspec £ # currentá!stñüÂðdatadescriptor # NOTE: There are some addi8ñ al tests relating to interaX‚ with # ñzipimport in the<_A_supS ¸`. mod =0.__ P__ if P.endsià(('c', 'o')): t <,Q[:-1]×)Plize ñ names: on Windows,¡wcase of$ compiled #ƒ€ules dep†AÙ�path usedQstartO÷python executable.Þ@normp(µà) def revise(¦¥0, *Þà…return (<'`),) + *S git=ÂStupidGit() ^°signatures_Bð_lexicographic_keyword_only_paSters(~1"""fðYields a whole bunch(s F S- S,Iwffthose w`always9 £ñally sorted order.IšEP= ['a0bar*Adeltpephraimpmagical @yoyo1z']WPfor i„örange(1, 2**len(hz~Rp = [:bˆ1JNjNH-€if i & (EC<< jƒ@p.ap†ŽF[j])pPn_tex "Yðfoo(*, " + ", ".join(p7‚"): passÞ_Åsymbols = {}PÇ"(fU#, # xy s['foo']"un¼j0_fn¤¡throw, out—q, baby,V_:¥ @the_;sthwaterBé/ ‰ A = '†…̃‚C_ baXR'.splc§ð IsTestBase(unitÞ.DCase…€redicatecpset([inÂFt.isxX&, $c¦&ôÿ\æ U< …EA=)@8Û…#co‹À, inspect.isÿcoroutinefunction, þinspect.isasyncgen, F1]) Hñdef istest(self, predicate, exp):&q°obj = eval(7Å.assertTrue(Aö(obj), '%s(%s)' % ’.__name__f�gÑfor other in \Q•s - set([] ='ifd7 ==”generatorU or \Æ>& þ =R<! Á^) and{õ ´o…§™ continueÀ.ŠaFalse(S‡Gnot ‹‡+_��_example$t©i¥srange(2¢‘yield i 8 T _Z, `f´ õreturn 'spam' @types.< ªEgen_N ç‚ Xòclass EqualsToAllÁ^a__eq__H,è8GG" ETTestP“@s(IsfBase):Á¿µ_excluding_sha‘global tb¶«4.ÿbuiltin, 'sys.exit')3Ÿ[].append4°code, 'mod.’0.__'__92try=­51/0Šjexcept Rtb = ¶µc_info()[2]3Cô@framŽatb.tb_ˆ8ëtraceback, 'tb3±if hasattr(l÷ , 'GetSetDescriptorType'¤j¦ugetsetd>B0 'u(Ò«).f_locals©JelseIB„R# ‰àk)<kfinallÓ…# Clear J!�all the Šsºù variables hanging to it.ä6Non"Ì êâ‡4ÿStupidGit.abuse? method, 'g3=rgu3Àistest(inspeóct.ismodule, 'mod') ñself.istest(inspe-ôdatadescriptor, 'collections.defaultdict �_factoryYbgeneraTÿ(x for x in range(2))B1fun‘5, 'V_�_exampleO•asyncgen,'_`/(1²D4genœk$5') ¤ôwith warnings.catch_5():(Å0.siöfilter("ignore" ,€coroutin> k N_b Vöõ if hasattr(types, 'MemberD«[Type'Õm: å�datetime.§delta.daysDJelse^]·assertFalseE b(`)Ù@def ˆ5_isf(`Ð@gen_4 = š 8&(1Ú1-4r.ÒÔ$OÈ(’ )‘ cVN~9_True(›°›*bšUš)5 Ã1 –?( ,š-J)“_*J”•.close();Â¥ # silenceÜóœawaitable$Ågen(): yieldî4 ©M: ª0 = ± aù–™ Õ˜€u3�Àro)) ÷ class Future: údef __await__()(Epass2ñ self.assertTrue(inspect.isBRable(fO()))7OFals8 5)) 7¶2NotS): Œ¥not_fut = "(s.Üõ = lambda: NoneeÓœN �÷oro.close(); gen_cò # silence warningsØpðtest_isroutine(‚yd1�mod.spamb ™5„[].countĉh‡ is¬ç+0, 'ƒ¦StupidGit'w½:E(lis‚^÷ CustomGetattr(object)¯2__g#!__® , 0 )-oreturnè…(…¿$y|Ñ_slot_membersƒ}F/ C¿_;ös__ = ("a", "b"7Wx = C¾�x.a = 42‚Òtu = dict‘3get/(xƒIn('a', 'sª0Not'b'zü¬isabstractöô from abc import ABCMeta, 1bmethodýÊ'AOC™ÁExample(meta=F&):8<@U¬= 5t*Ù‚revise(*/•[0][1:]),¬U Mðfile, 16, 'eggs', ['Tst = õžŸ)\n'], 0)x1x …9, 'spamw„ß(b + d, c + fu 2u ¥43, 'arguewòŒ�(a, b, cz 3z 3ðp z÷.‘| # üö named tuple field@•record = õïbù2Is().“./frÔ Xp.lineno,,Vª,Œ __/__8tunctionŽ2KIn('š3', Õÿcode_context[0]A#×PindexÖ3Òh“otr), 3n ‘-‘¤@z“À[' eggs(bó + d, c + f)\n'], 0)) õself.assertEqual(revise(*git.tr[2][1:]),18ð (modfile, 18, 'eggs', ['–q = y / 0m=ðdef test_frame(y!):6•args, var ðkw, locals = inspect.getargvalues…?.frÌL¯['x', 'y']+zONone( ™& ¸ä, {'x': 11, 'p y /4}díWformaðϪ0var‹l ¢T@'(x=„�y=14)') u�pò?ous˜=.f_backèÐ0['aŸbcdef³?'g'f'/'h% s1ñ'(a=7, b=8, c=9, d=3, e=4, f=5, *g=(), **h={}ˆð class GetSourceBase(unit'“.TestCase%Q# Sub1ñes must override.ÐðfodderModule = ¡é\setUps¤with open(þAgetsŠÜ/.W†)) as fp¶bÉ.7· = fp.read(fBrangöÓ, top, bottomÞI@lineìQ¶.split("\n"âpreturn a.join(9r[top-1:VA]) +!äiêh_, obj‘!  (O(objz Bú1) Ð ê¢Retrieving£YCode(*‘f = modä8A_getW!esÂ7a OamemberM,g!is,tÉC= +esfà[('FesteringGoßHmod.: ð ('MalodorousPervert',ï.H ÑParrotDroppin©‰ D „StupidGi„8 T2¶ª0treÐ{{ñ([cls[1] for cls in Ðes]) ÿ self.assertEqual(tree, ß[(object, ())(ô [(mod.ParrotDroppings, ?= >áFesteringGob, QÿMalodorousPervert„ Å ›/))õO ]h ›€StupidGi%æÓëPG .M/ / ]N  ; ]¦©ð = inspect.getclassñ([cls[1] for cls in –es], TrueG„RÿZ�ðdef test_getfunctions(!):!M ypmembers´,‘$is.m#Ás, [('eggs',o ` �“('lobbest<?Cspam< A)]) óP@unitÿ.skipIf(sys.flags.optimize >= 2`"DocstÀ€s are omNòd with -O2 and above"#„= 2, ñ"Docstrings are omitted with -O2 and above")Bñdef test_getdoc_inherited(self):%jò.assertEqual(inspect.9 (mod.Feste}OGob)¢Lð'A longer,\n\nindented d¿".' /{o.abuse� inothers  containingOtabsˆ(/()Šu.ØŸradiction ð The automatic gainsaying‘ 0@unTðst.skipIf(MISSING_C_DOCSTRINGS, "V¥ requires Ùsy|finddocp4 = i_†!Ð(int), int.__Õ_L4“.to_bytes=F/()H3Y.from�’S.realÔ >K_clean‹€1P'An\n“Ìõ/.'t >:6 ¢¼getcomments0¥4ÿmod), '# line 1\nÞuæ€StupidGidK)20Lñ+# If the object source file is not available, return None.ð<ðco = compile('x=1', '_non_existing_Opname.pyOexecÐ Is\²Ñ6co) ·ÿhas been defined in C°€onlist))ÖlmoduleÔò# Check actual %"r ’+• ),8äTâclass (uses __0Æ__ attribute2h.h¨Æ¿ method (nosñ, falls back to/ðname) sò0elf.assertEqual(inspect.getmodule(mod.StupidGit.abuse), mod) ö# Do it again (check the caching isn't broken7s}4Cp•a builtin—`¢str), sys.î3s["F6s"]ª"# dÿfilename overridelANone9FCAðdef test_getframeinfo À_first_line(Î!):0v(_)7 = ¶1�.fodderMËv.fr, 50×S þ=Uð.code_context[0], "# ˆ_ 1\n"C 1C 'A9ñule docstring.'PØ]sourcö²S!¶gš�, 29, 39¡2 Ö�, 21, 516ÿlobbest, 75, 76) »æ„µ¿¹ˆnormcasexú?¦Rspam)/¤M%Nðfn = "_non_existing_pï¦_used_for_œ_±A.py"ÿ’ÿco = compile("x=1", fn, "exec3 ¾``(co), 4ò€S!e.e[co.co¦b] = (140, ";:", $L6tryM¿œ coHfÐkfinallW1del8²¸By<70-©1!._/__¦4ñ_class_without_m' y$‡ CM(typeÍ5•@propertyÈ_Nk__(cls7%õraise AttributeErrorFtQ(meta ;=CMDEpass0 ÂR]Rs(TypY < ;C ³__repr·JReprM7,__9ýöException('xyz'¡Uer = _(ì,àer) def tóest_getmodule_recursion(self): ñfrom types import M2EType%õ name = '__inspect_dummy'!‚m = sys.n s[17] =L()1ð.__file__ = "" # hopefully not a real +A9...CbloaderE“õ" # pretend the:ò is understood by a >Qöexec("def x(): pass", m.__dict__¾DÓ.assertEqual( .getsource±ô(m.x.__code__), 'ç'J>del9’WZñ(compile('a=10','','single')) 8Àtýñproceed_with_fakeqF `'''doc5ó monkeypatches linecache to enable ”Vion''Bfn, ú(', 'ŽN&\n10get^6s =f?É¡?“(R½", ×_globals=NoneÑ7&iføV== fnðcreturn´R.spli�æ(keepends=True©4OelseJÑ©LäWñ# =zú:trykn+%{}!‘² , ‹F, nsy4À{2†(ns["x"]'kfinall€µõ {2_onlobjectyHS7N…mod.eggs=ò, 12, 18) class TestDecorators(Get@4Bas bfodderÍ_+d2¦”wrapped_dIŸ#2.=Œ, 14, 17}Ÿreplacing^#¼gone, 9, 10Z\ un…µLP, 1302Z3olambda_Qfunc1y13, 115°0OneD¯¯N"_o?_—#�Ý þp a one-~ ? «FtionOŒ�2.oll, 25 5AthreØ™$@›,ëq# whereÐ�second aß1ird>ðs are _not_ indented3. ñself.assertSourceEqual(mod2.tll, 28, 30) 2ðdef test_twoline_indented_lambda(O!):,añ# Test inspect.getseÀ with a two-H ?§ function,Bñwhere the second 1T_is_ ~Ïœi, 33, 34Ð0oneW€Ä²regular oneÌEÅ–z@, 37 ��manyargsš%‘ K[Uðarguments are on”c¦s and _noti @Abody7 ¡âaUlast fòŒ, 40, 41ÙBÕ!isØ"wo±, followingŽÓ0 liá'nd‘continuedBqhe nextG� by a \\èŒ, 44, 45 :@_in_ˆµG�ÌÁdefined in aì,x€a[1], 49 ¾�anonymouÜ ° ¦¸aÒܵ to anotherâ� @, 55�) classÙÓBuggyCases(Ge@CBaseðfodderModule = T G%@_com� »Kš8Œ, 58, 59[PmultiÕO_sig] 9­[0], 63, 640nesú`¶P69(). A71, 2À@one_¿"r_xïed_by_non_nameqB77, h deÍc"Qcls82ÑB83,  iµÿ_instead_of_docstrin¥<@88, 9Ÿ`methodðdynamic_class(self):  ñrself.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) # This should not skip for CPython, but might on a repackaged p"c whereOáunicodedata isRðan external module, orMQpypy.9÷@unittest.skipIf(not hasattr(Tñ, '__file__') or= =.;ÿ.endswith('.py'),G"<ÍcbinaryÔ!")E@def Èa_finds•_((®!):&¬½ò Raises(OSError, inspect.getC', ‹iC‡ Dˆ®¿7œlinecache¹±s = ["x=1"]IŽÑco = compile(%d[0], "�Áally_createdă", "exec;DÒ/co P:¬ê.a[co.co¢ðname] = (1, None, ,:s, #…6tryâ Ñ�ÜÇb(co), 26,0)M@ Ì?˜6[0]>0finr �1delÃéï25out 6f3ú in ['', '']ˆ ,q'x=1', ; ,+IO,Pž?O>ÕB_on_Y ü¹ ‹CyQWithM”›P, 1189Œo1nes#?uncgócls135.func136, _ üÓ TestNoEOL(Ge2CBase•€_setUpuñ tempdir = TESTFN + '_dir'+f�os.mkdir?.0‰>ù open(os.path.join-ˆ]'>ú_fodder3%spy' % os.extsep), 'w') as fr’f.write(" @X:\nT×pass # No EOL‰®ÙDirsOnSysPathª3Bdimport¸ž†Emod3"%»M  =>!ruper().‡ ÐarDown(self):# ñ shutil.rmtree(self.tempdir) %ádef test_class"!):B1ñassertSourceEqual&ñ .fodderModule.X, 1, 2) Ió _BrokenDataDescriptor(objecta1"""i1A b,u data d.ñ. See bug #1785.-5¸Ó__get__(*argsU¶ÿraise AttributeError("e"?__sPbRuntimN<„Oattrˆ0 ;oMethod=m/?N g A?get !VÑ # Helper for¥Aing _2ify±_n0s.  ´_wo_objs(clÒreturn [t[:3]LÏ in inspect.Q>]ÍPTestC ðesAndFunctions(unit=.!3ase…ŽÑ_newstyle_mro6!¦ñ# The same w/ new-ŠB MROë%A9Apass  !oB(A): CdD(B, C5O ex�ed = (D, $S, A, ¹(Ugot =C0getá%D) 93YW, gott]qArgSpec+…°, routine, Þr_e, var e=None,l rvarkw_e*• defaults‘formatted!•Wwith ½ÐWarns(Deprecaõ7ing3{˜¡ 5kw,w *,Cpec(à4*ÿ'w3/_e- › )4ÇX ifID€ is not –;N$;„(¯»èEù Þ¼)% hÇ •OFull™>t Í¡Ü C`kwonlyð_e=[], kwonlydefaïults_e=None, ñann_e={}, formatted>%):?•args, var €kw, defan‚, kwonly uann = \L’ðinspect.getfull9Åpec(routine),ðself.assertEqual(* , _' ª-Î_varkwV Ô /  !3^7; Qann, Ë?&ifÓ€ is not Ù�Wwith jðWarns(Deprecation7ing76 ÙJüØ?ïSa* )ÿ ¤Qted) ‚Àdef test_get²ºáø�qArgSpec÷€s(mod.eg%¨['x', 'y']Pƒ'(x, y)'kåL Ospam¿ D0['ambcde?f']A 'g,Ïh', (3, 4, 56 wÿ'(a, b, c, d=3, e=4, f=5, *g, **héøRaises(ValueError,y S½ ÿmod2.keyworded, []Xo9tannotatoÆn9Ý_WC_argä ¨>‹¬IFull]° B Ÿ_e='arg1'‚ û†@_e=[;2{?<¶†@?:1}~Å@='(*·?2=1ƒ ß„1Ät"={5 : list¾!½>»Õrºðkeyword_only_arg, [], ÿkwonlyargs_e=['arg';ñformatted='(*, arg)') w�def test_Yñpec_api_ignores_wrapped(self):0ªò!# Issue 20684: low level introspection API must O$ _P%__K°@functools.mµs(mod.spam)#¢‡ham(x, y…‰Epass(Õ# Basic check»ø.assertArgSpecEquals(ham, ['x', 'y'], %l'„FOFullJE ppartial¦) Ìö# Other variantAi=ˆ_method(ôo fJMR„< zF,, €vclass CƒO<'×@Z H% Jmham = ’h¢0��__call__Wì’ —6C()š .˜ /() /.p; Ó‘J_new»?new(}Æ‚“Oinit”(?•)@–z\tgetfullcásignature_attrÙ6(à £#A_par¥!int .P`eter(' =', ö.POSITIONAL_ONLYI©6.__œ5_ =@S²(td0s=(e…#,)ó©is-g‚ÆC } DOnnosE"a: Ë) -> 'ham': J'ecê g(¯$ÚF�.__annotaõPs__, Ž.ðdef test(): pass# �spec = in Àt.getfullargf(test),ñelf.assertEqualð.__annotations__, :.!) BP@unitQñ.skipIf(MISSING_C_DOCSTRINGS,+œñ"Signature informnò for builtins requires docstrings"¼@def y_Þ_;õ_methods(self):‚ï±FullArgSpecú±s(_pickle.Por.dump½Ç ]P_e=['a ', 'obj'],Î�matted='‹s, obj)'?<1’ï(io.BytesIO()) pXÊ‹ os.stat3kpath']ekwonly$`dir_fdAÿfollow_symlinks9Ódefaults_e={'=œ: None, 'C{: True}‚{££R, *, K=I H=FÄ�@cpython_Èx gr¹Afunc‡€import _MAcapiÃÏJ& =.‡t_with_sÂ�C}‰aÐr ’(@.VÔ[0], 'avocadoB~�6_no6‹4S{  Q÷Raises(TypeError{,£Xt`defini,ò_order_preserved_on_â ìçefn in EsFðlexicographic_keyworIëly_parameters(ÀEo&fnjó•l = list(<.«� +psorted_2 +(l!FÙ2l, I_IˆÄ#un7Àonly_paramet“ers_fn) öl = list(signature.kwonlyargs'ðself.assertEqual(l, unsorted_keyword_7Ñ_parameters) fÀdef test_getU°pec_method(V!):&�çclass A(objectGm2EpassGV¬qArgSpec³�s(A.m, [' ,']ž}Ìify_newstylel!žq‚ŸYs(): ‹¤s = staticö{;_c(cls>Ac = z=c=Cgetp®Ðp = property(*AX> Ø)m1^ Òatablob = '1'òÕö dd = _BrokenDataDescriptor(Z)m)M +q@attrO§_wo_objs(AÒÜü`In(('_Ïb__', '„ H3', f!, N,e‘”'missing JºlBinitmf P.¾s¸$A)³M Ü£cQOP #OpO]?', KGmG2E“ SplainÉr: %r' %Ík1lLV'JdùP ÿF md@ü�% d=• OtŽ Keô[B(A):Ç?ef ";" =v‘BðÒâB²fm°1ÀIn(('databloñb', 'data', A), attrs, 'missing 3) ðself.assertIn(('md@Pmetho BÏ descriptor'OdE� K œ¶class C(A):¸`def m(»u): pass3c " =¯_wo_objs(CÀsrstatic øW $QcQJC¡TplainmIpI�property•GmG�1)m1J9Ú¢?bloɯ�ÈoD(B, CË1®DÍ®ÜB>' ®DJ'®ºYQtest_³óify_builtin_types§Oñ# Simple sanity check that all <A-in =÷ can have theirE–sibutes xEied.!ôfor name in dir(_•Us__):'jr€in = getW -,G?2ãif isinstance(@,² \.snspect.§y(_js=)¬ oFbool…Æ�p__new__M T!, 9ÒøÀ 'ómissing __new__') õ*self.assertIn(('from_bytes', 'class method', int), attrs,BI'k ;p&tonh"Tplain£hp__add__ÕgLngObool7 Ïf‘def test_TÀify_DynamicCŸ Attribute(Ì!):3Ž.§ Meta(typeUP__getÏ!__=\, nam)-!if– == 'ham'eÕreturn 'spam'‡ ˆsuper().|v1¸qVA(meta =Å À@Ô/s. K|é1hamá DµFeggsµö should_find_dca = inspect.o À, 'data', VA¡.__dict__[]’ a\`ñä _žWs(VA)Iœg›?,˜H û‘/ga�f^ œ overrides_ù wÖë NoBool(object•RT__eq_”[other%ºL!) �F‚HAù aise NotImplementedError(KOb"This ´  does not ¶`ify a m§ean value"�ô_HasNBó4d =8“†dš…e!, ?.ddíZï O)šZ ò¨¡´’ Æfish = 'slapŠzsXrÌ|3['_…ë‚__moduleù __i m%']è£Pw Epass6¡œf#ˆá›– ®–ÀVirtualAttriÓbute(self): ÷class Meta(type!ûdef __dir__(cls"±return ['__Kä__', '__module3nam eBOOM']Ce`getatti¢ , 3p!ifA =='KÊK–)42i£super().__x(p/Ì CQ(meta=' ”Epass6ñ should_find = inspect.Attri|³‘, 'data',wV, 42)B×elf.assertIn(P,O‹3ifyp5!s(ª1)) IQBtest"+uVirtualŠb_multi /es1S?one4J 1" /__2S?two4J ) 3(1Ø2)•Kÿlist(sorted(set([�three'] +ãë›.‚! +�2&))�7·%!__+��t 3¨‹õ1 1x ¡<×24:1, à3@ª’1ã‚ âF1, 1UB2B­ B82, $f3B  DF3, 3†7cca;( _Sw¨for sf in ˜81, Ò  KÙÝof, cca´Œ°_with_buggy�…§*/ M•Àef __dir__(ckls): ò return ['__class__', '__name •missing']<)q C(meta +=MZEpass/ñattrs = [a[0] for a in inspect.B3ify€.6(C)oôself.assertNotIn('“!, .!) lðdef test_getmembers_descriptors(H¨x— A(object"õdd = _BrokenDataDH!()m%m)iMethod+,�Ðpred_wrapper( uð# A quick'n'dirty way to discard stand ÷õibutes of new-stylenš!# â9es.o Emptyû< À¿º;d(x· 'if5Þàdir(x) and has°(tD, x.^HL“JFalsÒ>*(x‹8§31ism™ 0 = AŒ‹*boisdataD (�‰�ÉdEqual(x±O(A, †,Ãð[('md', A.__dict__[6])]¯l ® jdj1dd'j“R;B(AÐE&‘BýXlý+ qklB?f*(=åIn(('f', B.f),FC/B)<< R‡NWb = BÔ—b—bI9”YC ‚±VirtualAttr# b¯kM(type²O_?°€__(cls,  (¡!ifª == 'eggs'Ý#•±'scrambled'¹# su().�|1ºAx@Õð s.DynamicClassAttribute  ÷def eggs(self):  Õreturn 'spam'-À.assertIn(('Bÿ', 'scrambled'), inspect.getmembers(A))Dj?Q())) B¸Vtest_^ü_with_buggy_dirÒËclass M(typeéM_4k__(clsA['__H __ïb__name ‘missing']Ÿ4)q C(meta +=MZEpass/ÿattrs = [a[0] for a inF&C)eŠ No�'‰!, Rñ ) _global_ref = object() •ð TestGetClosureVars(unit].0Cas0¨)ø¬resolutionl€# Basic ,ö of the 4 different :¦ mechanism f‚f(nonloc¶ 8!/g(|Vprint"(, N', �, unboundžEõgûH_argA]!vaÃ%{"`ref": 9}GŽ-Ž,6ref3…builtin_4á1": (̘M${"‰( ex›Eed =a¿p#, ’ Æù²d˜f¾gEqual(4c‘u0(f(BD)), ¹ƒnerator_8 “4Uq3YyieldIkÿšomethodhUCJ}î Š Ø+Ü &÷àÀnd_ref)  ”return g õ_arg = object()õnonlocal_vars = {"`ref": 9}/Hglob-_,3vbuiltina�print": (Âunbound_nameŠ](àexpected = ins Õ.ClosureVars(¿Ñ#, ’ Ʋ$, †˜9ôself.assertEqual(�Bgetc�up(C().f(FD)), ½!) �™def test_¶(\!):"£á# More complex1Ts of 5µ resolution4Z VfSW$¸4f).`s­4WËmake_adder(xS[add(y;oUx + y§:addhûcurry(func, arg1TP`lambda!02: -(,22fešïless_than(a, bOVa < bˆð# The infamous Y……binator.Å\KY(leR,g(v�»#e(¾¦x: f(f)(x)a)—Y.g_ref =ÊA;g(gã³check_y_com§A š` ¼ *Ãunc), {'f': „}jginc = 1·zadd_two 2 qgreaterˆ‚_five = êŸ7, 5m­ i¬fx': 1}i8 ©è<2< Å%),   {'’p': 5, '¢5': ìu-71y: OO)(3)‚ á3l.Y(*t·” Él_empty›-µfoo(): pass.£D{}, Gset(õ µž’: True), oüG7foo>¾ÒÿLrrorÿ{class TýÅÀRaises(TypeEA,´ ^', C@Àsurevars, liSst) ñ*self.assertRaises(TypeError, inspect.getclosurevars, {}) Bðdef _private_globals(S!): e code = """.õf(): print(path)"""*uns = {}Pexec(?F, ns³àreturn ns["f"]�ütest_builtins_fallback“f50 = ª.Àj–ns.pop("_S†_", None% ex$Eed =0C-pVars({}0A, {"ö!":"&"}J�ŒoEqual(€T(f), v‰ üas_dictû'[÷]œ³(:1¤þbath":1ùúIomoduleü:'os˜ô0os.êú:ð class TestGetcallargsFunctions(unit."fCase):%crCallArgµ€, func, Oñ_params_string, locs=ùÚ1 = g 0or ïF=Û°r1 = eval('(%s)' %jep?2?÷(S/, T À–¶f €gr1, r2c:PExcepmf;:56tryr¶F uEe² ¹[ as e\x¨*;els"$ffail('IPnot r>&d'N¹À Ε ¾ßHJß) ãIs(type(ex1), &2) ,Ù3str. -pdel ex1ã2´@make­#abØ , signaturÜ f�Create aÍ¡ð that returns itsã locals()""" öcode = "lambda %s:'%Áreturn eval(1Ñ% signature) 'ñdef test_plain(self):i@f = õ.makeCallable('a, b=1')($°assertEqual+¯Args(f, '2)?, 3,/a=W_b=3, 02Þ‰à# expand *iterÏ / **mapping_*(2,)ÝO*[2],_(2, 3[?, 3^�*{"a":2}�m*602, 4Ob":3j1-, ¢±°UserList / ODict¯Àcollections.;FO([2]iB~E*FÃO(a=2C[F/b=7/b=HaHYO@varaQO, *chþUo, 3, 4/Ô?3,4‹O[3,4~¼Œ4Œ v/kwÅyuEO, c=O;ai50c=4æ?, "C2 @9v�3, "c":4¹�úðc=4)') ò6self.assertEqualCallArgs(f, '2, c=4, **collections.UserDict(b=3)') K ?b=2H1a=3iM Lðdef test_varkw_only(^!):#Æ# issue11256@f = )P.make˯able('**c'¨(?a=1+_, b=20cÿ**{"a": 1, "b": 2}?­1a=1†eA+ý‡úM“²keyword´žÿ*, c, d&Ê?a=30a¬?c=404¾.PExcep=V)± SÝ ,dÙ¶•�N‡‚Š d„cÀ·mümultiple_features&Ýa @, *f”g‘DO3, 7/?x=81ÿ, *[(4,[5,6]), 7]B0x=8?93, B_, y=9GD82, G]D >aList('Æ÷,'[})«ï{"y":9, "z":1022, Ó�O[3, “P”fH�y=9, z=10‹ «x�9 ´ …Àself.assertEó qualCallArgs(f, '2, 3, x=8, *[(4,[5,6]), 7]') Ïself.assertEB?93, B¿, y=9, z=10MJ–M]J&õcollections.UserList('Ùà,'[ƒÿ ), q=0, **{"y":9, "z":10}Û2g”O[3, ˜‘ Q?DicåŸA)') ðdef test_errors(ú!):%Pf0 = P.makeIgable('/f1#Ha, b'2''=1)õ# f0 takes no arguments“ŽœPExcepñh(f0, 'K+ xx- *1,/C# f1§Ÿexactly 2®81, H€*Ø+7a=2PX 7b=3-C# f2Ö¥at least 1ׄ2Ö* ~öfor f in f1, f2‡‹q/žt�/at most|6þ 4421, +a?96k4, c=5rð# XXX: success of this one depend µ dict order‰v"##¢æ_, a=1~þ f got an unexpected keywordýtW c�02–‡336¼i:4, wn°**{u"\u03c0hb9": 4 C"# Gðmultiple values ÖM(1¸Ñl€ À'1, **{"a":2W}') ûself.assertEqualException(f, '1, 2, b=36ù # XXX: Python inconsistency^À# - for funcUÿs and bound methods: unexpected keyword 'c'H+un<ñmultiple valuesmEaEì‡c=3, a=2îÕ# issue11256:”Qf3 = O÷makeCallable('**c<!\3].�1�¢/f4Œ0, a,0d. ’5Ð #20816: getc$ñrgs() fails to iterate over non-exEtIÒkwonlydefault?õ raises a wrong TypeError6õdef f5(*, a): passBwith¹˜RLeRegex(I,/) ö'missing 1 requirÀ-´&')0=0insæ. Uf5) n757<Î 6(Ì;, cUÝ ¡ "'a', 'b'�K'c'"Uª(6)©•bpo-33197½Z V�¤[…variadicúparameters cannotÛ`s' have ?%™PdÔ("foo", kind= Ï.VAR_KEYWORDÏ y6=42v)9"÷° 5 is not aã6id ­Äà&T("barñ$5,0·á;ó'name must be a str,¿?intŸ3123�ö4) class TestGgM](Fˆ"):Î]`setUp(­V§Foo(objecti x;¥.cls = Foo1Binst(As 6(·, signaturej¤ '"'"&in)i mkLuperðÀs, self).mak³eCallable ðself.cls.method = mk('õ, ' + signature)3preturn $S.inst;ð class TestGetcj±rgsUnboundM_+s(1): _udef mak§(e,…:'¼\superO m,¤*).RÑ  ’°assertEqual@CArgs™`func, ëö _params_string, locs=None)³9ºz*!f._getA¥P‹(� /))áŸExceptionâ_{ã@#>/, ) Æ” 'û�' not inÄ � = dict( por {}, @=�E _¿g,Šf+) zðattrStatic(unittest.w0CasŽ™ia_basicì©É·hing(objectwBx = (Gt1@ = T(Òå7EÀ(inspect.get­"_s®@r, 'x'),E/.xF)!, �LAwith.—ûRaises(AttributeErrorôµ 'y' ò`y', 3)•ŸŸinherited£+žÙROther¥ éBpass‡3 soging = 9˜I â ’Pance_÷"2Q½ë�__init__O;, xò'³Øx>�Ð3óAï@Adel .m€Ž%2tä0�propertyéæÀ class T÷hing(object): ™@property«def x(self/:õ$raise AttributeError("I'm pretending not to exist")]tŠ@ = T(kñ.assertEqual(inspect.getattr_static(@r, 'x'),EA.x) _´ñtest_descriptor_«+s_¬mØfclass 6)_§__get__(*_?l$}( =„Ÿ1Ãx:Š%e5› b“U (�K±Ê(Z¶–  ƒVirtual¨'ð@types.DynamicC'Mm»/aeturn ß)_x8_ >Ó__dict__['x']]ž¡inherited_ XÂÁ+Ta Other£( )Bpass¯3öUø _slotsÏšy = 'bar'�_NQ__ = O UP__iniÈ éßãF'foo]Ÿ:eqŒG†@, 'yJþ/EAdel !.±Y£ Ameta0¬(} U²¬ OH o , A= F„æÖh0, 'ƒ2„2n_ sub(r *Ó$µ;sub´F3�µÀic(OtherThinóg, 'attr'), 'foo') ±class OtherfThing( %):+2Epassð# this test is odd, but it was added asPexposE bugAð self.assertEqual(inspect.get±r_static�”@, 'xÌ3È1def…€_no_dict`slots(aÂp1(s, None)·/Noº oq, 'lowe€Q·ü_instance_memberÇõ# returns descriptor�ðwith open(__file__)„jhandleÍ<p, 'nameyRtype( ). ‰¯inherited_ˆÁ ’ˆgobject„_U¥__ = ['x']üVŒ__init__9 ù2x =Ž{i(†  íòould be nice if•worked...ŸÇ# we get the» ïPead o:eþ UibuteB¹1½(ô.,.x«C . Žp$geo,À{, owner?h¿% 3ØkOFoo(d' =0(ÃJ`foo = 9÷# for a non data<‚~…zkRfoo._O¥_['d'] = 1±‰pfoo, 'd51¢& 1s a¯-s¯!sh_¶…#Ù=@.__s—ñ = lambda s, i, v:×2Ì F") FQ_metaÖ_‘_–fnš( ™de`Ç ?Ÿ , E= J "^`,U ~ a~Ê_as_propertyYÀ class Base·(object): …foo = 3 ûclass Something(Base4õexecuted = False<X™@propertyadef __\{__(selfT;.]:Tru\%rreturn Í·§instance =¼)„[ðassertEqual(inspect.getattr_staticG¿, 'foo'), 3Eø.µ,q i r¸4Ätest_mro_as_Y ?Vœ Meta(typ­� YŽi7&,)lq ÌTa, metaK=¼ DFpassr¿N)()P9H F –Odict— »0 = s9€W.call= P Foo([ a¦DÙ Ah †f &{}„ÖŸæ@foo.š4Åï.ifoo, 'ab «�rcustom_ _ò =‚ CY…|1gethü, key, default=Nonz©ƒñkpsuper()Š(SðFî ¨_$S__ = âȶWõŽ×B þì fÀkTû¬¡B )²*o__init‰ –spam = 42@ˈ¨CÀ, "spam"), 4C2) ñself.assertFalse(Thing.executed) *ðdef test_module(6!):Hÿsentinel = object(aôIsNot(inspect.getattr_static(sys, "version", T%),gk $ ¦úetaclass_with_müdict_as_propertyÎ:P MetaW(typeì�@; ›%!__^_T69]y = TrueE%preturn Jƒ(spam=42ˆŸ›%, ß=° ¯Í1 = ä.Ló(G CFpass7V Ë:ûRaises(AttributeErrorB÷|0, "è"6³—ð TestGetGeneratorState(unit¯.0CasÀf£\setUp „number_gL(ÂBfor $» in range(5$USyield*v.[# = n`Š o RY0.<YŒ_created¢ÐQEqual .‹4), x¼GEN_CREATEDc~suspendeBnextYŸ ‚"~SUSPEND„ñclosed_after_exhaustion~¶ÖiÑ~–Ýšÿ ))?LOS¤ ÿimmediate_excep­yoRuntimw­Öy.throw(0 £Ø3|runningl`# As m-ðoned on issue #10220, checking •Áthe RUNNING ×U only®p# makes( se”@ide 4í1 itþ3 The followf*ysw€is by us#QIWure'sIÁreference to K andµ[K`helper®5hodK–._+q€%õ ÈÀ_generatorstûate(), inspect.GEN_RUNNING) Íyield numberñself.assertEqual(Ï_generatorstk54ö = running_checkN(ž2# R$ñ up to the first °©Bnext•`E_afterEcñdef test_easy_debuggingr!):#Oð# repr() and st Uof a ” )ñ should contain�EnameN Ps = '¸€CREATED Ä sSUSPEND×CLOSED'.splitG@for O1 ins´¸}£= getattr(1,,H+ 0In(T,õD)-,ë\5get)llocals`+÷each(lst, a=None ªb=(1, 2, 3‹vÿ:lstý6žif v == 3ac = 12®ƒ5 v >´¦[Š]‹Ik.ýN%),`y`{'a': •, 'lst': u}vONŒX�, 'v': 1Ëe 'b': ½¾€2¾ª3¾@, 'c®2…:tryTÐexcept StopIt:ion8Opassƒ+B {})t—>o_emptyA¶[_one(;% 1�Rone =h/:£,³¶K(aG(Àqual(inspectþ.getgeneratorlocals(one), {}) def test_+Ñ_error(self):-1ð.assertRaises(TypeE+Ÿ, inspectxO, 1)D/ïlambda x: TrueQ0?setF0ð(2,3)) class TestGetCoroutineState(unitj.fCase):ƒ\setUpk„@types.cH@µunumber_(¤¨Bfor $» in range(5$(Syield*aQasync`Sawait8†D)?5 = (|larDownü >h.close8ss^0Þhreturn�~0Z ‘¯st_created•üQEqual .‹)ÌCORO_CREATEDdsuspendf¯p.send(N· [ˆ~SUSPENDŠ]ýd_after_exhaustio“QwhileyB:try�`Å&Ðexcept StopIt§>ionLRbreak,5[þOCLOSû ¢immediate_˜Gith �bRuntim†®Îithrow(0×,Ùáeasy_debugging©™ð# repr() and st Fof a£ &ó should contain theEname¸ Xs = 'ï rRUNNING �¹†'.split(‡º0ame¸[ š£= getattr(t , ,F|*0In( ,ùD)-,ïzÅ/ÕZd¾ 0gen? µ�ê& í0†Ü£qfunc(a=#à: Çb = 'spam' åawait gencoro • = func()ð self.assertEqual(inspect.get2Àutinelocals(%),;s Ó{'a': None, '€$':Š}uI`.send(-�Wc, 'b':>õ}) class MySignature !):üó# Top-level to make it picklable;&äused in test_sW�_object_/e+Fpass�•Parameter��KƒETestôO®P(unitÈ.CCase‹Ñ@staticmethodÍEdef í(nc, **kw1*dsig = i-K,ðreturn (tuple((p_.nameˆ‚(... if +£default is£empty else"Ù Q@annoô+onT³·Œ]�3strÖkind).lower()F| 2for÷™Asig.&n¯s.values(){2’_«Zú; T"))¹Nx @(,TSR½�PNb.L dS S '()'Œ*�ð(po, pk, pod=42 òd=100, *args, ko÷§Dï  õÓ@po =V¯ð['po'].replace( ø=P.POSITIONAL_ONLYBdCdDkC5k']h/pkf'kd$H&kò(ko"w3Jk&']à%S(°4ž'iŒWwith ÐRaisesRegex(VÒError, 'wrongH;{ order'çu!/, u8Àparameter or‡der'): ðS((po, args, pk, ko, kw5)) +ÿ,with self.assertRaisesRegex(ValueError, 'wrong parameter orua , {uXo}æòê32 =ð.replace(name=';/')—duplicateR�kŒ2§‘ðfollows defaultê_umentyd“gCjkkkNkgÅðTrue(repr(sig).startsòæ(' {42:'ham'}: pass†ó foo_partial = functools.0(foã#=1šÿåsig = inspect.£+K.qfor verçRange(Ã÷.HIGHEST_PROTOCOL + 1ÓiP:ssubTest<û _ver=ver, subclass=False?C3sig4Cd = {SloadsL`.dumpsÆ,§²?l»REqual,Yí # §° that basic¢-£†ing work{H8!myd = MyPQ”z', kind=Œ!ý.POSITIONAL_ONLYPðs = collections.Ol`edDictàÿ†Ss, a=…F½%Myí%()ï²Ãs:0s.vêEs(),z\Ðreturn_annota¤]=sig.“§�÷isinstance(mysig, ­ç8  P['z']Hh…éSÜè( 7ver† êÀ(mysig, sig_«pickled) óself.assertTrue(isinstance(sig_8ï, MySignature)F%ý.parameters['z'],Ž �4MyP>1)) :¤def test_s›à_immutability(Ü!):+J/'(aEpass&åsig = inspect.Z(ix4Pwith a=ûRaises(AttributeErrorhòsig.foo = 'bar'ÅM?TypHK¢a'] = NoneSé�on_noarg « $QEqualE ¯, ((), ...Ÿ�on_wargsBs²ö(a, b:'foo') -> 123À*˜ Ú@ a((('a'´ÿ "positional_or_keyword")ª 4('bEº/, GH ?123: _kwonl× *, a:floatE1strC?intCU|"7_®<[str, <1 O int2 �complex_s`=10, *-:¡`, spam ñz', ham=123, **kÅ:€\U?...XŸÛž F èÀv, "var_3ìOCV ñ„ Pham',°k·�3intÂE/")o Ú @out_Þˆ(f©): # NOQA¤ä=ÃD� NÀ pass  “class A: @imethod—def test_!ù(*args): # NOQA1OYpass @statica "b òf1 = functools.partialq,((ÃY), 1)¢/f2@ö__only>3>àA4A!kw†&1)fñself.assertEqual(’signature< ýµ@(((')c', ...ñ'var_positional'),))Fq‚ ʼn.AB ('lÌŸkeyword')ÈoA.f1),v@EOA.f2xd3xd4x0© �@cpythonZP@unit_ÿ .skipIf(MISSING_C_DOCSTRINGS.$"SŸò information for builtins requires docstrings"t›åD_on_9)æ€import _«Fcapi:Hƒunbound_5o>á"""Use this to 3 3Ps (th¢ð that should have a A)"""6P»µ = inspect."(oé)BãõTrue(isinstance(4,G\£ F)FlistA:ð ameters.values())[0].name, '…'˜ureturn „[Ÿcallable(U†S@or n$l E g€don't ex= fÀ signaðture = inspect.signaW(o) õ self.assertTrue(isinstance(4,GSG)F5if .É.parameters:kvoÖNotEqual(listm?ð.values())[0].name, 'B'~freturn‚ w•ð = test_callable(_õcapi.docstring_with_3†defaultsr`def p(Ž<): {¾[##].A“qÿ÷p('s'), 'avocadoÝì�,b,b'bytes+ d+F3.14½Ri'5% n%ONone' t'I' f'OFalsO Plocal,3P !syC¯sys.maxsizXÆNotIn('exp',/´); /gobjectõ# normal methodßa# (PyMÒDescr_Type, "' _dfiptor"Òk‚unbound_)¡(_pickle.Pfr.dump2Kd = "Q(io.SÈ7IO(Ÿ]÷dI°lstaticÈ 7Çstr.maketran  %X'abc''e_classd Ïdict.fromkeyd'{}#` wrapper arEP slot‰W Š+‹atype._ &__„ý ¶�int.__add)‚6(3)#Â_7´9 Òsupport for '%-Ë''”k7min¸%÷ # This doesn't work now.!`(We doÆhave a valid3†"w" in 3.cF hÐRaisesRegex(VÑ©Error, "noQZund")26®ŠWorksNow R™â5ypeÅ H"+Á# Regression'ßÅissue #20786+R õ¹�__delitemú .‘property.20ete1`‹ 5‹ìð_testcapi.docstrò"ing_with_signature_but_no_doc) @cpython_onlyñunittest.skipIf(MISSING_C_DOCSTRINGS,+A $"Sjñ information for builtins requires docstrings")O@def y°Ôon_decorated_Cq(self):4€import _<Ecapiffunc =.s '‚defaultsZ’€0or(Ow!@²tools.wraps$�#Dðper(*args, **kw †) -> intË1preturn ^ 5 ^)aº6D; = Ç*Mõ.assertEqual(inspect.6Õó®2n0ed_)m,]_likeßU passì¦ t¯‡ rfollow_F�d=False)Bñ;rÓï\ý¦ âØšuònå» -ÅÿRaisesRegex(ValueErrorÍ E'no ‚h found½'�6„k&noï ¸z3str›£1nonÊÏ É 3Typ€ÿ 'is not a callable objectV/42�Efrom›Q_V ¦ØŒc(a,b, ‰ kw÷r=True, 7req¡ š’“Qclass£w *µ# Has to beïõ, and have correctKMñ# __code__, __annot>s�0nam) A`F__kw,§ attributeÖn�__init__+,Ê á*["__r! ='. �.É.. í5 <ìð= func.__default[s__ û self.__kwdefaults__ = func:)0 "Ðdef __call__(eÐ, *args, **kw )):1˜preturn /.Z(3d@sig_#ñ = inspect.Signature.from|Pable('):Olike>+G)´¥ÄassertEqual(’-$, ys·b> )k)ñ# If object is not a duck type ofâ¥tion, thenÖ#¹Fð will try to geB«¤ for its 'ä'Cemethod#fl"Ü–del fl.__b¬„U(fl),-? @((('gc', ...�"var_posiû?al"A B ('ªCŸkeyword")A G...)ð# Test with cython-– builtinsÇ_orig_isdesc¤"is[eriptorp1K(obj] if hasattrC, '_t[mock'-GŠETruec RåÞ�unittest.`„.patch('¨Æ3', í ‹¦êÊ2! ™ð# Make sure that our ~` setupyworking7doFalse(¥(�ž.\= = Dts$F€º!–)“2¤_1gda_class»•à# We only wantVž>Õ~s¢#‡V6es.�ˆ;E(a,b% kwe= ", ?req=FpassRdâÉVªne__init˜gmarkerå( Vh__name# TY__cod% %`annota1 t  3%R9ªÓÀults__ = funóc.__kwdefaults__ ñ0self.assertEqual(str(inspect.signature(funclike)), '(marker)') H•def test_0°_on_method(a!):(s¦class TestDç__init__(*args5!EpassJ6!m1da, arg1«2=1) -> ine3D2t`__callª?, a©ª du-(u().m1),4« @((('âc', ...ÿ"positional_or_keyword"H ! H_2', 1F G Cint)¨ä2U äsäFvar_è?"),C ˜P “@Wwith 0òRaisesRegex(ValueError, 'invalid J 1'rLOœ" œßwrapped_bound§Õ# Issue 24298•½ ‡)@_`tools.�sÃ|É2m1d¨o, **kw& Þ Ü x?m1dû1ŽŠrh  Ö1on_Ÿ-'w@4kÐbqfoo(clsTA1, * ] »/xAP! =oe().foo“?eth”e>_only")† eðîwÀ ÿ ('arg2', 1, ..., "keyword_only")), a...)) !ñdef test_signature_on_staticmethod(self):.R¦class Test@5.d÷foo(cls, *, argP"Bpass”|! =ge().fooR�Á.assertEqual .¿(:þ ƒ((('cls'8=ãpositional_or_K"G  ƒ G9„ ðîÌrSpartiÍófrom functools import -.õParameter = inspect.'{(b} {a ~(Åq)), (()LSRWwith IðRaisesRegex(ValueError, "has incorrect{uments"¢Õç†?, 1}i)a=fAa, bñKc, dÑs* k Ýa”Û#bE1cE ¡ O ('d< ™ Þ†0 I™_æ_, c=2Y :2UÙÀonly"),  “('d', ...ÿ"keyword_only")), 8e...)) !ñself.assertEqual(ÿsignature(partial(test, b=1, c=2c Z((('a ãpositional_or_®"¨ � ('b', 1ãâ � ('c', 2:"Yd0\Ø?a=1k&#IEb<%d6@def ™ð(a, *args, b, **kw %):æùOpassø%†:rgsôFvar_øíQ%ðij *¢‡h1~3»5ä ,½W=True+À  ã((('args', ...ñ"var_positional"), -:('b>Ïkeyword_only</kwE/")} e...)) žñself.assertEqual(ðsignature(partial(test, 1, 2, 3, =1, b=0o -60iæ+Ž @C_or_é LAŒ_¡†�gù1def¾õ(a, b, c:int) -> 42:·Gpass(Aig =95.__Õ__ = inspect.-d l)Ùº„ô@coint, "ET /42S! ï?, 2ò­,®!psÚÅŸóA, 1)§Pjfoo(a)?…return aTt_foo = O foo, a=10)520)1Š›Qé |O', 2Ý= Üð)) # cheó)ck that we don't have any side-effects in signature(), õ# and the partial object is still functioning6õself.assertEqual(_foo(), 20) &@def •a, b, c):}sreturn J$ =Ž(–à(foo, 1, b=20)3j �ñUõ ÿ((('b', 30, ..., "keyword_only"; c ('c'7<= U...))ü¶ W0c=1ó"(1 ?10)do, *, dj 5, dqmtd=20, cp`10, d=v: ®ua:@posilcal_or_„ºŸ~ê·ºç; d0%Ûba = inspect.Z°.bind(a=200/11H °*ba.args, * kw A), (B 11¾c_=|3_ \Á¥c=13) # (aP*S'13Óõî(éH, 13èt7/12d&?w#/b=y`u+L, 12í m¹f:�‰(˜0ìt ¬0, d'$ ¹Epass8?sig£6foo,€params =ƒ. ¼eters.copy('R['a']•1amsð .replace(kind=Parameter.POSIãTIONAL_ONLY) çparams['b'] = ð.replace(kind=P'Ÿeter.POSIJôfoo.__signature__ = inspect.S(b–.values()‰7sig1GG(foo%õ(elf.assertEqual(str(sig), '(a, b, /, c, d, **kwargs)') ïsAnppartialve, 1)),:0³((('b', ...ÿ'positional_only'? _ ('c?Ÿr_keywordEdE1+ J'va…Ë O...)d&?, 2g(ô?, 3+¯O, c=è3x+u "<'i�0U§‡def test„3on_Òpmethod(%):Õðfrom functools import3<¦class SpamAx(YEpassn2hamhb(µ@Pwith ©êÐRaisesRegex(V8÷Error, "has incorrect arguments"ˆÀ inspect.ósignature(Spam.ham) `class :údef test(it, a, *, c) -> 'spam'-1IpassBðham = partialmethod(RW, c=1‚ñself.assertEqual(µ,_tÃ((('it', ...ÿ 'positional_or_keyword')F_ ('aE1Tc', 1ˆz_only')€ \)!()ÔÙÙ|xÏ: 'anno', x)r gqog§ Nž*¤rM ²ñt_ýš_on_fake_G~8‰foo(a): ‡Jfoo.;# =Á8L µtr(inspect.‰Ó(foo)), '(a)' wÑ ¯‘decoratedȦöimport functools„I70or(!7ä@5b.wraps$Ã#Dðper(*args, **kw ·>intBareturn“ 5 ^)aºÆ:Foo\@Î F¤1barUbèÉÁ7ž.—Foo.barb ¯#""H E$b9Š ‹ 4...54&/()( %à™Þð, follow_wrapped=False)?, ã((('args', ...ÿ"var_positional")Ao ('kwCŸkeyword")A ð...)) # functools.wraps will copy __annota�?s__Îæ€# from "R`" to "Rïper", hence noEgreturn| 5ó# Test that we handle method mµs correctly8àdef decorator( %):¾@$ #Dc (*yB, **ƒŠ) -> intTXÌd\(42, 9 bÿsig = inspect.signatureŒñnew_params = tuple(sig.ùeters.values())[1:]fÄ5.__bP__ = A†replace(I=k)GÚN£šclass Foo @ FUû__call__(self, a, bžJFpassf+Á.assertEqual<3DFoo.X ˆ …�E_or_LŒ bE‹ /))ã/()å ,¡�ˆ Rôpartway down the e stackEQd_foo (ü -4.__ÇúMB‚ 4€NJGtestØ1on_�U* C£@f__initŒ4|�q‰ CJ4G :ÞkM(typeÂåqkcls, a"Öä OQ(meta ;=CM4Vðinit__(self, b):+ Upass ñself.assertEqual(Õsignature(C),, IÓ ((('a', ...ÿ "positional_or_keyword"),G @&))”ùclass CM(type):€ûdef __new__(mcls, name, bases, dct, *, foo=1;¿ÿreturn super().J )z’Q(meta ;=CM^™ainit__E;, b#�~<b~? MÌ ’˜a !('ÔI1?dctG1tfoo', 1ëÝ_only") áâx}Ãrcall__(\@m, bWtËL¥&(n)Ô)Ç(, <=Ö_bar=2ŠÖ–MCÿ0¦0m1/bsF1d dÀ self.assÿertEqual(self.signature(C), ³((('b', ...ÿ "positional_or_keyword"),G @5)) hõclass CM(type):‡ðdef __init__(cls, name, bases, dct, *;r=2;?õreturn super().J E)u�Q(meta ;=CMY ”@;, b#|Fpasså(O.assyM3 z´}͇ !(';I1?dctG1tbar', 2RD_only") Hÿ@unittest.skipIf(MISSING_C_DOCSTRINGSÛ$"Sÿ€ informaÒò for builtins requires docstrings"5y_EA_on_;�_withoutÀj'q# Test )3es +ä user-defined °µ or __new__Ü9A C: hæg©tr(inspectçr), '()'Ä>POD(C)S#%D)S¤äL-`é( ïU µO ðRaisesRegex(ValueError, "callable.*is not,wported"­!N;Wf, NoneVˆc$D)ˆ‹}V%  gs‘_pickle.Pr) ð'(file, protocol=¤€, fix_imí`s=True0îZ,P(h '¯EmptyTrait6P2("?, Pb$På,À=True)')  ðself.assertEqual(str(inspect.signature(P2)), 1õ'(file, protocol=None, fix_imports=True)') E€class P3\:_Ðdef __init__(¡z, spam)&*Epass;*Ëq3)), '(S‘«MetaP(typep–ûcall__(cls, foo, bar) ™ê¡4(P2, meta=j <Ñ"4Ñ�Õ²Utest_È@_on_ÂÁable_objectsb‡�J FoooM_=•a6õÁ“o�_(Foo(Y ³((('a', ...ÿ "positional_or_keyword"),  @)|JSpamå¾ÇWwith UôRaisesRegex(TypeError, "is not a Z Z"V�(˜@Bar(,† E¢`J`gWrappedc"B.__w,ð__ = lambda a: GíM O;%"# ¾fr loopï‘ Þ×g DValuh'e'§Xdò»f ÿJ  ³(8� a=10: a^/10½5Ëe· float: I¾õ_Falseµfoo) == 42)»7ß6!6"1== ’`sToAll'ªw® !BÐ def óbar(a, *, b:int) -> float: pass þself.assertTrue(inspect.signature(foo) == _bar))JOFalsK!KeEqual(e¶Ohash¨?), ¬%) IOdef $/in"Ø #m "?Not%Y@ð?=42j*ëc#ÿ ±GÔô³Qspam(!?, aH)I×´KµHaÛÀ def fóoo(*, a, b, c): pass pdef bar"c"a"þself.assertTrue(inspect.signature(foo) == Ubar))lJOFalsK!KeEqual(eØOhash¨?), ¬%) If<!=1>/=1@ýPpos, �E )ˆJÿ � Hˆ Ó Ò?NotÕM$¢args, a=42R`, **kwL:intÉ+<¬B< û( r½ spA0Utest_*_{Pable(%):l&S óSXPžParameter© º0foo|>Š(´Ccmanual-4S(pe÷s=[P('a', P.POSITIONAL_OR_KEYWORD)]2Õ*PïjYyký = à +Yð.replace(returnó _annotation='spam'))) õdef bar(a) -> 1: passñself.assertNotEqual(hash(foo_sig), ýinspect.signature(barh›foo(a={})fWwith kð RaisesRegex(TypeError, 'unmÅable type'):©Î(Š 42: Upass ð sig = inspect.signature(@)&÷sig.replace(return_annotation=None2Òelf.assertIs(: 2+, 3‹+e_emptyj8o/42h_EqualÕ4 ,n)–1def¾_�ö _on_mangled_parameters(self)ܦclass Spam÷P1foo/Ñ, __p1:1=2, * W2:2=3F2& [@Ham(_ .**ø&ËAe.foo),3b @((('Ýc', ...P"posiiïal_or_keyword"H P ('_²õŸ', 2, 1, I,Q2', 3L"„_only")Š C...)àëÞ&&DY1HamXföÄFñ from_callable_python_objÕî5MyS 1): ÷ÌndaWÔ class TestPVðObject(unittest.aCase):n@def ¦_signatureSp_kinds(�.ŸÅP = inspect.fL-ºú True(P.POSITIONAL_ONLY < ÕR_KEYWORD < \HLfP.VAR_LG9X$%) L”N>str™F), '`T'’Ø + in repY‹k o§«lplõ('foo', default=10,ë3 È=´ ší1�p.name, z( •O, 10(ÿ Is(p.annotation, p.empty-}À,uÁPwith MŒð RaisesRegex(ValueError, "v µ '123' is "B> Õ"not a valid .§"¾9 v¾ 9=„+:Ã'� ±'�21', ©qM— 4TypY'€ï must be a strŽONone�8é×O'is M*$M9¾^/.a¿D1 'còT have·>?ues'—W?=42ì$Í €Á>À  ôkind=inspect.Parameter.VAR_POSITIONAL) 7Mp = /õ('a', default=42,/7 uqÅ_OR_KEYWORD)Lô%with self.assertRaisesRegex(ValueError, 'cannot have• v!Es'):O“¯p.replace(“ˆðTrue(repr(p).starts«5(' "ÉOñ "is not a valid Parameterø"m Wtï(q__ONLYv >ôdef test_signature_p¤ð_positional_only([³o 3Typn pÜmust be a strf^(X .+ëŒ�@cpython¬Ý �implicitÖE'e´ arguments püad as '­?'޶ or keywordY,H�L-Ú�O'.0'�½L= = Ä(ô^UÀ`,x<§Ý��Hñ%, É#0'ˆ\ �mutabilit6p_'spamb Ú<‚$(AÎð²èÖp.foo = 'bar'ßK#z’ = 123 +TTestSM�Bind(unitd.CCase’Ñ@staticmethodÔUðcall(func, *args, **kw 7Åðsig = inspect.signaÃture(func) ð ba = sig.bind(*args, **kw 'preturn <P(*ba.(4ba.+Sàdef test_signap_YÑ_empty(self):)-(m542 +:Á.assertEqualK`.call(oV), 42®Wwith 3û'RaisesRegex(TypeError, 'too many positional arguments'–Pr?, 1p]Ÿ, spam=10y<Söõ "got an unexpected keywordü 'jF'"):‚F &2=1)%Î û1var®O+ polgkŒ †((), {})/4 Ôo, ((1,9B, 2)< w‘foo='bar'C}q'foo': Â*, NÍP&}sÜ™_': 10—2š žÐ€D µ4< gPjust_�mwa, b, cˆte`�, 1, 2, 3³  WƒSƒ?, 4zL© ö"missing a require$�"Aa $i/W ˜ a˜ -N(ë… ‹ê>Z?10)´Ï=1, b=2, c=3×À b, c ñ self.assertEqual(ð call(test, a=10, c=13), ( “2, 13)) 2C =<Ab=10< , |<y@def ¡ñ_signature_bind_varargs_orderÍ!):1­5 (*$preturn  2Ü š b1, 2, J )m› Ð�&_aÙÓ@a, b¨?3, Þ &,ç#, ¹`, 4, 5ö( C)?0b=1–2C‹o, 3, (CQ1, b=AÇA÷HwithõRaisesRegex(TypeError,/?ð"multiple values for«ument 'c'"‰t‚¤?c=4. pjust_kw5)"**! vÿ”Ó�Ý_), {} ÿfoo='bar', spam='ham')Jƒ{'foo': 5'68} <Õ; )", Q&@±Ì/{}ô7=(8?3, G Á0b=2~?1, Žqa “ŽqWsŒ;c=4‘Àam='ham'),  ð(1, 2, 4, {'foo': 'bar', 'spam„ham'})) Añself.assertEqual(µcall(test, RAfoo=N%),>F�rßc=5, a=4, b=3m  4, 3, 5, {a–@def ¹ñ_signature_bind_kwonlyÞ!):*´.w(*, foo`return1Qwith #4ÿRaisesRegex(TypeError Wû'too many positional arguments'�u˜Ä»u1), 1) Êû2a, þ{=1, barxLõ"missing a required¾"’ Ö1fooØÑ ï;WÖ �bar=2), çF9d=‰@}X %9eö "got an unexpected keyworBøB FìMŸ , ,7=10-Ÿ ’ c­÷,?, 2™†Q=  /FØ9Ò#=2Ô'þ>DÉP{, **bin¡U, bin[éÕLº@[yD¦ EÀ (1ó , 2, {'spam': 'ham'})) ñself.assertEqual(°call(test, 9=7õ, foo=1, bar=2),DK/(1v Qwith j{ÿRaisesRegex(TypeErrorakù "missing a required argument: 'foo'"):¬yãÜ/+¤P, bin0/10”bin': 1, Ÿ 10œ~@def ‚ô_signature_bind_ÜsªÚ1ð (a, *args, b, z=100, **kw0DApassn åsig = inspect.w1�ba = sig.Žð(10, 20, b=30, c=40,~bs=50, s6=60>ð# we won't have 'z'0®Æ in the bounÄÀs object, as=edidn'tµ # Äa it to>'˜' Á•tuple(ba.I�.items()³ `('a', Ø0 ('Jÿ', (20,)), ('b', 3ô 2 (''Ž@c': +J : . 0: 64 Ã2ba.L"`{'b': •'m.(3s, ê1)) -m žüpositional_only¤Pa’ParameterR‚V�(a_po, bbc_po=3}R42, *�3Ö|return EC=›züPnew_p· s = collecíâs.OrderedDict(a"+âscÖ€for nameö ('¬@', 'óõ'­~[9L] = ö.replace(kind=P.POSITIONAL_ONLY~9ô©6±=!ps.value ú¨˜'._ü_Œ7sigT[ &A4, 5–/=6‚ .E6, {*’ $ä>_03, d]a b"=4Î5oÿ m‘ "but was÷ðs a keyword"):  òself.call(test, 1, 2, foo=4, bar=5, c_po=10) 4q with ;õ.assertRaisesRegex(TypeError, "parameter is positional only"):PXO Š|4{\añ0, b2}@def $ð_signature_bind_ _½P_arg( Ùõ # Issue #17071: one of the spnamed "?r1(a,m7, b[4Epass/åsig = inspect.¦Ù)&�ba = sig.½(ï3�.ÕõEqual(ba.args, ,- L>o=2, b=S ñ cpvararg_$ a3$*© " return a, f9, 'Ü{è%Põ°got an unexŠ ed keywordƒpument '�' F—2a=0±#=1~eìé`, **kwIó¶"f¡ÌßvP²=1), ((), {©W: 1})‰> « YŠi szº(':…}…�@cpython_IS ;�implicit� �9611: get ªÄ should workîöt comprehensiony|Ÿmake_set(�ñ {z * z for z in range(5)}½.0set_„_code = P!._ý__.co_consts[1]6ðfunc = types.Funci•(X4, {Bs€iterator6Dter(•á%Xz$, K40F€4, 9, 16qò class TestBoundArgèP(unitU.CCase?SÏ:Ç;¿_unhashable‰foo(a): "’!Cfoo)`ü Zä'ˆ'ÂC¥3(baYØew?ityÖ:Šà self.asserótTrue(ba == ba) ñself.assertFals#!#EßEqualsToAll()P .ÿba2 = inspect.signature(foo).bind(1\‰?ba2# Ï72) u3u R D3v™D#õba3.arguments['a'] = 1“‡Be Û3Ûõdef bar(b): passa?ba4ô?bari k�4ô4Ž­foo(*, a, ”?sig”ý¹r1 = sigwa=1, b=¡C!b=2, a=7 1E€ò!1 Ä9ZUtest_¥u_bound_Ö€_pickle(L%):Á9û, *, c:1={}, **kw) -> {42:'ham'}µ! Ç20, 30, z={}Šòfor ver in range(¬÷.HIGHEST_PROTOCOL + 1¼%Pwith Ôƒ.subTest<‹_ver=ver/3#ba Cd = jSloads; .dumps(ba,•>=o–:+VÙZ“ Orepr‘yÝáaRegex(©�ba), r''ïapply_defaults  X[*args¡“ôh´&207;ba.”öP3Plist(?©.items()),(ñ[('a', 20), ('b', 1 Ü0', 0‘ ('c', {}"kw ]Wmð # Make sure that we preservve orderåõ# i.e. 'c' should be *before* 'kw'.¥  10¬µd·ë ¾*Àarguments.it—ems()), ò[('a', 10), ('b', 2 Áargs', (30,)ac', {} kw ¥'d':1})]) R÷+# Make sure that BoundArguments produced by bind_partial()C arB…pported.õdef foo(a, b): passö sig = inspect.signature(fooZ™ba = sig.z(20"÷.apply_defaults˜õself.assertEqual(}N”list(ba.aë?.ito+207€Test no vYòî/È¥ä×/ [ùPa no-Éãñing still acquireDper eã='spam'ù„3£p class ÅS|ð PrivateHelpers(unittest.%aCase):èä_µ`_get_b80am(z.kggetterï;™D ¾F@('($`)'), ' '4_, obj9gcls, /;Ccls'A ñ _strip_non_python_syntaxv, inputÁVcleanÿ , ³6÷ eter, last_positional_onlyK�computed_I\�o( `'w: = .®Àý÷™  È D ä BÿŒ¢ú  Â�.8 Å‘"($module�ùpath, mode, *, dir_fd=None, " +:ð"effective_ids=False,\nö follow_symlinks=True)"©'$"(|2tà0, c 0) õself._strip_non_python_syntax('.û "($module, word, salt, /)",(' $032’%Ãx, y=None, z� & �B Å’7 l/"(� ¡$' \nÀ) ` z = W/ ¢m @ ¥ /#:Lð) class TestSignatureDefinitions(unittest."aCase):Sp# This ó( case provides a home for checking that particular APIsGdhave s{¢s availablB�introspecŽá#@cÏAonlyE@¥ú skipIf(MISSING_C_DOCSTRINGS;"ö€ informaj¾ðbuiltins requires docUQngs")z1def_,_Ï_Ï(‹3p7cs all :A cal÷qs in CP² NtG\A few  Íàcan't yet handß`so we "g thoseMòsince they willWð to wait until PEP 457 adds*dG ­± support to0!inÇ G6S.Pother!so~½ábeen convertedÌU�various 3H’reasons, éGalsoîÒðthe time being, but de®H%!es¹@fail�PorderÊðindicate when it nee8o bQ…updated.W&nor = set(BÎQTheseLiRgroup%$h_ñ = {"range", "slic 0dir{getattrpDP"next+1ite3ovars"}­!|=˜s|%ʵV or a·0 ch¬?aaccept¢IÚ’semantic_;ãOound˜Àneeds_semant³ic_update õ# These need *args support in Argument Clinic6.Qs_var1ñ= {"breakpoint", "min ax!pr>{õ"__build_class__"},ñno_signature |=¨z&Æðsimply weren't coveredÊ÷ the initial AC conversionD@for ˆÕtin callables Bnot_7€ted_yet ø1opeë@__im6½ C]Áð types are expected to providÉ@tros…ion infoI9V_with8•s = set()&€# Check _4s wom ber+nHSvars(¦sQ;�name, objpõsorted(ns.items()):~ùeif notgK(obj"&vcontinu„,©ñA havòCbeenÝ4lAC yet| isinstancez , Fp) and (Çœ!insN¨P# Not0ðat this also skip lIp except±mXÓêA.add‰b##ifŸ8in /’ú O^;Ô self.subTestî=j,ñassertIsNotNone(inŸ.]g)Î�g_ thatÇ!doÎulaim a TÑ¢is ensures‚ötest will start failing as moreFgK‘added, so¶2affDZ can be movWt%€scope of2J`regrese ŽFabovË3.Í (�-náv.__texta__) oà NTimesUnwrappô‚`def __40__(å7, nÿV.n = B@_nex ‘@propertyWl#edZW"if}bn <= 0Ьtraise EH#("´€o many tÌ"iP—0is ˜ W · ûf.n - 1VbreturnªZL1–P(unit÷.bCase):!_us_0„#—func(a, b|Qa + bRP@r = 7ð tools.lru_cache(maxsize=2£0)(func) ðself.assertIs(inspect.unwrap(bper), 56’def test_%�_several(J!):#\'6W(a, bÅreturn a + b1m! =mûfor __ in range(10M@f`tools.Cs¶Cs�Kper(AEpass0Ê4NotR2.__C4d__= 4HOstop>1? 1é2ÿ ûF2F G Hj.Ú•_here = 1_8oped = q,,[]ð =(lambda f: hasattr(f, "y6"))½ ¤‡Ë12) v(ß_cycle˜=): ò1"ÉøWwith „ó RaisesRegex(ValueError, 'ak loop'­ 1h1º(¾æ 2  8Â2^ÂH_cE ß�unhashabä(ã BENonevclass CÑ __hY__ = -ëd€L( Is9 T C(Û0õ³ürecursion_limit½0obj†aTimesUâpeys.get>=G) + @™Abobj) 7ÐTestMain(unitÎ.CCaseæ­only_sourcŸPmoduln¢importlib. !_m$('^'òrc, out, err = ó_python_ok('-m', 'z'�Þ mplines =qñ.decode().split(—ð# ignore the final new&õb%`Equal(us[:-1],[Ðgetsource(modóule).splitlines()) ñ self.assertEqual(err, b'') $ð def test_custom_getattr(8!):#J'Gfoo(Epass$õfoo.__signature__ = 42Pwith W�ûRaises(TypeError[…inspect.PC(fooµP@unit¶õ.skipIf(ThreadPoolExecutor is None,€°!'t)Ñs required toÿ0 __0nam¸òfor source files'Pv+% -òrc, out, err = ~ó_python_ok('-m', 'â'£§à'concurrent.fub.s:ø«B  =‹Š.decode(&°# ignore thòpnal new@#¹Hos[:-1]ÀãC.get+² ”j¿ rºŒbuiltins‡òmodule = importlib. !_m$('G5_»failureÀ$Ôd 'syPG =+¥ ;ð, ["Can't get info ¾ êCs."];Äodetail53 args = supip.optim_ö _from_interpreter_flags(æ, *G/, 3#oäE-öñkoutput'÷ñ# Just a quick sanity check on0A2§2In(€2.__Z]6put/w_Œ/ocached1 ¸Fô class TestReload(-.bCase):'psrc_bef$ð= textwrap.dedent("""\ Y"0priBBla"í3"""ƒL@afteKmOh no!NxbI2çXs, path,Ë`—`ed_src!:§®º§½Popen(S†) as src $sÜ„@src.© ˆ^True)E ¥Þ0Ð ñ) def test_getsource_reload(self):%)õ# see issue 1218234òwith _ready_to_import('Ip_bug', O÷ .src_before) as (name, pathjn’module = LBlib. !_m:)�3aðassertInspectEqual(^", 7 2·Copen$1'w'—6srcø[‘src.writeÊZafterS…% wSmain(ý€run_unit�(ÜðTestDecorators, ±RetrievingS´BCodetOneline)¹BuggyCases,QòInterpreterStack= Cl@ÃsAndFunctionpŒPredicatG»Getcallargs2kMethod� tUnbound'á`Getattœ2tic�qGetGeneZStateÒRNoEOL*ûSignatureObjectBBindPParam( "B”ƒArgumentY°PrivateHelpk 9%bDefiniF "ÄGetClosureVa©bUnwrap˜BMain R‹ é>�oroutine\€) if __R�__ == "__]2__"ÍV(³a# INI ðas many tricky partsžòpossible # Most of them could not be used ÕA 3.2Ž 4�This will'0par)rñthe following op$9ó# delimiters = {'='}0com‹‚_prefixe#aO€_no_valu:ñ True [DEFAULT] go = %(iúñolate)s [strange] :Xò that are indented # and end3Shash ‘Ás other = 9 do continu;@ in@C st2hav9% #Ma mixedóÈs|4¡ a[corru;¼‚Bis ß“actually x3ere Ò�holds allÙÁse weird new}+†1butó0for- "ò+ï# n(Daä”"anôÌ� = # empt¡´ring yet %p# None!8P[yeahG˜@ canW^ ed±@well «Š!es´Âmean = anythf³£they subseT`= Falsš»if you want"àuse XML letsþÀ some Unicody‘片仮å��·ËȤ] even ifl‡Ã`like t5ò= seriously yes,Ä�applies tл( "g!" E to"bžðe people with coñnfigurations broken as this? beware,ñ is going to be a continu>ð of the value for key "Kõ too" even if it has a = character dQstillK `ðyour editor probably highlightsVð wrong but that's life # le se#is¤ sof reÙðno error # when gettë�all itemsÒ£0sec/ð: interpolate = anyth3w¿rdo [noj“s here] #šBere'dö `go` in DEFAULT [tricky aAion] vdÄ#isÄlets = %(go)0[moè±P�go shoppiHŒ;Tóimport unittest from weakref ƒWeakSet 0strN*Bcoll?s.QUserS#yDustr9$gc ñextlib class Foo:ÛDpass‚RefCycleòdef __init__(self)× .c,0 = YCTestÂ(ç.bCase):¢[\setUpX`# need"ðkeep referencesAthem´‚[0= [ø1(c)fc€('a', 'b4c')þ ­.8/2 9x4yz91ab_<;K'ab'i_abcde3 '<bø’isdisjoin)˜ôBTrue¬'s.1b,2)ÃA&UEþÀ) def tóest_and(self): @i = ñ.s.intersection'….items2)-)²assertEqual&rs & set 3?, i7ofrozen=uPdef tº¡differencegÁ % ¿‚for c inñ0letð  â0'i,8µd and c notLö´GX‰s, WeakS,)(utype(i)7+òRaises(TypeError,ß&s.�, [[]])  T?subM(Ò - #/- ¦symmetric_âÉ/ :()Wd) ^ ½GçÍžG(ÃÏä1len�ÜJ) + 2¸(f2.pop(§gc.collectWt% á1xorK./z÷^ë#^ë ubµ]_supeÌ*2TruÓ.ab_weakset <ÚTabcde~?,B0>„� EFalsÁ‚?defA#�A BÀt('a').issub—\'abc'Íž2$4pADiè#3g?cbsg3%5 h õl‰ôÀ self.aó ssertTrue(self.ab_weakset < 4cde3) >EFals?-B?def@*=‘|ÅWeakSet() < !) ­±def test_gtã!):ÇÄÃ>˜†Ob?#|ö/ >cö.# Create a nest of cycles to exercise overall ref count checkH% =uö Foo() for i in range(1000):@elem!s�“.ƒE = sb`sub = &'et‰[%]þ subclass_with_custom_hashÅBug #1257731m=3 H(pM£l_O,__Q Òreturn int(id%r & 0x7f'Fs=H(0f=sâŠvf.add(s!’vIn(s, fˆf.remove0 A�f.discarVhÐ<>ini>mj@s.__._.item¥PEqual¨¹$C2c©éD�Pt2qba2öRaises(TypeError, ²�, s, 2);ü¬8;1);nñconstructor_identityž3sBk -Ï 2NotKŒ), id(t)ôßo1,ùsM]clearÉ’"s.© (,-/[]¥Ô1lenim.s), 0‰-opQ0dup7f .c!�?dup& \Sa0 �‹7elfÝËx = ustr('Q'`s»xŽFIn(x|…ÙS Nòðs, dup) seólf.assertRaises(TypeError, self.s.add, []) fk(Foo()P“True(len(/k) == 1+F#;objI �ñdef test_removem!):®Ëx = ustr('a']#s.3xvtNotIn(x$3:Key2Y/, Z6i7lÂÝ|discardÞHa, qá,ìQìBaÉíaí$s.>q>Ñ7> Ò_ôRaises(TypeErrork?f, [[]]ƒE­symmetric_ŽO‰Ñdef test_isubbÙi0s -ÚtÅž² ;!²ú; ?bo=(5aL) ^ 2ÌÙ2“Ä%KG½2Tru’.s != setKXitemsq&1 Žˆ2ÁaŸ1^2œñ weak_destroy_while_iterating‰¶ò# Issue #7105: (õ%ors shouldn't crash when a key is implicitly removedÀ# Create newPõms to be sure no-one else holds a referenceD)ð = [ustr(c) for c in ('a', 'bEc')]3s4?P@it =Š6r(s€next(it)»ñ# Trigger internal8Uationj2# D\0 anm!de0Vms[-1š±gc.collect(n`# justÍ6casô”# We haveRñ either the first consumedv‘s, or ano%&onJŠ¡In(len(lisí@), [!&, V - 1]ÊÙC# Th˜÷al has been committý{QEqual~(s)j® ¯and_mutate¹_uöstring.ascii_lettersàzÃ@contextlib. umanager[R(œ—6trycÑp# Start$Fratoj¡yielded = ^b œ*¤# Scheduleï�ö¢al and recò%it×;ugbo.pop()j5if ›>= u÷PЧR stil‘Gp5¤.,šNÒadvance it (i 20006).1)  å/ çwë) uIofinallñN9;#£†B all:2als­(Awith²`< as]¶—NotIn(u, +DòRaises(KeyError, s.‹6, ucu2_.add(UðIn(u, s) ó t = s.copy() õ with testcontext() as u:!(¦s.update(t9ð self.assertEqual(len(s), &t))bWclear™`10) �1def¹À_len_cycles(5)¼aN = 20.ÇÐitems = [RefC1õ() for i in range(N)]/+�WeakSet(;ÔAdel -i^fiter(s'6try�‚nbiFúexcept StopIteration3Epassf§gc.collect*An1 =vz¡8 28Q# oneÛ� may be k ñalive inside th"UratorbzÇIn(n1, (0, 1"1On2, ÍLraceËñ # Extended sanity checksÁs)Å›€face of 3ic 0;ion¬øddCleanup(gc.set_threshold, *gc.g(É3 tho4g1, 100wê {½0$ �R(th,  )tÂ\Æ)&emdC# AlâP will I`ed at ɇ garbagec ®J W( $& z)ò n ³sGreaterº1º#+FLess(NÂ( S O+Sò2, n1) if __name__ == "__main__"@@unitØ.ð(() {(u'/home/gbr/devel/python/Lib/sre_parse.pyiƒ1� __get|£__(i5óg‹à+Ù±Q?g˶ÓÖˆ`\?h)hacompilj`ju jp_info(lÿgðh㈵øÔ>g�íµ ÷Æà>Ó‚iRæbP†iògà iTàd;?g�›6ã4DE?bÍcdÍbsimpleerÇÿg?«Ì”Öß?ghUMue" œe2fPÛiðgSb.äA?g§"Æ‚L?ò,(u'/home/gbr/devel/python/Lib/sre_parse.pyi4u ´_sub(i\òg„¹ÝË}r?gŸqá@H?0g4g ðdistutils/fancy_getopttp¥tôcheck_alias_dict(i•gðh㈵øÔ> {{,{òset_negative�"esù~•gTäqs*É> },z} }õt”�íµ ÷ÆÀ>g mÔDh`r_init__WÙ•g,Cëâ6ú> WePªu¯K;]iY Ç&4 qtokenizš—Æ’StopT2ingÌ i(°1#°>Ì0~iEð!Â6XÂ7}’?any·e·!iuç¼?•g?«Ì”Ößâ> ¼)Ý °collectionsÛz¯namedtuple„ �§ �posixpathfJà%@normd–iÜ d3PsetupEPuBmainA¤©Ð�#Ð>f+ 0logeëu“/Loå r ÊÓåX¼*¼ aconfigùr»óË€ NoOpáRError7£RÅ:Å.Å �e®”MÉTD½¿ByteCompileÕagÕ4KXÕüÀl/python/Libò /sysconfig.pyi>uget_´_var(iðgTäqs*É>g�íµ ÷Æà>{(usetupLô ÇuPyBuildInstallLib(JTO0Oð$/home/gbr/devel/python/Lib/getoptk}Œ±ó·_>Y1\Ý>gfLÁgÓ?±4b ödistutils/fancy_r r Ô rÔ'r �posixpath×#JT@norm×kiõg¢&ú|”÷>gùœ»]/M×eoeqabsd Évðh㈵øÔìœ1È : ` 7 ³ñ>g,Cëâ6ú>7*o «`parser:qÕARawCÞPAÉݤô>góuþÓ t"0~i®ð!Ò XÇp&¯ÑMòtranslate_longoptÓBgy2í>g„Ó,B ± Dpþ±“eýd\©\P _´bitem__¤ÊX²í>g{…÷ø>Ù`­`8set`ÆiЉÔË&z‘Õ²set_aliases6¯K‘%°>Téþ‡âAUÒ_command_lineIt; h]]"/i"@_lib!‰SÖ‡¤é>g]éEí~ë ‡F.*F¿.¿QerrorÓ^¢PLinkE  Sg Nq)KXÅ Àython/Lib/diðstutils/errors.pyiQuCCompilerEt(i#g 0{(:" ~ið u!(S]O 0Xð'/home/gbr/devel/python/Lib/posixpathÃ&‰Â_get_sep½ jóg·_>Y1\Ý>g¢'eRCë>½eëeï expanduserÌ��íµ ÷ư>ËGf#Bjoin`gigW#À> Ð` =`ÛBsabsaÃ� aÀa �aŒ‚basenamedŒ¼¯°>gTäqs*Éd ŠddircÀcT(T€tokenizeSšcd UnrV.V") †¿. .diÝÇTDCˆâw°^°%Ï3XÏ} �sre_pars�ÐÈ"et‡P‘ióg;ßO�—nR?g_"Þ:ÿvy?‡`Pªur³³³¿ð>gfLÁgÓ?Ø Á`‚u£b|Äóg…Í®{+R?gÇŸ¨lXSy?$4óPfancyÿ0optÀS1 pRindex:Ð&ú|”ç>‹éòv&+vý‚__init__Jrè1è�extensionåmo v‚genexpr>âhiº|’£â ¶3allªGL¼Lùó 'rfind' of 'str' objects¤äi¤ÐxІÀ  Àg�íµ ÷ÆÀ>gð,�íµ ÷ÆÀ>(u'/home/gbr/devel/python/Lib/posixpath.pyi�1ôbasename(ig[ 0e,e àdistutils/corej"jð gen_usage(f“gTäqs*Ù> ?é>{k$;k]RsetupÒgÒ"0~i<¬òÀ+”ðh㈵øä>g À*+ Àconfigparser)ÑquRawCPÈoÈÎùMPuÓBmain±èi¨³ô>gáy©Ø˜×Q?± B=u‚ˆAFˆ)÷ °_weakrefset©Dxò __contains__±"„%à> ±!k 0abccžccòinstancecheck__Óci_ ÓZ Asre_Èn4Ç nB_subÏÏôWgÐî�b€DC?g¯Z™ðKýŒ€gPªuìfÉb†g×3ÂÛƒbRa‚ÈÛbBÄÄÿŒJê4A?gñÕŽâu„?+ è™ +³class_escap%jÿg!>°ã¿@?g{…÷.!Í^icÍ.` í`errorsÿhduD M?E" CugØ"“ã£g©MœÜïP$¦sYsAÙ t”}gtç-·PspawnèŠ í[f•gd?‹¥H¾"? ªßjXW jÕÀu.(i•gÒûÆ×žY? ð2{(u4/home/gbr/devel/python/Lib/distutils/fancy_getopt.pyi‡>ô _grok_option_table(w�s 0|'| �sre_parseoÙoXbsidentà •gðh㈵øÔ> àdßdSCsnamÇ^iZ Ç%Ç p_abcollÅPìuabupdatećióg ØFìó>gÕÌZ Hû?Ä)a ^ ecse(Æ™r_init__�bgÈp~i?�#Áeqtokeniz辂¾œi•g�íµ ÷ư> L$ Lacompilfj‰ $R_infok ibÀk/À>k!²Ñk chÕtn=•g·_>Y1\Ý> ——“built-in  Creprï!&' KÛ¼@ DdtupÜi¶ÃPsetup“PuH<@s ±×l; HH]Bmain@Š BŠ"×]<@.di?Š ŽÉ9[÷° òò ÇuPyBuildInstallLib=Ýòÿ¤Ð>gTäqs*é|"ÿ!? __Ÿd_class__pX§J qAuÚ_þ#ilü‘ÿi7gÀÍâÅÂ`?gçqÌ_!ƒü gרúC_codÁd†g� Ž’Wç(dÐ!Ê‘ó i"i"g�¾IÓ h^?gMc{-è½�?1‰‰dsetattŒ=àgùœ»]/M?gùœ»]ð)/M?{(u'/home/gbr/devel/python/Lib/functools.pyi1õpdate_wrapper(i•g�íµ ÷ÆÐ> j,j  distutils/ oxjÂ__init__i9n•g�¾IÓ hþ> 0j)j °sre_compileggg�identityõPion(kPi•g™ò!¨½? Dp²pp…‚_charsetß¼t?%? Þ!ÏnÞŠoptimizeoPTi•gÒûÆ×žY? Np~iHò11i¹° #°>1&¡ qwarningtxtdfilter,ej½?Psetupê’Lï PyBuildExt²¼²j! __!d_?__> X ; °genericpathÁ�!Rsfile½yô·_>Y1\í>gTäqs* ä1o pz�sysconfigm-. ¨â Ùòðh㈵øÔ>g ØFìó>¥íP0u¨Rfind_†_åsr­i�g?«Ì”Ößâö.æQerror]ËuD}@ArgE[ö`:"*Í  p7r¬جÿDuplicateOptionÌËgÌ4KXÌä `collec®”  dý3xprV÷VLÀ @ ó'join' of 'str' objects£RiW¿X à u�XOFile�-ͦ vqXÀ0(u0/ðhome/gbr/devel/python/Lib/distutils/dir_ ô .pyiu(i•g¢&ú|”ç> !{(4_+/n0cmdiW idn` 0i,iáj#àÓŒ__init__Ó”�íµ ÷ÆÐ>g Ójx=j ÔajÔ%pj §�listcomp©ÿ?«Ì”Ößâ>gÀ“.«° ?Ö%lû Distribution(Ú nÚ90~iC"¯ómethod 'clear' of 'dict' objectsÇ *À�#À>Ç4Àfancy_getopt‡ŒÀ_grok_opÏl_tableÕ¯°|"°>‚{&S{JÏ_build_indexuJJCSt-in S3ord=P¡i•gJ°8œùÕ ? =-Qwux¶x ±± 5'° �sre_parse£‚fM"€Ö•g™ò!¨½ ? —bbSescapúÅ•gTäqs*É> cèí chclass_iÚig î3maxî^µ)÷›÷+�¶‚getwidth}`ie±›‚ Ïinstall_miscšýV! _az"_>Å6\ÙXÅ ¥ osž­º Ù�_setitemSIù‹S�ú�F¾check_envir~ÐЯÀ*ù>0(u$ñ"/home/gbr/devel/python/Lib/getopt.pyi&u GÄError(i•g�íµ ÷ư> 0{(7"0~i ð!(S]O 0X/%½ p_abcoll¾òju __contains__¿¢ióg·_>Y1\Ý>gfLÁgÓ?¿'g �posixpathiëåï expanduserβÀ>g?«Ì”Ößâ>Í,f  distutils/kúkò check_environnAógðh㈵øÔ>g,Cëâ6ú><””’getframe>'0Ž')Á ‹pections¾Û¾)¢namedtuple»i»OF°'strip' of Ÿ' objectsÁÀ§#À>Á�setup Puˆ3maiU šBšÄÎf˜ Di¾ bu  qthUMuï°˜�W) XÆ<�1ng>óu^modulÿTäqs*É>gç4 ´;¤žaMexecê M“~§€tokenizeSqS±‚_compileOgd¤Ù>g¾¢[¯é‘±dd<*i_dȳ#»replace½Ði¥®½~44iÃ%É> §$,ãÂget_platformë0:ÐãЦ.T G0s/e�YPuS¬rÊ Ê|5À-in method _ô_build_class__>(i•g�íµ ÷ư> ð"0(u$/home/gbr/devel/python/Lib/getopt.pyi3.B$([eWÀ`2À>{`4` òdistutils/fancy_]pÔpÐpÐ'p �sre_parsecP‚uÓÓØ–èó¶Ov3£o?gTUh –ÍŒ?Óc4cB cB_subšbilggÊ0Ê :@dep_DÓ–ÒuÕ”·_>Y1\Ý>g Õ,nj ¢ajØ&j qtokeniz¡#>�g?«Ì”Öߥff 4 Ê dÊ4¬žPpuõühandle_display_options¬x4ç>g ¬x‡†AûÒ_command_lineŽ ktì+¶ jPs/logëEUü set_verbosityâôVñFæ‘?(?g ÉÉÄ­‚(¾Zâ tâ1â�sysconfiè-è_6‡ ètðh㈵øÔèt# å ± o㺪¬O4Ñ*iôgCÅ8 !?g¢Busñ·�Ñ)E Ç!ilàæ˜C�afÈ�0cmd�Ç 1¹ôg÷q4GV~9?g3ˆìø/@ψ1corÒÍ j › jÓjjÔÀu(iðXÆ–?{(u,/home/gbr/devel/python/Lib/distutils/core.pyi6ä(eoj0jŒ0~i?#?óethod 'isalnum' of 'str' objectsÄ_•gðh㈵øÔ> Ä)Ä ðcollections.pyiu ‚sgenexprÂci_ Â$@mÂbdecodeÁ\bytesÃji•g�íµ ÷ÆÀ> à à oºîºBqyW\·.\ ãQerrorjJ¦TD�TemplateE$ ]ÕgÖó!1“built-in : __“d_class__‰6KKXÒ. r©.ò_compile_typed¼Uôg� Ž’Wç(?gA 3mÿÊš'6 �functool/†/²wrapperš_idÈš`config¾×u/ôg·}�úëF?g'�H0ÕÌzÐé? jÖ: �sre_pars¥‡: ¥¢_setitem__¢‚¢•gç4 ´;¤? ^h‚ ;{¡^iZ ËZ Ë]œr Í’mk_bitmapÌV[ô*T7ÛS?gšÏ¹ÛõÒTžiÏ6i°optimize_chStÙpÙ*Þ p¦rÚ|qv ô!>°ã¿@?gÏ…‘^ÔîwØâ2 a lÔDj DÂR_info°µºô©MœÜïP$?gÉ©�ajK]Øl×l¨_)¤dÐ1¤ ¸ðxtension.pyiu ôExtension(i•g�íµ ÷ư> p{(u"0~i ð!(S]O 0Xô1/home/gbr/devel/python/Lib/distutils/e²P.pyiYˆÌ__init__Çó?«Ì”Ößâ>g·_>Y1\í>Ç4PsetupFPu¨Lmain± B±'± �posixpathaÀouabs ¦ôTäqs*É>ghUMuï¦�sysconfign }�óixÿ�ÿ�)± pgenericÓ´´ðRsfileJ`e².e ûPrrorsjZj‚@LibEÑüg‚"¿A) ¡sre_compilÝæ¾óigt¤"?gÓ†ÃÒÀ�š@ * r]]^b_typedŽ_dŽVP¿uLâPyBuildInstall°Lngn4KX¤| nApars‹+•bappend»Pƒiôg²�t±i¥0?gî[­—ã5kc‚rc_vj`còg´RäG.?g ØFì3?òb4bØbB_subf³i†g{…÷øÃ,¦òcputenv-ÓŠ“ƒ oŸ­¯ ƒ¢_setitem__°a° TãïPreprocessðgð{(u~i ð!(i6g: 0XXÐisinstance>(SP£iógí ¾0™*X?gðÙ:8Ø›X?«ñ0'/home/gbr/devel/python/Lib/sre_parse.pyižu fix_flags(¹k•gTäqs*É> ¸e �posixpatheë6â expanduserf•g�íµ ÷ư> f&Ë €warningseeÊDlteriÔ` iÏ 4ƒjò __getitem__gP5i•guæB? g4Ð ðdistutils/fancy_0optÞpttòcheck_alias_dictzEi` z z oD`êu©Rncode[Pi3À¥"À>[1[ Õ�extensionÒYÒÒT_initCÄÉ%n p_abcollbìÎSupdatÎÍi“g?«Ì”Ößâ> "?Î  ÙŸuÄrget_sep2 24Ù=Ù2&‡55ógrok_option_tablßi•g·_>Y1\Ý> ß)? < ecVÛpº„namedtuphÙh#mp:� f fZ·ËLS__nex§PØi•gÕ[[%XL? b,Ÿ L å1Á÷cnalizeȨOÓ ïJ7@normÝ7NSd !| r”]À_©b_typedcŠi•g¢'eRCë> H79�command/W)ÁÇð(iiôg{…÷?g ¼“O�m?{(usetup.pyi�(iAF0Fð,/home/gbr/devel/python/Lib/distutils/corejjAeÿg•µMñ¸¨V?g9 {Ú៰# F°Ò0~i…ñ"(Ÿ¤•gTäqs*É> O)  ¡sre_compilPæu of•g�íµ ÷ÆÀ> nxnxéê‚__init__in gi#Î Ptoken`J8S `4` ¿7Àfancy_getoptqpÑð_check_alias_³ÚPiq Ú%z p_abcollkì¤pRpdate`ñiš°£#°>báhc «²et_platformwÉÎôfLÁgÓñ>gÒûÆ×žYnúnB @renvironÝæÙæ"é>=9= ·ñcommand/build_ex¼#Uu  wƒ¢&ú|”ç>oøT™¶¶ASt-in ¿Cexecª+3ôîêUdt@B?góÿª#G:£3‡³ÿpectionsžÛ0Ó namedtupl ióguæB?ga2U0*©C? ai1sta1b rS_ISREGûZ£ /Ð>r°genericpathÈfÎNisfiÄ eÄ©&jph�get_attr_AÜŒig×tJ°8œùÕ ¤w&‡w pgrok_opÉD_tabów|ózmŒ c”cb_len__cPýi•gˆÓI¶ºœ? c1Æ ðdistutils/extension4Ym4T_initnÑ#g n%n p_abcollbì2gCpdat1i•g�íµ ÷ư> `” �posixpathbë]â expanduser4Ái½ fŠf—cdirnamÉ)Z c4) —Àfancy_getoptÖ‡pjógrok_option_tabl{:{•gTäqs*é> {){ ¡ ecVspÛpFÝDdtuphAF¬#¦@èf Öhclass_FGiC ÑiÏkk<pmize_chÈt*R•g¢&ú|”? o„ oØ·mÑS__nexbP3i•g ¨lXSYD? b‚H_uÄrÄòg”ص½Ý’?g{…÷(?b Ä3jdžWR_infok?ofŸg·_>Y1\í>k o(1y‘i f•4ÏÓ3B_subÌ~Ì“gç4 ´;¤?f??0g € _ÉÎ_Âç>g?«Ì”Ößò>{d,   £0ÐÒòfind_config_files× ª#Ð>£Ý£$2sys_wBXŒn#Ý>@#ç>E� ~iAñu (# Z# >Àdevel/pythonô(/Lib/distutils/fancy_getopt.pyi u(i•g�íµ ÷ư> 00(4ÿ 4/home/gbr/devel/pythonrmwòg5wô¿\‹&?g4)Ý^ÒX?{r,rîÜXÜ jÜþ0~iç#ðethod 'isdigit' of 'str' objects>(l iÉg< Ä)Ä °collectionsÁÛ‚â namedtupleŸdn` Ã8i #ðcommand/__init__x 9ߣÀ#À>ßI_setupFXARF¼&¼ €tokenized•"TRError‹¬‡"¬"å!å¢built-in mî __�d_class__TX¾*¾ Àconfigparser¡]u CP Äp¤Ð>gâ8ðj¹33Ä- XÄ'Ä �posixpathÁ=ƒ Osabsº?Ð*bÀouabsvüHdÆ"ââÓallocate_lockÃ4V°º�functoolÁ~ñdecorating_!?ionÆ .°>ƨŒ;‹ôgoÓŸýHY?gÓ�¬§V_}<9ä "!ex8e # Ýt�¾IÓ hþ#"?Å|AV ŸÞóg1]ˆÕa8?gR%ÊÞRÎwg+Ý mdÅÏhógJ°8œùÕ ?gCÅ8 hbg°install_libx5G ”¢'eRCû>gPG1à À/distutils/eðxtension.pyiu(Qiðg«ZÒQf?g ØFì?(3ñ,/home/gbr/devel/python/Lib/distutils i6iiógrQ-"ŠÉ ?g×3ÂÛƒ i.i`errorsk kkógî=\rÜ)=?gH£'ÛÀ=k&k €tokenizecc<óg”ص½Ý’?gm7Á7MŸcqstring>`| óhUMuÿ>g¢&ú|”E1¨ |�text_fil³�êá n qwarningyLÑ1ióg$Dù‚?g?«Ì”ÖßÑMSÌòÞ3ßÁOü>g�¾IÓ hþ>¶+:0loghѾ„gfLÁgÓÑÑ7hðcommand/installt)Et¨s™ò!¨½ t$t `getopta¼a”¢'eRCû>gF=ŠQconfi@¨Ù4÷>gtk4Ì âffancy_Üûai•gTäqs* ?oq˜Psetup!Á‚™Ç¾*2?0F*· `parserhð uInterpolationDepthEÍ(?h•g�íµ ÷ư> {wº0~i×!Êðbuilt-in method __�d_class__ã XÏX XOÐ'get' of 'dic rbjects>¯Úf•gümO�Øî? ¯)& ƒsre_comp·z�¡ g ÀÀë'fЉ‰²_escapecjc•g·_>Y1\ý> x·1corƒ;£ÕkfeßfÎxfÑð __init__(iiggð%(u'/home/gbr/devel/python/Lib/sre_parse.pyiI1ô opengroup(i•g�íµ ÷ư> e4e ðdistutils/fancy_getoptr‡rò_grok_option_table{3{•g¢&ú|”ç> {){ `collecVspÛpÄ namedtuphh? hHèf Ö³class_escapÑ(i•ghUMuï> i€ysconfigÏÒ>uget_B_var;Îi­ 0k+< ·!loo?Øðset_threshold(ÓinÀ$?À>{n#EnŸverbosityÜnÜ.ÜQerrorWqÀ CompileE Þ^Þ ~ið u!È:XÈXX‚getattr>¨‹•gðh㈵øô> ¨È �functool_Óupdate_wrappe_k•gTäqs*Ù> ð,‚hÎxo7r_init__$i`éi/é>i$17Ãfinalizeysqq0]1Û�extensionàLuàs ð{(u,/home/gbr/dCñ/python/Lib/distutils ô.pyi‡uparse_command_line(oyk 0t–0~iò#Î0_•gTäqs*ù> Î'Î Asre_·ÉT€â closegroupÁbi^ Á g re`Ì``bompileÄijð>g¦–­õEB›?Ä&] €warningscc¤filterÇjj²À>g†ÆAœ‡#?‡9i ûä /build_ext|`!u¿bodule>vÜþ£À>gÕ[[%XLv*v aconfig¥rgáÜuSafeCPyro£°>gþz…÷.oàØ£°>gOʤ†6;i· qtokenizµ;£°>gXà+ºõš>c"; @glob3ƒ_ i£°>g„dC_ÂqyýÝûsc£Ð>g÷¬k´è‘cý]ýO ù,amŒ�ð2k#q×~RawnÞÙÖc Ìí^îsn4› LPfancy²!opG J(òY-VTôg ØFì?g!>°ã¿@üg‚²mÓ·cÊ.9QerrorgE¤TD�InternalE$Ùvùk"÷!8OSt-in  __Ÿd_class__QÀư>g�íµ ÷ư>à0(u~i ð #(i8•g�íµ ÷ÆÀ> {Zð&/home/gbr/devel/python/Lib/warnings.pyi¤filter/(j Ä)j ¡collectionm(mÂ__init__Ñiógðh㈵ø?g¢'eRC?Ñ*g  nfigparserÕY™uhÏÔ0²ð>g{…÷?8'g �functoolÌ~Ìñdecorating_!óTäqs*ù>g�¾IÓ h?>p Asre_ÕÔ�pÔ‚getwidth<—Ôô·g Xr‹ßT?g�Ïdÿ< X<£ epcompilegc;£bsimpleË‚f•gÀ“.«° ? :eje ezR_infokkÿg<ž–¸Ê#?gïô¥·?W¥Ð5 ô i"g¦Ï¸®˜Q?gíœf�v‡TšB qtokeniz28™™Rmaybe–eij2°>g#É>Òa ΂)_d_d ì÷XÅ’‘processop¶Ï r°r°ÏkMÏÖdÏÖ§ef¤ë>gðk$ Â%3gPsetupPu7=maiÚ¨B¬±µ†2NoS0_Error~<J!J“built-in S __“d_class__A6Hr  �posixpath'�Ã9}basenam Ü#Ô>åä;,u Ñdistutils/corq¹ u ¾sen_usag¥Ðlk"Ô>¥j;Ô4 wf6ÀÑ/Ô>ü Àython/Lib/coðnfigparser.pyi—uError( Qi•gðh㈵øÔ> 0{(1"0~i ð!(SX0Xú*/home/gbr/devel/python/Lib/co½¾�ÿDuplicateSectionÍ”�íµ ÷ư>g Í4OXÍ,Í  distutils/ Œ`ÑuÏpistribuËŒMetadata›”?«Ì”Ößâ>g Î4OXÎ9΂command/0extÛ)ªE  Ðÿ¢&ú|”ç>gÒûÆ×žY?Ð4 XÐ4бfancy_getopËÔËB ÈôTäqs*Ù>gÄËÓ¹¢”0È‘‡u­_W\_lineO tä.äeýs©:Þ„Ÿ�PlatformTr'Ò 2sys$ËÀA©_\_vars²ÀÐ#Ð>zlm>ul © k©ø "llÙ¤Û¤ì namedtupleÔô¦@fgÑ;?gMLbõGH†&@ €tokenize?X uÞmmoduleÅ dÍZ&ØP FsGr Ù B­’- XÍX êQ>¥j1cor„"7�gen_usagû¸k¸0éÀdevel/pythonô$/Lib/distutils/__init__.pyi u(i#g 4{(4PsetupFFF 0Fû 7/home/gbr/devel/python´ðcommand/installuxu© º”¢'eRCë>g ºÜ ~i× u!ùðbuilt-in method __»d_class__>(ÌOXÌ"Ì @stat··¬S_IFMT¶”�íµ ÷ÆÀ>g ¶^1^|S_ISREG½V_½# ý 'update' of 'dict' objects) Z¹' �functools¾w�_wrapperÅk �linecachek‚ù óÕýL½n1?geN—ÅÄæ“?Ð&Ð qwarningÏU d K dŽ ŽBfindŒ?str‹ °D#°>»  �posixpath ë†Ï expandus‡g¾„Õ�text_fil‘ qŠŒTextFile”Täqs*Ù>g ÖfÐ)OXÇX´<(_localÐ}Ð})8 ¡collection;Û¯namedtuplei¸.i Qerrorn5nTD%SÛE! ‡9 /W"TXÏX $ad e–Äç¤5Ž4dii¿Ž bްUnknown ‹À~iu!<ðbuilt-in method __ôd_class__>(i#g ð20(u4/home/gbr/devel/python/Lib/distutils/fancy_getopt.pyi‡>ô _grok_option_table(w�ÿgÙæÆô„%?gXÎüj0?{|,Ô|B� ì pì ~i cu.<;ò'__contains__' of 'frozenset' objects>Õui•g�íµ ÷ÆÐ> Õ)Q `collec,sFÛÊâ namedtupleÎdiÎi °sre_compileiÏi¯ªÂmize_charsetÙ‚³ôgxB¯?‰Ïm?gu;ûʃôt®p²pp…o™jioß*H PnfigpÂràòXuMissingSe²HeaderErrorè–Á"&!&Xj1ÑÑÐInterpola5oSyntaxБ°‘/°>Ð4 X¡&¡ qwarningæ ÌRWmMessag( jÂLê#êbappend =lisPi•gǺ¸�ðF? ²,¢_mk_bitmapPði•gümO�Øî? Bh ””fP7i•gõ×+,¸/? f'ê j‰ˆ4ÌB_subfša•gÒûÆ×žY? f9f Š€command/™Ad_ex� Uu ww¨ w9ÝÂß×ßßC_cod«ccc@ �posixpathaJa¤@normÇÚÐi g�íµ ÷ÆÀòv>g�íµ ÷ÆÀ>(u4/home/gbr/devel/python/Lib/distutils/fancy_getopt.pyi‡u_grok_option_table(iig?«Ì”Ößâ>g?«Ì”Ößâ>{'{ �sre_parsenI¬á opengroup(e0e•g·_>Y1\Ý> e‹e¢appendbPƒi•gðh㈵ø? b)ÇacompilÉÏd7°optimize_chætoÂo•g{…÷? o7o ±ðcommand/installFx}3s#g s©P‚uD¼b Õ•g«ZÒQf? bDjd DYR_infokjÍ•g,Cëâ6ú> k!²2k ®Pi•gÒûÆ×žY? 0o`~iXðu(·„i•g¢&ú|”ç> {N,ý´ò»òu get_platform*in¼ø)[r__len__ÒýùóghUMu/?g–=Ô¶a4?Òd\còg‹à+Ù±!?gã5¯ê¬&?4\71i•gTäqs*É> kííBlen>}¬ðógfLÁgÓ?gç4 ´;¤¶4 ¥0B_subfJff³?g]éEí~?ã²r Ÿógetfilesystemencoding¯ri Ý ¯ os£î¾2Sdecod=fk; ”[ê[º[¥i® &+‰T_initei:#Ô>�#ñ>)Øß5‡ÚBòìC_linæotÀ㈵øÔ>gfLÁgðÓñ>0(u~i ó(iÈ•g5wô¿\‹&? {Lð'/home/gbr/devel/python/Lib/sre_parse.pyi�rïgetwidth(e ±3chr±¶•g�íµ ÷ÆÀ> ± ·±¢__next¯^iZ ¯ �functoolsucÒ lru_cachez¤i•gTäqs*É> É%z pfnmatchd dx‚É^cÉ,c  distutils/jújü check_environÒó?«Ì”Ößâ>gÒûÆ×žY?Òoyoü 0ufind_config_filesâ sâ&â qwarningª/uFAÿg„¹ÝË}r$?g[Y¢³Ì"”×&X j(�jÎ4Î 7ªàs/fancy_getoptIwI ƒdictcompPtP³Ð>gðh㈵øÔ>µt&õæ ræ.æQerror¼@˜TD³PExecE �gè 5!) 5 __�d_class__dKXÎ)Î A�!ilCc©’Ssimpl-‚Gôg1zn¡+1?gðJ’çú><„f /ë_{ObigÍ%%dhasatt­•iÛùäù]xºr_init__º#!•gfLÁgÓñ> ÇM p_abcoll+ì‚bupdate`Wi Ðw"Ð>`É gÉ ,’_platformmÍmämºðsetup.pyiuô(i•g�íµ ÷ư> ð%0(u'/home/gbr/devel/python/Lib/sre_parse.pyiÊ1 match( Qi•ÿgóWÈ\9?g Xr‹ßT?{b’‚uuÅP½iÿgv‰ê­�­2?gVÓõD×…O?b4b bB_subfØ+óg™ò!¨½?g„¹ÝË}r4?+M0~ið g·_>Y1\ý>—,b  distutils/ l0eòfind_config_files@sÚ.s]uáü PyPIRCCommandäÁÐÁÐä“–!– __¨Ÿd_class__XÉ*É ¿rÅáÜuSafeC9P8 ¬ôTäqs*É>g�¾IÓ h.'È- XÈ&È qtokenizà6‰½Rgroup�Ì¢gÉÇî%ö>gjù�a©u` ¦7i“gfLÁgÓñ>Ò"ô>–c7ÄÚgfLÁgÓñ>(u /er\\Dql_typedcò?«Ì”Ößò>g{…÷ø>0dp~ioð%(º/•g�íµ ÷Æ? {\4À ðdistutils/fancy_getopt0¯ÔE†Œ_longopt×”¢'eRCû>g z,j ò get_attr_namevñ•g ØFì? M!M@lowe@IX@%°> I,IOAÇ Ç‚platformÆiie Æ&n qtokeniz}0hP TBInfoVi\ Óx+“built-in � __¢d_class__>½6X½t&t8úÏoption_orderÒ¥ø¥‡r�pars0ƒmand_linqîtº!uœSoduleÌjóÜóüi£:-?g¯]ÚpX:?°j"co˜ï jõjÂ"'©’DsettFŒproperty”< ÀK#À>È*Ý aconfig‘r¤-¤IÏParsingErrorŒlÊ4ºÛgÐ!>°ã¿@@¨&;Ã]\setupÛ gÛG2v΄gTäqs*Ù³à³Õ+" XÄ^_Ä ðžu fix_flags(Sið@g!>°ã¿@?gfLÁgÓ?{(u'/home/gbr/devel/python/Lib/sre_parse.pyiªup$(]gb0b.b ðdistutils/errorsi šà(lôghUMuÿ>gõ×+,¸?Î4PsetupF uFiF²"0~i…"…óethod 'encode' of 'str' objectsŸŸ•gðh㈵øÔ> m  oý’êuogWiS µ,\ gmP{ujœMixin2to3f”�íµ ÷ÆÀ>g Ç ! ¢built-in m) __¢d_class__>Ã6}O ÃŒ³žÝ‚__init__½ñô ØFì?gÕýL½n!#eñ bÇé?orstrip?�i•gTäqs*É> x» �posixpathÞë  FŸxpanduser‡°ß"°>°fŠf—rdirnamec á #<9_'join!Wóg?«Ì”Ößâ>g¢'eRCë>!& €tokenize 6ºVRgroup¸ay )` ¡collectionÉÛcƒSdtupl ! )Òh4h ÌÀfancy_getoptÖÔs<×oÓgoòJžx@normmd¸½,Vó+Ô0logËËi áÍiR' )6Òn qwarning !6¤catch_´�<q)Àass__>(iPi•g�íµ ÷ÆÀ> ð%0(u'/home/gbr/devel/python/Lib/sre_parse.pyiI1ð opengroup(a0ÿghUMu?gfLÁgÓ?{f’‚uy$(^ihcÉ)ÉacompilË×e½R_codeÇiôg#Diâ ?gí�V`Èê†ÇdædCxÊaifÊ%Ê p_abcoll‘dbÇ2getÄìñóTäqs*Ù>gÉÇî%ö>‹-^ ðdistutils/debugfTÒuÉkÉ"0~i6?ü built-in method globals>»¬°¬°»#» Ptoken±± a±$±¨ô 'endswith' of 'str' object¼¤_ wh �posixpathÀG2NBjoinmiX ¼œ 3pectionsc9c e¢_setitem__‡› ôÙæÆô„%?gEÒnô1 Ë �functoolh†hrwrapperÎdÎoPsetup­ø к|ôgÍ®{+c?gDúíëÀ9£ª�Ð �MexecÎ M“ ~ oðî’½&deY�iôg·_>Y1\Ý>g?«Ì”ÖßâÚ\©\´g´\a½4½ öÀfancy_getopt|¶u Op=RDummy)] Oô"! __‘�d_class__Š XÍ+Í/loÁ @—¤í>g,Cëâ6 @† |å F¯.¯QerrorG,7TD�E" À°>{(uð~iu!(i•g�íµ ÷ư> 00(Mð2;/home/gbr/devel/python/Lib/distutils/command/install_lib.pyiE g (|”Täqs*É>g {|"Ô)OXÔ!qstring>ìu TokenInfoŸ”·_>Y1\í>g Ÿ4OXŸ%s pfnmatch]XuÎ|module>»óhUMuï>gm7Á7MŸ?»"c 1glo½� ` 6 `Ã*` ÀconfigparserÈA™hŒ__init__Èô¢&ú|”ç>g#Diâ È,h ž jYjA}_‰l_files tÜ't �functoolsoþÜpdate_wrapperß©³Ù>g?«Ì”Ößò>§k~fñdecorating_ŒgÞ3ßÁOü•–Ij!is3nceeNS»è6ÁkLsJKbJpÒa&Úèÿgõ×+,¸?g«<�°S¬J3# F¦ËË3allS²ôg¢'eRCë>gùœ»]/M’1<�extension�YÎ�ú î«ɘ"Ð>)nÀe/gbr/devel/ô%python/Lib/collections.pyiÛu namedtuple(iðgðh㈵øä>g�¾IÓ hþ>0(6÷,/home/gbr/devel/iàdistutils/corel;6 setup( igògÉÇî%ö>gA ]ÞL?{g1CPu Bmain©=GB©"0~i~ò ��÷�)÷ `9vò __setitem__¸j•g�íµ ÷Æà> ùi(i,d__initfªi]ÀfÀÇ4Ð ÇÀfancy_getoptŒržò_negative_aliasesNzœä#À>W#Ô>NEˆvó ‡uparse_command_lin¹t'ò �posixpathoGåqBjoinÕNS¹ðÕ1a Ë�sysconfigk-k +F_¨d- ÕÐÇ"à>-H0H’find_†b_filesrŸ9rG°AdebuâÆu¤sY1\Ý>g ýQÞkL jÄeajÕ �functool<†ejrwrapper=iôgCÅ8 1?g@i¨QH2›Ò  -ÿ]Âã$pi—Y^Â7 sgenexpr”%ÿ*¤í>g ØFìó”¶VÆ VBall>KGiL´v~ñdecorating_—#io¡šæôhUMuï>g� Ž’Wç‚�»afnmatc» ³ I cÓW@arch9` r )ˆ ‘+WÀevel/python/ôLib/distutils/cmd.pyiu(i•g ØFìó> 00(4ð '/home/gbr/devel/python/i�sre_parseeðu_escape(v i9dÿg()°¦ ?gd?‹¥H¾"?{d‚ddwÇ^hcÇ,Ç 0 Ìxý1‚__init__Í1ô#Diâ ?g!>°ã¿@ Íj1cor6;j*RsetupÑgÑ*Ñ aconfig#rÏ›ð InterpolationMissingOp \Erroræ”�íµ ÷ư>g ³¡0~i»!Vðbuilt-in method __�d_class__oOX×1× žØ�text_filC> ÞÞô·_>Y1\Ý>g™ò!¨½ ­áw$ FF µŒþ6Œag4KXÊ+WËòCommand?à?/à>À4?XÀ)À ®Ccomp7²¾L0_chÌtÇ‚¹ôg çfhg¦@fgÑ;%?$k ÚÝ_ÚfÒógŸ7©0¶@?g³=zÃ}äv?Aïße‹Sisnamî iôgÉÇî%ö>g¢'eRCûücî^cÆÿµxÿ¿ $5$ôgÖÿ9Ì—?g+iÅ7>›ö^Ì^ª �Xi]»& qtokenizöcÁà(iPióJg”ص½Ý’,?gBZcÐ ¡“?{(u'/home/gbr/devel/python/Lib/linecache.pyiu(`e0e1e ðdistutils/file_ o] oÏo”ðh㈵øä>g Ô+o0cmdiW i{d` Ø,iâjðYuparse_config_ö s(†ok„gˆ»z-±t@coret;ç]osetup(ÛgÛ Û os[©Ïò __getitem__ÈpiôghUMuï>gç4 ´;¤Èy �posixpathhëÃì expanduserÈ8"Ô>z%Ç p_abcollddÌÍ]j] )¢contains__fsiº³ä>gÞ3ßÁOü>‹òfý 1ufinalize_optiondt�íµ ÷ÆÀA#Ô>Arx¡àDinitÜzÎ jÜ" ~i¼!u0Yðethod 'disable' of '_lsprof.Pro+²r' objects>mEg2°>gp3°>{h‚2sys–s ÓkôgÒûÆ×žY?g?«Ì”Öß"Ý9w ©æðs/command/build_extwe w µ wæ N&N¢startswithQ-stDT[•gÉÇî%ö> ±GµBjoinèiœÀ¥À«²ŠqtokenizÓ#_�“Y1\í> ³ÅvÂf)ÿ s!ec’ïÛ΢namedtuple3EÏ<°3ÎÀython/Lib/poð sixpath.pyi=uisabs( •g�íµ ÷ư> (0÷'/home/gbr/devel/python/Lib/poaÐJunormvdd•gTäqs*É> 0e)e °collectionsÈ‚˜ñ move_to_end(زiÅàÎ2à>{jÏ �functoolh†h²wrapperÎ_dÎ&Î qwarningcScp _OpàRErrorÌšgÌ" ~ið u!À6iO 000-ðBEGIN PRIVATE KEYðÿN- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC3ulRNfhbOAey/ B+wIVYx+d5az7EV4riR6yi/qE6G+bxbTvay2pqySHtDweuaYSh2cVmcasBKKIFJm rCD1zR8UmLb5i2XFIina1t3eePCuBZMrvZZwkzlQUSM1AZtjGOO/W0I3FwO6y645 9xA5PduKI7SMYkH/VL3zE5W1JwMovv6bvNiT+GU5l6mB9ylCTgLpmUqoQhRqz/35 zCzVyoh+ppDvVcpWYfvXywsXsgQwbAF0QJm8SSFi0TZm5ykv4WE16afQp08yuZS0 3U4K3MJCa4rxO58edcxBoHðÿÿòQ29K3iINM8enRfr5q+u5mAAbALAEEvyFjgLWl/u 7arxn7bJAgMBAAECggEBAJfMt8KfHzBunrDnVrk8FayYGkfmOzAOkc1yKEx6k/TH zFB+Mqlm5MaF95P5t3S0J+r36JBAUdEWC38RUNpF9BwMYYGlDxzlsTdCuGYL/q+J o6NMLXQt7/jQUQqGnWAvPFzqhbcGqOo5R2ZVH25sEWv9PDuRI35XAepIkDTwWsfa P6UcJJoP+4v9B++fb3sSL4zNwp1BqS4wxR8YTR0t1zQqOxJ5BGPw1J8aBMs1sq5t qyosAQAT63kLrdqWotHaM26QxjqEQUMlh12XMWb5GdBXUxbvyGtEabsqskGa/f8B RdHE437J8D8l+jxb2mZLzrlaH3dq2tbFGCe1rT8qLRECgYEA5CWIvoD/YnQydLGA OlEhCSocqURuqcotg9Ev0nt/C60jkr/NHFLGppz9lhqjIDjixt3sIMGZMFzxRtwM pSYal3XiR7rZuHau9iM35yDhpuytEiGbYy1ADakJRzY5jq/Qa8RfPP9Atua5xAeP q6DiSnq9vhHv9G+O4MxzHBmrw9sCgYEAziiJWFthcwvuXn3Jv9xFYKEb/06puZAx EgQCz/3rPzv5fmGD/sKVo1U/K4z/eA82DNeKG8QRTFJCxT8TCNRxOmGV7HdCYo/B 4BTNNvbKcdi3l0j75kKoADg+nt5CD5lz6gLG0GrUEnVO1y5HVfCTb3BEAfa36C85 9i0sfQGiwysCfðÿGuus9k8cgdct5oz3iLuVVSark/JGCkT2B+OOkaLChsDFUWeEm 7TOsaclpwldkmvvAYOplkZjMJ2GelE2pVo1XcAw3LkmaI5WpVyQXoxe/iQGT8qzy IFlsh0Scw2lb0tmcyw6CcPk4TiHOxRrkzNrtS9QwLM+JZx0XVHptPPKTVc0CgYAu j/VFYY5G/8Dc0qhIjyWUR48dQNUQtkJ/ASzpcT46z/7vznKTjbtiYpSb74KbyUO5 7sygrM4DYOj3x+Eys1jHiNbly6HQxQtS4x/edCsRP5NntfI+9XsgYZOzKhvdjhki F3J0DEzNxnUCIM+311hVaRPTJbgv1srOðÆkTFlIoNydQKBgQC6/OHGaC/OewQqRlRK Mg5KZm01/pk4iKrpA5nG7OTAeoa70NzXNtG8J3WnaJ4mWanNwNUOyRMAMrsUAy9q EeGqHM5mMFpY4TeVuNLL21lu/x3KYw6mKL3Ctinn+JLAoYoqEy8deZnEA5/tjYlz YhFBchnUicjoUN1chdpM6SpV2Q== -----END PRIVATE KEY- ñ-BEGIN CERTIFICATEð” MIIDYjCCAkqgAwIBAgIJALJXRr8qF6oIMA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u IFNvZnR3YXJlIEZvdW5kYXRpb24xFTATfò"BAMMDGZha2Vob3N0bmFtZTAeFw0x ODAxMTkxOTA5MDZaFw0yc³B²/ V³ ² ³ÿÿ§CCASIwDQYJKoZIhvcNAQEB BQADggEPADCCAQoCggEBALe6VE1+Fs4B7L8H7AhVjH53lrPsRXiuJHrKL+oTob5v FtO9rLamrJIe0PB65phKHZxWZxqwEoogUmasIPXNHxSYtvmLZcUiKdrW3d548K4F kyu9lnCTOVBRIzUBm2MY479bQjcXA7rLrjn3EDk924ojtIxiQf9UvfMTlbUnAyi+ /pu82JP4ZTmXqYH3KUJOAumZSqhCFGrP/fnMLNXKiH6mkO9VylZh+9fLCxeyBDBs AXRAmbxJIWLRNmbnKS/hYTXpp9CnTzK5lLTdTgrcwkJrivE7nx51zEGilZh9Db0r eIg0zx6dF+vmr67mYABsAsAQS/IWOAtaX+7tqvGftskCAwEAAaMbMBkwFwYDVR0R BBAwDoIMZmFrZWhvc3RuYW1lòÿTA4IBAQCZhHhGItpkqhEq ntMRd6Hv0GoOJixNvgeMwK4NJSRT/no3OirtUTzccn46h+SWibSa2eVssAV+pAVJ HbzkN/DH27A1mMx1zJL1ekcOKA1AF6MXhUnrUGXMqW36YNtzHfXJLrwvpLJ13OQg /Kxo4Nw68bGzM+PyRtKU/mpgYyfcvwR+ZSeIDh1fvUZK/IEVCf8ub42GPVs5wPfv M+k5aHxWTxeif3K1byTRzxHupYNG2yWO4XEdnBGOuOwzzN4/iQyNcsuQKeuKHGrt YvIlG/ri04CQ7xISZCj74yjTZ+/A2bXre2mQXAHqKPumHL7cl34+erzbUaxYxbTE u5FcOmLQ·>ENDµô,# Adapted from test_file.py by Daniel Stutzbach import sys o $ioEerrn @unitY ccarray G tweakrefRproxy”functoolsbwraps YA.sup–V’(TESTFN, ô_UNICODE, check_warnings, run_ž?, òmake_bad_fd, cpython_only, swap_attr)�¥collection¯…UserList=€_io # CÐplementa1F of C‘_pyio # Pn+ñ class AutoFileTests:É # ÇÑÑs for which añ is automatically set up @0def‚Up(self)U!Q.f = vðIO(TESTFN, 'w') ð def tearDown(self): 0if &.f….close().ños.remove(TESTFN) a¬stWeakRefseñ # verify weak references=o‘p = proxy:&.frö p.write(bytes(range(10))"«³assertEqualC£.tell(), p 2fÝI…f = None›_„Raises(RÀðError, getattr, p, 'v'PSeekTŽL|/.fá2á-20Û\seek(Å$ +!f.B1C ,DK5, 1 F 5,F-G ¹G2bŽ  ápAttribu‹½Ìã�expected ,a existIíc>".f>ŠÏf.mode, "wb"±Æƒd, FalseyR‘8theŒÆare readonly“!or$P in 'yA', 'ý/d'©(AType %),a’s:!f,|, 'oops@qBlksizeÙ sòtest private _b'Jy~õ = io.DEFAULT_BUFFER_SIZE)€# try toÔ! p©Dred @Äfrom stat.stoÖ, if availabl7`if hasp(os, 'f7'¾‘fst = os.à§.f.fileno(ã,„=œXffst, 'Š$',©1i&f.¾X:6#Aintoÿ@Read‚ByteArra¯Õ^³ç[1, 2, 0, 255]Õ,f(é@a = ïab¶b'abcdefgh'×Bwith¸cFileIO�«, 'r') as Ïdn = f.Ô6(baK‡Ñûba, b'\x01\x02\x00\xff� 6Cn, 4Å._›/¡Memoryviewã0" %FŽp.moduleFÉ X)j4delð'^!Ë&/fdÉ<…fileno()Ú Íµ!f.3(äíÌ&[U d]ƒ j)0NoC»!FD.|ðfd = os.open(TESTFN,†O_RDONLY¹6try³2Bwith¯.¡(fd, 'r', Ÿêfd=False) as f;? › 7£|!F: ¬ f.€0, fe¢kfinall #osæ-fd{cursive¡å# Issue #25455§Wrwap_attÖP.f, '’'mÂÓ4øZGbRuntimJ 26ú # Should not crash½�s,L2f =fÁÙ…§(f.isatty(I%6dq#$+—¨*)úBValuøÅãð, 10) # Open for 5ing·« ñ("£þ™ž ߀into, "uE �\ ±æ‡mMethodËmR = ['ÝB', '» Q@able = › fZ'+3$ll s /s'”2'te4qtruncat~rflush'] ð self.f.closeC() ñself.assertTrue(¥f.closed) (ófor methodname in%s:#R#£ = getattrP,.<|1ò# should raise on {Y file[šªR,Äs(ValueError`±/4Typ.¦f.readinto“e7ï, bytearray(1)E {Oseek2 Üw3?, 06 h_write3 i4_, b''9 l_lines8 q9vùâdef testOpendiK)oô# Issue 3703: opening a directoryZáfill the errno[zð Windows always returns "[E)÷ 13]: Permission denied@ýUnix uses fstat andEx21]: Is˜"C6tryДêçFileIO('.', 'r„‘except OSô_ as e?¾±NotEqual(e.÷ 9k,)s¢V, "."Ã?elshrfail("S¾BhaveÃd "�P@unitȰ.skipIf(os.f° == 'nt', "° only worksóa POSIX-like system“QDirFDd€fd = os.F¶os.O_RDONLY×Qwith qU^)_/cm`Ÿ+fdž"os66(fde`f2cm.Ç4ionš¡s.EISDIR5ñ#A set of functions ãpthat wecñ expected behaviour if someone hasl”#manually]�internaljð descriptor. First,´‚ecorator{C0FD(™vb@wrapsue1-pe¿t#forcib˜¥fÌ0ford2vokñ•e problemcH2f =Êf’.Û'o(¥8 €ØS6, fÉ inE HÿNu 1X$2pasÅ £ Sžd•Äà ›Às(func) ð def wrapper(self): ñ#forcibly close the fd before invokingùproblem functionH@f = _).f1os.XÉ(f.fileno())!:try‘™b­:, f/þexcept OSError as e?ˆñassertEqual(e.errno, k.EBADFX/lsIô fail("Should have raised…"JofinallÕêî¯f( M óî$EpassWdreturnõ  @CÞ@dFDR¼,PtestE!On"vhšJodWritePw_b'a')ž_dSeekSs0OOTellOtN_runcaôt ¥VŒî?ablEò §PARead3r[årPâPåPF"ž= 0ìoIsattyÝ^.2f.i,ƒ), False±“�ReopenFor;M? Ñ[/™Á ¹@IæIO(TESTFN, 'r'W3\ 6 dí $š – f.E#(1AtpaŠs=u!AintoÖéüa = array('b', b'x'*10 ^ða) class CAutoÕiTests(`, unit�.CCasei1’IO = _io. õómodulename = '_io'hÀ PyAutoFileTàests(AutoFileT°, unittest.°Case): #²IO = _pyio.ámodulename = 'ð' class Other-O1s: 2@def d£Ables(selfei2tryr @f = $tÑ(TESTFN, "w")O%%ÿassertEqual(f.readable(), False2Dwrit2?Tru1Oseek1’f.close()ú§ÔrÔ¢ÓÔ;/a+ÕLÔ <oisatty:Øú if sys.platform != "win32"Ô é ë"/dev/tty", "aL1îexcept OSErrorj$ð # When run in a cron job ¡ùe just aren't anyX?ð# ttys, so skip:Çð. This also handles oXGÐOS'es that dor„support é.9MpassOelseòÓ å:Do5ÿÝdarwin" and \¿6À 'bsd' not� B7 1.÷ .startswith(('sunos', 'aix')cu•# Somehow�” appears 6Î on some BSD…J9AH:€q‡IkfinallC“os.unlink=ŽˆýInvalidModeString•’# check i*r mode s,Ô2forQin ("­U0wU+!rw+t"Š õy Äý_Value9À else:  ªf.close() ñ self.fail('%r is an invalid file mode' %!) @ðdef testModeStrings(H!):c#!‚ that thF  attributehñcorrect for variousd" sRKõgiven as init args6tryuyO³-ð [('w', 'wb'), ( +erb+'),RE V('w+b*@ ('aaUaE !abo�aUrUrUG ro(0 ('½!, UrU*)]Õa# readhÒs are last so©ýTESTFN will exist first�Bwith9rFileIO(9,X@[0])­fƒ)ð.assertEqual(f.°=&1]¤kfinallá±if os.path.¤s~}g”os.unlink# ¿¾UnicodeOpen¿ñverify repr works©u3E too9f = 4strpW, "w"Ð †¢ _Bytes ping a b%¬Ename—Bn = ª0.enúw("ascii¢sexcept E&ZErrorÌÄòskipTest('could not Xq %r to ];u 2+fn)¼Ç.write(b"abc°æÜ¤oÛ~o, "rb"™Ñ •)L(), s•ÈP@unit*.- If(sys.getYasystem1ÿing() != 'utf-8'�"JX only’2þQs¤OUtf8G_UTF-8M!…_UNICODEUŇ¡U:]U}]k†e[v–Àef testConstóructorHandlesNULChars(self): õ fn_with_NUL = 'foo\0bar'!0ñ .assertRaises(ValueError, ‡FileIO, Lo, 'w')E!jbytes(Ksascii')UVüdef testInvalidFdÙš¸?-10« /OSíÖmake_bad_fd()?ö if sys.platform == 'win32't{Ñimport msvcrtÒ¹�.‘.get_osfhÚ+, ŠMüBadModeArgument%ð# verify that we get a sensible eæó message for bad mode aSo¸ ¥= "qwerty":tryÿ8f =<€(TESTFN,__EQvexcept uz as msgP ifÚ.args[0] != 0!¢suftr(msg`2if …b in s ëŒA notR9°`fail("3i£7š: %s" % s�+# Áñ== 0, we're probably on Windows where temay bel”ð# no obvious way to discover why open() ·5ed.<JelseæŠf.close(°ô#no&ë!) gšŒTruncate“ P‚f.write(-÷array(range(10))“­ øEqual(f.tell(), ù4f.t“5î='÷seek(0, io.SEEK_END), [q1K¯& q[Í‹#On_ ”´§bug801631(>lòSF bug u3u# "fileu` faultäwä>/) 1&× •f7'r+Í@çdata = f.read(˜1if 0!= ›s—+5):,î‡`("Read¡!edscupdate¬0 %r@`¥Iðif f.tell() != 5:  ø'self.fail("File pos after read wrong %d" % f.tell()) EÉf.truncate()%if3i != 5:C}fT‚Lclosðsize = os.path.get}(TESTFNª¦+$§!%:tryû—bug8016311kfinall)•os.unlink¶Cðdef testAppend(F)b of3penEj, 'wb'íf.write(b'spam_VaVOeggsV$rV`d = f.ž?N/f.¨ò.assertEqual(d, ç •‚ Mi—fexcept�Bpass:À¼InvalidInitŶñRaises(TypeError, ®ÓIO, "1", 0, 0r]ŒWarningsZÄwith check_w#úquiet=True) as w½oB$w.:J, []J-¹ :©gOValu!r/some/imÏ/name", "rt"º€ |!UnmadFDOnEòfÓ@os.o¥�__file__,º†O_RDONLYª`_&, |&fd5#osòfd) # should not ô!OS[’(EBADF) Ž`COtherÍjTests(`, unitˆ.CCase{2ƒIO = _ioÅì`module‚ = '_io'Ñ@cpython_only*åZ"±Fd_overflowðh<Ñ# Issue 15989<€import _Dàcapi sðelf.assertRaises(TypeError, sóFileIO, _testcapi.INT_MAX + 1) ,I!@IN -Ià class PyOthervjTests(`, unit‹.aCase):…2²IO = _pyio.ámodulename = '€' def Ic_main(Fñ# Historically, these'ñs have been sloppy about removing TESTFN.tò# So get rid of it no matter what'2try¾FDrun_Þ`(CAutoÅçZs, Pyf6 C. O±0finß{àif os.path.exiwÍd£os.unlink(p if __\@__ =_O2__']a -ðBEGIN PRIVATE KEYðÿÿÿÿÿq- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDH/76hZAZH4cSV CmVZa5HEqKCjCKrcPwBECs9BS+3ibwN4x9NnFNP+tCeFGgJXl7WGFoeXgg3oK+1p FsOWpsRHuF3BdqkCnShSydmT8bLaGHwKeL0cPxJP5T/uW7ezPKW2VWXGMwmwRaRJ 9dj2VCUu20vDZWSGFr9zjnjoJczBtH3RsVUgpK7euEHuQ5pIM9QSOaCo+5FPR7s7 1nU7YqbFWtd+NhC8Og1G497B31DQlHciF6BRm6/cNGAmHaAErKUGBFdkGtFPHBn4 vktoEg9fwxJAZLvGpoTZWrB4HRsRwVTmFdGvK+JXK225xF23AXRXp/snhSuSFeLj E5cpyJJ7AgMBAAECggEAQOv527X2e/sDr0XSpHZQuT/r9UBpBlnFIlFH+fBF5k0X GWv0ae/O6U1dzs0kmX57xG0n0ry6+vTXeleTYiH8cTOd66EzN9AAOO+hG29IGZf9 HAEZkkO/FARc/mjzdtFnEYsjIHWM3ZWdwQx3Q28JKu6w51rQiN51g3NqOCGdF/uF rE5XPKsKndn+nLHvsNuApFgUYZEwdrozgUueEgRaPTUCNhzotcA9eWoBdA24XNhk x8Cm/bZWabXm7gBO75zl3Cu2F21ay+EuwyOZTsx6lZi6YX9/zo1mkO81Zi3tQk50 NMEI0feLNwsdxTbmOcVJadjOgd+QVghlFyr5HGBWMQKBgQD3AH3rhnAo6tOyNkGN +IzIU1MhUS452O7IavykUYO9sM24BVChpRtlI9Dpev4yE/q3BAO3+oWT3cJrN7/3 iyo1dzAkpGvI65XWfElXFM4nLjEiZzx4W9fiPN91Oucpr0ED6+BZXTtz4gVm0TP/ TUc2xvTB6EKvIyWmKOYEi0snxQKBgQDPSOjbz9jWOrC9XY7PmtLB6QJDDz7XSGVK wzD+gDAPpAwhk58BEokdOhBx2Lwl8zMJi0CRHgH2vNvkRyhvUQ4UFzisrqann/Tw klp5sw3iWC6ERC8z9zL7GfHs7sK3mOVeAdK6ffowPM3JrZ2vPusVBdr0MN3oZwki CtNXqbY1PwKBgGheQNbAW6wubX0kB9chavtKmhm937Z5v4vYCSC1gOEqUAKt3EAx L74wwBmn6rjmUE382EVpCgBM99WuHONQXmlxD1qsTw763LlgkuzE0cckcYaD8L06 saHa7uDuHrcyYlpx1L5t8q0ol/e19i6uTKUMtGcq6OJwC3yGU4sgAIWxAoGBAMVq qiQXm2vFL+jafxYoXUvDMJ1PmskMsTP4HOR2j8+FrOwZnVk3HxGP6HOVOPRn4JbZ YiAT1Uj6a+7I+rCyINdvmlGUcTK6fFzW9oZrðÿyvBkjcD483/pkktmVWwTpa2YV/Ml h16IdsyUTGYlDUYHhXtbPUJOfDpIT4F1j/0wrFGfAoGAO82BcUsehEUQE0xvQLIn 7QaFtUI5z19WW730jVuEobiYlh9Ka4DPbKMvka8MwyOxEwhk39gZQavmfG6+wZm+ kjERU23LhHziJGWS2Um4yIhC7myKbWaLzjHEq72dszLpQku4BzE5fT60fxI7cURD WGm/Z3Q2weS3ZGIoMj1RNPI= -----END PRIVATE KEY-ò Certificate: Data ñVersion: 3 (0x2)#ÖSerial Number0ñ82:ed:bf:41:c8:80:91:9d;ñSignature Algorithm: sha1WithRSAEncryption/OðIssuer: C=XY, O=Python Software Founda3õ CA, CN=our-ca-serverH…Validity]ýNot Before: Jan 19 19:09:06 2018 GMT1èAfter : Nov 281)271tSubject¼ÿL=Castle AnthraxÎ ËÅfakehostnameˆWú Public Key Info†k?rsac 4ö-Key: (2048 bitô#zModuluspÿ00:c7:ff:be:a1:64:06:47:e1:c4:95:0a:65:59:6bB9*ð a8:a0:a3:08:aa:dc:3f:00:44Bc^4Bàed:e2:6f:03:78�÷ d3:67:14:d3:fe:b4:27:85:1ì¾ñ02:57:97:b5:86:16:8°82:0d:e8:2bå 69™>€c3:96:a6öÿ47:b8:5d:c1:76:a9:02:9d:28:52:c9ðd9:93:f1:b2:da:18:7cüq78:bd:1�12:4f:e5Bð 3f:ee:5b:b7:b3:3c:a5:b6:55ƒPc6:33ìOb0:4Bða4:49:f5:d8:f6:54:25:2e:db:4b:c3H#64#€bf:73:8e‰8@5:cc°b4:7d:d1:b1�_20:a4ÆPae:deA 41Ï€43:9a:48½�d4:12:39+?8:f 91&† b:3b:d6:75 !62¡ß5:5a:d7:7e:36„€10:bc:3aþP46:e3“ÿc1:df:50:d0:94:77:22:17B±a0:51:9b:afÍ 4:60:26:1d½A04:ažO06:0 57N 1a5 4fP19:f8iP4b:68 P0f:5f˜Œ.0EAbb:c�P84:d9ÿ b0¡€1d:1b:11¡B€54:e6:15„!af*€2b:6d:b9î 5dp/01 74Z a7­„P2b:92T e2Y 13x 29<„]92:7bðExponent: 65537¯ð10001) X5÷09v3 extensions: !X5ù Subject Alternative Name: .9ùDNS:fakehostname!OùKey Usage: critical'Hðigital Signature, 7ÉEncipherment4[EÉ1ded-d (\ðTLS Web Server Authen‡dtion, kClient MuÿBasic ConstraintsØ�CA:FALSEHgé Id“OfiereòF8:76:79:CB:11:85:F0:46:E5:95:E6:7E:6ÿ2:5E:4E:AA:EC:4DxQority6z °keyid:9A:CFð6E:EB:71:3D:DB:3C:F1:AE:88:6B:56:72:03§‰08:A7:48€�1DirKð/C=XY/O=Python Software Foundašñ CA/CN=our-ca-s½ Oùserial:82:ED:BF:41:C8:80:91:9B 0øbInformfoAccessvñCA Issuers - URI:http://testca.p¹ C.netÙ/pycacert.cer}üOOCSPLZocsp/ÂÁCRL Distribu+"Poˆ .tBFull½ � ÖQrevoc/B.crleª@ AlgOðhm: sha1WithRSAEncrypžyð6d:50:8d:fb:ee:4e:93:8b:eb:47@€ba:38:cc‡e1:9d:c7£ðe:1f:9c:22:0c:d2:08:9b:ed:bf:31:d9:00^Paf:8cU€à78:92:d1:7c:ba€P81:7f?à1f:f4:68:99:86?xc6:cb:5€Pd3:b9dà12:fa:75:53:fdŒP32:21Þ÷af:6b:4c:b1:34:36Àðd1:a8:25:0a:d0:f0:f8:ƒdÀ°58:6e:af:e3Øxc4:32:8€°79:d7:cd:adýà56:f3:15:27:10 f9± 59˜dO€5d:4d:07âP7a:e5@ 97À bc€b4:f1:17^‡33:55:28Àñ66:7b:70:d3:a5:12f¥àed:e6:13:20:2dÛP9e:ecL€P64:cf1€13:14:1bØðba:64:ac:c5:51:b6á 13$ 93F@ñ fd:43:09:a0:0b:44:6c:77:45bÒ ed¡ b2[ dc@ð4a:5b:73:5f:c1:fcý 631 f8̰ca:3c:98:06$ fd @Pd1:e4è 61P09:8fƒ 18= 98˜Pcb:3fd7 3@Pf5:a7À2¢ 5:63:1c:ff a6›P8c:e8ŒP84:3d�€P38:0fAe0:5k°f9:18:05:23ñP39:dePce:8egða6: 6e: f5:4f:c3 -ðBEGIN CERTIFICATEó·- MIIE9zCCA9+gAwIBAgIJAILtv0HIgJGdMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODAxMTkxOTA5MDZaFw0yNzExMjgx O5MGI—–QRcwFQ–ñHDA5DYXN0bGUgQW50aHJheDEj MCE‚ðLCgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xFTATBgNVBAMMDGZh a2Vob3N0bmFtZTCCASIwDQYJKoZIhvcNAQ9÷ÿ‡ADggEPADCCAQoCggEBAMf/vqFk BkfhxJUKZVlrkcSooKMIqtw/AEQKz0FL7eJvA3jH02cU0/60J4UaAleXtYYWh5eC Degr7WkWw5amxEe4XcF2qQKdKFLJ2ZPxstoYfAp4vRw/Ek/lP+5bt7M8pbZVZcYz CbBFpEn12PZUJS7bS8NlZIYWv3OOeOglzMG0fdGxVSCkrt64Qe5Dmkgz1BI5oKj7 kU9HuzvWdTtipsVa1342ELw6DUbj3sHfUNCUdyIXoFGbr9w0YCYdoASspQYEV2Qa 0U8cGfi+S2gSD1/DEkBku8amhNlasHgdGxHBVOYV0a8r4lcrbbnEXbcBdFen+yeF K5IV4uMTlynIknsCAwEAAaOCAcMwggG/MBcGA1UdEQQQMA6CDGZhaºP ZTAOØpHQ8BAf8 `CBaAwHAàR0lBBYwFAYIKwYðHAwEGCCsGAQUFBwMC MAwIµdEwEB/wQCMA=ðLOBBYEFPh2ecsRhfBG5ZXmfmnLEl5OquxNMH0G A1UdIwR2MHSAFJrPz27rcT3bPPGuiGtWcgPLCKdIoVGkTzBNMQswCžðQQGEwJY WTEmMCQ†_ECgwdÏ�gQ0ExFjAUû Ô÷W91ci1jYS1zZXJ2ZXKCCQCC7b9ByICRmzCBgwÅQEEdzB1MDwG ðzAChjBodHRwOi8vdGVzdGNhLnB5dGhvbnRlc3QubmV0L3 ö RjYS9w eWNhY2VydC5jZXIwNQjó MAGGKWh0dHA6Ly90ZXN0Y2Euc¶e† dC5uZXQr 29jc3AvMEMúdHwQ8MDowOKA2oDSGMmQ R Qs3Jldm9jXuY3Js( )ñÿTA4IBAQBtUI377k6Ti+tHVro4zIDhncfhnh+cIgzSCJvtvzHZAO6vjFZ4 ktF8uk6Bf4If9GiZhpHGy1fTuUES+nVT/SIyIVCva0yxNDbRqCUK0PD4gX1pWG6v 49LEMod5182tDFbzFScQDPlXWVMA7a9dTQeGeuXzl4i8hrTxF0YzVShme3DTpRK5 T8ft5hMgLfCe7Bdkz/0TFBt2umSsxVG2zRMKk7H9QwmgC0Rsd0VDC+XtcLJ23AhK W3Nfwfx/Y3D4uco8mAZf/ZjR5OZhXwmPbBiGmJzLP3N7Pzj1pwkg7qVjHP+LptGM 6PSEPZk4D8zgUgP5GAUjdjneUs6O+6Zu9U/D Å>ENDÙð # Test the windows specificö32reg module. # Onlyó>functions not hit here: FlushKey, LoadKey and SaveKey import os, sys, errno àunittest from  0sup8?’threading*„platform.ðmachine # Do this first so test will be ðskipped if module doesn't exist support.im!_m$ð ('winreg', required_on=[¢']) # Now 3ò everything from ;ô* try: REMOTE_NAME = sys.argv[ ð.index("--remote")+1] except (IÁError, Value )ZðNone # tuple of (maj8ãminor) WIN_VER„ðRgetwindowsversion()[:2] # Some tests should only run on 64-bit architectures where WOW64 will be.p�64_MACHINúATrue‘ñachine() == "AMD64" else FalsÃòStarting with W¨e 7 andòServer 2008 R2, ~ñno longer uses # registry reflectionG`formerØðed keys are shar=•nstead. #uƒ ;Mð 6.1. Due to this, somežYfVàvalid up until7ô HAS_REFLECTION = 9Á‹< (6, 1)5ðUse a per-processÑ€ðprevent concurr ßÒàs (buildbot!) É€ # stomp~ðon each other. 5ö0_key_base = "Python Test Key [%d] - Delete Me" % (os.getpid(),)D1namDÑSOFTWARE\\" +wcó # On OS'es that ¶Ëw®¥ž0a!Ôtÿ]|Classes…?�data = [ÒR("Int� ",ã2 45  ³REG_DWORD),KWQwordMÿ0x1122334455667788[KQK0Str·2Val—B"A sRvaluežK%SZ“H`Expand5à"The path is % %JHwEXPAND_ObMulti-Š8À["Lots", "of"§3s"]òOXMULTIN€Raw DataJ‚Àb"binary\x00¦ NeBINARYéBBig í6Ó"x"*(2**14-1)… D LâHB†HbIG  H ”Q# Two¡ three kanj>ñmeaning: "Japan"# Sese")M ese 日本^ Q語",o·@] cóa BaseWöÆ`s(unitJ.qCase): \ãdef setUp(self�²# Make sure¦"th?`is abssTwhen S>sì%s._!.dCö _tree(HKEY_CURRENT_USER,'Ê)¡Àef delete_tró ee(self, root, subkey): 6try øhkey = OpenKey(7õ, 0, KEY_ALL_ACCESS)Iêexcept OSErrorT#xõ does not exist<xereturnªwhile TrueK °<2subÙp = Enum¹È6, 0¡)¥ “# no more±s�Ybreak_Ò.delete_tree(z”‚TCloseœD<m!) f€def _wri]‡est_dataÒD_keyÖ€str="sub!",>² PCreatˆ= õ# Set the default value for this key.]@SetV(y0, t§økey_name, REG_SZ, "DO"ÿp‹J1q`assert (‘˜handle !=ò"# V aÏE-key¸'# =#~ Kpa# Give0subG` some àds­k(2 ·,,‚_type in) âS3Ex(¦9q„THG2…ð# Check we wrote as many itemswÑVoughtÍ�nkeys, n_ó s, since_mod = QueryInfo*�cEqual(Gb1, "NoKðcorrect number of‘Js I‰K &I�È`Ì0Ì7Alen(#³§= ò!# \¡ Vway..ß # (but befá±we do, copyÛ‡òas an integer -FVallow q# us to¾B thaá>Ðreally gets cë&d)}Cint_o =cÝ}Ã_( õ Ž[3Qñfail("It appearsík¢) functionœ""A"µÕ@`actualÁ!x^ 8pasDr... and(GCPfway :-Ëà7¿¥ûÌ(/àtry: ÷ QueryInfoKey(int_key) ù!self.fail("It appears the key.Close() function "=H°"does not c3A`actualH&!"uùexcept OSError:PQpass ðdef _read_test_data(«Q, rooÇð, subkeystr="subÛ³", OpenKey=)að# Check we can get default value for this².†àRval =IV'(�›†key_nameâ¨ø.assertEqual(val, "Dm%",ae ñ "Registry didn't give backWccorrecµ"")0ATkey =§a# ReadS@sub-K”EwithJ7keym@) as{p]€aI`Ðenumerate oveYegs[5•index = 0|zwhile 1`>try"r = Enum§!, bž-ˆ Ybreak™ à|1in  o, TrueãG""DâêâP P?6Ö" =ÞI + 1§ £/`, len(VQ)¡ �zûnumber of itemsž  di­ály access each7 °{…K,*¥ Xtype dE_l 9typ¹5Ex(l <NX7’; ¢a"CouldKrJ 95}8typ}=îš#OÅzur mainÐszf.0WÒOÁ1, "Œþg wrong# ûìr1rH×±Was able toõ€a secondÊÿ when I only have one®r/“ÃodeleteÅ´Óð , 0, KEY_ALL_ACCESS)  ð&sub_key = OpenKey(key, subkeystr, 0, KEY_ALL_ACCESS) 9ò"# It is not necessary to delete the values before7ingC%‚”(although}Q must\£exist). WB[mE manually j4öto prove we can :-´2for”c_name, Ddata Ðtype in test_:iõDÜV×(>:R%) .nC2, nð, since_mod = QueryInfosG¥óself.assertEqual(KB0, "›Impty[/e"E ‰G"v.Close(_¿ 2:try<÷# Shouldn't be able/•it twice!Bph2afail("™1ingZU§ succeeded#êexcept OSError¬Epass‰?key@rootF,41key],#^”sP now ®ë ,º–c CgQ openAnon-Fent keyP # Us`@is e Ö¥ this timeq$Qdef _2@all(‰&, ´´@str=¿+&")n.r._writeCu(>Q3Oread2™4 Òcd_argsÙñÉÈðwith CreateKeyExK=,=éÑ, reserved=0,mM  acS=~{ as ckeZ2PTrue("Ç.handle != 0–§î¥-£o£" £÷ class LocalWinregTests(Base"):eutÒregistry_work¦˜ô�HQÌCURRENT_USERWS*¢, "日本-Ò"W‰ý_extended_functionœ£# Substitu0vregularHA and?¡Key calls ÂUtheir=$# lç counterparts.!ðNote: DeleteKeyEðx is not used here because itóplatform dependent øcke = lambda key, sub_key: CreateKeyEx(õ, 0, KEY_ALL_ACCESS)Pðself._write_test_data(H/ÖCURRENT_USER,^e=cke) Ao‘OOpen�LREAD‰Oreadˆ U)=o†ÇOdeleÈ ¹Adef îðnamed_arguments(H%):Ý.�*sM@key_'Õñ# Use the regular D£õKey to clean upp# �Ex takes R d args andmÕed separately@^¤5 ýconnect_registry_to_local_machine_work!Q# per«’minimal CIRHgð which just invo×iÔ3=l2ð SetValue(key, 'changing_vå', REG_SZ, s) Dñthread = VeryActiveT+()$h.start*ryüõwith CreateKey(HKEY_CURRENT_USER,R ûtest_key_name+'\\¿{) as kesEúfor _ in range(1000)™&Ðnum_subkeys, ðs, t = QueryInfo¼6key;mimEs8Òw = Enum ia1‹+A6[0]1kfinall �y = TrueiãW.join¾hODele¬ ‘ eK}2defc ‡key(selfFÀ# Issue2810,qð2.6 and 3.1 when the õ was exactly 256œÑ# characters,ƒ÷Key raised "WindowsError: More data isA¥available"s&mt÷ä ÛÏ6'x'×™ë(¬6, 0_yü B'\\'|(R,¸&))\·K @ GpdynamicCJ ;üC is :Q° generated,_sI#43  ) °8 !hé.ùPERFORMANCE_DATA|‘except OS¯ | if e.errno€( ƒ.EPERM, WACCESet|ñ.skipTest("access denied to registryq;à"(are you runnQÐin a non-inteŽêive session?)"�3 "ExS%#""ð!# Reflection requires XP x64/Vista at a minimum.Ðdoesn't have ñBthis stuff # or DeleteKeyEx so make sure their use raises NotImplementedErrorGñ.@unittest.skipUnless(WIN_VER < (5, 2), "Requires Windows XP")B@def Añ_reflection_unsupported(self):+¸6try ‘with CreaÉò(HKEY_CURRENT_USER,^úkey_name) as ckDHhõ.assertNotEqual(ck.handle, 0) „/ßkey = OpenKeyv <k?keylã5R”.(N”)¥…DisableR^°2key~"c*/EnbM_QueryÃI Íkfinall‘KI±setvalueex_l_rangeñ# Test for Issue #14420, accept proper <s'@SetVX1Ex.qñö# Py2Reg, which gets called by 3ð, was using PyLong_As,LAthus+&�OverflowE&ƒ. The im<aà@ now]sB[€Unsignedc t•ötch DWORD's sizeÅ hD1a(ck, "ÓqÑ", None, REG_Çb, 0x80†L<q2F’ex_returnUOb6759, 5# u�¡ int from �QoReg2PyQ5S`1!a ©rgeneratŒ@FromR7T¤DWval =2&~zÀ None, REG_DûWORD, test_val) !re , ñ type = QueryValueEx(ck, "@^name"Bôself.assertEqual(Jp, REG_D‚6?val¬‰finally:½ó DeleteKey(HKEY_CURRENT_USERD@key_´!) 92def@setvÝðex_crash_with_none_arg(Ð)lð!# Test for Issue #21151, segfault when None is p ƒd to SetDx+trÅz_ CreaÊf as ck�U´„#No‡Îck.handle, 0€ÒQval =»£N¾ 2, 0ÚcBINARYm]cƒÞ”^Sðread_string_contain Onull[i[a25778:7ãSZ should not I Fµ characters¶Yƒ2"A Q\x00 ìaÃ"¹ko/SZkj/SZgû1Ç/` @unit»ñ#.skipUnless(REMOTE_NAME, "Skipping remote registryü±s") class R`Winregágs(Base+):7P_Pl_worksÓ%ãkey = ConnectR‚ © ¶_¾_ç0_alPÉ_key) ÀWIN64_MACHINÏx64 specificWWin64ñLd#]umentû¶*s�ÿñ# Clean up and also exercise the VB arg€D ðEx(key=HKEY_CURRENT_ðUSER, sub_key=test �_name, ñaccess=KEY_ALL_ACCESS, reserved=0) 8Adef Oáreflection_fun �s(self):)dð## Test that we can call the query, enable, and dis  PIñon a key which isn't onK‹õ list with no consequences.L�OpenKey(HñðLOCAL_MACHINE, "Software") asuÒÖTHKLM\&ó is redirected but not •`ed in õEOSes…H-Ð.assertTrue(QRWŸ_key))5�IsNone(EB8Dn9¦ §P@unit ñ.skipUnless(HAS_REFLECTION, "OS doeÃesuppor/Bion"ñi_³reate, openUPeleteÆsŠ{a32-bit°ˆð# area. BecauseªÑare doing thi8}0getó&edP#“adifferza of 32á 64yŒabeforePafter7“?òion occurs (ie. wheôcédL�vclosed)æ:try¶÷C6RKeyExû‚CURRENT_0¹_z0& 0ã0 D50 | ±WOW64_32KEYG±W ™O —NotEqual(1P.hand&†4A# Thàñ should now be availPi3÷íiE W+ke«•?key ðWrite a value to w�currently. on@SetVF(ExŽñ, "", 0, REG_SZ, "æ""¾œ+isguntil å™ÇÆDH?Aversf4útú>yetMÿ_fail = lambda: û +�A$ O?IREADJ 64J Ž$ÀRaises(OSErr÷or, open_fail) ñ# Now explicitly)ñ the 64-bit version of9key@ù*with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,F‘ EÁALL_ACCESS |ýWOW64_64KEY) as key:Cðself.assertNotEqual(key.handlv)3±# Make sureàð original value we set is-re?roð"32KEY", QueryVEƒ_, "")~’Set a newqó, which will get ;€ed to 32“ …1Seti$Exka¡ REG_SZ, "6"ùR–Ýðuses a "last-writer wins policy, so¤ ‡A# on"6Âkey should bY@same%ÄDDIREAD>›>Ì9Ì f/lŽ¿DeleteKeyEx RÃ3, 0ÍP@unitcõ.skipUnless(HAS_REFLECTION, "OS doesn't supporWBion"–2def¬tdisable´@ion(å)n30usea‹¶ögets redirected andÁÞ+tr-OCrea2H B:LKc{dŸæ>#Ê-ñ Key returns whether or notú3is GdöL/ =Y(‹˜3ˆß¡Ttype(Q~), bool7ð# HKCU\Software\Cl#sÕ^­by default²wGFalsr K§D> .ÕQTrue(8@ùlQ# The‚³is now closzw€normallyˆïtÐ ë#ò÷area, but let's m!`at didJyhappen.Ce¤ = lambda: =Ï唩H À  °KEY_READ | ÓWOW64_64KEY) #ùself.assertRaises(OSError, open_fail) 3ð# Make sure the 32-bit key is actually)re9ðwith OpenKeyEx(H™ùCURRENT_USER, test_reflect_key_name, 0,H¹G ë 32ë0 as˜:?÷ðNotEqual(key.handlr&0finÐ DoDeleteÈ †Ä¢·3, 0s2defðexception_numbers(Â)•\ ÍÁFileNotFound×)6ctx:…£QueryValue–ðLASSES_ROOT, 'some_võ _that_does_not_exist') ©Smain(˜ðsupport.run_unitÞø (LocalWinregTests, Remote)g Win64+q) if _(�__ == "__„2__"ãòif not REMOTE_NAME÷rprint("�ñ registry calls can beœed using"ˆ "'Ô!_wÏq.py --rÎÁ \\\\machine�"'"R0¡³() # These ÓÁ are used towò floating point binary-to-decimal conversion.NyE baF on„B TCLNpsuite (‚ps/expr. €), which¼8" #2ðdata from: # BrigÄð Verdonk, Annie Cuyt, Dennisðschaeren, A preciŸñ and range # independent tool forqëô-ôõarithmetic II: Cñðs, # ACM Transacðs on Mathematical SoftwXð27:2 (March 2001), pp. 119-140. 0E0 -ñ1E0 15E-1 125E-2 1P3 106Q4 103a5 1015q6 100787 "39.8 219529B09766!10B4882;!11R24414@!12S12207w1‹ƒ00061035€1–“000305175‰1¡£0001525878’Á16 +8E153 -1’+9E306 -2ñ7E-304 -3E-49 +B3 -6 9E43 -9E44F!30F)0287GÀ-204 +2E-205,ñ-47 +34E195 -68ð+85E194 -67E97 +93E-234 -19E-808 -3Ñ8 -69E220 +18‚ 36ñ+61E-99 -43E-92 +86`-51E-7… 83E85 -566`+589E1¦P839E1Ë2744z@+930 @5 -1GŽÑ+604E175 -302 p+755E17©"51 66ër13 -408wð510E-75 +6782E55 -2309E¢P7963Eé@3391@+790¾ð 6 -7611E-226 +4907E-196 -554…ã11 +5311E241 - ð3 +5311E242 +9269ðE-45 -8559E-289 +869 ðJ76 -8085E-64 +74819E201 -82081E41 +51881E37 -55061E157 +77402E-215 -33891E-92 +38701E-215Bñ*139E-76 +75859E25 +89509E140 -57533E287 +46073E-32 -92146 ð+83771E-74 -34796E-2Mð584169E229 +164162§p-328324 ð+209901E-11 -4198ª 11 +940189a2 -892_0213¡ñ7803E120 -252601 + ’1 -505202P97081é€64 -6548êð60 +289767E-178âC9534 ñ8823691E130 +9346704Å‚-1168338 `606336¥ 36P@6542i 25Pñ83893E-127 +2572231E223 -5144462 ð +1817623E109 +6431543E-9Â`444097¹p +80769±121 -999764³0 +50609263îq0589528½-Ê00E1ƒÀ87575437E-31>s3135572¥P85900@ð177 -84863171E1u 68761586E2ù`504640Ù°86 +2786914ª4Jð 5738294E-248 +70176353E-53ÀR555086°-491080654Eס+526250918j¡-245540327¢-175150874¾¢+350301748€-4378771 3B°458117166E5¬€16234332 +229058583Ð-525789935E98Q29268z2ˆa658537ÑÌ�667284113á 0 -9712126c°126 +998139<PE-182�ð35231965E-156 +86@6048`637114� 55 ð18488827E79 -3981006983E252 +79620e6ð-4713898551E261 +871538žÑE-58 -9078555úi´0ü�423338424CT¡4667684902eÀ+23792120709qÐ5 -7856402151Š‘718120548Úá88 -3031116363ä`Á1803914657E2ˆÁ6314223356E-žP181577"78@-4530919D 10Õñ 8380362293E218 -6857630156™ºÐ52918668151E7Çà48357443505E32´�486500490¿8Ö 6973000981Ã8Žð 97015418417E-93 -9156540493¼€28 +1785Lð 6339E169 -742522891517E259³ ²570973126786Ñ3113521449172Ù+³P901815ñE217 -1556760724” 18w 9787850756X9Ì 24Q029157€9 +362371457 `0092“@9832×@00 +´p8579205 “¥Ð59360849E94 +(à845954547E49 -*�691909094Ð+556032250192ø^À7812878489267æ 4393985330.À256 -2780161Õ3<ð87605699161665E155 A2113À3 +°82181013635­0170ñ 63ìP31162üñ15 +35593959807306CÐ-5339093971091â71187919614612(0889Ç‘9518265E2(°70036656188± 73²°40073312377kð 2 +61602932495116E-72 -308óR01466247558E-72 +834735494917063E-300 -589795149206434E-151 +475603213226859E-42 -294897574603217+ð 850813008001913E93 -2034gñ 2043339E185 +406898344086678ñ-813796688173356ñ.+6045338514609393E244 -5145963778954906E142 +2572981889477453ð&-6965949469487146E74 +6182410494241627E-119 -85103094Fð6985E-277 +6647704637273331E-21ò215901545757777ð+3771476185376383E276 -3729901848043846EC,ð7 -9977830465649166E�ð+8439928496349319E-ö`-82042uð2070882E-59 +885368Ç7œ9à55327427228855Dð04 +36149023611096162E1.ÿ 7 +18074511805548081E146 -Ð7 +9733877413­ 42>ð90 -8813380980495v†P8 +94@¡5590268239»Ið4691002732654881´à5 +52306490527&ð 14E49 -26153245263757307ð +55188692254193604E165 -�ð5865317742005E164 +2717625800531916Šð 61 -73169230107256116E-24º 14v�763407014?Œ°54352516010Zò8261 +586144289638535878E280 -601117006785295431E245 +2930721448192679390 9531847132)`6652E2æ!90ð58290366539E-281 -55703p1898546_294 +210 -- 4100507554‰@-238$ð2104041512242479E19Jñ16312124536727437ñ+544208083024484958�-79264492óð 378159E78 -67940645013297917TM63 +Tð 0E-262 +740025369568292019k5Ÿð50063423920730049E215 +370012684784g1098ð -9250317119603650245E214?ð960943005697796�0252(ð076650850032962°75 +7015330×ï06592562E-75 -€4 +718566Ð4951919351E20ɰ36052020756c`395E19Œ`178999y`451517ª`184 -8;à89486201567102­ð8 +434554474310078355 ð18 -43579983706903034²NÐ+598252673491Éð2461E177 -6225914h€57791E47ë@3801dÁ7038565599E2|3ñ 8 -33584377202279118724E-f 57;P63479q…5Ð0E204 -143712q¢99038387024ð369920847601776241Ë3ð73984169520355248354E-Ð+992577632277ÛÐ’ñ-873363624251825476Åñ80 +7E289 -3E153 +6`-5E243!-1_0E-1¿q8E-63 -œ±3 +8E126 -4P+5E12 @8E-1,ð2E-163 -4E-163 ð+51E195 -37E46 +74ð-56E289 +69E-145 -70E-162 +56 ò1 -21E-303 +34E-276 -68 0+85 P7 -87 ð 4 +829E102 -623E100 +723I€2 -457E-B+914 !-3P35 +1¡^ò302E176 +921E90 -6048-p206 -46U 14•�q4 +9968s|¡0E99 +1246ð+6676E-296 -834·`97 +16ø0333Ið96 +3257E58 -6514 S+2416ƒ0ô063 º04E-*A1617 0-64�53418E111¿â513E160 +26709�99447E166¦Ð549E48 -25098 `+50196 ð -62745E47 +83771E-73 -97451W0663q03 -755ÒÀ54 +473806E8/P47612 €+292369Ei 58# P+9335Ä¡140 -72091p +53500j€49 -89052°�548057E814p6181E88`0997E1¥�320681E63Ëñ8609E-261 -3022ަA1511z €4691773E‰p9383546 p+305994@ 43 -611989®!43¢0662Ýà13 -4877378E-1 77âÐ3E223 -545286Ÿò9 +4590831E156 -9181662 `371443P‘61 +464300²62 -7428872Èp+529421bÐ30 -27966061EG°+26471073E1‚55932122ð95412548E-99 -4770äp+238531Ѐ78493654�ð 1 +65346417E29 -51083099E16ð9396333E264 -84863171E1#a595408Ó5®B4426Ô°52 +1488520]P29770¼ñ-251 +982161308E122 -245540327p+491080¡0+52dp622E-31Ip7183711¬3`085808P53p6272631a 10&°3091487E209ð3777767E273 +8421162È5ë 41ï 02`950724 `84 -95J2 Ê@0E12Mr6778560~¡ -35737968K—P71475ð'0981fî0181) 68P35E276ÎB1068²¢1307555534€29906711Ñ1Ú�149533557P90 +5c 42p-"@7476©v0191a€25968419Žj0932Gp7727E-4Ü�112984209 #�47584241Øð314 -79360293406E9îð 7332259349E225 -5720232611yÁ6860597053E-…¡5382701064¿F@1074©?6?�7636765E2ð508006109412E20`±54003054706ð+561029718715E-Z€897647546ðE-71 +1122059437~ 71„q3947086aÐ236 +80918470V@E116×3P17422¼Ñ+286556458711ð952805821491E-259 -132189992873E-44 -17369603 9ð4 +183113275759= 07Y 55žP87995òð8 +732453103039c(¡2773388949°)ð 8188292423973E287 -5672557437938E59 +28362787189¬ð 9995153153494E54 +922478ð 6422069E-291 -3142213164987ò4 +6284426329974ð<-8340483752889E-301 +67039371486466E89 -62150786615239E197 +33519685743233E'ò<52563419496999E156 +32599460466991E-65 -41010988798007E-133 +65198920933982)ò82021977596014E)ð80527976643809E61 -7471261150520yð8 +53390939710959E2(ð69277302659155E225 +462eòð2337E-72 -23438635467783E-179 +41921560615349E-67 -92404398742674E=`+73854(ð`647197E124 -972708181182949E117 -837992143580825E87 +609610927149051E-255 -475603213226859E-41 +563002800671023§“ñ51206426453718E+°80541643265hðE202 -530658674694ûÐ159 +94657417p918E208O87ê53318553E113 -9ñ0E-73 +369617594970696O0+36:ñ6212014994E233 -1833078106007497ñ+8301790508624232E174 -10377238135780290+72�288058113ýð86 -51061856989121uð 276 +7487252720986826E-1�ð374362636049341îP65 +3)Ý`010025ž€0 -75461`020051Êð!0 +4321222892463822E58 -7793560217139653E51 +265!39b681E11Ša519878ñ1362 +7²à871414247907E76ð8839359596763261E105 +18718131802467065àð6 -14974505441973652ñ5 +73429396004640×0= 8483921078ˆP83E57üñ391519190645203E<ñ82783038381290406 +5876704370267ã@63 -× 6231831231# -129 +6440Jp7698616ŠŒ-ƒð427432277771E-19pð76592356619258326E27`à53184713238516ìð+899810892172646163E280€29167076x�13E1„à47761278967534 -3¨0644è 7982054294Mð80 +92614534461070001Œð25 -95850793189651196zñ46 +2721040415122ß0E20bð92644927852378159E}ð54420808302448495š0�`99632181Æ05E2#0305½`391668oð2E-219 -1527871695ü5c1…1ÙP783330ª2 76oð847917025255E-220QÀ395502209207»02E1û3øÀ751104603993 58' 99ð76150998265E157 -7@9051x@9597bdñ3507665085003296281i`-70153,00002562 66çÓ8762278255956íÐ1088416166048£"16tÀ870732932839½"32^P+4439³81608558002™p8780435{0711E`+22195l’080427900ô@+330ê€39519049M 2EÛ52ð524140903677624E1ü00E1¬ð1403066034001318512òx4E-73 -17538325425016481405E-74 +67536228609141569109E-133 -35620497849450218807E-306 +66550376797582521751E-126 -71240995698900437614E6p3E24 -6@+6E2-ÑE25 +1E-14 -2!+4!-8!+5(@8E27(Q27 -4 ¥° -7E-20 +56I1-70\ 515 +7XÀ7 -31E-5 +62`-94E-8øG2-812€4E23 -54G‘+63E-22 -À3 +43E-4 -86@+942_A-471."80Ø@6 -4A°21 +818E-2197t!53ÈA-857v1269…4B±6 +959E-7 -P6 +37‰€7 -746E- 4034e P3 -81UP4 +82Ú‚15 -4147= 35 -44 +…@2690È+†@2152�C+172:B7979y0688˜7Í; 18r81‚7 -55684Ó 78¢8Çß5819Q2620 › Á0E-16 +89309HP75859Ÿ- '0425ðð3 -28514E-23 +5702h 3 {à85E-24 +344863Ïp-951735 q+200677ë@4013¾:@3960Þ€1 -20990þ€1 +41980•€1 -53773r‘4 +910308�@2275Qp6 +4551Q6-A1013P96301DD@1982š3� 34\Ñ@3117táR96136À€-9191316¯€+4595658 �-2297829 `167920,’1 +337922öq6758446÷`544409;�P39996“�7 +836648”66 - .S50606ãq6521238sp+555449Š13P10409ˆp9958576k72 -Fq09783939`674881ã„a900533_‚-8195678 �87105552Hp+108881çVp2177638üÀ1 +635806667òp-670026z�‘335013307{5d`179061³V4 -37£5 +7435812ú- 5 +2024644ñ`049289%`978537³Ò+`0549841>a825790aa082476*a8 -291V‰4q3710000÷0ø’127161333%�522964699.96 +¡7 +4429943(á‘859887228„p2214971ö¸‚41768870‚+4003495“00 -GP90163JÀ3 +8723803276©b006990¸Ò0 +7283511009¡3641755504Q+8427>0•-`4 +212·!64qÁ7 -664615669ÌÒ2 +6480835553ÿ -849326796Xñ19 +6520543009406835 34^’260271504;£6266220342Y�878444467‚P8 -503"03º°1 +29392222Þ€-18 -755t3032ܱ93749590629ñùp6424857·À20 -38782415Aõ@9249A2472ð -775648301398E-23 +54707ñ5707432E25 +683844634290E24 -136768926858"ñ!509802033730E-22 +101960406746E-21 -815683253968á+7344124123524Yð"9180155154405E23 +6479463327323E27 -18360310308816ð+4337269293039E-19 -4599163554373E-J¢9198327108“ñ3 +4812803938347]@8412ZQ90011�Ñ9625607876694$Ñ4739968828249�³96971838916nÐ-736810851754�ñ0 +5146135816142Zü-77192037242133E26 +<5 -9ñ7 +43999661561541Oñ-87999323123082ð+48374886826137E-26 -5768424656711<@3 +8‰@80596ù0-75+�13005913èÒ64233110587481â77577471133384jð48485919458365E-3Ð5690859826571ñ6 +589722294620ÿðð52835804449289EMð-65641536393620Ûð3 +57933674958574gð5 -3812927649808 Sñ965265859649698Þð848925235434882Ùñ+53617761222249ÿp-424462Q17441(Ñ2760092798889¤ 7 -6089271»0369WâÐ5201855977797÷ð7 -42567837766775¡2 +8013702ÈA7119  8862627962ø0~ -506800790{0162*ð-737971479982840sàà11453806401610�7 -368985ÅP91420�Oá57595485181547&ñ+3395700941739528ÿ€41155357½0196ëó3 -823107155516392¥ð655024669619087,@6 -6�¢0464039867Ù�+43566388…B8364ï`871327q1567286„̰48810593421™ð5 -83852770718576667ëà+9948296741820ŠoE-25 -6 à44666996999461Ôµã37233349849973L +5-1  -4@+2E-¹aE-6 +4 g20 +Õß7+-Ñ001 -Ç02 -u1Œ" 97f+Ô14 -ðC4 +7æ!83&!50 250-99p+97E-10ôpE-20 +9L3f6T@-388C+521)<ˆ>;P867E-1í"+33-66ëíP13 -9¡8×02E-D�-8 +4574¦2860ú 22?b6 -481�q6529E-8'&`1 +155¾P2 -25W1K9'p16 -305S@2 +9†- 77¬�11 +5433k@-624u`5 +328X@7 -8Æ 1638Gp0 -1596p¥0193˜a0 -798\Ž1930­1-25ÿ„1988 -9ƒæ@+810¤p8 -4314S�5 +40501á½8m6™©7¦J`+72091Èp4 -6297¢Ô#57‰P-8478â¸B6544ôR73653#g R52998ß`+382928a3 -633ßXð2165479E27 -86619à16E27 +4330958 ò-9391993E22 -5767352E-14 +7209190E-15 -1441838p84789903ñ+1473062E24 +8366487%ð-8399969E-25 +936673ð 2 -9406141E-13 +65970979Añ-65060671E26 +54923002¦‘63846927EN0958«àE-21 +67488159�-6900533O�+8195678ôp-409783éò 7 +77505754E-12 -3875287Ÿ€+8277298 ²5 -95593517È‚20003698m�772686455£ð +859139907E23 -400073978—�+56901432c°4 -79426386j³5 +39713193s€38039895- 67> 73f -3374407951‘+13497631f¡-269952636t€93208059»`0 -331Ð2ôð 5 -413864905E-16 +8539246247|"-5Í"79‹‘610501014X°-3090745820“ð+3470877773E-20 -6136#8ýñ7 +8917758713E-19 -69417555460Q+9194·5¸-h@9801IÑ6 +7355920428š 3677960214 +847363434\À7 -887076627ç±6 +44353831|6Ï9»1129ر+7156349676P -894543709ÕÂ5 +178908741 Á-35781748382€ 5797344784ÌÐ9 -2898672392ÎÄ9 +768227113ÿ�976994668¤ 20Áp7486567GÀ7 -193948409tÀ4 +387896819t4Ê‘874328381€ 5432376388QÀ7 -589871938Œb�271618819'à27 -93042648038Ð9 +5208310590ù€7 -76812$0394—Â+38406213219†¡7653377498éÐ5 +7943689127Ã=`941620ü6€+7816527)Z¡9100771900à6 -45503859502PÄ 7189755109á‚0 -90669"1Â885412800393GP81461zA6299(Ã708330240314M±54165120157Ð+839492064929[5 å`575675’2›±73834002228Åá-6842292502785”°-2109568884…°25 +8438275’8³�421913776hP20014x8$ð25 -865568932260Î@2 +6}�83579682œ@-883JP63449¨ð1 +194282170752¶=°88564341505Úé°77128683011—¡Á719203724213y7+76ð0E-23 +1531595151350œMp7878376 p3 +4937l@9252Ññ5 -50940527102367Í@9875ÿQ85040uá-9958939754489r-Kq8598265RXÀ9747069569967̱35851901247(0154Çr74484260308ì4c!53n�+91099038–1985»à27174242416920j@43483X‰`7 +162>08335‹6ÄP92545ý 00]@/306262¡A3241 13P24 +9“€18290414P4 -10ÒP05420âB0828€p3966696+ð7 -280276135608ðt777E-27 +212839188833879E-21 -113817196531426E-25 +9711553197796883E27 -2739849386524269E26 +5479698773048538E26 +6124568318523113EUj`977798pð 071E-24 +632261230312801–là95586456484461Áñ5 -9994029144998961E25 -2971238324022087¬ñ1656055679333934ñ-14454887091502°6 +55824717UQ85172Bñ69780896874856465Úò84161538867545199ƒp7912358CP42586B+UÀ111246292633ñó5 -12645224606256038œä22491366370462Šò7487444828746575ßð35642836832753303E24 -71285673665506606�+43723334¼@9730L 6 +1018241P53796¥ð†4 -93501703572661982E-26 # A value that caused a crash in debug builds for Python >= 2.7, 3.1 # See http://bugs.python.org/issue7632 218316701231211ð312.23538020374420q92e-370žcnother¤ðdesigned to test©Óorner case ofžÿ's strtod code. 0.9ðe+23 import unitg‘sys from}A.sup'.õ_fresh_module, run_G  TESTS = 'V�.datetime ðer' try: pure_Os = X(I!, l4=['J�', '_strpW1'],MQ µblocked=['_I!])<Ofast‰#?w € Ƀ) finallo# XXX:Q) is ™ÈÒto leave sys.“ò cache untouched$Rð but it does not, so we hCñto cleanup ourselves.æ°for modname2 �S Óéœcs.pop(K€, None) O[&, Ÿ](qsuffixe)ñ"_Pure", "_Fast"] æ (gb) First�‘ all the -Ø s,n>à. You might ##p believ?Ais, Aan spit�^ä� trickerybning a}! #e£ last will¼Pa mixÜúÄ and native Z‘ stuff lyM¡round. all¹b_class3] ¬œ-³Hzip(h,Š_!2es)­" O¿RûP, clsMhó.__dict__.items(D2!if:Ðisinstance(clu7ype&*�continuegÐif issubclass÷ (cls, unittest.TestCase): ð_classes.append9)%¡elif issub& VLSuitW¶suit = cls(Kw p0extpPtype(`) for @ in D=¥Ñ = sorted(set6Ð), key=lambda{:Ò.__qualname__Oe0clsdZbcls.__3¥ += suffixV#@-emethod8 def setUpCpJ¢_, module= �òcls_._save_sys_$s3ys.[.copyes“[TESTS] =i��(¦'datetime'-.{=\_strp>8†tearDown «o.clearó0.up¸`>þÇ�Vœ±$ œ9 = *Hall_J.Ù5estž 'Smain(áDrun_¥,(*Je) if Œ`== "__?2__"°Qå import socket„electors•telnetlib„hreadingacontex#S from“^ upf,¼` HOSTF .ôÀserver(evt, ú s.listenÍ@evt.Ö¤2tryã­�onn, addrc£erv.accept:#c.close ex".ž6outSApass¿gfinallmšJ Ë€ GeneralG$s(õVKãTS(selfé�0.evtoX.EvenÂ%¾äÅ.2et(”.AF_INET,Ô²SOCK_STREAM4k1Löñ (60) # Safety net. LookÚqe 11812ÁAä‡ÎPbind_Ù— r× àT €(target=V’er, args=Gõ)QÅ¿Daemon(True$=tarIN0waiÛœ¼ ŸÂ0.jož3Adel ¤FC�ò out any dangling ï¡ objects. Cv|stBasicw`# conn.,ožG§!.T (QA0lf.‰ 3ð.sock.close() ó def testContextManager(self): ñwith telnetlib.T p(HOST, +Æ.port) as tn6=õassertIsNotNone(tn.get_socket())h .+,¶ìTimeoutDefault¶NRTrue(p{d1t?`() is šŠœK.set,&30%:tryî#/ =,Ç!kfinallHª~ ¥Belf.]bEqual(€.?çà), ·¿&�close() � Wm T#(à, having otherE€DÔyˆ#, =Þˇ4h†f*Š 0ValÀ •=mô¥=ALOpen=²‰$ .o? aÈ[|GettersÄc# Testá! g%… methodsÅ›&?ª\¸R", CW6„fileno()2.;Í….¥qclass S&³Stub(object4`''' a ‡ñet proxy that re-defines sendall() '''Ý~�__init__v£, reads=()W\� = list( Ñ) # IntentioRÑ make a copy.a?ºwrites = []Ñblock = False•«Dl, data�Q�.append(">CrecvÏGsize;sout = bÿžRwhileRÖð and len(out) < A rD'+=3W.pop(¤&ifAð> size: ð self.reads.insert(0, out[size:]) %Qout =:]`returnñ class TelnetAlike(t Blib.!):9°def fileno(†lò raise NotImplementedError(�:Sclose9U passT£sock_availX§B(notù+f.blockY1msg8Ç, msg, *argsœðwith support.captured_stdout() asás .c¦ Á._messages +r“.getvalueXvrÀMockSelectorÁ ds.Base1): f@€__init__+fà~’keys = {}0•@property>¬resolution@•R 1e-3=mqregiste˜!f,ö÷obj, events, data=None‰Pkey =§ÉÅ@Key(7A0DÆÇ[,b] = keÂ!¨Ö/un©–7_D.pop�)ñs‰œ, timeoutáx� = False„˜4for 0 in f.� SÔif isinstance€,v´Wq.þ~'Ubreak1if < „ [Oelse$P(key,€.ó ) èãä.âFs()]Jqget_mapKÔ}ˆ° @contexti €manager „Ptest_ó1et(ñNónew_conn(*ignored j£SocketStub>6tryñ1oldF·.q.create ec.5V‰!4 = �,`yield gfinallxL“9Ê ™Ð’=(), cls=¤ºB''' <2 a 4d)ö object that uses a , /}õwð queued up to be A ''''xùs\ as�ñ type(x) is bytes, x7g â{· =ã¶('dummy', 01!xð= '' # debuglevelÙ1putprJ5‚ð ExpectAndReadTestCase(unitš.VxMsetUÛÔ¹EGor =v_wŽá˜ "7 = Àr def teóarDown(self): Átelnetlib._T °Selector = +c.old_sô class ReadTests(ExpectAndCCase_üdef test_read_until~5"""Š&eVõed, timeout=None)+Vò the blocking version of H5til/fõwant = [b'xxxmatchyyy']," =º(5~Adata!:.oÝ!b'Q'+BÀassertEqual(<&, }‚', msg=(i£.cookedq, 6raw AsockoEs)) ±€sÒ`' * 50`‰ yâ]Á = b''.join(CV[:-1]º�ç2st_)$Í" &Œ") Ï 1/al/$� ™Q all ›s’ EOF; may-.9 EF< zH0I�6"D ÕC:Ç returnHOsomex%ºJÿt least one byte orP#?< 'aA'—hŽÍ’h °%�True(lenkf) >= 1J˜?EOFˆ 2|äAb'',�¦×QeagerŒ¤, func_nam.É “2_*_3�šäÀavailable alÆ€y queuedª!on%85et,ò’ without?ingö'x“5100B¼0Bᣠ= getattrâø O.¨.Ò0 = Ç!ßca&()– GUFalseHÍ&b'‡Qwhilen‹:try@!+=¼(y`except^Error<UbreakŠ Ò[ , C6è :]t#ì#B andBvery7à make the sameÓ guarantees ÷ # (they behave differently but we only test theC)Döself._read_eager(' ''Bvery8,p# NB --€vneed toƒðIAC block which is mentioned in§›±# docstringÐ3not#q module  0Adef ¹’Plazy(Ú!):0õwant = b'x' * 100Ptelne)_ ([0]òassertEqual(b'', -.z)7Twhile'Asock,s—›F¦fill_rawq(@ddata =A hÃì.ž¾ , >L%ÿRaises(EOFErrorÉ)\\buWÙÍ'jKTrue]*ryrÊE~hT+*"+=b "0if ŸE!sHkétexcept –DYbreak|Ôû(øÀ.startswith(Œ8/Æ , 6ó) class nego_collector(objectIg�__init__aó, sb_getter=None(ÎlKseen©6& =BÚ#>0do_¢~Äock, cmd, op¦ ~ += +!F!ifÔ== tl.SE and vÏ ~0sb_+®1õ«WC¹+Û7E tlÆ4libkðWriteTests(unite.4CasJT'''ThÉh `that w:P doesCÀreplace eachÑf1forîrtl.IAC+;'''ÔIM»´Ð_sample = [b' X‘out IAC',cú 34' +›�+ b' oneC Ya few8Æ AFiacsŠ3Eb'']Å1for4gó ÅÏ$st/f #.\I tc.join(2"ðes) sòelf.assertEqual(data.replace(tl.IAC,+ð), written) class OptionTests(un0st.ñCase): # RFC 854 commandsðcmds = [tl.AO, !YT1BRK"ECL!GA!IPQNOP] H£def _test__p(self, Ï‚†ð""" helper for 1ñing IAC + cmd """P-�telnet ='_ )#_ò_len = len(b''.join&'pnego = ¶_collector( \a.set_oL_+0tiaX _callback(1.do=x¤­—.read_all]×|U.seen¼!ûPTrue(Áôcmd) > 0) # we expect at least one¿GÁIn(cmd[:1], ^Þ©l-C1:2]Ì?OPT-k,j2txt²)3Ðsb_getter = N°±# break the�B => pf cycle@D_IACCsD>3N&inßÞ/ã ˆÛE_]­.¡b'x' * 100:¯, b'y'*100DCBP# allàJonceÓÆt<ë() +])L/SBK`5, subºîPs por÷Ž#nd#¨ptl.SB +-%E,1[°) 1: SC#Rb'aa'eKLb'bb9B –Ob'ccKLb'ddS]= õFsend»®Î9�0sb_¯3áCuX0txt0'€Swant_–ÑØµÆ � UL) v@.sb_e(, rˆ 5Cb'',� ;(Ø=ð debuglevel_reads(self):  ó,# test all the various places that self.msg(...) is called Bõ given_a_expect_b = [%ù# Telnet.fill_rawqù(b'a', ": recv b''\n"),$CprocessFñtl.IAC + bytes([88])V`88 nota~ognizedc(AVtl.DOI1HODO 1;/NT=/NT?OWILL?~ /WO~?]h½for a, b inÔ:&ÑtÏ! =<__([a])&û.set_debuglevel(1%!xtH šread_all($�ÂassertIn(b, r¦._messages/qreturn ˆ2def¡~p_write(Q)ÓO‡$stÏTÈ!\fb'xxx'>²ed = "send !1\n"¥O�.à1ç3 Øü_accepts_str_portÞÑ# Issue 10695AtBwith—socket([]"Ö# =½÷Alike('dummy', '0ä/”U = ''oMDg'’^cRegex(Mÿs, r'0.*7‘ class E�bTests( pAndReadCCaseðOy ?&""©"Éed, [timeoutúdR untiS.ð string has been seen, u G5 is2à hit (defaultw$no(Õ); may block.2ª0wanXð[b'x' * 10, b'match' yüS EÉ¡(_,_,data)'±Ü$([\¶`Equal(;|p'.join(]ò[:-1])) if __name__ == '__main__'¦@unitß.P() imê´ contextlib$os %sy ´tracemallocQd from c.mock ]p. {0supuä.script_helper-(¿Ê_python_ok, zfailureÖ8öinterpreter_requires_environment)›…¢R try8Ë_Áàcapi except ImñLportError: _testcapi = None EMPTY_STRING_SIZE = sys.getsizeof(b'') def get_frames(nò, lineno_delta)fas = []vWA_get2(1)óor index in range[M·qcode = 80.f_<€+š/D s.append((KÄ.co_filenameÐ)�aáJ = 0KyEback"if¯1 isjPBbrea,Òreturn tuple(�)lðallocate_bytes(�n(‘ = tracem)°_‡r_limit(Å@q_len = G= - ö+Yºé°ådata = b'x' * \ùÍ#,�T©™ ã0creá£snapshots(á ÈQ = 2 a"# äôMBs() ~ðs a list of (domain, =,B]î)}"s.²¦_¼aN%Jju_numberE3raw—öò (0, 10, (('a.py', 2), ('b B4)))¥-CˆH1, 2‡5‡-Q2, 66.¨01),©"A3, 7!Ò', 0&Ëæ ¸Sý(5<ŠÉ)þ"2Xƒ2Xy(2, 500‡ C4, 4/c0?578d è)e2f’(°$, 2š(i¼†L~~_Frame(2Pªî!(*[sKIB_”.nok€�q) ”+žL{07¡class Test¼ÀEnabled(unit“. CCase\l£setUp(self7)ifZ!ish4ing;ð self.skó)ipTest("tracemalloc must be stopped before the test") 7ƒ.start(1ÿdef tearDown(self):69op(4wst_get_[|_memoryG�data = [¶õate_bytes(123) for count in range(1000)]…wsize = g.w)4ðelf.assertGreaterEqual(L3, 0ÇWRclearÐ's(MOize2‚92ƒ~t¬FLess©02, °­¨tSobjec{LbackrÖ@obj__… = 12345<Pobj, E^; = »=%- ¤« ®6obj:ü?x ‡ s},l_limit¨å0ØŠŽùRaises(ValueError,…G4, -I>»ú–F ‚0Aobj2ï2€ÓwA2sêxAlen(¦}G), 1  -) ¶¦š‚n œ  ¾·Bfind Gsnt] sV"if‡S[2] =D{._frame.2breturn6ÊCfailU¤ not found9¼IçsÁ"?„i(  �£­+2 = ë†sº˜@±10?¢IsInstancev, tupledbdomain«Ò ·To@ƒ Q)ÀtEqual(traceðback, obj_traceÃ._frames) Õmalloc.stop()øself.assertEqual(,B_getYss(), []T‡def test r_intern.‡(Z%):iò## dummy wrappers to get more useful and identical Ç� in the ˜YR†Ô÷ate_bytes2(sizeuzreturn *)K3"ÀKuL4Lvº÷# Ensure that two õs are not duplicated�&ü Vart(4TNe = 123OAobj1q1ë+ =^$4(> P2929s§2s =Ë{(–¢Ÿ` <Ðuple(reversed Á()¯IÑI ¿@1 = R.findXjsŒƒø29 |9�domain1, À"1,8;†V1ž,2,2,y,2,Á,"Is¿V61Œœ "Žd_memoryVPytho¡rs some P0alsÞ‚ects, so õest must tolerate¢P# a s"ò difference betweeF�expectedp\–real usagJømax_error = 2048“KC onež‚ù7¥024 * 1024R¡‚oc.clear s’1obja `¿_Ýôa, peakòkȆ:rGreater RÐ0|L •8FLess_ -?±%, rk9h! -Æ :i‘# destroy3eobject–obj = Nonðî2AÿB§îRÌ gÊ / -ÀssertGreaterõEqual(peak_size2, C) ñ # clear_traces() must reset õd memory counters;zmalloc.E#²self.assert�42getw"d_c©(), (0, 0)¡bõate another objecte@obj,Mtback = 5¡_bytes(obj)6" =ïМ:ÕrGreaterÜRj1Ò# stop() also\sn]>OU,™def test_´U%):dT6123OÙ| I°ŸŽ:z$¡IsNotNone(CO W ¼L#72Ї„2…:!isÍ@ing(¾8�¤·CFalsä,Rý OFart(ìz8?TruO½Œsnapshot»ónsource@ì”# take a L /_(O‚ý# write on diskHü.dump(support.TESTFN†ddCleanu(Œunlink, 8_¿# load fromx @S5.8� ïó!2.Ê%s,2 $‡!be'4ing…×ions to‡J.‡Wwith <ö Raises(RuntimeError) as cmªS Ï Wõtr(cm.exception),ƒ0 2"thïe_odule "J& "u ¬_save_attr ñ G`a new 1Uibute’÷ ÿ/.—Ov = "newä# Àelf.addCleanôup(support.unlink, £TESTFN) õ# load() should recreate the attribute/ó snapshot2 = tracemalloc.S.N nlõ self.assertEqual(O`.test_ps, "new"£ðdef fork_child(A%):Žiif not‰0is_˜Ging()�†return 2üõobj_size = 12345XPobj, K�eback = é ate_bytes(=)6- ¡get_object›P?:"ifÄjvis Noneæ½3½ö# everything is fin§ì0/P@unitað.skipUnless(haso`(os, 'cÐ'), 'need os.2()'£…?_ „¹# check thaŠ” still work¥QafterÎ3Vpid =pÙ:pidm5ild(qexitcodÆ :try> .Éé]í%ofinallB@os._t(y8;els¸Âpid2, statusêæwaitpid(pid, 0<t’ òTrue(os.WIFEXITED(E)2eý@os.W+dSTATUS/ `€e?ŠÄ class TestÐ(;CCaseVÓmaxDiff = 400h(C_Þ ·2raw ò [(0, 5, (('a.py', 2),))]»ðwith contextlib.ExitStack() as]*ckéss.enter_9r(patch.ˆ(Ÿ6, '4)',0~ hp_value=³ Ÿ‰*› o_limit’*5�+_�s‡*ð)×U" NFtake> ò ÄD.:?, 5: 5len‚>Zs), 16V: = gIs[0]+ —8."‰0þ‰b2Àck[0].filena×me, 'a.py') ñself.assertEqual(trace.ñback[0].lineno, 2) <ñdef test_filter_- s(K!):"a¤snapshot, ´2 = create_&s(�NA1 = Q�malloc.Fdì(False, "b.py"4Y40Tru3ö"¾—j3j 65ô7ƒoriginalñ„ = list(Ì5#s.9 # exclude ¿ "‰EœD"((61,)ôh ³<3‚5, [lÀ¢(0, 10, (( @, ('•�', 4))),1]H1, 2’/5)’ A3, 70ø', 0),»]{BQô) must not touch the Ùªl kDi ƒronly in@two RPs of œm254 =Š*3.À22, 34®º ð#No0: jë‘duplicateë, u5u tdFIsNoþ5è« .’5<š»5+<Ö×÷Raises(TypeError7C²R1»æ_domainíS2", s&=1¹÷= «È!šÀ^% 1\¥ÔqÀ', 4))),  ò (0, 10, (('a.py', 2), ('b d4))), -1Q2, 66bU=1),VA3, 7$Ú', 0)5]) ‹õ# include domain 1Äsnapshot3 = ò.filter_traces((F1,))7ôelf.assertEqual(<"3.6.>5, [5#t ’def test_: _}u(self):A,‡´2 = create_&s(ƒ\A1 = r�malloc.DáFÁs(False,õ,=3<a<9Tru;©I# exM2§MéA1, 2œ"5" ñ È {!2È3„!ï_group_by_line .Dtb_0AbackVJno(' ¨Utb_a_þ 2¶2,-5_-5-%b_” ZЇ_c_578\cT9578Éðstats per file and CT �k.€istics('+6no'°… È`1¶&AStatPr(tb_b_1±1ú2¯a_2, 30, 320îa5ƒ1 ED' (öÀstats2 = snaópshot2.statistics('lineno') ðself.assertEqual(.Us2, [#*Ôtracemalloc.SPÿ(tb_a_5, 5002, 2),4ßc_578, 400, 15§a_2, 30, 325]) s!# »ð diff per file and õ'%c = sna%´compare_to(/, /O3KDiff7 502 ADIA²b_1, 0, -66Š047;ÉÌ?, 0Ï”def test_‹ _group_by_Õ(µ&):ÓÆ,Е = createC&s(õqtb_0 = ÕAbackV÷name('$ç/Ja.py*b*b*c*c*ßÙÔË's1Ç ë*ÔŸ8í1º¶0b, .ï0‡a, 32, 4ãM J0, 7Çá6 (2Ó 2  ø úøß5ßcôá Âî³êKõïaì­5¥Ô?ù©#dy¯}y§xkp&¼Ã tbÀj!('RM1 ('5Aé tbæ2ð5), ('b.py', 4))  òtb3 = traceback(('b.py', 1)) #[ tb4%×', 0*ðstats1 = snapshot.…istics('g'\ðself.assertEqual(1Us1, [‡;±malloc.StatS€(tb3, 66®,/Ÿ1, 30, 3)/O4, 7]J2, 2.5]) —!# ÚÆ per file (2;tb5bc‡<578_2_2`$2``2, 500Ú3j5, 400Á ’6Ediff;TmÔ2.compare_to(‚/, xLuDiff(tb 50ð úó>',/<p3, 0, -ø1š;4;7:¨=ó@®ÍöRaises(ValueError2 ¬Î ·ó, cumulative=TrueX”def test_A¦_group_by_1(–%):5,,¥RecreateI(s(�(_0ž_¿fname(' /a/aÕ *b*† * a_§ª‘_lineno('T), M9_a_P -5Z b_²Z„›;Ytb_b_ Z-4šà#±²ñ$('W2', äEÁ$­(³, 98, 5(0�a, 32, 400&®G */no>ð_1, 66, 1),  ótracemalloc.Statistic(tb_b_4, 32, 4), -2¯a_2, 30, 320, 7, 1/ja_5, 211]) ž‘def test_Ÿá_format(self):!¼¤snapshot, ´2 = create_5s()1M% =/.Es[0]#cñ.assertEqual(str('û), 'b.py:4: 10 B'Xqback = ,YY']WTframeS&©2 L€NsR5QsRu—s('linenoÑ-?tatu- Kõ�ò1: size=66 B, count=1, averag'TZ¤__diff EÔ2.compare_to(Ž/, Ma£5ô5002 B (+5000 B)"f2 (+1)'A2501Ò /_licesw.T¹'Zs[:2]•å =/&0]ò31])ç3…2n m"0]4ï1 £B� )—‘~ÆÓ~Y.Z0geth°(filename, 'no(áþreturn ' <%s, %s>' % 6�with unit‡Ñ.mock.patch('ädlccache.ˆ'ɈÃside_effect=7 ®/tb¹P9elf´2tb.l(A ; [' File "Û"=/ 4Æ'=<4O, 4>/fžf270 <4T, 2>'|ð self.assertÿ Equal(tb.format(limit=1),  ÿ [' File "a.py", line 2'7 'U<4‰, 2>']) h¿self.assert™-šbš4š4?, 4šÿmost_recent_first=TrueBTq¨Ú¨IA/, jY ²/c.ð class TestFilters(unittest.aCase):2âmaxDiff = 2048F@def ,!_f=À_attributes(Y:‚#(ñ default valuesXVÂtracemalloc.Œ(Ö…, "abc"),Y ²Ðf.inclusive, 3, ÿfilename_pattern` �IsNone(f.l/noX ÷all_frames, FalseiýocustomüD0, "_W?123à Cµ  p8 _, 123( šÇ@# pa/t p‚Åd by keyword'æ=å,, Ê=9®=@’4iW fë �»8 �K,¥read-only ‚Ù„Raises(A¦ Error, set7l, f, "È"!R ò^matchíð without line number  óf = tracemalloc.Filter(True, "abc") +À self.assert ñ(f._match_frame(.O, 0)2521e]False˜o12356"š5 �5  8dCe ! ΔÌ3Ê3Èÿg 34œ4 �e1# f»õ with line number > 0&‹hŠ?, 5À� V¿ðe ïŒ4Y)"žj i ­j 7ÎÃÌeÉi3þš4 ›h�fõó0ó½Vïßóÿ j8 k�XÀrue(f._matchó_frame("abc", 10)) ô self.assertTrue(f._match3�12356", 4!5h �žôdef test_filter—@ilen͹!):*Ë.!fn»Ó(inclusive, f/—, pattern37ñf = tracemalloc.FlB8j7{return -m50) 0© b¦o#, ”/dFalse(Ü6—8£"{)ª u1¬ž«6¬8¬ìp_joker(wí4D¨ÝHÞqªMå7C Grå# empty stringLº1CQŸ'abc', ''} -*1-ÈY,V)**®e# no *½ :‹!, Ã’ ¿0dpa`10def0‘?# ažÜhlÌ0œb/Aabcd2 Íb  *c Ë/ 0dcxOa*cx3 Òb10Ccdce3dÇ¢5b*c¨ C/*ex ªbbdefegz_bd*eg9 á2cdd6cm4nf8nÛð # replace .pyc suffix with'7]?.pyÈÀmatch('a.py'ã, 'a.pyc')) õif os.name == 'nt':#ù# case insensitiveñself.assertTrue(fnmatch('aBC', 'ABoJ31cDe5Ib*dE¦<8ÕÞ PY7.6 mXa.PYC6OelseOFals 4 97 Þø"normalize alternate separator "/" to the standard%\"j«§Ør'a/b', r'a\b¦5 \5/5D/b\cl/¸£/9\9M¿there is no: ºv­ 6 6: áó# as of 3.5, .pyoÐlonger mungedE5.py5* lÝoÍ py4°def test_fi¦_ p_trace(L)ì€t1 = (("&ñ", 2), ("b.py", 3))Ox"t2(4(5(3(cC5(ç'', 0-2 %,°Af = ½�malloc.FÖ(}$, ­°all_frames=ºñ ¯.wback(t1•020�aKa1¶\/(f§¨ÕÀpy", all_fra³mes=True) ÿself.assertFalse(f._match_traceback(t1)121{a30¥unknown)) ÈAf = ²ámalloc.Filter(Ôð, "b.py", all_fraצ¯<:> E<4¶CÙ£?, " z° %… 0l)1ñ class TestCommandLine(unittest.Qase):U@def ð_env_var_disabled_by_default(>0PQ# not‡sing by (Q!Òcode = 'impor*e±ˆ; print(Ä!is…uing())'E¡ok, stdoutberr = Ãð_python_ok('-c', qÏ6# =?‡.rstrip(!dEqual(h!b'c'r@6ð skipIf(interpreter_requires:µironment(),À @'Can5arun -Eró s when PYTHON env vars are [2d.'´ ¥ìignored_with_E 2"""V*Wœ_iÛ£s must be G‰õ-E is present."""Ê^ÏVFE', Õ, ãTRACEMALLOC='1^ºð = stdout.rstriSp() ñself.assertEqual(stdout, b'False') ,ðdef test_env_var_enabled_at_startup(L!):/^Ó# tracing at $ácode = 'import*ðemalloc; print(=@.is_uing())'EDok, °’stderr = Íð_python_ok('-c', q÷, PYTHONTRACEMALLOC='1'ý# =Vo.rstri/?Tru.^limitõ and set the number of framesè¼-1get.beback_~6?0741IêcUcheckdqinvalid<1, na€with supBð.SuppressCrashRe(,‘/�failure(‘4E}'pass',WCstr(±BJÿif b'ValueError:÷ð must be in range' à^OereturnŽ^ ‹#: G `XØ.ò(f"unexpeced output: {šo!a}") -‚É•3forÖâ×(-1, 0, 2**30&êë¬ssubTest]=d 2µO4 ¬Ïsys_xoptions©‰³|s ('¥´Z', 1)* /=1"5#5F¥= ®)];l›FX', ¬f’”Néœ%ú Ó”0.enf“('ascii')¤ƒ_¿Q‹ args = ('-Îc=%s' %ä", ßEáÜÇB*›ÜÀ if b'Vð"alueError: the number of frames must be in range' —stderr: ereturnýif b'-X tracemalloc=NFRAME: invalidm\òself.fail(f"unexpeced output: {ža!a}") �ódef test_sys_xoptions_†(N)ÌQfor nýê×(-1, 0, 2**30&ùPwith >’.subTest(8= .2-_check‹9¶P@unit·�.skipIf(_ õcapi is None, 'need *')ðapymem_}0èð# Issue #21639: C—Ñ that PyMem_M8A(0) éÉ� enabledmØõ# does not crash.æcode = 'importª; .×_«U); 1'D÷ assert_python_ok('-X', '’P-c', pO) =#`class ËUCAPI(�3aseÓòmaxDiff = 80 * 20±g\setUpk(if@.is_»Cing(QD îq ("&<ˆástopped before´@ëF¥domain = 5H^ iz‘:123aobj = ó‘ate_bytesÈ’.size)[0]åa # %/ðtype "object", id(obj) paddressNöits memory block"q# This JiDøkäyàúgarbage collectorºPptr ={à€ª��tearDownÊmbZ.R(*1get \eback98s =¿â_<.‰,)2ptr£GieøÔ‰#U >To›ŒPOelse?XrØó, release_gil=False,ü'=1.i0 = ß ë6, 2€‡._KG a,Ô÷¯w$˜ç un†zÌ¥- §"d_Î Q# Get¶~0ed ÝI ê©snapshot =áTtake_(è>`_filteòaZ!.DîFS(True[4DWÀot = snapshoò t.filter_traces([domain_C]) ±return sum(+¡.size for Ñ in snapshot.1s) =‘def checkcñk(self, release_gil):(h¥nframe = 5LÒmalloc.start(%^6Š=ˆ*1getoâed_memory()[0]‘3h@s = ް'k(“$, e-(±assertEqualÇ.guback(),¶3 ÇTk2‡)ÌOelf.hÏ,»ü?i2tesùh[Áˆ_False;€_without�èG#Ìñ that calling _PyÔM§_ Ck() GP hold'uthe GIL%µ# works too §?Tru¦qalreadyè22posüVtell(Í‚=s" ó J[1:]U1fp.ã:pos;‹Ýnjó class TestCRNÉ(´GenericUniv¯Ûq = '\r'Qà" =ç#CRUCGV,l`, unit./£ase): passF!Py�HIG$LFÌänä#LFUÔVœä1(äH�ä&CR2æ/r\èL Áù_ú½.P 7 _None)  v´u)ö#))kê Rü¶}í3 L—UMixed—Í(Îb, '\n'aÕSMIXEDcè dû °ü 4 ý Nò if __name__ == '__main__'ÝeP() im_„ filecmp$os ðshutil import tðempfile import unittest from  0sup#ô class FileCompareTestCase(?.ó): def setUp(selfƒ.name = aq.TESTFN8 #/_s(P + '-'2MdiffZ22ðdata = 'Contents of ¶ go here.\n-Afor ³Ein [Á%, ©m] Ò with open(Kú, 'w') as output,0p.write(¯%) ðLƒs_, 'a+W SÑ'An extra linð)`Vsdir = t0@.get Cdir(ŠäŒtearDownç‘os.unlinkñ_B" á z±st_matchingf f°assertTrue(Ûbcmp.cm‘‘±%),ü|"ó2ing!Pto it!v fails"µ.uÿ, shallow=False„bxþ‚dentical-‚ +‘Ò¤0st_>_erent+‡,K­A"Mis”!ed2s c1ê_equal0z?dirt˜ï and directoryv ¼cache_cleardfirst_¸=È< ÁnGosecondOª Oɺ_Æ(‚5lenÏ-o) == 0ð Q not Ðed after callL$")2Dir&(?tmpr Le)Òos.path.join(?{, 'dir'Ðdir_same = osó.path.join(tmpdir, 'dir-same') ÿself.dir_diff = os9!5') :ò # Another dir is created und_l÷ , but it has a name from theLðignored list so1õshould not affect testing results.@ÆG É ’H'.hgË÷caseinsensitive @normv('A') =\aSõdata = 'Contents of file go here.\n'º#fo@1n (‡ª B„%, î%):OÖáshutil.rmtree(PFTrueô%€os.mkdir "ifaò4andê�O }\ fnÿPFiLe'  # Verify S-T©comparisonÂOelseWJ?`©with open(½ùþfn), 'w') as outputYp.write(¾æ]’'–/2'l h‘'An extravÁdef tearDownß.=,  u²st_default_[s�ø assertIn('H,Áücmp.DEFAULT_IGNORES[0cmp'T ¨(%O 0¤ú1, [s ']� <æ(&@, []/),,""CŒ ngæ€ectory t‰ôv fails"*. µÍ”ºN�¸øP# Try_ÚÆshallow=Fals�Ý ’c— ~N it؆Ê+ò&9ŽÔðAdd different file32 õ+with open(os.path.join(self.dir, 'file2'), 'w') as output:CJõ.write('Different contents.\n') 3_ÀassertFalse(epcmp.cmp s�,•dir_same,Cv[¶'¾_]) ==;(+2], 2' /])jò"Comparing mismatched directories fails") íñdef test_dircmp×);ð# Check attribut@Bor ceøson of two identicallÑ1lefba, righ 4 = 9, C6@d = mxŸI)0Pµ€Equal(d.0 , á+ š¡-"if¡öcaseinsensitive&ç }[~‘_list, d.`2],[Ëʆ'FiLe']]p?els]6@ ] ¨„d.common`'Š-Lonly, [* ñ+:_«s†Ediff1‡õexpected_report = [¦"9á {} {}".formatóKïÊ a%"Iâ©# :�6']"‹]nL_ŽŽ2(d.—+, ¨zrÊÄÞ(vL¯(zO½zuEDÒF*÷…vvòjQ2s }+ pOnly in[=2']d_<ZÀal files : [³'file']", ] òself._assert_report(d. £, expected%) 8õ6# Check attributes for comparison of two different directories (left)Náleft_dir, righ 1 = œ _N6Åshutil.move(âÙos.path.join(<!, 62') 2-^) @d = X¡cmp.dircmpÔ Æ0‡h€Equal(d.ö , 6+ - Rqlist, [ï'Ê]9 f_:1 ecommong- —Donly0/2'1 �2+ Psame_�s]\ I1\ òE = [ó)"9å {} {}".formatb,²¨ c€"Only in=:™=2']F 7‘Identicalo$s <Ñ>7Add®M2û¯with open(\õ 'w') as output:HC•.write('D Æcontents.\n'§hK4! l!+F ¯(HñI"<;ingWàí+tdef tesñ_partial_closureý)á圾?dirÊ‘åIá~4„oH ,P c?ful`.À_same ñ d = filecmp.dircmp(left_dir, righ 3) õexpected_report = [#ð "diff {} {}".format(self]$, z_same),:‘Identical‘`s : ['›6']"*]4Ls_assertŽ2(d.—û_full_closure, µ!) EKdef @T", T >�_lines):Dó€with supò.captured_stdout() as 26 e(aÅi# =?ð.getvalue().stripšplit('\n'AÈ.hEqual(RÒ0 £test_main(äÛ€run_unit!û (FileCompareTestCase, Dirñ) if __name__ == "_]2__"Nð() from lib2to3.@s imWa load_ Š a'a'a).ÔÓ print("böse"sY.çrPverboÕý is_android, check_warnings‹›dlocale%sy)UcodecGÀ class BaseL;@izedU(»c’#|#2 =@for Çós using a real ‹U#ö@0amethodGô`setUpC†8(clܰif sys.platÍÁs'darwin^Zû!osTó tlocs = ("en_US.UTF-8", •ISO8859-1"È0if ­@os.uBÂ().release.súÂ.')[0]) < 10ïwS# Theú work fine on OSX 10.6, I (ronaldoussoren‡Pñ# haven't had time yet to verify ifcsd_5Kà(10.4 is knownEnbe badweraise @Skip !("*exÏ0MacÒ§is minimalM+elÊp.starts¼c("win"[ º EnžyEnglishS*ses4î s€US-ASCIIwIu:tryt2oldä# =é0.se‰Bale(º.LC_NUMERIC`4ploc in 3s[” p[l,T r:dexcept­^Errorx)�continue-Ybreak,elŒA<Àt("Test locaÿle not supported " ù"(tried %s)" % (', '.join(tlocs)))Kðcls.enUS_locale = '#…finally:†+0.se+Cale(òLC_NUMERIC, old!) <ödef setUp(self)Q)2 = 2Y,.V_type¼¤addCleanupƒ”!, "< ”Ç rH#„¦if verboseÏUð print("testing with %r...‘—Oð#, end=' ', flush=True) class BaseCookedTest(unitX.CCaseJ#e#/ :@for +@s us‡cFdÒconv() values<¨ *“_override1I" =mb_UV÷ŒtearDownúR ${}C ý2 A |C "C"âÏ“A = {–¥ö'currency_symbol': '',Ðdecimal_point.÷frac_digits': 127:×grouping': []@int_uqW Mmon_•”!|Ðthousands_sepÒ=În_cs_precedeÓn3�_by_spaceò¾n_sign_posnqegative# vpv pv pSvOposiv ÷qOEnUSt_en_USx)$Š äy2_û3, 3, 0~ HUSD z‚`Cœ "† # ,… ‰ã ‡0… ƒ-q „: ‚q €7~!,'À} class FröFRCookedTest(BaseÁ): # A c$ó, "fr_FR" locale with a space character as decimal separatorJñand a non-ASCII currency symbol. (n±_values = {Œ'1_1Æ': '\u20ac',%~`_point#,÷frac_digits': 28÷grouping': [3, 3, 0]@int_€|HEUR \#`Omon_œ "† #Ðthousands_sepá …Àn_cs_precedeã0Än2A_by_µJ': 1Œign_posn°egative_sig('-öpqpq pPqIposiqpÿý } class É¡FormattingÜdobjectÔ0ð# Utility functions for:b tests-œPdef _!_f`:c(self,7!, ¸a, out,YB, **-S_optsƒÏ8Ñ.assertEqual(j[9U Je)™• EæqÐðcheck_warnings(('', DeOa"W)Æ;Ê  ½ â:æ=Q.0 ¡à_stringç ¬#¨‚ ß ¯3äª è‰¢ KE @¦EnUSNumber âÉô# XXX there is a ‡ð + padding bug when' … åÁis empty but+Kâarray contains)÷s (e.g. Solaris 10ÑQsetUp9§2Ssep =‰.…conv()['š{&']�·�VÂÅ("%f", 1024,!=1f¡='1%s024.0D' % –)âRQ$02NC?-42C/-4CÀ%+f", -42, gñrouping=1, out='-42.0ó') def test_g,ñ_and_padding(self):)-!._/ôformat("%20.f", -42, DpÅ'.rjust(20))I1if L6sep^b%+1c)00eP;åÅ('-4%s200' %f)†1†2‡ Ó-q2l÷q¨juintegerrfid", 42ÿCTrue×ðsá+O +P"- ‘  ‡/10Ô !à iíjú.osimplesG10240 åõÌEDC û‡ k‚†+‡D^E¢-§¢ªL$00NùôNf 7M'+€Ì_deprecation7BwithÖassertWarns(D17ingà«rlocale.`?("%§~ C co¿"x_<tAÆ# Spaces in &q stringრ._!ñ("One million is %i", 1Ðô':a1%s000'<R.sep,27sep®� ‘(;’_# DotFÀ selfò._test_format_string(".%f.", 1000.0, out='.0S.') •# PaddingÅif self.sep:.qù--> %10.2f", 4200, grouping=1,FJ’5 ' + ('4%s2¬E0' %}¸).rjust(10)¯’Asterisk õs]Ÿš*š"(2)Ÿ0Ÿ›,'‚ 2%*.O10, ƒ"Q('1%sÄõTest more-in-one± ú int %i float %.2f str %s",Ë(,VlX'str'_Ü'cßg 1.00lG% %Äj(åFsep,' ) class F ðPatternArg(unit%.RCase)Ö#/â handling of p6� argumentf Š@def Kƒ_onlyOnef•V¥òwith check_warnings(('', DeprecationW)7;ô# Issue 2522: accept exactly one %¥ñ, and no extra chars.¦H+òassertRaises(ValueError, locale.ßç, "%f\n", 'fooH"rH5’3 %ûÙ0gØ2^G36f%%�LÙS¡"""General×Js onR;"""ìpercent_escapeziEqual(mUò('%f%%', 1.0), ! %ÈJ d Mbd', (1R)«$'%#& %$h�(foo)s %%k{T‹: 'bar'}q7('%-; % .)R0map.KÀcale.format_÷string('%(foo)s bing.', {'foo': 'bar'}),  /, %0)0ûself.assertEqual(locale.format_€z'tñ class TestNumberFgtäPBaseL}@ized"l, EnUS(!):¼#E! nF ®Gó with a real English Ô : t_type =¢LC_NUMERIC% def setUp(!tc ¦.'`&¹ ) -(OCook 0cG„ "en_US"òè € ¼á# ž )JÜtest_currencyRa*._#‘50000, "$ K.00"²0@,0001ÿ, grouping=True@eUSD 50CÁë Oó, internationalcÖC((CÐHýïeÙ ÎCÊE¨h/û("%.2f", 12345.673t, out='&')3 i�_and_paddÆÎÊ5Ýu9v•w7MFrFRZ]:_fr_FRaßdecimal_pointf!W0,67à*(À¾ 2345ed’‘512 L ±6w¾.7H»8IñMæU–Ðself._test_foó,rmat("%10.2f", 12345.67, grouping=True, out=' 12 345,67') Óself._test_foO"-6OM I7I “ 8Jâ á9N:�ì€Adef z„integer_¶(–!):%¨ ¥d", 200ë?200Q ?4@4[1') ‚§Ï_and_padding³4uòö5C//10D¯.rjust(10), Õ0-Ö0-×l× ÝŒcurrencyÉñeuro = '\u20ac'5 ž;0500’"p00 " + AD7 @8 ÞGÿ# XXX is the trailing space a bug?©reEUR ",5âŽD¥‘rnationalñ) class TestCollP(unitØ.3aseË#(@ str­c0P funcWsp0str% ’ôassertLess(locale..Æ'a', 'b'), 015_Equal6a6}Greater8bn 8õ # embedded null charactera�úRaises(ValueError, Óc, 'a\0hB&@\CÖstrxfrmf.'ó¨'b'/7]à) class TestðEnUSCollation(BaseLocalizedTest, !�): #” string c?P funcHðs with a real English lY!e B s_type =r.LC_ALL!ãdef setUp(selfx|òenc = codecs.lookup(Nñ.getpreferredencoding(False) or 'ascii').name†P0if Sð not in ('utf-8', 'iso8859-1 wcp1252'ˆ<ðraise unittest.Skip/$('~ W¬suitable')u(!=gð and (sys.platform == 'darwin'ÂÕis_android orMŠMp.startsš¿('freebsd')Ò0wcsè÷ /wcsxfrm have known bugsÜ D.ÈÝ@3iskipIfõ ¨oaix'),ëð'bpo-29972: broken ‡s on AIX’H@_strÁ_¬_diacritic^m´.assertLessZ=@('àb'), 0)Íj†Í&=Í$),}2strñb')) class NormØ·CCase>eQcheckOSg£, expected+©eTEqualfnmA)Bb, msg=ì€}âa_alias‰s3foré:!, %ñ5.<w.items(>µ8 º0sub¥=X U?:$l0 É\emptyÂA'„'ÿÌs 'c3C �d'posix!lUe¼� en;“en_US.ISO4ì¹/EN,3en.ƒ‚a&d?_us/#GB//GBî�B.UTFQ"1utf�?0:"?, '1Ð.ISO8859-1', ó'en_US.ISO8859-1') ³self.check(&³US-ASCII', 8[15"565¤Sglish2/ENÕ1“_uk.ascii:)GB:ðdef test_hyphenated_encoding()!):(;8�az_AZ.iso 9eb9/9EÎ '=, '­°tt_RU.koi8cqoKOI8-Cm #9, 'eÀlo_LA.cp1133faIBM-CP7 ?ibm:$a?, 'uñuk_ua.microsoftcp125��uk_UA.CP± <-=ðka_ge.georgianacademy.ÿka_GE.GEORGIAN-ACADEMYž-?, 'ÊEcs_CŒ2†‹2 &<, '!) þ&ßeuro_modifier  `de_DE@/�}é ³5@ Ì@gEutf8:lUTF-8'Í_latinÎabe_BY.F@6ÕŸ\sr_RS==ny< §�valenciaÝDca_E 9g¦+@=&:¼1 ¿¯devanagariçSks_IN‡;éë-@A*>+Æ »ð') selfò.check('ks_IN', £.UTF-8') Fself+(Rsd_INJ°@devanagari<o-A+>+Æ »°+(sðdef test_euc_encoding(…!):!—”�ja_jp.eucQPja_JP /JP¤//jp1Pko_krS/Pko_KR /KR`//kr1Pzh_cnS/Pzh_CN /CN`Pzh_tw"/ TW /TW/ .tw1Pq�japanesem FfF.jis,OJIS7¢Ija.s,OSJIS,_·è?ajeµ?eucG7�˜iso-2022-Ç Ý0iso54 SbFjis7ù/fmscode1³ O.pck.).uì¶Futf8Žð +[ >.-¸`îd_p_ð class TestMiscellaneous(unit­.CCase¤TÏgetpreferredÍŸ# Invoke -ñ to make sure it does not cause exceptions.ÎÚenc = locale.UÀcoding()  €if enc: 1# Iùoding non-empty, make sure it is valid;ñcodecs.lookup(enc) ö def test_strcoll_3303(self)|##ð crasher from bug #-G¢5ó.assertRaises(TypeError, locale.fÏ, "a", None)@#bABÉ"etmœ_categoryÏ$.s)(fLC_ALL‘(OTIME)OCTYP*_OLLAT,�MONETARYƒsNUMERICñª#ËA7419I!Ë  ÎBs, 12345c‹5get=Ÿ_issue181^I #`: settßSand g 3theBó under a Turkishº2old«# =è —ð”ddCleanup½À1LC_;%, i„6try4GŠ�–, 'tr_TR'Ddexcept»o TÓ# Unsupported(õ on this system „Û skipTest('ìk needsB„6loc>gä´ªif verbose«CprinsѰwith %a' % L÷,), end=' ', flush=Tru>6loc†éQEquald!.Æ ´!in=_~£_format_in\tupleQÚ€ ÿK“[ßALL, b'fi_FI'›�iterable–[p(b'not'Ÿ"ñ')) class BaseDeØ1izejLõ@ized&):r_‡%_d2Q,·wue, out2XØK>bvalue)9 eOatof_!8Y iY$*i(Yð class TestEnUSöDelocalize(EnUSCookedTest, Baseö): def test_d>aself):#,._%Æ'50000.00', )6,78�Patof(x‡u", Œ},w- sis "i(s'po(o)€ class zC‰/(C©d ÿr" FEKfrFROFrFR"R,ËN 0007 YJžz~Ëw- s†k oËoËò if __name__ == '__main__'3@unit-.A() #öó\s for the correctly-rounded string -> float conversions # introduced in Python 2.7 and 3.1. import random ˆ $re 4sys ©0sup@ñ if getattr(sys, '�°_repr_styleìÃ') != 'shortódraise qP.Skipê/('ì!->Zê! 'Å„ô'not available on this system') # CY YVsin pureB,�ðcomparison. strtod_parser = re. €ile(r"""–´# A numeric¶²consists ofð(?P[-+])?7à# an optional #…‘llowed byÿ²(?=\d|\.\d)50# azó ber with at least one digit@šP\d*AP# havfða (possibly empty)b„eger parF0:\.ÈAfracLÈE# fo± Ï*ÚGEF1exp P?\d+)J d?rexponenp\Z """,��VERBOSE | ðIGNORECASE).match # Pure Pythoó!n version of correctly rounded string->float con.ð. # Avoids any use@&0ópoint by returning the result as a hex^P. def ðtod(s, mant_dig=53, min_exp = -1021xñ1024): """Cœðt a finite decimalY€ou  represent!anGñIEEE 754 binary64 ÒA. RÈ 'inf' or '- ±n overflow.B This functS�makes no Ðarithmetic atHC¡stage.""" t# parseÇ0intÉ@pairróintegers 'a' and 'b' such thatADabs(òvalue) = a/b, along with a boolean 'negative'Ô0m =~Atod_‹Ar(s)ZÂif m is NoneˆŒpraise VhðError('invalid numericMBing'E2fra-°= m.group('!')h'jÕntpart = int((€int') + 0qR/ )3expPª0') - len(5ô ‡Âsign') == '-ˆBa, b…�ô*10**max(exp, 0), „0, -exp)ÃSquick ¢ for zerosÛwf not aAlå-0x0.0p+0' if ¡eelse 'cñcompute exponent eisñ ; may be one too small in—AcaseŒ#60j€a/b lies5€a differg+pde fromTHd`À.bit_length(tb( += (a >> däqd >= 0 â€a << -d)b.eœEax(dW.°approximate�…Qnumbe/…ðform q * 2**e; adjus.dqcessarypí‰æ"-eåbš+àq, r = divmod(9‹ if 2*r > bÍ A== b©Vq & 1õaq += 1MEIif q0†ë+8-uq //= 2=ePâ# double checkä¢(q, e) hasï@ight1m2lassertƒ%<=œÃeœ¡-B=BAor eÖâAB#¯/ewšs'lif e +«A> ma(brWºîçpÛR’q;v®’ ¹æja¤ò , shift so # bits after 3iqmultiplS4“ôhexdigs = 1 + ( R-2)//"UY= 3 - %î@ = q»Ðshift, e - shñ ift return '{}0x{:x}.{:0{}x}p{:+d}'.format(,0õ '-' if negative else '',!øq // 16**hexdigs% *Te + 4Að) TEST_SIZE = 10 class StrtodTests(unittest.aCase):’±def check_s.ƒ(self, sÒñ,"""Compare the result of Python's builtin correctly roundedcDñstring->float conversion (using ³) to a pure\@ Z Rðimplementation. Failˆ5theEÐtwo methods gœ“differentÕfs.""" 0"ry%ÂBfs =«5(s)'úexcept OverflowError8±got = '-inf`s[0] ='  QoMemoryOm ep'=?lse~xfs.hex(·€pected =L8todÔò.assertEqual(ex.V, got³ ?"In¬û•for {}: "¼ J "w1 {}zD {}"s4s, "))»Óëñ_short_halfway_casesß܃# exact % %ð with a small numberðõsignificant digitsºÌúk in 0, 5, 10, 15, 20‹p# uppers\õ est integer >= 2**54/5**kX32-(-"#É$Z# lowY4odd¼\39 \6\!3/# \#if]0% 2¶ ÔGI+= 1^ierange(¦�>ñ# Select a random À=[ö¼y#6ñ). Then n * 10**kæ9s aß ¢{ðî.;cn, e =².¹ê,ír, 2), kœpð# Remove any addi»@al pÊsq5r¿while n % 5Œ_˜nk5¤+š%ßL 10i³(1, 3, 7, 9K'S# TryRž þpS2**p2xPe, p2Ñ0°Wuntil4ahas mo]nan 20 g onÁ = ô ¡/.! < ”àðs = '{}e{}'.forÿmat(digits, exponent) ÿself.check_strtod(s)ÿ# Same again, but with extra trailing zeros.jæ = '{}e{}'.for£– * 10**40¬_ - 40ˆ±m *= 2 ‘ð# Try numbers of the –£ n * 5**p2—Ï(e - p5), p5GR>= 0, :15 <Ñ.20 •ém= n, eYbwhile .O:'ÑsXfJ,û¨³3R -= 1ðdef test_halfway_cases(n)x#$ $ $7?`round-Æ-to-even rulÜ÷for i in range(100 * TEST_SIZEf£Ñ# bit patternca8ùdom finite positive (or +0.0) float%0bit prandom.}²2047*2**52)t™# convert€Cto a. -vm * 2**äCàe, m = divmod(‚,%kFif eZ¢m, e = m +49- 1Õe¸<074»Éadd 0.5 ulps2V 2*X1T #ùíédecimal string*¹ ø¾±À/<<×y9= 0T?els $# a@ = ( c5**-e)› wB€Æ-#ƒ ( H ;ÖMb?ariJ£ðressed as triples (¦, u), wher­@# n*1ñ e is an approximation to�^±y value andš%6# u@E1ulp5 ie [5¯0ð , -19, 1110), # a power%#2 O[y (1.Îð (17976931348623159077, 28O 99oO‡overflowKŠ2.**1024Ôð(22250738585072ò013831, -327, 4941), # normal/sub ç (2.**-1022) ,(0= i# zero8]õ for n, e, u in boundaries:#H'j!ºrange(1000)"&ðdigits = n + random.5š-3*u, 3*uÄ9Éexponent = exQ�'{}e{}'.f"t(i$, 8Rþself.check_strtod(s%}n *= 10ruqe -= 1 0ódef test_underflow_= y(}#)ñ values close to 2Ó…75, the G„¡y; similarp #7f_~s€cept thaexö error doesn't scalZ…# with nYßLæ2-40` ìPbase :5**-7 //ÒE1075W´[:—TEST_SIZE 'Ö1 = `Bx , Í'7Àà|bigcompÕØPndigs05•p, 14, 1 ð6, 17, 18, 19, 20, 4Z1, 508Sdig10MP~fibC_10 * Cw ~h6¿=9±>4007mE|parsingmñ# make '0' more likely€e chosen‚n other IIQ = '0¥123456789'#@signÔ€('+', '-"')ꈡ# put togea^` shortØ¥id stringsRÆ# \d*[.\d*]?z Ð H"0±Š�.choice(Ç®Ïintpart_len è52Ús += ''.join(dN ) ©_›d)P$if_ªß[True, False] u….¦OfracÕ;TÙ Â/ úŠûGelseóÀ fûracpart_len = 0 ýif random.choice([True, False]):1@Ls +=7¯'e', 'E'])3_signs.texponen·¢¯range(1, 4:›€''.join(1Ú_digitqÖ€for _ inã8ge(�=)) ßeif intf7+ fuAÿelf.check_strtod(˜Oelse??tryÃ_floatPÿexcept ValueErrorHMpassìD˜bassert@·, "expecteds"Cð@test.support.bigmem`(size= ñ _2G+10, memuse=3, dry_run=§ @def 6P_overD!d_òbàings(self, maxÚð# Input string whose length doesn't fituan INT.ôs = "1." + "1" *^!Pwith y.vRaises(€ˆ> ½Rdel s1 q0q0q�wBXdlarge_P¿ð# Verify that the clippS!of;J÷`Qaffec6ÄP# out˜v­su‘qpositiv�'(n†%…""" LongÒ…F• 1.0 and ‹En"""s=÷return '0.{}1e+{}'.format('0'*(n-1), n�Onega�2-�[1{}e-ŽnŠhbEqual(N ,€10000)), 8õ:2:&3: K® :® : ®ã[åaicularNx0# iEsþð!produced crashes or incorrectly rounded results 'j�±# previous Êðons of dtoa.c, ž1var freason§¥Ðstrings = [  ö&# issue 7632 bug 1, originally reported failing case ?ñ '21831670123121ù312.23538020374420446192e-370',@ü# 5 instances of�2.û)'12579816049008305546974391768996369464963024663104e-357uÿ$'17489628565202117263145367596028389348922981857013Gð8487398785991994634182916638542680Q¯1359048227Gð#32002864200581033134358724675198044527469366773928Ž8Õñ"9439343119318069694284183708503364791322414853985 GÐ7360827899896Fñ34582465350013678787643600595795Õ Gÿ!647744788364172994917184352346112993362880821360Žð13704940134126574534878641876947980878 €88451169 ñ 46'ð45774047060960624497964425416610480524760471G Õ#A for4ùintroduced by METD in r77451 (attemptedÊQ# fixB�,Np2), and $edI982.?ð'28639097178261763178489759107321392 0849182530¦+114ð # two numbers demonstratë`a flaw�ùthe bigcomp 'dig == 0'�ü# correction block (Ù)3)3K'1.0K1e44¢& 6=�# dtoa.cX®êð just smaller than a power‚2» ®##¢4É9À448766546555Nü717039532578546e-4 Yÿoff-by-one error f ¤tC83 (÷šcleanup),M)907p'965437Eð336549317990355îû 1997118345570045914469' #..“ 62¥0335Ò04169þþ007991306908470147322020121018368e#inQƒ lsb det\Æùround-half-to-even whenÕó# bc->scale != 0Ô éÆ+6)Àÿ$1043084852419839906667134017080721757731650342786850826áð176229240933092)ÿ75170240465819787231912N@0365Sp7435319ÈÀ878397589904J0947�58667307Žð94584489598101202438÷7992135617064532141489278815239' #... ÿ%'849108105951619997829153633535314849999674266169258Gÿ#92894069223968477159006502702583580486358545487249Žÿ$320500023126142553932654370362024104462255244034053Žÿ$203998964360882487378334860197725139151265590832887Gð433736189468858614521708567646743455R¿05935595381Gÿ$852723723645799866672558576993978025033590728687206Gð2963798013630240940483272739130796124699825¢O4824Gñ156000783167963081616214710691759864332339Ë?873G0656ɰ90656486646@ÿ83450809073750535624894296242Žð 072010195710276073042036üÿ7985245955618354119901G÷0652571123898996574563824424330960027873516082763671875e-1075', ù, # demonstration that original fix for issue 7632 bug 1 wasY#ñgy; the exit condiSéwas too strong7ÿ '247032822920623295e-341¥ûe similar problem to ‰1: crashkð# with 'oversized quotient in Ërem' message6ð990374857002456831028050434373469652480296012Qk1e-373Æð'9961763983374386316110P16288ÿ406769510558457G0885µ 02S€34529574øð3515631798401305ñ@1462G2Ž`059944"0935Å ð 042769690930905148015876788GÕp8914979Ëð69368270421829889yñ5625405976032710 Ž#Ã1 5:K°following 2@@ingsZùvert differentlyê?'10Le-16<[0e-17= Å7˜à99163379318915 ¨L0e-3xä# And another,`, fail/Êhalfway case†ÿ410625019803949ƒ„8ð ;8: ¶Úproduced 10.0ˆ<10.}š123456789 5', ;À # two hu÷mongous values from issue 7743 ú+'116512874940594195638617907092569881519034793229385' #...G`228569Lð 9154189084656466977171489Ï084883987920Gÿ$473321268100296857636200926065340769682863349205363Gÿ 47637660671783209907949273683040397979984107806Gð461822693332712828397ÿ 4603623958163297658510063Žð520260770761060725~ÿ04123144384571612073732754774Žð588211944406465572591022081973828448ß¿38602556287Gð85183174541939743301249188486945446244[Ÿ895047499Gð 4365519746497319171700993877{0102e@5829V?343Gð76193341216682148401588363162253931420379‚o497982Ž�1300387412½ÿ4295756733024613803865965011874Gð006257527709842179336²à816728187984503912352cð8844448336815912 @5229\ÿ91699354638895656152Õ�61875352ëà04208236074787F@9460&¯2830869374Gð05287663441403533948œú85390898399055004119873046875e-1075', çP52544ŠÀ352955266109�603582028AÏ125898496491à89225652784975ð045218257059713Rp7425143!/61=@4432ÌÀ599887000163æð65751744735599222585294‰=ð016668660000210283807209850662224417 ¯5226499536¼ð63151200775385580B@3730Åÿ215773875280084030259uð2370502479105305382500086822727836L¿81816280407uð65312149243640881266802347800120ׯ5925432234Õ0397M@8524Ô@7885àÀ072295878464�0528O4309G!11È1Œÿ498801734246927500699910451962094643G‚à67147966495485�0777Îÿ2687838176778993472988`561959ïð47036638938396333146685137903018376Ç/088p3197053s€84769252  7136513970 73@1471031Gð9912528110505017Ë@5232‚0ï77609130304371‚À'15719129282÷!7614046876950225714743118291034780466325' #... ð'085141343734564915193426994587206432697337P_11527Gÿ$278968731294639353354774788602467795167875117481660Gð4738791256853675690543½ù83782215866825e-1180', Íð# exercise exit conditions in bigcomp ¹arison loopBÿ''2602129298404963083833853479113577253105939995688e2',C,096eË– ˆo9601e-�05�17E/926\z# 2**53µü9007199254740992.0“7`1024 -Aù970: exact overflow boundary. All valuesið # smaller than this should r=ò to something finite; anyN MTgreatM€or equalDY5oneœsøÿ#17976931348623158079372897140530341507993413271003øð8269361737789804449682927647509466490l7NO7096øÐ3302864166928;ÿ55554785194040263065748867150Íñ8206819089020007¾ÿ67627385484581771153176447573†ð27006985557136695962284291481986083493âê_19074Õð168444365510704342|ü5969950809304288017790417449779Âwy - tiny 'cÏÿ‚[1.999"Ó+ÓÀ303415079934÷132710037' #... ÿ%'826936173778980444968292764750946649017977587207096Gð33028641669288791;ÿ555547851940402630657488671505Gÿ$820681908902000708383676273854845817711531764475730Gð27006985557136695962284291481986083493âê_19074Gð168444365510704342|ù59699508093042880177904174497792.001',fù# 1 - 2**-54, +-tiny!+'9û44488848768742172978818416595458984375e-54kJ#4Q6!501Qñ## Value found by Rick Regan that gives a result of:99683ð # under Gay's dtoa.c (as0ú Nov 04, 2010); since fixedÿ@# (Fõ some time ago in PythonZ).)}1'0.à1$bð05761291134237854299716904211912140?5437ÿ#08714776317814976295686899169228986994124665807319ð€51982237lû 82039897143840789794921875q]Pfor s<Õtest_strings:v self.check òtod(s) if __name__ == "__main__"=@unitS.¤() import ` from ! 0sup")usmtplibÓocket ssl = ,.;ô_module("ssl") ðrequires("networkCdef Ìðsl_verifiy(host, €)¿pcontextlósl.create_default_(_awith s )¸connection([A) as*d\6try I3 = c`.wrap_0et(�, server_²~= ‰?�except E:ion]Åreturn FalseãJelse'ic.closeãZ@ôTrue class SmtpTest(Û.CCaseKåSµ@ = 'ر.gmail.com'†premoteP a= 587 ª<oN _starttls(‘]–ðàget_attribute(iölib, 'SMTP_SSL''_ßBSSLCðý (ssl.PROTOCOL_TLS_CLIENT:}†+ =Ua.ay¢em‘CERT_NONEåÀAðupport.transien÷t_internet(self.testServer): sü = smtplib.SMTP4!, E¹remotePort)D:tryU`Yó.starttls(context= Biexcept„EŽion as e`ðif e.args[0] == 'STARTTLS extens:ónot supported by •'O³@unit)e.skip(^ «)?els’YraisesZehlo(Jõ quit() class SmtpSSLTest(‘CCase½¥Î@ = 'º±.gmail.com'~«q = 465 @def <r_connecT¾,ð.get_attribute(``lib, 'V_SSL'ÉDwithdŸ.transien~+b‚Keæ �_default_(y’„Õ+“using_sslž 'rsl.SSLCÎö (ssl.PROTOCOL_TLS_CLIENTœ:÷.check_hostname = Fal*' verify_mod$^‘CERT_NONEÂëÒ¦‘#, Ù÷µ;_=, uq'Python8's'€product_>81.03PSF)k°return db, €Ó class MsiDÞ£Cæp.1): EÂ_view_fetch_Y³s_none(self$ên0db_q, =KR&õproperties = []eò = db.OpenView('SELECT P3Õy, Value FROM'ò[CÖ.Execute(None¢while TrueÔ/‘record = <Fä(6"3if %0is U A#UbreakÉå‚.append(DÖ.GetString(1)h}0ClotH> 4) & 0xF] + h[i <àreturn r URLoñhttp://www.pythonìònet/hashlib/{}.txt"ÛÐread_vectors("S_nameé÷url = URL.format!~6try³hñdata = support.open_urlresource(url):ñexcept (OSError, HTTPE3ion Faise´ôSkipTest("Could not retrieve {}"©ijTwith œ®u@linexz = r.strip(Q$if@artsg�('#') or–8o1�continuepA kŠplit(','n$R[0] =j”.fromhex( /ayield ð class HashLib?UCase( w¾5ed_ñs = ( 'md5', 'MD@sha1iSHA1',ÒÖ s'sha224/ $56 E$38E csha512E E pblake2b2 s½&3_µ03_2­ Õ&3_ˆ/3_€�shake_128‚ O!) ¸o{^)})ð2# Issue #14693: fallback modules are always compiled under POSIX  ð_warn_on_extension_im»` = os. ° == 'posix'ÛòCOMPILED_WITH_PYDEBUG’*Ã_conditionalK_‘c(self,žeˆB"""Ixa"@ andÚÞða reference to it‰òNone on failure.""YO ˜'ÜBlib. ›¢•†4£MO�NotFound®P as e· à0if ä.U /dPings. ¥('Did a C ŽÞôÂr? %s' %~òß‹s_init__y°*args, **kw ì…�algorithmw7setè&+á! Ü4es.add(ƒ.lower()í~_…6Oelf.A'+3if €Àms.update({'²blake2b', ' ss'}) õself.constructors_to_test = {}'öfor algorithm in %s:%SP[?‡] = set(†¦# For eachY!, ‡·the direct §P and 5use€ñ# of hashlib.new given'}e name.3 Ø,bsæÎŠ.items()ý¡ãs.add(getattr(•,Þ%))„7Adef w_ªS_via_9ð_new(data=None, &=*«, **kwargs�Z0if 9@ is < ±!hreturn<(cY ®3 n9 !ô # =ôlf._conditional_import_module(','e4if  ¶# These twožñs should always be present whS2is n #gôcompiled. If not, something was !f wrong�Wr assertTrue:B½û, 'openssl_md5'G>Lsha1?;Ïñ4 = Í''+Ï©»H(if  Æ p‚Mo°add_builtinL(! HEÆœ�, "__getM"")O %¥Ss[{]9·óuü:md52ÿ'<_(t) qv+>w?256y7256=ðosha256}7224BK![.­?512­7512=­?512­/38­ Ànstructor('s“ha512') µif _blake2:ò add_builtin_constructor('-sC/Eb') _Ð_sha3 = self.]ñ ditional_import_module(')i¬<ª+G_224B« 0/560/38` ~� oke_128‘Ake_2Ânñsuper(HashLibTestCase,}ð).__init__(*args, **kw ®‘@propertyN€def hash³ s(Æ)’,säö_to_test.values(Šð return itertools.chain.from_Xable(K¥0sup7‘.refcount`²Q@unitn�skipIf(c_Áõlib is None, 'Require uõBÁ_refleaks_in*_< „gettotal�¢üget_attribute(sys, '/xAsha1l5 = º`.new('*ìrefs_before = Se÷for i in range(100¼ t mðþ.assertAlmostEqual(v7 - ™Ó, 0, delta=10¼^—l_arrayQAa = .U("b",¾)?ÚÝ¢S»s¥écUVons(aD•if c.nameI[shake>*êc.hexdigest(16FJelsep 2 üalgorithms_guaranteed Ù{uåOlib.>,yPset(_( + !in .C!edo_ÿs=A �B¿.islower())ÇQavail¶·hAPTrue(šÉ /).�“_issubE… ªbunknowÍh€Raises(V¯aError,u¿new, 'spam ŸñOOTypeN1P3ˆSS' Àattr(hashlib?, õ '__get_builtin_constructor')Gÿ _cache = getattr(hashlib|O '_z\€ðself.assertRaises(ValueError,‚Fw, 'testGEtry:Ô"µimport _md5�except Ib 4Œ skipTest("<ö module not available"?ø# This forces an]' "‰Å" statements•Qsys.me0s['s•'] = None#Á# clear the œ¾.2(© !íy 7md5xlfinall|"f ÊÊ in locals()k£úà'Nelse=Odel A:ß?TypW31/ ‰*('v7Is(C,ŠF.md5b-ßEqual(sorted(Õ±), ['MD5', x1]) ð@def p_hexdig½\s@for Ž‘.Ósb1h =0A‹•if h.nameH[shake=*e^ÓIsInstance(h.Ÿ¦16), bytes7;@hexs†=V), h.î:16)H4Z•“()‘)š5_M`ibute(ŠŸ?VL à}Z, str%Î up61ed_ 8Ü "n(!, }sA ušONotIV}o4§ , Èslib.newª)  ®large_updažñaas = b'a' * 128tª2beeb7cc6ddò 2048 # HASHLIB_GIL_MINSIZEÛð for cons in ÷ self.hash_constructors: Pm1 = +()¿.update(aas?beecdáif m1.name in ¹[shake®¹ºargs = (16,˜JelseÝ/*) à2ø2ø0 + ã0 + Î> + ¹«ðassertEqual(m1.digest(*ªZ), m2 Š3Š?aasr43r ú# verify copy() doesn't touch original/4¥ …2m4_ÿZ = m4‡ R_' �4 Žz#D’‘ °À µ%, Ó¹ def check(= , ¶², data, hexm!, ÀÁ=False, **kw¡Õlength = len(8E)//2(& =Zg.lower.¾Ý" ==�_to_test[©]]°# 2 is for $1lib€–(...) and0ew(; , @ý.úrGreaterÏF), 2tox_objectšú9+ÈmÌ9(|d£8€computedi.Q’() if not§ <' m ž¸Kòë i"q )ñ"Hash algorithm %s‰Ë€ed using†returned"P1 %rÏ`%d bytJ1put™@ thaë0oulØ!veÝŸed to %r.P#% ÷°,†6  �) )U- <�š! =ø—s.fromhexV « È„", I ¢) ”ï Môü\_size@³_no_unicodeK _q)n2# U) ÿQs areÀ alðd as input. c÷onstructors = self.có _to_test[algorithm_name] ÷for hash_object_=G in %s:5<kÿassertRaises(TypeError,R¡, 'spam') K@def �À_no_unicode(W)jh.check%a'md5')D‹%Osha1&?224(/56(/38P4512 ñ@requires_blake2Ü 'Lbµ)sŽOsha3ŒŠ+_h?3_2j_l"3_n0YŸshake_1284+ª#†‘blocksizem# , x!, _¤=0, digestF�,·length=None(¨ †þ0?m =å(™Èi(†Equal(m.7< : 9$ifV*LŽ ’blen(m._(_=?)),• P 2 0o2hex9r "2*;¦ tOelseõ/))RäÅB—£ – @ m.Š +€# split š7p512 / _ . « õ`0In([.Fü("_")[0], repr(m){Œ°«WWÔƒ†, 64, 16Á1�2/2023484À self.check_óblocksize_name('sha256', 64, 32) ¿self.check_4ß384', 128, 48545125A64) ká@requires_sha3‹def testx!(—!):(©¦1_22¨_44, 2¨"3_?136_/04"3_ 72…L`ke_128O_68, 0¨(keà0vRzó�l , (÷ , capacity, rate, suffixŠòconstructors = ™@_to_Ö[P]oÁ÷for hash_object_GG in sö9?m =9(E*‹ÄassertEqual(Ì# +ÍO16004 4m._7V_bits925 1]e*_extra! Ôñ3ö448, 1152, b'\x06'›5 8+Ÿ512, 108887«/83oŸ1024, 576op256, 13ýà/1fà  á9²®ablake26Ú °#F(Y X1bÕY$À6sà –¯case_md5_0‹`('md5'`ó', 'd41d8cd98f00b204e9800998ecf8427e'¼ùc1c0abcfÿ900150983cd24fb0d6963f7d28e17f72f2f8÷4b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', N ð'd174ab98d277d9f5a5611c2c9f419d9tŽP@unit'ð.skipIf(sys.maxŒÐ < _4G + 5, '$ó cannot run on 32-bit systemsÆp@bigmem/(E=Cð memuse=1, dry_run=False) ó def test_case_md5_huge(self, size): ð.check('md5', b'A'*&ñ, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') JP@unitsð.skipIf(sys.maxGÐ < _4G - 1, '$ò cannot run on 32-bit systems')Q`bigmem/(E=Còmemuse=1, dry_run=False7úuintmaxý!ô28138d306ff1b8281f1a9067e1a1a2b3ý€# use thñ+ree examples from Federal Information Processing Standards÷‚# Public'õ180-1, Secure Hash/ó, 1995 April 17>ñhttp://www.itl.nist.gov/div897/pubs/fipYB.htm¾ 6asha1_01(")1"",xKó"da39a3ee5e6b4b0d3255bfef95601890afd80709">€1€?abcƒÿa9993e364706816aba3e25717850c26c9cd0d89dƒ2ƒþÿ+b"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqËÿ84983e441c3bd26ebaae4aa1f95129e5e54670f1Ë3Ë¡ b"a" * 10Ùð34aa973cd4c4daa4f61eeb2bdbad27316534016f‹:2Ó2002 August 1ƒFcsrcph2"s O.pdf#?224%>224'ñ)"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42Uc .‹0 ‹ 2ð "23097d223405d8228642a477bda¶ð 32aadbce4bda0b3f7e36c9da7ãŽ; ŽžC |41ÿ*"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525Í = ÍÃ?ñ)"20794655980c91d8bbb4c1ea97618a4bf03f42581948b2ee4ee7ad6c%ò+56}À self.checõk('sha256', b"", ð6"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") Nâdef test_case_o•_1(self):qZ.chec“:abc–ñ4ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad") t–2–?Ùú- b"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqÕÿ2248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"Õ 3ÕËa" * 10 Àcdc76e5c9914úð!81a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 5 t_384_0Ÿ ?384�ò438b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da"+ Ãð"274edebfe76f65fbd51ad2f14898b95bÂ)ÁË Á Ëù2cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed"Äÿ8086072ba1e7cc2358baeca134c825a7Ä ù ÄÄöú þ "¾R b"4*4.424@opqr@pqrs@qrstJrstuR0093>ð3f71147e83d192fc782cd1b4753111b173b3b05d22fa0BõIf712žð"fcc7c71a557e2db966c3e9fa9174 \ € \€ @9d0ecú)716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5bÌð07b8b3dc38ecc4ebae97ddd87f3d8985Ìê í?512®?512®ø2cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce",ð2"47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3eâqáÎ á Îü0ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39’ñ*192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa5‰fäÀ2_2(self):  òself.check('sha512',  £b"abcdefghi!ij0ijkpijklfghm?n"+P&!no-³nopjklmnopqr!rs0rstXrstu" ù2"8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018žð6"501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909") 7âdef test_case_X0_3(m%): |¡ b"a" * 10 ìø2e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"Šð#"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e46¸217ad8cc09bìAq_blake2æó, constructor, salt_size, person 2key >0digE9¬max_offsetCÇassertEqual(w§.SALT_SIZE�)jõfor i in range(£G + 1b�U(–=b'a' * iN?3 = &ÚNtò¯ðRaises(ValueErr&g²=V)Sˆ?îcPERSONðf¤ ò$+ò (ôöø+D=ü”MAX_DIGESð:71, '©œo�(*=÷?ÑB&-1–Õ C0B.N/+1j3KEYgÀŒ d!a ?key^7key[I§P!e6keyªx Mb().hex!(()…#b9b'';W o0, 256iofanoutm$= hÀf.assertRaisð es(ValueError, construct ãfanout=256) ðfor i in range(1, : 'F•(depth=i)!ÿself.assertRais� </-1=(0<(Ùù0ù Rnode_Âþ#A$BÌ ÿdigest_size + 1)ÑQinner)Ö$AØ$B¸'+1§ƒBleaf±!(1<<32)˜ �Overflow4lD1Ž„µÝoffset=Ø#Bmax_. Û NÝ'F”¼7X¹string=b'',>keyNsaltnpersonH:=17_1Û ÿ:2560ù?512Rì —Plast_VU=Trueðdef blake2_rfc7693(z ã md_len, inö?0t÷eq(length, seed(—umask = <‹aÂ0xDEAD4BAD *B0 & 7 +Yb = 1óout = bytearray…Áa ‘¨ ¢(J(a + b)}#0a, „Ib, t‡`out[i]Ípt >> 24FI0xFF*–return ouAxouter =[(n&32ÐÌ`outlenb� Š"#in!¶ !¬Pindaty Â7ð, inlen)  ò key = selftest_seq(outlen, $) +ñunkeyed = constructor(indata, digIOize=BÓouter.update(O.9.()qo key=keyx Vv`returnþder.hex˜ ñ@requires_blake2Adef ? b(P!):6c.check6“(hashlib.1B, 16@64, –(1<<64)-1ð b2b_md_len = [20, 32, 481]l&$in&%P, 128Æ9, 255, 10241�ÅassertEqual(K»¦Ž_rfc7693½tš , €)),Jÿ4"c23a7800d98123bd10f506c61e29da5603d763b8bbad2e737f5e765a7bccd475")ƒCcasef?b_0Š"('Öxb', b""¬÷4"786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419"+úð("d25e1031afee585313896444934eb04b903a685b1448b755d56f70/o9be2ceø 1ø:abcûð4ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d1"+ 7ÿ2"7d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923û ìall_parametersq# This Œös that all the 5ñ work in general, and also2Ü#4ð byte order doesn't get"õfused on big endian platforms.M‡˜ š:foo¢ù920568b0c5873b2f0ab67bedb6cf1b2b.½ _sŽ(16å9Yb"bar0Psalt=z`person9ingˆfanout=2[xdepth=3Bleaf†4Ýnode_offset=5H ¶RinnerI70Plast_No=True))ÿ0_veÀ *‘for msg, ^ mdEread0@é÷RÖs.fromhex(keyÈ%îp!mdtÖÈ ÀbÐ(hashlib.blakae2s, 8@32, Ã(1<<48)-1) ð b2s_md_len = [16, 20, 281]&$in&ö0, 3, 64, 65, 255, 1024/õself.assertEqual(Ivòblake2_rfc7693(hashlib.6s, ˜ ~)),Jð6"6a411f08ce25adcdfb02aba641451cec53c598b24f4fc787fbdc88797f4c1dfe") “¢@requires_�fÓdef test_case@s_0(À!):#<‚.check('>xs', b""¬ÿ2"69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9ª 1ª:abc­ñ4508c5e8c327c14e2e1a72ba34eeb452f37458b209ed63a294d999b4c86675982") Wìall_parametersºq# This fös that all the 5ñ work in general, and also2’±#4õ* byte order doesn't get confused on big endian platforms.Mþ:fooTùbf2a8f7fe3c555012a6f8046e646bc75.0digyxsize=16I™key=b"bar0Asaltz`person9ingˆfanout=2[xdepth=3Qleaf_†4Ýnode_offset=5H ¶RinnerI70Plast_N_=True6cn_vecto*ðfor msg, key, mdEread0¤ÃQkey =Ös.fromhex(key*%îp!mdt=4þAsha3 SO_224T &Uð$b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5amMe¢ n —mhSÞ'iD$,µ-md#š/56</56<ÿ2a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"ªD&/56DäÐmsg, md) ñ @requires_sha3 def test_caseÑ_384_0(self):$(€.check('=&u', b"",$ø6 "0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2a"+Nñc3713831264adb47fb6bd1e058d5f004") /ØlvectorÝòfor msg, md in read_*sîHš?512r?512rð4a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a6"+ Îÿ2"15b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26’øh’’ $,Ú’oke_128“'”ø27f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eacfa66ef26"TQTrue)ç¤ ˆ ƒ "y2", 34 keî‰#�Š %‹¢ O_256‘?256‘ÿ246b9dd2b0ba88d13233b3feb743eeb243fcd52ea62b81b82b50c27646ed5762f"‘ƒ "y‘!î‘&�‘%‘ 1.0'ÎcÍ“ Ì‘ÍoscryptÈ$1ÈN ÁDfor I=P, n, ¥p, expecÒ"inD½zvectorsâ ! =Ì2(c=¥@, n=j=l"=pv¡" n?ŠY“0€# this vÍÑs should workn"Y�0× n=2, r=8, p=Š#$A anddõ must be bytes-likep6ŸyΞo+ñ 9@ key¨_ argsý4Žá8\.Àscrypt(b'pasð sword', 2, 8, 1, salt=b'C') ñfor n in [-1, 0*eNone]:#*ówith self.assertRaises((ValueError, Overflow2Typ*))LPôhashlib.scrypt(b'pas²¢©ú, n=n, r=8, p=1¸r¸µ|2µrµpµ�jpjemaxmemºl�·)1,¶j Ê= åFdkle ä¨É=ò) if __name__ == "__main__"—�unittest.�() from ¡support imó%check_no_resource_warning, findfile, TESTFN, unlink ;d]YBmockwPaudios$op„byteswapc$io 5sys TtructDaifc »ñs class AifcTest(hx .AƒPWrites] +&QWithS CFileü‘module = „”ñclose_fd = True¸vð_unseekable_rea ‹ ¨@PCM8l(µpÆ4Casys™ÿñ = 'pluck-pcm8.aiff'w$Ñframes = 3307€nchannel2Ñsampwidth = 160ratÞQ11025n8!48pcomptyp&bb'NONE|�`b'not bressed!Hñ.ž�hex("""\Xó0 02FF 4B00 3104 8008 CB06 4803 BF01 03FE B8FA B4F3 29EB 1AE6 \Dõ,EDE4 C6E2 0EE0 EFE0 57E2 FBE8 13EF D8F7 97FB F5FC 08FB DFFBDð&11FA 3EFB BCFC 66FF CF04 4309 C10E 5112 EE17 8216 7F1°%12D 49&ð20D EF0F CE0F E40C 630A 080A 2B0B 5Nð8B11 B60E 440A \ """) ð class AifcPCM16Test( °, unittest.ùCase): sndfilename = 'pluck-pcm16.aiff'%Ñframes = 3307€nchannel2Âsampwidth = 60rataQ11025(n8!48pcomptyp&bb'NONE|ž`b'not bressed!Hñbytes.fromhex("""\Xó< 022EFFEA 4B5D00F6 311804EA 80E10840 CBE106B1 48A903F5 BFE601B2 036CFE7B \Põ8B858FA3E B4B1F34F 299AEBCA 1A5DE6DA EDFAE491 C628E275 0E09E0B5 EF2AE029P0575#ô21 FB35E83F 1376EF86 D82BF727 9790FB76 F5FAFC0F 0867FB9C DF30FB43 ðõ8117EFA36 3EE5FB5B BC79FCB1 66D9FF5D CF150412 431D097C C1BA0EC8 512112A1 ðEEE21753 82071665 7FFF1443 80Eö8F 49A20EAF 52BB0DBA EFB40F60 CE3C0FBFPð4B30CEC 63430A5C 08C80A20 2BBB0B0…@4A0Ebõ BCF1139 B6F60EEB 44120A5EPj""")  24é(/24032¢l�D65FFEB9D�A0F00FA54 ö3C304EE2B 80DCD608430M²CBDEC006B26€9803F2F8!ð82401B07D 036BFB'%5D™`B85756+ C9-�055F3502B1�830EBCB625•CA7E6D99A<A 3EC BDE�5EBE27884I 5AK 6CF EF2929O%22<QDS1067U€57E83E16Y�7BFEF8402]!C5_2xÀ978F16FB7745m�865FC1013q0635s"4EuCãE‰À117FE0FA3438}�6B8FB5AC3��7A3FCB2F4…†6DAFF5F3´`CF13B9N!75•q69097A8™öB600EC74E 5120B912A2B´ÁEEDF641754C0¥�001664B7©«053F­•0001294E6,À499C1B0EB3B2½�73E0DBCA0Á‘2B20F5FD8ÅvDB0FBE1´ÀE4B49C0CEA2DÍ‚4A80A5A7Ñ€FE0A1FFEÕ†9860B0A0,ð 51486F0E44E1 8BCC64113B05é04ECë 36í•3170A5B48´ñ/32ñ,/32ñ04ñZÀbytes.fromhe�x("""\ ó6022D65BCFFEB9D92 4B5A0F8000FA549C 3113C34004EE2BC0 80DCD680084303E0 \LðCBDEC0C006B26140 48A99Kð3F2F8FC BFE8248001B07nõ036BFB60FE7B5D34L`B85756…ñ3EC920 B4B05500F350‡õ29983000EBCB6240 1A5CA7A0E6D99A60Lõ4EDFA3E80E491BD40 C625EB80E27884A0 0E05A9A0E0B6CFE0 EF292940E0292280Lp5758D80;ð06700 FB3557D8E83E16‡÷377BF00EF840280 D82C5B80F7272ALP978F1äðB774560 F5F86510FC101364 08663�õ B9C4E20 DF30FC40FB40EE28˜ð117FE0A0FA3438B0 3EE6B8*ö5AC3F0 BC77A380FCB2F454 66D6DA80FF5F32B|PCF13B¸Ð41275B0 431D6à97A8C00 C1BB60}°C74E00 51203w12A2BAA|ðEDF64C01754C060 8207:²1664B780 7Fp14453F4` ‡001294E6``499C1BvðB3B270 52B73E000DBCA02·ð B2B2E00F5FD880 CE3CDB400FBE13øðE4B49CC00CEA2D90 6344A8800A5A7CP8C8FEð1FFEE0 2BB986C00B0*äP514863ðE44E190 8BCC6480113B0580 B6F4ECºÐEB3630 441317]G5B480ð """) class AifcULAWTest( °, unittest.aCase):‚ùsndfilename = 'pluck-ulaw.aifc'$Ñframes = 3307€nchannel2Âsampwidth = 60rat`Q11025(n8!48pcomptyp& b'�|�"b':Ìbytes.fromhe¡�ð8 497C0104 307C04DC 8284083C Cé269C$ð3DC BE8401AC 03Ñ7Ý‘B684FA24 ð344 2A7CEC04 19FCE704 EE04E504 C58wp4 0E3CE}vEF04DF8Pð557CE204 FB24E8G02FC'° D784F744 9t°B64 F5C4FC2Ùp3CFBA4 L:É!FC P3E7CF5ðBA84FCB4 657CFF5C C[ 41C 417C090184 • 517C12FCPŠ216F.´15FC 7D7C13,[1EBC>Mp F0040FYDDP�5040CBC 6|�A3C 08BC0 s2C7C0B3G€E3C 8A84Ïm 2457-‰ñ‹pif sys. âorder != 'big'Ý# .Bwap(:, 25A5,a5m�"5$�30FFE8 4ALàF8 310004E0 82ñ000840 CB0006A0 4A0003F0 BE0001A8 0370FE78 \ ð-BA00FA20 B600F340 2900EB80 1A80E680 ED80E480 C700E280 0E40E0"F8 P#56#`FB20E8Gð380EF80 D900F740 9kÐB60 F5C0FC10 ·�FBA0 DF00: 2118 36Ì`FCB0 6GðF58 CF000420 420009Ð1000EC0 52001²  EE801780 8ÞP7E001Þ,7>P0DC0 À 0FYk5FC0 `0CC0 6| A4Ì0C00 2‡"B4…2P 8A00Ñm 2460- A""")›ñ if sys.byteorder != 'big':½�frames = %Rswap(ð, 2) class AifcMiscTest(audiotests.A ps, unit.)RCase)iámodule = aifc |@def +ó_skipunknown(self3œ±#Issue 22454ñThis file contains chunk typesbõ doesn't recognize.@c#.f‹ .open(findQp('Sine-÷ûHz-300ms.aif'))³`close_<0ed_:¬s_on_errorÃ@non_õ'6 = lñ pluck-pcm8.wav', subdir='`Rdata'Åöüwith check_no_resource_warningu2íÐassertRaises(Œ .Eªh0`# Try Øáing a non-AIFCo!, …õthe expectation that]E1# `iKÐ` will fail (C‚out raisdRÌWËóHÄ ± Uc, 'rb'£1#³ñ_write.initfp() wo ñ in normal case. But some ÈsÔá# (e.g. Memory?ö, KeyboardInterrupt, etc..) can happenx–þò mock.patch.object”c°2, '²)',…Bñside_effect=Runtime¡à€P 6 t5fºÄ9¥TESTFN, 'w�×Ìparams_added ÎR ˆ Owf„&f(Rf.set_U((1, °b'NONE', b'´=!f.°(#� Q<k¼%.gy�ÉPbEqual(0Ð.nchannels, f9/()=“sampwidth==ÁCrate==Àual(params.nâframes, f.getnS()) óself.assertEqual(params.comptype:;8nam;;wôdef test_write_header_b°_sampwidth(œ!):4®Dfor &ñ in (b'ULAW', b'ulaw AaWG722'GKöut = aifc.open(io.BytesIO(), 'wb'#1ÿ.setnchannels(1!bOrate!Â( ¿njclose(f ®@foutÚ5J), 25$Ñinitfp(None) S ‡îmarkers_values|1¦dc‰[£0set!P(1, 0Gfoo1 $1$2$z P(1), ^:*; 0ersµ[>]?žePread_ßKl’<0 = . šlTESTFN”'W.aiff!2setÂ(¬11, ðANONE"'þ3™0x7oddS #2›Leven$ÎÿŒs(b'\x00" Òfõ Œòr†©Ò¹R1), �Á:, (®­L$Iä72[ p8qRaises(ßSError`Èð, 3) class AIFCLowLevelTest(unit6.kCase):Èc†L', 0);,b28OFORM8q4) + b'YBxòªåO, b15!2 Ýno_comm_chunk ÓOAIFF{ Ó�Ossnd�/b'eQAIFC'±¯b += b'COM›PhlhhLÙ"38ìE, 8,<@ð0x4000 | 12, 11025<<18!>zMNONESB', 1ànot compressed+ÑJhRegex(_æ Ù and/or SSNDÓ p' missià ùtš(†)Òxà}ion_typ b ¥ÛC-23ÛÀ  ô 0x4000 | 12, 11025<<18, 0) +ùb += b'WRNG' + struct.pack('B'+ñself.assertRaises(aifc.Error, ñopen, io.BytesIO(b)) lðdef test_read_wrong_number_of_channels(d!):2¢Tfor n– in 0, -1 $ b ÁMFORMÁõ>L', 4) + b'AIFC'Y9û?COM:PhlhhL@638,„,‚)8,HL�:…MNONEÄ…1Äànot compressed+ob'\x00Ø@SSND# Ó8:I * 8ÎPwith ‡ ëYRegexð¤'bad # of  '¹Ö(Ïsample_width h1Šö1le Ÿ3MmarkòFdî ßæâz� :OMARKÊhv3, 1, 1Ñ À Warns(User ªing) as cmE6f = ¬ÉðEqual(str(cm.warnY3, 'd : ´ö chunk contains �N €'only 0 °ers insteadp&1'î “Sf.get5�(), NoneƒÀcomm_kludge_Tœname_evenun`ºnOÀ<<18, 0)  ðb += b'NONE' + struct.pack('B', 4) + b'even €b'\x00' ;?@SSND ?b>L', 8@6E * 8:ð with self.assertWarns(User µing) as cm:2põ f = aifc.open(io.BytesIO(b)))VðEqual(str(cm.warnY3, 'dÿ: bad COMM chunk size'Jôf.getcompname(),!) ~ð def test_read_comm_kludge 4P_odd(¡)Ù b ƒOFORMD„MAIFCz¼6PhlhhL€Á18, 1, 0, 8,£Fð0x4000 | 12, 11025<s(4f(egb'name±í¯aEqual(®g®7), ±1Â7), Å1¸Ö7), Ù1êF), 0í/@tellŸ)g�0*_ 6M6 WF^æòs(b'\x00' * 4 *7get4))ˆ 4  _bunch>÷p = (1, 2, 3, 4ú •>2set™/(p+7), .H¿initfp(Noneö‚header_r®9þ%<MüVcloseТ]I|iÆÖÏ1 s œ�ʦ$r #À in (b'ULAW'eAulaw AaWG722'íï1ý!¡( ž4,Æ6€èmarkersC/utŠ §Àises(aifc.Erñror, fout.setmark, 0cb'') ÿ self.assertRaises(aifc.Er?1, -1, @)0, None€g¿17Ørinitfp(QÒðdef test_write_aiff_by_extension(ï!):,Õsampwidth = 2ðfilename = TESTFN + '.M'$`out = P.�1 = 9Topen(A], 'wbmôddCleanup(unlink, 0 àåsetparams((1, ¬1, 1rb'ULAW'‘;òrames = b'\x00' *ögetnchannels() *Q Õ.;fE(\Ogclose(rrðEqual(f.getcomptype()ÐGNONE8$f.tp if __žò__ == "__main__"Ö@unit.ñ() """Tests for the asdl parser in P /ò.py""" import Ôlib.machineryóos from os.path+@ dir™&7sys dconfig§‘ # This·ñ is only relevant¶kð -source builds of Python.rnot sysbQ.is_p_-(ïrÞ xP.Skip ('.9 irsÃan installedj°') src_basì( __Íb__))) fd_dir =,d.join(I2, '�^p class –BAsdl(²CCaseÐ@.amethodÁü`setUpCGC(cls*év# Loadsðmodule dynamically, since it's S“in a realàAablejQ‡package.³s1.Tâ into an ast.Mtqand runŒ¸check on itIQThere‡Ð need to do t(ÈBeach1@, he»ÿM"sy¥0.inå3(0,þ˜ÅPloade¨÷!.S}@FileF5er(ô 'í*',æ!, !V.py')t2cls%"= .!_m'a(`mod = j.[(€TrÖV^r@True$#.‡smod), '«ðvalidation failed¨ð~�tearDown�0del¤0A[0] B³ ˜à# alias stuff .ÚÕ�r conveni÷K•àself.asdl = TeóstAsdlParser.asdl Ùself.mod = Te':mod&„types = 3. %ðdef test_module($!):iÁ.assertEqual wÿ.name, 'Python')2¢In('stmt',{w*Oexpr*;mod)~˱definitions°Ð9def Adfns= í°IsInstance(33[0]Ä„_.TypeÈ 7h.value=BSum)|tw/¹['withitem'ƒProduct† I_aliasFAp] =AHž!']@ Ð11tr(2)),'Ïð([Field(identifier, i>),  asã, opt=True)])'ZÊ�attribute ™ ÌË @len($.VO), 2„ý%}P �t‚C “(_>ŽincompleBàRaises(SyntaxEd , B#, ¿SdØ<0[="u<)y*0>,?)Uö(UyÀertRaises(SyóntaxError, eval, r""" '\U00' """) ÿself.assertRaises(Sy>?-@.A/B0CF�def test_jð_str_invalid_escape(c!):,u÷for b in range(1, 128 $"if#öb"""\n\r"'01234567NU\\abfnrtuvx"""X8…continueqPwith ‰ìðWarns(Deprecation;ingˆ;6`Equal(èõ(r"'\%c'" % b), '\\' + chr(b)) |xôwarnings.catch_ú(record=True) as wÍ(ÿ.simplefilter('always', category=Ç�±Ï"'''\n\\z'''ÞŸlen(w), 1$$ÿ w[0].filename, ''4 Ÿlineno, 2#Keû"§é ¡*cm¢]  Ðxc = cm.excepkœqXO, []D?excw3 v²d/1)8 w8w/81¶w>w?0x8z6u18> '½ ~-°,[ 0xTüƒU0001d12¯¦'Š1 Ž]ï VÏbytes_normal[b[ ž åb\À"""), byte(1C)) ÿself.assertEqual(eval(""" b'\x01' """), byte(19r:8:?0x8=ðRaises(SyntaxError, „,y…K´ {dr'\u183,Ar\' + b'ú„<’@:†•U0001d120B#'\ŠNŽ@’�def test_=_¯Ðs_incomplete(è!):*ú÷oÌ2'\xÃ=$ ?¦½valid_escapª÷for b in range(1, 128ÊÎ"if#öb"""\n\r"'01234567\\abfnrtvx"""ÿ5�continueœWwith !ðWarns(Deprecation;ing…;6 °b'\%c'" % bL ¢ytes([b]))C~ôwarnings.catch_ú(record=True) as wÓ(0.si÷ÿ filter('always', category=Í Dÿ("b'''\n\\z'''"«åŸlen(w), 1$ÿ w[0].filename, ''4 Ÿlineno, 2$Kez#¨ðG¢*cm£ã^ !Ðxc = cm.excepsžr}_w, []E?excx3 w¹?rawXŸìO#r'H•xø 4/rb4±r¹m'Î) ùBrûB ƒ<: {:¶buùð "\\" + b"x81") selfó(.assertEqual(eval(r""" rb'\x81' """), b"\\" + b"x81") CselfBðRaises(SyntaxError, P,C7 brP? �? Àp?u18ÂÄ Fw/F =TÍA •A È’U0001d120xÔÐ N�3NÝ ªáE ¡E2bb'Ü;/rr;&b<)bx'/rrï(+,�def test_ÿp_str_u()!):;8^y2u'xw_, 'x'j 2…U'\u00e47/ä8ÿu'\N{LATIN SMALL LETTER A WITH DIAERESIS}YŽ u–(uI';'u °Ïácheck_encodingÎ$, §, extra=""âàmodname = "xx_</÷.replace("-", "_uñfn = os.path.joinj”.tmpdir, Th+ ".py87¶pen(fn, "w"œ=vJ6try‰�õf.write(TEMPLATE %Û6)ïmfinallUfclose('³__import__(Éódel sys.modules[!%] ‚Q¡file_utf_8o“mâz = '\u1234'; Ýð ord(z) == 0x1234\n" ð< self.check_encoding("utf-8", extra) def test_file_utf_8_error(self): %5á = "b'\x80'\n"AnðassertRaises(SyntaxEI,�/, Ž8‡kÙÒ¯iso_8859_1J@iso-/?-1"O_latinL,I 9”H9�ò if __name__ == "__main__"¨@unitÍ.ð () """ Tests for the threa� module.$q import @.sup Y from &“(verbose,_Kõ, cpython_only,! þ requires_type_collecting)tã.script_helperq k_o+k,„failure Ødrandom4sys _5ing4ime ]tweakrefoU¶subprocess Ñ»Plock_¤sz° # Between¹ðk() and exec(), _ñ# async-safe functions are allowed (issues # #12316C�#11870), 0for[èpa worke%!ð is known to trigger # problems with some oper`g systyÔ #3863): skip9AaticS—·on platformmåbehave badly. !A_to_Jð = ('netbsd5', 'hp-ux11') 5A¬òvial mutable counter. class C‚(object)6�__init__‘‘value = 0Ô/?inc*E+= 1+/de+ -+"%iVAma, ª&, �ÅKõªs.append(t°!ßIsNone(t.iden'öRegex(repr(t), r'^<ªû\(.*, initial\)>$�xt.start'skÁ@ing 8Âh to completQç$t\.sPt.joip AFalsÿŸs_alive()+2NotX-+, LWWtZ5Ûstopped -?\d+`I =û˜¬ÕJu01st_#c_of_no]Fw =À The ident sótill must work for the main thread and dummyCs. òself.assertIsNotNone(7Áing.currentTH•().ident)>…def f():V$.appendK:—done.set(bSone =¸’HEven!nU = []…òwith support.wait_Ñls_exit¯ctid = #£.start_newf(f, ()�§X¨LaEqual(œ†[0], tidD0# K´¦Ð"immortal" _D¢jË7delü„_active[X!] )a# run öÃa small(ish)9ò stack size (256 KiBŒ¾ñtest_various_ops_@_4(Ñݪif verboseñqprint('�a|B...'w+:tryD¢á{_¯v(2621446eexcept¬ZerrorG raise unitÙ¡.SkipTest((yô'platform does not2ž changingÄÁ.d=Ð/0)±^largel_ (1 Mª 9ª'_x¨!@0x10ª¿#tforeignÿó# Check that a "."_`can usæ”`fmoduleŒmwf(mutex\²`# Call4‘ˆ)ðÀces an entryƒ ù#�Áto get made '—.fF mapœ†Ô † fÁ“.release(ó@ ÍGLock5!p.acquir:5ZÑ9i,×e# WaitAîª to finish B«Pcn(tid,tÛZ'.ˆsInstanc1@[tidE†ðing._DummyThread3) Å#Issue 29376ö"self.assertTrue(threading._active[tid].is_alive()P;¯Regex(reprA±), '_DummyTa'GOdel v ¦3# P5ò.State_SetAsyncExc() is a CPython-only gimmick, not (currentlyqò# exposed at the :ð level. This test relies on ctypes to get81it.š1def,_¡$!):.†Kò= import_module(""")ò*Pset_açc_exc =…!.péOapi.tm CB.argÈ2= (o–.c_ulong,]w_objectˆeclass q—ExceptionÕ¯Fpass½e&¹\(Leñ# First check it works when setting­XAfromCsame?•ŽStid =Ë¢get_ident($šùÿIsInstance(tid, int(rGreater%0À6tryä]€result =¾Ç9Åd3e# The Ùð, so we might haveŠAkeepÕVM busy untilûQ itFices`while ï ¶É Žþ . *:lseÐpis codeÌðunreachable butå�reflectsÈ intent. IfíkwantedÏÑto be smarter5ðabove loop wouldn't#Šinfiniteöñdfail("ƒ† raised"Ž Î:$bEqual(ß”, 1) # on� s¡w modifi¿GþUnboundLocalError13wasœõ too quickly for uŽÃŽ í�@0# `RPer_st> d`“aset byI€qòit's inside a try/ÀN’block waišqo catchJ´�hronously?ݬš awë^  up�l'at•¦6ion^ õ *Ev+†1r@WorkÖlà *@run(J h.´,0ä0sheêVFalseÐ try:  Ïwhile True: ÿworker_started.set()-îtime.sleep(0.1(ÿexcept AsyncExcvñself.finished = r›2aw_Y3ion¡0Qt = W÷ƒt.daemon]ö& # so if this fails, we don't hang Python at shutdownb._›if verbosWpprint("W32ed Ã¥ thread") Vs# Try aÐ id that does•µmake sense.3w trying non<Ficala"¯Presul:Pset_a­aU(-1, i.°ÂassertEqual(?¤, 0) # nodøstates modifiedíÆNow raise andz in the&ñ@waitò:forFƒ to get ‰ ýú™÷Hâó>F(retˆQverif‹h1 ha×Pexite$iuFalse(tqaattemp $tojÙhn�  Ot.id ‰1) # one  í=Œ Ôño say it caught6«Ïà)_s3Q(»fout=10Y~ç}%Ðll OK -- join»‡˜}Ú  t.6}P# elsH8Ð is still run`P, andÂ@have�0wayñk$"ityðdef test_limbo_cleanup(ô)‚ð# Issue 7481: FailureL9Íchould D~VF map°r^R_new_óg(*argsp !Qing.TWErrorœL# =�4 'X $! =þT6&ry¥%K£ö(target=lambda: NoneN6^.,Rï,s(Dç2, tV>Ÿ\t3ðing._limbo,  ó0"Failed to cleanup _limbo map on failure of Thread.start().") K…finally:t/Qing._3R_new_= =  =‘def test_SÃize_runnning;f(self)jð# Issue 1402: the PyGILState_Ens¼ñ/ _Release functions may be called|µ°# very lateþÀpython exit:€deallocaC a ŸCing Ù7forL…example.òimport_module("ctypes")ü€òrc, out, err = assert_‡_Œæ("-c", """if 1 @a YÓ, sys, time, @k/ð # This lock is used as a si¹Ø event variabÈ< yÊû. e_N(,—.acquire(ð1# MÁ globals areŽðred before __del__¥5runP?¡So we saveäÙin class dict5C=Ne3=C.{Mapi.X Q<re= ‹ >ûç å]sÚ0 = .® m*Celf.”(7 yrrwaitingÜ(YF_x = Cbÿ_ ï<v«.sleep(100z�L(�J, ()YuHq # Be åûTother‹3is N€™@sys.Ñ:(42]'""Ó_`Equal(š2¸: §¬with_trace½¢q1733757?‡à# Avoid a dead4P when³A.setK³ steps intoÖOfhutdow¨'/ok"£ A•€-killer,""pr5theÇË Psuite'Phang ¶&ve (6Oi»o² b>Q ¹ðprint('program bQ€ed; aborá'ì3Aos._  O7t =nrtarget=¿ Lêt.daemon = Trutãóx!is±ì· ù3@(fraÆ�_, arg«‰#scurrentgà()  Ðreturn func Ðsys.settrace()B""")1õdef test_join_nondaemon_on_shutdown(self):A÷# Issue 1722344õRaising SystemExit skipped threading.X9ð rc, out, err = assert_pyth‰ök("-c", """if 1ˆìfimportbX!£from time +Rsleep$ gchild(î8*(1L²# As a non-D’ý we SHOULD wake up and nothing­Oð# should be torn ‡O yet.‘print("Wo]!, ¦“tion is:"ôc˜T¢�(target=Ž).start(ñWraiseè ™^a=.ÓùEqual(out.strip(),7bà ’ "ž lnerr, bíñenumerate_afterýçôTry hard to trigger #1703448: aà’is still ŽUed inÙ#&úv1() xÐ it has been �U()ed.<0/ =A#ðold_interval = ÷”getswitch¿:try@ÿfor i in range(1, 100þYsY¦i * 0.0002„øtº ]Ïlambda: None:v"t.%ÿmü.ëªNotIn(t, ly+"Ýî#ed¨ %döals: %s" % (i, l)¼kfinall]5³‘y…òno_refcycle_through_‘ žðclass RunSelfFunc{(objectÀ^�__init__G,__Æ . °# The linksTthis ˜ NÐP backe •Æpcleanedýƒwhen theئ completesù„W. ¬ã s1Ó&O_runzRargs=D ½1!kw?p{'yet_a@er':�}I1.ÊÐ ñdef _run(self, other_ref, yet_anK): 0if 2Þ.should_raise&5Å SystemExit Løcyclic_object = RunSelfFunction(\u=False)<\weak_A‰ref.ref(8 Ö.thread.join($Idel (vóÐassertIsNone(s ˆ5(),0 ÿmsg=('%d references still around' %=Jÿsys.getrefcount�6)))f€:ing¥n c ..ùrNotIn('G0', U8(t)Ð0 = dDA*­El_param®72(t.N¥ añ% k¸N!xMšþP@unitð.skipUnless(hasattr(os, 'fork'), '&p needs 2()'fACummyYq_after_)ƒúð# Issue #14308: a d91 inVWñ list doesn't mess up¹œ#*j-jµ mechanism.$0codÜz"""if 12simport ³,‚Ping, ûFtime×qëQbackg<8G(evtß(ð# Creates and registersû the _DummyThread instance t Âing.current_-()+evt.setùtime.sleep(10) :bevt = UgLEvenDt£.start_new³(backgroundŠ, (evt,)žšlse};os.5"""£â_, out, err = ©ö_python_ok("-c", codekRself.*aEqual(A?b''#Qerr, #zð@unittest.skipUnless(hasattr(os, 'P¦'), "needsb"e@def @`_is_alº`after_7(¡) ô# Try hard to trigger #18418: AÐ() could some¶Ás be True onµ{#ñs that vanished ~0 a €..ô old_interval = sys.getswitch4¸À.addCleanup(0s0(, VRa# Makeàðbug more likely÷Pmanifq�?q.suppor½ —G1e-6^÷for i in range(20a Ê[÷(target=lambda: NonG6ØVpid =ó²1if /= h‡11 if t.ÝPelse ƒF)wt.join(þ²pid, status¢ZApid( �5ÓmKâ(os.WIFEXITED(I ± 6b010,W9fSTATUS=Cmain  p,W}'Â.name, 'MainÝî 2XidentÖ F."y %GAget_'()¢+f(•~2NotKo¦ÿ�,M?Ï )thm6f÷-th)th‚.Õ 3À) @unittó'est.skipUnless(hasattr(os, 'waitpid'), "test needs os.Ð()") def "ñ_main_thread_after_fork(self):+/æcode = """if 1pimport �HEing :"Ppid =†[�1if := 0W�5 = W.®(H/`print($_.name! xident =]ucurrent`.$FAget_9*();Nelseãœfpid, 055"""Gð_, out, err = assert_python_ok("-c", ¦?@datawPut.deö().replace('\r', ''.ñ.XÓEqual(err, b"0_ #b�, "MainTBd\nTrue"")P@unitm¸ôIf(sys.platform in Ps_to_Üó, "due to known OS bug‹ OgF3ILM �_from_nonš^Ma(R, sys_›†'f(T` ƒ !¸‡3‹ %2�#J“;õ# stdout is fully buffered because not a tty,”:�# we havµÿflush before exit.4x.2Ò4u8 e)th² –(target=føL‹th.start�wth.join’•î$-1Š–�)� üüduring_shutdownÜ# bpo-31516: )ð should still point¼Athe ;ÀŸT# at i¢cÀimport gc, t·hreading amain_t2 = ³ing.current)()5xassert <'is=ú() # sanity check€ùclass RefCycle:g§þdef __init__(self)$( .cD0 = g#K?delJ Íprint("GC:",�H+8 isE 3B!÷enumerate() == [R*])o ׯgc.collect¶ö5x =³D5"""1â_, out, err = 1ö_python_ok("-c", codeZ`data =70.de[Ò.FæEqual(err, b""? #Pß.splitlines()Š[ðV Truec"] * 2;=ütest_tstate_lock�ò# Test an implementation detail of Tj…objects./£started = re.allocjçofinish)S‡.acquireMCå+f(bHhreleasH Lötime.sleep(0.01Åb# The K K4ÀNone until t+3is ‚-tªS–(target=feXIs(t.» , n,!t.e%/ed&X1Ö(t.is_alive()Rã“can't be ’kd whenì@runn¥?ö# (or suspended)3>‰ ß+¬gFalse(6Û§�out=0), &Æßü;# W½Qends,Î"@ canòÅsuccessfullyœ# Õ°\L ¯5¯f# But �WQstillÖ¸: we hold · now, whichœˆpreventsNÁfrom knowingêñ's end-of-life CØKis doneæB)LeÍ@find{fá \áÐrelease()  ðself.assertFalse(t.is_alive()) #õ"# And verify the thread disposed of _tstate_lock.:aPIsNonb*d‘t.join() <ðdef test_repr_stopped(N!):!—V“Cat "&à" shows up in @!(T¯÷) appropriately¥¢tarted = _Ùd.allocÎ(¥ofinish)sS�.acquireCó'f(ßãHhreleasH�L3t =¤Bing.ÿ–(target=fÏ!t.`ž/edS|+CIn(")"",bt.–³#¤0uld’0ear©W­ ða reasonable amountcFtime¶ñ # Implementation detail: as.÷his writing, that's trivially trueJ3if �û is called, and almost: 0+7 isL>c. The–a we'reÓ€ing hereh– ¹Lö"all on its own"ÖLOOKING_FOR =E<Pfor iN›range(500\8if D-t'iUbreakZŒ¦sleep(0.01T (a*� # we waiu0at Û¦t 5 secondJþBoundedSemaphore_limit (tàraise ValueErr&#f ­¶d too ofteniIcML1, 1O)bsu ~(C(E˜8[y®$bsŒ ;? _œh]®#t#gsDD 8·/f? = Ø tؘÜRE&s(FU, bs.Ó~Ñ@cpython_onlyä×Tframe ~tracingÂðIssue #14432: Crash when a generat¾`s creaLiCúó ™Àdestroyed whó(ile the generator is still used. The issue was that a #8ñcontains a frame, and\ð kept a reference toLðPython state ofó destroyed C threa“÷ crash occurs when a traceP�functionÓeetup. ‘def noop_5(£å, event, arg):+ìp# no op#9iongreturnM eY(S wh|1hluyield "9"QŒcallbackP4if 1.geõNNone` &=Â/()ØHext(3&0 = n«2old\¢ = sys.getk@s�!:try¿”# Installî ä »)Oing._ ,P# Creqa  iOqñ which exits afteršþ Jùimport _testcapi.8`_in_te0bary_c_±g)G0# Có §£1difN#t <Ir, check®&thNZÏ didn't keep›}X› Ø@for ñ3{range(3ètG²–ijed herª:îwkfinall L|±) class T<òJoinOnShutdown(BaseTestCase):u÷ _run_and_join(self, scriptÜ› = """if É °sys, os, tiG2inglá#Ï¡,m wam]ñhe main program7zerminat/º±0ing(6q¶o.4 ü"¢print('endŒ|'œ#€# stdoutÏ�fully bu•Àd because noù±tty, we havüUflushÕK�# beforeo.çp.@¸s\n""" +©añrc, out, err = assert_pl…_ok("-c"ßq`data =9÷ .decode().replace('\r', ' #.Z`Equal(?3, "=m#\n “3\n"æ·B!_1oT_on_s¡X½#Žáusual case: on) , 1 0Ãa non-daemon2Õ³À= """if 1:  ¦import os ñ t = threading.T ù(target=joiningfunc,5A fargs=(L‚current_Y(),))E‹t.start(Úime.sleep(0.1úprint('end of main'!5"""càself._run_and_Ë‘(script) $ð%@unittest.skipUnless(hasattr(os, 'fork'), "needs os.2()"u AôIf(sys.platform in Ps_to_eó, "due to known OS bugO@def �!_2­@_in_oped_proc�Ò!):½u¡# Like the8ò above, but from a @Å interpreter= ¦ = """if 1W[¦childpid =ö;!5if $J!= 0?"´os.waitpid(*2, 0: 5cexit(0˜™}}Ó3}KÃ�ôork() was called“cworkerrSA# Inɲò,è ™ò object must be marked as stopped.ÜDâ U×  µ£S£Á(ˆç5%9&=,AE7Nâ; Ó%(%ü«ñ) # Should not block:ó¶Pis al¸yýüIwØ@ÙÅ �w�R'7ƒ4_daemonú-s(ˆð Check that a daemon threadó cannot crash the interpreter on shutdown ò# by manipulating2ð nal structures that are be#Ødisposed of iLrÅmain thread.gõscript = """if True:‹Ÿimport osorandom/sy1Otime/—Iing ú_has_run = set()$Bdef ˆZ_io()¾Âð '''Loop for a while sleep2:ð tiny amounts and doÉsome I/O.'''™XJ2ýin_f = open(os.__file__, 'rb')O3@stuf4;.©O(200+Inull`0devO, 'w_ ‘_f.write(l\¦.#( .Ÿ() / 19957_oclose(#Ù! òR.add(Âing.current_/() åcÛM = 0x@_ inE_ge(40Cœ3newy# =G”TQ‚(target=(?_ioÿD`.daemoÓA • qP.starù ÚM+= 1F¢3lenDIA) < 7-^ÿ^0.001Ìþ# Trigger processÀI«sys.exit(0®ª ´5"""òrc, out, err = assert_python_ok('-c', ¿¡Rself.,“False(errxð%@unittest.skipUnless(hasattr(os, 'fork'), "needs os.2()"` A0If(Û€platformA Ps_to_eó, "due to known OS bugO¸�ñ_reinit_tls_after_vÊŠð# Issue #13817:Íðk() would deadlock…ra multi# ed¡•gram with]#ƒö ad-hoc TLS implementation.b¦!do“œ_and_wait`a# just“q a chilwL45 it~0pidc 0if >> 0 0os.O›pid(pid, ;elsÀm~ „!# V€ a bunch35VAwillÔ*()ÔeÚ1E= []ÃQði in range(16):  ñt = threading.T ÷ (target=do_fork_and_wait) 96œs.append(•.start() 5„for t in::Wdt.join0ð@unittest.skipUnless(hasattr(os, 'šà'), "needs os.2()"¦@def @r_clear_ãás_states_afterÝf(self)‹ô # Issue #17094: check that· DQ are ]1ed P �ñ#+Ôrt a bunch ofDú˜U = [])i)‡range(16 +´ò lambda : time.sleep(0.3)>w¼Vpid =e«1if 6= 0Db#:”have been@O:úif len(sys._current_frames()) == 1j4ªos._exit(0èOelse.1.* _,¿2tusù›pid(pid, gDä.assertEqual(0<ÿ ò class Subinterp”ÐingTests(Base bCase):míØ_K–:µ# Non-daemoƒ° should be 3Ê4t szåreter shutdown¥C# (i$F8808DBr, w-Vpipe(Šÿ.addCleanup(os.close, r%w%Ücode = r"""if •import os«?ing2imeK2S'f(?0# SUÕTit soeÜö is still running whe=C‘# Py_EndIäj©is called.¤/ Î&05óos.write(%d, b"xþ ã%f)¨'–""" % (w,i!re+“ upi….run_in_0(ž2ö9ret;E# Th74was„†properly K0os.´d(r, 1)ñ6¹ùós ._2èðSame as above, bu©ðdelay gets introduc/% t­'bÈPthon ü‘ returnedNPbeforà®Pe!Xdeletè°# To achiev.Àis, we regis„a]ñ-local object which ä‘@a bipen deal3àted. ró, w = os.pipe() ÿ self.addCleanup(os.close, r%w%õcode = r"""if 1:cjŸimport osŸthreadingIime Úclass SleepergkÀdef __del__(Þ)#'`time.sEj(0.05)detls = ™{.local(%j/f(`#žó a bit so that theRù is still running whenå£ð# Py_EndInterpreter:}called./ ÒDrtls.x =�'er&öos.write(%d, b"x"ß#T³û(target=f).startR–""" % (w,F0retXpest.supÁ.run_in_subiè(I2Ãö.assertEqual(ret, 0!6# TYöwas joined properly) K0os.zd(r, 1)ñXÑ@cpython_onlyíÂtest_daemon_ Üs_fatal_erroroÓ_ÓR¦“€Make sur…"e Æ�U1°I ,™_=TrueV‘HPscripRv _¸Jcapiäƒ%ýhÊ Ñ×Pwith fÖðSuppressCrashReê *òrc, out, err = ä_xâfailure("-c", èôÊPIn("F„! P²N>or:;5: "8Ô2"nož0las "—0.de»b()) xúðingExceptionTests(Base CCasep# A Run˜E ò should be raised if P@ର# multiple FsÌåm_uŠl_againƒ¦s±Bing.q«$‚xdR®(s(Ì,;7šM„/¯³ing_current¹ ³  » ìÀimeError, cuðrrent_thread.join); def test_Ãing_inactive-q(self):,0C2 = Qing.TV%()$3ó .assertRaises(RuntimeError,;‡ †¯daemonize_†.¡o.start�esetatt¦2, "”v", Trueæ`8+()Ç`releasOüunacquired_lockO ML%eK @.ne…P@unitÓñ.skipUnless(sys.platform == 'darwin' andõ.support.python_is_optimized(),Ü 'kò macosx problem'Á\ürecursion_limitÅ# Issue 9670i#—õ that excessive Jó within a non-mainWw causesH!anAÀption ratherWôn crashing the interpreter on -Iðlike Mac OS X or FreeBSD which have smallVéault stack siz‘ fo�‹^áscript = """ifkuq imŸå2ingrk'e(®creturn>e¯=_outer;:try‰2ok¯Dpt Rö÷EJpassÊw\qtarget=¥\hwá— çprint('end of 3¯(5"""Óáexpected_outpu @&\n1 p = subpro³€.Popen([òexecutable, "-c", ô]]“xstdout=U¼IPE, stderr8(ð = p.communicat]@data¶h÷ .decode().replace('\r', '%•‚Equal(p.a:„, 0, "Un: eõS: " +³c¬3elf2R”$, D~ád³Ñ_n 6:! =ü Twhile=Lbð .sleep(0.01)  @1/0 ñt = threading.T Ê(target=run)-z.start(ùwhile not running:5jútime.sleep(0.01@6‰ = False=kt.joinq5"""%örc, out, err = assert_python_ok("-c", scriptwRself.,aEqual(C6b''#P§err.decode„>óIn("Exception inL"�M 2ÿTraceback (most recent call last):A ÿZeroDivisionError00Not¦´Unhandled e°5Mñ @requires_type_collectingõdef test_print_Cð_stderr_is_none_1(ë)zæ = r"""if True¡import sysjœIime L ÄGrun(židglobalÀ RV¿ % Ý> !˜€Bsys.ßj = Nonšï¶ÿmÔ˜2˜ÿ6 N~Àe Ç t.join() 5"""örc, out, err = assert_python_ok("-c", scriptFRself.,aEqual(C?b''#ñ NotIn("Unhandled exception"x±.decode()) ˜ðdef test_bare_raise_in_brand_new_thread(†!):3Þ72(G`òclass Issue27558(TQing.T^ ?¦exc = NoneDHu†ƒexcept O/VError<!if"MÖQraiseG=if \I'E$ (iðfine)') else:  ñ if output and limit is None“result !='#: 9ªif verbose¹print('no')4ðraise AssertionError("%r %% %r ==!9" %:V ò(formatstr, args, ²,°)}�# when 'å'æõspecified, it determines how many charactersŠò# must match exactly; lengthsbalways#.92ex:câ=5, '12345678')#esG___'5ð (mainly for floating point�mat tests ’ which an˜XKðcan't be guaranteed due to roundZ representa¢ e£sI/el66not:(y´Blen(ž0)!= zC) or¶![:�2]!=)_w!�1"%shshsØ}%s" % \®0 (a)\0pr(g ϵ)t,el¼¡yes') defÛfcommonˆén=«,W óoverflowok=False>@# if&/!a 8@ abytes,ù aarray;Á# otherwise,– !s+y)Øif isinstanceµ3str‰t»$[ºÔ&, σ"b_=& =Òã.encode('asciiv �7¶&baQÙú(/x b_ŸQ = []40if ñî d, tupltë1 = 8+, L-Z†ú"b_òV = ba ô� ë ˆ:,æ…žV%G* ` <ˆ¡Pcëi", e+>½7n,!@[N_exc€Pexcepúƒ, excmsg36tryŽ€‹K~ÞEAL0 as A ifŽP(exc)�jF,R"yes"q1£CÐ print('no')  ð&print('Unexpected ', exception, ':', repr(str(exc))) @$: Ãif verbose: U2no', iB7ion&QraiseTFelse^õ TestFailed('did not get ¼Sp: %s' %Êùmsg) def test_exc_common(formatstr, argsø0exc9‚#;á str and bytes¥RK1ÿ.encode('ascii')Œ‘ class F· P(unit„.qCase): hïë_ëb(self)Ô”ØBthe !ð identifiers that work !¢same acrosû@=,öarrays (integer, float, oct, hex»¡ï("%%", (), "%""0.1d$ 1,&1&*&ósys.maxsize,1), overflowok=True) #8:Ø ˜A.100Rx/'0'LP: _J.1'×x Äe#.117x=<'0xgz. J51',Ç; À" é8é–0êëfÏ".0.€#·òse are trying toÉÐ�limits of' ¬õ rnal magic-number-length#&tL@buffÝiA2at 3p change= enZ!sess‡)le=‚effectivñå Ì!*gäã09, -1.e+49/3.€//10/#:100_ñsome ridiculously large precis&�I ò '%12.*f', (123456, 1.0))°Îp# checke�÷p valida•B on 𾆧5thexðshould no longer caó use overflow in Python õ# 2.7/3.1 and later.ÿtestcommon("%#.*g", (110, -1.e+100/3.))0G0f0F0 õ # Formatting of integers. O�s not okÅ@x", ð?"a"ç"0ß, "174876e8005oW/12# W0X¯3510355640[d[~# [7 ÿbig = 1234567890 - /e0big·> @-A-vB5C//31D02D Ì$(-3FE  0FÎX-G2 �4?-00�$!03H+dž+H+�& GF +{ ��«<F.6. B 30¦C+FCå$232.ŒF G$Ë¥float(big)œ_e", 6) à &0x@aabcdefõ # 21 hex digits7 /Ä6UF‡79Àstcommon("%5ñ x", -big, "-1234567890abcdefC") ÿtestcommon("%22;'3; w(-2=< ´0=0áñ->={5õ?-00}!02?©0>+?+? >O +ûu{I=.f÷91p:"t¦223.w >-?>bBX", x)aABCDEFŸ#8!0X*:a&0x:<#:v< 27>êP@-A=X10AŽ"#.‡Ã/0x ?@A)27‚/ „-DB °/#0DË+Ê+‡Í A  ‚C8+0XÃFñ0# next one gets two leading zeroes from precision, and another 5the˜�# 0 flag&•the width ·ð#+027.23X", big,ñ "+0X0001234567890ABCDEFC") ÿtestcommon("%# 027.23X", big, " Eÿ # same, except no 0 flagf+e«šª-Exª8+0xîaabcdefT ï!- ŠE E Ï�big = 0o_$67e õ # 32 octal digitsD yoÇS ÌB-´-D%5E1/33F24F Ò&(-3HG*0H é r¦-I 8 ‘6!-雓!03J;0I)+J+J( IL + Ü‘ð 8 H .2m# 4 D3E2^Šë“‹234.¦H I&-JIÐ`/#C™EGG(&38ŽyK(-LH À5670 ")  ÿtestcommon("%#038o", big, "0o000012345672") J* L:.34LJ--—-˜L&)38˜/ N*-OM/ 30O‚(+ë+�› L6++ç ›+-PO†,-  :P+× QÛ‹ PŽPñ# next one gets ÿ leading zero from precisioná7.33à¶Îù# base marker added in spite of Šÿ(different to Python 2t”ofreduce÷Y, and¬’is always¶G#.32o “  Š“, plus tw£ÿ"0" flag & width’:035­T ¯ÿ shouldn't change the size{#|•Mð# Some small ints,+Dboth 1int¨•flavors).< �·d", 42, "42q #-$-% O42.0J `#x", 1C/x1n$#X$X$HHo$ �?0o0lGð0, "0") ó testcommon("%d", 0, "0")  !$#x"x$X$X$G�x42, "42m%"-0&-'oooL %"-0& Lÿ # alternate float formattingÿ'%g', 1.1, '1.1'*9'%#&u0000') Pµif verbose:p print('Tes» exceptionsgS_exc_·ð'%', (), ValueError, "incompleÖÐ f B0 %sÕ D ™�Ã"unsupported-ü character '%' (0x25) at index ã } d'Kc', TypÀ|%sÿ: a number is required, not strï r?b'1s9_bytesu xçxZ¯: an integé!tO3.14\u&"Î@def #R_str_:f(self)ÙÐ"%r", "\u0378 "'\ ±'") # non Eable Aa75 A‚4A�4�/ #~=Š>=¼ # ÍÊ×€ unknown 6mat=us, etc.='1�('abc %bàÙ bÙ'62Ù5ò#§Úƒ(unicodez0\u3þc,'raw-Ï-escape'), 1u#n – ?–c˜—º ÷ã "must be realRF C('no¹Ñ"�ñall arguments conve=`during¯$ùV¾ôc', -1, Overflowë %c]ùÐin range(0x11u)KÀ'%c', sys.maü xunicode+1, OverflowError, õ"%c arg not in range(0x110000)")2ü#test_exc('%c', 2**128a P O¢3.14, TypeªI÷requires int or char“ CO'ab'C,?b'xCÐif maxsize ==U31-1:rú # crashes 2.2.1 and earlier):try>s"%*d"%(ef, -127™"Ñexcept MemoryAFIpass•Nelse'ÿraise TestFailed('ñ should fail') YAdef ” bytes_and_ öarray_format(self)vð # %c will insert a single :ñ, either from an¦�256), or|#(<s×0ume:±f length 1,éOU str.=¹ûcommon(b"%c", 7, b"\x07s &@b"Z")Z& 1yte(0)1 5~ 65%×AZ-*A+*L# %bZ‚eries of! ^ö type that support/ð # the Py_buffer protocol¢ something=qhas a _û@s__ %odh°class FakeB&w(objectÈJB 4!Õreturn b'123'`Gfb =_( ábµ abk b"* ¿Adef"Á x_ fbÂ7123–&m´Sview(ˆ6 ‘�# # %s is�alias forá$--‰Áonly be used`Py2/3 ¤s*5&"%aÏ0giv§ e 2valâäp# repr(•€_obj).enÿ ('ascii', 'backslashreplace'úBa", ˜ b"È)Qb"ghiRob'ghi'- A"jkl,O'jkl+ b\u0544.\ 2ð# %r is an alias focr %a ð testcommon(b"%r", 3.14, b"/"))`b"ghi"+ob'ghi'- A"jkl,O'jkl+ b\u0544.\ 2‹ñ # Test exception for unknow õmat characters, etc.=µif verbose: pprint('Z6ing]*s'û._exc(b'%g', '1', TypeError, "float argument required, not str#LbM_bytesO noxmat', 7  ðô "˜5all³ðs converted dur jROtingu ËxV�ytearray(‚)ûTò"%c", -1, Overflow ö0"%ch ßin range(256)RW?256XC_**128[B_b"Za"| Ùs an integer Ð or a single „&/"Yq\ãW`b", "Xfl^bp1s a2ýs-like object, "4 "en"° that imple¾@s __x2s__À@'strˆ:0 ;Â0"%s£/Wd‡ £Uêúif maxsize == 2**31-1ùú # crashes 2.2.1 and earlier):try s"%*d"%(e&271"§q MemoryFEpass´5l Qraiseý�Failed('ð should fail') def test_nu£l(self): õ # test the null character" ðcommon("a\0b", (), ' /')'!%c'/0,)±format("a%s)b'c\0d'. bYb1b24b'a3�1defÔ¬_non_asciiôÒ‚�\u20ac=%f×!1.²"11.01") Z3?Ô.assertEqual(Iaabc", ;À07<5"), "abcK"07".G<123E2123?E.F6‹?12.G&0j‹4E"0j„Š'+2E8Eb(1+2j)C`>`?€`E?123Ö2`>`…lG>A)I©>©A/0j`^`Æ‹À EÆE`^`ZÖG`^`ZI`^``zmlocalew&ryxL’oldloc = 0B.set (v.LC_ALLÖ5,7, ';dexcept_ÊError as err‰ŽôskipTest("Cannot se;c: {}".êFerr)“tÕ FconvÙ(:Í5sep&3õ['thousands_sep']x.[point0�decimal_&']©10tex0¹×123456789, "n@*×€In(sep, = ®)lfü#p.replacîp~5, 'j':g17 = ‘/.5Ž01In(µÀlf.assertEquó"al(text.replace(sep, ''), '1234' + point + '5') …finally:¢locale.set (ñ.LC_ALL, oldloc) 5ñ@support.cpython_onlyö def test_optimisations(self)q·ò = "abcde" # 5 charactersc”6ð.assertIs("%s" % <,Ò )/.5+/10,1*€Õ±{0}".formatÎ)Ü O{0:s2/.54 /10513›2O % () 'X+S£œprecisionŸqf = 1.2. ³cEqual(°ïf, ".0f"), "1"�030G.2004Wwith Èö Raises(ValueError) as cmEš‰0%sf ó(sys.maxsize + 1)´/ßc = complex(f°cà7+0j¯ª ã3ãY+0.00;ê*`ê žû�_c_limit£`from _Ëpcapi imð† INT_MAX£ +Ý*P%ÇkÃx* U xò if __name__ == "__main__"Š@unit&.ð(() <&Aead>U` üà
from-\N#"toL/Ÿ/«»Ò_Èd›ÈÛÐ0">f1nO2">2h "1.’Beautiful"isybeTTer*Bthan Uugly.ƒò–ì‚êT/ttêì¶áE3">3FÙá| –Rsub">�2à‚Explicitß.ttÁ"im,.ù†±N̆ ¾63?E4">4­ uú3Sñe wcomplexÞÀlass="diff_nõext">
ð ý �
3)‚nowrap="ˆ"> y3.bSimpleD"isbbetter Bthan co*"x.�g/tr> =5\2td ãë×:subצ"4.C® Ùsicated.ˆœÎ·E4">4DÌ £· Ì¡Ðe©èˆ°4¶ ÖÏ3ÿ35ÿOFlat,=nes÷+4ÄÛB6">6‡Û&12âo$`Ø?O7">7ØI`Ø?O8">8ØI`Ø?O9">9ØI`Ø?o10">10ÚIbÜÀlass="diff_nõ#ext">11-‚nowrap="U">123Ind/tobg/tr> =1´ÜAbÜ@_4">14¸JbÜ@_5">15ÜJbÜ@_6">16Üa%_Ö�a href="#d2">n17à �h "1.’Beautiful"isybeTTer*Bthan Uugly.ƒcî0€1ìU/ttìð*U8">18J ÍšRsub">…2ä‚Explicitã.ttÅ"im,.û†ÐÀff_next"> =19wh "3.bSimple "isbbetter Bthan co*%x.eù­¥to0_18">18F"my3.% 20íÙ:subÙå4¯C…°sicated.ˆ»%f Î §¹ ΣÒe‚ìδ4³ ‚ð55OFlat.=nesû-4yb21">21‹22ÀÜAbÜ@73">œÜAbÜ@_4">24¸CÀ="to0_24">24ò123g/tr> 118td õ header" id="from0_25">25-rz Id/tobÜ@_6">26ÜJbܛǀlib_chg_C/_2Ð_7">27ôJbô¬_8">28ÜJbÜ@_9">29ÜJbÜ?o30">30ÜIbÜ@_1">31܆=3_Ö�a href="#dŸtop">t32â ;h "1.’Beautiful"isybeTTer*Bthan Uugly.ƒeð2„îDÀ class="diffò _chg">tter than ÷ugly.
33^²td nowrap="0"><” ^Rsub">™"2.‚Explicit"isNbettÙ"im,.û†Îë¶¾5EU4">34¯ wô3Sóe scomplexøâ#/toà‹.3.ô:addô±8Õ%Í@_5">35˜ÙÍ4¯C…ç°oicatedÏ,�»f Î §¹ Σ҂e´4Nq³ð(55?FlaÌ=nesû-4®_6">36á&12ÊDdubÜ@_7">37ÜJbÜ@V8">38ÜÀowrap="nowraÿp">123õheader" id="to0_38">38+‚nowrap="bg/tr> ?39zÜ(bÜ?o40">40ÜIbÜ@_1">41ÜJbÜ@_2">42ÜJbÜ@F3">40âêp'4bÜ@_4">44¸JbÜ@_5">45ÜJb Ür (` 2Bd>  Added « -AKÁchg">ChangedA“ô>À
Deleted
& <8ÿ border="" summary="Links"Teñ 3‹h‘=ñd>(f)irst change£>É 8On)ex7 Ot)opf /Œ 

Cont�!(f¿“ñ within numlines=5(default))

}DÚ°next">
from
f1Ó#‚nowrap=""Dš‚2©€H@0 – O1">nO2">2h "1.’Beautiful"is0be<æ }�chg">TTer*Bthan Uugly.ƒò_‚ì‚êT/ttê츶áE3">3FÙá| –�2à‚Explicitß.ttÁ"im,.ù†±Ì̆ ¾63À class="diffõ#_next">4+‚nowrap="ˆ"> "3.bSimple "isbbetter Bthan co*%x.e�«…to1_3">3D¡© Y =5ë×:sub×y4«C�¬sicated.ˆ·$` Ì £· Ì¡Ðe|ḛ̀4a �g zêÿ35ÿOFlat,=nes÷+4oE6">6  9&12âo$`Ø?O7">7ØI`Ø?O8">8ØI`Ø?O9">9ØI`Ø6Àd="from1_10"ò>10123ÿclass="diff_next">ÿheader" id="to1_10"bc/tr> ƒ !11ÝÜAbÜ@_4">14¸JbÜ@_5">15ÜJbÜ@_6">16Ü éõú1_Ö�a href="#d2">n17à �h "1.’Beautiful"isˆbeTTer*Bthan Uugly.ƒ:íî0†ìU/ttìð&ïÍU8">18J ÍšRsub">…2ä‚Explicitã.ttÅ"im,.û†³ðnext">19wh "3.bSimple "isbbetter Bthan co*%x.e’­¥to1_18">18F"my3.% 20íÙ:subÙå4¯C…°sicated.ˆ»%f Î §¹ ΣÒe‚ìδ4³ ‚ð55OFlat.=nesû-4yb21">21‹ð5123u$bÜ@U2">22À ªÜ1bÜ@73">œÜAbÜ@_4">24¸IÀ24">24<²td nowrap="÷">123 ð 25^z d#/tob Ü„ëõ<!è€lib_chg_�/_2_7">27Jb ô ù_8">28ÜJbÜ@_9">29ÜJbÜ?o30">30ÜIbÜ@_1">31Üî ú3_Ö�a href="#dŸtop">t32âúh "1.’Beautiful"isybeTTer*Bthan Uugly.ƒeð2ŠîU/ttîôˆ WS33">3µW œÀf_sub"> c; "2.‚Explicit"isbbetter Bthan "im,ÿ.34¯owÞ3Sóe …complex.e­¥to1_33">33F«<� „Radd">¶± Õ%˜@_5">35íÙ:subÙÒ4¯C…°oicatedÏ,»f Î §¹ Σ҂‚´4N36$ =&12ê@%bÜ@_7">37ÜJbÜ@_8">38ÜJbÜ,À_header" id=ò"from1_39">39123ÿclass="diff_next">ïheader" id="tobg/tr> 140¥ÔÜ:b Ür

Context (first jñ after numlines=5(default))

38h°@br /¶€h>F375456PB)0—f`»ð ²ŸvØE8">8¼ îØ0`Ø??9">¢Ø0`Ø?_10">1 Ú0bÜ@_1">11ŽÒÝíc1_ ÖÀ
nõ header" id="from2_12">12-‚nowrap="ˆ"> "1.’Beautiful"isybeTTer*Bthan Uugly.ƒ°î7ìV/ttìg/tr> =13JÅÍš?subä2ä‚Explicit§ã.ttÅ"im,.û†Ðθ ¾65@U4">14¯ wü3Sóe complexä Þ¯Áà ‹.3.ô:addô±8Õ%˜@_5">15˜ÙÍ4¯C…ç°oicatedÏ,j»f Î §¹ Σ҂„V´4³ ÕÒ555?FlaÌ=nesû-4{R6">16‹16+‚nowrap="R">123g/tr> =17^2td rz ÁdÜbÜ@_8">18ÜJbÜ@_9">19ÜJbÜ?o20">20ÜIb Ü„‰<!™ô €lib_chg_$/_1)±o22">22Jb ô Ü43">ë�C2bÜ@_4">24¸JbÜ@_5">25ÜJbÜ@O6">2›õÀ26+‚nowrap="Dg/tr> =n27šh "1.’Beautiful"isybeTTer*Bthan Uugly.ƒHî7ìV/ttìðe ÍU8">28J_g€ šRsub">…2ä‚Explicitã.ttÅ"im,.û†Ðθ ¾65@U9">29¯ wü3Sóe complexä ÞG à ‹.3.Ž:addô±8Õ%˜?o30">30˜ÙÍ4¯C…ç°oicatedÏ,f Î §¹ Σ҂e´4N ý 31-‚nowrap="U">123d /tobg/tr> Ü/U2">32ÀÔÜ;bÜ@F3">3œÜAbÜ@_4">34¸JbÜ@_5">35ÜJb Ü„‰<!™X„€lib_chg_/_2�_7">37Jb ô i_8">38ÜJbÜ@_9">39ÜJbÜ?o40">40ÜIbÜÀ ý41-‚nowrap="Fa/to_g/tr> Ö�a href="#ë€lib_chg_j¯_top">t42ûh "1.’Beautiful"isybeTTer*Bthan Uugly.ƒÆð2 4îU/ttîôÊU3">43LÂÊ‚ œRsub">‡2æ‚Explicitå.ttÇ"im,.û†Òκ ¾65@U4">44¯ wü3Sóe complexæ Þ Ç¬Áà ‹.3.�:addô±8Õ%˜@_5">45˜ÙÍ4¯C…ç°oicatedÏ,g»f Î §¹ Σ҂e´4N "5.BFlat "isbbetter Bthan ðnested. ˆ46^²td nowrap="U">123d /tob//tÜ>U7">47ÀÔÜ;bÜ@_8">48ÜJbÜ@_9">49ÜJbÜ?o50">50ÜIb Ür

Context (numlines=6)

‰<+€^ ñlib_chg_to3__top"2¾ðcellspacing="0" Dpaddòrules="groups" š<AŽh_Ž@br /”€h>œ31Œ‚0©€Hð nõheader" id="from3_2">2+‚nowrap="ˆ"> "1.’Beautiful"isybeTTer*Bthan Uugly.ƒìCêT/ttêg/tr> /3FÁÉ–?subà2à‚Explicit£ß.ttÁ"im,.ù†Ì̲ ¾63?E4">4­ uú3Sñe complexÞ Ü å§»Ü ‰.3.ð:addð­8Ó%”?O5">5”×Ç4«C�å¬oicatedÉ,^·` Ì £· Ì¡Ð|xT°4« Ï´êÿ35ÿ?FlaÂ=nes÷+4 kB6">6‡6)‚nowrap="R">123g/tr> =7\2td px ½bØ`Ø?O8">8ØI`Ø?O9">9ØI`Ø?o10">10ÚIbܽ΀lib_chg_ñ/_1ò|o11">11ôJbôÎÜ2·ÜJbÜ@C3">1’6C1bÜ@_4">14¸JbÜ@_5">15ÜJÀ5">15123 ð 16^tza /to_Ö�a href="#ë€lib_chg_j�_2">n17àksh "1.’Beautiful"isybeTTer*Bthan Uugly.ƒcî01ìU/ttìð÷ áÆU8">18J ÍšRsub">…2ä‚Explicitã.ttÅ"im,.û†Ðθ ¾65@U9">19¯ wü3Sóe complexä ÞâÁà ‹.3.ô:addô±8Õ%˜?o20">20˜ÙÍ4¯C…ç°oicatedÏ,c»f Î §¹ Σ҂„V´4³ Õ˜ Àeader" id="tò o3_20">20 "5.BFlat "isbbetter Bthan �nested.€g/tr> 121^Þ5123d t@bÜ@U2">22À²ºÜ1bÜ@73">œÜAbÜ@_4">24¸JbÜ@_5">25ÜJbÜ/Û€lib_chg_×/_2d_6">26ôJbô@_7">27ÜJbÜ@_8">28ÜJbÜ@_9">29ÜÀap">123ü õheader" id="to3_29">29+‚nowrap="R">123g/tr> =30^2td rzÜ'bÜ@_1">31ܵ$3_Ö�a href="#?€lib_chg_¯_top">t32â ×h "1.’Beautiful"isybeTTer*Bthan Uugly.ƒeð2 3îU/ttîô ÏC3">3¦œRsub">‡2æ‚Explicitå.ttÇ"im,.ûÒ Îº �Q5@R4">34^5ü3Sóe complexæ 3à ‹.3.ô:addô±8Õ%˜@_5">35˜ÙÍ4¯C…ç°oicatedÏ,»À3_34">34 "4.²Complicated"isbbetter Bthan c/Pex. 135­5)55BFlat. onested-BÜÏfrom3_36">36Þ5123‘d@b//t 2xÜU7">37À Ü1bÜ@_8">38ÜJbÜ@_9">39ÜJbÜ?o40">40ÜIbÜ@_1">41ÜJb Ür

Context (numlines=0)

’<+8"^ñlib_chg_to4__top"2Çðcellspacing="0" Dpaddòrules="groups" š<A < # ò
from-N-"toL/Ÿ/«»Ubody>ÒÈd›È2 id×ð lib_chg_to4__0">n2 "1.’Beautiful"is0beTTer*Bthan Uugly.ƒÌì08êT/ttêÉE3">3FÁÉ–?subà2à‚Explicit£ß.ttÁ"im,.ù†Ìj•é ¾63?E4">4­ uú3Sñe complexÞ Üt§»Ü ‰.3.ð:addð­8Ó%”?O5">5”×Ç4«C�å¬oicatedÉ,^·` Ì £· Ì¡Ð|xT°4« ÏÌ4üÀ_header" id=ò "to4_5">5 "5.BFlat "isbbetter Bthan �nested.€c/tr> ƒ !1n17ÂBï1+’Beautiful0uschg">TT.NUugly.ƒ î2:ìV/ttì 1 ÍU8">18J ?sub2äExplici"im,  €ÖÎ  ¾æ5@_9">195ß3Sóeÿ/complexä Þ /¯Áà ‹.3.Ž ¬8Õ%˜?o20">20˜ÙÍ4¯C…ç°=icaä  Ï»f Î §¹ Σ҂²�'³ 5'Àrap="nowrap"ø> "5.BFlat "isbbetter Bthan �nested. ƒ !yt32IJtd nowrap="-1-’Beautiful2wschg">TT0PUugly.ƒ±ð4>îV/ttî'/t5  ÏU3">33LÇÏœ?subæ2æExplici"im, ÚÎ  ¾j53_4">345á3Sóe3complexæ Þ /±Áà ‹.3.ô ¬8Õ%Í@_5">35˜ÙÍ4¯C…ç°=icaè  ¡»f Î §¹ Σ҂¶L'³ 5(Àf_add"> c; "5.BFlat "isbbetter Bthan ðnested.
r

Same Context

5<#ò class="diff" id ñlib_chg_to5__top"2jðcellspacing="0" Dpaddòrules="groups" ’<A
from1ò‚nowrap=""= D} „/to‚  H ¾÷O2">2÷1Ü’Beautifulá.TTáUugly.e–:« ©\jÀff_next">3 "2.‚Explicit"isbbetter Bthan "im,.h“onext">®/to¬ag/tr> =4íhp 3pSEePn complexm.©\j?O5">5j4jC@koicatedo.®at?O6">6t&12j$`Ø?O7">7ØI`Ø?O8">8ØI`Ø?O9">9ØI`Ø?o10">10Ú À10+‚nowrap="R">123g/tr> =11^2td rz ÁdÜbÜ@2;ÜJbÜ@C3">1¸DbÜ@_4">14¸JbÜ@_5">15ÜJbÜ@_6">16Ü I_Ö@U7">17½ "h "1.’Beautiful"isbbeTTer Bthan Uugly.e"%«]n@U8">18 n2n‚ExplicitOm.ttm"im,q/®Àtd> "2.‚Explicit"isbbetter Bthan "im,×. ð 19^2td ¾Æ 3ÆS›e¦Ä scomplexí#/to«`n?o20">20n4nCDooicateds.°cx@_1">21x5123J �2bÜ@U2">22À ÂÜ1bÜ@73">œÜAbÜ@_4">24¸JbÜ@_5">25ÜJbÜ@V6">26ÜÀowrap="nowraÿp">123õheader" id="to6_26">26+‚nowrap="bg/tr> ?27zÜ(bÜ@_8">28ÜJbÜ@_9">29ÜJbÜ?o30">30ÜIbÜ@_1">31ÜI$3_Ö@U2">32½¸Àh "1.’Beautiful"isbbeTTer Bthan Uugly.e"%«]n@F3">3tn2n‚ExplicitOm.ttm"im,q/®`t@R4">34}Àtd nowrap="nØowrap"> "3.bSimple "isbbetter Bthan co*ÿx.õheader" id="to6_34">34+n£"="«Ag/tr> ?35Ã4nCDQooicateds/°bx@_6">36x5123�%bÜ@U7">37ÀÜ1bÜ@_8">38ÜJbÜ@_9">39ÜJbÜ?o40">40ÜIbÜ@_1">41ÜJbÜ=À6_42">42123õheader" id="to6_42">42+Zbg/tr> ?4Àz?td Ü%bÜ@_4">44VÜ(bÜ@_5">45ÜJb Ür

Empty Context

Ê<$]Cñlib_chg_to7__top"2ÿðcellspacing="0" Dpaddòrules="groups" “<AÏhG@br /M€h>Ý3
t

tabsize=2

(< §B" id92Fñ cellspacing="0"Dpadd÷rules="groups"  1col5>fIz_¿"er�¥from9_1">1L‚nowrap=""„ DÍ ‚/to€ }c_ c ÖO2">2IspanARchg">œ Lin¿"1:%‚preceded"by›R:[tt]•to:[ssss]�]ú’ø†F ¢ãE3">3Tõý|<¿ M ïã0ï2ï-ssñtò ä Íâ•Ü?O4">4Ü3Àp; &nbsòp;
Line 3:‚preceded"byÂfrom:[sstst] toÿssss]õheader" id="to9_4">4)‚nowrap=""">n<´ f:chg#)ä?g/tr> ?5üž4žÙ ö2has-h« ¹ÇRafter):ˆÈ$̰?E6">6(¤¬°5° † „ƒt€>endá4subáÙ~¦$ÂL  xr

tabsize=default

`<&ë/[ñlib_chg_to10__top"3–ðcellspacing="0" Dpaddòrules="groups" –<A1Œ ¥„1ü‚ ‰5  e/>tE2">2 À  ?Àp;Lin’e 1:‚preceded"by’from:[tt]ðto:[ssss]tAÁheader" id="1E2">2*‚nowrap="y">ª Linú0g/tr> ?3ìÏø; 42.-ss0t1 !  9ïU&@O4">4&eO&3&sWY (!Eå?@O5">5 4 ÑP.2hasQÑ( ßDRafter):¬Gîñ?Í-Ö@E6">6*þÖ5Ö ˆ†Àss] at&ñnbsp;end&  6E‚nowrap="b">Line�"5:2has ‚from:[t]cto:[ss "atÛŸc/tr> r

Context (…ñ column=14,numlines=0)

K<9÷Õ@ñlib_chg_to11__top"3�ðcellspacing="0" Dpaddòrules="groups" ©<An4[õê>2â­1%«Wadd">«²IaddeÇ £ f ª²„vU>X¯dÞèæª:1ª 2ª è4^Nchanichg">g£ÁÄÁÂBG¼5eICd×QrEùrú4ð id="from11_7">7òline 5 õheader" id="to11_7">7*´¼aˆ±·G/rg/tr> 1ë Á>†"edˆ)td•?r.ú4ǵfrom11_8">8Ï …6» ÎgYš gž,g™O4×e1IWEr ú„R\<!lµž0lib¡_Áî_2">n10X ±¦8subM8žTsubtr$T‚ÔÁ1¿9add¿Ç­ Æ� ` ÀP ctyŠ 8 Û á§J3§ otop">t©R2">12Ç ßÀap">1234567890 öt<Œ ƒ0add2² ®g/tr> ?¼ˆ� B>I5689”B~  b ëf$5ã˜lÒfrom11_13">13B?td ÞRshort}Olineü+�û�ûsanother�3ong –5*u$â `õ2iner3thaŠ_needsõÊòob ?pedúA›*U4">14á *3jusˆ>fit¥Tchg">žÀEin!!O0˜3–/S: –34¬DU5">15õD s�t6+& }Àowrap="nowraòp">just fits "in×t ð ‚nowrap="B">woq™lines)Ryup!!žˆ\Sˆ &r

ùðcolumn=14,splitö‘s()

i<1B" idjñlib_chg_to12__top"3Ÿðcellspacing="0" Dpaddòrules="groups" ¡<A
f1�ÈÐÒ©0$P-�1� ªK E2">2ê  1234567890 'o Ñ|ílð4ÀÞO5689â$`Ö·ò1¯&È5ç?XߥE3">3µ ¥³×¢%iê2O1">nÁÀ"from12_4">4òline 2B,ðnext">n4i£« 9add«²IaddeÇg/tr> 15Î í-3$òkiÈ¥2¥E6">6ê4NchanÄichg">gÄ)td•5Ä1gÂBGœ 5Iëd£�>rEùrúø5&2"ƒ¼w6‹E7">7è‹5uœ¿ ©,Ѿ…¼,a·žtµe,è?žÀff_chg">ed ð 8]²td nowrap="ù">line 6 †RZOe±ðÚrErÜÝbE9">9  b7$PÍ�iêŸa href="#On10ì 8sub‰8_TsubtråT@Á1d¿9add¿o­„ nöP ctSµŠ Ywñ ÛWá4±b11">11_³ uNmíkî’otop">tU_2">12U 1234567890 ™´3[² À1234567890 â‚nowrap="0">Œ–)89”~Ì2td u}b //tëd0æã˜ò id="from12_13">13BaÞRshort}Olineü+�/to�!ûsanother�3ong –5*u`Hõ2iner3thaŠ_needsõÊòob�?pedúA›*U4">14á ‹3jusˆ>fit7Tchg">žÀEin!!O0˜3–/S: –34¬DU5">15õD s�t6+&}.4NwÜV Zðchg">s
&nbÿsp;yup!!†header">‚nowrap="ù">wo lineS)ˆg/tr> ?16̦®2the†5end% n/tol! ðr

aðcolumn=14,split^Ñs(True)

7<5q"žÖñlib_chg_to13__top"3mðcellspacing="0" Dpaddòrules="groups" ¥<A
f1i ŽÖ�0$P™�1� ®K E2">2ê  1234567890 'Å|ílð4,ÞO5689â$`Ö·ò1&È5ç?XߥE3">3µ ¥³×¢%iê2Àf="#difflib_ô0chg_to13__1">n4<,‚nowrap="y">line 25Î í-3$.òkiÈ¥2RE6">6ê4NchanÄichg">gÄ ×CÄ1gÂBGœd  Iëd£�>rEùrúø5&2"ƒ¼ÝE7">7è‹5uœ¿ ©,Ñô…¼,a·žtµe,è?À class="diffò _header">>ed9g/tr> 18]–¿line 6¡§ UchangY… /tož/a™ O2—0libš_ž/_3h ðe±ð)td:rErÌÝbE9">9 ðøb7$Pó›�iêŸa href="#On10ì gVsub">'8_TsubtråT@Á1d¿9add¿o­„:ÞnöP ctS\Šj8 Ûá4ä±b11">11_³ u3Qkî’otop">tU_2">12U 1234567890 ™´Àd class="difòf_header" id="to13_12">12Ag/tr> 1ˆ� Rsub">Œ 12–)89” c~Ì b ëf0æã˜l@fromnR3">13BanÞRshort}Olineü+�û�ûsanother�3ong –5*u`Hõ2iner3thaŠ_needsõÊòob ?pedúA›*U4">14á 3jusˆ>fit7Tchg">žÀEin!!O0˜3–/S: –34¬DU5">15õD s�t6+&}.3À">>wo lines)Ùyup!!†header">€ˆSˆg/tr> ?16Ì ®2the5end%9 n/tol! ðr ×û! _compat_pickle import (IMPORT_MAPPING, REVERSE_ bm NNAMEB#) p„builtinsŽ$io –collectio+dstruct!%syD„weakref ‘unittest ø î0supö .�%$er'¢AbstractUn_Tests4P_2oModule8’ersistenttr=ŸIdentityPE)x'rObject‡�DispatchT¹9bBigmemy0Q try:Ÿcâðhas_c_implementaQñ = True except I RErrorG4�False é7 Py„(1Ë)S€dump = s�‚cmethod([ ._)­ s' s(Oload'&N'N´Dr = ’”Ü •1): TuWt)r"°bad_stack_e˜Ça(Index§,á—truncated%ÃN2ing1B EOF _µ ’Attribute(S Valu 4’.¤', ¡U)õAdef vó(self, buf, **kwds%‘òf = io.BytesIO(bufìuôEelf.@(C¤�return u.mð() class PyPicñ klerTests(AbstractPickle‘): p3r = "._%r.un UAñdef dumps(self, arg, proto=None):Ikõf = io.BytesIO()@p = =.m#(fB#.dF(arg†f.seek(0€return bb¦(f.read())¨Dload¨¿buf, **kwds¤6buf^u§©CÍ„ u.mò() class InMemory_„˜$, ­h+,`J gBigmemXÜòbad_stack_errors = (c.]@ingEq, Index ñŸtruncated<1EOF:¥’Attribute(S Valu Ùqstruct.» �, ImportKÝ!Ý…v zD;IdPi>(Py~DBDumpøR_Load 2(Py r {&¡&._OszC{W¤TîÞ˜aObjectí�^$@À.>œ *aÀÉpütest_issue18339m'ÞŒ.eÖ(io.BytesIO()–;Qwith 4ñassertRaises(TypeÅâ/]‘.memo = o5â$ù # used to cause a segfault'~OValu©{-1: None}\ §{'(ðzÞ| 0 ïÂ2Q6)¹ ¾ÀtchTableTestós(AbstractDispatchTableTests): òpickler_class = ".P'“def get_dL _tMW(selfMTôreturn collections.ChainMap({},a I!) jñ@support.cpython_onlyŸaSizeofà(unittest.GCaseˆqcheck_s.5 = Vq±ÛI_ûrÕ@baseOM`alcobj€('6P2n3i1P')±ZCp = ZUÚ(io.BytesIO().Pó.assertEqual(object._Ít__(p), � =!MT&¤¢truct.calc [3nP0nš/ME/)ofî&(p¢) + §d+ 8 * †ñ+ # Minimal memo b À.Dpsys.getèof(b'x'*4096))FÏwrite bufferH÷for i in range(6@§Ëp.dump(chr(iªê,32ëË8 ofë½required toñŽò# save references to 6 9s;0$Wpis clea{Áafter every ü/).*/un,(q2P2n2P  i5 3n@+2i¡fCUz "P™ ô!P'êiZentrynBnB3ark–BF! u€encoding|ð'ASCII', 'UTF-16 †latin-1'¥ú>Qrrors<`strict3replace3;Eu = M ~,G,¯= 1, e„= …@ÊuÊET/(uO ,h/P M:Dlen(é�) + 1 + ó­20stdˆ% =—3Ü4³ |†ï_ªQdata,"lq, marks ­ðdump = pickle.dËumps(data) ýu = unpickler(io.BytesIO(dump),0 ?ÿencoding='ASCII', errors='strict'qn.load(ñ check(u, stdsize + memo_ 0* PDarks9n) ž@_ÌŠ0, 32, 0jð# 20 is minimal non-empty mark stack s.] ƒ[0] * 10e2f1128g‘emo tableUð required to save references¿100 objects€ üchr(i) for i in range(100)], 128, ”ùdef recurse(deep):âÙ#M = 0 g?C[K , ]Nareturn  ®/0)Ë/1/ 02`*58,151O64, 1—–;134¸‚•.‰Ps('a'Ì’ ŽuŠô †232 ñ2 + 1) ALT_IMPORT_MAPPING = {Ìð('_elementtree', 'xml.e ".ETÉA('cP|*ñ'€StringIO&ioc}•ONAME“ _builtin__L@base !ngs 6strg‘exception�StandardEá,SE+>PUserD8, ' ecollecWö`socketb_  S%@Typer0} Þómapping(module, nameæ:if 4. >8 = %[DÚRelif 5U  W: = ![:KÀÚ�reverse_âˆREVERSE_Å “h? = -ò8 Ù ga )2getƒØ6tryi?ðsys.modules[moduleñ] except KeyError:6try õ__import__(module),E‘AttributeK0 as^ E`if supGŠ.verbose iÒprint("Can't t r³ %r: %s" % „,c)Š@qraise I­Š ¨¥,?exc|p²return sys.Á"s[´] def geta4ÑRname)Pobj =&6#r�for n in 0£.split('.':>dr(obj, n<˜5objˆ_Ä@ionsgGe0ameh7diraX  ,Že"àif isinstance(&ó, type) and issubclassQBaseE‘3ionƒGQyield_ , I! :ð CompatPickleTests(unittest.4CasNrÈW(selfed÷s = set(IMPORT_MAPPING.values(j/|0ŠREVERSE_8 /{  ] 7eGDNAME}}P._s |= E =ºFxrTqi ý2get-ê @w S$Qpass Î ŒŒ_mapping”«#3,2µ' nw.items(ÔuPwith ì@.sub(ÀS)37 3å ( #ifêÎ3[:1] != '_'L3ÖƒassertInÖ:2, Ÿ ;[Equalñ¨$2]w+3)¹w· �3Ü43),³2(2)É ³ÇcÙ.ifŠR== ('¶a', 'OS<Q8ƒüö �é0³]True(xj;/el»à ¿À attÿr = getattribute(module3, name3) ð self.assertTrue(issubclass(Iî, ImportError)C_else:Y}|£ = mapping”22Q£2if >Ï3[:1] != '_'f/ÃcEqual(ed3),  v?tryd _!hexceptEdOpassKeÿ È!) fñdef test_reverse_iê_ªW)®3for–#2, ÷ 3 in IMPORT_MAPPING.items(8£Pwith P„.subTest£K)37’2get!ÚÒyv as excÒc`if supêo.verboÖ0žprint(excv?if Û@ not+JALT_/A and�X{REVERSE/D.getóp, None) 2BS¹ (mý3 | 2)�eONAMEÁ Här3 a2) == em‡?_breakôç“fail('No ´Wÿ from %r to %r' %aƒIÎ2ß4 = + ¿ �-h, =,ÎIRs ÝM13ÍóË þ Aame2 /"Û[í³{þ÷sbC$ =kMPV ]­‡(3)c¥ að, name), (moduleË2, name2)) bmodule ¸ = mapping(5úself.assertEqual(0#, 3XA3)) yðdef test_exceptions(L!):› [’'4õ', 'StandardError'),AE  ('builtins8Ez' u=q<…reverse_î´w "­Âê/OSY2mæ Aä4aù1forî¹, exc in geqZu7Qwith €subTest(3 %)$ifY±(BlockingIO.¹ÿ ResourceWarning, àStopAsyncItera(/ ‘Recursion†³·�continue)Ðcs not Rô and issubclass(exc,a<î \Õ ´(û£Á)J elÎaImportÒ Öm‹Úâ b. ú\(;ÁuFelse£ “õD™‡ ƒ1%' ÁÿmultiprocessingÑJ` = sup�!.i”_+('J.¨Fext'†Ñ J ÀÐwith self.subÛTest(name): ñ-self.assertEqual(reverse_mapping('multiprocessing.context', S,S b- D<)< �‡C! Ãó) def test_main()Ðs = [PyPickleJ�s, PyUnpr! ØiPyPers!] PyId 7·DispatchTab|_Chain >bCompatu¥] öif has_c_implementationô§.extend([CA<, C÷öCè/ Cý>BDump†R_Load ', Cå= ÁrÂaObjectDÞ4™/ C³®zInMemoruaSizeof±]9ðsupport.run_unit» (*s!0doc(¸€) if __Ã�__ == "_û2__" -3() < ñ""" Unpack tuple rò>>> t = (1, 2, 3€µa, b, c = t*aqp1 and b 2 c 3%ETruegFlistfl�r4, 5, 6Ó flAP4[f5 f6% f= 0�ñi < 3: return iµ.ôraise IndexError!<GSeq(-³dô$ò2=ð‚Single eÁ! u�öing, with extra syntaxjs 699,osM9100I7= s«w9Ò»fb, = sfb!ô 100 Now for some failuresÇŽing non-�7L`Tracebaó(most recent call lastŸR ...11ypehð: cannot unpack non-iteñ2rable int object Unpacking tuple of wrong size >>> a, b = tñTraceback (most recent call last):'Q ... ðValueError: too many vas to u„ß (expected 2)™lh™\�sequenceÔZshort1ï, c, d = Seq()¢/¯not enough= ‰4, got 3D «Jlongª¤7ß%a �ñwhere the test for[°ð raises a differq�kind of eZÑ¡class Bozos£(Exception˜0...×Q pass•§é=RadSeqÇ/ûdef __getitem__(self, iUZúif i >= 0 and i < 3K%„return i†!elD/==:äA/set:QIndex;ñ Trigger code while r–"6an 8# (·¾û«,B—)˜Dq, e = Be%"._ˆ.ñÊ\ÆÌÇ ÁJSAllow´‘empty iteÁsTq() = []Å¿S[] = S 0(Enon-Zr shouldnB Typ· q!42qoPP: can]¼ „ŸZo an  ®f ¯2[42"±S¹±0) """ __›�_ = {'docTs' : 0} Qó_main(verbose=FalseUBfrom  import sup~ LQ!-À.run_doctestñ((test_unpack, verbose) if __name__ == "__main__": 6(3ñ=True) """ Test the implementation of�PEP 540: ±UTF-8 Mode.<ä import locale$os %sy „textwrap@unit—Q from¡�M0supU.ä.script_helper/úassert_python_ok, ðfailure MS_WINDOWS = (sys.platform4ð'win32') class UTF8ë!$s(°.RCase)[ñDEFAULT_ENV = {osp'PYTHONEl': '',cLEGACY‘¯FSENCODING-ÐCOERCECLOCALE#0Q!} X¢def posix_‹S(self¢ŽSloc =§C.set&ñ.LC_CTYPE, None)R6�return (>@= 'Co¡get_outputm“, *args, pÇ=False, **kw‰‚kw = dic5.>+}$ifKix_out =ä(ƒtI5eout[2]Oelse\/okW1W6ò out.decode().rstrip("\n\r")´@SvskipIf( ó, 'Windows has no POSIXÁ'¢…B_ù €C = '©¡sys; printòflags.utf8_mode)'š2G.ê`'-c', U‘, LC_ALL=20€ØEqual(out, '19´0xopf;Z¯:PX', 'á½A±$€# undocuð ed but accepted syntax: -X f%=1^¨ A’/=1”(^0^0£ò6if � #"# Ù¿› disables0_Q# andÚxÔpriority overI 0í ëjlÄ =°9Æ×4‹env_var×:À= self.get_oóutput('-c', code, PYTHONUTF8='1') ñself.assertEqual(out, #$aout = *_get_o^ 0^#^÷# -X utf8 has the priority overº3‘PX', 'K =0 ÿ' ¡åif MS_WINDOWS:…A#žcLEGACY#òFSENCODING disable׫UTF-8 modeD?andüwþ ,P/× B=F Gñ# Cannot test withíýPOSIX locale, since1 enG¹##Q0if c�bposix_Z/()¹õ should be ignored if -E is usedvê{Es pDž.zinvalid1éöxxx', failure=True‰…DIn('nùðenvironment variƒ value'Cáout.rstrip()) 91defòð_filesystemencoding(„™ªñ = textwrap.dedent('''J;©import sysÿ print("{}/{}".format(sys.get|)Äc>¦eerrors())N3'''ð;2¡expected =ªö-8/surrogatepassêJelse´;rescape'r‚(" ¯È’zãM/7¯ ÿ è ='á/ct€ H-Ämbcs/replacehXðstdio(self): ÷ code = textwrap.dedent(''' ©import sysñprint(f"stdin: {sys. ¸.encoding}/�rrors}")E6outF?outGH 6errH?errH HU''') žðout = self.get_output('-X', 'utf8A-c',G,89 ðPYTHONIOENCODING=l eÀassertEqual(èÏsplitlines()^!['tÿ : utf-8/surrogateescape': :u;#h;÷backslashreplace']I,# ýó has the priority over'EUTF8M…Lw"latin1”‹2V/strictƒ3{3| @MS:nameõF=gUTF-8/aJ7N7MÀdef test_io($%):¤F+@fileäl¥ys.argv[1]]#¤with open(-v) as fp„'”8{fp÷ï5ZP = __ /__ ý 2Æ,ÅF='1'í5.ä2, 'w*5l¤_check_io_Mw¤, module, @=Nonß ›—Ö3# E¨õ explicitly set}†args = [�%ify }+¥.append(f'�{ 7!r} G±E "1={e At&À from %sç import open ùfilename = sys.argv[1]#Awith9(-É, %s) as fp:+Yñprint(f"{fp.encoding}/…rrors}")4ö''') % (module, ', '.join(args))0out¢õ elf.get_output('-c', code, œ]�õPYTHONUTF8='1') /tif not ³ Ù­ = 'UTF-8'8Ý 64fstrict5sÊôassertEqual(out, f'{iA}/{e>}¤Ôdef check_io_'(I", @)~.._/),æ‡="latin1”;— ="6replace>6™Ù™",  qJMtest  8'ioZF%?_pyIôlocale_getpreferredÙ²Ÿ¾"¡:"; FóH�False), $ fTrue))wGXy@utf8U ¯  JfÏ, LC_ALL='C'r!P@unit¿ð.skipIf(MS_WINDOWS, 'ó specific to Unixh>Œcmd_lineœ0arg›Âh\xe9\u20ac'Óƒe('utf-8I»@arg_B� = arg.deÙ'[ascii(~÷surrogateescapebQ� *,·/p"%s:%s"R 1), o(ò0:])(UÎ4(Ô÷_opt, expected, **kwÃ1ô C±3argJvIùð = out.partition(':')[2].rH&p('2 �Cãµ ),S¥ÞÇõ[¿]\ if\ð .platform == 'darwin' or supS¶.is_android—"c_?ZæOelse+š,¦a=0', [V]4.²í¬ðim_level(self):  ñ!# CPython: check that Py_Main() doesn't incremenÑOptimizeFlag Gó, # twice when -X utf8 requires to parse the configuration7(8Mñhe encoding changes after rea K,^D h!is:° again with/E newi%).>ócode = 'import sys; print(sys.flags.o%)'7ðout = self.get_output('-X', '!-O@c', g)>8öassertEqual(out, '1'#abE2') †”û àignore_environEñ if __name__ == "__main__":¿�unittest.3() ¾tcopyreg&q from 1`pickle 3er 7òExtensionSaver class CkTpass øWithoutSlots(object)':&zWeakref%0__s:Ôb ('__w%X__',)cPrivate= Gspam8_vL3ßUnderscoreAndM"/__}|ÏSingleString='·í¬Inherited(F[ 6Aeggs÷§ôopyRegTestCase(õ."):ó1def_¥(„aÛ.“ðRaises(TypeError¾X.=,ƒ5rC, Nonelyÿnoncallable_reduce†Dôtype(1), "not a v"’ ¿constructor—M?intœLbool‰±è…ºMBTrue´.)()úeôœ_registryl�mod, funcL%`junk1 Ð ¥2', 0xabcd�L O(gØ2try1<€# Should~dbe in ‘F now©0ë¥LValu¦àremove_extensi_on,  ùmod, func, code)/ÿcopyreg.add_extension(3 ù # Should be in the registry.\ôself.assertTrue(li_9[rO] ==¨L†invertedKåFÇ)õÂ7n'tÅ_cacheÂ`NotIn(\G5É= f”Redundant!uation s?*OKp"Ž 3 #DÁilow upzÑ# ConflictingN hNöRaises(ValueErrorß †fJ + 1tfremoveYw. ¯module namê8H[1:]| Tx ˜U¤QTw @# CaO� one that isáºered at allP!ifeõ@ notË_¡:«»CZ2modhå r©%) ˆzfinally™§e.restore(* :Çthere anymorQÐ7Š_å¼ R# TheUS*may*¨V¬<Å, though, ifÚó # we happened to pick on a“Ó€. So doî—check forH .31# C%Qvalid¨s flimits!1for!r1, 0x7f pD = E‚QSavernÐðtry: û copyreg.add_extension(mod, func, code) 7oremove:�finally:OÅe.restore() ñ# Ensure invalid‹¥s blow up.(1forò in -1, 0, 0x80 lð self.assertRaises(ValueErrorë ,h  +0ðdef test_slotnames(|)�‹dEqual(S3öWithoutSlots), []‰?{Weakref>àexpected = ['_gñPrivate__spam']Åâh@4), \¬nóLeadingUnderscoreAndB‚"ÃU)Æž°ô0___T'¯>rÁSingleStringKzI™7‚eggs', '%Ÿ$f.sort(<…result =à VœInherited3 I Zçp if __æò__ == "__main__"ï@unit .`() doc–s = """ #ò Tests borrowed from or inspired byW¶genexps.py >@## Aò simple loop with conditional`Ð>>> sum([i*i Ai>ðrange(100) if i&1Î1vj166650bvnestingTl[(i,j)R3jd"4)c [(®0), 123Ñ 11, 11, @2, 0 12, 2 2 ]¯¨  thS0ner«0resòà dependent on "_outerÙ 4ÙiÙ¹ ¡3±3±3±�] Make ðPinduc²ð variable is notµFosed›ai = 20× Ë@3283Ëá3i=ð 20 Verify that syntax e€'s are r5dßðlistcomps used as lvLs™![y*y÷°(1,2)] = 10v## ñ : +IGNORE_EXCEPTION_DETAILšðTraceback (most recª–call lastW"..S¼Ø : Hð>>> [y for y in Ô(1,2)] += 10 ð# doctest: +IGNORE_EXCEPTION_DETAIL ,ñTraceback (most recent call last):'a ... ÁSyntaxError:6 #ð Tests borrowed from or inspired by —ö_generators.py Añ-## Make a nested list comprehension that acts like range()  ’>>> def fnÂ0...ðÀ return [i f—3 in?5n)]@<110)ñ4[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Same again, only as a lambda expres·ðinstead of a functÍ`defini Ál½$ =E?n: ³ 2(³GB canðfother ™:�Qg”(QGxGS?}‚qyield xY¬ß(\/5)q#] Bsureü`None ifTvalidÖVvalue¶['¡i¡À#10é , $]ôhû various scoping corner casesåR‰&s× usà@e itQBableSödefault argumentë¢items = [(QŒ i=i: i)æ5ýz2[x( ¿B ðápthis ti÷…1cloœ®˜”'4{R] An°away toUE/thA�is local-&heW­'ei = 20ÊP¶Â¼’d confirm´$a CŽ jump over Ì! Vß²ô2: yÐîðy¯®2ëð] We also repeat eachÜQabove˜îÙsë idÀâaG%_(š Ïà UÒÎëu âš)¢Í ž* 0 žÀfunc(): @... ðitems = [(lambda: i) for i in range(5)] ,4Y = 20¢return [x(>x>\;ñ>>> test_func()<F[4, !] )8def-:} ±ys±y± F°"62, ±] """ __Ù�_ = {'docTs' : 5} Òòmain(verbose=None)Þ¡import sys§Afrom  up!r’_listcompAs0S.run_ˆ('#, ‡)y#ñify reference countingv if!¸ñ and hasattr(sys, "gettotalref5"×6Â!gcG#uU] * 5 {Blen(/)SEâ1£gc.collectˆhP[i] =‰.Õ/Tprint™ð if __name__ == "__è2__"ÝyúcTrue) @unit# ôxdrlib class XDRTest('.0Cas;7]‡xdr(self*Bp = Oƒ.Packer(ïõƒáb'hello world'PaÑb'what', b'isahapnin V3or'·4pp.pack_"42ã =-17u09Rbool('E`]False5�uhyper(45Žfloat(1.iodouble�string(sNl(#, ™Ê +uarray(a%T…P# now[5ify0dat‚p„Q_buff¹uÖ Unu0er(3Wâ.assertEqual(uMßposition(), 00 u\Ñ8), Ô^ . ë/5Œ™.º\ûP) is ¾´# remember áL poè ÿ oo4pAwind �e again"tup.set_Ž7(poGs!4Ñz_÷¤ú1ðAlmostEqual(up.unpaóck_float(), 1.9) ÿself.assertAlmostEqual(up.unpack_double8 2`string2sh 0Glistqquint), Ÿrange(5))IWarrayJ‰F), a?†up.done(öRaises(EOFError, –ñ class Conversion( TeÁ€nittest.qCase): f def setUp(j!):~.döer = xdrlib.Packer()<�›yM|, *argsT2(X:³:g¼_ŽA_int^W O+Ç@2, '}'ÉbM8c%Adê_`%Bab)Ccouhyper%+C cò if __name__ == "__main__"–uÄôL() # This file is marked as binary in the CVS, to prevent MacCVS from recoding it. import hPpPEP3120:(HC ep.bimù"Питон".encode("utf-8"),*¢b'\xd0\x9f£b8\xd1\x82e%d'8N†?\П\a(9falLœbadsyntax2tryÌõis6.6"_pDU&�except ST"ç:msgMñmsg = str(msg).low¬BQaTrue('e',4r:lse]:òfail("expected ˜ôion didn't occur") ;àBuiltinCompileBsCÑ# Issue 3574.ŠQllatin1N’# Allow c_ ()ç`read L0’-1 sourceM_`q = '# cÿ:1Õ\nu = "Ç"\n'‰N"H ÈRŠhñ, '', 'exec'HÀ except çSyntaxError: õ$self.fail("compile() cannot handle Latin-1 source")@uns = {}Öexec(code, ns'cðassertEqual('Ç'#ò['u']) if __name__ == "__main__"¬�unittest.ó () import _dummy_thread as  Dtime Equeu drandom^` from h a0supi'ômock DELAY = 0 class LockTests(2.RCase)Ï0"""ñ lock objects.""" I def setUp(83±¡# Create a:-'.L= .allocate_&()ZßQ_init;b‘Make surebqs start *edpÏQFalse¨�Ued(),-¡"õ@ is g� ialized un™Led."µSrelean´ LÊ.( €WŸ.acquire(8é21didêdž properlyæñType_context_managere÷Ewithî5(!uEpassŠ"Î%2 "A;dà2 wa»Ñd®"imä_" À#k"e of an × raises RunÏÁÓR'('!, óùd TScond_�_successª@the 3‚itional :0ing¼l works.¥8Tru.??e(00 OCondp ½1ªÝ% Ú:†Å¾!edï‘ returns â Ì'J0Kadê%ðšÕincorrectly "šï "Ï/ed)un*ù 1‡�õ )( 1? U»/¸ÜçÀuncond_acquióre_return_val(self): ò#Make sure that an unconditional locking Cus True.?N‘.assertIs\.1Á.acquire(1),2,2x/"Uosdid notwD5.")Fx w!) 2’def test_Û_ž _b¬1ing¹7>Aof a!!ed Qsy€delay_unl3(to !, uÒ"""Hold on toSòfor a set amount of time before Yqing."""îI&r.sleep(l Š“.release(-;_±É{Ptart_]p = int( .&()&‘_thread.s.3new‹y2w, DELAYBöif support.verbose¶¤ pr}r�"*** Wait¤@ŒSìB the_)"\ó "(approx. %s sec.) ***" %Ÿ-" ?end Þ_"done÷ÕGreaterEqual(r"- q�S{Bã%+byöä`failed|üÐ@mock.patch('fb'ˆði@e1outè , <_’øÁ"""Test invoj<ñ() with a positiveø†out whenÃ!isš alu#y CVd. EnܯR() isr"edgUgivenM/n2andPFalse9 """b} žretval = %´waitflag=0,á"=1OVb{(Dv.called+1_"`_once_M(YE¤!, ç Ñ*°_representaÕÉÛ›•@In("NPed", RHþ1'ŸMOÀ class Miscf`s(unit£.CCaseÂ0"""%‘ellaneous1sU 2exiÐ9 ’óRaises(SystemExit, û.: XOidenO ´IsInstance(GBget_7 ),�áÀ ó "_thread.get_ident() returned a non-integer") ÿself.assertGreater(HQ, 0) 4ðdef test_LockType(B!):TQ¥IsInstanceTôallocate_lock(), mO,IMæ1à is not an in¯ of what "M &is"%by� ¦"üÏset_sentinel_;) JA didò/ aýB8.é0¬rrupt_mainëó#Calling start_newÎð with a function tŽšexecutes V¤ñ # should raise KeyboardInte„À upon compleV.:•Ucall_Z(’E™.!ÑÙ"¸R€-s(�œ a 4 ³* stuple()¯ï„Î"inÑÆû�ÕöNí lístack_size_Non÷…retval =N0(0rbEqual(;cCO_notwiæŽÆerror) as cm£ï"d/("¥�cm.excepyargs[0]²P"sett”"0ck >¥�supportedr� class T¾ Tests(unitâ.CCaseÔ0""" Vc²{ion."""Ÿ½arg_passing·’Make sure˜£parameter 1j works_P’òer(queue, arg1=Fals 2 ©c‘"""Use to5 1!()| esV¡s properlyØG{`.put((…2%£Aing_)1 =  .Q²&(1„þ ˆç9, (M@, Tr÷)J�result =àz„(%¡?(5ƒ[0] and 1P‘"Argument'Xðfor thread creatio_n " õ"using tuple failed") /ó_thread.start_new("X½arg_tester,^.()�{'queue'::Aing_Ò, 'arg1':True 2 }›™result = <e.get()‚°self.assertM(5ƒ[0] and .1]š×Ñ"Argument pas+Bfor � creatio`okwargsaF( , ìo?argKŒ�Bboth•»ÄZ1defc_multi´_¯(%):%.ya_mark( w, delay&²time.sleep(D9S.put(r�‡_ident()º>P_counÀ5E Æ2 = QQ#(5Löif support.verboseØ”0pri~c�"*** Test(gÚ ð "(will take approx. %s toÞsec.) ***" % '€cDELAY,EaŠin rangeý á1if P galocal_¨ò = round(random.V(), 1,4,elA J0Më "½R^] Åv)¦ƒø f'done'6 "ZEqual†`.qsize)®Ñ€"Not all 3ÿs executed properly�p "after?JEH{î0»6__R_not_lÖ¼&""Gó` invokù ·Ñ) with a non-Mp value —"g%".ôExpect TypeError<Ámeaningful epmessage$–be raisedGŸ~¿•R,%s(cz) as cmï…Àthread(mock.ÓMock(), []) ð4self.assertEqual(cm.exception.args[0], "2nd arg must be a tuple") J°def test_kw4 _not_dict(`%):o5""" ðTest invoking start_new_thread() with a non-L value for "g%".MôExpect TypeError=Ámeaningful e message toÇfraisedG À R,%s(cv) as cmÝ ¾.ÏTmock.‚<‹È=’!,3r’% ‘ŸSystemExiŒ2@funca that >s„kQEThe Pp shouldydiscard|h6 = 5Æside_effect=h&()Ê?try‹],ÀA§ ^ O lfail("Ý d;.ˆ@Ãò patch('traceback.print_exc'Á@eE�?,_3O,þ ã.ÐË»• and the Øá¯%ed6via((p|¥<wIìÍ÷PTrue(¦bñ.called) # SimpleÜR suit€ñhttp/cookies.py import copy from1A.sup€run_unit) , 0doc ?Ce ;l)ñpickle class CŠP$s(D.bCase):ÓcQbasicZJ•cases = [±“ù{'data': 'chips=ahoy; vienna=finger',2 '†B': {30':'5B', '73':'9}:’repr': ""E`output³JSet-DŠ(\n”Ë"},+ûÿÿkeebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"FU' : 'IGED';'''T=QÀe=\\n;'>''',( ù8'output': 'Set-Cookie: keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;"'}, Uñ# Check illegal cUð s that have an '=' char inéunquoted valueO`{'data¢–•)',&P 'dicÈ#{''R' : '+},ürepr': ""8. m š"# _’s with ':ùAacteþûtheir name. Though not mentioned inPðRFC, servers / brows ©allow it. 1 Bqy:term=g H -I1N@'='=T=<}iðissue22931 - Adding '[' and ']' asQ0id krsq’ %#)0ues3Bdefiy™ RFC 6265,{O£üa=b; c=[; d=r; f=h`' «àa':'b', 'c':'[ Pd':'r Pf':'h\`'½€a='b' c=½d='r' f='h'q�È­\n'.join((Õu ?a=bÎ '?c=['?d=r'C ›)))}]û�for caseñUases:&³4C =š.([pC.load(I[æ]!ðself.assertEqual(ŸA(C),}[®4 "C.’•(sep='\n'?'AÜ@k, vÜUsorte¢ª].items())ó÷ ¯QC[k].eB, v)?‘def test_ü3J95p'CustomHóWILE_E_COYOTE"; Version=1; Path=/acme'¨O'±'X'š´ –'C[? [';Ÿion'], '18Apath5±Ô"['6)N [* ßB.js_,…(), r"""îà
Alien sex friend˜²[2:250:6] »)o905100»P>1989…§_48:14¨W4570808¨'90¨OX§5§1§/54öY4572929NuColoniaªO3:12ù"   ñ$Flotas (max. 9)Ô¡‹ P§ h>Num.Espionaje(F)- bZ¤Sonda de ea€: 3 ">3< 7š[2:250:6]úWed Aug 9 18:00:02 7O42:57 17>ý‘ 3
Metal-80Eo/3.965M ø)p
<ü1 <$íõ 519" border="0" cellpaddingAspac1ñ
[2:250:6]<þWed Aug 9 17:59:557O42:17M8:017w{R@ Nueva misión: elegir navesN.¥£‘DisponiblEph> one new dict #ñself.assertEqual(ChainMap({1:2}).maps, [$])7q# 1 arg`Qlist Yàdef test_bool(c!):7rVFalser/))%o{}, {}+7TruO³-Wò)Ä|missingÇÕclass Default5 ðô#__J!__L[, key(,¥return 999=d =jƱ(a=1, b=2),Ö·(b=20, c=30!²for k, v in&6*û, d=999).items(’® }d[k], v » Ð# check __get]S__ w/Üž/77�¿.get(k, 77)¥ �0_) w/ ˜_o"c=!d=Ç£k‡� H£¯__containsA¢ÿ.pop('a', 1001), 1, d\Ó 1MO1002â—e: 9�Ï(), ('b', 2)^ _44Wwith hûRaises(KeyErrorÃdßL Ûñorder_preservationš@zÔ(´ 0 O@ðedDict(j=0, h=8/),+  i�9—A4444¥?3335 Pf=666�£222, g=777:–@  Be=55^) \Ä_, e=56 ¬ÿ ''.join(d), 'abcdefghij'3˜$(dß k[)›2q('c', 3xp ('d', � =‘ ('e', 55>qf', 666 g'„…`('h', 8>0i',é94|j', 0)]€éo_coerc  ÀMap(dict(a=1ó , b=2), dict(b=20, c=30)) ñself.assertEqual(+d41a=1D8�.items()@yðdef test_new_child(ˆ!):šò'Tests for change åissue #16613.'.Öc = ChainMap(ܦc['a'] = 1*1['b2�m = {'b':…'c': 30}fd = c.¨m_³ ;‰.maps, [OÑ30}, {'a':1, hõ }]) # check internal statex]qIs(m, d]U[0]) %ñ # Use a different map than%ct*²class lowerá7ictos•P__getÃ!__’[, key(,ÿif isinstance(key, str)-Pkey =I.€¡areturn¦.ƒÉ/ª�contains«i„ ˜.1±½ œ ?C]œ`in 'abùÀ–A¾n d9yR, v iô(fBŸÄC=30, z=100)M:Sy&geßtÊ€.get(k, L�, v) #<QÐ Named Tuplesd: `NT = nhtg( ÐNT', 'x y z')±# type used;apicklek2s NI°P(unit‹.bCase):Àe�_factoryâ[Point•”'ð š(0.__ÑQ__, '2Pslots3(Ä O�.__module/l•!, l’?°fields, ('x 7y')° ÷Raises(ValueError,ß,‘%Arefg ghià 7ãÐhas non-alpha#r€Àself.assertRñ#aises(ValueError, namedtuple, 'class', 'efg ghi') ñ# type has keyword ÿ self.assertR^ O9abc] ^ÿstarts with digit e!d%‚ # field_ïnon-alpha charg(Babc 5*g+,Æ8ˆ9‰_,� e_ed +ÿleading underscore/(jn²# duplicate ô™€('Point0<Qx1 y2—ñ# Verify that numbers are allowed inÞs±S_NQa b cN?~# Test ósLaD¥1t =eC@('ntXöthe quick brown foxfkõ# check unicode input³_ñNotIn("u'", repr(nt._5s))1n’P('theš–#')®† ‘4’Ã"4TypÚÏ._make, [11]šö# catch too few arg×a‹, 22, 33iaBmanybÄðdef test_defaults(q!):8Ä qdx y', ;Œ=(10, 20�5# 2$Xg[aEqual(Uô�€, {'x': Z†'y': 20}E‚(1, 2), .+0jZ+å)»$<20,!d # 1$#!P—îëV4# 0ïë À self.assertòEqual(Point(1, 2), 3) õwith self.assertRaises(TypeError):+2L%) A8 õ# catch too few argsa;w¶6 uOmanyv9?, 3}=ìwdefaultññ = namedtuple('¤', 'x y', 8ß=(10, 20, 30)¦=Ånon-iterabler›ª/10 =�another ¨§&WFalseãyã_None)y#>@ is %ž}°”._fields_çF, {}>5 IsOæ¥.__new__._81__,p<qF#PL>ä#y[]}q# allow"I ÐgM‚P'x': i'y': 20’ E‘m•¶²!(1¾ ½,+é rH(wxrRplainn5torc�nÚ ñ@unittest.skipIf(sys.flags.optimize >= 2,. Sð"Docstrings are omNàd with -O2 andñ above") def test_factory_doc_attr(self):%)ñPoint = namedtuple('‚', 'x y'P+:Ñ.assertEqual((!._\2_, 8‘(x, y)') cP@unit‰ñ.skipIf(sys.flags.optimize >= 2,.f ð"Docstrings are omNïd with -O2 andøð�writableô?xö÷ Alias for field number 0:)5T = 'dÙ:!'lC,BxØ]_fixeú²€spec, re&ed in [‚ˆ`[('efg •g%hi'), `_1')],&#¯ìnon-alpha charh0abchPclassi#('h¼has keyword`8É"9gÉ@('_0q_ Èbstarts~\digitf´m?), Åf.ÿleading underscorelk%, ¨ÞŠ _2ìû´²# duplicate¤^7x�ý 0V¦ is a spacÁ]< ì8ŒXNT', §�=True)._ms½ øîmodule_parametþ+NTõi0['xòRy'], BÏ=collections RNT.__2I__, 5[‘instanc•)Ap = 2(11, 22˜#p,* x=,_y=22)/-V , b\*·.`*dict(^ , j)7óRaises(TypeErrorù@, 1)eá# too few args­-–[o, 2, 3a[Omany\EevalMQXXX=1øÀ)', locals()qð# wrong keyword a“rgument ó+self.assertRaises(TypeError, eval, 'Point(x=1)', locals())Aÿ # missing keyword agØEqual(repr(p)^¯1, y=22)')žðNotIn('__weakref__', diE0g1p, ¾ø._make([11, 22]¾È q# test 1Ï classmethod•eÿ._fields, ('x', 'y'b 3e8¯ attributee qreplaceŠ1, (Ëh Ê8 È€asdict()[cô–ð(c8bÆEtry: 13p._ŽÆ0, ei&=2²except Valu† @5assQJelseÎð_fail('Did not detect an incorr wuname') Oá# verify that #@ strØæcan have comma‚\0 = Krdtuple(.Gx, yÌ2p =ŒúV}ºˆU! 8µPspec ²“be a non-Ævsequence¿ ÊmÃ?1defo_=Pness( )פ /'xbçÜUçáIsInstance(p, x(‡pijÛò# matches a realdE cƒ (¸larÏcoercable tohAlistgR +# hDÊ1maxa/22Âp`# iterÉW *,Xy# star-X�O = pií&U ¹Ð# unpacks likpÎcÏ(p[0], p[1])[p# indexÌeÄI1Åàp.__getitem__,c 3) ÿ self.assertEqual(p.x, x)! Oy, y!óRaises(AttributeError, eval, 'p.z', locals()„ðdef test_odd_sizes(“%):�ðZero = namedtuple('_', ''†È$@(), jì Z í%Ÿ._make([]- Prepr(2Q()), …/()ƒ€._asdict�/{}²‚._fieldsº;Dot0Dotd‚ PDot(1Ø?1,)z4Dot1/�(1).d, 1U/�/ ?d=11 $)1)1_'d':16 4Ðreplace(d=999ó?999õ Æo0'd'1s†n = 5000ö%ames = list(set(''.join([choice(string.ascii_letters"†ðfor j in range(10)]) i'n)›@len(b;Big%QBig',<'’b = Big(*onY "2b, u,Ñ -3BigH.?á2posŸé“enumerateØ3 n’getattr(bBW), poæ€ b); # a sure 4õ) doesn't blow-upVd = bŸ€_expecte!ì2zipÅ,Ô ¿ ËEd, dDa"b2qÜ!**][[Q[1], í—-5], 42)]Ñ%b2XºœÀ%P[1] =V -5%42 Ê$b2òU�1ñiÔ lpickleö p = TestNT(x=10, y=20, z=30Fh`modulee(J,b@loadÜUm11, 'd-Odump- -€protocol�B-1, dû.HIGHEST_PROTOCOL + 1žuqÀ¦(fD(p, W`* hÀl(p, q)  ôself.assertEqual(p._fields, q ') 2 7ñNotIn(b'OrderedDict', dumps(p, protocol)) Fàdef test_copy(H!):Xö p = TestNT(x=10, y=20, z=30„Ðfor copier in y.L, @deepUY0q =Vier(pJ‚ ?, q#  $Æßìname_conflictsép# Some %€s like "‰p", "clsPtuple ñ itemgetter", and "property"rÅñ# failed when used as Èd!. Xõ to make sure these now work.N1T =6d„v('T', '‡Ó€ ³Q cls )'6tÈæ(1, 2, 3, 4, 56 ræt, (1,2,3,4,5))0newI¶t._replace(… %W@=30,‘B=40,•'=5:# zb}Ô0,20,30,40,50ªÁ # Broader³ñ of all interesting(Às taken fromU¤ code, oldS¢# templateäan example"ƒÀds = {'AliassAIð'AttributeErrorQBuild Aypas+…Create',Oa'Encou©+qExpecte Fà@FP!GoihHelperD IronPython.J 5Key�@Make`Modify *NoŠ Q'PoinpQReturZ É1TypOdÔ"UsÁQValidðf 'Valu�VariableLaŽ‘accessiblW8addá2addR1all-1lso—qarg_lis­2argT‰rgumentsG±utomaticallbmb¨ 1tinA!buPb(@cann}ãaclass_1pacGQmetho¾!clH’collectioWxconvert–Íc< iÏ�debugging)RdefindÆ—Qionar·1doc0Tocstr= žcduplic£@effeO@eithk„ 'enumer)cnviron`4 'eò-u1exe}fërf_globa÷+ LžcformatIfram:1funX4 75gen«!geÇ™*gÈ0 'gbÛíhÎ@help)¡identifierUQindex ¼ @stanH in#ti-†n~`introsãÞ&ishð', 'isinóstance', 'itemgetterArabl@joinwkeyword Ss', P'kwds!le.1lik>@list3map&amessag"ˆmetadataMQmethok 42odu“m B_namBuddO2tup>_“` "pa2neeÐ9newKQicely8sum_fiel'2umb<Qobjecô of(qoperatoXhoptionP‘particula%Bpickª 0ingG2plaˆ"po40osiM)alOrot¡M4regX reâLCreplè dHreprN1_fmÍ `esentavF3sulJuse_CS se%1selSsequez!seD1sidÍ�specifieþBspliHtart›sPswith‹1ste!stõ3strÒ Œbubclas y¼atarget1thaÀ!thŽAtheiS2thi opL _$2typ=%yps‘underscor‚unexpectæ`unpackXuÆ8useë#us'saAvaliQvalue–Dvari°PverboBP 'whep€Awhic11worqxv.z Uzip'}/@T = 3dæ`('T', %s)#€# test _%__š2 = :¢range(len(?)Art = T(*1)ü.assertEqual(t, $;Ã*dict(zip(T.‘,iRÎEmakeÌg ._(ƒU°exercise __F(&(t÷� asÕƒg"._#@(), +[ñß2newòÊÝv*10 for v in’0new. t.èolace(*žX)¡ N&, ,Ë~ &ˆ~2I·_getnewargs� P9t._*} !) T1defÿ r(@!):%ANAq&x'ý0 ôçA(1)), 'A(x=1)/ # p shouldQw the±1 of só„ðclass B(A):  Spass ñ self.assertEqual(repr(B(1)), 'B(x=1)') 0ðdef test_keyword_only_arguments(L!):+_õ# See issue 25628Hwithz÷Raises(TypeErrorEIóNT = namedtuple('NT', ['x', 'y'], True¥1 0abc30def5 reT=<7Ä ãNT._fields, ('B__1'))Ï=\žYFalseÚ· ¡_subclass_gl_24931ˆ!v Point(;1('_ J)z+è3a =GF3, 4 4ða._asdict(), OrderedD![(µ 3)L y'F'])¹ua.w = 5rZ_Yÿ__, {'w': 5}) #<Qð Abstract Base Ch esm:" ¡ðABCTestCase(unitj.&):ƒ£validate_a r_method�€, abc, *êsÏ$ptubs = D‘.fromkeys÷s, lambda s, *args: 0›ó# everything should work will all required kÅ are presentÒðC = type('C', (¬$),2�W)C(Ôinstantiation‚œfail if a~µ is missing|1forG1 ins¬û( =�f.copy(“'Pdel s+[c]^Þ. EÙ ýA, C,Ÿþ÷ó"is!ceæí‰ëp/ =ÏD©€object,)Uö__hash__': None}¹ƒsetattr( ,K1IsI®@ce(C?abc(|(»ÆZ+ú©(Š?Not�rŽ ˆ£comparisonˆ—‡ opj@['ltug!le n or0andxFsub'Y€operatorN%{}pÎ opÌ+opÊð = '__' + op + '__7' ô operators[name] = getattr( , %) 7Åclass Other:Súdef __init__(self) $ÿ.right_side = FalseH#eqF0, olM:TruLt}return °__lt__ = __m „?__g/le8n?rorUOrandx< 8sub<è1forÜ„, op in ò‹s.items(r¡if not has ƒinstance ëkcontin�Ë" =?%()Œ¨6op(U) <`assertÌ(#M0,'RY Y«pcalled èZ%s.%sûsu% (type„)Ú1) Ú„test_genryield ð TestOneTrickPonyABCs(ABCbCase):AJIœAwaitable*"f¢n@«¦s.coroutinõ?¦1 @`async -Onew_1Bpass´Cæ/BaóaÌ® 5< {KÀMinimalCoro(Æ =ŸAsend#`, valuITà Q@SthrowA1typF‘=None, tb uZ‚super().=72 ’a/__ÿònon_samples = [‹qint(), øµ, object()]ÎÃx¤> rcNotIsIŸE(x, l ¾3…a(issubŸ (x)<d, repr)Ï0BarÉÞÇ2ÃÀ¿ °Bc = óa`# Iter�Žcs (gen ÷ with CO_ITERABLE_COROUTINEE�flag don'(Eve 'ð' method, hence ca%4be ósG&of´A. Us&qpect.isn©õto detect them.@Ø Àstance(c, Aw³aitable) åc = new_coro()õ self.assertIsInstance(c, AwDBò c.close() # avoid RuntimeWarning that a  was not aH'ed‰õlass CoroLike: pass�ðutine.register(*´„True(isi¹-(()Â; @subc’h9Yu = None±ñsupport.gc_collectEKilläò to clean-up ABCMeta cache�def test_eþ(—%):f"Ggen(•GyielZp@types.�F ?@ `async l)„q¬W8J Bar%A!__ø,__ÊF »KpMinimal�Æ ô^AsendY{, value#`breturn±@SthrowA1typF=×A, tb R‚super().=72_aÿònon_samples = [‹0intÇøQ, obj],q5()]Õ—for x in E ‘Mä(Noç!x,¤gQÅ3@Falsd)f8(x)<s, repr()wÖÞÀ+¼ x¥¹¸Û© $P`# IterHÕ'÷s (generators with CO_ITERABLE_COROUTINEEõflag don't have 'ð' method, hence ca%4be ÐF# of­A. Us&qpect.ism©õto detect them.‡Ñ cÈ�G� D?/BŠbÌ ¶08Ç$, ÍûÒ JJ2„6 Z¿Ó%(ÐCoroutine))  ðself.assertTrue(issubclass(CoroLike, ’utine)) 8! %%: �def send(_Š, value)#'Mpass8Qclose92Ÿ__await__6“ò@Falsó…instanceó*()õ­</Ítest_Hashablßó# Check some non-h)ð non_samples = [bytearray«@list!seudict()]Z€for x inZD �ØdNotIsI4x, ´)P  wtype(x);s, repr()K ùõñYNone,ƒ‡Q inõAfloa co%?x().?strPtupleFbfrozenLq , s , object, Ù , ”&s(Ý¡�܉† ¾“…þ÷Raises(TypeErrorÄ ´tdirect 5ing#%H(< æ __ï´õreturn super()./_·`Equal(Q�(H()), 0'ð³w(int, H�Tõ validate_abstract_methodsÐ4, '‘'j=%isW 7. ŸAsyncIter P/AIG_aiterH1elfqŽæ õ« AI �  9KOAI, 72ß³èßî_/[]@ Þ Í ¢  (M @׃  G FÅM= ÑSðtor(self): ·class AI: údef __aiter__(self)!,preturn  =casync COnextC aise StopA5•IterationP]÷.assertTrue(isinstance(AI(), 8Oor))91subí?(AI7õnon_samples = [None, object, []]`ð# Check some non-,Uables#€for x inU FÞdNotIsIÜx¢Uy7@FalsÝmtype(xs, repr((ñ# Similarly to regular Îötors (see issue 10565cN AâJOnlyÛD '| 1-ù validate_abstract_methods(@`, '__aÑ2__' Q__') QÕQtest_ª _BÒ”Œ"„lzv??€%D�#@ ‚±ótest_CollectionA¦¥some non-c+s%Gnon_@ = [Öõ, 42, 3.14, 1j, lambda x: 2*x]>€for x in_G ú«dNotIsIæ6x, ¿½4 Yytype(x)=s, repr()M Mable"_i0gen‹4a(b''),?å(bytearray()),à 5(x 1?[])GI…3ôpsamples20set,cfrozen 1dic1s0strotuple(<1lis4<A.key:Hitemvalues(YœO• ày”Àeck also Mapòping, MutableMapcetc. õ'self.assertTrue(issubclass(Sequence, Collection), repr/))J{IH ÊOˆÙ¼ z?Sett@tGNš Lô# Check direct ã5ing7ôê(V:OÐdef __iter__(9) $preturn %g(list(Ò D?lenC0|ƒcontains=,hm†UFalseGâ`DerColåu): pass Ò REqualÀÊ2))), []ñi<û1ÿ` 0s`/Bfloa‘1 Àõà :fÆ2É4ð validate_abstract_methods¾‘Q, '__O' ¯E__',Öu6'__a'é>csized #per non-p^à (which is notH¡)) p…šColNoIterA P 3žxOSizexËY$):F(öL¨  �:€OCont€1öˆu(n £©ñ<€instance{»/()>q>�< z<z À.assertFalseó(issubclass(ColNoCont, Collection)) ö self.assertFalse(isinstance</()>õ# Check None blocking\‚` SizeB:|Ðdef __iter__(† ): return 6([]¥0�contains4½ a‘__len__ =ž•OIter•8 ”0A�ITrue0é �ø ~º8|<º<º>zz <z4D in €:«ColImpl>7¡NWlist(÷ ‚íCý,¶*m)¦f†  Ú`NonColgá <&__ì7Uº 9 · ,Ptest_àCatorçðnon_samples = [ð, 42, 3.14, 1j, b"", då[], {}, set()]GPfor x P T¹dNotIsI®4x, � :2†wtype(x);s, repr(3Þ¡�bytes())úPr(str Ê/Ptuple")#r(‘=0dicŸ,>'kcfrozen3TG.key¦Aitem> Bvaluæ*__gen()»5(x Ñ/[]$üjøõŽô%ô validate_abstract_methods(pÁ, '__next__' òB__')=Õ# Issue 10565LzextOnlyñsV nRðyield 1 £ return ñ self.assertNotIsInstance(NextOnly(), Iterator) 8Âdef test_Gen(G!):YÖclass NonGen1=ƒ__iter__7” EC,Mnext,MNone,TcloseUMpass"Qthrow"°, typ, val=LA, tb 1): :;Ì2ÌyCsendËtvalue):I¬GÂ3Â6j eàf õnon_samples = [~W ð42, 3.14, 1j, b"",  é[], {}, set(),<ia(()), D[]),˜:£2 E3()]A—for x in ž @³?5x, )QÎ3±False(issub¤ˆ(type(x)<d, repr)ƒI3f “�ag+Pø¶MinimalGen(i � �H uSË R‚super().=hc¿¨Ggen(7Žvyield 1¾/Á, (lambda: (- ))¿ 7), ÉM (’xøš/ˆ 0?Truð wö validate_abstract_methods0, 'õA', '€'tq# mixin¾imgen =;Á½0Is(*J )Ú(.†(¼0), Ä>3�Equal(2, V92* IsRK.¹(ðRaises(ValueError, mgenó.throw, ValueError) öself.assertRaisesRegex(+µ, "^huhu$",5< Nmgenlx ("K/")€ø(StopIteration, U E()) ’ðclass FailOnClose(GenDEor):&±�def send(ú0, v’): return 0@1P*args1.SŒY S N¤0).c¬ ÈeIgnoreÂOExitÐNOpassÄ bRuntim?/, ¢ Îh¥test_AsyncÌF“¹ŽNonAGen1«“__aiter__9©e ¨}__anext-MNone-a|Wÿ Àaù1typ/=NA, tb 1): ;_ Ñ2Ñ}ú Ç3Ç>m ko%õnon_samples = [ÀT©ð42, 3.14, 1j, b"", ú(), [], {}, set()ßua(()), T[]), ¦; 2 E3()]€—for x in ¡ FÂ'úNotIsInstance(x, 4.Ö8±False(issubw�(type(x)Ad, repr9:Gen��{aâ 3�3I )O7Ä&pMinimal™(‘ -m¤¼jG´ Yð await super().athrow(typ,à val, tb) õasync def gen(): vyield 1.±samples = [/0, G6¡, MinimalA]E“for x in 9 _ð self.assertIsInstance(x, A••Iterator)N“4 ?Gen5 óTrue(issubclass(type(x)t@d, repr)…�ñ validate_abstract_methods(»G�, 'asend' gthrow'|vArun_„[(coro€Ùresult = None`while Í S#>tryb.�(PÓ²except Stop}Ÿion as exPŸãex.args[0] if ^ elseºiYbreakÔrreturn VtÕ# mixin tests1jmgen =x¤Y(+ , ¼.__aiter__(Ò.‘2¿0;), q__anextOO~}Equal(29V/2)† (mxaclose(4Wwith oüRaises(ValueErrorPmÜ’/�� FailOnCz Û [ÄHÜ–,pSue): Ûv™¦7�8*O8Ñ Ðû'Ó%).V[úeIgnoreÊKExitÝRFpass›öoRuntimó Ñ “ip_Sized(ŽçCnon_ʦù, 42, 3.14, 1j,Ýá_U4$5(x 0?[])L_™ «Ác+Nofã·ª/OFals*8!$ßbytes(), str(ÑPtuple#@list!secfrozen 0dic9A.keyiCitemÀct().values(N), ]õfor x in samples:6ÿself.assertIsInstance(x, Sized),ôTrue(issubclass(type(x)7d, repr)Goñ validate_abstract_methods(u¿, '__len__'94isi«3´ðdef test_Container(|)þCnon_ÿ = [None, 42, 3.14, 1jX4_YOgen(|$5(x y/[](¨™®TÁ¬+No¯ç3 3OFals´<¸<)Ïbytes(), strPtuple#@list!secfrozen 0dic®«A.keyi@item2GÜC ï _só;?f÷Bûc²s<Ê allable7P"", bã‚[], {}, Þ{Ò ;‚:!;ú9�lambda: j!Eß, int, object‚?lenäist.append, [] i./ø ^-:2, A+?all'7¿"tdirect_Õ~ TestCollecÔ�ABCs(ABC4aseŠñ# XXX For now, we onlyñ some virtual inheritance properties.oò# We should also?$th*Ð behavior of c˜ ™EÑas real base ÅÄes or mix-in.UºbE�±`sampleŽú[set, frozenset]m;#QIsInsâ(>@(), ¶ P1 ÿ6441°validate_abgÀct_methods(Sž6'__d`', '__�"__ î'S0 Myü¡ ÓÕPyx"É2& æDx?<08¼9 %6([]Ö )²comparison(é ´þ_9¡°OneTwoThree$'…CZ.šÿents = [1, 2, 3]õ'6ain%qx™ ]Q~ì~¥OÀÇj»ä%²ðKt´KÙÁ(D{a, b = —-), GaÇÀTrue(hash(a)ñ! == hash(b)) def test_isdisjoint_Set(self):#'€class My7SetE�__init__:[, itr%)V°.contents =&c I!EainsMxKÉreturn x in WQCiterMJ%½¡)K?lenJ¯len([x forŸ]VCs1 =T—(1, 2, 3)2x4, 5, 631öelf.assertTrue(s1.à8(s2I+MFals,“œ*�equality(ÿe¼#A H3, 44;  8g2 > s1• !o1 < s2!OO2 <=D #3F O1 >=iE‘(s3, s4D3Not$\2, s3û¯arithmeticÓÿeû ¢8, 5ÀÛqs1 & s2š:òë23, °M(3,)ïpMutableÐ;<öIsInstance(set(), 7i5Qissub16 457Notiofrozeno?p=vÀt)) ñ*self.validate_abstract_methods(MutableSet, '__contains__'Diter 0len ' @'add*¡discard') ðdef test_issue_5647(‰!):A&# {ð.__iand__ mutated the set during ‡Uation?ðs = WithSet('abc{W7s &`cdef')�# This usifo failX/ðassertEqual(set(s),Ž ('gãO4920ã bpop() wÕ did not work{€class MyÓ3Àõ__slots__=['__s']?x�__init__Ž»,items=NoneI/ ifZ`ms is #žC[jÒP.__s=$&)ŽS’v‰Äreturn v in VKÙE%j›‘È"E1len"D1add,Ìasult=váÐ?.Ovª  reP rˆ„Oˆo__repr–"Øp%s)" % 3Q(list¿)ü×*§[5,43,2,1] �.W?, 1–=875•Wempty=^Gfull‹range(10žu.<es -= s¥ÄaF!, y2¤ L^L8&L }|1ìpèR16373ÒJñ# Recursion error compa× €0 ann`æ# Set instanced/COE9;SetÖ¤Ù¡;, x'krUFalse€D908’!%'([íà?NonãÀ(self, x):  Øreturn False ùdef __len__(self):+<08Oiter9%O([])@#le>?, xzïNotImplementedGtG Höcs = MyComparableSet(®n ?Non#9q.assertb(4F< csF#BTrue"=#F>#F>FÏ–ütest_issue26915Öð# Container membership 6ñ should check identity first_úclass CustomEqualObject7ˆE__eq—_otherâðc”Sequence( Ej6ini;seq%¸�¥_seq = seqmEugetitem´Oinde–Q[)]RW1len£.œ%) Fönan = float('nan'L^obj =ƒ´ç¥9÷([nan, obj, nan�c [‚Iseq,ÐItemsView({1:H@, 2:U*}))_Value*R5Efor ˆ6 in s[)Ielem$ #¹#lf“0In(1,SKźÍQ(seq.Ð�(nan), 0,obj), 1, ScountX2,X2§¬1Sam¦¿‡, s1, s2ôó# coerce both to a real set thenâe¿1ity] 54Set`t(s1),=C(s2)£Œ4ð _Set_interoperability_with_sQ_setsà ŸIŸe: 8743}Y@List€7Set2�r)__ê×{ents=()-1–.data = [jIIH*0if !@ notvX.2#q.append�ò#ÏósuiÌ„ ƒ>ð def __iter__›(self): ±return iter#i.data)'±def __len__#F1len"EOreprFø'Set({!r})'.formatU›ær1 = set('abc'³$r28bcd3WabcdefJ@Listy NfN RfR VlV2lis¡7cbarlVhbcddcbVS"ed<ùõtarget = r1 & r2ã°.assertSameÎf#Bf2, 5&,r,r2 & f1XlX±•Ê|Ê/| ÊOžOr2 |Ê/| ÊHfwd_Î-Î7reve2 - r1‰-ëV¹ S�i0 1ƒ?2, `Or1, `r`«`rÀ!‡`f`lÀ�·^·š^š5f O…^…^…ò# Don't change the following to use ÕLess or other ó # "more specific" unittest7÷ions. The current<ZRTrue/ ñFalse style makes’°pattern of ZAÐcase combinatkÀ clear and aÇ@s usÈ×know for sureAñðexact operator beü—invoked. - pr%f subseÇôÊ�(f1 < f3éà"1"2"ere"e " eÀf.assertTrue³(r1 < r3) óself.assertFalse"1"2"Wwith IõRaises(TypeError):ovf„%l3?"1?+%2 @Å# any subsetÎPTrue(´?= f9"9 E: gŸg "g #gÎDrgrgÉ /= +?= l *9= l Ïproper super _3 > f /f1"2"…e„ e" e"erÊC4 e > +>+>=\Ÿ";Of2 >#E r3"€"g"g#Eg/= DgrÎ#  ,/>=*>�equality =à /1 " f"9\#ƒ#rF #Àf.assertFalsÓe(f1 == r3) ôself.assertFals#l#1F52) jÅ# inequalityO!= f\ ?r1 # f#rF1TruçEç"g"f"MfDlªlKðdef test_Mapping(C%):Röfor sample in [dict]ö1ó²IsInstance(4C(), YÞ 5¸£issubclass:89jó validate_abstract_methods(iñ, '__contains__'Diter 0len ã�Ö'__getitem__'r’3 My[c =D!__W ?‰return 0u8x<;, i^?ÿaise IndexErrorGâDA€%6(()á S¶comparison(ô .ÞR’as(Type’·, reversed,0)±êfdutableP®m0 `èEm©t ?@<{ 8r‚*Bs‘5del U_J7elf^p# Test kae 9214Fömymap = UserDict(ùµ['red'] = 54 ÷/P.keysû6SetJ1�KeysView6h2CItemjÒ¼Az = 8ôÕ | {'orange'}ZûHz, s!flist(zûXa['blue|7«ÿ# Shouldn't affect 'z'uE(Ô(sorted(z), [¤", Û¨^wÀmap['red'] =C 5 õz = mymap.items() | {('orange', 3)},õself.assertIsInstance(z, set)&flist(z^Ã['blue'] = 7zõ# Shouldn't affect 'z'OuùEqual(sorted(z), [©ñ, ('red', 5)]) Bàdef test_Seque¯P!):‚ðfor sample in [tuple, ÄÖ, bytes, str]15D GD(), m 6òTrue(issubclass(;9:lŸ?(10m3 i8hïmemoryview(b""n>s ¨?str3ô validate_abstract_methods(yñ, '__contains__'Diter 0len  `'__get?__'@€_mixins(dGÇøSØ�*j–�__init__JCKq=()(,i¢.seq = seqÖHµK_indexJtreturn Q[(]RNG1len"œ-“•# Compare .hð() behavior to (b]|str)”Þn_C¡_same(seq1/22, Kargs¨:try²›‚expectedJ1y*E{/þcept ValueErrorRBwithP¨vRaises(3 —WOseq2>lserbactualÂCk´? ä"W$, #R, '%r¢c%s' % w,ôD ty@Ö1 ºbnativeŰty('abracad'ê‰añes = [-10000, -9999] +•(ÁP(-3, �Yj) + 3)L2seqs†—7 È`letterÌFset()J'z'}Ù³û£6¨bseq, (X,£@vPstartuß |@€Àetter, startO)) ÿfor stop in range(-3, len(nativeseq) + 3):?Rÿassert_index_same(+/Xð , seqseq, (letter, startQop)) G÷ def test_ByteString(self‘ÄPampleÆ€[bytes, jarray]»=.´ÁIsInstance(s@F(), h 28óTrue(issubclass= ;< žÿstr, list, tuplež?Not¡%OFals¢Ú tïmemoryview(b""> wA  ÛÁMutableSeque�à 7%råsC q­¡Ñ ',, AB ïêŒ0, då²ò n>«¯˜ @®= ½ª; û validate_abstract_methods(9ñ, '__contains__'@iter Ð`'__len3tgetitems6del inˆ'8 ‰|_mixinsD²# Test the !< ofæõ by creating a minimal concreteÆ!# õ inherited from it.#! ›SP ëñŒ__init__Ç Ø‚lst = []I?IB!, ¾{, valuep5P[(2] =*Z²ZS{return ZRNG²K¸ñ+IñP?del”kJ;.5B/ï\mss =r²Êmss.append(00extð(1, 2, 3, 4)) sóelf.assertEqual(len(mss), 5) s&–mss[3], 3$Æmss.reverse(:1$:?pop6 –48wremove(ˆ r<&ömss += (10, 20, 30XB6& -1LÜ_clearÞ_0) #<Q€ Counter _:t class`1SubÃWithSetItem({!):O¢# Test a c’# s3ñ that overrides __setitem__9Ðdef __init__(£ó, *args, **kwds`²ñ.called = FalseCŽ.K .q…t¯key, valueq?TrupJF?GetB%3getvË<\Š!, 4default6dreturnV.K7RØ¡(unittest. as§Ïq_basicsÏ�4c =oŸ('abcaba'í%c,.ÿ {'a':3 , 'b': 2, 'c': 1})?ßa=3, b=2, c=14ÿIsInstance(c, dict[ 'Mapping*¢4(is{a\3h6T)c). xasum(c.Yos()), k jsorted00[1,}/3]‰82keyfA['a'º·<?), 5.ÉrŒ‰ ![(Œ±3), ('b', 2 oc', 1)š `c['b']0] _@c['z$›À self.aóssertEqual(c.__contains__('c'), True) oself.a4z4OFals5 ÿget('b', 10), 2a ,z,/10- ÿ, dict(a=3, b=2, c=1)1ÿrepr(c), "Counter({'a': 3, 'b': 2, 'c': 1})"Gò c.most_common(), [('a', 3), è2 cÆ&)]Jõfor i in range(5):kroi9i),/3 ‡ 7[:i‹ lö''.join(sorted(c.elements())), 'aaabbc'͵c['a'] += 1†a# incr8õ an existing value½·c['b'] -= 2:;sub1… to zero9¥del c['c']8‘ # removepOntry. ðmake sure that Sõdoesn't raise KeyErrorHOc['d¯¿from a missæ…e'] = -5®ÿ# directly assign> f^4>oadd to5 Õc"4"ÿ0, d=-2, e=-5, f=4. Waffff�p.pop('f(4<(PNotIn"6, c! *3*œ�, cnt = ccVitem(?3 d5&wc.clear84%F, {}2 R'R)R\ s(î"mpZ!edh#, ;.O@keysn kwHCType>Ihash<“c.update(5û3ê!/ç7�Ôp * 50 +_ * 30E)m÷ # test case with no argsd`__initp!a'^_íž*)cdx.D™ú"55 33 3% ÿc.setdefault('d', 5), 1l !$ VeV5V 0e']~ @1def_A( ªRlist(ÊÀr(self=42).ió tems()), [('self', 42)]) ø.assertEqual(list(Counter(iterable=42).iMQ%ONoneS¦óRaises(TypeError, ­ÚØ2o(), ()6±.__init__) nðdef test_update(R!):d4c =¢(i'c..^0?‘c~% zj ²n:r&Ïât> #()a;f{}, {}¶wœÙ |copyingâ# Check that cv`s are 1{f, deepRpickl5andUõ #have a repr/eval round-trip%Wwords�÷'which witch had øes wrist watch'.split,øc½G(dupñõ�msg = "\n¸a: %s\n| @" % 3!, ^9bWIsNot)_, msg.½=dupW¤l.�Ä& †($ñfor proto in range(¤ûe.HIGHEST_PROTOCOL + 1)Qwith õ�subTest(K= , ‘`TloadsmRdumps�,�)É("(!¶_É!o ZD]›(=¨8!œ_subclass'4 MyC !Fpass�' =1ö'slartibartfast'œRd = cþ’Od, c€len(d), cw HAtype* +±L{½_conversion1# C°t to: set, ¬a, dictF!ðs = 'she sells òsea shells by the core' ó!self.assertEqual(sorted(Counter(s).elements()), ?s))C8_et(s)= Gdict~;), P.item�‚ eDsx µðdef test_invariant_for_the_in_operator(!):2-Dc = öa=10, b=-2, c=0Š@for 0V in c<@OjUTrue('> '!In%K, c)¹ƒmultiset­Lions¯p# Verifùòat adding a zero cݱ will stripÿs and negativesú% +ÈëUÃcÌ>)Óó a† = 'abcdžOiL§range(1000’<#Êô random pairs of !Å-pÓ`>bp-2,4)) x–{žµLø.update(e=1, f=-1, g %qq8qqhqiqjq¹ÞÀop, numberopÈ[Кgÿ.__add__, lambda x, y: max(0, x+y)),= ?sub=-= /or</x,; /anµAmin(A º]”„result =vop(p, qÎ%\xJL' ý…â(p[x], q[x]), w [F (×1x, £¤7# vödðs exclude non-posißï u¿§1x>0úQ`.valueƒ—7Ä/efÆ Å ¶ÌÃð with no repeats are exactly likØtÉéO0, 2éÄLCÈ?setœ_aset.__ Õ€ÌÀr.__or__, seËt.__or__), ð(Counter.__and__, se/ 0-]:?c>£_result = �op(p, q)16set-ñsetop(set(p.elements())„((qIólf.assertEqual(z^ð, dict.fromkeyseA1)) ™ð def test_inplace_operation16lf)ñŸ‘ = 'abcd'AM÷for i in range(10008"#e õdom pairs of multisetsK-Cp = ”(à (({,>bp-2,4)) x{=)(úp.update(e=1, f=-1, g=0%qq8qqhqiqjq¹qÀ, regular_opË[£1iad¤!µ ¨ 50subÙ55 0,Š@i44 hEª = p.copy(›ɾc_id = id(c;Oop(c€y22+sei2CÀ¥A*d(D0), ç –�subtract(BTc²÷a=-5, b=0, c=5, d=10, e=15,g=4ë%c.Oa�0b=23&-34 20%‡30, h=-5<€ læP(a=-6�-O8N�—0f=-N‰T'50 Å-Î(͘ÎMP'aaab#s}6ce' “ 1aâÂd¿5e=-Ç'Xxc6=42 Õ²list(c.item†0[('%†', -42)];¼b�iterableq:u‹°öRaises(TypeErrorŽ)„À, 42) ð& self.assertRaises(TypeError, Counter().subtract, {}3) A?!) 8ðdef test_unary(C!):U5c =zÿa=-5, b=0, c=5, d=10, e=15,g=40‡ñEqual(dict(+c), > ?@ -@La=5)¾ÿrepr_nonsortableÉ 2ÈFNoneu@r = E&(c ‘ïIn("'a': 2", r#@b': Y&Hbühelper_function£ñ # two paths, one for real6Us andáother mappingsg¯ðelems = list('abracad'0%1d =R(Æ _c^_?€ents(d, s" Ô1, {P5, 'r0, 'þÐ2, 'c': 1, 'd}|Àm = OrderedDa ƒmƒ%m,ùØ Yñ[('a', 5), ('b', 2 r Qc', 1d ]SK#õ fidelity to the pure python version‚*üSubclassWithSetItem�eWÖTrue(c.called"y8 w—62 }L¤-Ge-œ~ H? #<QA RunÈsa:% ÕÐmain(verbose=ú>ÐNamedTupleDoc”0dochñ .DocTestSuite(module=colles*_Ee<[2R&, ^ , ûOneTrickPonyABCsÏ! *Co(`K�ChainMapC¯UserObjecth]ðsupport.run_unitØ (*Þž()(,obð) if __name__ == "__„2__"·]–º1) #çsVðxml.dom.minicompat imªT copy dpickleÀ+Fc from S RA* Ëð EmptyNodeListTestCase(unittesðt.TestCase): """ñs for the EmptyNodeList class.""" . def test_e&ónodelist_item(selfUY # X Ú access on ana.W0M_N* =#"()|%då.assertIsNone(7.jE(0))R-á-1)) # invalid«kWwith C÷Raises(IndexError웉5[0]ƒE'2-1]Œsllengthu…E¥•# Reading¦æWEqualUg6, 0Wh# Writ@æÿxml.dom.NoModificationAllowedErA.uo = 111 __add__4 + Ü(Ó,/ˆ‘?__r�}[1,2] +à—ˆ <A) “—eÏP(unit›áÜE‰× sØ‘ÒÀ# First, useù4(pú�õKUr»æ^ŒS# Now.' ¢ÜsZ2¶.append(111Î 3999¼geC,yP1uH > ]?[0]j ,V-1], É…í­5  \f[1, 2]á"2@h Àde_list = Noó deList([3, 4]) + [1, 2] øself.assertEqual(node_list, No>!, :1)) =�def test_10 ___radd__(T!):&f!R# =~+ +\%]).=‘‹", Õ‘üpickle_roundtrip™q# Test '¥ing and unEof a¨.öÐñfor proto in range(4÷e.HIGHEST_PROTOCOL + 1 =w# EmptyX+~'k2d =¸xe.dumps·œ 5Öe7Sloads¹d.ƒeIsNot(?%, ¢3G3æÊ# Non-eš.append(1v� 2 ,¯fNcopyÉU"% =s(%AcopiV.I& 7 , , ¼Þ'[1(2v0 = ÔÙVÖ"@x, y!Bzip(Ž0050Is(:Ô@deepÔD__¸ÝY× *|K.c#ð if __name__ == '__maiþ`n__': unittest.main() from __future__ import annotations USING_STRINGS = True # dataclass_module_1.py and A_strø"re identical # except only the latter uses string‹3.  b$esòtyping T_CV2 = á.ClassVar[int]36I6YW.Init: IV:!8 @  2 CV{™4|—Ocv0:²Q = 20º=cv1#D = 302: b2-33rnot_cv4À4 # When usahô, this field is not recognized as a X.þ Iþ IVþ$esa£i¸$i"?"IV!iv&IVi†0#n .€egetpas�o sl$iod¡BytesIO, Sé ÒTextIOWrapper0>6BmockÇ0sup¸R tryn)ƒtermios iIßRError' } = None??pwd;4pwd7 @—ó.patch('os.environ')GÄGetuserTest(Ù.qCase): Ë@def Ü_+¦name_takes´³_env(self, l)Ñ*�expected_>� = 'some 'b$¢ù.get.return_value = ?1mÙ.assertEqual('#, Q¹?())ÏÐpriorities_ofÉzsЬ¶Ðý  ”Π # in case‹0re'ù æà<Zë   + ù.call_args_list,([D"�(x) for x‘ð('LOGNAME', 'USERL /)]pÿfalls_back_to_pwdi9+ � if<•)Qwith ç+€getuid')Wiuid, \760pwdN%pw9éwlÀ uid.retuûrn_value = 42 §getpw.retu(ý[expected_name]5ùself.assertEqual(0,0 t víass.getuser())4#weö_called_once_with(422Yelse:@ üRaises(ImportError,~ð) class GetpassRawinputTest(unittest.qCase): m@def ð_flushes_stream_after_prompt(Š)�ñ# see issue 1703I<ö = mock.Mock(spec=StringIOîš4 = !('~Fing')AdQ_raw_$c('some›2', u!, =?.݇) !usíderr_as_defauljÃE9 = ¹5 1Ðpatch('sys.st~b') as jg4Ho.write F@È —#inž:/'in.¬:,ÞF\œ.readline 2ýèi‹hö‘ø)ñifferent_locale5û®ö = TextIOWrapper(BytesIO(), encoding="ascii"ÒÏ ùß"HasÅ‚o: "6 í=0,�=x Gw#rÀ’_on_empty÷"Qj½­ ;EOF $  �ðtrims_trailing_new|Ž'\þ ”A'#'›‘(Ýž«ñ# Some of these„ð-s are a bit white-box. The functional requirement is that #G ÷Bword ñ be taken directly from*�tty, and>p it not0±echoed # on(ñscreen, unless we£0fal;ƒ back to¢œ/stdin. Ü�might runV platforms ùðout termios, but play�ðsafe. @unittest.ó skipUnless(termios, 'tests require system with $ð') class UnixGetpassTest(unit>.ðCase): def ñ _uses_tty_directly(self):&*hð mock.patch('os.open') as 5, \.21’io.FileIO3ofileio5ÒTextIOWrapper<ftextio�kÁ# By setting�',ùturn value to None the implementation will¼ # ‚ñ code we don't care about in this< . We can î;outPþfully if an alternatˆùorks differently.Ff0.reÔ_Ô=Ó %gøc.unix_ )()#Hðassert_called_once_äÉ('/dev/tty',5dÁos.O_RDWR | jNOCTTYwò.y–Þj, 'w+'DúDcF)êsresets_3çJÝ2 ¶”.tcgetatt@s@ S ’I = 3Pfake_ˆ®s = [255, ]3» ÊVlist(Q øÉÖ #tcÅ Ö!3,žh.ANY, eœàfalls_back_to_ $if0_raises7JQÉÏ ?io.< K3jŽy@ ÅXG„I N{BytesIOú$Ôside_effect =Aa.errorë£y ¹ xS¯Password: UÀ  ðtextio.return_value) ñdef test_flushes_stream_after_input(self):/3Å# issue 7208ðwith mock.patch('os.open') as 5, \.G1¿io.FileIO')+ßTextIOWrapper2ÿtermios.tcgetatt3s3½Õ SI = 3ãßQ" =ùMock(spec=StringIO)3Ógetpass.unix_ (”=O 5.Èð.assert_called_�(ñüalls_back_to_stdinê8·Õ s_­ Asys.^:', ù XXù.side_effect = IOError-={.fileno/žAttribute6Öðsupport.capturedAerr(¯jstderr–ò:3elf`cWarns(¦€.GetPass7ing1;- à ÎÖƒreadlinekËDonceÐT¤+CIn('…sÌA.get÷+()mÎ8Á_word::ò if __name__ == "__main__".@unitO.P() imf =libT.util&os Hh�sys from«N Ã.!Äcript_helperK¢‘warnings Ý .cÆ_(Îó.simplefilter('ignore', Deprecation‚n˜wp_imp ó requires_load_dynamic(methvó"""Decorator to skip a �f not runÆñ under CPython or lacking7Iimp.dQ)."""n$ =S1.cpAR_onlyŠ&@ C.‰0If(�0hasWx(imp, 'f1'),=¦'– 3d')}õ class LockTests(„bCase):ÑÒ"""Very basic$ ofzÐort lock func¢sþœ‡pverify_#a_state£, expected�ÃmPEqualö.9fheld()5û 4 "]¡Bç†be %r" %‚¬c £™ðLOOPS = 50  ð6# The import lock may already be held, e.g. if the test suite is run Is# via "N(P.auto 0". "f_W°_at_start =‚.%()-Áself.verify_ astate( D%) 4õfor i in range(LOOPS):„±imp.acquireWrvOTruehereleashˆ{‘original Ùp shouldyÆrestored now=š Rif noÞ x :try ) Áþexcept RuntimeErrorDEpassö:Nelse'Ûjfail("rr withouÂ"yraise "X\"˜±") class Iî Tests(unit .CCase) def setUp(—\2mod¯rortlib.í‘_module('Lsencoded+s'Ï$ø_strings = mod.ÓzCpath* __ "__ï§<‡ z ¼‘modname, +Aing,Ñ0str2s  §ý %.'Ð? 'G@_' +©<; ÀassertEqual(ý@str,/, 4fin‰_ó_—¹d(Ã!, ³§¹ª)[0] as fdZÝ4fd.³œá1 p = [os. @.dir3µ(__file__)]|¬‹>R?�s(Syntax¸ä\ù ØAbads.°_pep3120', v�qŸissue1267f4@fp, ÏÚr, info �.Ÿ :,ùÌ© B?/fp´ #No”²JNone»…c�¿/fpâ,8Ÿtell(), 0gÑàline(), '# tesÿt %s encoding\n'  %/%) .õ!fp, filename, info = imp.find_module("tokenize")9…with fp:ðself.assertNotEqual(bFNone; *'.·, "utf-8n3Ÿtell(), 0^¹readline(),´[ R'"""Tñóation help for Python programs.\n'Kðdef test_issue3594( )@tempP_jB = '/0mp__&erÁ°sys.path.inIv(0, '.'á6tryWº‹Zopen(eñ+ '.py', 'w') asé ;?ÿ¢.write("# Q´: cp1252\nu¬.±;'\nšBG žÐ„jclose(FR(7ile*'¨kfinall#Ddel X9[0]ïsupport.unlinkD •2c=560ñ# Test cannot cover‚ðload_compiled funcŽ.¼ô# Martin von Loewis note what shared library^çhave non-asciiKõ character because init_xxxzD4be –AAand ý0 neÂqhappens8‚dynamic OsðBut sourcesñ ified to follow generic wayJ°processing #&s.ÊÅ# the returnêð could be uppercase or �¼4fs_z! =&0getÓdsystem(ë¯'Qvers ¨ üÀWindows ANSIEue pagesfB# on{ðspace symbol from 1y0/ð (http://en.wikipedia.org/`/Code_bšõknown_locales = {M³'«ú' : b'\xc3\xa4' L0$/8C 1 /c0 2 3 1@4 `5 e 6 7 À8 }m!if)úplatform == 'darwin'aÀn#, •Īرc OS X uses×ðNormal Form D deco·mposition ÷0# http://developer.apple.com/mac/library/qa/qa2001/qa1173.html Jõ special_char = b'a\xcc\x88'sUelse:> 6õknown_locales.get(fs_encoding) ;iif nott Xô)elf.skipTest("can't run this test with %s as filesystem m"l§ )% –tdecodedÛ. Î8ðtemp_mod_name = 'Ÿò_imp_helper_' + A]›)package> FPinit_CÝos.path.join(dQ, '__4f_.py')Ž*ry…ñ# if the curdir is¶Rin sycb± fails when§�Y)ð# ./python ./Lib/6P/regr 1.pyÕ6 7iâ.insert(0, os.�ºar@ opeò�0+ 'çd, 'w')- è?@÷.write('a = 1\n",kèð, info = imp.findIule(£isð asä IsNotNone(+ Bˆ+2Tru&’ [:-3].ends  ˆG `Equal(ÐB[0],0111r+ §`12],2—PY_SOURCE63modX?loaXˆüŽ´‹mod.a, 1w2ô warnings.catch_.()¯ÿ.simplefilter('ignore  Ó[sourc+), : ¸ ÔüUÐdÀ�ys.dont_9A_bytC0×™compiled(ð) ,'�¿cache_from_\MN#îWnexistsY(�os.mkdir- Ѐ½™ùð_name, 'w') as {file: ù.write('b = 2\n')&ôwith warnings.catch_.()Rû.simplefilter('ignore\�ópackage = imp.load_T(test }_name,  ­óself.assertEqual(KV.b, 2+zfinally½ùdel sys.path[0]ðfor ext in ('.py', /c'ñsupport.unlink(temp_modÁ +G‰ 4Pinit_›51nrmtree* c .ñ'__pycache__') ê2def] issue9319(MàB = o"@.dir“"(_©_r8…ñRaises(SyntaxError,nô@find/¡ule, "bads<À_pep3120", [‰]·9¼from_source¾ð# Verify that theoð module can correctly KP and ŒP .py ‹s¹ô# XXX (ncoghlan): It would be nice to use xpCleanImF€here, bu�àat breaks beca<dthe os¢èregisters someE@andliÃ�py_reg onÞ…w Since �‡ doesn'tDSrever†iqration,(m$ais lef‡a brokenCÁstate after O€sion. ReˈialisingOxcontentVsBjustAt1 os.environSÒits previous r‡is an OK‹¥workaroundPorig_7À bgetenv  ÉE�ÌmentVarGuardxÊ=ÉV("os" ù$!dd™Úup(x[0].close(cnew_osS™SJ, *x/WrIs(os, A& -2ANot(R*7™¡@requires_¶qdynamicV kR15828%Pexten9s¾I— -¦ picked upÍ@adap|qbetweenj0oldA APIxx#Ùi‹Plib c·Qn't hH C …50exa˵ = "_heapq"î/B?@_ = å:!ifWË_ is not Non Í$G %?modƒÀ, *x) ñ6 self.assertEqual(mod.__name__, example) @requires_load_dynamicð!def test_issue16421_multiple_modules_in_one_dll(x!):;Z0# I8 9 : _Ãing several Aõ from the same compiled file failsQ`m = '_’dimportŒ'"5�obj, pathðó , description = imp.find¿<(m)<v.close(Cmod0:Ã"&(mf -1-·__foo'E2E?barE� 0ú+1+½øC2C »CHwith»�Raises(IëWError\`Ì ’É'nonexistentäéO_z_Pàð#1559549 added `xp` and `7÷` attributes to W˜Ë # in order"óprovide better detail.N`#10854Éçlemented thoseLp on*1ortKõures of extensions on Windows.B¶kRbogus‰gâ!HÆv as err) Íd#f0In(”,JQ.exceâ.0 U7err3 #mý__yŽ_is_None(EWhen&an€-G@ is G˜, open onÛ!on+`behalfË 8)È�e#15902ßñ¾J Cound…1=a@if f)0[0]·1not» Û" Z>r2][2] !ŸºC_EXTENSIONHþ¡skipTest("WAÑdoesn't appeaEfbe a Ck"¶7mp.Ç(Ô,¹1, *WO[1:] R24748E¬Ss_sysn|s_check �Ù¦.imp_dummyS:try ‚del sys.gðs[name] ÷except KeyError: Epass:tryòmodule = importlib. !_me(name)@XIspec1 util.find_ú('_testmultiphase'?XAÑ.load_dynamick , Dz.origin9òself.assertEqual(J0.__¤@__, 4g0__.39"¢¯ñRaises(Attribute¦², getattr, É�, 'dummyÏ 5üÿint_const, 1969ýrIs(sys.i s[ö]x5kfinall" 3Mdel Q &” C˜3P@unit4q.skipIf«ñdont_write_bytecode,.<".ð meaningful only when 3Ding 5"ß@def 5�_bug7732(R) €with sup§.temp_cwd(!wPsourc-)åTESTFN + '.py'Ÿ,’os.mkdir(5†}ËqRegex(I„C'^No'ú>2impsÓ,¼“‘, ["."]) ”ý•üle_calls_to_get_dataô # Issue #18755: make sure D D0 toÈDá) can succeed.{¬å#eròa_LoadSIðCompatibility('imp',ˆž.__file__÷OPopen(A)w….ð 'û # File should be closedÄ?�Will needðcreate a newly ˜0ed Õ ‘–_"‚CF�Soraryx since =Ò)Fifieð#¦ t‡�s like __IUer___ï0modR” = f"tmp{d(}"#q = type°ˆ$s[* ]) E„ e˜swap_item?”5 ?;DValuXû'embedded null'F?ýõ{ï$, 9s + "\0"@@ð€cpython_o Zi.^31315ÈDTher[0n't^2an Ê€ion failZ!inþ=)#ã»Ð.name is not ³a string. úcreate_dynamic = support.get_attribute(imp, '-&')FÕlass BadSpec:d¹name = Noneåorigin = 'foo'úwith self.assertRaises(TypeError)^ ’(‚A()) Rðdef test_source_hash(^Gm¸Equal(_imp.1 42, b'hi')÷\xc6\xe7Z\r\x03:}\xab P3HPü85\x9765\xf8\x9a\x8b9'Ãüpyc_invalidation_mode_from_cmdlineÚ‘cases = [ �û([], "default"),�"--check-,Ç-based-pycs"5A&palways"@ €Qnever> =]Çñfor interp_args, expected in  C%( =3+ +37J"-c", im. 4r; print@Dp_D_D)BµLr­Óscript_helper˜À_python_ok(*¯y8 q€res.out.ìðp().decode('utf-8ÅQ) c»ðReloadTests(unit5.bCase):NÑ"""Very basicXðs to make sure that >rOò() operates just lik B."""\ ª Ëð# XXX (ncoghlan): It would be niceŠ1use—.ÅaCleanI£ ²# here, but±±breaks becaAò he os module registers som½tp# handlV opy_reg onÿ?w Since �‡ doesn't‰rІirÛT, the‚pis left¾‡a brokenCÁstate after Oøsion. ReinitialisingO‡contentsD2and At1 os.environXÒits previous r‡is an OKG¥workaroundÎREQ×mentVarGuard(ˆWNož.2,osPextenõ 3 |ˆ('time'z¾ | ~builtin|marshal‚ …ê÷_deleted_parent‘À # see #s18681 õfrom html import parser ð= sys.modules.pop('%')'ådef cleanup():e;[71] =s'“self.addCBJ_Rwith &ñssertRaisesRegex(I¸rError, a ‚²imp.reload(Þð) class PEP3147Tests(unittest.CCaseH0"""@s of1 2Q.""" ÁPtag =>¢.get_tag()@P°skipUnless(ðimplementation.cache9Ñ is not None,\@ ‘'requires–MJ!beM©¥à_rû€_source(\îpú# Given the path to a .py file, retur!itN¼�# defined<c=ò (i.e. under __py�5_).6rP= os. ò.join('foo', 'barzcqux.pyß¹expect =}'oW 'já{}.pyc'.format4V.tag)¨G!.a£`Equal({án×’, True), ³4s!to�Ebe 'Ž' tSH_æñS1PEP2(e” # ot€. This Ús²Agood·S!à“f ÐQølQKÞBNull!erÂã ¬`If(supð.TESTFN_UNENCODABLE¦3�"Need anâ�codeableúRname",7Dunen% 20? = Š�os.mkdir(3b±;try‹hŸB =­3*, PkfinallTVos.rm|p if __9ò__ == "__main__"Œ+ JBThe `A forÌ�ing vari@Banno/ñ s. Empty lines above are8ú€reason (Eðfor correct linð&e numbers) """ from typing import Optional __annotaõs__[1] = 2 class C: x = 5; y::@['C'+ONonecÅTuple x: int>Ástr = x; f: !P[int,#]ssM(type)y ŸA'123x1123š o:Ûôe = object (pars): bool = True\QD(C):72j: Œq'hi'; kv= 'bye'Ï$es1Anew_" h5 = ß('H', (C,)) j4J')ƒ#F(‚z‘ódef __init__(self, x*�DpassC3Y(F 52�super(F, M%).\5123�DMetao4PØò_(meta, name, bases @spacž/rreturn ng>ÉSeW0 = �Àx�á = 'something'&y@ els´¼Efoo(r#10Nóbar(y: List[str]Âm2yesg.#) ,ƒunittestH4est0supN/„_urllib G$os $io dsocketTarray %sy0…tempfilepubproce¤lP.requªà# The proxy by< G#odºóed below has logic specific to the OSX #C°config data6àucture but is ìòable on all platforms.›�2 (R«ñ, OpenerDirector, HTTPBasicAuthHandler,ý­2ðPasswordMgrWithPriorA0, _!e_ H $_1°_macosx_sysÿ: àAbstractDigestx¹)Š1urlÖ(Terrorðhttp.client # XX”:³ # CacheFTPm` (hardÁ`write)Àñarse_keqv_list, s_X= · ¢ÔTrivialTests( .0Cas™ac___allÀbá# Verify whichTÑs are exposedEÚófor module in 'Ï ', `sponse Ä , Qrobot"r'àN`contex�%{}gaexec('z%íC*' %ˆ#, B)>4delù['__builtins__'](#ifH0 ==ÅŸ�' and os.]+nt·¢du, p =gà.pop('url2path:%')�à.pop('pathname‹2url') ÿself.assertEqual(u.__module__, 'nturl2path=p=ÿ for k, v in context.items():£vfÒurllib.%s' % »,E÷à"%r is exposed|'<’but defin_%r" %G4(k,g ‹1)) 0ðdef test_trivial(dس# A couple "/s>©1•óRaises(ValueError, ´ðrequest.urlopen, 'bogus'ŠLð# XXX Name hacking to get this ñwork on Windows.Å; fn6P= os.@.abs(�@__fi.ø).replace(os.sep, '/Š ifJT=Z'ìFpurl = " ¡:///%s" % ‰—Oelse:9:0f =. >(qG_url:vf.read(4ƒf.close($èüparse_http_listð Us = [ˆ]à('a,b,c', ['a'¾Jc'])½ ('tñ"o,l"og"i"cal, example= H!NÐa, b, "c", "dºe,f", g, h'z ™0"c"X""d5ghµaa="b\\gbd="e\\fŸ="h\\\\i"l3="bf2!,fjg2ei"'])]@?€string, rËf GÜ*ü ¸S)T å1URL€¬_reasonstrè6err`e¬.5"('6D�`In(errnPson, [0errO‚ class RëàHdrsTests(unitñ.bCase):>”äÍ_headers_dic™5"""S4Theg.4 4`ionary7ánot a document%Återface. ItJðshould stay that way, because the co½¤te set of p…are onlyK€accessib*ahrough@C.getÙ‰(), .hasó_PM&in¯pHowever<-õs pre-dates those methods, and so real codeP¡will be usT'he0.ŽèðThe introduction¬02.4ø jð was a mistake ã,6samsE:ˆ\ópreviously saw all Ÿð2 user)-providedÓ headers in .õ now sees only a subset. *5""" ö url = "http://example.com#õself.assertEqual(Request(url,I†—ÿ={"Spam-eggs": "blah"}?)Ø[@#],A)A¦6s¦OEggS¦9§¢def test_rA_�_methods(Ä!):,H¨óNote the case normalization ofõ names here, toI`.capit1@e()-Bõ. This should be preserved for:ñbackwards-compatibility. (In�AHTTP•,–€Dtitl{ó is done by urllib2 before sendingÎsá‡.client)ËÓat e.g. r.hasW&("Ê)uõcurrently False, andé_r.get:ô returns None, but that c9xchanged‹gfuture§Má“ r.removeh~ð items both fromÍæ ©ðunredirected_hdrs dic UariesÒ>æhreq = Û‡ºz‰True(req‡÷)5U6ð_ u(), [('=@', '4F')])Ë63addQ ("Foo-Bar" ?az"pbsorted­ w)Ô0[('b1bar�oaz'), ¥ÃÖ@yt¨PNot-tµ"! Is|7¥7 X6È, "default") ^�a�\á5¼ ÐŒ7("Uå-ÉÓE<ÔyD) Ý1OÆ=ndøüpassword_managerñSmgr =.%.aðPasswordMgr()  ñadd = mgr.add_password Á find_user* 01ðadd("Some Realm", "http://example.com/0joes/")D ni??'c.…P:3128C3c€ d:04d5 e5o5:Ee") ðð# For the same r9$, A setñhighest path isuwinner.Kúself.assertEqual(¬ ›5"),Fþ”('joe', '•&')pt/ni~h{h/|TÙâ ¬Ospam¨s6�©/®,ð# You can have differenuYs forFths.Ìcãè0fooöñ8 0bar8!ni:;b� ö 0fooö niðq/Áq 2barq s #w, newer(ühould be consideredšbHšPfirst LblahÚ9 `second:~›W' r*r �ð# No special relationship between a.exampòle.com and exampC: ÷add("a", "http://'15a")1ÿself.assertEqual(find_user_passME/"),E}¶('1', 'a'))œk'a.ºm `None, ow# Ports� Some Realm'cƒï |‚o)_:3128t '3cccr ¢ Ú î0 õ†(yl dZ '4ædæ m emÒ?0('5rer?�def testð word_manager_default_port(î!):2H5""" ðThe point to note here is that we can't gues#e Z Z5 ifJt9ð 's no scheme. This appliesa…both add°/B ,Ï.´ðmgr = urllib.request.HTTPPass7FMgr(G¨add = mgr.zZ v* T0Çf…—gÅ 801jÍ7g7h71k4hi-:d2l0ij0 13m-^ ä Ý?100ù m#j8i 0'10 j ÔÒ ÎFå?WqFGoÀ/g.example.com"), Å('10', 'j'))&ñ"self.assertEqual(find_user_pass("g", "h.example.ceP ('11LkL,o:80"),O*ittp://¢Vä ¾#h i `None, WMµ 2ZlZOh  £V  o i j 0'13»m»L´msi$ ¼! Õ%lÜñ class MockOpener:ªñaddheaders = [] �def open(ÔÂ, req, data=/òtimeout=socket._GLOBAL_DEFAULT_TIMEOUT)a3G.F K!, K& =e#, ŒSerror�Ìproto, *argscZ 3 =  BFile¡íCread`Qcounté^Á�.Oline2Bclos/ U˜H‰S(dict(�3get£qCname ^±return list!©.values())òóResponse(io.StringIOFf�__init__CÓ, code, msg, }\, urlR.Hì $[¥` e_url =„6url‰Ainfo°ÈGU1g+l3 `”ƒCookieJa/*Qadd_c_aP'4uesºŒ…rach_reqã!�sextractNsH©R ecQB \4>ü¦FakeMethodð ¥ðmeth_name, actionÃ, handle): õself.meth_name = #9# =B ’action =  Ðdef __call__(gw, *args}preturn .a)�,W@ô class MockHTTPResponse(io.IOBasáƒEinitƒ÷fp, msg, status, reason•Žqfp = fpÉ*0msg!*sgJ# =S _# =h 0cods62003Aread“(&'''Oinfo'&{}'gbl)Õ=urlQC_$ C—@šlevel = 0Ûúreq_headers = []ºdata = NoneÆraise_on_end?KFals)OsockBw_tunnel} ‘àhost, timeout=Tü et._GLOBAL_DEFAULT_TIMEOUTù<:ostÄO$ =YÈ8£‘set_debugJ«!, r" = Aõ=šp, port=b#, J U0?ostÏ!P! =WÑ$if\.+â.9~]?Oelse9†.clear()òsrequestï²Ñod, url, bodyè öE, *,w¢ en�‘_chunked=f ]÷UethodDâ selector =}q is notéé%$+=K….items()Pl,W.sort !if÷ah N û: = -"if‚˜ o!y OSErro¬Dgetr Éa Ç÷File(), {}, 200, "OK"QcloseQJpassÍïr«ó# useful for testingϱr machineryûò# see add_ordered_mock_¤Òrs() docstrin .H = 5Ò)__‚R“._define_(ó "7,°(odOßðspec in methods:  òif len(spec) == 2: ðname, action = + $Oelse6i, None<ømeth = FakeMethod(né, self.handle)9�setattr(!²__class__, ?W!) 1Bdef A,R, fn_%Òö, *args, **kwds)Ê[ýparent.calls.append(I@>¥$if3!isøY[areturn§&el5C== "$ˆ">> �responseB“s = MockR!ö(200, "OK", {}, ""ÍžŽ?ress]questrò!Reç("http://blah/k÷.startswith("error"Ÿ”ccode =i[Ñõ.rfind(" ")+1:]­0:tryIE@int( öÐexcept ValueEƒ@6pasQ/re\$Ð.rð&0", £ [0], res, §¡©¯:ÊN"rai÷� urllib.cA.URLÙ ("‹ŠÆassert FalseLQcloseŒjoBadd_Æ(", 0é# =??xV = []‚c__lt__[WotherZ¡if not has2, "mr_ordeFC# No$"ñ, leave in original ;…. Yuck.­±6TruÝÌ }1 < •Öq4 :hƒed_mock_; s(opener, Ú_ƒô‘"""CreateÌH*ñrs and add them to an OB’Director.PO‘: list ofs RtupleKñstrings defining‡0ods[ù$onGrs. eg:e![[í_p€", "ftp_ÑC"], æEinesf.,?!()Ü.C”() on onez, Ÿ6Y%"anyu These^¡just recor0 irnQumentýLÏÀP. Us!a "€ instead3"a *p causesg1 toIÃperform some¸I (se¿O()),E9I,.r`;")]Mð.http_error() oóña Request object. F1"""6as = []‘count = 0Áfor meths in a_spec:޲class MockHÅ1Sub()04Bpass†?h =@v)i#h.«¡_order += ª!°add_parent(&er>+ 3F + 17·¦s.append(h5E.W|]¸ñs def build_testŸCer(*8£_instances [ò = OpenerDirector(}uhq ?IB�!1 �c3TTP§’(urllib.rS.Base£�# useful ŽÕqing red«@ions’Q authLò# sends supplied header&ùcode as first response8`200 OK%jsecond&_ð__init__(self, T,f´P.ïdf–=:…rreset()žuT c_T)CoR_I¶MW, reqRÀimport emailÛ!py9 U¦�copy.deep (L:10if c.¡6= 07!  ,*pname = ¼„.client.½!s[Gi80Rmsg =Êñ.message_from_string¾.‡µ:VXÈu.error( &"’"E,ÚrFile(),Í” , ¼V, msgeOelse Preq =‘ hÈ P"\r\n"aœÆÿRé¡(200, "OK"‘2, "¼ý.get_full_url())­S“ ®–AbstractHÑM># U¶ðthe Proxy-Authorizationó�by verifyã"th3ñ# properties of6con �Ãdebuglevel=0� hº.ITdDconn<@TTPCŠ»$sŠt.™¨O&do(`\1 ”“PCheckO œJÀsting auth ñ # sends supplied code response #ðchecks if auth header is specif7¡in request4ñdef __init__(self,Y!):V.m= @has_l_l�= False &]QresetZ T;‘http_open?,¸D if.F|÷('Authorization',È. ¯2Tru>$pname = y„.client.b%s[ ]Ý0Ãreturn MockRЬ0 , O,¡File(), ""Çñ .get_full_url()) class-òPasswordManager‹LSadd_phMôalm, uri, user, !ÿº�realm = ÂPurl =D 0ser:serc% =nñPfind_‹«%),€ßd 8fŠ#,)Ò„def test÷ (;² ˺[?s€[2[([97×'ãZ 500)/Ñ(‚j], 0)]k£class Mock1Sub(ífFpass÷?h =Hè |#h.ö=† à*ªs.append(hK o.¤%=Z´„#{æƒr1se ûmpanks tovrir sortm ZÙ1[0]:¡7s[1f515,0]‘\raise‰ # g@URLE[à stops processTž¼À ¾Ü ¦“ YÌ , / ƒMÐself.assertRaðises(urllib.error.URLE ó, o.open, req) ð self.assertEqual(o.calls, [(handlers[0], "http_Bñ", (req,), {})]) M‘def test_(|(]!):of# XXX ‡_default! =õs are a special case)öo = OpenerDirector(ÓPmeth_7E = [3�)[(Æ"i� 302")],*"ù_400", "raise") 8 Z8Èeturn responB^J303"~m"b ¼]ÊÁô = add_ordered_mock_E(o, 2Ì,Öclass UnknownÄëa__eq__âw, otheré%rùBTrue%²q = Request‘ö://example.com/"Ì´o®D len­e) == 2÷ÁýÂ)x 52÷Š_Ïf,Ÿ,+0(),RA, "" )�ñ for expected, got in zip(±¡ I©¦õod_name, args =O –w ÔÓ D)ƒF[:2][Ð >k,+jí¡processors »R# *_rå! / þm€ods get ðñed appropriatelya‰å,}¹ˆ ö…_ ³†S3Ù"e0:òÉ/rep,%# 潜½•on *all* ¥öthat define theme # not justd first8 7Es]q Õݧ:¬1Ï\q+ñ6), K×6")]ãéi0&, ´p, kwds)ú•enumerateÇ gŠif i < 2©\ð û self.assertEqual((handler, name), calls[i])  <Ïlen(args), 1/ ¡IsInstance0Ê[0], Request8]else:yÍ# *_response –Ò42š kÒ8$# ¾Ð from opener.ý is None, because there's noë## ­ñ that defines http_M#to"= it>0if ­0[1]u1notyn²ê“1], MockR‘ð) def sanepathGP2url( )_2try \ò.encode("utf-8"k except UniE"VError<ð raise unittest.SkipTest("U×\´able to utf`1url'¢= urllib.rƒ. ·=`if os.À == "nt" and=1ó.startswith("///"ìã j-A[2:]Tð # XXX don't ask me about÷q mac...(dreturnl¢ class H­ô%s(qCase): =� P_ftp(Ë›HÁ—FTPWrappe`½>�__init__>g, dataD&[.! =#~HƒretrfileH P , 0typ³,V */! =:$ôB=±io.StringIO€«0), ·V»)µBclos²ôFpass3NsNullFTP�(^ O!i5uconnectò@, usÕ¯ýwd, host, port, dirs,5Aûtimeout=socket._GLOBAL_DEFAULT_TIMEOUTÏAWz ) =Ž {+¢ §' =´2Èz?irs!Bftpwâ! =´ó <?‹Cõ!im¡eftplib>Mõ = "rheum rhaponicum""Kh = +5ý>ƒh.parent®O'(¢0for Ïoj , _ä,Àname, mimety—pe in [ ù("ftp://localhost/foo/bar/baz.html",1% "+ó", ftplib.FTP_PORT, ""I8P["foo†bar"], "aq "text/n)o uparrot@|§-P�­<2%25`°7%Q­±?"42b³8S±µ< 5:80 v ®#80�ŽD+ ¡", None’*¬gif;type=aW ‚0A8[$5gifŠù # XXX really this should guess image/gifµ)]:üreq = Request(url)¡.timeout = ú = h.ftp_open(req?#ù" authentication not yet implemented by FTPHandlercð self.assertEqual(h.user,  n+‚passwd, /öÀ, socket.getpbyname( )A`port, +`dirs, +ðftpwrapper.file�$, >› , _;úheaders = r.info(^0( ("Content-X€"), mime D Cint(x[Dñlength"]), len(data)) �def test_þ(“)Ð imyÁ email.utils4ãph = url¡rìS.FileqêoÒPparenò³MockOpener(‚NÀTESTFN = sups.n`urlpatt@sane ³€2url(os.@.abs(:Yø towrite = b"hello, world\n"`§ ¿"¿P%s" %öið, "÷file://%s" % urlpath, "#%ð (socket.gethostbyname('local4'),I)J]XEtry: l>addr = ` s%))Ceexcept:aierrorc%'';5if } 1Íurls.append(4í%) U0for0 insXöf = open(TESTFN, "wb"Ì ¡f.write(to K![inalls‡f.close(¿Ž h._±·Request(url}*µîdata = r.read(Ÿ$qheaders'Oinfo'qrespurl'ogeturl)fï rïw@stat�0os. Ÿ¯ðmodified = email.utils.formatdate(?Eú_mtime, usegmt=TrueOªŸos.remove†ðself.assertEqual(b/,  ,jû["Content-type"], "text/plain�DalengthF/13>TLast-O= & {·v[‹â¾µ¤2:80Íò /úúdoes_not_exist.txt"×^anot-a-d-e‘.com//dirH9!%s�…` Ýá os¢rcwd(), j �¸¡somerandom¶ÐontheinternetÄ"%sš v(`]÷ Ü<ûFt`RaisesõAlib.ZP.URLEc ’B/, C Š0h =a˜rœÇ.FileHandlerð o = h.parent = MockOpenerC() ô# XXXX why does // mean ftp (and /0not@!), WwhereGð is file: scheme specified? I thinks)Áreally a bugOIñwhat was intended ÷to distinguish between URLs like:CˆÁ/blah.txt (ašõ"¯/localhost-$øftp.example.com3T6URLˆ€for url,XU in [Äž#("¦ U@/fooÙ¯", False),89%pAsomeMh/ög«‰<]ò.öreq = Request(urlg:try0 h.bš_open(req2`except àlib.error.URLE K±self.assert”K(ftpP'ls¥8­Is(o.req, Œ *PEqual²Ê.type, "ftp"nX .2 ==0v!) ;àdef test_http(<"):z4h =r`÷.AbstractHTTPHandlerUño = h.parent = MockOpen$pVpurl = "r8://5"$!Ámethod, data%ð("GET", None), ("POS b"ò/") Kú, {"Foo": "bar"}? req.timeouÁj”¼ûadd_unredirected_header("Spam", "eggs–í:WClass8[<"do–1 �ù# result attributes ‚r.read; ñline # wrapped‘RFile \ ;@info;0get¥` # add3°code, r.msga�200, "OK"v adÄAfromyù›.getreply�hdrs = r.s8 ; &Ð.__contains__k4Á gives dict y4lë·'*`url(),ô ™ / .ôðø ÷7Šlevel, 0z,v,±2ð selector, "/") sÿelf.assertEqual(http.req_headers,  ÿ [("Connection", "close")7 ` ("Foo0Ðbar"), ("Spam‰eggs")])xs§`data, %) /ñ# check OSError converted to URL.ï³aise_on_end÷u = True(�R. s(urllib.ee.XÐ, h.do_open, \Y, reqžCž�for TypeŽ� on POSTËå which is str.�ðreq = Request("\ö ://example.com/","badpost"=¸v¬rS_ªHóadding of standard $œGo.ad9[Í*÷°ñ in b"", None: #U, GET,wö6ò7÷ = MockResponse(200, "OK", {}, ""02newj¾(» !ifm�¹ ³,vQNotIn%Átent-length"mú.unredirected_hdrsÆJ OtypeH6elsd _ b>reqš[çÂ[], "0GO!Ç]/ €"applicaeû/x-www-form-urlencodedŠð# XXX the detailsÀù Host could be better tested¾ P"† ˆKýKþÎSð# don't clobber exist” ˆ-¾Jadd_\̆K"foo³A¶1, "¾ =? 27zv/, ­¹ˆreq,dif notL—Pòself.assertEqual(aR.get_6$('-6Ž'), NonepP :9'),|I'c'}Oelseã?intç•230)òPdef t<á _body_iterž(h) 0# GÖ4ic "„Ðere is no wayedÉ¿,#É_Fall ¤o Û (þÜÂyield b"one"?­+11­a �e‡a ] ñY5LU#QM ‡I? 11$žempty_seq%RZero-w) Yœõ be treated like any other/-Œˆ¨u ˆƒ 6())º O8reqx"ÓS"), ""IÀsertFalse(reð6q.has_header("Content-length")) def test_http_body_array(self): $!# .à Iterable - X! LXâ is calculatedc?ñh = urllib.request.AbstractHTTPHandler()”1ño = h.parent = MockOpen$%i‡³( =¤ã("I",[1,2,3,4]îZBfor ¥s in {}, {Æf": 16}ý7rreq = R½ ("/ú://example.com/", ‘,h×J2newMSh.do_Z_(req(òself.assertEqual(int(=D.getÚ'‚Úc')),16ð Þhf¼_debuglevelævgxDirecto“Ĉ±S²L&=1¿co.add_p((hBopen?‡s://www.D"* þ'h.¹?, 1ã¼doubleslashÜò# Checks the presence of any unnecessary D E"Åurl does not{p# break=úthing. Previously, aEdM�ly after�8hosMðcould cause incor~P pars\vƒGC¥data = b""eµds_urls = [¸ôÿfoo/bar/baz.html",3/4 3h4›œ ›]�õï sþ ds©& , @Š$i� whether ë³determined áPly if re!‰no proxy¨5np_} 12| 6?R.unre‰úed_hdrs["Host"], "ƒ €Î&aͳQ.set_êa("some Ê:3128", NoneÔ+>;@full_setterWðo ensure that components are se×Q0ings$# p›qv object´¢à'http://exampl÷e.com?foo=bar#baz', é'http://exampl.ÿ&spam=eggs#bash9"%] f÷0# testing a reusable request instance, but the url parameter isH5óired, so just use a dummy one toRUtiate;Rr = Rr(ñ%')*1for‚ in%s:3pr.full_¢= qparsed  V(url)Aôself.assertEqual(r.get_V0(),WŽ4$# @ setÐuses splittagó ù into components.ž#1AsetsjÐfragment as N>Awhil�Ào@s itb)''NÈM`or '',ÃDsed. Ô @1urlt u).queryPV1def[@@_del6(`)¼ÿGwww.ôFdel êøT¼ Is/(%Þ&h&Íselector, ''àüixpath_in_weirdurlsäÀ# Issue4493:E@lib2ºðsupply '/' when? 0re W• does notëö# start with'/'Ähß@lib.Œö est.AbstractHTTPHandler(éPh.parc¡= MockOpen kÐRš›àpython.org?get‰‚7reqÐBv2new$Sh.do_ªV_(req$©ƒ5Š.host, '„8À/³ÉÇ@url_PAout_v/= ðè A˺? = ïc ¯]error¡<4E-ˆProcesso;oÑ? ‹"Ä%/"c ÿ•‘±# all 2xx a sÂvthrough@ ½û Response(200, "OK", {}, ""¶�½—$_r7freq, r·J`Is(r, 8ñFalse(hasattr(o, "proto")) # o.qÂð called r =ó MockResponse(202, "Accepted", {}, "", url) ônewr = h.http_r=freq, r'ðself.assertIs(r, 8õ!False(hasattr(o, "proto")) # o.error not calledЇ Áÿ6, "Partial contentÈ�ñ# anything elseçsùA(and¨ö Opener returns None, hereV 5Ó¿Bad gateway ¯[(ám3�Equal(o.¹0, ""¿ »<rargs, (H/, º1)) ÿðdef test_cookies(Q!):¨Acj =5C FJar(¹0h =Óòlib.request.HTTP+ÇProcessor(cj3s.parentV‹(�qrreq = RO(ö://example.com/"N §…200, "OKž,7\�²(%þmrcj.ach_J/eq'f*Ü req.originX‡_host, "àߎÜ=·unverifiabl±xMPcj.ec‡?, rß &•7SŒredirectT¢from_url =á àqa.html"L/to-b-“R‹hHandleÄo6• ´# ordinary Õ¥ behaviour©ðfor code in 301, 350303 7TÕ,@data,&’, "blah\n".2Ámethod = getáh _Øa_%s" %€~8 U€ , ‚.p.timeou§õsocket._GLOBAL_DEFAULT_TIMEOUTýg£Ðadd_header("N÷nse", "viking=withholdê:!if”1 is¨ ) gC¤ñ-Length", str(len(ã)å¨$unÒeµ@Spam±s<ðtry:  òmethod(req, MockFile(), code, "Blah", ,5ýHeaders({"location": to_url}))>ð except urllib.error.HTTPE :/wÿ# 307 in response to POST requires user OK?òself.assertEqual(ß>307žo0îIsNotNone(data/+[ào.req.get_fullP??tryòX´Ž), "GET"UaŸAttributeYgbFalse(¿ì Lò# now it's a GET, there should not be hÿ regarding contentPð(possibly dragged from before be>aêçhð= [x.lower() for x*É$]{ùsNotIn("¥”-length",Èy<Htype:w /§0["NÝ_nse"]v ¥ÿ "viking=withhold «ySpam", ã 8õunredirected_hdrs) ëÀ# loop detec àreq = Request(è|8ötimeout = socket._GLOBAL_DEFAULT_TIMEOUToDdef �0(h,,\=s _qh.http_uN_302ú?302ù 0û ø°# Note that0° *original*­ @ shaÄõthe same record of=#åPions óM@sub-áests caused by1.1#›’ infinite°.� of a URLc itA…Â", Ñ÷_req_host="example.com•@counÛ0Q.óõ- 4zwhile 1ê.Ô"þ7:// /¡4©5+ 1±[¼ñ# don't stop until max_repeats, be¯õ cookies may introduce statew•Š Å1untìHJR�ƒHandler.xÀeats) ó' # detect endless non-repeating chain of redirects õ'req = Request(from_url, origin_req_host="example.com")?•count = 0 req.timeouõsocket._GLOBAL_DEFAULT_TIMEOUT5Etry: šzwhile 1Â÷(h, req, "http:// q/%d" % œ«>" =E + 1yð except urllib.error.HTTPE ‹ñself.assertEqual(V,Ki Yrm[R‘ Ha¹dr.max_ãaions) Sõdef test_invalid$(‰)œÁ/ =qa.html"TŸMÀschemes = ['N!',•s','ftp']/~1øfile','imap','lda1)’V•§bŽ4h =}$(Ó¡o = h.pare…§MockOpener$áD° Bfor ÝK in �dTurl =5“+ '://' +#a:ÜesRaises(B ›@, h.¸_O_302‰0%€File(), *ÿ "Security Loophole"?:õHeaders({"location":ÿSurl})²À % l #! ÷(â¯That's finÜØ—ÖÑ™þ o.G€get_fullì_@Æ�relativeÇ5PC/"/Z¨5 Öparse.urljoin¤öÐ/ -_cooki "# !ð s shouldn't leak into rediróected requests ñ from http.cookiejar import C:Jar-Ptest._7_7õinteract_netscape @Fcj =W%() 4`(cj, "aö://www.example.com/", "spam=eggs"Fñhh = MockHTTPHandler(302, "Location:ìTqcrackerT@\r\nO deQsurllib.:.\ÄDefaultErrorh‡r7ŽRedirect3_cp = iƒÆProcessor(cjg¡o = build_�àopener(hh, hdegrh, cp1.$(V*ðself.assertFalse(hhÒ.has_header("›2"))ßAdef ˆrå _fragment(N%):ì!¯ed_url = 'çÐindex.html#OKœ'Hî'îJ' + qæ'wà>¬˜f o­'.^¬ûEqual(fp.geturl(),ü.strip(´|no_path³õ# Issue 14132: Relative^ X°s original E©Áreal_class =q.clientK`Connec›0psponse1á"pà/1.1 302 Foundâ`?query"FUi" =ªp@fake-3(rex ]øddCleanup(setattr,Ç!, ¤É"wóL0url€iter(("/#É Å&").4def­à(conn, method,'Ç, *pos, **kwZÓ  url, next(�b.›àm _>p# Chang:� for subsf0nt ¹ Ý8"._0__.�JdataïF200 ÷oHello!ÞÉ$ =@´YöÏ9url¡python.org™ Z iV @Ù%Žencodingr€Some chaK�ers in thkDð target may need special høðing, # but ó-most ASCII characters should be treated as already encoded óclass Handler(urllib.request.HTTP%):3:ûdef http_open(self, req&*�result = %6.do2².connection= b<3„last_bufC6M.buf4ð# Set up a normal response for the next®ä @tdƒ = test_@fakeø(8° b'2ÿ/1.1 200 OK\r\n'+ÿContent-Length: 3-  >123d)v`return5ulthú% =:ÜSer = ýQbuildÈ3er(A6/Js = #ð(b'/p\xC3\xA5-dansk/', F%C3%%),œS8Óspaced%20path6 6 4?£¢(?p£'lö\T[locaÏöA] in?s>BwithÔsubTest(repr(?)Gg4š%Ï302 RedirectW LÍd: ' + œ_ + b'7 )Õ–"= h. ('^þ://example.com/'>PexpecÛq= b'GET¤rk¢ ¾4 = LZ qœ³assertTrue(;p.starts¾(�)»$pr#1)) N  a_proxy!Õ±o = OpenerD‡6or(ã.phrPFŠ`(dict('!="^.,v:3128")Nco.add_ò6(phÑmeth_spec = [µû0[("_âF", ":H9")]/gþvÄordered_mockƒUs(o, {.urreq = Rz�x://acmeà&/"Á¦PEqual„Œ.host, "87oi®ÇK dé» >[gs[0], N*)]ß?’[tup[0:2]ª up?ƒo.calls]+Ðdef test_proxóy_no_proxy(self): Äos.environ['$ö'] = 'python.org'.õ = OpenerDirector()ðph = urllib.request.PtñHandler(dict(http="Œæ.example.com")Iso.add_h6&phrreq = R] ("L°://www.perl¬&/".ëø .assertEqual(req.host, "43`o.open)GÈ­[{®5°÷IOdel  Ñ‚def testFOO_allS*J’�šs–»3s¼o:3128"ÁÑmeth_spec = [Yˆ" [Ï s_�õ", "return response")]0 %@s = 4Äordered_mockAUs(o, x)Ïv sN™Q7Ù¤ T`ÿ �$[(Q[0], I5)],8õ ó[tup[0:2] for tup in o.calls]*dù\ßauthorizationpF''p¯Ä = MockHTTPS”ç v 9%4t›�header("(-A;îgFooBar6 8 User-Agent/WGrail. àreq.host, "wwwó.example.com") öself.assertIsNone(req._tunnel_host,`o.open!ò# Verify Proxy-Authorization gets Kåed to request.°# httpsconnÿ _headers do not have the^,G butO-�req will?lë�NotIn(("µÕ", "FooBar"),Y.·�_handler.ÄD.reqÄ$yv User-Agentm_Graill[si OsNotÐ ˜PEqualÚ.ó@, "pÏ4_:31289=3getÿ\a'")] ]`@unittó,skipUnless(sys.platform == 'darwin', "only relevant for OSX—@def KQ_osx_ÁP_bypaQQelf):qÃE = {°'exclude_si*Š': False% epßðs': ['foo.bar', '* ` ‘127.0.0.1 Z0.10'Ir¥'10.0/16']”} €# Check �ñs that should trigger%ó Ý;#7X in (®?www° ½I¬! ®!W"TYTrue(ˆ@_macœ syò f(˜,±m à 'expected/` of %sT0be j1' %w5[9Gabc.ë0E4 Xproxy¶Obà hÖPVqPdict(•!="n‚o:3128"� &pho à~%¨&�Networks{%A7, '‚}@"%s"{R̾âÒ*À, password_mŸanager,  ÿ"http://acme.example.com:3128/protected"H]proxyB8!) ¡ðdef test_basic_and_digñauth_handlers(self):3×q# HTTPD*RAuthH(ò raised an exception if it couldn't Sg a 40*P£response (ðpython.org/sf/1479302), whereR shS‰ insteadKó turn None to allow another×r (especially;ÖB Õ)E¶Dthe ª.BOAlso»ñ7027, RFC 2617 sec!1.Òge must‡Btry ‡À first (sincö0's „Pstron§ §à scheme), so w¢8corñorder of calls B„to checkiRcomesoè€class RePúingOpenerDirector(ZŒ__init__?  A./*„!.rŒved = []‚ rpk, info–( H�.append(,PùMTeståð(urllib.request.4 % w›Ø£_error_401£Û*args, **kwds5¬cparentû"("-")!™.‡ J{ ÄD SC $ B:íA —@??om/ =¢password_m}ƒ = MockPM(1Cß? = ê XAB @ +(?õrealm = "ACME Networks"ˆ¥trÍgg((¤ 401, 'WWW-µ¡enticate: � j�="%s"\r\n2' %ÎkD.addÓ(á* ðdigest_handler)  ôopener.add_handler(http 3) )ó # check basic auth isn't blocked by digest J… failingC±self._test_F_F(ƒ,Yyõ, "Authorization",F‘ xrealm, ½ÿ, password_managerE "?ÿ://acme.example.com/protectedˆC0)ëtXpwas trilRefore3÷ (twice, because> l� called .t1() 9o ³assertEqual›Ò.recorded, ["‹A", "ÃC"]*2%Adef ܱunsupportedâ_4Û(g%):§Œaer = OŒ–Director(˜ñ# While using DeH²JhVmý = urllib.request.HTTPCV(NoneqB@Mock7p(qƒ 401, 'WWW-“ðenticate: Kerberos\r\n'_ò u»0 ¢)Z.ÁóRaises(ValueError, w$, ¨8wwwê"Í÷ Ì ªB+98ƒó fÊ cÉ@@NTLMÁÅ µ›ó ôÄQ ± ,ÇÌ?ead* j-‰e_url, Y imAá5e648FuserÖ€ = "wile�xcoyote"¯lõ() fed through to eu Dú Á “ð‹L=‘“.8 ¸ û>?url< �À_manager.useCr) ô self.assertEqual(password, ”_manager.%) ?popener.Ç(request_url"õ# should have asked the^ ^A for”username/om¬¢átarget_realm, ë ?íurl, protectedгexpect one óð without authorization,Ïn( Çólen(http_handler.W_s), 2À_False4ð[0].has_header(’ )Kd_ð = bytes('%s:%s' % (ý¦), "ascii">Tõdr_value = ('Basic ' +æ`Òbase64.encodei^zÀ).strip().de(ž è@[1].íé,†Š ¼ÔtrunredirRhdrs[Tp]{ @# if+Åcan't find aW +e won'tï#OAHTTP’e error%â÷”% =a)u = NoneA �Fset(I ƒ jÿ 1Y8ÿ%ÂPdef t¨b´q_prior_àauto_send(l!):/·ñ# Assume alreadyV�enticated¿!isCF=Tru1#ÝðAPIs like Github that dÁ¶ return 401\—‰õ = "wile", "coyote" 0ª' õ://acme.example.com/Ó"e,xp = Mock8HŠ×CheckAuth(200Õ4pwd&0 = 1P7€MgrWithPV9Ádo¾<=-v(_? T.add_¥(²°’*, O/, ³ä î.é ö{@V (6^'A = OBDQ.orIä/Í BQ/ÜÐ) opó ener.open(request_url) “# expect õ to be sent with auth header5ðself.assertTrue(http_handler.has_5_5lPdef t²basic_prior'ð send_after_first_success(f%):u`# Autošd• ;ãentication is G†ful onceóõuser, password = 'wile', 'coyote's3'çø://acme.example.com/protected:0alm4VACME'|ópwd_manager = HTTPPˆ€MgrWithPeAuth()‡N2e<BL-!Ha|(_? T.add_t(realm,í*, $Ä3iÝ7 = l.�*edm8Ñ7cFalse(7_ª Opº‡Director " ( Rµœp = Mockw2e¡ 401, 'WWW-UÎ!: h (�="%s"\r\n†' % Nonelž�˜* .’k-¢L€—PCheckF(200ß ÂFúYæ×2MQ ‹è0# A\ü getting 200 from wV# NexŸs� in the ¨19”Òm^lclosedOq"""TestÐdconnec9âcleaned up wheò€responseYP5"""ú°for (transf[Pdata),("´5("Ch!: FP", b"/;"),,TOñ-Encoding: chunked54€:0GñContent-Length: 4>9,gªº@ = "+A/1.17 OKd {}…".formatû)FV" =ö°urllib.fake”(b .eÜ`e() + “ @ß3 = >��.Abstract�È;À req = Requ÷est("http://dummy/") ùreq.timeout = Noneùwith handler.do_open(conn, req) as resp:5_j.read(pñself.assertTrueLý.fakesock.closed,Nò"Connection not ( žñ {!r}".format(transfer)) Eòdef test_invalid_:(‡)¶À"""Test the Þkóis cleaned up after an Lúqonse"""mø>" =taurllibÞƒ7(b"}U3 = 'òrequest.AbstractHTTPHzDrreq = R,Û×5‡pRaises(¢÷.client.BadStatusLine'Ḡ]ä Ôð") class Misc–`s(unitÆ.0Cas”nß“ser_has_œÞ", ,¿_VÎ §rany(h._(Z__ ==;rƒfor h inv.‹s‰QbuildH!er©’¢8 Myû 9’BpassõK4FooC HCBase HT#foë$ ^l3BarQ(l1bar h l?< Ho = (&, ·©ö.? X6o, ;/^@ñ# can take a mix of °ões and instances2Â/()•Ä34subµ¤of default2­s overrideÕ ùÊ 2[ð# a particular casee”Ming:—”0be o'edJÕin explicitly ’° ÍZ5²Àhas_handler(óo, urllib.request.HTTPHandler) ÿo = build_opener(5&()7Rself.2b_has_hX(v wó# Issue2670: multiple Fõs sharing the same base classC‡ MyOtherÜÂ%):>ÿpO 'MyV,j F2 Ó!) ¦`@unittËñ#skipUnless(support.is_resource_enabled('network'),Aõ 'R %Sires 3‚ access'²@def ' _i¶`16464(QTwith �÷transient_internet("http://www.example.com/"DœU, =¾ ¥–/¼>est4Rú| Òñ.assertEqual(None,uCdataŠv­ (†÷, "1".encode("us-ascii"<9 kLb"1"k) 1 0ð get_header("Content-lengthy 峟234567890¼#?Å0öÆd‰›RErrorbLface’5"""únõ 13211 reveals that H� didn't išAment}1URLfIÐnÇ even thoughF‚is a subž4of B.C˜Ðmsg = 'somethòpbad hapŒ%d'3`url = S€ = fp = ›@hdrsGûLûF: 42C6err!e:Þ3,_p, msg, QF, fph€÷ True(hasattr(err, 'reason'å0LBerr.',ðoësp(?, 'mÃexpected_err‘ ° %s: %s' % í.… , Î6msgD ðs;), _4 ÂyÀqual(repr(erñ&r), expected_errmsg) def test_parse_proxy(self): $_,•cases = [#'!('>é.example.com',"ˆ (None, 5*))7Y_:3128^":c/',¯‡ù*# The authority component may optionally include userinfo�ñ# (assumed to be #(×name:passwordä&jo@ñ„'joe', 'V k -•m Ë ,´rA w"#EÁ¹s with URLS7�('http://þ/’+'ò c³h%='ðÐn ulw%´ åX{C ÷ù# Everything after tU«is ignoredÿfþ. rrubbish| ¿0ftp"ð# Test for no trailÃ@'/' ™ ­I® ¸`5'))u]W,¡&tcyO in Kk8~Ù.assertEqual(œ'tcÌÅ 6øRaises(ValueError, CÊ, 'file:/ftp€,½€unsuppor60algl,hmòhandler = AbstractDigestAuthH( Sâ ¬Š) as exceU.get_Šö_impls('invalid'fðself.assertEqual7( ùstr(exc.exception), ð"Unsupported digest authentica1õ algorithm 'invalid'"Dð) class RequestTests(unittest.aCase):3+3Put.(¹ñmethod = 'PUT' 7çdef setUp(self-d.get =€ñ("http://www.python.org/~jeremy/")Rj=?pos> >Fo"data"$ Àheaders={"X-@": "++"}š)Ø", :{='HEAD'M puæò~,cforce_2L ¬v"POST")æ _ìÂassertEqual(=!, Š– =) 9CGET"8?get7Y8ž9%PUp/pup¨| vÏ!;�9QFalse F..(3GN† = "spam"ž~?Tru}þ_7getÝ÷Ô# issue 16464Áf we change “ðwe need to remove content-length Ì#er@Ð(cause it's mðprobably calcula*òfor previous valueGˆ€setting_�‚_should_}_}_}� Ò/‰NotIn("C­€òunredirected_hdrs…’v$Jadd_(€W+42?†l#42ˆT PLdrs[¥]K6  ð!µ 7485 same ¡@dele….* ¡oQ'foo'¤¿ Àh", 3) ò self.assertEqual(3,óget.unredirected_hdrs["Content-length"]) 6del:EdatadlNotIn(Fs !) Hðdef test_get_full_url(Z!):!† Íõ"http://www.python.org/~jeremy/",;? L q)��selector‹v(?Gïreq = Request(Á"0¨Á–"/", req.\æ BOtype³>"�6 OhostN …X@X}_unquot®(6%70ë* ’7�_proxyâBFals¢.3Bhas_3)©3set"�0erl–1", î²?Trua _ r²origin_req_ðüOE¤!Ç8 [wrappedœ °Pž2Ó³½url_fragmenœ Œ‡´/?qs=query#G_=truež 5 „a|O#funn eŽjð# Issue 11703: get/„) omits Ñ‚ in the ual URL.Dsurl = 'HdocsDõ library/urllib2.html#OK'? é;url ªÅIÙ1), 2NºÔ0ull /•�urls = [¼'÷*/æB/¡ F!']Ú«0for쌸ÎEø ñIYà) if __name_ð_ == "__main__": unittest.ð() """Script used to ò os.kill on Windows, for issue #1220212 This sA ñ tarted as a subprocess inWª_os and isnñthe CTRL_C_EVENT%SBREAKðsignals, which requirejðcustom handler to be wrê@n inÕ1he Ññ@target. See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspxða similar exampleð C.\ñ from ctypes import winã, WINFUNCTYPE æ9Dmmap ðsys # Function protoW“4the# f#ñ. Returns BOOL, tak>‚DWORD. H>˜Routine =�(³.;<Ó) def _ctrl_…R(sig)s2"""\�ig eventãr�" 0w€rminate ¼91"""¶`if sigÐ..fÝApass0/el2O6'seárint("UNKNOWN ™!")_¸( ó2 = èrD( ) uÃtConsoleCtrl.# = ÿ.windll.kernel32.Se/ @.argþSs = (Y‡,q¾)A0resA* =/Ï if __name_R²# Add our cÛBtrol�5ing‚Ñ with value 1Jif not Ó(]3, 1OéœPnable>?addE²5‘exit(-1) z€# Awake =¨@m = i.°(-1, 1, sysbBv[1]„m[0] = 1M DoÉhî…but wait‰´]˜while Trui¶þ„asyncoreæ¯dselect$os UsockeQ5timMUerrno26truJ“threading±C0sup·Ê$ioÆqBytesIO #B.PGOAVraisem¢SkipTest("Ys-� helpful(@PGO""òTIMEOUT = 3 HAS_UNIX_SOCKETS = hasattr(ðQ, 'AF#ò') class dummy‹›Ç_init__(selfH@.cloûr= FalseÑ52 É1lfileno2-)42¢channel£Ð( =Þ(É «Àf): ð+self.socket.close() class exitingdummy: def __init__(:)Upass &ühandle_read_event/ðraise asyncore.ExitNow}M?Rwrite@3 = Tn¼% OexptOø_crashùr.error_ŒŸd = FalseŸExceptionlƒìÐ_Ý Á÷ðTrue # used when tesEð& senders; just collects what it gets until newline is5 t ‰ð capture_server(evt, buf, …#tr¦¾`.listeLÁconn, addr =;0.acr!()Ke {timeoutâGFelseqn = 200B€start = @.^øwhile n > 0 and$2 - :V< 3.0_7qr, w, eµ80.se ([ÑC], [20.1Ê5Jif rKen -= 1±pdata = TŠ.recv(10N%Ð# keep everyt& 6ufor the¿­terminatoriAbuf.Û(sþ.replace(b'\n', b'')x1if @ in 6ÖžYbreakp�Â.sleep(0.01)”,è7¡lfinallE"7pevt.set¢šàbind_af_aware(;a•à"""Helper funcÛ@ to 5# ai  accordingáits family."""Ëñif HAS_UNIX_SOCKETS=m.,3 ==N1.AF* ±# Make sure¡Àpath doesn'tä1st.gÝðsupport.unlink(*‹¾`_unix_‚(etöJ %.4O_F Tests(unit2.CCaseGjQ;? A£_exceptionFGõ# check that an )` other#n ’÷ in the object handlerKÑmethod causes+$s_error Õto get called>ötr2 = crashingdummy(î †read(tr2 PEqual.q_~Ÿd, True) lwOmQ£r*#6+à �”constantsÇ0selÇ`moduleét!ð# are not present0ðWindows systems (se3iæh:;ð http://mail.python.org/piper/ò-list/2001-October/109973.htmlo†# These ¸•should bešò as long as poll is availableïò@unittest.skipUnless(hasattr(0, '=R'), '.¢ required'�@def I_ðX@"f)û—6# CLAcorr_sUóF by D—”°ibutes = ('$€', 'exptt `closed ç'K€expectedI› ´Âect.POLLIN, f/),%4PRI„&bOUT, '¢'cERR, 'À(?HUP(ONVAL)Qclass¾6obj±×€__init__Ñ c�‰ = False."ÿ# û$ ð" OÞ+ •×ÿ°o_eventà+;ØKâL(! =xM “ "Ä• 0”'“ P“ "{ š¤for flag, �Ôà in expected:   tobj = tes 7() ð self.assertEqual(getattr(, , expectedŠ), FalseAóasyncore.readwrite;iflag) m°# Only the Qòibute modified b£routine we~k to beIùcalled should be True.%1forg1 ino)s:$  ª!),B)== Ýðcheck that ExitNow exceptions†ùùobject handler method”Ñ# bubbles all-ôway up through s s  Eÿtr1 = exitingdummyùtRaises(W.½,iÜ, tr1, Üÿ&anú` othern!inØ  À#q causes/4T_erro91geteG¿tr2 = crashüAtr2.^_kdò$r2R Za¸'1def¦ _closeall(A)²._p(“= A�_defaultI ‰ g{S, useR–6# Cù7_¼!) €s everyt…¶a given map@al = []Ä<«…map = {}ÏiB‡range(10ƒ5Ac = é{channelðªl.append(cÀÙ ‚c.socketi¡0[i]cÈ'if#¸ŸUÖj_ $:try=5Ö ? .…‘K!ofinallhÜþ¦& =", ˆJelseÄÀ’kÿ– ŽDlen('7, 0+clh C Ñ ê_ü_compact_traceback3 ”r6$ Eáö("I don't like spam!"k  ªpreal_t,Ç3l_vûtb = sys.exc_infoÈr„ ¶Àback() § else: õself.fail("Expected exception") -€(f, funcõ, line), t, v, info = r,Uÿ&assertEqual(os.path.split(f)[-1], 'test_asyncore.py')C|7ÿcompact_traceback= Ÿt, real_tav$v$êq, '[%s|_]' % ð) class DispatcherTests(unit÷.RCase)� def setUp(=¨Bpass†#ŒtearDown&E£close_all(¼6Œst_basic8Ed = <d¬(ÿd.readable(), True- Jwrit-ä—Orepr–0God), '<Ѐ at %#x>¯\id(d)?log…Áœö# capture output of E.UÆ) (to stderr(ò l1 = "Lovely spam! Wonderful"e l2,ÌI don't like"Ówith support.’"d_tS() as€j¹d &l1–2!ì3s =E².getvalue()Ï1 !°, ['log: %s…Il1, #2]r@log_p˜BZ�Çout via prin$§ðHave you got anything u7¾?®`Why ca°Pshe hA‘egg bacon¾È and sausage>3ìaTHAT'So^v in it!d{ð5outð?outðø~GEGGS4ê#2“3, 'SPAM'³;å%?out%el@= ['Š ÷2n%3],.i‡$, _¡TŸunhandledUÝ�d.ignore_˜@typee! ?u Þ%ÚV_exptŽÀ d.handl§e_read() ïd.handle_write¥connect() =ñlines = stdout.getvalue().splitOò expected = ['warning: un~õ d incoming priority event',qµ BÝ5ö68]£ñself.assertEqual($, ý?ðdef test_strerror(9%):Hõ# refers to bug #8573öerr = asyncore.F¶errno.EPERMåôif hasattr(os, 't'p[ƒ ¼„err, os.1(_`Ž&-1%]@TrueKð != "") class dispatcherwithsend_noÔ(ê#_$_%ÆS-LableNÂreturn FalseÀ.y_Ë 4Epass›D›ðWithSendTests(unitÈ.GCase�_setUpVn‚ŒtearDown&ð”close_allxð@support.reap_thòsPS 0:«!po¦bn -= 1u@evt.tÕ$=7capW , ö&*2øzfinally–�ðjoin_thread(t, timeÿ:out=TIMEOUT) @unittest.skipUnless(hasattr(asyncore, 'file_wrapper'), '1./ò required') class FileWLUTest(„pCase): _ãdef setUp(selfð.d = b"It's not dead, i¡sleeping!"G2ðwith open(support.TESTFN, 'wb') as ´x1a.write�A.d) Q˜�tearDown›_kunlinkn @|st_recvAfØ?os.­Áos.O_RDONLY)‹§Ow = z6(fd&�os.close<JøassertNotEqual(w.fd, <&ileno(),OçL13),°"Ÿc7Aad(66Ù/wÍAñRaises(OSError, w.r1€Lsend€!d1X¶Come again?F!d2ðI want to buy s*vcheese.+Ç WRÇ1 | ÕfAPPENDÏÕ)wµ'd1P.í(d2&r& º7r`d + d12ƒx�dispatch{ 6‚)À6st_# ¿ †•data = []\íDÁT#�C£qhandle_JG #'tata.appÈ.k629)Ô1s =q„Û SN�loop(time7÷ 0.01, use_poll=True, count=Vª.RÉ�b"".join("1), ! K ìsource_warning‘å# Issue #11453d¨f. YFATcheck¯’s(('', ReÆWÅ)³|ENonefmP³gc_collect(%¨¨R_twicŠWÀONLY) ó f = asyncore.file_wrapper(fd) �os.closeˆ.fd) # A¥ dupped fd1õwith self.assertRaises(OSError):)wfs%) ;æEqual(f.fd, -1ª¡# calling ±õ twice should not failQdõ class BaseTestHandler(�dispatche¨AÐdef __init__(›·, sock=NoneÌB.7ÃKÒ.flag = Falseoh–q_accepttirN0 ExYion(".ýásupposed to be+3ed"b a/edcebeoconnecÇ/È/ex',]a"-_e_' ­OServ¨Ha"""A s&õ which listens on an address and åQs theæw0ion5"a U!r.6"""� Õqfamily,`,7=`¿( "pcreate_s2et(n # set_reuse_å(Ñbind_af_awared.H¯)Œ0+(5 $ =Ý ‘@property"U}1esshñbreturn~@.get _name(– m°:±š(LGY~Client(±Øñ7essê D ÿ Vד(Xâ! ‡Ipass<éBAPI:¹«ŒtearDown¬�Ȱ_all(ignore W=True†ðloop_waiting_for_ÍR÷, instance, timeout=5¢“ = float(q) / 100yÓycount =VwhileËûaet_mapÙ2ð> 0: ô$asyncore.loop(timeout=0.01, count=1, use_poll=self.7) ùif instance.flag:)ireturnbY -= 1‡U.slee’lƒ`fail("g± not set") Cð def test_handle_connect(7)”Ê# make sure *ä is called on ?^Çòclass TestClient(Base a*Œ ] ‡&ž6r = TrueÌprver = f Se E‘.family, ;Faddr#c˜K¥'4H.66ess9% Ð_waiting_for_g(TÙe_accepd))erwhen a `pso�Listenerq€Hã6r):.3ž�__init__,$, ùò ¥2\Q.>+'âcreate_socket(a+Ñbind_af_aware�.2!, Œ´T\lê.(5P:Ress =ýQ@.get Sname(¨U‰‚H ˆ (Š0Šb$0¾ŠsâÚŠ!edfáð ?ed(Žÿ‡œ¿dispatcher.Çþ %  , w #P.clos=ç0lagTŸwS 6reaÀ # makó!e sure handle_read is called on data received òclass TestClient(Base %):&-8def^[(self#'Ï.flag = TruekH¥rl{ Nq�__init__nk, conn&t´H.6 Ì5©ösend(b'x' * 1024)¯�server = ^S †‘.family, AQaddr,@ÅicQ^4Ab.CEess)9%ðloop_waiting_for_T(T¦!Stest_õQwrite¤$Z# mak(ó "N va˺ _þKRTOclosR(Rñ when the other end #sä#Ðoection…A^üñ…Ò# in order to6•4 be(Pwe ar-ipposedmq#AÀat least oneW1v()E 3[recv(`PÁ‹ÂEG=!CÐ�rp ¥ huÃp_after_Â|_broken½ñ# Check that ECONNRESET/EPIPE-ƒorrectlyXöd (issues #5661 an‚¦# #11265).*Óa= b'\0À&28ûÍú &):'&…Ì1yg E $©Ê;¨ðexpt(self):  ôself.flag = True !…close() ÷class TestHandler(Base&):-KQdef h+`_read(W%):P#ÿ.recv(len(data))% “?f�writablecÆreturn False¤�server = ÈS A‘.family, šXaddr,÷�`clientFAestC Ab.C6ess9Yðloop_waiting_for_“(Twý#@unittest.skipIf(sys.platform.startswith("sunos"),9#ò "OOB support is broken on Solaris"œLo_·AexptÒ·´# Make sureÞ'W`calledWpÊ¥ received.™ð# Note: this might fail6Tsome ßUs as H'isA”tenuouslyÔøed and rarely uspñif HAS_UNIX_SOCKETS-„êÑ == socket.AF* ¦+‚íÀ("Not applictC to 6E3s."À}8if ¶l†"darwin"ˆ�use_pollx !E may0ømacOS; see issue #28087~µ ì Ô¨ü÷# -µS1024,ú‚.MSG_OOBN/7á.tÏ¢WF¨�__init__œk, connÎ*ë²X.6‡1© þsend(bytes(chr(244), 'latin-1')öN[�G ëArrorPÇ�4ó qP?Ž‹u1.0 / 0*t<e‡œE :tryBNraisèðexcept ZeroDivisionE€D6pas…UOelse/s! EcRion("n�ion not d«4_.T‚À server.addrcess) ñself.loop_waiting_for_flag(client) ,ðdef test_connection_attributes(G!):*Yáserver = BaseS #�.family, 0V.addrŠo4C| 4U6Ãnã# we start dis¡%ed m²ssertFalse(Ÿ.*…+5Tru*Paccep*õ'# this can't be taken for granted across all platforms”#j•• +–Xà execute some Ú¢s so that c øRs to ?�asyncoreñ (timeout=0.01, use_poll=»¶, count=100"ar<UœÎ1/4C the%f_lose(âW é±/ed€¨Astopë5ingÚû/.cÚ2°S …=Áreate_socketÞ55 = €¨dispatcheru-.cAS‚Equal(s.ps.type, ¿SOCK_STREAM< ¹ 73getEO(), " ¦üget_inheritable()‚Lbind<Àif HAS_UNIX_ÚrETS andh¯4 ==ü!AF*°´ðlf.skipTest("Not applic†+6E7s."1¼1½%1.ßêd–.listen(5—port = s1>á’name()[1]¾à2¤2¤ñ# EADDRINUSE indicates<{ÿet was correctly boun�ñRaises(OSError, s2ý!, ÞÿP[0], å `set_re†G2L ÀETS and self÷ .family == socket.AF_UNIX: óself.skipTest("Not applicable to 6EUs.") ACwith.e(P{A) as r:tryŽ>@.set@opt(áet.SOL_SOCKET,Jå_REUSEADDR, 1)�Gîexcept OSErrorg�unittestòF("SOLû not supported on this platform"i>lse_Y# if UÑsucceeded forÃù we expect asyncoreÃÇ#y®do the sam!5s =>´.dispatcher7> Œ ¿eªÓassertFalse(sÄ/.gˆ ­L’.)“‚oclose(!rcreate_P â ™sQ¿_reuse_addrPþ?Trua¶@xÑ.reap_threads@def ±á_quick_connectø)€ñ# see: http://bugs.python.org/issue10340S¬1if ÿ©û4in ?PAF_INsdgetattW3, "p6", objŠ'))ˆ[XQ½� specific×C@ and\i6Táserver = BaseS ïÐ,¹Ð@# ru°"e <‚ 500 ms:Aþ³ should be Eqed in 2*3t =DQing.TŠö(target=lambda:yõloop(timeout=0.1,G wcount=5wt.start¶ :€ 3’CK_STREAM”:¥,Ë6(.2[ !vžoLINGER  ÷struct.pack('ii', 1, 0)\y õ#s.É(3.>ess¼ R2pasr kfinall§¤Cjoin¤C(t, 5ð=TIMEOUT) class PÁAPI_UseIPv4S† s(Ö9„§LÓD = (|@HOST(9 @ËðUnless(support.IPV6ð%_ENABLED, 'IPv6 support required') class TestAPI_Use)ÃSockets(Baseñ): family = s#‘.AF_INET6ƒaddr = (gó*.HOSTv6, 0) @unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix]s¨ )¨�mapfileuríð'http://www.python€.net/uniÈ/¤h.TXT' »_EUCKR»Qoeuc_kr¼#cEUC-KR½/ð# A4D4 HANGUL FILLER indicates the begin of 8-Ìñs make-up sequence.G€pass_enc0ö = [(b'\xa4\xd4', '\u3164')]-/de-b_JOHABbQðjohab' mapfò\ileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT' # KS X 1001 standard assigned 0x5c as WON SIGN. 4ñBut the early 90s isóonly era that used johab widely,tð most software implements itoôREVERSE SOLIDUSvÑSo, we ignoreo²Bhere'€pass_encùñ = [(b'\\', '\u20a9')]„'/de' ñ if __name__ == "__main__":C@unitf.¤() import ` from !á0sup" *cŸTxtlibdsocketÕurllib.reques$os Ôemail.messagestime l=ôires('network') class URLTimeoutTest(¹.RCase)è€# XXX thãòest doesn't seem toã€anythingôQful. #âTIMEOUT = 30.0ãdef setUp(selfdWý°.setdefaultË1out(.K)E�tearDown HINone@œstURLreadCTwith Cðtransient_internet("a0exa¹W.com"ËJf = ¾§.urlopen("£B1/")2>!f.˜­@NÆ£s²1"""!„0 usªÁ¯AheseÐ s ™ònot exhaustive. Assum<!at) OQfiles! aË0gooþðb overall of some|abasic Tðface features. TЃLG…s exerci½ñoptional 'data' and 'proxies' arguUB. N¦sLAfor Ôàparent redirecLÐ have been wrÞn±å×Fðalways construct anO!toró –Q sincÌ�re a fewVMajhu”ObaddresÅì=makri&àpensive enough¤ðwarrant minimiz7�unneeded¢3con´sò2"""kZ'(@Ï. qmanagerb÷ÄnÐ, *args, **kw C resource =Æ2s[0´š ;N7r‘ ‡®42try byield ×ofinall-‹r.close(y_þ «1# S @ exp¡dÁ°árðwith self.urlop÷ en(self.url) as open_url: ñfor attr in ("read", Hline s `fileno yclose",MXa "inf*Šgeturl")y, àassertTrue(hasŒ(«,›À), "object rK¯ned from "}^p "urlMÑ lacks the %sU�ibute" % )I –A9.(Ž�calling '±' failed") G�def test_EsˆÿÄ# Test both %E and !s.JÅQwith ’ËMÕ 0X¥IsInstanceVÈ™Ì_bytesÆ„t did no�¯ a string"F„ s…Olist„s…D ƒƒ1~''i,De_obj =_.( )=ò, email.message.M 2by Ù1 is¥/an'­&? of�ßdEqual(Îð.get_content_subtypeä]"html¡£ôMake sure same URLà edÛ 2by DÊ,Bgott Ì[Îû<,« ~getcodeê+Ã!) ð¨QfancyVPer to#° 404 error .s%={ö + "XXXinvalidXXX(^àsupport.transi§Çinternet(URL*ø2HPðWarns(Deprecation;ing7;8ð = urllib.request.FÜ0URL"Per(). }ÓA>try4ú £ ¤ofinall?jÍÀ 68ÚZ,w ϯbad_addresÞ½Àproper excep-»ðaised when connectL–to a bogu×## c.Z³# Given thaBð VeriSign and various ISP³s have in ÷&# the past or are presently hijacking various invalid>ðdomain name request'÷ an attempt to boost traffic> toðir own sites, findt(a \gto use;ðfor this test is di]÷ ult. RFC2606 leads one to<óbelieve that '.Öø ' should work, but experiencz`seemedת÷cate otherwise. Single characterxATLDsd`likelyC!re@ƒ0, s0is es¶- bð°choice. TheW il20'.'¾wvents axñrelated problem:7÷ normal DNS resolver appends;ˆas fromˆàsearch path ifHre i<0no “C€end and,.“o53oseè:bimplemȰ '*' rule a©!ulî—returned.¬¥However, n_tis will¦1Ç;"faCÉC ISPþTs alløª8ó!. Tñreal solution wNb}p be abl >°parameteriz�0e fÀ with a mocköŸìcbogus_˜ñ= "sadflkjsasf.i.¥E.d."kEtry: úðsocket.gethostbyÀ(V)/êexcept OSErrorG$# I0aie‰ötoo narrow, since getaddrinfo() may als‘‘ # ƒ÷¡EAI_SYSTEM/õETIMEDOUT (seen on Ubuntu 13.04),«Iñi.e. Python's Timeout½A*6pastLelseÜT_hGðth some overzeal>ù providers such as OpenDNS˜ôself.skipTest("%rn4notâ Õà!to†O" % –.±ure_explanap€= ('open %anµ�URL did iDaiseÌ9; '£ @'can¼ñcaused by a broken90ser7Gb(e.g. µPs 404n`†s page)'rü0passertRµ#s(‚o, msg=)Àsurllib.¢@.urlð("http://{}/".ftùð) class urlretr+0Net—¼`s(unitv.CCasez0"""9 {H0 usžnSQ.""" ‡€@context; SmanagC8def’(!Ð, *args, **kw ŠÆÕðurce = args[0]  òwith support.transient_internet(resource): 1ð-file_location, info = urllib.request.urlretrieve(*args, **kw )N:try_eoyield i ;ofinall?Ôyunlink(H!) D÷def test_basic(selfçq# Test P funcëaality.>¤>9elfìIª.logo) as {,gG1ú assertTrue(os.path.existsA@), "Í ~Õ returned by"šW "¡’ð is not a valid q"—ÞJopen‚a, 'rb'Üf· Ìpf.read(· Áing from theÝÈÅ ÕI" byÌ|failed"Ø specified_ÞáòMake sure that /y£ža&of®�to write Oorks ,œ  …aTESTFN_ xg;\Equal3V „ «w Y‚emporary!ÝoheaderÕ " `as 2ndð"ue…¢OgoodТ °IsInstance(Ëò, email.message.M) @³Ã3n iX? ofU—ð = "http://www.python k.net/"Rdata_K m!FI%ÿ¼Ns˱datevalue =ù&º.get('Date'„0ùformat = '%a, %d %b %Y %H:%M:%S GMT'ôk�time.strp (Xˆ , c {€except V®_ErrorBfail¼v¯bin %r W9' %e¬˜ re—AhookU0Ârecords = []°9Ging_>ðblocks, block_size,÷ total_size): ñ records.append((blocks, 1,=%) >ñwith self.urlretrieve(òlogo, reporthook=fFing_e) as (O”ðfile_location, {headersº�expected¥w = int(.÷['Content-Length']¼�sŽ0r =ª#r(õ) # For use in error messages.°éõassertGreater(lenFõ, 1, msg="There should always be two "Nþñ "calls; the first one beforeõtransfer starts.")O�TEqual—Ÿ[0][0], 0+È -1-,XŸ ä. _` can'tá0>c%s" % Qoz ¥I2], á7O-1][8½¥.Vs = {j for _ô_¾¸}C X{#,}Ds7 5sma%s mus;e´9³ @ 90]*› OœÙ£’number of2s * ë¯Æ NB" >=F9?in ò if __name__ == "__main__"µ�unittest.‘() # Test àmodule type imy .Ñweakref from G1sup*1 gc_collect½pquires_R>ing>ó.script_helper L´_python_ok †Qsys M­aType =³ð(sys) class FullLoóö@amethodŠQdef mCRw(cls, m’return "<&ô '{}' (crafted)>".format(m.n}HBare}Tpass š¸Tests(^.ƒ4CasY�]á_uninitialized¢@# An¡"Òð has no __dict__ ›µP# and$Áoc__ is Nonepcfoo = ­0ypeæVew__(O•True(foo.}Z.àRaises(SystemE&¦, dir, foo12tryÆ™|dè¶Odfail("š% =,Vpr(s)[ñexcept Attribute„mÀ pass  ôself.assertEqual(foo.__doc__, ModuleType0) 7ðdef test_uninitialized_missing_getattr(^!):26Ç# Issue 8297IÁ the text in ùAttributeError of an n! mžIZfoo =³fnew__(Æ)-šøÅRaisesRegex( ¯ ‡2, "u€ has no æ¦Ý 'not_here'",F„, foo, "+"N@F’ %o("foo"7_'foo'D no˜nstring[§Regularly ’$,¬2doc< !@name;.KONoneg#Ist`loaderY,apackag†-1speÎ* ¯0ict„B{"__é1": ê3, "0": Lè24"__Þ<MÆšE2"__Ö:}J_ascii/ oASCII ,?doc+A51.a^dŸ)¸ i¼ ®0 unicode¢ U#¤o\u1234|ª)d°4o¶.Àne,  ð"__spec__": None}) %ñdef test_reinit(self):1# Rõialization should not replace the __dict__;ð foo = ModuleType("foo", ¸doc\u1234")0•.bar = 42�d = foo.^0.__³+__ZTÎÒ.assertEqual(Lbname__‹.4doc-?doc0 vbar, 42Ø„.,ênb {"__ž!":*1!__ƒ„¼, "bar": 42B¥ "__loaderì,zpackage …' ´CTrue7³\ is d>¡dont_clearGõSee issue 7140.÷€'f(rƒ;S$/M`return5¶gc_collect(Dã%()g[_C], 4éä@requires_typeO1ingeÅEÜ_in_ref_cycle€destroyeÞ![]C»m0±(m.7 >âs = """class AÙ&ò7, lla.l = lF.\del__²*õ.append(1) a = A(†A)"""DÈ•exec(s, mPÆUdel m*šfS, [1]’­t|weakref²M wh:.>m£ì5—Is(wr(), ÂBu »mŒ_getattrÂaimportžT.good(u as ggaEOfrom&?+ÛõBp, "Ther Gâ �gga.x, 1.S#7y, HwithSý RaisesRegex(AttributeErrorÍO ÷"Deprecated, use whatever instead"ä>“?olo"FBsys.½0s['D ¡+']\+À _eësï )baîbî á,Àttr2 ó self.assertEqual(bga.x, 1) #»ad_getattr2,HwithTõRaises(TypeError):W^mEnope@Š Iödel sys.modules['test.b0%']u=if X2' inB ¹_A2'] a@def |_ŠP_dir(R aimport&E.goo]q as ggaG.7 ¬Làgga), ['a', 'b6c']½©f© _e´s° R¯b¯AfromÕ á,2Õòó6bgaá@!2I*´2ek|_tricky�f 3fõ# these lookups should not crash)O�AttributÆPO3.onÎM3delþ¡­3­,3Ìrepr_minimaly # rs when Ýñ s have no __file__, __nam Õor __loader__ÐQm = M¥%j('foo'•$m.D5 ‹r(m), "<‹ '?'>")„._êœ Ù’ {Ä}A_and,&Šfÿ = '/tmp/foo.py'(­ F DÀ}·M_onl˜F mÀ? .9Ó*/?'Ñ Àdef test_modóule_repr_with_loader_as_None(self): õm = ModuleType('foo')¤assert m._GP_ is I$Q.)`Equal({�(m), "") 5’def test_«Dbarei¯but_no_nam´1del±:!__rìõ# Yes, a class not an instance.( ìq= BareLB"Qç0 = (&< A�7 %÷?' ({})>".format(i)<Ofull<#Z'_.ƒò () will fail because the $0 ha6ÅIeò. This exceptionJñget suppressed andp0eadXJ�!'sM<wbe used˜© õ;OFullõ&õf1Ù7Å:‰ kRÙô�crafted)1€and_file“ ò7# BÑoÑßÁ0(),vž K LƒS8!._Êÿ__ = '/tmp/foo.py'[PNJfromDWLW ±Even though6£[4an ÇVD wÕŒ ` À. m.ñ__loader__ = FullL# �m.__file Õ'/tmp/foo.py'#ñ'self.assertEqual(repr(m), "") ?¡def test_m(_:�_builtin(X!):(�g9sysiasys' (C?-inj lsourcei@r = ‰P(unitž)„Çtarts_with =ß*•' from '"26end0€__init__?>$Úv[:len(snG)], ,` â'{!r} does not5 ±©'.format(rP)ã Î [-�ÉU):], Š?endˆL)ñ @requires_type_collectingö 4ýfinalization_at_shutdow@1# MeÑ globals and )ôins should still be available during W„r°rc, out, er2ñ_python_ok("-c", "F� import °?_a"s–False(errplines =la.split(! ?Aset(%E), {°´Šb"x = a"¶bª.4b<�len = lenVI�il.rmtreek #"}ýßý descriptor_errors_propagat²pclass D10ðMq__get__æg, o, tU%àraise RuntimeEo8]"M(>KType@@melo퀘R_(s(`ð, getattr, M("mymod"ÊN #P1zen¬¢namespace .¥Qs areDbed in eÀlib. if __7¾Â= '__main__'&¶.ñ() # Copyright (C) 2001,2002 PÖ` SoftwpQFoundrð # csv package SŽ2s ‹T copy 4sys * !#ioº0 Sto"IO@temp TeEtaryFileK4csv $gc dpickleF$stB0sup‡”itertoolsapermutÚs#„textwrap"bdedentš%onAÒOrderedDict ;Tá5CsvP.4CasI""" 0 thFPderlywC_@rserà‘ways thatøâ apQriate´PFðhigh level interface. Further tests oñ#f this nature are done in TestDialectRegistry.1"""ñdef _test_arg_valid(self, ctor, arg):*Rð.assertRaises(TypeErr+1)+o, None1ÿarg, bad_attr = 0>�delimite?0O'XX'� Gcsv.Lo, 'foo7 R7¸=6#@1´ }¯quotechar== ïlineterminator¿$ E‡ Ä?ing€#Ö Xî°QUOTE_ALL, 3'îo)BÜÛkreaderâ × Ñ9j, []) S wrES 9Ç, StringIO()[„qdefaultæsŽW*args¹Qobj =ª(¥¡ƒ# Check LsòEqual(obj.d#.&O, ',¸5Qoubleñ_, TruÔ8Qescap$ 7 �, "\r\n"Õ=¦ÊO, '"á5Ping, äMINIMALvÿskipinitialspace, Fals(mstrict4ð# Try deleting or chang Áibutes (theyÌ_-onlyµÏAAttr:¹0delM', &5, '(CM?setM O, ':RÀteError, delóattr, obj.dialect, 'quoting') þself.assertRaises(AttributeError, setK@Ge�, None) ,ðdef test_reader_S s(~!):!B!._'sdefault(Bcsv.9L, []SOwritS"9Ç, StringIO()[ˆ#kwƒœ@, ctW*args¸õ# Now try with alternate optionsá kw:Ð = dict(delim»À=':', double£õ e=False, escapechar='\\',I.Ðlineterminato+Ar', I;*:%@ing=aÿQUOTE_NONE, skipinitialspace=Trueastrict#YQobj =0(/B, **ÿ$T}gEqual(®.O, ':²5D!, Enj , k7 zo, "\r";{ÛO, '*à5Zing, ±s Ö , ×=æ3Š Õ - è PÁÓQÑ Ö9�-derivedÜcclass &Ô¦ËA='-': ô •:='^9 y:='$(]>='# ò9ALLv &Ù " ¥Ú3+ ( ,^  …Ó&O, '-(X(^o ŽO, "$!#oÞ ðALL) self.ó"assertEqual(obj.dialect.skipinitialspace, True) _self.=átrict, False) 5ódef test_reader_ip_attrs(O!):)a!._/ (Bcsv.AL, [][Owrit[*Aæ, StringIO()) ¿_—±à, fields, expeñ‡**kwargsËö with TemporaryFile("w+", newline='') as fileobjq@r = ø ()%, m73.-2ow(£¹$Cz.seek(0{Ù-w9(),mM  2 + €Oê§terminator¸TXerrorZ6exc_êW^ǧRaises(excì ý„@7 ''C'l¡_arg_valid šºlWE{\, Nonß0`A((),vãQ![Av], '""'R'äx8squotingì¦QUOTE_NONELð# Check that exceptions are p²åd up the chain©Öclass BadListBÊ•|__len__2¥return 10;Q:sgetitem>7, is&Šif i > 2zrH1 OS†b7',ÍŸEæJIteml¬3str¨¥‡#@[Bado/()‹A_big€ ]À# This exercH¶ðbuffer realloc funcáUalityAbigs�å = 'X' * 50000 :˜2, §¥%s,%s' % \<G (2%, &Vb&À ê�°'a',1,'p,q'ˆ�a,1,"p,q6 F©# œ\ÀUOTE_NONE)  òself._write_test(['a',1,'p,q'], 'a,1,"p,q"', 3õ quoting = csv.QUOTE_MINIMAL)6k?"a"m%¯NONNUMERICp?"1"ß#/ALÛ `\nb',1CŸ"a\nb","1DeA@def  «pescape(S!):!–Í/\Ÿchar='\\'QRerror2óE&, =_"q"']2¯' kÀNone, doubleOe=False~ ªm¬\\"q\\"n zå z? = |ßO '""gÛ*!o/\\Õnœ… œ1ONONEòœ_p\\,qœ êyI jiterabll)”B 1, @)AÚ = ]<�7+'V/""-Õe>>=öé<Ñ- „?$, E_',') nLrowsÕöclass BrokenFileïs®¾7W, buf"�raise OS§x8rµ (h+()°passertRK#s(L", 8.`ows, [#]]áiÐith TemporaryÅú("w+", newline='') as fileobjâZ ¦)¡fz ¥ATypeó§Àr.writerows,‡ None) rwriter.ðows([['a', 'b'], ['c Jd']]7êfileobj.seek(0ôself.assertEqual(-ðread(), "a,b\r\nc,d1") “•def test_�°_with_none(U!):(¾ó TemporaryFile("w+", newline='') as {9=ôc = csvú¤ ʉ#G?, '? ¸?ithõbèð/'a ;0'""êa'éjá1, [ðò9'ãîéñ@support.cpython_onlyá ìlegacy_stringsi0t _>BcapiPJ6c =™.unicode_NF('a'÷Yfcc<TZ_~">÷ , input, expect, **kwargse2#er( (6.±jâresult = list(.W¿ /üù?A_oddn ïMÐ[œ¯ 'Ì[b$¥pRaises( qError, a,åé p['"ab"ca6 , £c1þõ# cannot handle null bytes for the momenti‚Ÿ2Oab\0Ÿ mï(Ôóbc']], doublequote = 0³@­1)b'®") É 1eol©� Á"a,Àà['a','b']])  ñself._read_test(['a,b\n'], [['a','b']]) -? 0r2b üassertRaises(csv.Error,", °Arc,dQ ªHnH4(r\J=@def bl@eof(K!):^ Š"Õˆ/ 'ˆ %"a-± ^(´û], escapechar='^'ê@®ï], strict=TrueP'ÐO2ei "['  ÇC Å:ÈS\\b,cw`a', 'b;c']v,\\�/9›\IFb"b\\,c¯] H?,\\H3Lc\\"‘" y"b,c"\\k ,cÜÔquotingÕ“1,",3,",5l1Ò0,3,5« <":3 D,¡ °§´JNoneÅE }3@ing=˜¯QUOTE_NONE…õ'# will this fail where locale uses comma for decimals?ýz“5",7.3, 9�²', 3, '5', /]]@ Ã{NUMERIC³ ‚“"a\nb", 7u³| _ValueÅéÜr['abc,3nÑ ÓdÐdef test_readó_bigfield(self): ñ'# This exercises the buffer realloc functionality and KW sizeIulimits.q = csv.1_1_%()'6try�–&… = 50000&úbigstring = 'X' *‚#@line!¥%s,%s' % (8%, €7ð._read_test([bigH@], [ w?*]]AäÉ 'h.AÏassertEqual(y!), |*£*-1)d RaeqError, * , + ,­ICTypeI�o, NoneŽ E1Hkfinallg�(�!) w@def îä%ge=6 it6r< ¯"nonesuch"~ ò"un5$erø= =ÂCÉ" ÇŠ AG0Ïo, 0, 0a ”M™� oument=Åsquotingo/[Ï × Ï*°myexceltsv(Ÿ ôJålimiter = "\t":@nameD„expected>s =$`() + [G]U 9f.sort(÷§ g(D&, ‰/¶‘ddCleanupæ7B 6fvlqC).def, '\t'@%goÍúÃ!ed| %&()3©s (, W!) 4 è_er_kw¾à± = 'fedcba'<ÞÙOÞ7=';Ü©RPu�[['X', 'Y`Z']], [dðreader(['X;Y;Z'], þ,))3¤incomplete§%Z'0»8tij”ÐBspac˜Àect(self):  ò class space(csv.excel): ùdelimiter = " " quoting = >©QUOTE_NONE%‘escapechaBE\\" úwith TemporaryFile("w+") as fileobj�ð.write("abc def\nc1cÕ1 benzene\n")fÈ9jseek(0AreadßÅ (0¢, dialect=%):òself.assertEqual(next(C@), [¡Ÿ", "def"];Ó@ÖDÖÃdef compare_¡P_123(�Ñ, expected, *(¥args, **kw/):…û, newline='', encoding="utf-8£•geìO O’Dç«row([1,2,3C¤.Ô  š-�&()%) REtestOQapplyQ0(A0&\t1=B=:<C<|<?Uni>g\u039B©Ë„register# (' AC', ß:try¶�°"×-\r¯2a\t2\t34zAz;4:2:96=»/B(×°<|2|C†<;2;C†)A,Ë�O=';'uÒ2p¤3Uni0›kfinallì*/un,>n5badO¹lõ# Unknown parameter±+ÞñRaises(TypeError,‹æ€er, [], d0att’ùÏ# Bad valuesX#‰v = NoneŒŸD/-1C.<100c2copÈÀ): f÷or name in csv.list_dialects(): ! =+%ge*(C),ðself.assertRaises(TypeError, copy.#, T!) >ðdef test_pickle(F…f®EYPprotobrange(‚÷.HIGHEST_PROTOCOL + 1’©ïKUdumpsò!, qð ) class TestCsvBase(unit.3aserqreaderAZQEqual%ó , input, expected_result9§ú with TemporaryFile("w+", newline='') as fileobjûq.write(l ð!jseek(0³7 (01 = D³�fields = Ÿ(B c<o3hËI^v   4‰Orows�*ð.W/()2¡DaExcel(�²g½P = 'e#'nÏ^_singÖ’~ ב'abc', [[ ,]]#OsimpM’1,2,3,4,5Sþ1','2','3','4','5'aPblankb㓱[ §bempty_�I,Jo['', '˜FoquotedR#""SçOa_left_³Z®­ __righ_,º,__ ¹["eRsSUV inP¨Ba""b½ ÁU«Àal('a"b"c', ñ"[['a"b"c']]) def test_quotes_and_more(self):$(÷.# Excel would never write a field containing '"a"b', but whenF@read#õ one, it will return 'ab'.,�./äerAssertEqual(\ËbÈBloneÍ ÃQ¬P"Q VO "b"!8* , Ò í_spaceÔ*0 "a»1[[' X"d#Oõ1,2,3,"I think, therefore I am",5,6',†�[['1', '230? 'q<5g6xûzð""I see,"" saidÿ! blind man","as he picked up his hammer and saw"¼( —–p? '¸H,nlFÝinput = '''\ : : :µ 9,8,7,6'''k±‚‘@4 'k.\nÈln*\ní/']¾ÿ ['9','8','7','êdubiousë‘2,12,1",'™1¯T' =nul›y l[], ''Ôrsingle_/ PJ@['ab!,�_c\r\nX/mpXB1, 2U€', 3, 4]µÊabc,3,4lXs½e0"bcWð3, 4]], '1,2,"añ&""bc""",3,4\r\n') def test_quote_fieldsep(self):#'ó.writerAssertEqual([['abc,def']], '""c�newlines]ñ1, 2, 'a\nbc', 3, 4gQ1,2," Ðð class EscapedExcel(csv.e Ìæ`ing = ¡QUOTE_NONEée:Òchar = '\\' SITestWsCsvBaseYšdialect =€ fcg-Pabc\\vg_read_i) ÐÎZ), á)Dñ_Unix( k'unix'mrsimple_Q¡´'#bcv01",z "átõtà/'"[1„v 5']]$QPd6s�NUMERIC“cŠ / Ÿ‘<* (li) ¥ì¦h�zƒ QDictFÕP(unitë.C»ð ### "long" means the row is qer than¡number of *Qnames©EWshortFòre are fewer elements iKbX J’c_·Ldictµó with TemporaryFile("w+", iö='') as fileobjÎÒ^é–&WÞ(-,áÑ = ["f1", "f2A3"])÷JN"zheader(!Wz.seek(0]aW-ü2 (){p1,f2,f3ô"A~Prow({®@: 107@3": 2*"}5e’�2 # Ø ÷º ¶@10,,¯Or\n"nPmultiãM_row Ž· = StringIO]üÑ ÈÀobj, fieldnaámes=["f1", "f2c3"]) qwriter.vheader(ðself.assertEqual(fileobj.getvalue()WÆ1,f2,f3\r\n"=SZprows([{ˆ0: 14ƒ2": "abc’u: "f"},—ž=2=5 3FWxyz"}Ó¶i'"fÏp1,abc,fÚp2,5,xyz 1") @‘def test_ë°_no_fields(‚!):$Â6¿ = StringIOdñ Raises(TypeError, csv.DictW¦#, J€}r_not_in‹Mname�ôwith TemporaryFile("w+", newline='') asmÈÌë;r =›£1eldx? = z Nñ# Of special note is the non-s-ö key (issue 19449bBÍp¨DVžEË*cxÆ:TúÐrow({"f4": 10YŸƒspam", 1ª}zõexception = str(cx. *ŸAIn("¨"?", 3O'f4'-0Notc?'f20-‡·Û@typoO€extrasacñ!_r© _e¥í,©î�, ['f1', Ö]$ ¥!="¦d­… ,_“ÜÕ ¿ ¥6ðdictrow = {'f0': 0ø!1'70: 2a3': 3}¬Íc  Yó", »#, vX+oignore,Wp-/ V(Z^?1,2Pread_b”�¹ñ ¾¹P("1,2§|ð filçeobj.seek(0) ñreader = csv.DictR@(fil4,-8 ñfieldnames=["f1", "f2:3"]pòself.assertEqual(next(†@), {?R: '1'DA: '2 Á3": 'abc'}) ”�def test_<–_dict_no_Š(j!):,­ó with TemporaryFile("w+") as í-1ð .write("f1,f2,f3\r\n1,2,abc "ß5k I¾(-Æ P76er.1/, ¼@Q# Twonð$ cases to make sure existing ways of implicitly setFm� continueKñ work. Both arise from discussion in issue3436.Mÿ^_@_Œžq@½Ñ¹/))P /@ D|I¼-½\chain¹i¹±t itertools•Øœˆfirst = ;ÌÐqfor rowóí.[=3], s °= ¢*æH/ow�'Llongз-ƒo,4,5,6‰;ƒ8î1 Ž °None: ["abcr45Ð6"]}) deóf test_read_long_with_rest(self): ö TemporaryFile("w+") as fileobj-4õ .write("1,2,abc,4,5,6\r\n")\/jseek(0Ÿóer = csv.DictReader(c,IMð fieldnames=["f1", "f2"], îQkey="ø —ò.assertEqual(next(‘@), {JR: '1'O_: '2'�¤xp: ["abc˜45a6"]}) à/de­F_no_à»=Pf1,f2³ÄI‡‚.õ(, Ö @Å…OshoriO¶Á Ý@.tQÿ"1 2 3 4 5 6".split()*¡Ëval="DEFAULTÆÞ$1"¢2 2¬3 ?abc­494C5 5 6 ?6'}v˜?!”žBr "Ñ=�\multij©sample = [qñ'2147483648,43.0e12,170def™ ‡'0/ ^I,170\ Œ]NDWÆœ}õ="i1 float i2 s1 s2ä©i- ´"‰b=À  Â"i2": '17', 0"s15?abc6kqdef'}) nñdef test_read_with_blanks(self):%‘ òer = csv.DictReader(["1,2,abc,4,5,6\r\n","=A=]õfieldnames="1 2 3 4 5 6".split())yÅò.assertEqual(next(ÌQ), {"GQ1', "2 3[!454?5 5 6 6lý�u! ü�semi_sepù²;2;abc;4;5;ù¼0þßdelimiter=';'ëð class TestArrayWrites(uniti.CCase\…Pint_w, �€import aM¸Mõcontents = [(20-i) for i in range(20)]/2a =A.Gd('i', D W0 TeröaryFile("w+", newline='') as fileobj=¾#Ë#r()ö, dialect="excel"¸:.4Jow(aø expected = ",".join([str(öBa])+xö[�z.seek(0X Ž-!D(), y"¬odouble¯*O*0.1³d³Ü²ÿOfloa`+±f±À with Temp÷oraryFile("w+", newline='') as fileobj: Òwriter = csv. ()ÿ, dialect="excel"):4Jow(aù expected = ",".join([str(i) for i in a])+"\r\n"[�z.seek(0Xôself.assertEqual®”.read(), y!) Tádef test_char_â(D)ñimport array, string<(2a =. D('u'$ã.ascii_lettersp4pwith TeW’Œa€J²class TestDJÐValidity(unit–.CCase�®|quoting«R#myš(¶\B€SdelimÜ*";``escapeu = '\\'î:Pouble�™e = False ðskipinitialspac%:Tru$x�terminato_'æ hb3ing|¥QUOTE_NONEm<ë¿ #d.L,ÇK”I,f = Non·VaRaises]uError, >Rd2 9wµ¤5ALLî *ž"5+?ALLCv_, '"'+Ú7(d.ï�Jü&''|h§&cmš�(”Y0cm.¨uption),XD %'"¡à" must be a 1- ac'Þ4fۈ͔, not intÖk*m¡À lineterm÷inator = '\r\n' õ quoting = csv.QUOTE_NONE%õd = mydialect()õself.assertEqual(d.delimiter, ";") ,@#… = ":::"$Wwith UpRaises(–ÕError) as cm:1ÅY™ ùstr(cm.exception),DH%'"Åÿ" must be a 1-character string'ßÜÈ?b",Þ’¬¿, not bytes·4’ˆØ4intÖñdef test_linetermiú(W):WclassÕdDá& ¯;ó`escapeZ\X`double^•e = FalseY>ðskipinitialspac%:Tru$ ÆfÀJ p,/é + Í5 J,t« ÍB² ©€invalid_Gs¨Ïscreate_(û(field_name, value±Û…Jpass–uetattr(X., r 2 ê7for<W in (\6, "@A", "*"Ò†wsubTest=� 6Ð self.asseû&rtRaises(csv.Error, create_invalid, field_name, "") Ÿself.asseM?abcP9Ob'x'Ÿ8ð5) class TestSniffer(unittest.aCase):ùHsample1 = """\ Harry's, Arlington Heights, IL, 2/1/03, Kimi Hayes Shark City, Glendale 5ò12/28/02, Prezence Tommy's Place, Blue Islandh3õ.Sunday/White Crow Stonecutters Seafood and Chop House, LemontR!19…×Week Back """2']'s':'‚':'IL':' 6':' E' 'S K':'G;Ý4':'2' '1':'ú: ƒ#''+''2':'\!5':'"'#`header(ð '''\ "venue","city","statd÷performers" '''eA3 = B005/ 3??5/0  -Z6$¹º4ºû2147483648;43.0e12;17;abc;def   8E;1706 l5‹ðaaa\tbbb\r\nAAA\t 2BBB º6/@|b|c#Pd|e|f #7#°'a'|'b'|'c' 6'd'+ñ2 # Issue 18155: Use a delimiter that is a special char to regex: +'Jå'+'+'!+"'/+"'8¯‘+‘S+ IL+‘+‘+‘5�+‘+‘ 3y‘+‘Rp%+ on–9‘0'+ ’$+ “/+ ”`'+' ILD — +=!š$+ ›Ûà12/19/02'+ 'Weñek Back' """ def test_has_header(self):#òsniffer = csv.S&() óelf.assertEqual(1.Sÿ.sample1), FalseB ¡@1 + ¤QŒ° _True)ëÿ_regex_special_delimitN8.2?8),ÿguess_quote_andú'Bfor –ø in (";'123;4';", " "eµCwithÙrubTest(Z '+¤dialect = m1f, ",;"`25ªG.ù_, ';'9B@charîr 5Is(oQouble< ¨¬:õskipinitialspace?ÿÍ C<Èž TGkh  ö?L'",G}D''"}1æœ‹Ê 2åh/":Ê/"'1Êgωsœ 3 ð # given that all three linesßÁp3 are eëv“# I think=0ny Óñacter could have been '¡ed' as theî¹%# ëõ, depending on dictionary order3¾&InbÊ,Q{ëƒOs="?ÍÀ'"?p/p/pÀsniffer.snifóf(self.sample4) öassertEqual(dialect.delimiter, ";"1 ± = sniffer._5._/\t`6`|_7_(ð€quotechaO'�8�6'+'1®9.¾  _1 ïpñdef test_double$8!): “M¢er = csv.Sc(£Ñ vheader1. VFalseÞ‚.\2.\8–\?Tru·)[C-\@·¢ class NULöçwrite(s, *argsApass"�lines = p @unitQñ.skipUnless(hasattr(sys, "gettotalrefcount"),Ok ì'requires sys.7C()')¸¥TestLeaks(~CCase¸Ñ–Ì_create_readç•delta = 0Ž`lastrcW€(ófor i in range(20vÎ`gc.colÃ6°êægc.garbage, []Ù-Š(¥àûer(["a,b,c\r\n"N&9:2rc-3�U = rcA# ifN©0) lÀ , - Põshould be 3 or more@ 93P< 3, ç!) + ÷¥ø7ø7NULÕ Àc.collect()  ÷self.assertEqual(gc.garbage, []) ,ú rc = sys.gettotalrefcount((Ïcsv.writer(s/ùdelta = rc-lastrc”W# if …�) leaks, - Põshould be 3 or more@ 3±< 3, True) +àdef test_read(5!):435= 0õrows = ["a,b,c\r\n"]*5œa÷for i in range(20uyœgc.collec–¡ë>Qrdr =l0er(æ ô±1row³&dr"­Epass;ñ�ë€ during ,ò5ò5òÞóx[1,2,3]ï 7NUL:£  õ>ows73 owD C$X  "ðclass TestUnicode(unit.bCase):1@nameøù["Martin von Löwis", "ýc André Lemburg$ýGuido van Rossum!òFrançois Pinard"]‰ºu³Âú2with TemporaryFile("w+", newline='', encoding="utf-8") as fileobjéæ‘(",".joinD.Q) + " ý9jseek(0à*er‚0 ) ýRlist(?A), [ ‡?]) %;±s&<dÑ (ÑN1row—H Jðexpected = ",".join÷(self.names)+"\r\n" ùfileobj.seek(0);ÄassertEqual(-ð#read(), expected) class KeyOrderingTest(unittest.qCase): c@def #_o/à_for_the_dict_aÑer_and_writerÇ!):<¾öresultset = set(¹÷for keys in permutations("abcde"EIó+with TemporaryFile('w+', newline='', encoding="utf-8") as 6ect—Râdw = csv.DictWÂ0,¡³21dw.îgheaderÔC°#'drzRI7tkBâtuple(dr.field-kV fN, ktUžX.add("ù# Final sanity check: were all±… unique?‰ �Elen(kÔ), 120, "Key V`: someo [�not coll¾$ (ÈB?)")£(edš �õdata = dedent('''\¶;ÂFirstName,La ™Eric,IdleñGraham,Chapman,Over12 YiUnder1;¦John,CleesS ''').split×#s(æBYDist(¿Eã9)),h[í edæE([('è@', 'Öd'), ('õç;')]I I  K'LÓ‘(None, ['@‚ ?2']„e „]I› G'¬]¦!ÿ, restkey='OtherInfo'»¡¿Â²@del G5[0] ò # Remove the üE rowjŸ", ÀÀames=['fname÷', 'lname'])), ñ[OrderedDict([('f'Ã, 'Eric'), (:«, 'Idle')]B BkGrahamDŒChapman'E“ð (None, ['Over1¾ ?2']}0Und; ÁVB0Joh§_Cleesô]) class MiscTestCase(unittest.!):}@def Ã__all__(selfðextra = {'__doc__Ñ__version__'}F+Øsupport.checkOP, csv¾1csv?1), \=µPif __óÀ__ == '__maic©Áð () from xmlrpc.server im�± DocXMLRPCS ´http.client4sys ’threadingYPÙ*‰ <ómake_request_and_skipIf(condition, reasonU€# If we 'A the},€have to R3 a T� becauseg#2îñcreated in setUp blocks expecting onQ�come in.Cuif not Ÿ]Àñreturn lambda func:7ë decorator(Ð:¶  N-a‡.äÁ("GET", "/")n(,Êgetresponse(&draise —P.Skipå(xRáª%!è ãu(ö, =jò(("localhost", 0), logR‘s=False) k6tryzp# Add s§�documenta;*prv.set_x«er_title("é ö”BP;DjCs: ¤(¥©ð"This is an XML-RPC yYer's 8X, butÏ"Iðcan be used by POSTÓáto /RPC2. Try £add, too."\‰1# Cá and register eždÛesxEC@s(objectòUìq_methodâ[, arg(,1"""“+1s. $ú truly does very little.""Ní@rg =oG4rv.ãq_intros0on_©å3�0pstance(ªø)Hï‹add(x, yâ0"""·btwo inE£s togetheræðfollows PEP008, bu÷t has nothing ô%to do with RFC1952. Case should matter: pEp008 and r( TOsP’hat startUAhttp64ftpTùbe auto-linked, too:E5é://google.com.9"""Õreturn x + y údef annotation(x: int)iÀ""" Use func&1?s. hdpclass CUWithAo g‹wmethod_’ëself, x: bytes𣨖.decode()yäserv.register_¿U(add)$ÿlambda x, y: x-y1³+Ÿinstance( &()6Ñ™¦fexcept,.per_closó rraise rðDocXMLRPCHTTPGETServer(unittest.TestÆU€`setUp(tU’# Enable u‘ feedbackž!ibÀ._send_trace(è_header = TrueŸ!lfÉ‚ = make_`( ‰¢.thread = Qing.T�(target=&<MŸe_foreverG.v%{PORT = EÅr_address[1]è$�client = €..bQConne!ð("localhost:%d" % e™gŒtearDownja.Û~_# Disˆ3UFalseYv@@hutd˜<Ljoinž8ZŽZèÿst_valid_get_response÷ örequest("GET", "/"Œ@¯}4getÙ×ÄassertEqual(%†tus, 200]/2getÂó("Content-type"), "text/html"ß"#  �Rs an Åäion if we don'1to â�the data?H±ÛX/inZ,Ospam^H?404^2Xplain_ º c0"""ï tz#ÐÀtionality stóays the same. The output produced ñcurrently is, I suspect invalid because ofRðunencoded brackets inQõHTML, "". ˆÂsubtraction #õ method is tested.15""" õself.client.request("GET", "/")(¸response = 34get&()“#òassertIn((b'
'sK*b'3#(x, y)'),H¯s.read()µc@make_ÿ_and_skipIf(sys.flags.optimize >= 2^ó"Docstrings are omitted with -O2 and above[1defŸÐ_autolinking(>%):À°"""Test thaðe server correcd=õmatically wraps references toLAPEPS…BRFCs—v!s,b0it 0ifi;Áext starting0K°http or ftpëtocol prefixesŸ‘documenta¡0forÜd "add"¨rcontainb²Ÿ material¹O Àó‹ÍÉÂ?addœ,ddáòb'Add two Pinsta¿’together.BThis 0ƒb'follow�\ntÂd ¢AŸ¡rfc-editor£ÿrfc/rfc1952.txt 0RFC¡BCaseaSshoul[rmatter:bpEp008 ¡#an3r[W.Têsë#ha $! Oð†%c2ftp«b¿ Kê-Ÿ#ed�Btoo:� M¯google.com5Š6://$?�
'OS b'(D_Y0)\n# cReturn(aQ+bstring ucontain�documenta1#2for O2the’specifiedK0./Gk/dl>\nÀ P ÑŸSignatureÖ Ê S}�ÛY-">R à)hå‚[double, S3intBint]Ê+ ÖBlist OudescribÔ§P9"of (.Q'Ij2the—CabovUexampáQ#ad SkYCtake³òa1argžsP’nprg„ rresult.6S3Thi}Sserve $do²2NOT@csuppor”% S©6 #D'), ò def test_autolink_dotted_B s(3%):Ür"""TestÉòdot values are made ø SÉmatically in .EûbÈ#ry[sØ5addï60too¡,0Rn Y2nnoðM Na)ÿ works as expected "FÉ2docºð = (b'' if sys.flags.optiÿmize >= 2 else ò b'
Use function`annotaås.
')Oåself.assertIn(m(^öl>
#'Ný b'(x: int)
' + docstring + b'
\n7, , ¤“Rbytes•ƒ9'),ºð response.read()) if __ñ__ == '__main__'::�unittest.ð0() """Test suite for the cProfile module.""" import sys from tG1supDrun_cð, TESTFN, unlink # rip off allpPeresteestuff W"_p€t�yÅ' ~¶Ñ÷ , regenerate_expected_outputF¿ä.script_helperO|ú_python_failure, Çok class C€( ){Ôr-=e.+ %y &É3maxÍâ = "{built-in S ¡ins.max}" <|def get (g¢[ƒreturn _•O2BÑ# Issue 3895.T‰àbad_counter_du8Œ_dealloc`«0_lsëFwÑ# Must use a {Aas S‚òIO doesn't trigge¤2bug…?Ðorig_stderr =£. `2try†.¤with open(¦q'w') as~ ,03sysT! =#[ ccobj = òî‚r(lambdax M8†.enable(Y1.O.disP o.clearpkfinallE‰ Œ×>€)¦dQ21862?d€_path_op9 \ # û± -m switch å8s`²'Gthat,ñneeds an argument~0 ñ„('-m', '› 3-m'Ç7g0\Ãnot-existent\f"±, 'random_m¡O_xyz{ïsuccessful runj/okË‘, 'timeitÛÀn', '1') dð ef test_main(): run_unitø(CProfileTest) def ,òif '-r' not in sys.argvIME^]Felseðregenerate_expected_output(__wK__, ƒô+ # Don't remove this comment. Everything below it is auto-l¯d. #--cut-6# _(O¾[ = {}ñ['print_stats'] = """\P 28.50.0 /01pŽôe.py:110(__getattr__)K 92270B A1.00 K025(©CfuncGB23/3>!155S0.007YH057 GÃ35(factorialH4 2? Ú)01HV48(muB" 2x$040K6ÑY0.300B•55(helper‡" 4E2116 2029 1N*03E#73E1F‹yS50.1�7F#84F¦2_indirectOö$31X3•4a5O8O F#06ä#00X$0821Fc98(sub#?"""¬gcaller®î €N"<-w P ” ŸNj îù :1()e ½` e#01tI130 ƒµ›D%20‡` i7i ¹j&„™è"ÓˆË!¹HDx P Ûái j B9P ®jiæ]P¹ ~[pg/&~gð8(helper2)  #<-6R0.234 ð 300 profilee.py:55(helper) "$28R0.078 1g#84gÈ2_indirect) ˆc98(sub‹EØh#06Ø+08Ø$88qñ) {built-in method Ìins.hasattr}mh_Ðz 0.004@#73h1A*Ðh8hÐ Ísys.exc_infoÌÜÐ 8Ð{/ü 'append' of 'list' objectsmh"b""" _P”ð$Output['print_callees'] = """\ :1()à#->1P0.270 01.0k‚º25(testfunc›�110(__get+/__q)->ÐNq ž#01q+13˜Ï35(factorialj*«4<0.6 �Î2 Ñ@20/3#!0.È9:147Ñ P|(2È0 ºj48(mulÔ¥ Ô44 Ë1…1¢™lR  ÒÉk <}U  ÐU­ñ`DAªÙ}Í ˆü|sLä0'÷5 j3‚à88(helper2)  #->8S0.064 ÿ80 profilee.py:98(subhelper) >j 1690.0 Pñ110(__getattr__) {built-in method pins.has%}Sm2m m ð""" if __name__ == "__main__": P ò() # line 1 def wrap(foo=None)(ƒper(funcCpreturn SFDper \7\xreplaceD[pinsteadD([èprint('hello')^1b@13 @v#() )w 4ped\Fpass739 @—,Ogone)õ24 oll = lambda m: mFH27 tµg: g and \ - 32-iKCd: d.Sd*6”0one¡  À!39#ñ manyargs(arg1, arg2, arg3 :4):6!4365twoYCm): ½m�à€47 a = [,ŠCx: x]¼!52c1set¸Üò globals()["anonymous"] =E1g¦x, y: x*y)ZMñwith_comment(): # +ŸFworlH€61 multií@_sigË'e\s"+yØBNone Ý!68ÝÕ$69/²class cls707Jà'$71'Ç v9Õ extra74 = 74ò7H7ì<(,ó8, stuff78) = 'xy'E9Ustop'I581 ¦"82¦¢+83Z#84Z*84Z/85Z•£$88ë##  ]è%90�9$f0œX˜œgQ"doc"RZ!42"X eÂ_in_dynamic_a = f().g #2 10ú¶keyworded(*F#=1¶s25‘annotatedwo: list/¥a±_only_arg(*ž 2Ę : |ÄY4114 äC115 ÒC~QWithM[D@S(selfj3ÏAfromwÁtools import!s â‰decoratoø¤sÆrg5fak9a¢ ”%wE29 @`nKrealâð20 #line 134 clòass cls135: def func136() 7ánever_reached1E ñ,2 # Test case for DynamicClassAttribute # more tests are in ô_descr import abc 4sys @unit:à from types 1n c~ó PropertyBase(Exception[pass )HGet(5+S+?DelV ¢2s(objecty¸Ó__init__(self‡±._spam = 5 £@/K- G5"""}¡.getter"""N7vreturn miK!.s/, _, value­H~deleterIB9del†â2Sub7Ä"):Z¡5 = °.__dict__['"']'@ ø€ 4"""m/ 'EaisepG2)j3rSoS> M‘ MMú0Doc7 ‹j ïA_get S4Ji/ =(Lq, doc="-,")©eDocSubV²/8=Ž–ðThe decorator does not use thisºy stringB oqSubNewGL(yÒ ÌÆ/0newª©5l� œl#�originalƒ d›Õ 8Õ\ôWithAbstractVirtualüQ(meta Ã=abc.ABCMeta�ó@.aTemethodOXcolora{‘‚ ™‘ vÀtmethod ñ@DynamicClassAttribute def color():ppass c.ð PropertyTests(unittest.CCase6G#_p/ñ_decorator_baseLS(self1gµ# see #1620{-q = Base®%()>Ð.assertEqual(,�.spam, 5' _(>F = 1�f /10g)qdelattr®0, "ˆ"GÎTrue(not has23î&")4íní 2í)¥Odef ?subŸsub = SubtRaises(ž€Get, get8_, subj =S=s=f, NoneF/ CSDel, ê €@9ñskipIf(sys.flags.optimize >= 2,. ð"Docstrings are om‡ód with -O2 and above[‹L_doc“{}asub.__ÔÐ__.__dict__['à ']toc__, "È¡.getter") äyÊ’á ¹ �0DocY5L 8Sub>elfTÂé x¶&+NX*wº0œ_override92new&BqqSubNewGúw ?Ó /®Àam'].__doc__ó, "new docstring") ñ newgetter = PropertyNewG((õself.assertEqual(9�.spam, 8,ð__class__.__dict__['@ ']Ooc__¬­£def test_p¦ð___isabstractmethod__descriptor(²!):<ì÷for val in (True, False, [], [1], '', '1'48°› C(object!™colPqreturn _* @o__initw<• = 'cyan'EZý© J .�eÁ%"()',wW2W¢À self._coloór = 'magenta' õwith self.assertRaises(AttributeError):07µOkay2.colorCaEqual(%"()',zð) # Issue 5890: subcl~Ðs of DynamicC†ñ do not preserve method __doc__ strings Hß PropertySub(OÐÅ"""This is a†„N""" a_Slotsf8ð that defines __s` __}{_ = ()�ðTests(unittest.qCase): °@÷skipIf(hasattr(9Ø3, 'b1'),;„"<blready�6nt,¶ñ will have no effect")I@def �á2docÄð_copy_exception(X¯x:tryŒð· Foo(object,0@×��Lspamn -�rying to ¥ t<¹ìr?E an ºD�return 1�°print('\n',”.j7B[ £ EpassYJelse¦Ee"Lk$?d")3úsys.flags.optimize >= 2&®$"Dà€s are om›!d ~Ü-O2 and above` ¡þ ú‘ñ 0"""|¿ wrapped in˜¼æ âÌg$ ”0Fooìpict__[' ']á WœÄmp�p_setterÊRies_gâÝă__init__;É_<+ =[ r  û@². äà`, valuÆÃ;"""�Öðgnored"""  ôself._spam = value µfoo = Foo()/ðassertEqual(foo.>6, 1&O = 2;2; a@—àFoo.__dict__['x ']Yoc__,*"ð wrapped in DynamicClassAttribute subc"‚÷™Sub(Foo):YXy Š (@)y.setter@def (ë,t dëù"""another ignored docstring"""S0NÉe'eggs'$bfoosubÍÖí6 Ð?subÓE = 7[A ˆoHÃmFooSubWá1lú@unittest.skipIf(sys.flags.optimize >= 2Nž$"D„€s are omNód with -O2 and aboveRîoñ_property_new_g Õ1): §m‰{(object%#@PR5Sub48sa 5 ZL ‰return 1WѺ p?newt0ý J "a dvIOBaseMo�2_” ¥½­ÿg –™ò if __name__ == '__main__'k£ðJ() """Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCasesW` from  ².support imôs_resource_enabled „tertoolsebisect Dcopytdecimal%sy5o dpickle#drandomdstruct ¹Tarray² kDatorðlt, le, gt, ge,ñ eq, ne, truediv, floor ð mod from test import sup# Ädatetime as r_module=AÀMINYEAR, MAX &S_delta_zinfo/im{U?zon©,Äà4Ü_ ö_ñcapi # Needed by)_H-"Q_strpò# pickle_choices = [(%, }roto) Pfor p“ in range<ó.HIGHEST_PROTOCOL + 1)] assert len)xC) ==p<×ðAn arbitrary collection of objects Dnon-ò€ types, ¨!Àing # mixed-ð* comparisons. OTHERSTUFF = (10, 34.5, "abc", {}, [], ()) �µXXX Copied • _float. IND Ð("inf") NAN =ÎÏat("nan") #9Úçöás class TestMP(unit.qCase): Ö1def5ñ_constants(self):÷R=‘U2.ádEqual(4.b1E.‡{, 9999)¡Ìname_cleanup¤ if '_Pure'�a!__Q__.__;_Ó´@skip¡('Only run1`Fast C&plementam'‘=à tT@set( Y ein dir$Zpif not 1ö.startswith('__') and7endN allowed = ƒ#['äC', '– Ê%',ù‹'+#P_CAPI4 ! ÙIt2&']¬²AøCs - Å,Ä]€�¶ÿdivide_and_roundÏ3c Python r,._¬àÏ ÿÿdar(-10, -3), 3)*a5, -2)Tñ# four cases: (2 sign'Ia) xb` 7ƒ?, 2' -(-) 7Øà-2) seólf.assertEqual(dar(-7, -3), 2) ÷# ties to even - eight cases:&ø(2 signs of a) x bAõ/ odd quotient)B/se’R10, 4‘� (-)/-2R-S*T+6¦({16, y)-*£/ #9ò # tzinfo tests class FixedOffset( "):-Ðdef __init__('1, o(², name, dstF=42);âif isinstance("W, int$ýò = timedelta(minutes=ú SxVY\Ú2.__s# =ä Ç __ò! =ù T& =%BCreprBbreturnþ_r.lower(š;2utc–~dB @(u tz°7&5?dst2í@˜PicklableI NR=NoneS d4W.šøN¯__getstate� ddict__áv_TZInfo¼Q Ÿ0ateËw_module¸¬rrandom.$()aCTestd@unitž.0CasE ñ_refcnt_crash_bug_22044¸qdtz1 = ºR·td©ö(2014, 7, 21, 11, 32, 3, 0, tz17Bwithªb÷Raises(TypeErrorzf.ƒÂünon_abstractness¼ # In order¤‘allow sub®¸Pget pwñ ed, the C implementation3Š�# wasn't ¡O;Qaway Óehavingå rØ=DNotIY!edë.puselessgW¹wTdt = fE.max5m Ed#, \.È?, dXÐRaises(NotImpólementedError, useless.utcoffset, dt) ÿ self.assertRaises(NotImpF#ds@Aðdef test_subclass_must_override(]!):+o#÷ NotEnough(tzinfo!%T�__init__A$, ¸Kname.2f2.__&# =/v#'E0 = #ƒTrue(issÑ®#, ¯<Gne =Ïö3, "NotByALongShot",cÕIsInstance(neW Žÿdt = datetime.now(G¯ Pne.tzãí"/ne.,?ne.)anormalØÊ±fo = FixedO£(K_ThreeB&foBæ›for dt inFf, None�,˜†Equal(foý`(dt), ‡ödelta(minutes=3)’E€B"Ì52dst2tB42))$"vÍpickling_basmô# There's no point to 3Íõ objects on their own (they�p# carryG data), but.`y needV"beYøable anyway elseD„oncrete Z”es can't =5ed.0corig =¥„.__new__0&¼€Is(type(9³Z*ûen Pproto)Š_choices#rgreen =ã�er.dumpsj!, A ´derived = uiq.loads(I -Ã@ÆÇöJ NP# MakiPre wef»/‘S an i„U of a–ƒŠ…:imeÿF-300Ç\o}`, argsN[²å (P¨ã2, (±Ú, 'cookie')),8 zo$,#š "EST"))]Å© (*©Â¥o.!3rig<(. & ¯Æ\†V 0 ¢2]‹X�� ;Àself.assertEð qual(orig.tzname(None), o 7) õfor pickler, un ƒproto in™_choices:=Hsgreen =(qr.dumps}!, E p3–derived =qq.loads(M1óself.assertIsInstance(G�, tzinfo7 E(typ4 4 EGf¥.utcoffsetMBŒPðdef test_issue23600(ô)oñDSTDIFF = DSTOFFSET = timedelta(hours=1) Qfóclass UKSummerTime()V(‘"""SimpleNð zone which pretends to always besS0u, sincevRùthat's what shows the failure./6"""¶<o G, dt %freturnG1dstJA]?³ƒ'h'IJtz =„1€u = dateÅô(2014, 4, 26, 12, 1Ø6=tz4tõ¶z.fromutc(u¤$¹Wt - t·‚), u) @Test�Zone(unit€.bCase):ÊQsetUpE‚n4ACD…6(ÉŽp9.5), '''©)ES:-;9min=-�?.ax?>Y­constructo XÀertIs(timezoðne.utc, timezone( Ãdelta(0))) ñself.assertIsNot(1?, 'UTC'F_EqualF#öfor subminute in [µòmicroseconds=1)ÙÐ%]:ØßFtz =Zý%3Not¾zþáoffset(None) %Iq¡‡0N¢# invalid :s�Ù ×:1, Í+1)Å òRaises(ValueError®,|� Ý= -ž%) ´^with }2Typ|!):}#:"&42±raZERO, ›x"@~+ã'ABC', 'extra';ðdef test_inheritance(G)œt2Ins%ìN{†, tzinfo46EST0…2utcŒ ƒrdummy =á!DT61ªh{«0, 1.5, 12‘Qµ = h * HOUR=A’PL/ª()ç (�NH--IJ“T²7EST‘&''yB#25) K‹æACDT, Eastern]ä¸0utcH" =+öDT.replace(tzinfo=tz¿1¥local = tzçD („�9#- .,B2utcÆ()Cþ xÇû R¬comparisonNÆ#NoV0ëg(ZERO)VGHOURÃ<�9)9!\-5 * >w, 'EST'ƒÆ`•Î& <%�Î!InA{G}É82Tru{:A != åhMFals13== 23Ädaware_ È#íU thatáõ instances can be used by^bU5t =@(1, ãzF.mináG.max;utc†%+zð/t)ñ t²= Çgƒj#@mOdst(g À t.replañ!ce(tzinfo=tz).dst()) def test_pickle(self): for tz in b.ACDT, øEST, timezone.min&axCGaUr, un Pproto^Š_choices=A–tz_copy =>r.loads(:Ár.dumps(tz, U%))Ä@ÂÃassertEqual(UF, tz.Ftz =Ø5utcH nÅlÁ&½I纡È'ÆDÄe.(;e1d Adeep¢2Ò? ¨nLhâ.Ù / #9à # Base class <ñ ing a particular aspect ofIRdeltaÁ, date and # Aò comparisons. \åHarmlessMixedC!ð# Test that __eq__SÑ __ne__ don'tUPlain ¦mFQ-typem³Q# Subvpes must�ine 'the!',`@(1, ).Abe a„`# legi{«nstructor.fh×_’_ú ³Bme =i vSºù`False(6 = Ý#1Tru"!"E†() == me EB() !"ø hÿIn(me, [1, 20, [], me]N0In([0/]›5?ful4>ÿRaises(TypeError, lambda: me m">m„ðRaises(TypeErroór, lambda: () < me) û self.assertRaises(TypeErro6=7">6#m/ #9ð # timedelta tests class TestTimeDð(HarmlessMixedComparison, unit8.0qCase): H2theI=b1defkÐ_constructor(s!)::…Peq = ‡UEqual=td V6÷ # Check keyword args to iDñ eq(td(), td(weeks=0, dayAhour aminute `second DtVmilli$e micro)]y1zq130, !B$' n,áSt7t#-24%&-60(*Æ** G?100[i6m6¦_float-O.0/7¥ 1R.0/24( ìR.0/60* ,.# .E0.00   2 ` 7B-))«¯mputations¬3aðd(7) # One v³bT0, 60!#c#)Iâ-�eq(a+b+cî7V#, 'À#!-b!À6, 24*3600 -� DÂb.__rsub__(aÍ/ !-aS-p+ €/-1� -Æ %`1, 999 ­1abs¦a-½ 6td(Ë=), 10, ’*;l:, bY1*10ï7·a:10*Tb.1td(n K210*¦: àc*10, td(0, 0,£ 10000)) ÿeq(10*c, td(0, 0,"Oc*10" ‰a*-1, -aY©b*-2, -b-bcIc+-cðb*(60*24), (b*60) ©!M60*b!¨0ª1ç0é Aa//7â 6b//û6Qco; !a!V«0, 7*24*36|Pa//36“¶+© O10.5O*14$b/…2dÛÚ~k paØ× ×õ # Multiplication by float"@us =žémicroseconds=1:‘(3*us) * 2 ?Peq((5b0.5 * D-, >D)(-}-@!(-;! å# Issue #23521feq(td(ï?a123456˜  ¤>b611229B ?5)) ~s# Divis�{int and˜Yû?/ 2÷6s/ 2.0, ” [6!|dv~>€@!ðfor i in range(-JE10):AÊÆ÷i*us/3)//us, round(i/3ªJ-K-LvL’/ (1 / 0.ú.5)S ©U11576t©9’, 86399, 0) -¼ 958),H )o7td(AN1, 1WO1, 0Ngñ def test_disallowed_comput{gs(selfÅay¹imedelta(42!òAdd/sub ints orñs should be illegalzêÁ*.0,zö.assertRaises(TypeError, lambda: a+i÷S6À-i) ð self.assertRaises(TypeError, lambda: i+a) .6E-a) 7ÿ## Division of int by timedelta doesn't make sense.;by zero/ !5= 0@®67// ê8DZeroÇ $Aa //œ*@?-?0.0} Ùca / ''¦ñ @support.requires_IEEE_754Jð def test_disallowed_special(ê!):'#6a =Û?(42– DValupïa.__mul__, NAN6utruediv:‹²übasic_attributes°ñ days, seconds, us = 1, 7, 31JÕ)tdÖ 4¯’Equal(td./( … . Smicro*¸Êùctotal_! öÑO=365r R)"Y53600|Ifor )û in [123456.789012, -"0.–, 0, 1e6]PÔ=g»2•Û‡ /:(),§@û # Issue8644: Test that td.BÕ has the same,°# accuracy 7d /»&1)ã2!ms'S-1, -  þ6=ms¾þš I^carri9-t1U=100, Š�weeks=-7!ÿhours=-24*(100-49)+0minÌ?=-3#j2# DÐ(3*60 - 12) *„F + 1W)t2î ;'x\1, t2S`hash_e =ityœYEÀ4*(100-49),  Ïminutes=-3, "¿ seconds=12#Tmicro(ñ(3*60 - 12) * 10)^öt2 = timedelta(ò self.assertEqual(hash(t1), F2)) G81 +Hvweeks=7O*t2!wdays=7*" qft1, t2C !ˆ’µd = {t1: 1}¦•d[t2] = 2 TŸlen(d), 1xƒd[t1], 2ðdef test_pickling(V%):eõargs = 12, 34, 56Iorig€*,{Afor Veer, un ƒproto in†_choicess=sgreen =$€r.dumps(s!, Ah/`derive7iq.loads(I -â WD |compare)t1ü6, 4i œ …2¯True(t1 <=T">"AFalsE!#" ëýÖ@(3, €), (2, 4 G3, 5Z¸ &Bõ # this is larger than t1r=C º%W2 > t"% l& 2 pL sL&L{=À M' 2 'NÉEVM<2 &1 óQM=NË=`badarg?ªOTHERSTUFFJÓ�"= 9!, …~ |2!231 ]Kc2Ë", cé •ò Raises(TypeError, lambda: ëL£? >#>>À self.asse÷rtRaises(TypeError, lambda: t1 >= badarg) Ÿself.asse? 9o <= t1?(>*>>+»ûÐdef test_str(!):åtd = timedeltaPeq = ++gEqual (Lðtd(1)), "1 day, 0:0"3$eq)-*-+2T2TsU +-,«ñhours=12, minutes=58, seconds=59v�12:58:59ÄBA3@4?2:03:04>³weeks=-30, I3‹—‹3LÁƒ "-210p23:12:3c#fTmilliHr’¯:00.001000šTmicro63É6o0003")üddays=9Ö&59!559,±z |L)))*"6999b59:59.�ç=repèÀname = 'dateïB.' +á°theclass.__%%__¦ (Y.51ÓA"%s(&`1)" % `_00, äc0l2o$ -1p@, 40 ˆ× Û4=MIý#U/60Š+l#b0S$ à/10Ë 1Ñ#wa�€9ˆ#š1‹ <Àconds=100)" ñ% name) def test_roundtrip(self):"ô for td in (timedelta(days=9õ, hours=23, minutes=59,CG asecond)d microV)? ‚-,?999/$, n1:112ä¯B3)):Lã€# Verify7À-> string ->™identity.Ês = repr(td)ðelf.assertTrue(s.startswith('date;.')7‰ = s[9:]MËtd2 = eval(s0gÓEqual(td, td2% ÙÆ` via rÉ`structèºfrom pieceså°D0td.Gi.Ž  §Ììesolution_infoÒáU¦IsInstanceÝe.min, ¨ƒ8/ax8"r¯? šf.max >ª¹®Ô¾(j(F? è(„÷, 24*3600-1, 1e6-1—= �p(0, 0, CÅÝŒoverflowÖgtiny =WŸ)td#`min + :dè@td -Fõny # no problem!ɃRaises(O’QErrorÃp__sub__e/nyT;0add;-—� »Max -»+»0€ö »=™lambda: -Üý)daÜ/(1U�day.__mulV_10**9=&e;qtruediv|Oe-20| A1A#Àdiv__, 9e-10ñ) @support.requires_IEEE_754ñdef _test_overflow_special(self):&Iõday = timedelta(1)*ó.assertRaises(OMÿError, day.__mul__, INF;%-<x¹¸ümicrosecond_rounding¼(td»@ÓWeq = ½REqual7ô# Single-field ].@’(td(milli�òs=0.4/1000), td(0))I<os to 0> -?+70.5}Fs=0)t-eq·-;-< ?0.6v1v;-< 1ì2v ;-<Ú]2**6Û^ 6Y7Z8o1/2**7k?781¤-7-8~3# R-@ duešñcontributions from more than one þõus_per_hour = 3600e6_5 *2* 2zŠƒdays=.4/'2dayøxBDs=.2+,V , 0@ Ï{ʤ-¥-¦ X§B ¨$©þ# Test for a patch in Issue 886y8·�5), 0.5*Ñ.1.‡ …á0.5)//td.resol>J "�Åðassive_normaliza…Æ (†-�ÒP((td.”.b C%),J› €(-1, 24*å 9)Æ=boo7_XTrue(A“&00, ��) Ð0, 1)) ó self.assertTrue(timedelta(microseconds=1)) 3HFals4A0)) (ödef test_subclass_Y@"):(S & T{!):DÙ@staticmethodf«from_td(td7;`return\³d.days, td.Ô å»8]“as_hours(´asum = `y * 24 +¥0FŸ / 3600.0/ ¢4&e6�^ê—round(sumÍpt1 = T(&=1:�úïIs(type(t1), T#•Equal(t1.X), 24g2gC-1, g =-çTw2w 2w8-25xµ3 = t1 + t2yÝE3), †‘ t4¸.H3F4¬ 3 A, t4 NN3 .11 6;Pstr(t 4Ï—4n1mÔ�divisionøvt‰@9æ=1, minutes=24(19¬d < ¯§# /dˆ, 5059.0SÖ- .Ô? ·®­3Z ­$€_, 2.5ª S7, 2§izerotdz˜«ÃRaises(ZeroDªòError, truediv, t, O‰A\floorBö#NEOType~2y�# note: \ \V of a¯÷ by an integer *is*wòcurrently permitted.`´Ÿremainderµ y?s=2þ)r¥# %ñ¨£’/ó3Dœ-Ÿyz Àual(r, timedóelta(seconds=30)) ázerotd = timed)%0)òself.assertRaises(ZeroDivisionError, mod, t, K\>KType6#102ðdef test_divmod(>%):‹t¤·minutes=2, Ø-21Þsq, r = p2t, 7!ƒÿ¯Equal(q, 2'r,G˜âsÇ-È¢"-£,È =S 9¬issue31293ö# The interpreter shouldn't crash in case a¢0 isüuided or<ð# multiplied by a float with a bad as_lõger_ratio() method.FÎ�get_bad_@( .Õ class BadFg(- #'Q x¡,0`return¯¤šu¡çXùøº o7J) / ò‡1 << 100>^(*^Ü6foròô [(), (42, –1, 2, 3)]W•BValu® ô4ø ê™3g- gh"A(?752(pbecause…") H¡s negativek϶# remainder÷Í{Int(int:£q__mul__›{, other&^wg Prod(ž` ÃYOraddZ>SumY¶›_#* 4ÚÞg(0, -1ßVTmicroC0BadP&1)|*mhours=#À timedelta(ÿweeks=BadInt(1)) #9ð # date tests class TestDateOnly(unit.ÁCase): #'às here won't p=áif also run on^ðtime objects, so d/F2subvqthis to‹71o. ,1defó _delta_non_days_ignored(self�¡Adt =HÁ(2000, 1, 2)ID0 = œP(Lõ=1, hours=2, minutes=3, seconds=4,AE Tmicro*5k:aysj|.p%½Á.assertEqual�,Ÿýq0dt2ÝAt + ½–GQt2, d)Bays)JGC‹FtC'?t -†"- öm¾A = - 32 -21íñ öm4•'S0¡(¼ó¼sub_var = 1Èÿ (HarmlessMixedComparison, ÝbshouldÞ�for bothYQs and F s, except %a_Q# fewµas that4ºTƒverridesá2the丬öÀbasic_attrib˜ðÌHù2, 3, 1i ·t.year, 200!J ‘¯t.month, 3N 1dayr¿œroundtrip¸.adt in .¾±mtŸ+ƒ.today() î€# VerifyÁ-> string ->³¡ identity.¨0ªvrepr(dtæ3elf¡ðTrue(s.startswith('‰;.')7‰ = s[9:]fŒkeval(s0gtÀ2ºŽÛÆ` via r§`structê�from piecb6 C$(ddè dt¥ ïñordinal_conversionsߣà# Check some f›ð values. fóor y, m, d, n in [(1, 1), ñ# calendar origin @Ï2, 31, 365),- 2m?366+ ñ# first example from "C™ÿrical Calculations"v p1945, 1çÉ2, 710347)]:4ód = self.theclass())'#ú assertEqual(n, d.toordinal()/¶-or\.3n3 b!d,ý:ord)³if hasattr(Oš, "hour")Ûð # if we're checking someth ù fancier than a date, verifyúù# the extra fields have been zeroed out43 Э.«:, 0Õ2 @minuž4osecondh7cro9Ô0# CA›ðand last days of year spottily aEs6WwholeFTrange2Ås supported.$fªO1in .Ð(MINYEAR, MAX ]+1, 7êV¹ (‹lS) -> Ÿ ׯ is identityw ®M¡*:n =ý ,d2S÷*d2## ߀that movÀAback¸‘y gets tos4enda*-1áiª:> 1)Ô þ µ*-1“3 é2-p33  õL¹9| ¹>O2, 25 }?52*B@3, 3èÙ ²€AH· (ƒ€0) -¾ € p/3day. - !- Q\- 0 S/ .û�V/, ^ 0W , 6Y (3^�Æ ),Ì\ÀrtEqual(c - ¡(c - day),3 õ# Add/sub ints or floats should be illegal3õfor i in 1, 1.0:Sÿself.assertRaises(TypeError, lambda: a+i)6 -6!?i+al Hi-a)%QdeltaCõte is senseless.Èúgday - ’ò# mixing date and (l!orp) via *™)//zy*y¯z6l///m "//žI¤Q4  #l" +àú0a +÷5ðdef test_overflow(›)/ptiny = ö.theclass.resolutionq@in [7a, time8(1)62)]bD-dtd0minëÓª'adt -= Vé # no problem&° âOáæ²dt.__sub__,M€ @0add@-Ž‹¨ 70maxžÓ+Ó5“’‰ Ó%@fromÔ\stamp*aimportôö# Try an arbitrary fixed value˜±year, monthýå = 1999, 9, 19ÛAts =b0.mk‰,((9:, 06-1)Ûdg Ó&ts,0‚Equal(d.m' Ç) 1dayî;hzinsane_œ�™ñ# It's possible that some platform maps.Õ_t to double,M#Ê8Athisõ will fail there. Tn@µexempt suchv°s (providedC÷y return reasonableAàresults!).  ñfor insane in -1e200,  : !ñself.assertRaises(OverflowError, !ùtheclass.fromtimestamp,JR�!) 'ðdef test_today(W)‹pimport [/Fò# We claim that :©) is like �(<.q()), sovG•prove it. Pdummywrange(3�7n+ =%()I*1s =» ï]againL ÀsV"ifñ2 == E3zYbreaksò# There are several legit reasonsOªcould failU`# 1. I-òcently became midnight, between the›`() and ‰! †() calls�º@# 2.«” platform,ðhas such fine resolutioqŽat we'llhnê@ get‡ s²¼value twicez3zGpooru,Û~we justw±happened toär,P befo‹QŽ quantumLŒboundary­4­õ system clock got fiddled�dñIn any case, wait a little whileßAtry ` {O£.sleep(0.1Ê» It worked kôt didn't. If ip, assum|#'s~1 #2Sÿ3# lµ ` pass ýöhey're within half a second of each other´7p/ !4zòÁAlmostEqual(Ù,ÃÞ p delta=' (Ÿcs=0.5)/ùOweekû‹i‡7‡ð# March 4, 2002ý…a MondayB‹×ѹ(<¤, 3, 4+i).‹J), iv6G8isoJ*+1Lÿ# January 2, 1956½%<o, 1, 2½* G½Q°pisocale’ ¯ñ# Check examples‹>‹ô# http://www.phys.uu.nl/~vgent/U/a6.ht dIà(2003, 12, 22+Gi) ú"self.assertEqual(d.isocalendar(), (2003, 52, i+1)?Ad = Cƒtheclass.ÿ12, 29) + timedelta(z"O4, 1y-/5+j%ã19, ã1l#9Pm8P0z3Q!10~4å"=4tð def test_iso_long_years(A!):#šÀ# Calculate &Q ISO *÷ and compare to table from=ôhttp://www.phys.uu.nl/~vgent/Ù/å6.ht@õ ISO_LONG_YEARS_TABLE = """c¤û 4 32 60 8897j5 931p43 7192S 486P6 5|982 ú105 133 161 18T 11 39j7 195>Ê16 144 172p22 150 å01289*84�ú201 229 257 28n 20É35 263 291s€212 2408  21z46 2749 24r>*80’ù303 331 359 387:0308ª6 364 39 31p42 370 3±3±*37¬0325r|8åN Oàorted(map(int,þ ’‡.split()ŽeL = []Õöfor i in range(400)bº20+iÙ+31è1š,é?160/ÒV Š[1:], d1l w;if �š[1] == 53ÎÒˆL.appendi ‰:L, r)(œlformat—tv2, 3, 2³ ntáOü), "0002-03-02"xc)t/00wNsðSat Mar 2 00:00ñ:00 2002") def test_strftime(self):!@t = õ.theclass(2005, 3, 2)&"åassertEqual(t.Qÿ"m:%m d:%d y:%y"), "m:03 d:02 y:05"I;ÿ") # SF bug #761337‡µ'x'*1000), Jr1556784ùÓöRaises(TypeError, ߎÏneeds an argŒ@ Ñ, "one", "twoÜ€too manyNsO 42“æarg wrong typeÖ#îÿ that unicode input is allowed (issue 278ã!%mœ$03XBÿ&# A naive object replaces %z and %Z w/ empty strings.ñS‘'%z' '%Z'wY'' ''z’make sureêõ invalid format specifiers are handled correctly„#NValuW, "%eÇ98%#óñoh well, some systems just igno  osî 7onenð#at least, exercis;@em t� M–no crashe�#G•generated? for f in [$èF%#"]`):tryBf vexcept Š=GpassõRcheck ö this standard extension workÑàD("%fh-H +d,†7, 9, 10ÄUÚRdt.__Tp__(''),C(dt)¦öBwithŠhUXRegexš 'mò beB§, not int'ÑL q7123h'# .pa derivü@'s _*ç__() gets callò"! A2 }%efF   ¥return 'A'LPa = A|PaO?'A'ãºâBâE),z_zðBð_b = Bðbð6str?À for fmtÿ in ["m:%m d:%d y:%y",  &ÿ H:%H M:%M S:%S5_%z %Z)]:iñ!self.assertEqual(dt.__format__(fmt), dt.strftime)C aB.bBQ'B') xð def test_resolution_info(Ì)ßñ# XXX: Should min and max respect subclassing?[‚Tif isTA.the(`, dateg4 exP1ed_'% =(VFelse›40̘ªIsInstanceŽj.min, {šA/axA+‚ , _delta„=Tru¿Qax > ¨aÓ æ…extreme_`�\big =HLax -%in_ð # 3652058 days, 23 hours, 59+2ute ¡seconds, 9c microN�n = (big.M°*24*3600 + ,A)*10Hñ# n == 3155378975tõ999 ~= 2**58.13vbjustasþ0, 0, n…âUbig, =) ›¼,X/axE˜‚ ^ ùÔBtupl8ñPfor iEwrange(7Yö# January 2, 1956 is a Monday (0­.d<(3Š, 1, 2+i,tÚ.˜ ÑK9t, Mš i^Z, -1)Ea# Febr¾1¾aWednesÁ22ÁýÁ6MÁ(�%7, 32+iÈPMarchGPƒBThurÄ13),Žðis the 31+29+1 = 61st”æ¤A# of(Yyear.þO3, 1þ6Mþ@3+i)þ/61þ À.tm_year, 19W56) ÿ self.assertEqual(t.tm_mon, 3*�day, 1+i-hour, 0+?min*?sec*w¬(3+i)%7…y16Þ±isdst, -1) cðdef test_pickling(m!):ƒõargs = 6, 7, 23porig = .°.theclass(*.µAfor Xeer, un ƒproto in†_choicesuysgreen =$€r.dumps(w!, Ah/–derived =iq.loads(I -¶QWD,(ð.__reduce__(), ;|ex__(2)^|compare]-t1Cv2, 3, 4„/t2$ ¨ft1, t2E!¯True(t1 <=" >"AFalsE!#"Z6H!!(3�3), (2, 4 G3, 5§*‘õ # this is larger than t1vA&œ %f2 > t1l) % p& 2 tL wL&L=Ä M' 2 'NÍE M<2 &1 ÅQM=NËA`badargCªOTHERSTUFF`JU1ä9!, …Õ24!= 2Y1 +g¡c2Ë", cé ð Raises(TypeError, lambda: 諸> >>+%}Àises(TypeErr÷ or, lambda: badarg <= t1) ÿ self.assertRaises(TypeErr?>*>>+»¼ðdef test_mixed_compare(Ë!):"á`our = õ.theclass(2000, 4, 5) )a# Our !ƒ can be Sód for equality to othe,%esBeEE-(|¦= 1, Falses *�1 == our*T!T?TruS !S)§õ# But the ordering is undefined(¥�'< N601 <î ~PRepea˜1oseØòs with a differentž³­PSomeCØõùFpass+@thei -(ŽÕ ==#i’[mê \!\›¯<A[ È)-Ÿ Gð:4§°However, if!  explicitly MscV¡# relativeIs@, it‡pallowedVdo soÂíúLargerThanAnythingöa__lt__ , ;breturn™�BeB±isinstance(., ¤|b/eqbMg no}È#g*íÐa=.›¹Èõ= 19æ’so it doe}qspecify–knumberF#of€¿¢Tif d.lö("%Y") != '%04d' % yv/0# YŠñ42 returns '42',ï {3q)lEqual(tB, '%p ‡=€# '0042'hÿobtained anywayi@4Y")jÜ tbreplacÈ7'(ëPbase_} |O¡3²IsInstance(;,¶4D/<ðÂð# Timestamp depends on time zone, so we'llEaculateJe6herAts =%Cv.combin°P(0)). vþ@caseD[¤’c('from…A', (¹O,)),'])/ts&”&Ê /]H3for@d_name, `"in¼¾ 8�ˆobj in (ï!, deóØAbothr�Nrod and ÿ7Bwithi0sub-�obj_type= ?@Kõ= ³<"¥ = getattrl1>5dHB"(*_`/#û¡it creates.dright K &q[,dtW= {@'s e®1 to~Õ object>{¢v5/_dëQalledl'l Ô}†pickling„ð&): “ð = 6, 7, 23 orig = óSubclassDate(*args) õfor pickler, un ƒproto in•_choices:9@sgreen =$ár.dumps(orig, Ah/–derived =iq.loads(I -óself.assertEqualWD!) ‰ðdef test_backdoor_resistance(B)±¤# For fastóing, the constructor accepts aÖÑ byte string.uË€# This i(Ôlow-overhead ‰÷ . A user can (by intent orEm¬pke) pasKgñ directly, which (if it's­Æright length3õ# will get treated likeÇ�, and byiô×normal sanity“`checksú&". ôÐccú insane objects Vñdoesn't want to burnÎ@timeÇvalidate allŽÀfields, but D Ÿ:amonth !›Çstops, e.g.,EXh. ð('1995-03-25') from yjjing anØ׈base = b>g£if not issn€A.the|$, }“JUuase[:4]P™ã_�Òin b'9', b'\0rFxff'æSù;ñRaises(TypeError, –o8 ¨w[:2] + —!+ 63:]‹­P# Goo #teîªbad tzinfoÝBwithÅâXRegexç&'^A1 stZKrg$'~ó (nps([1] *e(à“)), 'EST'w6 5ordž»range(1, 13d,`should÷blow up because ofÑ€¹ alone. If¡#(ðimplementation chzsEòdo more-careful-æVit maçÁ-# ˆBtherRSs are7 .·¹4s([8]) ȯr@isof„t)4 # Test thaO%)m¡reversibleP� _\Us = [ŽF, 1) ­000, 2, 149Æ 25/29@4, 162N4, 3–17, 5, 30<]اapdt_tuplŠié Bdt =Öð(*dt_tuple)  ó dt_str = dt.isoformat() òwith self.subTest(6=)):.3rdt_rt =5Ötheclass.fromd q-) ErñassertEqual(dt, Z-™def test_YA_subp(A�h DateS". +ÄFpass•dÏ <Ã2014, 12, 14‘7¡) =hú±.ò IsInstancem9rt,Qp\failsþ # ºi that 01() 1õ on invalid values’0bad&Us = [í0'', ê# Empty string/–009-03-048ö# Not 10 characterxX¬'1234567894ja dateax200a-12b3# IÖb� in year<O9-1a<_month=E2-0a§y?day;_01-32;.62-2i_leap 3E0228_Q # VéòISO8601 output no § ]Cfor L s 7Ó€Raises(V\[Errorqî‘ 7fü`_typeecPwhen úÐed the wrong O´–import ioš$!4b'2çá1', None, io.S8IO( %)]XTIU VOTypeU%fO) #9! #žAtime¤2s €|L(Å `sub_va’13¹/TTime( "):€-Ã0ateJýbasic_attributeÛ y²(2002, 3, 1â0)Ñ–.L , 5( 8?, 3& oday, 1$ @hour›& ƒminute, ¿À self.assó ertEqual(dt.second, 0) ˆself.ass'Wmicro,-ðdef test_basic_attributes_nonzero(K!):-]ö# Make sure all 2� are non-7· so bugs in;õ bit-shifting access show up.'Pdt = vò .theclass(2002, 3, 1, 12, 59?800õ `year, @ onth, 3& oday, 1$ @hour¦& `minuteÆ( °/59( ÝQàœroundtripÑ¡for dt in u21, uÁ4, 5, 6, 7),U ¬g.now()1)€# Verifyi`-> strö-> datetime identity8¶s = repr(dtÿàôTrue(s.startswith('V;.')7ZI[9:]ÇËdt2 = eval(s0gny, dt2) A߯` via r—Qstrucïºfrom pieceså EÖºBdt.m›0dt. y  2dt.ƒ;f%?Ll‘isoformatR Ú eà… &t.] ),üð"0001-02-03T04:05:01.623"¿_Io'T'), I1 I ’%K\x00LO$c`spec='sY?T04*IÁK?:05NçN?:01Q_milliV &Z!G°Z1€VNautožÕÀ000123")  ð@self.assertEqual(t.isoformat(sep=' ', timespec='minutes'), "0001-02-03 04:05") SW÷Raises(ValueError, d\Ffoo'CÒ# str is ISO ‘ð with the separatorðced to a blank. �…Ü_str(tº@:01.ÎU23") @At = Dðtheclass(1, 2, 3, 4, 5, 1, 999500, tzinfo=)†zone.utcËEe3\œllisecondaTa§Ÿ999+00:00ª#•F�‡Kautou"N/mij0dIÄ?croÄ 02 h2Û ),¤’�2-03-02T$'à $'T_B& B „ÖL¼z I0ime­ñðz = FixedOffset(œcdelta(Ó§=16), 'XXXª(½zÈÅò4:164¤def test_i­_¬Î(ç'):ÕoÍUs = [s('05:00àè¬hours=5)),+2+2+O6:27V36, ?>=27712:32:3�&12;R32, s%>=30G002:-�9.123456ˆM4L9c½=?)¹]îR}', None?Â�§" e &‚(0)ì�+àðprefix + expected, timezone(si·gn * td)) ýfor expected, td in tzoffsets*Àprefix, sign*õ[('-', -1), ('+', 1)]6%] ödt_base = self.theclass(2016, 4, 1, 12, 37, 9¢4exp8'+ö-04-01T12:37:09'aÈ€_tz, tzi�…tzinfos:…÷Sdt = Ž’.replace(*F=tzi{-Pexp =…+ )tzQBwithÕpsubTestNK yPñassert dt.isoformat() =cË“def test_.)I¾B04A, 10I5L3Ë1|£Equal(dt._bò__(''), str(dt))‡­Ù;ðRaisesRegex(TypeError, 'must beB§, not int'´L q7123hñ# check that a derived õ 's __str__() gets called‚&1 A(ãV }%efF(  ¥return 'A'Z�a = A(20^a]?'A'ñ�strftimeðBðE)", N__specþBþ_b = Bþ"bþ[­ fm*õ ["m:%m d:%d y:%y",‚™ &ÿ H:%H M:%M S:%S5_%z %Z]Ve.é$Pfmt),¹YcC 0B MB$'BL,`more_c4ïâ # ’r fieldsbõDate doesn't touch.vpimport N 5"c¯À, 2, 18, 3, zÚ 1S"t.¥ö), "Sat Mar 2 18:03:05 2002"T÷4# Oops! The next line fails on Win2K under MSVC 6, so it's comment*b# out.MÃdifference iœà produces " 2":† the dayš # but platY Ö:0:õ. According tolv# C99, |iº¦rrect here–#cN­\ mkð(t.timetuple())S)) õ'# So test a case where that difference doesn't matter.?ñt = self.theclass(2002, 3, 22, 18 u5, 123)62ðassertEqual(t.ctime(),  mk0(t.„tuple())Â1def½ð _tz_independent_comparing(k%):z?dt1²¦1, 9, 0, 0«?dt21 1/ 232 c£.dt1, dt1PTrue(–>#ÛÃ# Make sure 5sonºñ forget microseconds, and iÙGdoneK4viaE¡ng a floatœöstamp (an IEEE doubl ·have enoughNøprecision to span‡€ resoluta�Ðs years 1 thrJg 9999,P'so�«™÷necessarily calls some distinct valuesLe�)Ò"pMAXYEARÆÂ, 31, 23, 59�&982Aus =*hdelta(q&=1'à = n6+ u‘ 02 -(F, us?(s1 < dt2Ü@strfü _with_bad_tzname_replace"ò# verify ok if tzinfo.44().6ð) returns a non-stoX ÷ MyTzInfo(FixedOffset�ƒ¨‘‰ø "&OStr(str"&L  , *args.2Ä( Ný Myu'3'ø5í2C33, FG¦ûôRaises(TypeError, t.¼l, '%Z'ÚÌñconstructor_argumentsJöR# badU Úzµ3MINáð, 1) # no excep—55ßäV„å ˆ#, ‰@-1, * F š+CœÁ [months C2000}( 4ñ/) >  SŠ$A#13À # bad cdays ÿself.theclass(2000, 2, 29) # no exception4444hù assertRaises(ValueError, º%, »:30)ªB1ÉB$1×B#/19B-?1, (†0, 1, 32I¯# bad hour; 7|_?o}3w ÍW&-1Ê7F"&24Fominute 23’%?, 5‘Ô#?3, 4G3, 6t"osecond"/59&-*JŸ.7N2_micro7 N0>¶ �@9I¿ mù ¨3ø¸a%l 3!10 òEfold6K5  a=?À 2000, 1, 31³, fold=2) Á# Positional:ñself.assertRaises(TypeError, •theclass,4Vò2000, 1, 31, 23, 59Á0, None, 1) @ðdef test_hash_equality(j)–:d =}(b2c3r7åe4 wþE‹V(d, eS µQ(d), #e)Õ Ádic = {d: 1}êu[e] = 2 T�len(dic)$5 &‡dic[d], Ö$e$oJ01, ­�0, 5, 1J 4 �J¹¶pcomputaKsµa�2Ub'M1956'¥diff = a-bÌdðiff.days, 46*365 + Obrange(W–2002, 4))‚H¯seconds, 0* _micro/03, F7, 6\pmillise6Ðtimedelta(0, ×'00…yhour = %(36"9day!1fIweekè @a + n ú}yÆ8Æa EAO + aE*Š010*LHO3, 3Œ ?a -Ñ6E -†ÒF ‹ÜTE.2 k1¼ l?dayD 1—Œ D 1>ˆ‹‰9E/- EÀ2, 2, 23, 17s, 6)) ñself.assertEqual(a + 52*week, ÿtheclass(2003, 3, 1, 17H-H1HKH ‘Žq) - a, ¿/3day. - Chour. / ƒmillisec37 -·Â-à - ¹/ ^ ¹/ 0 ¶48Aa - ]¾/, Æ 0¿0, -^¾1, -0º5, - 8�NÅ�,•\¼!, /·%, 7 0+ („ +�! +h& +<,=ä Ð2ˆ°10, 18, 6, ?000" ‚&&((EÂ)Ã-;ÿ2, 22, 16, 5, 59, 999…(‚ [! -ÆTõ# Add/sub ints or floats should be illegalù�for i inª5.0: óöRaises(TypeError, lambda: a+i%6-6!?i+al Ui-a) Ù`# delt°õdatetime is senseless.)þ0day–•# mixing ^Rand (t%orp) via *¥)//‚�'* ·zhÀertRaises(Tyó peError, lambda: day // a) ýself.assertRaises(Ty7a5?day7*k# Æ# datetime + Ïis senselessË+”5ðdef test_pickling(!): õargs = 6, 7, 23, 20, 59, 1, 64**2*porig = @°.theclass(*@4Afor jeer, un ƒproto in†_choices‡‹sgreen =$€r.dumps(w!, Ah/–derived =iq.loads(I -¶SEqualWD,(ð.__reduce__(), ’‘ex__(2)) )pOmoreu H0200|†ö16, 48, 37, 444116 aMbrange(e÷.HIGHEST_PROTOCOL + 1è2é.\aYb„Ps€GPL`b.year;/03+�month, 2)lday, 7XÀqing_subƒ_=Ú.SRDŽÝ¶š|compare4R# The1"ð) inherited from Test#Ð covers the e„q cases.n(ñ# We just want toYð lexicographic or„Qng onJ@membVÖN ham!at$W lackmˆð = [2000, 11, 29’`, 58, S9%8]Q-t1† Î/t2" /Wt1, tÜ!¯True(t1 <=" >"AFalsE!#"\i¥X@len(V)F0new0 = &[:Rõ4[i]! i]‹f%Y9ô ) # this is larger than t1DÀ self.as÷sertTrue(t1 < t2) vself.as%o2 > t1% O1 <=K=L!L&˜AFalsã=M ' 2 'N>æ M<æ &?1 >šZA1) §ð# A helper for timestamp constructQests.0ð def verify_field_equality(éñ, expected, got):4E2()�.tm_year1. 5 2mon4_month52day6?day43houž 5$miž_inute62secžrsecond)¤t•test_from¢qbaimportÂ7wAts =.8(‡Qlocal$&ts&agot = ‡štheclass.….(oÞ ×:utcUIÚ6g3(©× …1‘.Úñ# Run with US-style DST rules: òbegins 2 a.m. on ò¡ Sunday in:ø # March (M3.2.0) and end9Vfirst8ò November (M11.1.0)º@@sup"P.run_œò_tz('EST+05EDT,c,5'{l_naive} '§(1970, 1, G t—X²(), 18000.0{¿ ~W]v2, 3, 42c VZ |Ð + 3600 + 2*6¦3 + 4*1e-6e # Missing T-t0¯2201£@11, Ý1}ÿ0.replace(fold=. Ütˆ1K%),• éAt0 -`delta(ÂFs=1)Þg¦ xÀimestamp(t0.ÿtimestamp()), Pt1 + ,õdelta(hours=1))2À# Ambiguous õ defaults to DST)öt = self.theclass(2012, 11, 4, 1, 30W*ÁassertEqual(;P.from–Â&t. u)), t) w4# Tê÷ may raise an overflow error on some platformsBðXXX: Do we careÚõsupport the first and last year?>©for t in [‹(2,1,1),Õ9998,12,12)]:D�:tryIs = ý 3ƒexcept OéEèD6pasìUNelse'¾‘s…•def test_¤a_awareÒ)i A1970 1, tzinfo=D�zone.utc- G, 0.Zh q1, 2, 3“t) ‰V 3600 + 2*6¦3 + 4*1e-6Ï¢e 0(9ç-5), 'EST'Ì ä Ho1180ÕÜ<@6ð.run_with_tz('MSK-03') # Something eKÁof GreenwichBMümicrosecond_roundingR{>fts} ?þ p9utcs �·zero = fts(jóG7+.¹/, -ë 23onex C{2fminus_7-87S1p# localRA(-1)ùgŽsis not ë edZjWindowg£|%ÆJ&59@Z |7 T94=‰Ô%8`0t, ß*IN9e-7 ©5t, ¬/N1N—À ð t = fts(-1/2**7) ÿself.assertEqual(t.second, 59/Tmicro4‰992188) h…;1e-‚~j, zeroy@9@?one?10.94Ø…0J* þa 4½~}1I} ¬xùKÁ F* òC7812îð def test_timestamp_limits(E%):¥# minimum *Pmin_d»4ð.theclass.min.replace(tzinfo=<†zone.utc)@@ts =c@_dt.&Œ($6try� Á# date 0001-A 00:+:©Õ=-62135596800¶E±IÂFfrom�§J, tzÈ,SW 7&dtÊñ except (OverflowError, OS Œ) as excí=theññdoesn't fit into 32-bitù*_t—ä# or platform :ñsupport such very oldh ÔóskipTest(str(exc)CíZ# maxb: set ¢As to#õavoid rounding issueso?maxL/axL ì’”G=0, =D„���;ý-12-31 23:59:00Æ 25340230074T{_ax_ts{ÅwZµ# number of—ðgreater than 1 year: make sure t z:newñ# is not valid in,.—  I€ödelta = 3600 * 24 * 400vµ# too small5‡�in_ts - C�# convertG€a Python fCÚ can raise a sIÔespecially onG.%s.*Wwith ºRY�s((ValueÀ,e)C“< `Àestamp(ts)  ñwith self.assertRaises((ValueError, OverflowB)): ;<õtheclass.utcfromtimestamp(ts) 0•# too bigÆts = max_dt.5•) + delta(§<¤Í/ i<údef test_insane_“Við# It's possible that some platform maps CÕ_t to double,AR# and8Athis{õ will fail there. Tgshould@µexempt suchv s (provide\÷ey return reasonableA¥results!).Bfor Á in -1e200, f ¢ •,Ç Må �§ — Ášÿ- P�P@unit5Å.skipIf(sys.ñ== "win32", "Windows doesn't accept negative*¢1s")�ù#o_float˜ BThe Ù Vòz-dependent; at leastm´t`”w‹#„÷(like it did before bug 1646728 was fixedAŽ.÷c(-1.05×:a ë(­Õ;d =· 2Ã%A¨{Equal(dùó(1969, 12, 31, 23, 59, 58, 950000)îlutcnow›aimport%¾@Call¡aƒcess if B)a ÂQ) areV'inñða second of each o‚±tolerance =†(42s=1³BPdummyAwrange(3d#ðrom_now = self.thecla×ss.utcnow() ò from_timestamp = self.thecla4"!( .*()Ipif abs(.P!- ùnow) <= tolerance:…�Ybreakð# Else try again a few }%s.*°ÿassertLessEqual(Š ,ˆ!) IÐdef test_strpa(W)¦ñstring = '2004-12-01 13:02:47.197'HÉ`format+ö%Y-%m-%d %H:%M:%S.%f(µexpected = w. U_dateŠ‘", Š", g„ got·-.ο5/=9•V, got](„Is(type(**),35 U 0:¯ †*¥¸"ð("+0002", "%z")ôÿoffset(), 2 * MINUTE¥J-J-K¯ X8@01.03­ <- ðdelta(minutes=2Gòconds=1, microse3Þ Á# Only localCõ zone and UTC are supported{cfor tzWñ , tzname in ((0, 'UTC'), eGMT'),:ñ!(-B‚#, \G[0])uB&ifƒF < 0“@signn-[»E = -È ¤?els‹R/'+Q PPhours�¥£ = divmod(‰†//60, 60—¦ódtstr = "{}{:02dR {}".æ(’*, ^‘ M>Æ[ J %Z"*Ôú*dt/u¿=õ üK.w }À# Can producO´consistent õ¥Á fmÝ`"+1234±3Ô*ù/fmÅñ1ÖŸHOUR + 34-2dt.Þè‘õ# yet will roundtrip2@strft(¶!, û '3# P3Unaive,À if no %z isV3vidÄÀ self.assó ertEqual(strptime("UTC", "%Z").tzinfo, None) öwith self.assertRaises(ValueError): QQ-2400S?z")D%0CDàdef test_more_»`tuple(—!):#®a# This*ñs fields beyond thoseñed by the TestDate.[V.P2t =úð theclass(2004, 12, 31, 6, 2 3ê’)l%t.YO(), Bß, 4, 366, -1)Oªþ ð(t.year, t.month Oday,2b t.hou2Pinute3osecond6 Ÿweekday()' õtoordinal() - date¤h1, 1).!?+ 1N $t§ gåŽTt.tm_l -0mon F-do t.day,n-"mi†š.0sec´¾.wµÉ2y2³-v ‰ ù~Qisdst)¦ @strfs:U O, 47Ó .\ÿ ("%m %d %y %f %S %M %H %j"Z að "12 31 04 000047 33 22 06YŽðfor (s, us), z in [((33Øð3), "33.000123"±0F"),]ozPtz = o`zone(- `delta(ÖRs=2, …¤s=s, micro'usèKJ’.replace(Ž6=tz<%Ò@z²³"-0200" + zÇ!|extractdBZéÚ—‚18, 45, "4‘3ídú teéè3200Fì686 p Æmcombinþ2d =WvÐ t = ótime(18, 45, 3, 1234) ñexpected = self.theclass(20020?4, >|combine=.fSdt = V(d, t�vôassertEqual(dt, –/) CÔ¯=t, date=dMuP, dt.O/()Os t.~' ÃîWb;Ø‹ôRaises(TypeError,3õ) # need an arg<5, d?0two@sAöDßargs reversedDõ0, 1Gÿwrong tzinfo typeK#ÿ, 2) # too manyÚ!"ò@", "˜"�?ype&dGÝ’t�#:=ðUumentb f , Ø�zone.utcØbIs(dt.�/X¾=_2I(¡ rt1 ¹ë X¹N(ðdef test_replace(5!): tz=< c BogusÉ3ZButco}›Ö): return Non 11dst + 0÷Sbog =�h- æobog) ) bë=:w)wÏ!OAlso%(ú^^- XBalso)‰-$KÎ3lso] Sroken&1Lá (bn “5dt_^âY  É]q˜P1subP_dateÇØ,):!C[ kætheAnswer = 42<"à__new__(cls, *¥{, **kwsH0÷temp = kws.copy.€extra = *a.pop('+"^resul�Om C.b1 =  ),oÿqnewmethC, startùE1 + #) Tmonth fsecondkTÐ = 2003, 4, 1@2, 11(8Â3vnv # 3¡± depends on¶ð zone, so we'llƒaculateˆe-EhereQ"pü&()þ*@caseK[8>e('from6©', (ts,)),&û# See https://bugs.python.org/issue324175]êéL.utcj]('utc“ —`9½ƒ/@strpì *þ '%Y-%m-%dT%H:%M:%S.%f'�qcombine@Aate(>q[0:3]),ØH3:])>]�3forRd_name, n"in×­®@ 8åŒobj in (}!, dHîAbothJŸ¤rod and ¾sBwith{0sub0 �obj_type= 3@aù= ³<"¥ = getattrl5Bé5d„B"(*_d/#¡it creates.dright j &q7/dt3ð  ñ# Test that it's equal to the base object / Àself.assertE8A(dt,5ÿ _d.replace(tzinfo=None)) G …q called�¿constructor:�“.extra, 7mðdef test_fromisoformat_datetime(C%):^ Œ.õ() is reversible.!KUs = ['@(1, +),?900p2004, 1526Å2017, 5, 30)P]O‰Ð‰30,  V�, 241000\34567 12�r, 45, 2"›‘separator›‡' ', 'T'¼"& , ÈŠzone.utc>Y% !(*ûdelta(hours=-5)¦2 72))‹!dt‡°.theclass(*,�_tuple, *s ºF=tzi•qFfor 83 inEates&,W,, zi%~s¿ut6dtsÔg0sep‘ #'µdtstr = dt.,ƒ(sep=sepQ'Qwith .0subJ(A=V0rdt_rt =7e.žF T>7 tT ñNU ñ:d‘@(201Žä ìS17456n”rtzoffse< Ýu "5)Þ ì 4Ì6, minutes=2„ ,§-Ü32, seconds=3Ü 92e4794croG1ç˜{À+= [-1 * td v tdu 4rù-0Ç ‹êø?td)� ® \ !&0 à  J59?>æ:#1À dt == dt_rtñ&, dt_rt def test_fromisoformat_separators(self):-1E = [p' ', 'T€\u007f',ú # 1-bit widths3) 803#Ê�/4240ᛇ18時2737QðŸ��'& ?# 46]#. for sep in#Pdt = -ù.theclass(2018, 1, 31, 23, 59, 47, 124789) µdtstr = dt.ˆ–(sep=sep)ŠkBwithk�subTest(==¬,ð ž.òB ’;ÑãassertEqual(dt@”A�ambiguou@ # ±à strings like (ó-01-31+12:15 (where öis not a time zone¨ � '+5-']Z¹0f12, 15sj­¶XMspec­@datem_basesñP(2009ÎP, 4, ëP7, 45e3456),‡4.'0)jatzinfolQNone,õôJ.utcQU% !(ªûdelta(hours=-5)ƒ2 21é6, minutes=27)È1imeT6'‘œ. �seconds'Õ… 'milli%4cro2ã`ip, tsŸ‘enumerate‚ 00tzi-m É%$€dt_tuple) 04 ifƒ ==ªº-1fnew_miÕ´ = 1000 * (|a[6] // �@-�´œ[0:6] + (d,·<¾*†â0:(4 + ip)]), 6O=tzi”�Ž?=ts6Õº-_r{ ÝÀtstr)  ðself.assertEqual(dt, dt_rt) .ðdef test_fromisoformat_fails_datetime(G!):15É# Test that 81() :õ on invalid values<Åbad_strs = [U0'',ê# Empty string;Þ2009.04-19T03Hþ# Wrong first separatorDO-04.D osecondE ‰a‰IFhourõ'Å-Åh:1a:45B$# <WminutS>95:4€>Á| =;15|3Bad?ÿ\3:15;ÃG� Hƒ:4500:00 # HAOzoneŽe:45.23“ò # Too many digits for milli£$ :$ .1P 67˜O?croOS+24:3ì¸ïooffset¾yzì�-NŸnegative M H0ᛇH12:1•ôgunicodŒ>1/µèŸcomplete  =12:ä ?  A90:4† A° 912:=È¿# Ends withÛˆ JG&745.JG)7+N GmØ#45-J7S05:00Ø¿# Extra tex ‹->? A =ó‚]X OïC in sH%1`@.subW((=x04àassertRaises(VßalueError): ñself.theclass.fromisoformat(bad_str) :™def test_%P_utc(E` dt7ñ = '2014-04-19T13:21:13+00:00'S�Pdt = A†N…2-óassertIs(dt.tzinfo, timezone.utc0µ1subñ º¨ DateTimeS&ŸéŽBpass!Î @ð, 12, 14, 9, 30, 45U7390, Cà=ß( ó delta(hours=10, minutes=45))üI@dt_ra “ ê6dt.÷@l¡Equal(dt, U)µ$±IsInstance(%,LB) fDTestbŸ( i�8 = /ƒ¡# OverrideŸôs not designed for î/P@unitÈp.skip('.¹appropriate12es'çGœroundtrip:Ú§D­ʸsub_var = 1'õ HarmlessMixedComparison, ¯bCase):o Þ©Àbasic_attrib °¹G(Ÿ0ï:fú t.nÇ% ‰/, K osecond& Wmicro+ã Œ_nonzeroëö# Make sure all � are non-7± so bugs inhõ# bit-shifting access show up.'M@59, ?800  X/59 .' Z¡Î@éì—, 2, 3, 4yð# Verify t -> str@!->¤– identityB¯s = repr(tÞðTrue(s.startswith('dateø7.')3LA[9:]Í·t2 = eval(s'õ ÜO, t2¾ª` via rµQstrucv piecesÉp<Y9$t.#t.§§« /ÿ¼¿Àst_comparing“(self): õargs = [1, 2, 3, 4]Pt1 = 0°.theclass(*0)"2" ?öassertEqual(t1, t2C!¯True(t1 <=" >"AFalsE!#"ïñfor i in range(len(PW0new0 = &[:R4[i]!ei] + 1f%tYWú ) # this is larger than tDZÐa %f2 > t1 ) % ¤& 2 ¨L «L&L³=ø M' 2 'NE M<2 &1 ùQM=Nu`badargz¦OTHERSTUFFÄ Jhä9!, …Õ24!= 2�1 +gÕc2Ë", cé Çò Raises(TypeError, lambda: #L£? ç>#>>+d} ô!½ú?aoˆ> >Þüdef test_bad_constructor_arguments®#ze hours7¼¡@0, 0"ÿ # no exception.#23/. ¾ÚDValu� z@, -1M j<)24<èominuteê¼ëÀlass(23, 59)ó # no exception ñself.assertRaises(ValueError, ÿtheclass, 23, -1)='&60=Ú# bad secondsSr(q`59, 0)¯à 3 5943 ö…ú*Aþ_microA  1, 9=•.E!10!) ðdef test_hash_equality(Ž!):":d =¡/f30, 17ge&[EoV(d, eE ™Q(d), #e)¹—¶ic = {d: 1}¬•ic[e] = 2 T¯len(dic), c™�ic[d], 2ždn$o._0, 5- % ¹,º|œisoformatxtR!4,I_, 123—&t.Tÿ), "04:05:01.000123";Xstr(tu”MA"00:�;Ü=Ñ Ž?001•H� Ô– /10–I—%)10—Àelf.assertEqóual(t.isoformat(), str(t)) õt = self.theclass(microsecond=1000),(�assertEq]A"00:0.00:";˜ ™#˜0™Lš"™š<óhour=12, minute=34, Ú 56ê_23456± timespec='b�s'), "12V>—@?:34CÏC?:56F_milliKO.123O!Y šO4¡!Cautogo:34:56J ÷Raises(ValueError, ', ‚oonkey' äFO99952†O999"�5—˜/00«O0i -•def test_þ_ˆPzone(Ç%):ÖÕtzoffsets = [‚('05:00'1`delta( ls=5)),+2+2+O6:27V“©Ns=27712:32:3�äDs=32åNs=30Gƒ02:04:09Bˆ1%s=19s=912s=123]V_zinfoR}', None?+9�§O.utc&(Öšð0))), ]  Òtzinfos += [ ù(prefix + expected, timezone(sign * td))58for/íd in tzoffsets*b!, Nõ in [('-', -1), ('+', 1)]6%] öt_base = self.theclass(12, 37, 9•4exp,¦'12:37:09'I°‚_tz, tzi¯:mBt = u’.replace(9F=tzin+Pexp =x?9_tzOBwith¼psubTestNK wPñassert t.isoformat() =bÈðdef test_1653736()I÷!# verify it doesn't accept extra keyword argumen©÷Nc†second=1ô ¥øRaises(TypeError,¶‹, foo=3)µ@strfW ¶{01, à?, 4}…Equal(t.Qð '%H %M %S %f'), "01 02 03 0&4"Gó# A naive object åÁs %z and %Z ´åempty strings.Ô ‡°"'%z' '%Z'"…l'' ''"ÙHº&"__Q@__('ûcstr(t)uUÍn.ºXRegex¿€'must beò§, not int'¢L't.o$12âñ# check that a derived ®õ 's __str__() gets calledU&! A� |üFÏ „¥return 'A'Zoa = A(PaÝL7'A'Iâ �áBáE)G__specïBï_b = Bïbï ;3 fm % [c%',]t]†¢q';@fmt)2ï¤A Ÿ0A ñA$'Bá^Z½p Ì$«rú�01:02:03.~0L0þ@000)P%10PG4000ÏPÀ.theclass(0,� 2, 3, 40â)), "00:02:03.C") ñself.assertEqual(str(Ãtheclass(12,R0M"12MF²23, 15, 0, G±23:15:00") ŽÂdef test_repƒ!):ªùname = 'datetime.' + §0.__%%__4ÛY.ÜÛE4)),:r V"%s(1+@" % mGl0B 00p /t# Du 0v# 2ç ^)k# Wl -j/yÑsolution_info„P¡IsInstance%PZ.min,˜$@/ax@*$reà , (_deltaƒ=Tru½Jax >¾Ñ  �picklingû ñ args = 20, 59, 16, 64**2eOjorig =a (*7¢Afor aeer, un ƒproto in†_choices"asgreen =$€r.dumps(w!, Ah/–derived =iq.loads(I -þ)WD,(ð.__reduce__(), ;ex__(2)gA_sub‰_Ñu%SEOTimet¶Z¿Lbool # 5° is always ÷.8 cl²³?5(cls(1)é ?0, #&)’À self.assñertTrue(cls()) def test_replace(self): `cls = •.theclass0argÅ[1, 2, 3, 4]pbase = k*()LÀassertEqual(+ , .…ž‚Ui = 0>õfor name, newval in (("hour", 5),*< Ï("minute", 6,¯second", 7,Umicro1'8)D†0new0 = &[:*S[i] =Ù È„expectedRNUEZgot =H0**{-:T}1 ŠgZ, got,bi += 14mõ# Out of bounds.¯È§1CkúRaises(ValueErrorü , Ì?=24=#ß/=-|$ÁO=100%E 00Ii1subGr“ass TimeS*” Yp’b—@ctimx ?1žÑ�Is(type(8‚Y10)),ˆ 3Êu¥&):"å! C½ætheAnswer = 42<Ë1p__new__²!, H{, **kws0ötemp = kws.copy(Á€extra = *a.pop(''*PresulN¸ù.�OC.b1 = §Žrreturn oÿqnewmethC, startùE1 + ³Â Ô^�pf, 5, 6 = $Í4±æá%jdÎ ‹y,þin ((-1440, False)¤À ÿ (-1439, True),  (,É40, False)):Zêif cls is time�0t =!ù(1, 2, 3, tzinfo=Edgy(offset))R&elTOdateX 26, as©ùassert 0, "impossible"šŽif legitæ¤aofs = absÔ 9 àh, m = divmod(1J, 60û(àtag = "%c%02d:C" % Wð < 0 and '-' or '+', ZHôif isinstance(t, L Át© t.m>tz(ORself.$úEqual(str(t), "01:02:03" + tag;/ellMñ Raises(ValueError, str, t) C’def test_80_cl… s(CÊ„ = A.the%?ÚB C1(C6a2utc‹Wõ, dt): return NoneK1?dst+otzname. Ðfor t in (cls-O1, 1Å M¤-LC1()Æ9Y@rtIsN6(t. ¡-' )ÝOž3ž#°ádelta(minutes= …㡹 Ý?>¸A "aÞ'F¢7C3(H M n,KÖ™Bâ)<Ó; ßÎРå# Wrong types. ·4·# 7 ¦7v(± Ñ0+Š4ŠŠ4Typ‰–?2?dst,Æ lOÝ out of ranget6tÀ ÷( def utcoffset(self, dt): return timedelta(hours=-24) A/ds;:²t = cls(1, ¶tzinfo=C6()`�õ .assertRaises(ValueError, t.¹3Udst) Áõ# Not a whole number of seconds.)’class C7(¨%): ŒE Smicro^6=61¸GK A'-8BS7SgEqual(F7(),ð j/61—D·>¨v+ñtest_aware_compare4Uacls = ÿ1the}µ·Ensure that½ò) gets ignored if the b•ands have¸#Rsame Ô0 meÿ ôòOperandDependentO*4³Á t$(›Ê.minute < 10N"Ð# d0 and d1 e¬õ after adjustmentÍ/ ¹i3s=ts u7Oelse„�2 off in0_weedsw#59ûjCbaseû“8, 9, 10,€=jyPd0 = C’.replace(Ü&=3Ô/d1$9$2$1PPfor xøªd0, d1, d2$!y! ñ% op&ÿlt, le, gt, ge, eq, nw goÎvop(x, y¸Q°expected = (Ü3, y 6SR»Tgot, L©£# However,Iãy're different-bs, uct=t is not€He®aañ can't actually™R an olP-depelzEset,qµ`ough (œ@() pÚ“s None toX")KÐso skip this ” ­Uq if§Û ’×Ó·IÜJÀo=OperandDep÷endentOffset()) ùfor x in d0, d1, d2:!,%y% )ðgot = (x > y) - :< yr( ifbis d0 …Õs d1) and (y  .1)—FÍexpected = 0¼!0lifæ"s Mã'L*CG/-1”/seÓdassert¯A gfRself.M´Equal(got, žñ)) # Testing time objects with a non-None tzinfo. class3pTimeTZ(> ð, TZInfoBase, unittest.CCase¿2theB=o Ú@def -p_empty(´/äR.<(Pߟt.hour, 0$ ominute& osecond& _micro+ IsC2(t.E)ö\zonesö esøSFixed¹æ-300, "EST", 1àhutc = *'†UTC", -2(,meR6) MEP3(2t1 �ƒ( 7, 47,üG=est&2&)12&7utc&3&3&(meL4&M'=4Ä/t5"œvM31|), Æ)2)SN)3) Ì)÷4*%–#t5$!, wÊ CutcoÌ,Fbdelta(Õ s=(ål/2.B 0? 3? 6@€öRaises(TypeError, t1v³, "no args"K¢ôcname()7l�ø-=- ü-A-ð"tz.'í2ê0dstçÃÀminutes=1))  ó#self.assertEqual(t2.dst(), timedelta(minutes=-2)) 9 :3:39’IsNone(t4:]ðRaises(TypeError, t1/ß, "no args") –¢hash(t1), à #-·*-2Z-ˆot1, t2âO!3! O2, t!$No¾ÿ4, t5) # mixed tz-aware & naive aÏlambda: t4 d>)12??utc?o?3?/me~z?20, /40w} 8ú»9pt1.strf_õ ("%H:%M:%S %%Z=%Z %%z=%z"),@7Áï %Z=EST %z=-05ß /t2�!Z y õ` UTC +’Ê /t3N í� MET +01œÞ€yuck = FuòOffset(-1439, "%z 7%%Z�Qt1 = =e23, 59yKÕwtA'%Z'vO'%z'xÀ  ñ"23:59 %Z='%z %Z %%z%%Z' %z='-2359'") ,ð # Check that an invalid tzname result raises ¥exception.C’class Bad4•(tzinfo):!lytz = 423defhð(self, dt): return 5.tz1òt = time(2, 3, 4, h=y%)).>ñassertEqual(t.strfAÿ"%H:%M:%S"), "02:03:04"=RùÆ(TypeError, IZ, "%ZL¶Issue #6697ÿÃif '_Fast' iØ!__5P__.__h&__/.Ô.8…'\ud800'ß$ã¦OValu§ sñest_hash_edge_cases�³’# Offsetsñoverflow a basicŠCt1 =±!heÚr(0, 1, ¬©RFixedW—(1439, ""³/t2E0E 8Eøèb(t1), '2)ý¸å23, 58, 6, 100e¼0-10½ J4J/10Â&d?ÌŽpicklingÅóTry one without a5»öargs = 20, 59, 16, 64**©Morig™*71Afor …eer, un PprotoõŠ_choicesìtgreen =Ap.dumps(w!, Ah÷–derived =iq.loads(I - WD,(ð.__reduce__(), ;Yex__(M(# nkt@ = P¯IableU3T†'cookie'šv 5 7žZ4�®è“³IsInstance(º.S,L  HCAutcoäÝ÷delta(minutes=-300žK ù>), ÁÈ€ÒH[æ˜more_boolçÀ # time iós always True. õcls = self.theclass õt = cls(0, tzinfo=FixedOffset(-300, ""))1H`assertg>(t)M5MO™#o23, 59žq23*60 +ñðdef test_replace(%):)w’ˆ z100 = k1jV+100"m=zm2)ð timedelta(minutes=-200), "=0argùÁ[1, 2, 3, 4,y]£Cbase*.yÌ.æ`Equal(+ , .ð)úUi = 0Xõfor name, newval in (("hour", 5),* "("ÚO", 6,¯second", 7,Umicro1811", Š)ß²0new70 = &[:ZS[i] =  ø„expected‚N…E go¢ x0**{]:T}1 ºgZ, got,fi += 1Àó # Ensure we can get rid of aW i¥ tzœ(� Ì:2 =D`V=None›Z Is~"2.-(„  Úgadd on%ž3ž2ãr=¯w 3&!IsÁÀF3 ¤0Outlfboundsjœ%1aòRaises(ValueErrordÇ , z?=24=#�/=-|$oO=100%´E 00II‚m³}_comparˆPt1 = 5( ‡t�„ålt1, t2< +¯%F%R„ÀEqual(t1, t23) öt2 = t2.replace(tzinfo=FixedOffset(0, "")3õ self.assertNotEqual(t1, t2) Xò# In time w/ identical _á objects, utcofÅ is ignored.EÃclass Variesš%):ÂÐdef __init__(™ $.f=”ödelta(minutes=22Ü0T˜U?, tX +Y1X\wreturn “34v =ì9/t1 v"Â"n±®.á/),3ñ@2@4@ .öBut if they're not6®, it isn't#À4…�True(t1 <³“ # t1's "òcounter still going up¦ñtest_fromisoformat# öÙ_examples = [²O00, *),b23, 599"]ƒEöhh = (9, 12, 20  mmG5, 3s„f(4, 45*@usec,÷0, 245000, 678901à Èð+= list(itertools.product(hh, mm, sÐHsec)DO‚R[Nonek@zoneA ÿÚ! Œ!(©‡hours=2)-(156, ã77))A¢for ttup i¤® ]'!zi&È ~" =Î1the¯ (*Z,êF=tziv1@tstr×.D4"Bwith\€subTest(8=n*Lt_rt�.¬> w=& , Qšü_~?—Abase �(µ 30�ƒ, 217456b‰"tz‡2 §i5¸# S 4 , §?ë32, seconds=30‡ e2w4794croG1123úõžÁ+= [-1 * td �dŒ$ 4·6hÀ À timezone( ódelta(hours=0))] Àtzinfos += [*3÷d) for td in tzoffsets7"ziB:SZ�t = base_T’.replace(mZ=tzi).östr = t.isoformat()£Pðwith self.subTest(tstr=)z.0t_r�0Ötheclass.from`: …9Àassert t == E,‹™def test_Iá`specs(o�ú_Ys = [kÿ(8, 17, 45, 123456),!0,�K[UNone,ðJ.utcMÙ ;-5)2 21Ú6, minutes=27€1ime?%'¢C', '. �seconds'Õ +5lli%4cro2³`ip, ts¶‚enumerat ‚¼0tã$`_tupleUó”/ if~ ==¥µ-1fnew_miР= 1000 * (twq[-1] //)<-d7 0:9<+ (c,zG Q%(*„â0:(1 + ip)]), ›æJî9„?=tsÅj%AÓ.rEqual(t$Mfailqbad_str² ì4'',o ê# Empty string7?12::ý# Ends on a separator>/30A>>15.‚>6úÑ# Incomplete ·> ;@=?0:1@ == =èa:30:45.334034E=ðvalid character¿aEÉaŒÀ # Inva÷ lid character in seconds ÷'12:30:45.1234',ÿ # Too many digits for milliK7567NK?croKb+24:30P`# InvaÝÿtime zone offsetÙ?56-CnegativB¢ï¼š30:45|ÿ # Uses full-width unicode colonh0․j(56RK`\u2024«@plac•ß decimal poináaJ¢ð # Extra at tend of basic 3' JFEüK 8456NKüK“+12:00:30TO† H%] é·abad_st %s:!6ówith self.subTest((=)0 4ÿassertRaises(ValueError48gõtheclass.fromisoformav)¿™def test_%À_fails_typeeg(Ql # ÁY the 8 8p when p³d$`wrong N’import io‡µ$es = [b9ö', None, io.StringIO()ˆFæR ZŠ£V?TypU.QrR 1subŽ Kh TimeS"mv%V3Ztsc ==ð12, 14, 45, 2037ptzinfo=�ÏU.utc)Šktsc_rtG 4Ftsc.B)ê�G²Equal(tsc, Td& IsInstance+I_rt,À[—7_½$tz>¾?C4ætheAnswer = 42>Àið__new__(cls, *argK*kws|0ötemp = kws.copy(äe = *a.pop(''*Presulz^�OC.b1 = Žrreturn oÿqnewmethC, startùEÀ start + selóf.hour + self.second ðargs = 4, 5, 6, 500, FixedOffset(-3–"EST", 1):Rdt1 =U theclass(*O)]rdt2 = C÷, **{'extra': 7}KšñassertEqual(dt2.__TV__, CS+ßtheAnswer, 42, �?, 7' b1.utco0), �; Á2.newmeth(-7;1€3dt1 -€ñ' # Testing datetime objects with a non-None tzinfo. 8°DateTimeTZ(Gð, TZInfoBase, unittest.#aCase):Ÿ³% =|Û@def 1�_trivial(r54-dtö†1, 2, 3,F^ Q.yearMQd.�.month, Ð .day, 3’ €?, 4% Ÿminute, 5' @?, 6' Tmicro, Û , è…üeven_more_compare�R# The±"R) and :õ) inherited fromE‡#:*M� covered‰©r cases..6õSmallest possible after UTC adjustment.h:21, e=ƒ–1439, "")to# LargsŠgú°(MAXYEAR, 1¾ÅR3, 599,³é ª-«;ó# Make sure those ª± correctly,y@w/o oFflow-µ¿True(t1 < t!/!=" X2 > tÍe‚1t1,"ô!!2,dç:_ aferö }V1ýV‘Ì2?c3, 13,/ F›3*60+13+2NI`Á(û2Šô# Change t1 not to subtract a 9uÐ1 should be l¢rÉö0²ñ>ŒÀ# Change t1 ó#to subtract 2 minutes, and t1 should be smaller. ó2t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, "")) HDõassertTrue(t1 < t2) kÿ'# Back to the original t1, but make seconds resolve it«01«,‰³x/=1Ð >ЇLikewiseÁRmicroNÆ_}ËM~�t2 naive8$it8Idiff424E.min_N �NotEqual(å s$!!2,^!#„Ä> comparisonŽEfaillHwith{õRaises(TypeError):+Z0t1 Å”“It's alsoû“if it hasõœR.utcoþ–) is NoneŸ= N@(0 }Fdef BÑ, dt): returnO®td…(5, 6, 7Žk)³yz�# OTOH, i OK°…€e two of¿�se mixing @waysWbeingMQ&pØÈ1WòTry a bogus uct—g�B�c/�£timedelta(]Á=1440) # outøUounds?è22, =žÀô1‚0×7BValu�, lambda:!==k¬•àtest_pickling(™º # k@one líancargs =ž4"208�1, 64**2kNö = (*@ÈAfor Žeer, un ƒproto inŠ_choicesâsgreen =$€r.dumps(w!, Ah�–derived =iq.loads(I -.Ù˜WD,(á.__reduce__(),ÿyex__(2)-w tàtinfo = PicklaóbleFixedOffset(-300, 'cookie') ðorig = self.theclass(*args, **{'tzinfo': t}9}derived<21, :=…–0, "", 0)Gõfor pickler, un ƒproto in•_choices:¹Àsgreen =$€r.dumps(Ó!, Ah/³iq.loads(I -³assertEqualWD,³IsInstance(+. 0, Pça˜HtCButcoÈð), timedelta(minutes=ÝTì ¿K�tzname()  5K°.__reduce__6 ‘ex__(2)) ˜ð def test_extreme_hashes(X)»ð # If an attempt is made to 1ð these via subtracting lå#n5"`a date÷ object, OverflowError results. TheFð Python implementation used”Õblow up here.6tú@1439ý¦ë&(tQòMAXYEAR, 12, 31, 23, 599,� x �-ˆJp# OTOH,¢3OOBtƒ should  25, �4 .jÁRaises(Value³,Ý<, tb>zonY esErv, "EST"jhutc = '“7UTC$,meK6%(MEIEt1 =t@(200¨ã, 19, 7, 47, (esê27ê76utc·/t373n'men_U%t1“ —)2) ‰)3){Ëk/2.B ^?3? 6@ <A Wm@- `-D- h -<"1) (t‚ð self.asòsertEqual(hash(t1), S3)) |self.as-2-ot1, t2N!3! O2, t! 2str¼ÿ "2002-03-19 07:47:00-05:00"`?Î?"12??+00?I3), ?3?1?äd = 'datetime. (¹¯, 3, 19, '{3repìÿd + "7, 47, tzinfo=est)é =ê=)12>?utc>é>3>!me|ºðdef test_combine(B!):T÷ met = FixedOffset(60, "MET¾)4ÄPtz = Br(18, 45;5234 �qdpM3.–d-T¥ çDdt, 5†,, thÝ ¨œ!) 6+extract+#ß¿�theclass¯ /‡…³?å!dtž"()R 0dt.d6 +;/tz=¯è¹ @ütz_aware_arithmeticLanow = é(V.now(Ktz55š0-33œˆwest 5:3Iátc = nowù“.replace(íTb4now3 ‰•Iu.@5§4Is(N.l!/55-æ06imeid Á# Can't mix ‘ and non-.)Žð Raises(TypeError, lambda: -=ž= 7Bõ°Å# And adding¦q's does¼£ake sense,Äoor not½ +½.Bú%= ÿ1Sub2ïshould yield 0ãÀ - now, time³delta(0)) ô self.assertEqual(nowaware - f, time<=±# Adding a õ should preserve tzinfo.1&=Pðweeks=1, minutes=12 öcroseconds=5678°”eplus =£" +‚jØ%IsÕ.‘o, tz55U22 =K% +^V Œ2[ˆ `5,b52) iƒ# that -‹X@be wôwe started with, and1!J+¢"beZ›7iffQ‘LÍIs(diffö , 6zRò Raises(TypeError, lambda:ª�œCb6,H eñMake up a random™Fzoneòtzr = FixedOffset(+.ðrange(-1439, 1440), " om3J"ªé# Attach it toüpáô’.replace(ÆF=tzr]Jñ7/õ0!# ý�sure the˜Áerence takesÅö adjustments into account¸7got?xƒBÕ# Expected: —H basq! oj7) -9±9\ =A=A =Ž?) +; hî»z-\G ƒe6c9B.utcë'()… sK)0Tgot, a øTry max possibl%ùamin = VÂtheclass(1, {=?-W"min"ˆg F�MAXYEAR, ¢31, 23, 599,× ~¬K"max™! =ð-ŽZÛ#0max-,õ.Ã-'inI  i§( 2*)"`# Diff£tXQ, but¨Csamez·ðtza = timezone(HOUR,s 'A') ÷tzb = timezone(HOUR, 'B"þdelta = min.replace(tzinfo=tza) - maxbdñself.assertEqual(S!, ìtheclass.min -Aax) ¬’def test_{P_now(@!):Îkmeth =B5now!ò # Ensure it doesn't require Wõ (i.e., that this(•blow up).N@baseFeth(ìá# Try with and öout naming the keywordIö off42 = FixedOffset(42, "42"Ytanotherr5Dgain;tz=*‚3Is(K.ô0, a=S4¶7Butco¦!),:ÏÆ(minutes=42)Eá# Bad argument//o }ðRaises(TypeError, éF, 16g/í=6���e•R j # Too manyösQK!, ÷Øp# We do®°know which ³ ´@ we'Ô!n,Z)chave aÖ³!# k  to repres” it, so see¢1wheg<¸‡actuallyJAö a conversion is trickyõ;utcÙ¶0, "utc", 0¿øfor weirdtz in [ èa�hours=15,‹kc58), ":S,¢:H/( Q6),]^L¨Pdummy¦wrange(3�#¥`= datel.«¤ó(hcIs(nowˆ,3;utcb,()†>utc?0nown40.as¤¤Qif ab�0 - ?1) <€G¯seconds=30 ä]break™a# Else@code?Ðbroken, or mo•shan 30 b pEŸd betweenRµcalls; assupólatter, just tryï >Jelseë¸ñ# Three strikes_m6outå+ËPfail(âö ),/A(tz)Ôl’) may be ó"ï æ@from \stampðaimport‰Í àfromtimestamp   ts = time.3() õ% # Ensure it doesn't require tzinfo (i.e., that this(•blow up).Nèbase = meth(tsfÁTry with and öout naming the keywordKö off42 = FixedOffset(42, "42"Yvanothert!, 9"Hgain ;tz=#ãself.assertIs(S.þ0, aAW4UEqual7Butco®!),rödelta(minutes=42)Eá# Bad argument //o }ñRaises(TypeError,}†, ts, 16k3õ=:¥ —e¥VH v # Too manysUÅ ïV?fewU%) Æ # ®t�1ke Átz= actuallyö some conversion¿a¤stamp = 10]putcdate&4 = €.utcfrom=( Äð# In POSIX (epoch 1970g÷hat's 2001-09-09 01:46:40 UTC, give or tak½‚# But onËðflavor of Mac, iQÁnowhere near°. So we ca)EhaveÙ # ËQidea 5w01ime:>3is,B� only tesX'atJPrelatµÖchanges matchdeÖd´hours=-15, oð39) # arbitrary, bwuot zeroq+tzi`–, "tz", 0†¸expected = Ì+úX8gotäáF, tz_SYpã, got.replace(©SNone)»1defM_€_utcnow(Q%):”œ0 = �.theclass~5now$Gèe`; for NÇever reason,¬è)˜—„accept aÁa@< ô]$gIÕ2� ǹ +WÃpimport "@Ì×À.theclass.utócfromtimestamp Pts = .%()õ$# Ensure it doesn't require tzinfo (i.e., that this(•blow up).Nèbase = meth(tsfÁTry with and õout naming the keyword; for whatever reason,`J# utâ%()�„accept a¸†argumentŸö off42 = FixedOffset(42, "42"­ñ self.assertRaises(TypeError,Ûa, ts, M6T==Ù’def test__¢`tuple(Š!):%Èá# TestDateTime4¡ed most of›p. dateBP adds pwist tofJ†DST flag¢class DST(ˆy}¦�__init__™«, dstvalue*.äif isinstance()_, int.2$¨ädelta(minutes=o3#.% =”ë%¼4dst·ƒyreturn O E cl@1the*±�,Tõ in (-33, 1), ( @0, 0‹None, -1 ³d = cls(1, ã0, 20, 30, 40,Ø=£q)tãA ÀÙPEqualjŸt.tm_year+?mon*?day+ Õ�?hou� ­/mi‚ 0+?sec‚ �w­!, Uy+Y.fisdst)J#¢2() pPs wro6ypeЍ� "ªV"x"))ûs¿_e edgl`91,1pH1439_ ()·Ýæ »O -P Q0/oof ran¾*V‘¬Ë(40Ë"½N<-14O¼sÕ0utc��böIs"'=0GÀ if iÿ sinstance(dstvalue, int): $ô = timedelta(minutes=);Tself.4 = )0def(-?, dƒpreturn "O ERcls =…theclassð # This can't work: DST didõimplement utcoffset.<oôassertRaises(NotI2…edError,/7rcls(1, õtzinfo=DST(0)).p)ÉËass UOFS(DST‹'ƒ__init__,ûuofs, dofs=None1�KDST.5/ªPâ 4ŽÃ�»Gî0forø|� in -33, 00, Ï ŠCd = Pó2, 3, 10, 20, 30, 40, `>E-53,\)ºtˆÉjtuple(!÷ðEqual(d.year, t.tm_ 0Smonth1?mon04day.?day/ #11,ùhour) # 20mm + 53mm = 1hn + 13mmš Ö#13G/mi¡csecond1?sec£ ³d.weekday()4wØôd.toordinal() - date?)?+ 1w # « tð# Ensure tm_isdst is 0 regardless of what=€() says:0 K#6Pnever·peffect ÎQa UTC!E† |¯M„±# For naiveÿ£,› ¬" =‚ Rexcep|K§. ¿ ¸¥t[:-1], d.‘!()R 5 í�# Same ifà{XúÇÌ/ Nƒ Z! O|B0ipCheck tŸ3badñ4‹detected8B8À def utûcoffset(self, dt): Åreturn "EST"õ d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=BOFS())8hõ.assertRaises(TypeError, d.utctimetuple) 6Ø# Check that $÷() is the same as3 asK zone(utc).Y(�Ç 20ÀP11, 1Ìö4, 15, 16, 1718192°for tz in [Q_e.min, 7utcJmax]Tódtz = d.replace(*&tze‚*™Equal(dtz …()[:-1],ó6 6 ¦ L‚A# AtXõ%edges, UTC adjustment can produce years out-of-range’ # /`a datezò object. Ensureѱan Overflow ( iÇr'%d.TCtiny}�MINYEAR, ¸1, 0%37}U}G1439�0# TEðgoes back 1 minute lesKÖan a full dayw�¹ ´ò)ny ÀDhuge´#AX´8?p3, 59, ¸9 À-ÁforwardÄ6¨ ÄQƒ# More o©V case§•  Û0ime)w(MINUTEŽV!’­UO.maxt-uZ ’def test_³’_isoforma?;Òzero = FixedOa¶0, "+00:00"fKplus(2Eh"+03:4*¤ +×-231, "-03:51V{unknownY‡None, ""— clS„vtheclasÒ³ñstr = '0001-02-03'�Ø0ofsYó , Ñ,Q3s, ˆ þ9u8š0, 987001!^—^B4, 5'%us6ofsK7g¸ò4:05:59' + (us and '.t~' or ''@2ofs?Þ`s not â>¢d.tzname()?zBtail?ˆ"+ R + is#&d.E�›.Aiso,Ne@+ 'TÜu?À.isoformat('kT')) ÿ+self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstrLk\u1234QVZstr(d˜ ˜å@def ¸�_replace(ê!):`cls = •.theclassöz100 = FixedOffset(100, "+100"ù=zm2)ð timedelta(minutes=-200), "=0arg‚ð[1, 2, 3, 4, 5, 6, 7, ‚]�Àbase = cls(*7‚À¿+ , .ù5)) JUi = 0õfor name, newval in (("year", 2),*2 ¿("month", 3+day", 4)0hou~5*aO", 6,¯second", 7,Umicro181‘tzinfo", )f40newµ0 = &[:ØS[i] =‡ v„expectedNEZgot =ö0**{Û:T}1 8gZ, got,fi += 1Dò# Ensure we can get rid of a .à i› tzœ( S2ÌUV=None›Z Is(<.-(„ Úvadd oneÎb3ž2ar=´wY<š3&!IsÁÀ* ¤0Outljboundsœ% 20®_2, 29kòRaises(ValueErrornÑ , S=2001yMpmore_aså=zonUÀ# The inheri´�/ð covered some trivial and e†W caseÒ@fnonøˆé0, "LKf44m±x44, "44%;m5h%-É®w0s=5“!m3æÄd]o*€.now(tz=xbSIs(dt½*, '1# R“óing with degenerate?! r¡Ö an exceptionéŠôÉ6dt.qÐ, fnone) ð# # Replacing with same tzinfo makes no change. 2òx = dt.astimezone(dt.5)%óself.assertIs(x o, f44m&ðEqual(x.date(),b . ƒ. %) ƒ Þ”differentã¶does adjustß=gotáOfm5hˆTIs(goþ/, (Þ+�utcoffset·´ödelta(hours=-5)g�expectedŽ -=¾õ in effect, convert to UTCD!+=�.B0dt)Dàand from there@`local ›G$= R!.r;"e(ú=û0 # P£attach newjIè,[ 6¡D‘6-tz8: ám%3ÙÒ–Ð@support.run_q’_tz('UTC'I–def test_\Ð_default_utc(%):Md©à.theclass.now(—ìX¶(‘¡ ÃANonev2.ŽÂ# Note that Þð in TZ variable hasbà opposite signn4Dóproduced by %z directiv{=ÿ EST+05EDT,M3.2.0,M11.1.0ReasternVó(2012, 11, 4, 6, 30,Ù=mC '[ !, 5$ P.strfuö("%z %Z"), "-0500 EST"? Ç5Ç�4ÇDÇó>œnear_foldõæ# Issue #26616 u}1aterB2015O1, 5 œu%›Is = @7¦\sDL,Üware_subtractÙ clnýàtheclass ð0 # Ensure that utcoffset() is ignored when the operands have Dõ# same tzinfo member.rclass O>¢DependentOk4%):.P7defŽ{self, t$(úif t.minute < 10F"ù# d0 and d1 equal after adjustment}3òreturn timedelta(i$s=s)7Oelse„r2 off iL]weeds@w E59) 2óbase = cls(8, 9, 10, 11, 12, 13, 14,�=z)ÀPd0 = Sƒ.replaceì'=3$1$9$2$&11%Pfor xªd0, d1, d24!y! 'µgot = x - y¯expected =¾x13- y œ>s€.assertE2d(got, Xˆ€# OTOH, Šhös are distinct,Ò&n'w#m5Žá ·ÀáEF#KPif (xæ2d0 �Qs d1)'&(y 1|' i0˜$@elifô"s P ñ#O ;FJÀ�(11-59)-©Á À su#0-wmðtest_mixed_compare(<�tÄ@date¶ö(1, 2, 3, 4, 5, 6, 7~tª+e kt1, t2L%t2>ÕV=None%F%Fñ.RG, ""¼WÀlace(tzinfo=óFixedOffset(0, "")) õ self.assertNotEqual(t1, t2) %ñ # In datetime w/ identical tzinfo objects, utcojÅ is ignored.IÒclass Varies(;%):“Ðdef __init__(� $.f = ”ödelta(minutes=22à0T˜U?, tX +Y1X\wreturn “74v =ì9ót1 = t2.replace'=v"2" nµ².á/),3õ@2@4@ 2öBut if they're not6®, it isn't#tþ4…�True(t1 <·“ # t1's "òcounter still going up¦�test_subœ_æ!tz)"):)ë!! CA.the GætheAnswer = 42<@mð__new__(cls, *argK*kwsH0ötemp = kws.copy("Pextra-‘emp.pop(''*‚result =©½.�yC.b1 =  »’oÿqnewmethCo, starˆE1 + îDhour Fyear\Eø = 2002, 12, 31, 4, 5, 6, 500,  -3‡"EST", 1ådšm (¢ d�CS, **{qG: 7}KE adt2.__1V__, CS+F7, 4Ì,ˆ?, 7S 1ß�0; $2.µ“-7), dt1.Œ ‹ -~ô # Pain to set up DST-aware%Pes. 1firyônday_on_or_after(dô days_to_go = 6 - dt.weekda 6if %I9dt À$ëa€dt ZEROB2imeE™0) MINUTE[y1) HOUR‰s=1) DAYw?pthe US,ùñs at 2am (standard·@) on6 0 Su õ in April. DSTSTART =’(ñð 1, 2) # and ends at 2am (ñDST time; 1am standardñ) on the last Sunday of Oct, # which is#7fir$ n or after-ú 25. Because we view 1:MM as # being{zpat day,a rej€no spell0�in local«P of #(¬@hourªÝr(that'sp‚DST, but¼zaken asð). DSTEND = date!ðP(1, 10, 25, 1) class USTimeZone(tzinfo): def __init__(self, hours, reprname, stdname, dst!):;?2Á.stdoffset =æ`delta(Ý!s=)0Z4 = !q3 = d‡õ ËR˨qreturn ¯"Ç6 tzÿ'dt8"if4Idst(ýU”©Felse' .×/ƒ2utcC…hl+šÍ«è), ±Pif dt�@Noneø2dt.  ¯ó!# An exception instead may be sensible here, in V@moreæòòacases.òÙEZEROyassert žÏá:y# Find ˆin April`@star‘'!_sq_on_or_òð (DSTSTART.replace(year=dt.)³‘Pð.weekday() == 6 and’€rt.month4‰M<= 7¼ª in}Fober½Rend =â»?END¹?end·µ!10¶´X>= 25µð Can't compare naive to awñobjects, so stripáŒzEfromÞ#…“íd­ <=÷��=¯z) < end¡=EHOUR_vc¸ Eastern =S-5, "�", "EST"ÌDT") Central4C6, "4C4C4‹MountainhD7, "aM4M4|PacifichC8, "hP4P4ñutc_real = FixedO†ð(0, "UTC", 0) # For betæ0tesÇpverage,äñwant another flavo’CUTC ‘w4¸(/˜ôë0s. ’Kfake’S-12*6—›œ@TestžCð Conversions(unittest.Testñ#Case): # The DST switch times for 2002, in std.2Àdston = date-((…4, 7, 2)$.ff%±10, 27, 1) (‡theclass*‘# Check ayÑ that's insid®‹@ef c(ñ(self, dt, tz, utc, ®#ffôø+ó .assertEqual(dt.dst(), HOUR *ñ# Conversion to our own™ò zone is always an identity¡@j as:>@(tz)³qPasutc't.(2utc\Tñthere_and_back = 4/'tzR Ã�UTC and =_isn't d,§s¡# because }ñ are redundant spellings (in local!G) ofCyúQ whenv€begins: V÷ clock jumps from 1:59:59B±to 3:00:00,Ãamñ of 2:MM:SS doeØgreallyA‚make senÉ1n. †åes above treatK'as?�daylightÞµ@n (iœâ"after 2am"), w9aliAZ1¥sstandar^Š0latH@formZGwhatc‹½&V†producesx0if Ô‚ate() == .¶!();@dt.hÍB== 2 èp# We'reü(thç0xbcomingB…¤@“Pgives# ð-4³< /oì+ 30à# Although durœawas co30red»bÓà ³”,¯Zois not¢GFZERO²§lyYVAsameFØO UTCf ©j dL›Oelse?not« ‚?· �BIŸwe have aI "š( i�à(unfortunatelyÖ ¢<0end‚Pat caæ"beª@ed aôEl in#KD. W£E wto 1:00MDagai_–ô haVŠ©athen: &óAtakej'beO ,Nò== 0:MM EST, but:is HÀ # daylñight time. The hour 1:MM dayl@== 0óstandard can't be ô# expressed in localU÷Nevertheless, we want conversion backJófrom UTC to mimic theSñclock's "repeat an°µ" behavior.I@nextÌ�_utc = asn+ HOUR$Xtz = 20.as…zone(tz)2ôif dt.date() == dstoff0andw%0:8(p# We're!Ò&bbeforeâqast DSTÒ�l M°is ineffabl¼WY[ ]J1Ù$–õself.assertEqual(0tz,΀replace(°6=1) >-^=_ !c6•'JelsewL a - dt,¶!) `‘# Check a¿ð that's outsideŸ>Pdef c)(f/ , 7Futc)† cC£st(), ZEROzø6# C0to Œ1ownŒŒ  is alwaysû‚identity“@j ʤq@ting'xÆ”m$n fF toojP=!aøG�¡there_and_N„Z»,C¸|'Át_between_tzi3utcІ«An = i .Ûxtzinfo=é’# Because  onŒP ends°taken as beA!<, #<ù s no spell.�in tz for ëd0 ofh{Iuà# For purposes)îAtest+ DK!isº¨, which is” ¼îs (-æLFime)¨^(ffl/ffm Pdelta(�¦(weeks=13)LY?DAYOHOURbŸminutes=1c,�crosecond1"):2ŽX in-(n,,n*ffG#ur91 + 1«#WyJzÐ ÷self.checkoutside(dstoff, tz, utc) Cfor )@ in ,¡n - delta,Bff +::EmLn5àdef test_easy(7)Nñ # Despite the name of this4,ñ endcases are excruciating.aŽñonvert_between_tz_and_utc(EasternV_real ’/.c;Pacific;! vOfakev$ ;0# T,pext is Íòly dancing near5õdge. It works because2## ÙS and ªbðfar enough apart thaÇeir "problemGÿhours" don't overlap™ Ž" ¼:a# OTOH<±se fail! D Qenablm1m. H difficultyNëÜ•Pedge €’ps assumC�at every =‘representd+inI±"utc" class| is5Àalways true ’÷a fixed-offset tzinfoJ@P (lkeÒÌÂAutc_(‘, but notO¶ or CentralœA# Fo-ðse adjacent DST-awj¡time zonesKR rangŸ sšåáed ends up cre¥sbN#on;0are1 4M!inÆtother. © s"òreason, we would seç4ureiK%vsó«€s too ifGñadded 3*HOUR to{wlist ofIóh6)gCm ¬,­p) # ca*ÇJî,Û JKœ_trickžð22:00 on day before Ælight startsé±fourback = èRIV(*6s=4«Àninewest = F÷Oöö(-9*60, "-0900", 02e ’.replace(-=U5!# ÉOu7ÖqUTC == â0EST 3ñDST. Since it's "after1lA# 2"}!sh~g§©he 3 spell˜1# IaBplug„\NDinto¤÷, it "looks like stdwH¢", so its ŽÀ is returnedó as -5, and -5 - -9 = 4. Adding 4 ð# to 22:00 lands on ÷, which makes no sense in local time (theJðclock jumps from 1cð3). The point here isbx sure wMõget the 3 spelling.kõexpected = self.dston.replace(hour=3).ðgot = fourback.as¼Õzone(Eastern);¶tzinfo=None@cÄassertEqual(u, got) ið# Similar, but mapà6\€UTC == 1 0EST fç DST. In thatI0casB wan: osixutc36, Õ†utc_realÙa# Now  ñ "looks like daylight", so„³offset wrt 3¼7-4,²la^@-4-0â�-4 givesDïÁK WeÝ7ESTO*ví1ÜõóJCoÀ9у ends, wá°"repeat an š¦" behaviorÐ0# !� 4:MM 567Pcheck¸Hthes% L!23%01E2:MM9Œ# EDT ! 9'Jwall'N� againsŽ„@for ‚ ina, Ufake:]n+ tzCEš, Pacific(,�irst_std_4óAff -~Qdeltaíqs=2) #  rJ€# Conver¹ at‘6UTC{#fq’-= tz.utcû(1�# Adjust Û�possibly úÐe as++= m+1mF¤ZIËcÛ`; this”4a1wheŽ=ó/ &3tz=ˆ©b„!= µ "6utcl !tz±�in (0, 1.2)á0ÒihË%ffoM=TpDtQminutœŸ0, 30, 59q1u4 = €rM=tG A#$tz@¡/tzu"ŠCastzºÀe(tzinfo=Nonÿe), expected) ñasutcbase += HOUR (ñ def test_bogus_dst(self):I÷class ok(tzinfo@‚utcoffse;Ò, dt): returnk)1f+w`now = ŒA.the…ã.now().replace�–=utc_realøø# Doesn't blow up.Vò.astimezone(ok())  96~Ÿ notok(okÑENonezÊ÷ assertRaises(ValueError, now˜l œ@Someºs¡ò In the following, ¥.‘ôimplementation may¡¥0 orÞ Ådepending on¾ò# whether DST is assumed to be in effect. ”qis situn,F&a öp should@rWd by �)·�tricky_ˆxÜöif dt.year == 2000ç ¼ DOelse6 110*`M,dtÈp(2001, Î9 )dt8 #?sä|fromutcâb4TypšƒEastern.<Q) #-µenough args%µ1dat©O.utc³ƒ(+, „£w) # wrongó „Q )F inŠŒ correctDeÉ2ü@(now>Ú:# df‚Í`Equal(O.šÍÀ„has righ€ memberI4™ZŠtoo manyŸ™PÇ€.today()Tn8ype2ðAlways converts UTC�standard ² ɰFauxUSTimeZ† [x´0ˆ ÊBdt +12std‘+FËK = ~T-5, " 0", 1ST"9DT"Þ� 4:MM 5678E9:MMx‘# EST 23012Q 3ODT - ð 5:MM ó # Check around DST start. õ = self.dston.replace(hour=4, tzinfo=Eastern);f<S7/F0õor wall in 23, 0, 1, 3, 4, 5:W™€expected™ ]”E‡0"ifZZ== 23KOú-= timedelta(days=1Icgot = »‘.fromutc(é )0ÄassertEqual(d, got) Ï5$+ ©.stdoffset3‰%Š?‹(°# Ensure as Ôzone() calls eV) too#B�~!ê§utc_real).Tº«(v‰ += HOURˆï6endÊRí%ffÍZîDêB1, 2ð ¢:팤ÿž/ #9p # oddb·“ class Oò(unittest.TestCase):�@def Ð_bug_1028306(É)‘ð# Trying to compa+P datea 9÷ should act like a mixed-�CtypeE°ison, despiJ6hatJ‚is a subÇ!ofµ1as_=ftoday(W”# “.combine(,ø&()8ø.Á5Tru)C != 4H0%40FFalsa=a 1b5bð Raises(TypeError, lambda´: as_date < stime) õself.assertRaises(TypeError, lambdaD:HD#? <=‰5IŠ$>‰4Hˆ%ÉaE#:% >I%) áð-# Nevertheless, comparison should work with the base-class (9�ð # projection if use of a 'õ method is forced.‚ccEqual(“t.__eq__Ãg), TruŸôdifferent_day = -.Õ+ 1) % 20 + 1o^6 ^é.replace(day= [æ®_‰), Falseo2And_qeb‘other subb esA?u. If aÅ#$ð wants to stop this, it's up´PVdo so}]s_sc = SuEDateGTyear,f.month?day,í?_sc+…Z 0PDitto5I¨s¿ÃÇ .ËÏTò80ateZ2, 0Ô/i & ð def test_extra_attributes(”%):É for x in [Y•.today(), â^:.utcnow%!_delta_zinfo‡imezone(D&)]ĤtÜ �Aù†ø4@x.abÒ1æ8Þcheck_arg_typ7sz Number‰B�__init__m, value|¯" =% wJIBvreturn IÆÙÙÚ‚ecimal.D?(10á" d (ð'10.9'),  ØNumber(10)]: ÿself.assertEqual(datetime(10, )),CO COxx, 5)) DWwith ˆõ"RaisesRegex(TypeError, '^an integer is required 'J~úr'\(got type str\)$')ÂG'10'³ef10 = U5.9)„Îÿ __int__ returned non-intÐ"Ì_floatÎ7f10Ípclass F=(C Epassßsú-/10ù"Äÿargument expected,û 'ɵÄsö¨q .õ MLQM5QM9QBUFYJ]/ #9ñ # Local Time Disambiguation # An! ri,¡al reimple$ð of fromutc that resPòs the "fold" flag. ë‚tzinfo2("):‹%deH(ŽG, dt"¸ in UTC -> lÄ:"."Q‰õif not isinstance(dt,8_-rù ó#("×$()í5s a= @"îbif dt.Ø$|Ì ÞhBValu\/("5X4# R¦v7– satisfie#Âðdt + ldt.utcoffset() =G0offB°dt.replace(¨8=0)4.01 =Û .1.À if off0ø is None or off1„dt.dst()7: õraise ValueError ifJ@0 ==16 ldt = dt +05Y€ù= ldt.utcoffset()#\ D`returnD8ð# Now, we discovered both possible‹‡sets, so7öwe can just try four4–solutionsáfE  in [off0,Y&1]!¢ o if¹ýE B+è]Bíreplace(fold=1F#eh« ú ("No suitaL local time1ð nd") # Reimplementing s�ified US-ðzones to respect the "¾ñ" flag: class USTimeZone2(tzinfo2): �òdef __init__(self, hours, reprname, std 0dst )\2B.stdz! =˜adelta(G=K0Z% =eŒŽ!q$ ={ ‡‘Ë]˨ü^"Ç6 tzÿ'dt81if 4Õ ¬U”©Felse' .á‚Xo), lhl+šK«E ifC»2dt. ¬ # An excep²ò instead may be senPhere,¾0morú#™icases.ÙEZEROyassert žÏáOðFind first Sunday�VApril`@star8'!_s'ô_on_or_after(DSTSTART.÷€year=dt.)³‘P .weekday()þb6 and Pmonth4šM<= 7¼)la»vOctober½Rend =â»?END¹?end·µ!10¶´X>= 25µðCan't compare naivex awRobjec a stripïΡU fromÞ#…“íßÏ–=c†‰Ò�+ HOUR <Z< endgP# DSTÓ–in effectj>tE–@elifJV i]À # Folòd (an ambiguous hour): use dt.fold to dis#gate. åreturn ZERO if4•else HOUR-óelif start <= dt <+(:)]ô# Gap (a non-existentœÁreverse the ¡?rul–� –«m¨ {¯DST is offëô Eastern2 = USTimeZone2(-5, "�", "EST"ÎDT") Central7D6, "7C7C7œMountain2nE7, "gM7M7~PacificnD8, "nP7P7ô( # Europe_Vilnius_1941 tzinfo implementation reproduces‘’lowing # 6Qransi+ð from Olson's tzdist: # # ;P NAMEüó GMTOFF RULES FORMAT [UNTIL]3¥/¥¢ 1:00 -B0CET Ð1940 Aug 3 # 370MSK"¼oJun 247nÐC-Eur CE%sT ó4n×£$ zdump -vP«`| grep.1mQ Mon {¡3 20:59:59+i UTC =3»ÿisdst=0 gmtoff=10800c Éóc%00!CEd1d³7200 classè 8(8)g�def _utc_ºS(selfuM [datetime(“Ã, 6, 23, 21,„=8I, #  Éæ\X2X]X'2:AUTC YÊ/loÊ"3r Ê“t× / zxÉÑJ4, 0^)] Ñ!4 Î_YZÒ‘utcoffsetœG, dt ´_Ä,z€_stop = �%._ )N¤$ <-2artñ13 *8/op7-(2Ý,3)K#$4 >=†%oph€25/dsZ0� 91ݨÌ/ 0Àop rñeturn 1 * HOUR def tzname(self, dt):Ãfold_start, Pop = +`._loc_%()1tif dt <-6artMQr„_'MSK'5/op4(5Ð, 'CEST')[dt.}]G"# ~$>=%opy=ûfromutcüsassert gU == 0N‘tzinfo is!ŠÛ.year != 1941Ôõ aise NotImplementedErrorBÜ{/ut{%ddt + 3”°¸ƒ=2= ).replace(¬&=1Š Kð class TestLocalTimeDisambiguation(unittest.%fCase):É�_vilnius_p_ÛÓV$£ = Europe_5"()Rðgdt = datetime(Tò, 6, 23, 20, 59=%†zone.utc lEdgdt.as"(r&OTàEqual(ldt.strf3Å("%c %Z%z"),¡ ñ'Mon Jun 23 23:59:59x¯ MSK+0300'p Å?, 0&QFalse–_dst()&?1, ‚R00:00?+02åµ?Tru 2v2Tue<!4 %=x:est´$to�²!m²2®¶” ‡ò|­ƒØý²ã ²°1­°GUTC'aÕ 3ÕÀ gdt = ldt.a¤stimezone( s.utc) ð self.assertEqual(gdt.strf/¥("%c %Z"),07õ'Mon Jun 23 20:59:59 1941 UTC') :¡ldt = date[#r, 6, 23@59, ötzinfo=Vilnius, fold=1²gH_ldt.aÝ[1Ý!j4, 0, ÔÌp}2:00:00©ðdef test_constructors(%%):ÊÈÄ0ž�å1, 1 ÅR w t.#', é $d%Wwith *÷Raises(TypeError·´·0—£0, None, 0¨ÿlmemberùÝ 1dt.lì¥jÎ:?tz(<—¹|replaceºY�0Uΰ]«?=1)³5)t.40i¼ �d5Ó# Check that cðment of other fields does not change "ñ!".jF; = p1åvEasternIh0 Ü;Hµ1 ç(: A# Oufboundsê_OValu` »2J ÑK È›ð is a keyword-only arguÜ´€)ÉÁ1+pSÒT Ö´Ò¯comparisonÕÀ datetime(1,ƒ 1, 1) ÿself.assertEqual(t, t.replace(fold=1)/_dt, d1aàdef test_hash(k!):}¦t = time(0_dAdateª­ XBt), ¸Z} è2d<Ä!) ¬ò @support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0'sú@fromÍ\stampás = 1414906200nddt0 = .Ca(1(g + 360] @dt0.â/, & 1&1 ÿAustralia/Lord_Howe  _l'Lhowe`tm = _6`.local f(1.4e9ü#if"Astrf!ö '%Z%z', tm) != 'LHST+1030't6¯skipTest('·—Ãzone is not óed on this platformâX# $ TZ=PËÇ -r 14281587ìõ# Sun Apr 5 01:45:00 LHDT 2015^?605^S^‰ �ˆt‡ /18‡ _t0, t“ §t¦¸S´ �Ð(2014, 11, 2,[3Kd,t0˜ÖŒ~“{)Ä,1i Gdt1.1¢-Kž½ YZa, 4, 5´&45Xs{ Ð(0)cŒs÷ +1+ fPs0 + ?, sW ± as¼¶ Oàdt0 = datetimeó(2014, 11, 2, 1, 30) ö dt1 = dt0.replace(fold=1"õ# Convert both naive instances to aware.SCadt0T¶astimezone(Qat/1. õ# Check that the firsts€ in DST VA and#`second5STDŠðself.assertEqual(›ö.tzname(), 'EDT'™/1/S/  0 + HOUR, æ[0# A%Åñs with fixed offset tzinfo's always have Ž0Ò %', ÖÊ'Oðdef test_pickle_(9!): !@t =  dAdate1W"1,®<Bfor _Ur, un Pproto®†_choicesy}=x%z[t, dt]"4s =_¡.dumps(x, \z(6y =‚Ž.loads(s' 3Ox, y'R(0 if|À < 4 else x.UB), y  YyOreprr= Àetí¯.´E0, 0± AAdt),½K '[ ( hFgapü>gapû²ù 0gapø?gap÷%0gapÂNõ '2 ó­hash_awareì èä ]R(t), �.replace(A8=1)ç r?2, U™(-ꯓ½ÂE6gapDõ@ SEC�imedelta(k0) ˜ãpairs(iterableƒpa, b = –tools.tee$5Ânext(b, None"°return zip(@ò) class ZoneInfo(¼c”0rooéÀ'/usr/share/’'e¡�__init__?0, uØiEº6""" ñ:param ut: arrayF&Að of transition point estamps1J…ti: listIJ÷ (offset, isdst, abbr) tupleK:,I¸MÜu uj!ti¹6l* sinvert(Ñ@staticmethod9G *jL(-@('q'a"),=à© if\U¦ð[0][0] // SEC  ólt[0][0] += offset Olt[1ù for i in range(1, len(ut)):GLjijRti[i-Yo// SEC.61][.… ,¡return lt ?Á@classmethodðdef fromfile(cls, 7objž$ifú .read(4).decode() != "TZif"Íñraise ValueError("not a zoneinfoQ!")ƒùu†.seek(32ücounts = array('i'.¿E6, 3$ðif sys.byteorder±Z'big'°g'bswap()/›/ut~/utzH?[0]‚/ut~·type_indiceB"’ n0ttiM%[] ¥Ç'1] 9õ .append(struct.unpack(">lbb">)76))I@abbrw§#j'2]) # Convert p ¤ð, (gmtoff, isdst, W@ind)c enumerate(: ½)ˇ[ @ind:†s.find(0L]á~ÿpÀ= (timedelta7’)“ÐÔti = [None] *þY{[, idxÂú Ê1] =V[idx]®÷self = cls(ut, tiˆ #1Bname ~ path = os. P.join(.Øaroot, 1Ý with open(0Ê, 'rb') as f€›7clsûðEPOCHORDINAL = dßô1970, 1, 1).toordinal¶Ô@utc(íG, dtÄ0"""DÂraUTC ->W`local B.""",0if Çåisinstance(dt,:c-4Typ¨“Å) requires a=— argument�if dt.tz1!is|Ð ; k5"N›Ú stamp = ((/C0 - d.v•) * 86400ØF+§Ÿhour * 36& ¯minute * 6L gsecond±!ifŽ´<¡uw tj¿Fti[0ß«vfold = xJelse@ðidx = bisect.bi÷sect_right(self.ut, timestamp) sassert '¦[idx-1] <=0/¤idx == lenaF) or4( §wdelta(0" -‹!ut‹61])*Adt +i[!if”:•ðreturn dt.replace(~&=1LOelse4 KÁdef _find_ti_†, dt, i)6Í×ô(dt.toordinal()ÈñEPOCHORDINAL) * 86400aÿ+¨Ÿhour * 36¯minute * 6<fsecondÜl�L`lt[dt.üŒ60 biŸ.¦l¡¦NR`ti[max³H†- 1)][i]3‚utcoffseô41I\V&0)B/ds<EisdsØ =Öõ(# XXX: We cannot accurately determine the "save" value,ê³# so let's ¬÷1h whenever DST is in effect. Since?Ðwe don't use Ê)/Ðfromutc(), itCPunlik•Gthat?ðit will be needed for anything mor¾�an bool(`%).@³‚ZERO if 2éV HOURbetznameÕ¡2¡²@classmetho'@zoneRps(cls, ‡dir=None\$ifJ 7p = cls.6rooð_tab = os.path.join(`dir, ' V.tab' :tryef?"pe7O,êexcept OSError7Zijwith f#©l^,inÞ = v.strip(z !if P and ½-@artsrG('#'P2Qyield=£.split()[2•²Cstat®Çstart_year=1^@counoDgap_ H Uzeros— min_gap = 31imeìE.maxG4max+3ax_+¾"MP_datenV5M.min;7 +~Tœ h)ZÀ= max_fold_zÃone = None  stats_sincðdatetime(start_year, 1, 1) # Söing from 1970 eliminates a lot of nois`ôfor zonename in cls.Es():‰�©count += 1Atz =9yI(B)(l�dt, shiftmÝtz.transitionnr‡if dt <  “%vcontinuÙ#ifpo> ZERO>Ogap_ÝDAif (¹ó, dt) > (max_gap, _ž 6>+" =• $(_I% =¢0ƒ_ = dt.ÈNa.max -×b< (min×LæCæ(æ0šæ%elô<ôOfoldõ ñA = - P] 40ax_,5)617 w¦$, Më/inë)ë1ž"/se _zeros¨Us = (2!, ÷>', @üÐprint("NumberƒÖ s:q¡ %5d" % A4�):4Q = %dˆAs) + ‰ ŠK)" %¶a((sum(NÏ ),A  ˆtMin gap´À %16s at %sÉ %sÃ; ,$, û)_/ax_qj“_!in¦¿¾C­ Íb/axbаbÀatetime, maxñ_fold_zone)) def transitions(self):ñfor (_, prev_ti), (t, ti) in pairs(zip6P.ut, ?G.ti)CGôshift = ti[0] -O5[0]j'ðyield datetime.utcfrom ¡stamp(t), K¼anondstÙ ½À"""Find all úðs with the same value of isdst on both sides)E."""®["if÷° < ZERO andKU1] ==L&1]·MQ-Rã0[2]á2[2]eÁ@classmethodÿ2©print_all_€Acls,[÷ _abbr=False, start_year=1@coun0V®U�n�tin cls.'s(;-Atz ="#2(+)Q(Udšƒæž , Ç9tz.Æ iE`if dt.Ã' <Ð6 orï–(Y!!=a”P‰continueªM+= 1tð("%3d) %-30s %s %1½5s -> %s" %7V1 (n$, $/, 6é7ßSRAõE,I ¿§2t, Œy=gapÖ~&>=~ }Ozero~12not¿{1 fð ZoneInfoTest(unittest.CCaseWÄö = 'America/New_York'¿BsetUš8‹°ys.platform@z"win32"�Ó@skip|¡("Skipping@Pinfo ™s3†Windows"v?tryM°à.µiÒDÿexcept FileNotFoundError as err`­2%s: ÂL,CæÃassertEquivD}ùg, a, b@¯/ðal((a.replace(tz =N_@, a.<r, id(a.?)),Ÿ_ (bIbIbI)èŠsÀself.tz ð for dt, shift in tz.folds(): !)x!B[0 */V, 0.5 Cú- timedelta.resolution]MUÉudt = dt + xjlŒýromutc(udt.replace(tzinfo=tz))9ñself.assertEqual(ldtÑ>, 1.ag\ðimezone.utc).asÔ>(tzF t`ivDate10s(a[>ldt4€utcoffse£(, `Ô pNone), U%+ MLÏ# Round trip= É£,HÂk 9) Nv-R W¸^&=,S Å‹X¤IB, 0)Ôàdef test_gaps(1cPtz = 5.tzƒþBZ�=9£(œW>^ã¶Á ŠÐ Ë áCreate a localyî inside the gaã ÎX" -ã�§dALessc�ó0=1)8à/() ^ A0A±"At %s." % nB7D9 IÛ¢ *Ðsystem_transiH 8Ðif ('Riyadh8'Ÿ�«yname or à# From tzdata ÇNEWS file: Q# The£s solar87, c8, and þ 9 are no longer distributed.Qñ(y were a negative experiment - that is, a demonstration Nðtz data can represD«ñ time only with some difficulty¾_error¢2ir L@ce iy:ÓŠû caused confusion, as Riyadh¡Rcivil‹òwas generally not=fšose years“‘ðself.zonename.starts׺('right/'))»1ñ skipTest("Skipping %s" % O)´Btz =%tzö TZ = os.environ.get('TZ'7[]EaK:try¦_¥v.tzset(Pñáfor udt, shift†€z.transi +s(ð4 if3.CŠ >= 2037o%ð# System support n‹ñ s around the end of 32-bit§%_tËG#Mñ later is flaky on many sjÓ>]breakT€s0 = (ud@datešþ(1970, 1, 1)) // SEC9s{1"C #B}seconds4ûx`ó[-40 * 3600, -20* ]1, 0,7¾@ss -˜fss + 2CS]б_0 + xbPsdt =ãP.from zstamp(s2ŽO tz5 ÿ , tz).replace(tzinfo=NoneN*ÃassertEquivD�0s(sžm91Œ6dt.±)ÛbŽal(s, s1, if ss > 0:Õ?gap2Ó# Create locazainsideÔ73 C0) -F?/ 2wt´î ts%dt‚fold=1)'`ts0, s<nss / 22 Àaal(ts17-N 70fin› ©Pif TZÖ# _7delÿ !;elsU72)TZ8 ñ class ZoneInfoCompleteÝ�unittest.SSuiteÐdef __init__( ‚àtests = []  ðif is_resource_enabled('tzdata'): &ð for name in ZoneInfo.zone+s(.6ÔTest = type('3q[%s]' %O8, (y,), {})zLn! =; %£`method¥@dir(nšR2if ,ü.startswith('test_û/!�s.append_(F)´ñsuper().__init__(4ñ)) # Iran had a sub-minute UTC offset before 1946. class4È (Õ€ó = 'Asia/Tehran' =ACapi=@unitˆ.CCaseBãdef setUp(selfíð# Since the C API is not presentc`_Pure [²s, skip all¡id`lf.__cÓP__.__7c__.end{H z”.U¶Â('Not releva€p{•Python') oð# This *must* be called, and it ÷ first, so until eitherN°restriction`loosenPQwe'll^W¡as part ofÿW%upG_#Pcapi.  _datetime_(½�2utc•â�use_macro‚¥(True, FalÒ½Yv_utc = |@get_w9fSˆ? ƒA.subƒ*= Ÿ43”assertIs(‰$, zC.utckós“CZ—H , ÿ 9_nnæEmakeçQpŸ1expdž0ime (€ödelta(hours=-5), "EST"Ú9 unº; n•cases = [ „ ('ÉÓ'É , b`/),/ø0 18_nn42_nn7Êß]Ciˆ�, tz_act0exptÑ )==ÅøÜ.jEqual(d<.ddt1 = 4°(2000, 2, 4˜Rinfo=CÌ6?dt2:?expu §Ždt1, dt2f+0.tz!()4i dt‹§5ä¬?ã… asÙðzone(timezone.utñ'c), dt_utc) def test_timezones_offset_zero(self):*.ðutc0, utc1, nonH@ = _Acapi.geIoEPwith Y�.subTest(@`name="a"q0+�assertIs("$, ®.Ê+[ 1[1[" ^ CNot((dÃ$e_exp =è(ñ÷delta(hours=0), ""V<*VEqualqV 4 dt1 = datecó(2000, 2, 4, tzinfo=<)k?dt27É s §0dt1—2c'0.tz)(Ç2aÍ`check_Õ ÂÑclass DateSub (' sBpass ìêp(2011, ªJds =P&tDeHV!is± P›2_Ñ—0# CçP the ¹õ that should be valid_NSTrue(o6(d)Ì$t%s% , ~)±^Ç!atÌs™ÿes do not match exactlyÒGFalsÓtfaÚ ,s,Y ’ñ various other things are™ …s at all?0arg`[tupleª@list@1, '…-01-01',2¢ëå*1)%•(12, 00)]: for arg insªO5(x!, þ î,:‚arg=arg,x=I9=^@ò £ò£6Tim£' | £_%"&30Ót‹ LD"D!isýy [y8O(T $T % Àthe subclassó does not match exactly õself.assertFalse(is_time(ts, True)) -ñ# Check that various other things aremCs8ðargs = [tuple(), list 1, '2011-0%',2ž H‘delta(1),ðzone.utc, date(>†, 1, 1)]© for arg in)s:X(ä!, ü)(„Qwith $òsubTest(arg=arg,J=I9=8\@^ def test_ca_Ûû(C^ñclass DateTimeSub(/*€FpassAdt =4Y8•, 12, 30)% dt® f34%isµ@ = _ÌTcapi.› Ù—Tbe ones]õshould be validg¯¹®bF(dt)Ä) s* Sthe s‡k!½p*Htÿ¼¸xk<Kd qDvHœ,wAtd =¹+&(1£ tdgX1rŽ<X šU8Ü?(td, *W +XLkY*IZ5ÀÒqÖ,Àn (True, Falkse): ñwith self.subTest(arg=arg, exact=9H8ð assertFalse(is_timedeltaIE1)) yðdef test_check_tzinfo(Fañclass TZInfoSub(+&BpassYbtzi = )!()p>¢Q2 FOR³4 +18×½14 STORE_FAñ Jes) Ù÷16 JUMP_ABSOLUTEe1©�8bZBLOCKª/20{0 (None©-22oE % (ö .__code__.co_firstlineno + n.2œ.&3)õÃ1333982(x=[]Èàassert 0, ([s Ex] +A[ õQöª _2‹ºeIF_TRU¹+26‹êAÓ‹ionError¦ ö <£ð object at 0x..., file "%s", ÀL %d>c£s3 ('bug8¦..k'N10 MAKE,015*\ 0 (xZ4¦ë/16ê1mí4�\Ú20 BINARY_ADD¾/22v =õ24 RAISE_VARARGSc¡ã2ñÉ8É·Ê __*(__­@&o ^ ÿ_BIG_LINENO_FORMAT¾ dKspamOð 2 POP_TOP  Ä4 LOAD_CONST“0 (None) ó#6 RETURN_VALUE """ _BIG_LINENO_FORMAT2 = """\ %4d90o`GLOBAL|0 (spamo« 2 POP_TOPˆ » ¼ô dis_module_expected_resultsÄöDisassembly of f: 4º ÖE2E bgb5b:¨€expr_strÙ€x + 1" µ> 1}GNAME L0 (x²2ä1/Ë4 BINARY_ADD㯶simple_stmtÊ(= Î#ÕzoSTORE_ON8N1¡*10\ù@anno05ð x: int = 1 y: fun(1) lst[ 60)]Fð# leading newline is for a reason (tests 2no)\{1 2Aû0 SETUP_ANNOTATIONS Ue6e“| 1 (intµ–1Q2 (__õ‹ations__=1/l1 ('x'1"2 βSUBSCR 381Œl3 (funOî¡À18 CALL_FUNCšt1¦2Ú‹2ã\2 ('y-24•2æ2Ò\4 (ls3ìw3àK3 (0¦/34w*36 ž3ÙÀME  �1 (int) «40 POP_TOPÄ2 LOAD_CONST-|4 (NoneJñ,4 RETURN_VALUE """ compound_stmt_str = """\ x = 0 while 1:|`x += 17ÿ'# Trailing newline has been deliberately omitted dis_l3 1º0ÙK0 (0ÖÐ 2 STORE_NAME?§0 (x) 2Ç4 SETUP_LOOPÁ 12 (to 1843 >>6“c d%8/›K1 (1Âá10 INPLACE_ADDjK1Þ+ ù14 JUMP_ABSOLUT6Z6XUBLOCKî1¿2Z/20Zò”tracebackV0%3d¨0‹YEXCEPÅ‹J4) 4÷\/ 4‹2M!--æõ 6 BINARY_TRUE_DIVIDE¶88 �1¨ P2"12•qFORWARD!40r5ç„O4 DUö1ŠcGLOBALFÌ0 (Exceptionc­8 COMPARE_õD0 (e7k match=2ÚYtIF_FALSY*52/22#24¥-FA­€ rœ d#281sFINALLYù1J,4013Oz¼ %3`@ATTRXU1 (__Ó+__¶3å\1 (tb0æ23‚0‚04æs 2Ô4Z“®44 DELETE_0/c6 END_¨ %4Bõ /50+ �+À1 ú)52j.ÿ´s“-56Éð % (TRACEBACK_CODE.co_firstøtno + 1,Ç* 2*ÀRACEBACK_CODòE.co_firstlineno + 3, ßTRACEBACK_COD*4*ñ5) def _fstring(a, b, c, d):oôreturn f'{a} {b:4} {c!r} {d!r:4}' dis@² = """\ %3d«±0 LOAD_FASTQ0 (a)iæ2 FORMAT_VALUEK 0+4Z=CON[l1 (' '\61‹L1 (b/8/`\2 ('4`/10¼ë4 (with formatj/12jÊ1ûÊL2 (c`6™|2 (repr2ü’2çK3 (d`2ò\/24Ã6Ã/, bù26 BUILD_STRINGW7W’28 RETURN‚„ """ % (åž.__code__¤$1,Q3g(xBñyield x async oa %co>5×for item in _=ÆCpassÆ3h(yuf&foG)Õ'''funcdoc'''òá`[x + z� zf!y]"2fooè�nested_0é kCLOSURº; (y# 2’JTUPL.! 1~¶î‰@1 (<�ð object foo at 0x..., file "%s", JL %d>‡\‰ü_h..fooóò 8 MAKE_FUNCTION°8Æ�10 STORE Š1 (foo) ;æ2k/14»hµ § __/%__@_8' 04, 3is_=1=ÿ%s Disassembly of Ç:+ }xö}C¯„ÀAD_CONST  ö2 ('_h..foo Ö') 4 ð8 MAKE_FUNCTION8+Ô10 LOAD_DEREF$K1 (yZ»12 GET_ITERHo4 CALLs1+ô6 RETURN_VALUE """ % (dis_nested_0,2†__file__ÿh.__code__.co_firstlineno + 1'3'_g3, ) ¨ð 2 = """%s Disassembly of <¢† object ¨° at 0x..., ×p "%s", ¿“ %d>: %3d{À0 BUILD_LIST0 2Å-FA*f 0 (.0Æ >>3Q4 FORÆ–12 (to 183�6 STORE_dL1 (z/8’WK0 (x/†] ^Ú12 BINARY_ADD 014 0r_APPEND»2+ô6 JUMP_ABSOLUTE'4+1/18³ {TpO _Ú {ð class DisTests(unittest.qCase): ¹âmaxDiff = None–def get_d«ñ (self, func, lasti=-1, wrapper=True, **kwargs):[®Ð# We want to �ñ the default printing behaviour, not$÷5argKöoutput = io.StringIO(òwith contextlib.redirect_stdout(?›Ÿ$ifó‚dis.dis(ôÜ�$Oelse:çeB6%Irreturn ¡¿.getvalue()�ae_as_s—ä[½Y ÒØ–WFalser_³p_addressesh\^ñre.sub(r'\b0x[0-9A-Fa-f]+\b', 'Ç1', =Ô(doŽ_f™‡expectedp goÿÍgdepth=Ä0if 54!= O ®!= R ò6got]"ÐÅrtEqual(got,T8Ça_opmapͽ C`*¯["NOP"], 9q Inñ.+ÐLOAD_CONST"],ó dis.hasconst) àself.assertIn($ôopmap["STORE_NAME"],=aname) =°def test_op(I!):[XSEqual[+[föLOAD_FAST"]], " f¯boundariesjÅÄEXTENDED_ARGǰF @HAVET\UMENT«]width§Âfor opcode, 3× in enumerate FJ'if0õ('BUILD_MAP_UNPACK_WITH_CALL',~8 8^TUPLE: s;‰continueTQwith Û‚subTest(Ë=G ! =A0_OPPi_WIDTHXqè ! <. dY+]a+= 1 +4o_OPARGa¸ëBLessç3lenÄ1), P Ï-diÌJ`do_disPPmbly_ 1(_f+,_fE¯bug_708901¿L2bug2S[|1333982\ð # This one is checking byteiQs gen~ d Ÿ@an `ÐÖrt` statementUñ# so fails if the¡s are run °-O. Skip t{+%n.ð°if not __de_Û[Askip^b'need ”%s,fsout -O' 7FG>È­big_linenoð$«func(countæÓ¥space = {}ç–4A = "@ðoo():\n " + "".join(["A] * ZÖ + ["spam\n"]œKPexec(P%, q "freturnr['foo']®C # Tp all smeranges²i•{(1, 300íúexpected = _BIG_LINENO_FORMAT % (i + 2™œÏT(i), V“­Ásome larger —_s too³r300, 10ºe G�51O2P.À) fó rom test import dis_module ðself.do_disassembly_3(,,8ñ_expected_results) K1defjÐ_big_offsets(\!): n$§func(countånamespace = {}44A = "@òoo(x):\n " + ";".join(["x = x + 1"] * b"É\n return x"VPexec([%, |)"8r['foo']ñ™‘Õ;, wؘs = ['''\[Ð%*d LOAD_FASTJI0 (x‰.=CON/M1 (1.¬BINARY_ADDv_STOREwvò''' % (w, 8*i, G + 2 4 6{Æâfor i in range()]‰D s +B 38% éØRETURN_VALUE ½© Å †ú[0] = ' 2' + s[0][3:ª"''hï² èL1, 5ü\wU(i), >Vi, 4)M:–:H1249=@*50@ 50¾ Ì\e_strÐ¥@expr19ÞPsimpll&mt@ G@annoAF E¸compound_stH 5 Mbyte7á_f.__code__.co B#f_l OclaslC[cS ÿinstance_methodã_C(1).__init__i_Ny_H•5: = x Mƒ‚ Sºs 0AÁOatic74.smt'stC, økÀf): ð.self.do_disassembly_test(_C.cm, dis_c_class_method) def ):Àe_generator(X!):*.‚gen_func.0 = B.gety”(_g) # GF 3ItionH«C;(1)F"it•F}ï€rtEqual(ŸW , w™í _asyncóaJ±aõAN~¬ûP¥Ký N_!, œcoroutineòó!co®CHùJ‹ = _co(1,eobjectØ*q.close()ùAvoid a RuntimeWarning (never awaited)?÷ba0 GA!, D|fstringB_›1ž ª>_no˜6try—›õdel sys.last_tracebackúexcept AttributeErrorBEpass0¶\sRaises(~9³¯.dis, Noneµƒ ºE» a51/0EŠion as e†tb = e._F%__@kgR = tbQ! tb?~Se_as_*òtb.tb_frame.f_code, Æi£D~4p†Z ƒÝ2TypÚ<)XÝmble_recursiv8X÷ check(expected, **kwargsQ.?dis+Gy(_h6 „5M€p_addres©6dis:aï(¹˜ß)±,önested_0, depth=0R %1%1%2%2%3%ÀNone) ñ# check(dis_nested_2) class DisWithFileTests(Dis ð): # Run the t Ñ again, usingñ file arg instead of print?ð4def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs): †ñoutput = io.StringIO()f$ifC3‚dis.dis(p®=JeEOelse?½eG·/, N rreturn o .getvalue(~µ code_info_ Ð = """\ Name:»$ ªn!ñ(.*) Argument count?�1 Kw-onlyŸ°s: 0 Number§ölocals: 1 Stack sizz`3 Flagˆñ OPTIMIZED, NEWLOCALS, NOFREE ConstantsCQ0: %rÍv_formatóy@1: _#äðobject Variable ë?±x""" % (('FH°ted detailsÏrmethods[ tions, or X6.',*Ï€if sys.fäà.optimize < 2 ò (None,)) @static^ Ñätricky(x, y, z²¯Â, c, d, e=[]`dÃ9af(c=c)…(H<2, f­cyield g ?�<!939398979þVARARGS, VARKEYWORDS, GENERATORR–5<Ù 1` f at • " q", line>6B2: '".<ýO>.f'n2@1: y@2: z@3: c@4: d@5: e 6:es ã7: kwds Cell vÉÄ€[edfxyz]*81: 2345±""" # NOTE:’2ordà¶c†ð above depends on dic+Aary 8!\_%0Bf = 0.__HB__._Å0_.cÂpnsts[1]<×1CÝfœÕ,8œoNESTEDƒ¤ÔÇFoc FreeVÀinfo_expr_stùr = """\ Name: ê Filen ñ Argument countG³0 Kw-only aös: 0 Number of locals: 0 Stack siz‚`2 Flag“ñ NOFREE Constants: 0: 1¾ÿx""" code_info_simple_stmt_stò´¯ 1: Noneý �compoundÿº0ù1ùO 2± async def a_def()7€ await 1J÷ for a in b: pass³with c as d`[L$MO(.*)D+2D/10EòOPTIMIZED, NEWLOCALS, [¯, COROUTINflw1bð lass CodeInfoTests(unittest.CCasen¡_pairs = [Zu (dis.¨%, _ $),,htricky%"2co_ž_nested_f.7@expr-& E- 4 |6 8-0)!] Û\2S(selfv<á.maxDiff = 100>ò°x, expectedü/R®,-1 ÷zrtRegexÁ6(x)L) Ashow× I§`aptureò`dout()·joutputÎÖ‚›x\ ïF§.getvalue(ðZ+"\n"?.ú = io.StringIO(# r, file=9 *Œ |ð_object(self):  ð(self.assertRaises(TypeError, dis.code_info, object()) ;ò def test_pretty_flags_no (Z!):*.i`Equal(]:ò (0), '0x0') # Fodder for instruction introspe€ñ!s # Editing any of these may require recalcula'`the exG ed output Ñãouter(a=1, b=2À£f(c=3, d=4Õçinner(e=5, f=6!õprint(a, b, c, d, e, f) Preturï1ner/+ò'', 1, [], {}, "Hello world!"D@!f ×cjumpy(�ð"# This won't actually run (but that's OK, we only $rmble ita™à in range(10^÷i)†if i < 4�continueà':> 6'Qbreak$Felse°"I can haz ƒ clause?0whi´ 5›Q -= 1_ƒª Ѫ ðWho let lolcatzÌ0o tŒÈU suit¹6tryµQ1 / 0£ñexcept ZeroDivision­,@HereÀ_go, h 3...%8Açwith i as dodg†^±Never reachÁI0finLL/Lðnow we're done")äVEnd fè opiq generaî$s ©_ž`_line ´ �_offset =ÇQer.__³ _.co_first/qno - 1 Ç/_f2–consts[3]ufg9 = >_'Ž j"@m,J 1u (ïF1j The follow%ós are useful to rexe=ñresults after # either$»�is modifiK@byte/Ì ch)®AKq¢ion, updat{ references˜G_´Yand #ŠQ befoå@runnãá>7 #_A0s =ÏI.get(\!, 3;=O2) #Ó'µ›¡ = [\n ',­Q #',ù.join(map(str, z)øï,\n]', sep='')³/()µ· ±Àted_opinfo_fÁ = [\n ', 1#',ð.join(map(str, _instructions)), 'Ù]', sep='') #"© = dis.getñ(outer()(), first_line=expected_inner¥) #print('bopinfo$·\_jumpy³³ $³66 IŒi 1t~7 (ñ(opname='LOAD_CONST', opcode=100, arg=8¡val=(3, 4)brepr='4ñffset=0, startsp=2, is_ûà_target=False)i‡`LOSUREU‰!35s^0arg‰1'a'† o�2�ONone„;1x„b„ „4„.¨BUILD_TUPL!02|V06€. 3†'‘_object_f‹(3), 8œK4†œ'ó·..f­""¢1ÄC ÐMAKE_FUNCTION˜È°%=9¦ 1 =')Á1Æ/‰STORE_FAÑ2H‡&' ¨1Å/E`GLOBALÛ!16ýÌåŸ'Œ Ñ7Ò!WDEREFˆ3ˆG2argŽ €µ4ƒS2•/�ãÀpcode=100, añrg=5, argval='' ð^repr="''", offset=22, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100,|!=6xƒ1 ‚ '1*�4�.ŠBUILD_LI�3p=ˆ� �€6€40MAPV|8.€ 7ÿÙ'Hello world! /30›.×CALL_FUNCTION3 =ž �3ž/hPOP_TO›éö=arg�ž/Ÿ)FA�"24…2žf“' ¡3 8žÆRETURN_VALUE‚8ù„ ¥ÿ ] expected_opinfo_f = [ > Eœa(5, 6)/žÒH ­3'¦gCLOSUR'"13‚=©a© ©«/„ ³ ('b„ „®4D„c„ „ °UQ Œ<„d„ „°—THTUPL0=¿ƒ “�1Ž&V ð code_object_inner, argreprðd=repr(code_object_inner), offset=12, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_CONST', opm±=100, arg=4öval='outer..f ”'*°/=","Á4Á.æMAKE_FUNCTION'Ä!32“!=9Ä ¤')D6ƒ.˜STORE_FASD!25y=‡€'*Ï8‹.LÏ`GLOBALãpÐ"16Œ×ŒWprint¶'Œ*20Œ5X!WDEREFˆ3ˆa„ €Û4ƒ3 bƒ ƒ�/�ƒŽcƒ ƒ�/ƒ 1dƒ ƒ•/OCALL£gq £3Œç wPOP_TOPŒú20arg X=arg��4 #ï#3”6—ÆRETURN_VALUE 8•ò] expected_opinfoÅO = [“ Ä1 74,: ½¶5 : B^� Àtion(opname=ñ'LOAD_DEREF', opcode=136, arg=1qval='b' Brepr ÿ:offset=4, starts_line=None, is_jump_target=False), Instruction(opname='‚ 2v‚c‚ ‚6‚K3‚d‚ ‚8‚3GFAST…!24z!=0e� �/10‚Jf‚ ‚2‚.×CALL_FUNCTION3=” ‹)Š1‹/pPOP_TOPT |Ö0arg~ã=arg�Š49CON 0  ƒ´�/ÀRETURN_VALUEY 8 2”ñ] expected_opinfoA_y = [7‰SETUP_LO¯u¹585G­Pto 54Ò+ £3º!`GLOBALT&"11Ÿ¯P'rang¯5>=/E9A¼)… 10¶ </¿ …U‘‚=/€GET_ITERTŒ!68k²8/;FOR‚943‘4‘4‘ O?TruNlSTORE_K5IÀval='i', argðPrepr='i', offset=12, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_GLOBALXñpcode=116, arg=1±val='print'ˆŒ4Œ4‰!GFAST‡!24p!=0‡þ2argƒ 6  ×CALL_FUNCTION†3 „)Ž8ƒ.pPOP_TOPTŠúÙ0argÛ-�/20�.L†'2‘5!9CON0ÿ!=2 €4 ƒ)‰COMPARE_„!07z‡<  ‡2‡/ÐJUMP_IF_FALSEá1ú&=3   + �/…yABSOLUT…31˜‘ …3‘6!Ž'7?Tru �ü+û6�3�L �('>� �3�Sý‹   �/ˆBREAK_LO™8�4�8* /4 Àuction(opnamñe='POP_BLOCK', opcode=87, arg=None 6val `repr='.óffset=44, starts_line)ð(is_jump_target=True), Instruction(opname='LOAD_GLOBALW…1116|!=1ƒq'print'†o‹6‹K10, ‰OFalsŠ WCONST‰!00r!=4‰÷I can haz else clause?š/"'#4", ­8­n¯×CALL_FUNCTION²34;5)0/50ƒ.?0TOPT¸&0arg0Û=arg�2�.‰SETUP_LO„2³!52Ž„1108 ƒ`to 108¶  Å-11:Ã)FA821=Œ„''i#  5¹1 � ˆÐJUMP_IF_FALSEÜ’1‰9Š  +”/Í66�-12“Í”'6œ/ -6–  '6˜� †( ’/13!Ó5!17…‚ ÷INPLACE_SUBTRACZöh7�/ðSTORE_FAST', opcoÑde=125, arg=0qval='i' Brepr ðLoffset=74, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_FAST', opcod‚4o‚6‚/14€!9CON�0ü!=3ˆ6 6«8  COMPARE_OPW!07p= �('>„ „/80ƒ.÷POP_JUMP_IF_FALSEŠQ8‹  + /82‰.…yABSOLUT…‰&=5… … ’/15!�'-16€?Tru �2ƒý4ƒ�L�('<� �9�Sÿ‹   9�/ˆBREAK_LO›oê0argƒ … �7 /9"¬¤ PBLOCK^¢8¡N˜fGLOBAL…1^�1h'printœ 1Ü ¢9“L²£¡÷'Who let lolcatz into this test suite?ª"25", Ìä/àCALL_FUNCTION'ò, opcode=131, arg=3val ðLrepr='', offset=104, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOPU~|K0arg ‚6‚.×SETUP_FINALLYˆ"22Š!70ˆ"18 ‡`to 18028�-20 ?Tru Š`EXCEPTW2ˆ"=1‘‰!24•‰ 242‰*10‰@˜˜LOAD_CONSŠ0ÿ!=5}‰ ‡1‚2‚Ä€77v€‘€‹1š/ðBINARY_TRUE_DIVIDEà”2‚ñ¦1¦/P(+1› ‚VBLOCK8/,ÆJUMP_FORWARDˆ1ñ²%28"15/¬ 522#ÞŒ,:DUP»”Â’ #. ¢`GLOBALØ™1k  ñ'ZeroDivisionError'ß2·/‰COMPARE_â07¶È`'exceph match£¡Ö3UwIF_FALSå1EL"15g© >yQ3t/bT*©Q3täÀruction(opnañme='POP_TOP', opcode=1, arg=None 6val `repr='-óffset=134, starts_line*ÿis_jump_target=False), Instruction(opna‚16‚.°LOAD_GLOBALÛ!16q'print' o8�O23, ‹WCONSTŠ!00s!=8ŠßHere we go, h 7...ª/"'24", Ì*40ÌÎ×CALL_FUNCTIONÑ3eÑ U)P/42„.á,4á3WEXCEPÔ!89Ì00argb>argå/ÀJUMP_FORWARDbæ\2î‡"17 †`to 1762” ä¶°END_FINALLYY‹8ß5Ÿ?Truyl)FAk"24˜''iG !5�-25í€ ¦SETUP_WITH2143�1‰‚"17Ž�02�5¢/lSTORE_ 5Љh'dodgy¨/–�25©ã§‹�Á÷Never reach this"-"'c6Ä> cÀrepr='', offóPset=162, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, argKfargval `repr='-"ff‚4‚2PBLOCKW„?87,…6….¦LOAD_CONST†2100‡ p0 8ˆ.÷WITH_CLEANUP_STAR�8›/70Ž?Tru �`FINISHî¤2  .7«/°END_FINALLYY‡8}£‡ °q7°š ¯27¯/ˆfGLOBAL“2116”°‘q'print'Do 8®-28É'1Â÷"OK, now we're done"—\ Û§Ç/ÐCALL_FUNCTION[É"13/=6 0)„Ä3Tö'8Áx Í18Á4ø-9¼‡ÀRETURN_VALUEë!83›ÝÀrgval=None, òíargrepr='', offset=192, starts_line=None, is_jump_target=False), ] # One last piece of inspect fodder to check the default line number handling def simple(): pass expected_opinfo_simple = [ Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=Ø0“0.__M°__.co_first!/no  ÀRETURN_VALUErpU1=83šoa¤.¦¤¨ ] class� Tests(Byte}°Case): £r test_d¬íq(self):'+õactual = dis.get_in’"s(8).=ò.assertEqual(list(DO), eë)•z�€_set_to_¼™!&, Lyª<_outer™3 ˜Nø§&^ Plnested§÷with captured_stdout(ùýAf = S(’ÍfÛf×+fÓdoubly_Ú'VinnerÞà8äè+C ì—y¾† 3¦¦+C\) # Á has its ownañs above, so can rely on it to validate #9óobject oriented APIÙÈ`s(unit¾.×®\£`antiat7”Ø # 7 ÿ@func$ , method, .² string and™åõfor obj in [_f, _C(1).__init__, "a=1", _fP]P©|—@.subއ(obj=obj§(bj+�"MxÐIsInstance(b.ó codeobj, types.CodeType) ðself.assertRaises(!ðError, dis.ByteG£, object()>ðdef test_iteration(M%):\0for5ð in [_f, _C(1).__init__, "a=1", _f.__c6__]= Pwith U÷.subTest(obj=obje(Bvia_¢ˆ = list(¾9%))š150genÀ(or8°get_instrucÚs@œ>`Equal(Q† , ] 5üexplicit_first_line?‰actual =‡†(outer, 7¡=expected_Kê ¢[6), <RpinfoC ¬asourceYp_in_disóLmbly³ # Use the Ñù @ ã‚‚ ÝÆsimple).dis(Ä, à.strip().partiŸö(" ")[0] # extract…%nouîr = str(n}2.co޼&no€ Dˆ>+ anYà©enumberŽF á?350FÜ\"350" $ ôBåmaxDiff = 1000ãx(„@InfoÏ!s.AZpairsúbxd¹u†¡rtRegex(b.œÓ ¼·,edÄ‹,_fwwð9*,_frPfrom_Ž\ebackttäh'tbì¹.E&tb ñwhile tb.tb_next: Tç¹ób.current_offset,H_lastiÉ Í? [b\Fò ) if __name__ == "__main__"C@unitW.ð() # Augmented assign »¤. import 5€ class4A-¨(.CCase�\BasicUx = 2 gx += 1**G-= 8.W//= 5G%= 3&MÀ x |= 5  px ^= 1 ex /= 2ñ self.assertEqual(x, 3.0) "ð def test_with_unpacking(6!):#TEðRaises(SyntaxError, compile, "x, b += 3", " [exec"slInListjux = [2]z@x[0]Qà*ã$*J-= 8IZ//= 5J%= 3&\|6 r’u ?[0]x_InDicj{0: 2}š+èvõ£ŸSequences(1,G[3,4% -¯ôÖ[1, 2, 3, 4, ]–æ|]Uy = x[bx[1:2]p4yb+= [1]X†e)X-³True(x is y�¦äCustomMethods1+D class aug_y¾�C�__init__9w, valueå'‹Rval =#`HHraddHFureturn M+MKJؾ. S#œ $2(2 žÃiy¼=Ç zí �3�.eÖ3 4z3 ñ"""Blocks inheritance, and fallback to __,9"""À"__Dv = NoneùH¦&(1ä JÈ&107oªQIsInsޝLJ+.y._not x$5G, 113«62(2>¬�}2}?3(3}À self.asseró tIsInstance(x, aug_test3) ÿ self.assertTrue(y is not x$õEqual(x.val, 13) I5x =`64(4>Wwith gõRaises(TypeError):D”‚x += 10 Z@def ²ðCustomMethods2(_T=²output = []<NQclassB:alli[€__add__(KW, valP?X“.append("3† called"è,TrU 4V iV 4V°areturnž4É?sub3qTr"r4V iV 4V ?mul3q"4V i"V4V/atu m6w#%Ðr\i%\7¸/�floordivQ8{‹OiCõ9|%rC|9| bùOtruer 7ymxrBô8z Àn self  òdef __itruediv__(self, val): #øoutput.append("8� called")5preturn X {?modv3qTr"Ë4V iV 4VX ?pow3q"4V i"V4V/or2o!Är3T i!T3T/anQ3q"Ær4V i"V4VxŽ3q"Çr4V i"V4VorshiftU6w#%Ðr7\ i%\7\/l/"6w/%Ór7\Àf __ilshift_û_(self, val): ýoutput.append("__ilshift__ called")4preturn W Æx = testall(3Ux + 1$U1 + xhx += 1B-,-,-,*,*,*,@,@,@,/,/,/, - . /%[%[%[*à á â|[|[|[&,&,&,^,^,^,)>>-)>>.+>>/)< i9pow¤ i)or. i*anŠ ix>rirà)i 8 >ò '''.splitlines()) if __name__ == '__main__'ž@unitï.ð() -- Testcases for functions in cmath. --(PEach i  takes the2#m:  -> BTwhereO% Q°is a short ÚÁ identifying†y,D i¦Ôa to beI÷ ed (exp, cos, asinh, ...)H ¼„ðpair of floats separated by whitespace- `repres«ð ng real and imaginary partsOða complex number,)Ð 3ÔPexpec{‚(ideal) &‰�ue, again‰@ed aL Èá;� í@listžèñðing-point flags requóired by C99 -- -- The possible flags are:ð& divide-by-zero : raised when a finite input gives aWó mathematically in-uresult.c�overflow]rEd whoseqõ-real or imaginary part is too large to fit in the usual rangEöof an IEEE 754 double­vinvalid¬fqs-`gnore-˜ñ-sign : indicates that…!of +¶$ofשïþis unspecified; i6Gc4 isD›@n as†,# n both -inðdõ should be accepted aBgcorrec·iÝmÝ+˜›ú³âKF™ may appearÀ”any order%ðLines beginning with '--' (like this one) stàa comment, and÷“×°d. Blank lV,W q contaiaðonly whitespace,CX alsoH f“majority ñAvalu°û@were� puvº÷Rhelp ´version 2.3B�MPFR librëˆàmultiple-preci/}ãfloating-pointfbations$Ûð rounding. All outputB«5qis fileìð(modulo yet-to-be-discÐg@ugs)>_"lyaped, proWdCeachC‰x€ decimalB Â�0 be9iÓ`terpre:áas a representå@OŠ1spoæŒ nearestì= iP. Se>#tñhomepage at http://www.mpfr.org Œ or0forqon abouñÒGAprojSYA min!t�acases `generaæ  mppP 0.19—p100 bitÊsuracy (©(§)  imŒÛ¹Ö1of ˆGfunc'-- gu;qs. ThesÆu(@est.Á_–¢.MathTestsE,’@well inA!_c5 ;-,€acos: In>Qsine ×5-R É s =P0000 A 0.0ô -> 1.5707963267948966 -0.0111 2121-g1c32dqbranch Þss: +/-1Jð10 acos 1.0 0.0 -ð> 0.0 -0.0 acos0011 # 1" -#"2"-#>ù> 3.1415926535897931T32lU3dó -- values along both sides of real axis¯#20[ò9.8813129168249309e-324ßø> 1.5707963267948966¡2õ-FµGµ25002_e-305{5j4öo1e-150j55j65:9.9_8e-17z8_7E Š8`ê8EP0.001F‘1Øy9615634y94h 5Æ3RY0.578ô6vø2.1882979816120667v3NB„C„J0v9„@™386886319„WB„C„d*.02ƒöó2.1073424255447014e-08Ä3ƒT •UT ¢1T °¨ ô0.044717633608306849¦¯R¦R ¼%2.­}èp-1.3169wu69248169ÉA„A4Ö/23ƒ @3.82y£47133310124ÖB„BÖ1P0E-Iô37.534508668464674“åQ¢ Qôî>+14|¼ô346.0809111296667O4õUª U öP_1e+29ª À689.16608998ð577965 acos0047 Z -1.0ú1e+299 -0.0 -> 3.1415926535897931 689.16608998U8Uó 9.8813129168249309e-324 Sñ1.5707963267948966nš9E ™F30.0E"50Eo1e-305y)514h24?150h34h44:9.9_8e-17x5D ˆ6DW0.001w"69ÐX62823Î5h1d 2ºDY0.578ì6pù0.95329467197772655sAB�C„6>0n9„ø1.4901161193847656e-08‡6OE‡FŠ` ¦2‰Tð2.1073424255447014Ž 6pDˆED €. – ˆô0.044717633608306849†~B†B |%2.i¸p-1.3169.„69248168s|1d1|+23c@3.82Y¤4713331012cl2d27\1v0Ë"->Ró37.534508668464674s7XA ‚ATL5+14â�ô346.0809111296667Ï7UE ŠEV„ƒu7YEŠEò -- random inputsg#10¨ð-3.3307113324596682 -10.7320075308È6+ð1.8706085694482339>ä13986806554613^Åò-2863.952991743291 -2681013315.2571239]5ó73950301699 22.40260784327475ù#10âà-0.33072639793òl220088 -0.85055464658253055 -> 1.8219426895922601 0.79250166729311966 acos0103 acos -2.5722325842097802 -12.703940809821574`ô7699942413107408 3.2565170156527325_"4 _ð42.495233785459583Àð54039320751337161``3.1288Eô 73153304 4.4424815519735601`5`ð1.1363818625856401 964°25498630376^ô1.5709141948820049 -9.8669410553254284_6_`2.4398T°24157866e-1Xó3300205189026616‚ð570796326818066ì“324305780A7d7d°1.352134042Èò552 2.9369737912076772Ãô9849059192339338 -1.8822893674117942_8_ð827364706477915 1.035Ž�232147557^ `322463Ã@0032^�409068826À4969^9^ 0.25978373`ð03546 10.09712669185833_ó1.5963940386378306 -3.0081673050196063_"10_ó0.33561778471072551 -4587350.6823999118`|ð2536333251 16.03X„40257953¾$11_ð49133444610998445²ó807142236299001Ûð1908761712801788]ô857334581318786Û%12` 2196734507®Iô2.48129654317451`@4140Í¡6100692 1.Z”726098817Ù1º°2.9614262102ó219.03295695248664ð 572768319822778 6.08246598850ù1¸`2.8862üð3652641 -20.3801‘@2206Àtõ4302765252297889 3.7182018531476‘1³À0.4180568075:ó09 1.483343399082348¸å±83455830304‘€20798477D15762²ð52.37611140592471¨@0139@Îï0p@0.00½À017618040241_4yP50666~5471²ð41637948387.62596ÂÐ56341829289400> 0547�07883548=ô-25.14542498980938Ö1´ð0.0612266591222Aó6 0.844723439461515%À5240280306369 7679179897 %81<·ð2.4480466420442959e+2c@1800\�20138466xð7.353756620564798e-28 -61.45565#ò996376 -- values near infinity¥#20×€1.620686@±683021e+308™0n’226285283°-> 0.566508ð3826223 -710.54K7–#56I#20áó1.2067735875070062Qà1.342917372439ÂjÙ 4369390864Ôi4÷”794027498Òê°-7.41301451J@9047Qð7 1.1759130543927645²`2.1332™‚46478536Òð 21871115698752 acos0203 að!cos -8.6329426442257249e+307 -1.2316282952184133ð%8 -> 2.1821511032444838 710.29752145697148 acos0204 õ 0.0 1.4289713855849746Sñ1.5707963267948966 -TÔ4631069738996T5T-Uÿ3153524545987432UÔ1634604787539T6TSð-9.6229037669269321T7ü©ô709.85091679573691T7T¨ÿ-4.9783616421107088U ä19187157911233U8Uñ1.393754192573938¹8i"->BÔ2135678707264E9Eñ9.136238896737153’"7 ²FßÔ7990195312461Š"10EP-1.34ù0122«4F‹ò3.1415926535897931ÜÅ1862969887180#11Uó5.4699090056144284/¢/> VªÔ2860327108564Ý"12U€1.588071ÓŒ0Øð8 5.5638401252339929ëò3.503519487773873e-308¼Õ35187633140583g€24972116i1316»à8 -3.045647771Õ0024hò2.4370618453197486i¾P11227†S23412¾1Tà-9.90162240060©Sð4.9570427340789056h2-3Ô8794693522946¸1d4Ó5407106687413hÿ-4.4233577741497783eÈÔ3501970467200†1tà9.367462308364ï° 1.52095590i4797v>+Ô3086948449108+1ƒ08.1Ä�320217843­à6.609344579500hbd*Å475255222779��0-3. 93La665104«Ö6885639665089DHñä34480761042687ñ¯ð -1.0577303880953903 -6.45>‘681573561e­ ó45200719662046 -- values near 0v2àð1.8566986970714045e-320‚0867™€567604021Þ /møð7.9050503334599447U3©ó8931816251424378®/8..mÄò465908125712189UÀ2.4654065097ï2†1Û/nð-6.101691640819261nVñ2.47032822920623o2PJ.n'`3.4305vÃð2729e-311 -> 1.5ð#707963267948966 -3.4305783621842729e-311 acos0225 ð -0.0 1.6117409498633145+�9 -> 1.5Z/Z6ZYÿ -4.9900630229965901e-322Z.Y7Y³ð-4.4889279210592818´1Z.Z8Zð5.3297678681477214T!2 Ë 40.0E9Eò6.20734258972116E3jRE"30E9à40656458412465‹/24‹#31FÐ1.71075170528Š3Ñ8Œ ñ -- special valuesä3100ŸÏ¡1Š-GC1002»-c32{d42_?nan04nanÅ,1�-2.3 infbD-infcÜ2´Å1 ”1íÆ÷1ÞS0-> !΢&à-> 3.141592653#G931 1Î2Ü2Î1c8]1À">G"±#ù-> 2.3561944901923448¨±--Tú78539816339744822±.&- ôignore-imag-sig�1É6pJI2Ꭰ¿2à[ !àÉŠšÙ2Ð""C¿f9-­ »2ßå¨ÙcÞõ1Ý�7êcÆ·2�cÀ> 0.0 inf acð os1031 acos inf -0.0 -> @inf B1032"-#ð> 2.3561944901923448B232,Tù78539816339744822425nan† 4nanT5"02.3¨ "6"v"Ê? -1 --Eÿh: Inverse hyperbolic cosine --NOQzerosÅRh0000_cgnõ1.57079632679489662 h2¡-4²hKg³3h Øôbranch points: +/-1´1æ21.0¸ #×# o50.0%È&Èö3.141592653589793{È3 Y5Èõvalues along both sides of real axi¿2Ùø -9.8813129168249309e-324î 2ýG ¹I!_e-305$6n¥�h -1e-15Ї™¤¹6nÏjh -9.9_8e-17ì 8C#27qFŽ H8H\0.001}1¼u9615634}95 l73fY0.578ü6z€2.188297Vd120667zÖÏC ˆE^0‚9ˆZ•386886319ˆkC ˆEx.C2‡õ2.1073424255447014e-08 U )3—U™V-W¶1W ¼¬ÿ0.044717633608306849ª ÃSªT¨Àacosh0038 acð2osh -2.0 0.0 -> 1.3169578969248168 3.1415926535897931 acosh0039 a B-C-D%40D3‡@3.82}¯4713331012‡)41CˆDˆ 2E+10—ÿ7.534508668464674— 3R ¦S¦ 4T:9.9d8e+149Èÿ346.08091112966679ª 5V ®W® 6X+1.TU1e+29®ÿ689.16608998577965® 7V ®W® 8Xô9.8813129168249309e-324[çô1.5707963267948966/49F �G-H5o1e-305}5 5lüU1e-15 ¢¡ß5lÂÁ?-17è±EŒ [0.001{"69àT62823Þ5|2 h4X 0.X¶6tõ0.95329467197772655wUC …E6R0;‰óô4901161193847656e-08‹6cF ‹/1.H t 2ð2.1073424255447014‰�„EŒFG”§¡ò447176336083068lC’Ck\>0.0DE�‘ 50.02�2KhÄ4À8 acosh 23.0ð 0.0 -> 3.8281684713331012± acosh0069 0 23/4D-0.05#705+10 .0]wð7.534508668464674B1BkCD2D:9.9`8e+149pGñ46.0809111296667F3F sGH4H+1.Q1e+29tGð689.16608998577965¨F5F sGó -- random inputsZ$10´ð-1.4328589581250843 -1.8370347775558309eð 1.5526962646549587 -2.190250RU35786aÓð-0.31075819156220957b`0772553`839297bð0.951391682861937yõ1.7812228089636479dóð-1.9044776578070453 -20.485370158932124c°3.7177411080359�õ6633888745861227bNð75642506000858742 -21965976320.873051dð24.505907742881991dõ5707963267983402d+ð-1.6162271181056307 -3.0369343›C9609‹�940705726*!22‹ö042954946175020(GŒÐ3780280298063o‘001805488 0789Ú>õ992877058761416 1.886386995096728É6®ñ-9159468751.5897655 5.801474766427364Èö23.631201197959193 3.141592652956407`7`ð0.0377391575509¼PÐ2184135749351�ø0.21685844960602488 1.6076735133449�8dð8225991.0508394¢ñ0.2831854300891364Sö16.615956520420287ņ19164101Œbp-35.620§p0230263à31303237005015À�4.2658980ž 43"�3.1328013AT41873ƒ1×ð96.729939906820917 Ãñ2934522837236533À5b 04ïq5863548,@0030Z¦9586697284gÝ`0.5965V0Ý 64ë€2.041229&`163978Èð1.4923002024287835°31256842190mÈÚô109.2938411267782œð15454863061533812d±5.387166296 7jõ4141245154061214e-0§1áÐ8.67056519693Ï|6(¡3164978746‘Ð2.93361809583/5/Ð4026736203187”Ëßð1.81016464450526868ô0123451327218554-ñ1997148566285769,@0818 ¥2760150265fãð 52.56897195025288 0.0011ð813916065985443 -> 4.6551827622264135 2.1193445872040307e-05 acosh0116 a ð 0.28336786164214739 355643992457.40485dõ27.290343226816528 1.5707963267940999`7`ð73876621291911437 2.882859454110Q@e-20dñ4.2774820978159067õ0.73955845836827927i8ið025865471781718878 37125746064318.492fû31.938478989418012Ê6895Ê9að2.2047353511780132 0.074712248143489271að1.4286403248698021+Ð3799790497162¾ó -- values near infinityÝ3200|ò8.1548592876467785e+307 9.0943779335951128ð-> 710.08944620800605 0.83981165425ÿ%54j1j»à37229680972531Rñ8 -1.033696661787485k8ïkð4543331094759 -0.62ï±T34875z3202jò-1.5014526899738939kò1.5670700378448792Õô66420706795464 2.3348137299106696203j@0939b752139'Õ`416960ÕJ2797Õõ30182863115886 -2.3806361477870†3204kú0.0 1.47606243355958Tí27873384716929y%66“5T-Uà6.207721032622h7ÿ09.4125645748476V 6VUƒê62189990996830¬p33544440734ð'89­ð­0-8.D±62483383912îï70971018048317X ß@1.30‘975249934R8Xñ10.1568668010722KÄ[ 53š€40214026F8°€Êá33747422926706H1�ð-6.901137599229I7�Ð09.5184569971$õ 3.1415926535897931V|�-9.953957|b926973VUð> 709.884740958701™Xj`7.6449/u1891492>ò570654076826835Î009.4�173175480õ2518906916769345e-30i1i€5.432541:c602197À‘7.806480792XÏp2791777Ô5 ú4369851312471974igñ-1.152362611236046Óô8 7.0617510038869336ï03117010216909� xó1.168502778686259¡!-5l±55835792562!=À045079075714Úž‰ñ3.0236370339788721 1.75=ð720096417e+308 -> 710.ñ44915723458064 1.5707963267948966 acosh0217 ð 6.6108007926031149 -9.146996822Hÿ149e+307 -> 709.80019633903328 -f8fð-5.1096262905623959 6.448492678541 fï45061713997973Ë 9eð2.8080920608735846�ð7716118836519368f8Ì€10.46124’P63445/ 2ô -- values near 0D#20yð4.5560530326699304e-317 7.3048989121436657|L%21nð8754274133585331V4·A8469ép76841995ë/9.p2pà-4.67488760099Çð2 9.7900342887557606pßo3oð313687153839923Wð20 -4.940656458412465g 23àq4qð0.0 4.343101386649677["14[Z5Z-[�6.0147334®A2918[M[6[Zð-1.288029138708129™*/> \·ñ-1.440156397653462g¸] ñ1.368968057086309W!3 Ñ>Fëñ1.530434689349437F"2 »G˜3ºñ -3.7450175954766488e-320ˆ-H�3“ñ-8.425056308088580�1�\sspeciald]4100£Ž 5100Ž/3ä.0infðó4100§@2.3 +!->2hœ3Af0nanÊ5nanRàU0-> #¦¬$„-H1½-ð]'ô3.1415926535897931ž1¾3[3¾Àh inf 0.0 ->ñ inf 0.0 acosh1013 a2.3 -> #4#-<$õ2.3561944901923448V53.2ö0.78539816339744823634nan‰5nanV7#‰$8$00.0G G9#ó #'20#ÀF'21#?0-> #2#ˆ>|ô -1.5707963267948966ä2�-05¢/°i £4¤�5¶jÇëo™õ-3.1415926535897931<Ù5o53ëÎA43í%Y%ï+K*3ð/4,3ðq }3à-³ $ж}$? -ÿ -- asin: Inverse sine --23`zeros 9A0000BtNvsin0001!â" D2#I4-> #3#$ âó branch points: +/-1=1¤41.0_¸0³0_{12Â3Þ>dÑ2Jeæ àôvalues along both sides of real axi•öð sin -9.8813129168249309e-324ˆp ÚK ¼L!M'Ue-305‡1)D±*+4U1e-15á-)5)DT9+6+:9.9U8e-17¸I7I t„J Kð8 asin -0.001 0Ñ.0 -> -0.0010 16ð7416 0.0 asin0029 )8O9%309H5789`F÷61750165481717001|/31CkDˆ2E„P99989lDð1.5707963118937354B3BjCD4D!1.l2j Bô267948966 2.1073424255447014e-08T5T{U-V 6V 3ª ô0.044717633608306849¨7R¨ T 8T?2.0— `1.3169�u6924816=ØA† C4â/23… @3.82{£47133310124áB† DàÆZ• ô7.534508668464674•ïQ¤ Sþ)9.Q998e+14ˆô346.0809111296667W4ÿU¬ W N001e+29¬ ô689.16608998577965T U¬ Wñ9.8813129168249309e-32Ä *Ÿ K5d1e-305œ'ûa)àU1e-15ì'¶P6)Œ64-17°G~)q{ ñfIp‰ '–5P(• 6lÀ58 asin 0.57(89ð 6 0.0 -> 0.61750165481717001  asin0059 \ 0.57A-BC$60C€P99989i„ð1.5707963118937354@1@gAB2B:1.02g @ô267948966 2.1073424255447014e-08R3RxS-T 4T +¦ô0.044717633608306849¤5P¤ R 6R?2.0“`1.3169/u692481657?‚ A8A3� @3.82w¤4713331012Í2@‚ B7Ì1H0 5-> ÌKó37.534508668464674‘7ÛO  Qê)9.A~998e+14p¤ô46.0809111296667G7ëS¨ UìL_1e+29¨ ô689.16608998577965LïS¨ Uò -- random inputsg#10À-1.597955583Úð 083 -0.15003009814595247 ô-1.4515369557405788 -1.0544476399790823b-tñ488225895317679 -9.6080397838952743e-13fÊð246024460412851gà17423800540040/#10.ð-3.6508087930516249Ìñ36027527093220152fð1.4685890605305874eó974227300715203ó#10=.@23863p232681961µ±13516996364a00.8㉀91147275,@3223es0568919÷#10Jð-1592.0639045555306Äñ72362427935018236c¤°34180711751Yõ8.065933691872922ÄYÞ@9835Wñ 71312019 4.2131508416697709aEP57778@9935}ô2.1461732751933171òX�-1.918471ò 30213 0.4060330507977923%ð 1.3301396585791556 1.302Fa231498]Àn0107 asin -ðx254495.01623373642 0.71084414434470822 -> -1.5707935336394359 13.140183712762321 asin0108 asin -0.31315882715691157 3.9647994288429866 `ó0.076450403840916004 2.0889762138713457 b9bñ90017064284720816 1.2530659485907105Âá0.534665097419Þô 1.170281155757^"10^ð2.1615181696571075 -0.14058647488229523^ð1.49761663238968713ó4085811039334604¾"11`ñ1.210474921070779`ð85732484485298999`�0.8391307N`343924aô068171925052590�$12að7059733185128891Áð84032966373156581að1.0510900815816229`P29679t1361652Á3`ð9.91370850172906875ô460838397025089 ”237704820Šô2.995414677560686^4^`117.12†`510414ñ5453908091.533401Üà2.147514141139bðe-08 -23.1127454502&c5c@0.08\ñ187798029227 0.06705434986017319¤-ò0946786856771813-ô223991060639698È6eð 46.635472322049949 2.38351žr8056678„À519719494001à 4.53669896009à3]7]P3907.z 96ëíô19.1440218863901áìõ965233083235 8.9637018715924218]1€ 31ºñ 308273 509.0157788355476ºP0.002{õ803817829316 6.925629449452470¿`0.1085cñ277509224 1.5612Œd821747|ð58491014243902621ép2970757gò1327 -- values near infinity6#20Úñ 1.5230241998821499e+308 5æÀ2289940845257�`2201442ó 892068 710.3728348653596à#20áà8.133431769867þO€9.224942ðc872451>�ð2259991284020042 -j�096245304þÐé-ŠP85066ÊB1768Q°6.701544526Ð9Ðñ-0.97637511742194594ÒÓ0688748667137R#20ò0-1.f@2988{@3842iP8 -5.Ž 05§F1419Òð-1.20593190551605'ÒÓ30396478954626#20þP0.0 9�Æ809297789743UP709.8àP44105cß-&@6.80ý™255193975 0 F`504639�D3489FÀEö-6.499751645479821F F0458c'#59,#20©Œ°-1.67674490¿%52?>š0êÅ406210180302G“ð5.4242749957378916€µ¦§±63267948966àð27765497888902 asin0209ð> asin 9.5342145121164749e+307 -0.0 -> 1.5707963267948966 -709.84165758595907 LB0210Uò-7.0445698006201847VU-VUó53902780872136 U1Uð1.0016025569769706U8«V¬Ô9095709697881W2Wò1.6552203778877204Vÿ0.48761543336249491ô710.39328998153474c3cñ248571283038486dÿ8 -4.3489311161278899c-dÅ1113557467784cüò117842813353125Çð5.123452666102434b. ÖbÕ3026464192303)5cö316763431300801€ÿ52939679793528982fÉÔ6453260239768-6gô0.80843929176985907 1.015085182776787zð > 7.9642507396113875e-309 OÕ9043283556163¤7hó8.2544809829680901 -1.742354814053947 ð-> 4.7375430746865733h!8 ÑQ44459'5216þ8iñ-5.2499000118824295 4.665557897751221i76ð1252459249113292j7Ò 12Ä1$0399hð9904782760833433bP73156ep4781163iò2660659419394637i4ñ14102757522312 -- special values~4100óÛ"->‘40.0#Á0-> !‹tEFMG# 1infcGk4infUÜ2I2.298� A¶4nanr 4nanboa06ã–Ä SñP2˜Uö78539816339744828 Ù1µž2 †1µT&0 Ì1³-©21Á ->O—ô ignore-imag-sig`1Â.2T¢ÅHÔù±0¸?ÀkCí`¾\02aQº 2º‚ à asin1022 asinY 2.29�8 nan ->Ðnan asin1023 A inf!õignore-imag-sig242@-0.0Tô1.5707963267948966 -infd52™?-> A 6AÂs Ç7"c 181Nî4-> ·9#O2"302Uø78539816339744828"313ž3N ˆ"32#¥?> -2 3×4ÂCèäÎ œÛ-c4Μ%(? -1 --&ÿh: Inverse hyperbolic sine --JKQzerosäBh000×h!€50.0#Ç#%û 0 %ÉhM%-> %º%?qžôbranch points: +/-i?1¬1ž¬/2 »3c4 Ê4¤h Ù5jèð values along both sides of –•inary axiª2þð -9.8813129168249309e-324P å2Ù.N! O4|`1e-305=+ +,i<-¨{Q1e-15”X%15¦2®\,X-§X)9.Nu998e-17À£žx-Lˆ Mº˜P0.001;ï±@0016E74169І,:u;Ùt95786H‚ô61750165481717001€ë€FŽG H0˜À99999989 -> ñ0.0 -1.5707963118937354 asinh0033 ! -):0.9S89 ->F4FE:1.02D÷2.1073424255447014e-08œ•267948966œ5VœW-X 6X® õ®ÿ0.044717633608306849¬ 7T¬ UV8Vª2Ëÿ> 1.316957896924816E 9C}# -D-E#40Eˆÿ> 3.6882538673612966" #41D‰E-F2F?1h0ÿ> 37.534508668464674™ T-U 9W0e+1QÁ> 346.080911B/67g 4X-Y\Q1e+29 ÿ689.16608998577965\ X-Yó9.8813129168249309e-324È g4"-L¹ M5*`1e-305;™) *e+ô`1e-150*T5150) Ê*T+ G4-17dt ’,J„K„P0.0019ç 8 165741'5d+8q9D 0.R³6F~õ61750165481717001³ <DŠE64‚ˆ€6MÐ0.99999999999ñ999989 -> -0.0 1.5707963118937354 asinh0062  '02Bö2.1073424255447014e-08T•267948966T3T| T0U-V4Vªåªÿ0.044717633608306849¨ 5R¨O ST6T¦02.0Dÿ1.316957896924816= 7Az B-C8C„ÿ-> 3.6882538673612966 9B…C-D#70D>1•ÿ7.534508668464674•#71Q•R/-3Sþ 9.õQ8e+14E¡346.080911:/67W 7ÿV-W TQ1e+29¬ÿ689.16608998577965T V-Wó -- random inputs$10ñ-0.5946402853710423¤‘445065489Ù0145:-ñ6459775392653022.ô3825622144153635|'10%À193539580461½6; 17­³24793193454ió19237926804196651.õ171741895336792Ñ;Žñ33117585138955893 -8.5256414015933757hõ2.8327758348650969 -1.5668848791092411eK�1.5184043A3571Íò73491245339073275ð1.2715891419764005Ëõ39204624408542355eYð-0.60716120271208818:p2890074KR43654ÁÈá11929942118723›ö2474593167811813gkñ237177865112429 2.8832601052166313.ñ1.720582077241323µä62026170296309Ë$10{Ð-2.3906812342¸7aå63492168485740aö9609636249445124 0.814214266057470\›ò027605019787620517 183.8558847655055�Á5.9072920005æÅ`707813fF4787ò¼ð-0.99083661164404713¥ñ28006797051617648)ð0.87501852512839ñ95 0.019894099615994653 asinh0109 ð -3.0362951937986393 0.86377266758504867 -> -1ô6030714685221 0.26475058859950168c#10cð0.34438464536152769 -0.71603790174885029dò0.43985415690734164,õ015037409294324e1eð4.4925124413876256 -60604595352.871613cà25.52078373861 Úõ570796326720768)#12añ2.3213991428170337 -7.5459667007307258að.7560464993451643a2%•210856117Á3`ò0.212919397416820287Ñ2042881478440að0.77275088137338266+õ3182099250896895c4c€6.644735ê`455957\ò97196191666946996Äð602830695139672*ö1436824741231996b5bP7.132}ð655083746 2.15163ŠP27068uð> 2.7051146374367212K 9051701669à%81Â6``0.1884]ð 905063442 3.4705348585339832Á÷1.917697875799296 1.5141555933479D7^ð9065075303281598–ñ621681454822201_@0.19 p5078593+È013422809614æ8cà2.024200466573{! 0 Á028164749578nð1.497036621289600"€30526007B“§Ðð 37.336596461576057 717.291pp1678234!ñ7.269981997945294!€87910219;ó 33 -- values near infinity™$20ä01.0mò17500874541e+308 1.1497786241240167P-> 71°34605565181²ô8185093696179347c$20éó1.1784839328845529R01.6$³29586716638k 6255783678ÏÐ9499631173560,Öôð-4.877768224890žTð7 1.4103736217538474�-Øð28970147376992 1.23yfT09644¸$20ÿP-1.28H”890323310¿ô1.573239261315569!> l0597xp4290745Ù�886571814%E2452Ù ð0.0 6.8431383856345372Ä|ñ709.5100171844460"e948966Uý-VP8.6010q3223805U-Và73874482126689sVóP0 -5.ø€39606730L ¬à30413698733742 Ï ­ì­p-7.1507q3462180ȯ 55ò8~?705Y â 1.60251361A3934 ö6Çp2261076§KÆñ1.392781985823911˜¶0½ 10.2206589ñ!89RÀ0 asinh0210 ð*asinh -6.0442994056210995e+307 0.0 -> -709.38588631057621 >Q0211 ð -1.2775271979042634H58 -Iñ10.13428215553972J2Jò1.0687496260268489Ið1.0255615699476961 Ÿõ95584521407841 9.5959010882679093e-309i3iò050967333370962iÐ-0.87668970114433kú89443961168183 -8.7224410556242882l4lñ-5.716145281486239mð7 8.2377808413450122kvð 3006540611166 1.441142664)0116k7×5kó8.200904072765331Òõ-6.407409526654976kð69101513070109 -7.8130526461510088l8l6lñ 6.4239368496483982 1.6365990èC1427Vð> 710.38197618101287 1.5707963ªU48966d7dp5.47291ûÌ0882mù1227237438144211eà00511346983546/f8fð-8.345581829741]rÃ317202018201‰ÿ10.25619930551818Ë 9eà2.6049726230379�@7952âq44022708œð10.474488476856440 Íô -- values near 0E#20zò1.2940113339664Ññ14 6.91691904177745U2ï3s€2.384847:ð874649e-315 -3.1907655025717717n4u=ð-3.009764367964162‘ñ16 4.69362363549184m4uIñ-1.787997087755751.#°622834902341ê4uRWð1.2491433448427325J4;K2-P2.5024€1545380690‡ M,ñ-2.96439387504747ƒW Mü=ð2.939690592755416J2GO!Oåð5.6404293002935G1êGÇð3.3833911866596061ë M3šð -4.9406564584124654e-324fÉ Mtð-2.221137922799484Æ(Ð> -2.22113792ñ!27994845e-308 -0.0 -- special values asinh1000 A 0.0!->6G1001#O $ H2%B!->| %3%*& '4'”0infpõ1.5707963267948966252@2.3 +!->262d0nand5nanU7#U0-> #8#tJx>9#J#1„F#ô78539816339744828œ1”/•3œ1’œ F�œ FŒmi õignore-real-sigN1£IN1”-m-È1¥4¶yýo¸1¸- %2º ~/0.¼2¼š‹›2¾1œ2¿~(�œ2å‚ J{2ÒŸ>>6ålª 2ÕZ$ŧG HÇÈ î3É ÌË3Ë7© ƒ3Ëò[&3Û4Æ0éµ%%¤%§ ^-zÿ atan: Inverse tangent -- 50---U` zerosBñThese are tested in „AtanSign�_cmath.py5w0á0tan‡¼î3-- $1  9 &2&ÇâL3&+</N™‚ò along both sides of imaginary axis Ÿ Ãð-9.8813129168249309e-324 -> 0.0 -9.ð8813129168249309e-324 atan0011 Ÿ -0.0 -9.,? ->! M2ML`1e-305;)3)v*+4+E8150T4150)5)D*+6+T:9.9U8e-17dI7Id+J K8K”P0.001903D5333797b880839"209b95786~ô660957090286630{2;/0.C‰D20Š9†õ18.7149738751185Á2KC†D d.22…ó1.5707963267948966 -18.36840028483855”2ŠP-Q°1P ¬ ô3.8007011672919218¡ ·Q¡R¾2K/> â00.5ƒÄ614433405489” ÉC…D3Ô2Ú‡ô05004172927849126½3ÖE‰FØ1K  C#3ëVªW þ*1+14ˆÐ61e-‚3øJ¤ K ò;_1e+29” yñ0'3üT[¥\ K™ê +öØ À24 atan0040 ÷atan 0.0 1e-305 -> P0041 * -()2)(7150P4150'3'A()4)P:9.9T8e-17`G5Ga*HI6I�P0.0017 03D5333575_66063787_9578þ6zõ660957090286630w9@iAB"50B‚ D9989‚ó18.714973875118524ù570¿A‚BP.)2�ô1.5707963267948966 18.36840028483855� vN-Oœ1N !œô3.8007011672919218�£O�Pª!2.‡Üô0.54930614433405489�µA�BÀ2C?-> ƒ 05bµ72927849126±ÂC…D6Ä1; $6×T¦U ê)1+14/A61e-Z6äH  I Þ3_1e+29� v9Yû6èRY¡Zò -- random inputs©#10üð-0.32538873661060214 að530461550412578´ -1=Ð2728427554227÷ô69451401598762041c ó45863393495197929 -4799.1747094903594c´�068820623có0002083691605063614 #10ô-8.3006999685976162 -2.678889025179093Èà46198627718101°ð0.034811669653327826  atan0103 ð -1.8836307682985314ñ1441976638861771 ->ô839984370871612 -0.20630956157312796b4bó0.00063230482407491669 -4.9312520961829485fò5707692093223147fô563867743008304f5f÷84278137150065946 179012.37493146997bõ963267685969 5.5862059836425272e-0Ê6dð 95487853984049287 14.311334-dô661322859434561 0.069676024526232005Æ7bÐ1.351325253964ñ 9 6.0500727021632198e-08eð0.93371676315220975 2.140800269742656.g8g¶ð566254458595795 0.11O³71944159823eÁ205564637111¾,ô493405387141732c9c05854ô8795408559 0.6443896542321286Èð68361089300233124 0.46759762751Ð#49c"10cñ48.479267751948292 -78.38638246011254Äð1.56508887709105Ú–ô9227681137329758U"11bð1.0575373914056061‹ñ7598801237729698Uð0.94430886722043594,ô31915698126703118Ä2b�4444810.4 P772036ñ5655340459394255& 1.ñ961018134231 -2.8ÅÕ6437701909e-1Æã@0.01P40508p0009fñ03293266855028247g.0120ö3É-Å412147768349ç1çñ1.535358530015491Ÿð1947099346796519RÀ1.3400310739=*ô29996003607449041á 0.21869457Ž�70882 9.9_¥8425400709îÐ8584607887644M0100*@8817‘LÛð0.1778329015024�°ó433468986365095ëñ17668728064286277,`243580T87384>1Üð15.757474087615918 383.572621425h!> æÁ6894060369628ô026026817278826603HÒ€10.58701^P53331“ñ2172023808184343àQ1.476€81336236½ô019199097383010061aÐ00.8ƒ±07867878120Vð230148609359502߀0.714725¾P53492ø0¶`1221953ò 605 -- values near infinityy#20æ 7.Äp3970111ª°8e+307 8.16ÿ¾S74630-D7àó948966 6.3439446939604493e-30%20ðð5873698696131487l8úó0780367422960641mÀ-2.9279309369781nüò-1.5844551864825834Vò1.0290657809098675„¼Ü�2.8829614»6Ž nð3 atan -1.31687ð92562524032e+308 -9.088432341614825ð,7 -> -1.5707963267948966 -3.5499373057390056e-309 atan0204 ð 0.0 1.0360465742258337Z8ZYù9.6520757355646018X5X-Yõ045063210373196Y³ù9.955138947929503Y6YXò-9.51552967157636Y ²ò-1.0509136480201²8 7Y²—ÿ565700490496501³ ù-6.4243816114189071µ8\Ð1.29563393895Ö4VÍ/> ´40.0 9Dô440812624377215šEÓF"10F ã63178646193641íF KŒ&11Fp5160569BB1069Ñr8GŽ2H€1.236162R03838Fð4.6827953496242936T& "13Rñ7.00051647289721Rÿ7 -5.8631608017844163S¦$Íá05344400333850Vñ8 5.119919726842031U/C!ô1.39917251814725B€3.568776ô7U«ñ8.1252833070803021 6.278295391734382P,ð1.5927890256908564Ð,1,ð2.8034285947515167„ó337804977575387%-àð-7.4749310756219562iŸ19ñ-1.4073509988974953 1.677638178596835 ¯{€5.960760òi364569i^ð-2.7135551527592119ÓÔ2815674455257Ÿró7.802944772756532rò -- imaginary part = +/-1, realBtiny%30¬Pe-150ˆ0® -0.7853981Kð744828 -173.04045�C8333D#30­1F5æEDô178.79691829731851Ѝ;9.9Ue-161šUô-184.55338102980363V¬-š6šßô190.30984376228875E�œÀ888671826830‚2œWð-368.76019403576692 §¢Additional›òvalues (mpmath)|4¡À1.7976931348Å5L±0192rG¡-HÀ1348623157e+ð308 0.0 -> -1.5707963267948966192  atan0402 ` 1e-176;1.04715!939-:-;4;0g1u#096P73459"v5;-.<=6=#0.eaøù0.7853981633974478100.7B æ‰ B`886473`Á8BÀ4.1014199471æ…41.4˜6B9B÷255.765591500789¿*57À"62Æñ -- special valuesUB1000UI®‰ #1#4nan" !K81€ˆôinf divide-by-zero2D"*²o2;-242.2"8·óAA»@4nanq4Õu£$-_A#ä2»1 30.0Æ1ß0-> è1Þ¶*1îq"n{ô ignore-imag-sig\1ÿ>dî!->OØÎr “q1Î!)?-> . 1Ì0Ï?ÊkC0Èk?2æ,o 2ôŸ€2ä�0Ñ}!_2ñrò Ë2ó`º6#æQ2èIHº‡Ûë4|AìÈa×¢3ÞÖw½À67948966 -0.°0 atan1031 Y 2.29õ8 -inf -> 1.5707963267948966 -0.A2A-2325nand U4#hmˆ »5%61.0%ˆädivide-by-zero464"Q?> -â 74)C8C0¦|494rC#40C/w? -1 --Xÿh: Inverse hyperbolic tangent --PQ¥s ñThese are tested in ”AtanhSign�_cmath.py6ÅBh000ò h i$-> &õ&.ƒÞ2000Ühƒ!> PÒ(QR+ñvalues along both sides of real axis¥Dh001Æñ -9.8813129168249309e-324Ô?-> Mí-©N!Oe1e-305‹+H¥-ó˜h -1e-150X+ù+X,-òh, áu998e-17h/9.K KxàL M4%01‡ 0.Ê!03@533399Uu:;2XY0.578ð6dHù6609570902866302ODnEŠF0w9Šò18.7149738751185ùD_DnŠEFx.v2‰ï36840028483855QžQz– R†SÄ1S ¸¤ü3.8007011672919218¥À966 atanh002ø7 atanh -1.0009ð -0.0 -> -3.80070116729192180ñ5707963267948966 JD0028TD2.0 Dÿ0.54930614433405489 1.D9D‰E-F%30F3‹ÿ043505688494814884Œ)31F�GŽ 2H+10�(9.„�9998e-17Ÿ 3W ®X° 4Y<E+149Üo1e-150¤ 5K ¨L˜ 6M´KV1e+29˜ ¸_9e-30© \©]º Ð9.88131291682™$24Qe3!,¨ M4(1 5‡) e+îÑ)ÀTU+’ |%dI�+uúKŽT0.001; >3@53337i*k 8�9DY0.578,6a·ú0.660957090286630{;BkC†520¯ò18.7149738751185àBKBk†CDd½72 p18.3684–o483855¦5ŠOw’ Pð5°© ¬ [Ð5·P¡Q ¢À966 atanh005ñ+6 atanh 2.0 0.0 -> 0.54930614433405489 1.5707963267948966 8G0057B-C-D8D3‡ÿ043505688494814884ˆ 9D‰EŠ#60F+10™:9.9_8e-17›/61UªV¬ 2W;D+149Ðo1e-150  3I ¤J” 4K+1.@U1e+29” ³_9e-30¥ 5Z ¥[¶ó -- random inputsÖ$10-ñ460925980633501 ð038050126721027:ð-0.41984265808446974-õ60354153938352828gñ-1.693461426982905fó48807386108113621fö58592769102243281 -1.353783747097589e($�467293985» 07ž`478683çs5395876eð69961624370709985eô199445015657007$10D0-5.Æñ232418984888 -544551613.39307702d°1.893265755a1744Jª…495852351`îð1184146038126363ð3.2599788998233´>äð00101839365474051–ö1.2731614020743833mgñ073345736950029532 0.35821949670922248Ñð0.0065004869024682466.P43993šf192089Ѐô-13.866782244320014 0.9541129545860273eÐ7189685205505íÞõ6583227046314093¡ð-708.59964982780775 21.¤´02159266675c0D`877907É0741dæ70752584283895dÁõ-30.916832076030602 1.369189713882984Çð32292682045743676c6¥–209484711*9}A7461Ž`986175+™Ä479744391306eð56467464472482765�õ961561282417262e1÷ð0.400892467374156J€1.632285Ãè9,ð0.1063832707890608'ô0402821335326482�1ñð2119.61676882621vñ1.5383653437377242e+1Y@8.95XP851830/2i—$11õð756.86017850941641 -6.606408713ñ03223817 -> 0.0013211481136820046 -1.5707847948702234 atanh0113 ò 4.0490617718041602 -2.5784456791040652e-12hô25218425538553618fÅ963267947291f"4 fò10.589254957173523 -0.13956391149624509cñ094700890282197664dõ695407140217623d5dó.0171187553160499 0.7076611346535401cõ55260251975367791 0.96619711116641682b6bð0.03164550252775084dó067319983726544394Èð31513018344086742¨õ67285437670549036g7gð 13670177624994517 0.4324t5hep1153893k`017253+ö139200814533621Ê8cò64173899243596688 2.9008577686695256bÐ0656801424241Ëö5 1.251853572405392ò9bó19313813528025942 38.79961915074186Žð00012820765917366644 1.54502922ó3612 -- values near infinityB3200}ð5.3242646831347954e+307 1.37403960800841538èp2.45192Óþ€576e-309‡4707ÝE8966n1n°1.158701641"#58Uò6.55792688733758n° 6.53653752~B5098n²o2oò-1.3435325735762247qò9.89473692596015pÿ-4.825668090658995ß"0-1.$Â857522598942pó-9.470120470239100g0-> q 53ÖŸ262872645â.à0.0 5.66141810µ1849åÍÚ(-(@6.98 2721450139¼G Höð -7.497061306031YHg¸ ×p)ä28060188031406.>0êq¾P8.221j’336000745�Š>žP16256`954813{8Ë ¶ 1.A±51961728089/8›ÿ> 6.751501708395132Ö1•@-1.2æ¡1626359878·8‚ó-8.141985636053761]¤1ƒ±-1.06164277ú0426¹¬°19364239948x9p 1r`1.2971²s101806825.2\�452333293ÈP7.709݃51099832ÜÇkó1.1849860977411851Æð7.9781906447459949 ->ñ( 8.4389175696339014e-309 -1.5707963267948966 atanh0214 $ð 4029969422586635e+308 0.9Uò986543663375 -> -7.127599283218073lk5kð4.7508098912248211kñ7 -8.2702421247039908kñ2.104904264527804l8´Ø6mñ8.2680742115769998 8.115389841091806ê7kO0.0 Â7Uð1.2575325146218885Œð4746679147661649ÕÁV„ 8Wõ-2.4618803682310899 1.3781522717005568W-X®9Wð4.0952386694788112¯bª3376353703W¯ô -- values near 0E#20j@3.80ð3659811628e-314 2.PÀ4842390743192r3s1sð1.739111073361187sò21 -4.35478006725414t3t4u2uñ-5.96568160813250vð17 9.969225355541626ª1u4u3uñ6.560667117840023Fò3 -2.1680936406357335Œ§5weñ2.523094440182077z9LKù- 5.ű56949006465±0LÑ MÙL12C 7249468377YË MÑz�-3.086110zQ20603N6›!OÉð3.1219222884393986—!0 ´/> K½Q9.892vp6497619KÔL M3 Ö 46Ÿ€09291815"$12™ Mzð-9.881312916824930224 M/> !  Nò real part = +/-1, imaginaryCtinyy$30Æ1¥Ae-15Xð176.4943332043244³p7853981e744828E¾E:9.97V߀177.6456èŸ082149 0.VWa1e-1616ÿ185.70467357630065G ëF-G�°90.30984376T‚ŽÀ816339744828± atanh0304 òN -1.0 -9.8813129168249309e-324 -> -372.22003596069061 -0.78539816339744828 -- special valuesmC1000m@0.0 !->50.0#1#0nanz*5nan#2#²a-> infJ ådivide-by-zeroG3GC@�õ1.57079632679489662,12.3r25d2ÎÎ6#ƒ‹U72Y282h292²2¹1͹ #ͪ #Í› Úõignore-real-sig1ÏI0-> lÀ®€-�1³^‚™1…^1×6-@l`1Ù+4Û¯thÝ-mœ2î—4ÿœ ”2Œ $ÛL š$2�'>Å0è2'�ÿ.M2á9& ‰(2ôlÝ Â2ö2uÉ6ø6Ø×3è‹Ê×Z3ê6SÆ 3ü6Æ36¿¡Ç ê¾ ë3èì%‡ ¼ Ã3 7?‘1÷,4õ0lhóðinf 2.3 -> -0.0ñ 1.5707963267948966 atanh1040 ` -inf -> -0.04? -ð -- log: Natural Ÿarithm --: € log00003P 1.0 �!->30.01¡ !2!-Aó3.1415926535897931/3/E Q1ò-- values along both sides of real axisY1Èñ -9.8813129168249309e-324Öfÿ743.74692474082133 {1üSÀ-T-U0Ve-305—ÿ02.28845336318398—CB†C†4‡Ee-15úÿ-345.38776394910684†5B†C†6D:9.9U8e-17ÿ36.84136148790473–7R ¦S¦8TU0.001•À6.9077552789G6±9A„B„2ÞY0.578,6’ÿ0.5464528014091418“2ÛP¡Q¢Ø0Ì9¢ÿ1.1102230246251565e-16c2éS¥T¨ú.ü2§ð2.220446049250312ަ Q¥R¤1S ÿ099950033308342321JQ¤R¤29ÿ69314718055994529’?ƒ@€3&23��3.1354942z_91497€3?�@€ð1CÐ00000.0 0.0 -û(> 36.841361487904734 3.1415926535897931 log0033 log -10P.0 -0O-P4P:9.9t8e+149 Sÿ45.3877639491068¢5R ¦S¦6T+1.öU1e+29¦ÿ688.47294280521965H7R ¦S¦8Tô9.8813129168249309e-324Kð-743.74692474082133ß9C –DE!40E`1e-305\ð -> -702.28845336318398212J34240150K33Ö30.02¼01e-2J34 Ÿ6-17vAv�Bj†C†€U0.001uÀ6.9077552789Ç6Q_1Hd2d>Y0.578‹6rø0.5464528014091418s;@e�A‚580 añ-1.1102230246251565e-1¡CICh…D EZ í2 û2.2204460492503128†iAe…B„xq Ž„ÛP09995”�30834232AwAe„BCv%2._ñ0.6931471805599452›/t/Dc01r&23a�3.1354942|A9149d/a/Ea016P«Wu¸6K>c~?~FøÙ ‚GBk†ó†H¼À01e+299 0.0 ú-> 688.47294280521965 0.0 log0065 log 1.0Ï1e+299 -0.0 Có -- random inputsV6Vð-1.9830454945186191e-16 -2.0334448025673346eó0.70973130194329803 -1.5707963267948968c7cð0.96745853024741857¶ò84995816228299692að25292811398722387Œó4207570438536905a8að1603644313948418`ð2929942111041835_ð-1.0965857872427374_ó0715870859971419_9_â59179131684386v 25ž³99251132177a`209347%`249901aò1334784232033863a$70að 68907818535078802 -3.06931083476�ð1.1460398629184565€°79164038139‹1_1_`17.268ƒð47565589 6.81651200O½ð2.9212694465974836 2.765624508d3164\2\ñ.7153894479690328 26.43405537280263:ð 3.2767542953718003 1.6355Ëß4173\3\P8.045Sð 648936578e-06 0.19722758050208½ñ-1.6233969848296075 šÄ8371206810104b 2.430644268ñ3173 0.684691975070099¾�0.926335920969Dô2.867016057671833]°ð-3.5488049250888194 0.45324040643185254»ð1.2747008374256426 3.014564004511]·00.1ç±51685151018 °26062518836É1“ð1421287121940344õ955584408411834}µð2.71248377956383óñ13.148769067133›�> 2.59716;A5706¼q1.36735YS20943R7±ð3.6521275476169149e-13óó7820543023170673e-0¸òÐ2658136741569øx“171384316œ¸€5.0877544Q862233p2834978¬A8685uð1.6576856213076Å‘-0.247115/S73848u8µð0.26477986808461512Vð67659001194187429à`-0.319l‘5207999977¡1977736719œ¾8¶ 0.œ16 À071962 5.351Ÿ!60*4Àp7737117ÉB3829úÓ5206219261802^¸Q0.296×�46215788qó002005604504258479~ .2á@3366ê0588Ÿó006760311416868920Á8Á�0.8210423ã0Œ°5 3.9005387C0331êð> 1.382791896529959°36333047018‹48»A0.27Õñ 5358180667 124.4208811094580]`4.8236î2n2ä68604725878901Ûº{ñ262869591682674ï0580o@5730²>ôP73821]€37809126~ɱ65360960087‡ðvalues near infinity loð%g0100 log 1.0512025744003172e+308 7.2621669750664611ð7 -> 709.44123967814494 0.60455434048332968 lof1fó5.5344249034372126Nð1.21558591584312758gó8562300345679 -1.143553056717973f2fò-1.3155575403469408Nò1.1610793541663864Íó75847809546428 2.41848796504974d3dä63236672097323±ó1.5429944621144zbÀ10.005452365íó6 -2.3843326028455087e4eñ0.0 5.944927669232771™�ó8.67616191258526 1.5707963267948966Q5Q-Rñ1.120185045902569Rlï30970253338171R6RQ÷-1.621422593346652öð09.6795125501086½¤7R¤ú-1.745326979159105SÂ753150560873T8Tô1.4408605776014 ½É 56ÂÃ20058262 0.099Aä391515176148283B2266WP1327 ÇC1bñ-1.20135440129529ü8kç3ló 823023956 3.1415926535897931QMwä70433782597680Ï–ÿ70929198492399 -T;ð7.2276974655190223"P7 7.9 ’711369164²P8.871Ñp6512104F9ŠA9307aS8e-30Õ1:Ã785959371607à-6.19562008682=åÐ9.31023883080fð-5.5279244310803286gk1<ñ-4.667893387447104¢P7 9.9d220382Ìï43433142431388~K01.5~p1245395V+°8 -5.311719šb375619bP9.608Q7835008�\ 7.)7p1504435Žä32070377662635‰Æà62282865085137.1jô5.9760325525654778 -8.01494739973491Áÿ08.9749317724839Ì1x°-7.88019420oñ629 1.786184581476744Q~¿77629046837 —à-9.88643899385ú GP23578ž0747–Jÿ8.71693946977302Œó -- values near 2Æñ2.2996867579227779{# 6×`077093�Ae-31\ñ-708.3634356771739`ò0029509166223339815ß2ßð6.916919041777451åð23 -9.041401318894811e2k!39Â@6796Epð 4944423210001669 log0122 ð log -1.5378064962914011e-316 1.8243628389354635ñ%0 -> -713.20014803142965 1.5707971697228842 log0123 gñ2.3319898483706837e-321 -2.235876394186637€3hñ9.9045008332522¯h£6337224766g4gñ0.0 3.87277010108112P5Pô23.96033425374401¸•632679489Q5Q-Rð9.6342800939043076¼2S�39.167072,O1752S6SRöò66099393427834e-308Rà08.37814861757]¥ö ¦7S¦ð-2.118469567376662§1úø4.5636103673181K U8Uñ1.13635098543486™122 Àð> -741.30457770545206�9Cð3.557272650056975ŒÆDÑ0.16340580236â20.0E!30Eò-2.3696071074040593ŠEó12.93865466421641 3.1415926535897931S1S1813ÛQ72669217 HÜÿ28.88512203138862 -Tñ -- values near the unit circlet#20ÇJ0.59j8 0.804Ð2.22044604925‚�2e-17 2.2n³74355881808bÖ:0.7`j93 0.6` 09a�6.1629758á@9154Ž.ð4350110879328448 ässpecialìu&10×0øVO-inf{ ãdivide-by-zeroG¼ FÜ7 G2Ù7…0-> • Ý2100•12.3'. \V/ :^0nanG3nan âM0-> ¬œ ‰D9 1�Ø=Üìblog101®é“/ – ]á2101‡Mx mð2.3561944901923¤œx*.ñ0.785398163397448252101x+9 x1xê y8 ˜1xÛ 2wv¬g µ2Wõ!> ©¤=4À-zero log102±3 log 0.0 -b> -inf  ödivide-by-zero log1024G?!> ó1.570796326794896605032.3o0 60£Z1 71b81]  ó3.1415926535897931Ã91g“1!301Ua20.0R&31!Q!2!¡Hsó2.3561944901923448RÞ+0ô0.78539816339744821È2nan0-> 3nanQ¸-£  ¨¦q ? - 0 --Þÿ 10: Logarithm base 10 -->  At000eb10 1.0Ö>D"f"Q# Fix Gô1.36437635384184142j2K# -W4ó-- values along both sides of real axis\1Ôñ -9.8813129168249309e-324âÿ-> -323.0051853474518 }tlogt001UÅV-W:Ve-305›005.–@1@8~9r³zEe-15ö r Ë8r!15Ÿäå::9.9U8e-17ô/16� £G‘H»IU0.0013~ ¿5m6l2ŒY0.578þ6zÿ0.23732143627256383Š2ŠS˜T¨ˆ0¤9¨ñ4.821637332766436¿ù2¥UªV¬Â.Â2«ÿ9.643274665532869« ÞTÀ-0.0 -> 9.64ð&32746655328696e-17 -1.3643763538418414 logt0026 log10#H0009p 0.0 ->ÿ004340774793185929 S7S-T ¨8U02.0’™ÿ3010299956639812–9A‡ B„%30C3…ï17278360175928…)31B†C†2D+10•?6.0‡3C –Dˆ4E(9.6”9998e+149¦ 15ôä‚/35H ‘I’ ÌU1e+29’?299 ÁH’I’¶ô9.8813129168249309e-324#ð-323.0051853474518£3ºEŽFG4¾`1e-305aD 8(¤(C)*ŠU1e-15– Ro(CRRTSÈIP-> -1›40.07C7bq892V0.001 ¿%?M LìY0.5786Zð0.23732143627256383CêCkxDE5è0—ò-4.82163733276643'R5EmŠFŒ".F@0002÷EO9.64²‹>DkEŠZ1F žŠßç‰fCj‰DˆrÇ v~1Ig ·À2 -0.0 logt0ð058 log10 23.0 0.0 -> 1.3617278360175928˜ logt00592-34#604+10u6 313[©4 525:9.9`8e+149Ç85·40.0838 d9:4:+1.ÚU1e+29r:299ß58 dr9ô -- random inputs„6Lð-1.9830454945186191e-16 -2.0334448025673346[ô0.30823238806798503 -0.68218817692092071g7gð0.967458530247418579ò84995816228299692eÐ1098452842228ƒô -1.051321426174086cŽð-0.1603644313948418bð2929942111041835að-0.47624115633305419,ô89967884023059597dÀdñ5917913168438699°25238799251¤#77fð52521304641665956fó92655790645688119f7òQð 907818535078802 -3.069310D5476‘ñ497718788506644õô77809953119328823c"€-17.2681ãð 7565589 6.81651200146047®ÙP26869ô 8098534 1.2010954629104202_Lñ-1.7153894479690328 26.43405537280263Q 1.42307630&À751 0.710331-e900530!só-8.0456794648936578e-06 0.19722758057570208‰ð7050323524498756gô6822058934805551R7 ð-2.4306442691323173 ìÑ4691975070099Æ!0.4À257845332595&Ö4512925337489…Èð-3.5488049250888194 0.45324040643185254à0.55359553îP41063sm´85108866405‡Ý00.1²51685151018®À606251883621Obñ960201973291363K@4150=„55660430Û7Ûð2.71248377956383ñ13.14876906713338P1.127op6133170žö0.593836166438032‡Ùð3.6521275476169149e-13€78205430›r0673e-0à 4.:À722398941112y¦”2727171140ßà5.087754581386>xó283497832678685£ñ7199237180642684ÏÀ107321043521x8Ûó0.264779868084615šó7659001194187429’@1387Î�935281681Çô52018649631300228Ý 0.à 75+ð398071962 5.351»!6074ÉP28473´r 81€@6820àð98178033 logt0082 loò8g10 0.29667334462157885 0.00020056045042584795 -> -0.52772137299296806 /ò 9359659442937261 logt0083 loið82104233671099425 3.9005387130133102e10.6ô89028349361 0.59208690021184018a4að27268135358180667 124.42088110945804aô2.094894315538069 0.68123637673656989_5_ñ00262869591682674+p4779580r 57Çbð-0.32060362226100814eò7979964816877081 -- values near infinity~3100~ð1.0512025744003172e+308 7.26216697506646117„ð308.1064156268206ÙÐ26255461408256i1ió5.5344249034372126Qð1.21558591584312758jO�106009209)ô496638782296212i2i0-1.€Â575403469408QÀ1.1610793541B"640-> Óð24419052091019 ä03359777705266iyô-1.63236672097323¹q1.54299ù3144gP35145¿ð4093 -1.03550249243ÔÐñ0 5.944927669232771¦Žð7.77414657501117€82188176432075$10uð-0.0 1.12018504590gVzÁ049289770684ä6V6{Uê21422593346652à20989622030174ÐW7W­û-1.745326979159105XÁ418768020353(X8Xô1.4408605776014©ÆÐ1586219590875ç09Dä39151517614828CEÐ4348794720007òF1†ñ-1.2013544012952981ó07967114380773 1.3643763538418414š1q‰@7043V 59ðœà22282926451624�W_ð7.2276974655190223FP7 7.9æ�71136916ó307.85899996571993 4.7762357800858463e-30t$11\›Ã785959371607ó-6.195620086822114p8.04952¨ð69455 -2.400747076796É j_ñ-4.667893387447104ÇP7 9.9®8CÒï66912092839902Šmà1.510801245395k4ô8 -5.3117197179375619ïP17920>O1565˜ | 7.[ô750871504435 1.532070377662635�Ý@8527.Ë6 1‰ð5.9760325525654778 -8.0149473997349123e+ñZ307 -> 307.90390067652424 -0.68218817692092071 logt0118 log10 -7.880194206386629 1.7861845814767441e+308 eÿ8.25192633617331 d9dð9.886438993852865 -6.19235781080747cÈï79185604308338Èó -- values near 0Ú#20vð2.2996867579227779e-Ç"6.ßð0770939125e-312D-Eô63833129662572 0.00012815668056362305m1mð6.9169190417774516e-323 -9.0414013188948118nò21.0424970672714ëô4902805353306059l2là-1.53780649629]1Âñ6 1.824362838935463Ú0Úð9.7388887826322Ú¥5429998942k3kð2.3319898483706837¿ñ1 -2.235876394186637„3l÷12.65055220919641Ã08144538Ø4mñ0.0 3.87277010108112V5Vÿ4.41197828323476|#25U-V€9.634280ðV7ž…¯1618073175Ó #26WVâ66099393427834a2-> I×4472104545649 Ž#27W®ð-2.118469567376662¯1€67397777<ýƒ2çñ1.13635098543486¯ð21.94448750709819ù¢Éð3.557272650056975Ÿ 22ÛGÑ4488828466845ú›3›ð-2.3696071074040593Â0tìó09.62532365619722 1.3643763538418414ž3„a-2.813þQ72669�'17žp16.5507Œ�961042 -W Zòthe unit circlew%20ÍJ0.59j8 0.804Ùð9.6432746655328709e-1.ó9616571575684681a$20Ý:0.7d 93ÿ d 09e 2.`463916ÂP22e-3.p2794689:`75476 êsspecialLÝ(10Ý–?inf‡ ädivide-by-zeroJÁ IB: J:‹0-> þ4100Ç12.3+2Œ‰^3jfF0nanµ4nan6T0-> "À1008 log10 -¡0.0 nan ->ñnan logt1009 log10 -2.3 #$10#@inf J0-> ó1.3643763538418414U(112Y222Xc40.0T3"S"4"-Evô0232822653813811T52-1ô0.34109408846046035262Q9Q#17"†#8#í E–í "2•‚»"…" Ù2u-…!> ¸-Ü ãdivide-by-zero2�DI : JÅ8‹mô-0.6821881769209207Ç2Ç* 4 Éü5ÜjîÎØÓeP4n4 3Ìg#3$W$%|I3.3K3ꜰ Ã3Ù¡ Ä3È#zF? -ÿ -- sqrt: Square root --01ð s 7A0000@»F!1!c>- D2##E3"'-# Ýô values along both sides of real axi³1³ø -9.8813129168249309e-324ƒó3.1434555694052576e-162¹1ÜJŸk-L k1e-305…ô622776601683791e-153…9 t; 4WQ0t:9.9T6e-76s58 s: 6: &X8e-17‚T1e-08q77 � 9ð8 sqrt -0.001 0.€0 -> 0.0ð 31622776601683791 sqrt0019 q -0.00167%207H57896oDó0.76092049518987193y/21B{C-D2D‚Z99989† †3B †D4D:1.02…41.0u51 t363 Š dÔ0049987506246æ/27? rA8A2O�õ1.414213562373095rX1 c33T*23eõ4.79583152331271½3D2 f441¬0)Ú·3,: }!<$)9.½y998e+14® #S3e+74<3< &I ‰ % K TïY1e+29”+3.@6·• _BJ •L jô9.8813129168249309e-324îñ3.1434555694052576e-16q•‚I”J K4šg1e-305ƒ TPe-1538 8R_ 19 :¦Á9 ÏA6e-7p7£7Q89  bP8e-17ÓHP1e-08 6�6`78zty© nld4M[>0.05jN/0.§ £wFAh…B„5>0ûc AGAh„BÀ99999999989 à-0.0 sqrt0052 J 1.0€2 0.0 -> 030V1 2429W1à00499875062461>5>d?@6@02.0V0ù414213562373095p70G1b823cù4.795831523312719c91Id2d"6031¤0£§†919`{Uð6(9.´”9998e+149N P3e+74ƒ2 )H‡ IJJïU1e+29’õ3.1622776601683796±IUAItJ ò -- random inputs]#10¬ð-0.34252542541549913 -223039880.15076211iö10560.300180587592 -„96805192aÔñ-0.88790791393018909 -5.3307751730827402aô.5027154613689004 -1.7737140896343291aúð-113916.89291310767 ûð18143374626153858bõ2.6877817875351178e-05 -337.5157669103895Çð-0.63187172386197121gð26293913366617694f0Ü 0570749526€,`811254h!87CÊ2¶ò58185169308906215 -2.354831299043099�@.071>€34242007�ô.0985752598086966bKP-1.05½ð 4765935896 0.144003192591’6Äð069837489270111242f�3098775528`Àð-1.166759594750493¡ñ1115971147395367Šà0.051598531319… 51`�813981705s$29añð-0.512372841144990Áó026175433648339085€18278026­½°8 0.7160355¸d597614c"ð-3.7453400060067228˜@9465&c480963að2799008854169249*ô9554243814742367_Påð027736121575097673b¡3679430008ð719035603389 75Âó2096172651250545c1Ôð1501.2559699453188GÀ199732520728ú`Á38.746047664e9¨`015481ê2*$02#1Ôð1.48300753268505Òð0.64100878436755349bð1.244712815741096aõ2574926425843458`Ð2 sqrt 0.0953ñ+95618499734602 -0.48226565701639595 -> 0.54175904053472879,ð 4509239434231551 sqrt0113 7ð01091856818632777ò54054037379892561cñ786817985833238+ô34349772344520979b4bñ98779807595367897ó0001984875843722519eô99388031770665153 -9.9854872279921968e-05i5iò11.845472380792259 0.00100511045815067Ë 3.44172520¹A5397,ö0146018406123464/6dð2.3558249686735975 0.25605157371744403-ñ1.537127847738664bô83288964575761404Ä7`00.7@8941¯ð9098 1.049642062ò2076`ð020074438639088Š 51449287564552_8_ò1.8961715669604893 0.34940793467158854_ 38m�178141161_õ1263408093506690_9_À0.9602537831¡ð801 0.6957322486014)`ð0358710342209998Š�358199165dó457 -- values near 0Ñ"20rð7.3577938365086866e-313 8.11814084651127439z@8.57eð3531543516e-157 4.7320876342511c4163p1pð1.2406883874892108Xñ0 -5.121013332426977‰2qð1.1140990057468052qñ5 -2.29827569453â7s2s -7@P54530·À9502e-322 2.p3792447¬5Œ¾ó215758580748028ä"1.‘610007724‹r�-4.996324tQ80121æ 4 -8.471843 27sW[ñ50582312540437e-162æ 3524594195þ1æ&ñ0 7.69955360938519Ð8Cà96208481077974^o159 1.Bð-0.0 3.390082660649941^0»ð4.11708796399223ÖO155 ^]`-9.890,7Ë10822^€7.032353©1523sO60 -]»0-1."P93936â9v÷ð2.619440719656670158w`ð7.905050333459944Ñ20x@8.89£¢9979403099Õ%0.‰ûÀ1.8623241768Qr3_@> 4.n6¤= 57J 55lK3Ôð-2.66597113449988”0 ”Q 1.ª 80·Q03649TM3­Q-1.54F€69446724ô!10ußK-ÓÔ 59l0307¹!55{òinputs whose absolute‘£ overflowsS4¿1Æ9e+308 -ð> 1.4325088230154573e+154 -5.9ð336458271212207e+153 sqrt0141 û -1.797e+308 -9.9ò6 -> 3.72844764320573N2@ð3410406899802901gó4 -- Additional real values (mpmath)‹"50‹ŠÃ693134862315—00.0‚ñ1.3407807929942596355lD 0.0L×ð2.2250738585072014e-ãLà49166814624004sh7e-154L2˜Q5e-32‡Z€27587494\¡74834e-162;÷Uspeciïš3100æ‚ ->0!»-"‘0infŽ4infC3²@2.3 !->!4!!5!…"6"e7"@f8"1nan¡!9!ê%0-> 3nanê1N…!N"N-DO-Å‹’P1P"H"QC ÊPB Ó8101OÊ& õignore-imag-sig$f)8 {fß f2fœ !f’ c2e_÷`#f$hÅ2xGi¨#k:¯*Ñ2mj X9H[eŒ²3^�3`”³3c$ÿ$d‰G ŽcF Š3cãÁ± 3b¹ð,For exp, cosh, sinh, tanh we limit tests to arguments whoseZãòinary part is less than 10 in absolutel€: most o@ðlibraries have poor accuracy for (¨)˜Pe and§0ine?Farge˜,#6theDðof these complex funcs@ð suffer correspondingly. -- Similarly,p{!e/an" ?ðwith relatively smaÿll real part. - ÿ -- exp: Exponential function --@AÐzeros exp0000OA 0.0B-> 1 1-$ !2!A3 %BŒÄrandom input”44ð017.957359009564684 -1.108613895795274 -> 7.0869292576226611e-09-@4225Ã02377833e-08¹5eð.4456149663368642e-15 -0.75359817331772239kð0.72923148323917997,ó68426708517419033e6eð0.7600865488351£6ó4665723548010501bð41764393109928666,ó21035108396792854b7bò5.7071614697735731 -2.3744161818115816e-11Æô0033220890242068356 -7.8880219364953578e-1i8ið0.46539813279270ó5.2236706667445587e-2ið62788507378216663 -3.279864842002Ù/Ð9g@3.24™ó 5242295518 1.153562530424395/ð015799936931457641Šò35644950380024749`1ðð -3.0651456337977727 0.87765§Ü3878,À2980559562983aä88277518085566a2ò-0.11080823753233926 0.96486386300873106bð50979112534376314 0.ÆÓ5512419561562Áq 2.�7à8& 48•ô1963623575470807# 7706045285µ 39îó001513371734113768ë1´�3.3201709lð83357e-10 1.268407c448726'p2978069#`434889ðó5462610007689186Åâ°0.887672760Ã@3272ëP18953÷€86895557%ñ2.385962404985809¤ô4577155913204442`Ýð1.5738333486794742&°80307554432ä¬à4.825109113245­Bð0893553826776623ÅÝð1.64087023418137™ñ1.43887948438083€0.678673Ñó 689048 -5.1148284173168825\×�1.8202794¥@2033ð020812040370785722 ò6.172246289642090Kó284755888435051^Ì�1.727396dA4587_ñ6114062132895494¼À4.6067931898m!76Ç 29÷t6944413Z1áà06034306862995¡p9815313Q43550À@12.8Q£5889966629ep1848128Êœ2À`10.280°À19483029 3.4%°22559748535ð-27721.2833215515P9028.ñ6“2¼dÐ4007405129741¾P21258;d673172 @9774ÀP93353¼@ 0.2½³03729054447v2¾À 0.027364777ð!809295172 0.00059226603500623363 -> 1.0277424518"76-ñ†6086970181346579 exp0023 exp 0.94356313429255245 3.418530463518592 -> -2.4712285695346194 -0.70242654900218349 -- cases where exp(z) representable, ¢.real) not”!30”È710.0 0.7850æñ5803016909637158e+308 1.5790437551806911Y1Y-Z-[êðvalues for whichhò(x) is subnormal, or underflows to 0˜4ñO-735òð 4.3976783136329355e-320 á42198541120468ZòZx-2.35592-C@5207Da037293C Â669018234125[2åB -74µ0Kð4.9406564584124654J4‚6p676è 4X02.1"-#5#!3.E#i6$!5.6F#´Sz) ov¢I5�Žç0infÓ BA„2711ÝÐAAj‚01.5Að1.5802653829857376è#7 U ‚uA6Að-6.5231579995501372B6B A”A12.8Akñ7.483617741744852‡57 F k°Additional ì /‚(mpmath)(7iQ1e-08^Íû100051Y 3—1b30004583374L!0.C1°22140275816Q)841<¼ýp2.71828—459045235â7,-È$0.uÈÏ É37É4¢0É1çþášñ0.367879441171442321þ27ò2.220446049250313e-&¡!22*B8Bø-1.1102230246251565DºðA8889ÓF9F€2.302585ÔA9404ª„ €7217ù8(Í@00.0vG7829Ç89€709.7827Txñ.797669956663801ÀW10.0ÉsspecialÁÏ™Ï\¶TmwiØð4100’0{a-> nanÀ invalid eñ xp1003 exp 2.3 inf -> nan ‘invalid e040O-0.01 050a 060_‰�7N8ž 9 @"10 ƒ0-> 20.0&11 01.4/ 2 02.8 ŒAo-a54.2!&ca"05.6"c!R!47.0!cB9>¨B 3infBÁ  BÀ ÑA2C¿  C¾ `2B‚�ô ignore-real-signAimag‰kE-JÚARAŠ7‹(³‡I ‹ ÕƒÌ5Ì ÌÒ -2Ìp Ë 3Éx0> 1oJ3Êš  "Í> ‚øƒÐ3³Ì0¢a ]3ˆ-a 0½âl‚"P "…"23÷‰#VFg4Œ"W !Œ6X!e4Œ!!}!Ê ›4nÉ "`È !Q-Ç  O-Æ !N¢S4uD Jœ5”1Eˆ ×5”r\ ’ ‚ nan - ÿ -- cosh: Hyperbolic Cosine --< À- -- zeros �cosh0000 A 0.0B-> 1  F0001!-&" #2#E#3# Gô0.0 -- random inputs545ð85395264297414253 -8.8553756148671958Tô-1.1684340348021185 0.51842195359787435b5bð19.584904237211223 ¦ð66582627994906177cô159816812.23336992 10656776.050406246a6añ0.11072618401130772 -1.48482021507324_ñ0.086397164744949503 ?ä54275637717284b7bð3.4764840250681752Ã1484 ‘288275276Âõ4.325931955190844 7.524205354873795#8`ñ0.5204706360452460añ3603805382775585`ð.0653940354683802Áô9193293606252473Á9að1.3951896297599¸€00747386xa070290Àð2.1417031027235969ëó01415518712296308a1ãð-0.371070647576ë1˜ó4728085307856609€58060149Ø1991bô55712531964568587c%ð-5.8470200958739653 4.0021722388336292að -112.86220667618285 131.”403354501#1að170026144485188+`754013Ó0513`ð0.57208748253577946Âa141090tE4020aŸ 44°97902648783P90479öQ13974Áñ0.50760322393058133¼Ä396665201081 1Ìð0.052267552491867299 -3.8889011430644174Äð-0.73452303414639297`ô3554070483353713 1Îð0.980007641771274/ó1.254882924778409mA4722f`414161Ýö1.08794214321803ÅΣð3594701222644008^ñ8884789993018128Æð0.632797824193126¡ô0.06495456681600228q1Ñà1.381735317837¹`0.4318bƒ81673222¬±922166337467Œõ7807383085884934«Ð!ð3156811201484657 2225576095]9ð1399733125173004+õ133551234360595êÐ1Ô2!ð33062347 4.50249VR23837„ç`04160260626m¡3.15738221n$612Î00.57@1920Š 31@9262��12957534P0.698ó0405378381 0.47309067471054522Ë2ËP0.543i2Ò@62596S`648358ã#46 p9223446IA1934+a341679çd845501aÍ 0.00147774ÉÀ7920331 1.36 81&@7661 ð0.2012106963899549ô01447518137863219bÎð2.218885944363501 2.0015727395öP883687 -> -1.94294321081968 4.1290269176083196 -- large real part cosh0030 cosh 710.5 2.351999cñ2967465239355998e+308 1.3076707908857333 [1[-\60.6W 6]ñ1.4085466381392499DØò186402466645023Ì¢AdditionalÑóvalues (mpmath)�"50�¢1e-150 0.0q $¥$8#2G'09#05X35`0.0003|5"45933764623ù20066755619075848353!1.×fú54308063481524377363-õD-0.0Á7%Â888‘595õ1.316957896924816“2H4@1504$¯6ì-C†6 ö7.32867951399863Àt6777216�A2193£†+ñ8.71497387511852«œ„67108864BA4366ìB8€709.7827ã8ð8.9883497833190073272*"=?-> ‚special LR3100W<3-> Ø!40inf«1nan¶ ô invalid ignore-imag-signA3A:0-> @9*G2.3 z=9zi0%i%naŠJM!->X31008!01.4ì 4infc402.8!- "54.2"'E #!5.$ "1•7Õ f1•f ö \•1•6 ,1}S, bï1†.Š †1†!!†!!†˜µê›3101‡fÀ¶ 1¥ÃA‘ AÕ2³ˆ“ #µ-_ùÀ1022 cosh ináf -2.8 -> -inf  cosh1023  54.2$4inf#4#05.6#/"5"47.0"mE6#>!->tBnan ô invalid ignore-real-signA7A1"-0d A9Iimag98902.3�9%na[9"œ ""30"ys£-> 1.0 0.0 (31#F.¡ á ¨'32A0-> @ 9Ã-Ýz>zªÐ0$i3ÐÀ ô®ïÐ#01.4W|3²#€$�$€± ' -‚$4¢„-„l4¢#Ö(i ƒ4¢<5Ć‹µ'D#~I~… ( 4�ïA‘ Aqªf¶”ªÌ`©Ì$¨Ì„5§Ê"¦Èh5ˆ É? -ÿ -- sinh: Hyperbolic Sine --8 9`zeros ?A0000H!->>!1!ˆ=›#2#>‹#3#(á,%–Årandom inputž47ð17.282588091462742bñ3818794869410354ðô-14867386.857248396 -5970648.65535166395bð343.91971203143208Àò0172868877771525e-2xð1.1518691776521735e+1494ô7792581214689021e+127o6oð14.1781222533009Wñ1.938715757935129ô258440.37909034826 -670452.58500946441`7`ð.0343810581686239 -1.0970235266369905Íò-0.560708582780927,õ409888325804669Â8bð0.066126561416368204•ò070461584169961871/ä01055870093812/Ð5572767386375À42 sinh0009 ñ -0.37630149150308484 3.36217346921 @ -> *ð591118119332617?ó23447115926369383b%10bð049941960978670055 0.40323767020414625dð-0.045955482136329ªô0.3928878494430646d1dð16.64785260390371bñ0026852219129082098dô8492566.5739382561 22804.48067113356($12bñ.476625314303694 0.89473773116683386_ô1.2982943334382224 1.7966593367791204Á3_ð422.36429577556913 0.10366634502308`ð3400321008920044e+183 1.3941600948045599É4jð0.09108340745641981Æ€40408227AP70353kð0.083863724802237902-3bµ71655393560d5dá2.036064132067ð2.6831729961386239a -3~ð21124363175 -1.7238Ot0002817*6\â56167172230633…P00789  8622717767`@6.43{ 5853815869¿õ05147226440072213³7dñ0.336804011985188 -6.565462297164933`ð0.32962499307574578aõ2944917015999519Ä8`€23774603ìP496937ñ9246719579923204#ñ0.1444983949060338Ä@8210f…05355679Ã9c°00113882735`0549ˆ€96761968¡5985uGô014605389634999 0.9222939840709880x2Üð3.2443870105663755ñ805428755961689c 8.87028907¥õ7426 9.261074859704219]Õ  065°8857054738 ¿‘8206391195Õ-p4442684 23Aô09812954473970739ª2×ð 4.7252283918217696e-30 9.ú±15564265669î -4.5071980ƒQ44404.ô0.3002573070166171Ž2ßž0371 €67842006Ëñ2251254988753265f,0262š1673ÍË2hó201231217961 -- large real part,3Ÿº710.5 -2.39@-1.3kð70564885919e+308ƒ€24394470°!98[�-\J0.804\0283M‘601735164E¤¹£5419399767]Ì¢AdditionalÑóvalues (mpmath)�5Ü`1e-100q*1.†5002 9ºT5e-178*4.E9895!9,r6999 79 Y8ý`3.7e-0ð0«:3.7¬a8885e- :¬$01rR0.001:!16B7502X8€60.26Ð2013360025410ð9399895 0.0 sinh0056 @ 1.0ð -> 1.1752011936438014569373€-3.7e-0880a8885e-!<8<U0.001:;!16B7502[:9:ª-« "605ô1.4436354751788103{;1.9(07±"61B-C-D2D°17.32867951ˆ&63†u6777215�@2136£ý#63Bð8.714973875118524%}’67108864.FQ03621`B4B„709.78278ñ 8.9883497833190073272e+30"=5=->-? ñ -- special valuesR3100™0w !x0infã Cnan ô invalid ignore-real-signAu6!->óA9lC2.3 z5 ziZ0%0-> %naŠ>MŽ!->X„3100„!01.4ì 4infcr02.8!- "X54.2"'EA#05.6# "1•47.0"f1•!Êï •1•=6A•1•5D Þ1†Š †1†!!†!!†€S-Ê1‡f P"¶ 1¥ÃA= A÷2³ˆ´ #µÆ#Ø2—-a2‚•cG„#c"…"ch‡#/ d2§1ð §k ´2ˆ"† Ö3zcå5-> i3|H,LÐ 3šA5 Çÿ3¯à-2.3 -inf -> nqan nan ðinvalid sinh1034 Q -2.3$!->4nan"5"Ôinf -0.0 -> - %6%61.4%4inf%7%02.8%I$8$44.2$#9#05.6#‘$(40$7µ%1%‰ >  ,ô ignore-real-sig'42A5-@939OS30.0-4™•0-> gÈ Éd¸ÚA= AqÃj”8”ÁåTÀã"¿á‹5¾á$½áj5ŸÊŸ C? - ÿ -- tanh: Hyperbolic Tangent --> ?ñ Disabled test: replaced by`_math. TanhSign()7"an2/_c!"€-- zeros ¤A0000­@ÚÙÈF0001$æ% J2&O%' L3&+' \ó random inputs §47ò21.200500450664993 -1.697072948034299÷ô 1.0 1.9241352344849399e-19U5Uñ0.34158771504251928 -8.0848504951747131Mô2.123711225855613 1.2827526782026006`6` 15.4541447]@3689.ñ23619582288265617`80.9ð3283 -3.4336684248bd36e-14g7gÐ7.61031631196\2gñ780274832030700Z-fô497219438 -4.9064845343755437e-07f8fP0.153‘723579212Îà63510863273061O>~ñ2324608170356186,ö710834674339102‘9dð49101115474392465Sò972300126488630‘ð0.45844445715492133,ó77191158541805888È1ñó-0.10690612157664491 2.861612800856395“ñ11519761626257358Ûå84004883556475*1/eò1505774192066702 1.543117459772700öð1.381109893068114Ã0251;”966370935X1j5E 36 P79222ü0354û£9541246459Æð065220499046696953 0.ð 36921788332369498 tanh0013 ð$ -1.3540418621233514 0.18969415642242535 -> -0.8823ô861151387 0.043764069984411721c4cð0.94864783961003529Lð11333689578867717dÀ0.74348401860368,ö0512710425438552d5dò1.9591698133845487ò029654444904578339e‰ 2707769681ßô0.00022664240049212933Ê6fð0949715796669197�@247080853"56dð81636574501369386,ô087767436914149954c7cñ5770428.2113731047 -3.716058033983316�11.0RA8Að1.55767823213996m°1.035794378º4Uó> 1.040300238489534õ81126347894671469að 0.62378536230552961 2.347139fT56021ð5582499238960363²ó53569473646842869Â"20að17.400628602508025 9.39870595ß4197È9°845 -8.0175RÄ20530832e-17c1cð0.1502617750987ïò 0.50630349159505472É`193675Ìp1827768+ 3849847858 6ô$22að57433977530711167p0É‘454626562òð1.085784815926284€P69139Àt5587221&2¶ð0.16291181500449456Š�069728102»C7544Áñ614933590755115¶ó067910772903467817 -- large real part83›07103X€40.0"ZQ-711 Á0‰-2+¨1000 -2.31Ì/98dþI]p0001e+3FI9.66F(0y0â¢Additionalçóvalues (mpmath)Ð5òP1e-10õ0� y0^ 9 5w•8*4.–E9895!91e-1Î999 79’Â8`3.7e-0�«*3. q83559e- :¡4001« ®68!07“9v60.27°19737532022oA0114U4D4@7615h 59µQ48881R4Ü-Ý-щP0ß ê80gý­ 62ö0.5493061443340549ð5>8340ð6<-DE Ð2 tanh 17.328ù679513998633 0.0 -> 0.9`822364  tanh0063 ñ 18.71497387511852%Ch988898C4C0711401.0 d5!‘1.797e+30>(ñ --special values:B1000:ÎÒ[F1001!0infT@nan  tinvalidQ20O2.3 0}U!->\4nanQýQ!ýnF8-> B1006“!7à !7!?1.4!8!42.1!D-0.0¦9"8"1j†43.5"C1j!Èhô ignore-imag-sig"1s5"à9 |5: Ö1|€ �1|!!|!!|€T'0 \1~ fá ƒ1Œ²02šw›  2œ5-0.D#†-F#p”H2q"H"r"Hgt#0I2Œ©n�\Œ#a#°2~"~ "3pWèq r3r HÆ õ3-•0Œ`  š3ŒR"Œ-o1-|VÉŽ%< %z%> %|%@%3~$B $4€·D$·4€%!> %肎4‰47 8Ç4’e"->Þ4“`µ’: 4¡0¬dà-> -1.0 0.0 taðnh1047 tanh -inf 0.7 -> -1.0 0.0 G1048#?1.4#9#52.1#-G)50$8$1$53.5$G2#µ± üignore-imag-sign -ÿ -- cos: Cosine --$%Ðzeros cos000030-> (â 1 ¼!» 2 >0.0 3 %bŒÄrandom input”44ð2.0689194692073034 Cð016802181751734313vó-0.47777827208561469/ó4760401501695971ú5f 0.42096273S@7977,ñ823851677425802Cð2.9010402201444108*0232Ÿ 04 3617^6^A1.94­ñ 630694557 -2.975185739289121^ó-3.5465459297970985 -9.1119163586282248_7_À3.3118320290( 16ô`878713q9286142!ð1.3911528636565498 0.16878141KD91708`ð4.9540404623376872`ò579492322390268ô0.28062445586552065 0.5946786130850800À9`ð0.45374584316245026 ¨Ñ50283448373932ð1.924766557429057¾ó8300457220476110}1Õp2578172ð 76843 1.2715881615413049 1.M°16145948914^¹â‚97363332|1ð -0.13862985354300136 0.43587°q7767032€1.085988“`361912nô6215754814667227`SÒ0322=ñ 966584 9.9384082307326475e-1 ð0.99387545040722947ËP98254*`065479.Æ™à1.502763366205è@e-07Ÿá069668060249950½P00024ø`912412gó469545565660995e-09gÌñ4.972864549050305HIÀ747980886095âŽ00.2À011731975501w/Z0849HS83186fÌp7.81969*A8671 79gP234458- 0.7ð34882501585063 0.Ã313993308299 1ÌðÒ2724218807667mð746684453087182«E °01224443284R`108253¸s7437005½Ìð4.2396521985973274*€21788483#2488…ð 2.1165117057056855 -4.041649qD6414Ê1Êñ1.162220662492729),²01154611970_`0.4488E�613370379Ø 8234699150tÈ1Èa1.6287â�620884e-0B1582£�42897928‰ð1.17423199957914à 1.Tp8394819EB 2Îà2.638521260611zð 2.9886107100937296 -ñh> -8.7209475927161417 -4.7748352107199796 cos0021 cos 4.8048375263775256 0.0062248852898515658 -> 0.092318702015846243 .ó1983430422306142c2cà7.991451543385Pð 0.71659966615501436 -> -0.17375439906936566ô7721704352729458`3`ñ0.45124351152540226 1.699269399381215Áò:2.543477948972237 -1.1528193694875477 -- Additional real values (mpmath)à!50€`1e-150Ä01.0³0#f#8"%T1e-09"=0.95Vù1000‚y51550933754®70.2gø8006657784124162892h53Ó0×ø> 0.5403023058681397174262-ñ$0.7"8½ 585Š292ñ1.047197551196597ß/',899406Þ±2.57079632686B÷-0.841470984807896473576þ-DÈ6÷7.22566310325652öø58778525229247407559„,Å964594300514Æð0901699437494722255$ UspeciÖ2100-3-> š ø0infHo1nan ó invalid ignore-imag-sign9î-4-> 0Ýi:2.25ó@xg 6 .îi0-> £4100ô*.3�9(/3infO:2.7/8/-_0ü04.2¦205aûJ-5.5a61`01Î87.0!�1Î:>VÎ+Î1Î 8¨1½BMî1·-´@#naM1¸| ¸?¨žä¿˜^ F  ä1Ÿ8Ɇ Gn2¥_fRðinf -0.0 cos1021š cos 1.39r inf ->±inf cos1022/:2.7.8(1> -7030I4.2020/4/:5.5_6/^.5.87.0‚­6 4Íó nan invalid ignore-real-sign878@0.0 -!->0Himag080:2.2¶88?$na^9.–^!30n-’> 1.0 0.0�!31 ? G+ Ö ¦3»- 9 1¼jÜØO¡Äh7 /ÅÀº¦ðÅ¡/3¼¡/0¼¡(-Ò3¿£11a4Ð¥! Ð:s? Ð ¦4Ð 9Y4¿ì_J"ª—"x | 4µ:å 4̓*î”À-ð z1Á-ò 2Â-ô £5Ã-ô 0Ó-ôƒ5¼ ~ zö: -ý -- sin: Sine -- !�zeros sin€/K!->j1�Š  @2!:"B3!&" ¿Ô random input–45ð18691829163163759 -0.74388741985507034˜ð-0.2396636733773444,ó80023231101856751¸5bò45127453702459158 -461.8133992071616aó!7.9722299331077877e+199 -1.6450205811004628e+200j6jð7669228345768921 ¢â36993656498751jó3.557238022267124 -6.8308030771226615_7_ð31024285525950857™ó4869219939188296*ð70972676047175209 -1.9985029635ð0426839 sin0008 sin -4.4194573407025608 -1.405999210989288 -> 2.!ó480800802685 0.55362250792180601]9]ð1.7810832046434898e-08ð0016439555384379083d-1»561131852611²62786668375k"10kñ0.8200017874897666 0.61724876887771929eð0.874907819594886’`448352’s0987758_1_ð1.4536502806107114_ñ3998575534150415_ð1.2035709929437679 0.61121�T16370`2`@2.26G�215550605õ131727606855837¿ð77502093809190431 -b@4554ãƒ68229532Â3bò0.02613983069491858 0.1840476659777607‡,ñ580778863127943-ä50252539673564b4bð1.5743065001054617—ò531255742726420Äð1.144459633209272‚ó0019537598099352077Â5`ð7.3833101791283289e-20dð164532213242362yÐ> 7.483472067b'42/ä52755564646691J6gñ0.34763834641254038 -2.837741642108956ë‘2.9188835ÿó663 -8.0002718053250224Ä7]ð07710578518042155ð0.09005602731620³Kð0.077341973814471304ð€08990986T52458)Ôð3.90632277981423úp0.05954: 54ë 24f03.9: 90¡v56512e-/7Dƒ85983735ß1ßà0.573339179325Ðð 8 8.7785221430594696e-06gà0.542440293383ð5 7.374786912530136 622Ù‹ 48…�281651316P�330446207+"85{,P62288Kó9651 0.336388967157068þ2×@1.43š 7302672ð81361889790284347¾ñ1.337096006094792ó2336137961387163ºÔ01.1å€87354403åñ4.859723596615055Zð 58.919141989603041 26.2370039C5885k2Í0fÔð3078406649192 34.š�a131209¦ò:565548145569.38245 644329685822700.62 -- Additional real values (mpmath)Þ5˜`1e-100Ú0E 7r`3.7e-0z08I3.69a2001e- 8Mò�6 07!830416[�7)2kð0.1986693307950612263Æ02ÆÕñ0.841470984807896506,2˜-Ô-Õk¶0Ö× G5-1.¦-§ À0058 sin 0.5ú 235987755982989 0.0 -> 0.50@4642ÿ sin0059 sin -0.5B B0C!60Cð2.6179938779914944f„*49@6018t0…!61B-C?-0.D 2Dö7.225663103256523…ð80901699437494673648„3@ò-8.796459430051+Åó877852522924734065Æð -- special valuesU2100-�!->öv3100ú0infi1nan ó invalid ignore-imag-signZï-4-> 0ßi:2.2�8xDxg46 .5.ïiï3inf!6!:1.3‚$9 0070:2.7080-181:4.2´21`0ÿ:5.5a60_1Ð47.0 L á1Ðj˜ XÐ1Ð-Ð Ð1ÐVžk#na!1º-·0/»r� º ©Žy0Ç—]E  Ÿ8È… Gn2¦_fÜ ¤„oó2™‚.]˜€+ 0§€+`2§€­¦úhN 2¿1¿ý2¿ƒ..µ¦ò3ž)m ! ¶ÆÄÆ 3«u.z E3­jÝ@P `3´_7д‡Íñ¶3¶‘0¢0®à2.799999999999Ð9998 -inf -> ùinf sin1038 sin 4.202/7090I5.59605a!40157.0"�!1!¢3nan¦óvalid ignore-imag-signZ29-N 9131 -0Œ%> T4#Ž#a /inŽ 5:92.2~ > IIr68bÇ•t"47#:1.3V9S:2ÖJ-2.7221×-05Ö-0eç5æ-Â#Ð Ñ|= -ÿ -- tan: Tangent --&'�zeros taný5 ˆ$-> 1Ÿ !2!:-]30.0!3!&" ÈÔ random input–45ð56378561833861074 -1.7110276237187664e+738S {5Fñ3.5451633993471915e-12 -2.855471863564059Dð4.662244130488957.43?Ó0273843093951â6gð2.5024427196386964ð26742234390504221dð0.66735215252994995,ó39078997935420956`7`ð0.87639597720371365 -55.586225523280206aø-1.0285264565948176e-488UP01578°ñ596427243 -520.05944436039272V"1Ú9Cñ 84643549990725164 2.07490Ì@3963Uò31412661676959573 1.0033548479526764ø$10`À436137922485¦ô6 8.1082741629458¼ò 1.3879848444644593e-07 0.£8834422401»1ß/ð820906367833114 0.285€89924802?>B3±85737936536_ó089269377971245Âñ1.1477859580220084 1.902163700270804Áð34348450042071196!2p4PS01687_[�124655431Uð3409 3.06068510163448ô#05Æà12530514290387�3P7r´69945479e-0Æ�ð3.75828487175256ñ-692787020.4403893C '1†°2.232196765z’­ñ10.09006942300816Có1.5369846120622643e-1…Ì“655723759 …Ð0.88371172390ð"245012 -1.1635053630132823 -> 0.19705017118625889+ð 0196452280843129 tan0017 tan 2.13474142318492673ð9311339960416831^ð-0.038663576915982524-ó0174399993980778`8`ñ5.9027945255899974 -2.1574195684607135e-18Ãð-0.399865915392814961±50237531679~1i9ià0.448114894908ð2 683216075670.07556Ér0.0 1.0>!20>Ð4.145976639607ò5 12.5230172056057=ð2.4022514758988068e-11P0S11249f!21_ð1.7809617968443272 1.5052381702853379œeð44066222118946903^Å932684517702d#22^ð1615313900880577 1.7956298728647107^ð0.04179318682639036‰0[³395460347923]°0.067014779ñ08945 5.851736157745709_ð 2.2088639754800034e-06 0.ò!836182420061 -- Additional real values (mpmath)…5Ÿp1e-100 º ->l2 7wt3.7e-08833.70q17328e- 8QT0.0016 13p4666875 6*2iø2027100355086724948h4\'1.Ôø557407724654902230c51-Ò›Ó6:Ç g"014Ô3Õ -¤?-1.¥ ó÷0.463647609000806K4 @7163•IË-B? C61�.10714871¸@0904f›1Ž97529š6:bA-B D!1.¿sÀ4.1014199471(93 6?E1.57¥p255.765x0078964q6?æ57079632679489iø1978937966095219.053åNñ7.22566310325652бñ.376381920471170152ܧ6S08.7Z�94300514"?À0.7265425280‰3140cøUspeciðR‰¥£ !—0inff@nan sinvalid(}-(32.2ã87ƒOd 3nanVpU .^Áˆ1-> t3100@30.6š.6 1Àn1007 tan -1:.39ù inf -> -0.0 1.0 tan1008 tan -2.1010 /9/7^8/"10/43.5 "11!œ ò ignore-real-sign±!122  6 r À7V0-> 0�1�]]ƒ invalidFˆ'·62�Y:| 2�:0.6$96k:/Š1j .‡h¡]•/2.h /•h }”õ?1.052¦¾*ä2¦{..­žÌ3–Õm !˜º×A 3‘(›7š› _‹ W /‹J‹â-Û3�g-1�i0ž Ó0\ ’¡m14³o"ðä4³Ôts4¾g3ºZ�ߎ4½¦#c R4·)ç u4Îr =„ À-ò @3Ã-ô 2ÄÉ—ÿc5Ä-ö 1Ô-ö …5ÄqÅ? -4ð -- rect: Conversiüon from polar coordinates to rectanguO-- -4 L° For cmath.tð, we can use the same testcase syntax as for å -- complex -> ò functions above, but herTðinput argumentsDðshould be interpretedhða pair of floating-point numbers ratherD@than”ð real and imaginary partsFa¤A.H�a¡p'spirit0’C99' ruleó$‘. First,mPshortƒversion:Q! Åñ(x, t) = exp(log(x)+it)@ðpositive-signed xG 8-9-:Onega:7nantò nan + it), except that inŸ-@+-0)Í€ ‘þ Eô is unspecified?n0nowEm long : -Tconj("t)Qall x¹QA-B-0?/ð+0, +0) returns +0ÿ0ÛB"7inf#Å- 0 +- i0, w¦3SG Z: É n0NaN’ 7@raisõÄhe "invalid"g ôÁAion,ðfinite nonzero x�vYinf, x_+-infz.* ("&!fÂkresult6)ª²Xinf+i±Ìx°¯inf*cis(x)|ì;6NaN= +i î»@ÌI ÌËWNaN, ©ã!+ l±²®Äs (includingn!inÙDies)Ì^Ú^¶°ºZÔ ‹` ,bÀ( x,=R&æ¾—;{b? +-y>nŸ al values ÞA1000òA 0.0!->40.0!1!+! pignore-ì´ iJ2J02.3„‡ànan invàalid rect1003 A inf!->Cnan 0inv0ô ignore-real-signA4AC0.0 A40.0!5!41.4!4inf!6!02.8!-�"7"54.2"'#8#05.6#D"9"7©ˆ"10!üÊ  Himag&11902.3|9$na$&12!–+> !†Bf%f œ Ÿ1~˜.-{~ò! Z  ¦;-!>  1¦  n fmÎØå3I ¸ 2Ýu é0q I2å<°ƒêdç#ë #é#í$ì-ï«2ÖGï"×"ïh°öÒ D� é2Æ--� U2ž"ƒ "3�?&!> -3s–-Q ¡¬½ ²3š® �ê .3§.z Ñ2. 3Ä5°1-> ÌßÅ/ $Ç 0Àê3Ç#/#"°". #±/ Œ4³^  ~�9È,. …4 +" [l ê4º;m†4�$Î YùÉnÃÚ+nÀ¹( Ï010q‚Aí×Yßï-YÀinf inf rectð1049 rect -inf -2.8 -> @inf H1050#44.2#4$1$05.6$ Y%2%57.0%m/ -5ñ -- polar: Conversion from€òangular coordinates to2 /--”:—¡For cmath.¡ð, we can use the same testcase syntax as for Cpcomplex< ò functions above, but herTðoutput argumentsEðshould be interpretediða pair of floating-point numbers ratherD@than•ð real and imaginary partsF$a ¥A!. V€ Annex G#øùC99 standard describes fully bothi~lS‘ (as cabs’ðcarg, respectively, which in turnK±are defined1erm¼™[QhypotU€atan2). <‘overflow }C0100I„1.4e308 Wñ0.78539816339744828 IV¯¢ial values\%10\@0.0 !->50.0#1$-%2%BIõ3.1415926535897931X3384-545PŒ X5#02.3Ö #6#JV73R3õ1.5707963267948966282§292 31-˜1ÐLfô2.3561944901923448Ë1Þ/j1©1Þ33Ü™41î5œ5 5¢jk:Ø-1Ïj5742 4 /ÑS 2 0nÐ> inf -0.0 poõ lar1023 polar inf -0.0 ->  C1024%Qnan -*%5nan$5$02.3I0$6$m $7$#8#j9#±'30#…0-> °#31#B#2#ˆ##cÎia‚$a-ka¥H½ô import unittestàtextwrap from  *0sup2Å, mock_socke6 $ioNTsmtpd ñasyncore class DummyServer(*R.SMTPð): def __init__(self, *args, **kw )- D.: b9õelf.messages = []0if wÒ._decode_data›9Àreturn_statuB' 'OOelse?b@A ƒprocess_® peer, mail·°, rcpttos, ¯,(ïŸ.append((D !))‚ð!ifV2 ==êû ܶ '250 Okish @if '°ð_options' in kw and 'CUTF8[*]e9 " ov rñDispatcherBroken(Exce†$Epass¥$« 1™clisten�3num2Rraiseî |)i¼DýTTest(š.CCaseRmQsetUplgÿ‹4 = o.¹ÏKã_Ví_unimplementedh²2 = q¸·#(($ñ.HOST, 0), ('b' q§cV=Truet conn, addrw€0.ac¶(%`hannel"wMC!(s4&, I., o¤°write_line(iÂcY]².queue_recv-J,Phandl&Uad() #wi b'HELO exa'Ü $ÿMAIL From:eggs@. ËRCPT To:spam,À write_liÓne(b'DATA') ñ6self.assertRaises(NotImplementedError, write_line, b'spam\r\n.\r\n') Nòdef test_decode_data_and_enable_SMTPUTF8_rhz!):;Œ ‰RValue� `smtpd.\yServer,û(support.HOST, 0)>'b' °Z=True8â parDown(Ðßöasyncore.close_all(…’socket = ×ò class Debuggingô�Test(unit.qCase): ˜\setUp“ d…Rmock_„K!ndÜO°, channel, ð,, =1Fal‹ÄŽM(R&"Q.y².queue_recv-Ô(,Phandl&'adWwµ°(b'EHLO exaÛ,if³“b DóMAIL From:eggs@Nð BODY=8BITMIME ŒèeOelseW@ …€RCPT To:…ƒ, íH®�Ib'.'Ðùst_process_message_withçAtrueÌs�Ì ´(›/ (�†ˆ) conn, addr�Šw.accept >"FCÏ(¾&, I/, o lúcaptured_stdout() as s4.seKŠ\_I \n\nhello\dÚU´P.getvÓXÏbEqual(/ù, textwrap.dedent("""\K% -÷ MESSAGE FOLLOWS 3¬ ÐX-Peer: peer-…2essBÆ Ù 6€u--- END‡ 3O""")­f“®7F,Ÿu2]c$Àend_data(chaónnel, b'From: test\n\nh\xc3\xa9llo\xff\n') ÷stdout = s.getvalue(òelf.assertEqual(/õ, textwrap.dedent("""\T[-õ MESSAGE FOLLOWS -3¹'ýX-Peer: peer-address% !h\ýþÿ $�e-- END® �a""")) 1defhñ"_process_message_with_enable_SMTPUTF8_true(self):>)`server�ñmtpd.DebuggingSñ ((support.HOST, 0), ('b' DH ‡V=Trueä`conn, R…vw.accept 0cha]"§ÓC(Â&, I/, s  Ù’captured_\v() as s!Ù4³.send_data(Žëÿm×ôÿ, › …èoômail options: ['BODY=8BITMIME', '‚*']ñI¦larDown#÷asyncore.close_allšÀasyncore.socóket = smtpd.soc ð class TestFamilyDetection(unittest.ó Case): def setUp(self c†asyncoreuRmock_ƒ KŒtearDownN?±close_all()5kNà-@Êò$skipUnless(support.IPV6_ENABLED, "IPv6 not enabled"tô ¾`_uses_, ¶eserver�QSMTPS(rÊHOSTv6, 0), 4q¸_Ò.assertEqual(]P!.f°", ¨.AF_INET6)[,st²4²%� ²Ç²,)†`RcptOp�Parsingˆñerror_response = (b'555 RCPT TO parametersÑÑrecognized or'On÷b'implemented\r\n'Tú/ißõold_debugstream9µDEBUGSTREAM¦1-'÷ = io.StringIO(³bJÎ`·¤Kelf.âž¡write_line“°, channel, Xø±queue_recv() (Phandl"*ad1st_¡s_rejectedzkb� = Dummyº£`, ('b' û‘conn, addýów.accept·¢/CöÝ&, I]ú0HÀ, b'EHLO exa²'2óMAIL from: size=20Jj/toH|foo=barHÎÅ×alast, ê Ú Ê²st_nothing_^ÄÿÀe=20') ó- self.write_line(channel, b'RCPT to: ') @´assertEqualAÀ.socket.lastMð%250 OK\r\n') class TestMailOptionParsing(unittest.aCase):oð0error_response = (b'555 MAIL FROM parameters not recognized or 'I»0b'iÝdmented¥  def setUp(é‰Ssmtpdå¶ = asyncoreRmock_uDò.old_debugstream = LºDEBUGSTREAM1-'ñ = io.StringIO() 8³ŒtearDown¶§¦close_all(˶rÓe·2O â—h %, n|^NÁ.queue_recv()ƒ(Phandl"*adü st_with_decode_data_trueñserver = DummySò ((support.HOST, 0), ('b' RV=TrueH�conn, addPYw.acceptmº3JRSMTPC|(4&, I/, oJÂSEHLO ¹´@for HU in [LÓ!b'MOfrom÷� size=20 ­oUTF8',>)ï BODY=8BITMIMEL#CUNKNOWNB#×body=8bitmimeC]ufIü+Q ÓGw–¡ìJ�*b' ÇHAOfalsB.íç{0-]J¤™,ÀassertEqual(óchannel.socket.last, self.error_response) µwrite_line( O,û.b'MAIL from: size=20 SMTPUTF8 BODY=UNKNOWN'y¿assertEqualz É †P501 EÖ:cü can only be one of 7BIT, 8BITMIME\r\n�ú  îÜbody=8bitmimeeæS Ù“ b'250 OK¢éðdef test_with_enable_smtputf8_true(¼!):.®ñserver = DummySò ((support.HOST, 0), ('b' V«G=Tru�conn, addT]†.accept(ÇÐ0 = œ d.LC†(4&, I/, s Ò.”^“, b'EHLO j a2? Ò!Ýy zÛa classD(�Test(unitï.CCaseÙ]setUpîCmtpdG¶ = asyncoreRmock_ `õold_debugstream»ºDEBUGSTREAM1-'ç = io.StringIOhÿ�v¼¿decode_data® 2lf.€³�Ö ¸> ½ ¶§<ÍŒtearDownÐÁ—close_allPжñeƒŒÑ2 ü 2—C  , „R>5dÁ.queue_recv(.M -Phandl'Fad()qí€_broken_!ÜóSupported commandsEJÿMAIL RCPT ' + \¢ ñ DATA RSET NOOP QUIT VRFYùÜ#P_qý ‹C;a€ FROM: <˜Oess>½�_unknownÅ Àe(b'HELP SPASM') ñself.assertEqual(õchannel.socket.last,3:ÿ$b'501 Supported commands: EHLO HELO MAIL RCPT ' + \M ñDATA RSET NOOP QUIT VRFY\r\n') ;�def test_]±_bad_syntax¿!):$¡ÎÐwrite_line(b'1C�:ï�hostname´Ÿduplicate³Œ example» Ü)ä043 Dµæ/ßâÿparameter_rejected_when_extensions_not_enabled+ÿded_smtp = FalseÝ  *�£from: SIZE=1234lC031 S'‚ÿFROM:
L)ð_allows_space_afU_colon6 êð=  >o250 OKòöû,Ÿû0� size=20YúÜ&–"? b'€3_\‚+cO«@Wÿ1? hi‹"yZ ÛdÙËT& "Ö_21 BywÀst_HELO_QUIT“(self): ÿ .write_line(b'HELO example'))LQUIT!±assertEqualjñ.channel.socket.last, b'221 Bye\r\n') e�def test_XÁ_arg_ignoredI³ 2@ bye’AŸbad_state‹ã2mtp'á = 'BAD STATE'ÞolK\` ÿ b'451 Internal confusionsÿcommand_too_longè&#ïMAIL from: ' +°qb'a' * #Q–0sizž?mitA @µI.°500 Error: $P too &Kð_ºÿ limit_extended_with_SIZE`/EH†¯fill_len =+p- len('�€$ Ú1±‘Û y ý\=1234ƒ¥9X50 OKzö7Æ((ÇO 26)g>Í, ? b'r'ÿ rejects_SMTPUTF8_by_defaultu& ^ ºbbt BODY=8BITMIME ˜!P[0:1]>54Adataºter_thanô_A ³# Hack the &ð so we don't have to generatePmuch W.!¶_rz = 1048, «qšFKDeggsf J \ðRCPT To:spam@examsple') ÿself.write_line(b'DATA! QA' * 8ðchannel.data_sizDUmit +_fŒb'A\r\n.aÉassertEqual([Ïsocket.last,Vð b'552 Error: Too much mail œs1') @Òdef test_MAILµ‘parameter{!):(³Š ŸEHLO examF ^à FROM: SIZE=512>o250 OKëinvalidóe÷/æb'501 Syntax: hð
[SP <þ-Û?s>]ÖRCPT_unknown_3QŸham=green2&55 Éñ not recognized oriÆhmentedúi Ñ ¸ /Y< TOõ>hó& ð_larger_than_default_VJ_limit*o= 1048eOL2096žh [€message ìø exceeds fixed maximum #VcAneed}5 ?/HEntto:spamkû2$03V·]icomman3Ý&!_sœ_¾ä8[h from QæÀel.socket.laWst, ñb'501 Syntax: MAIL FROM:
\r\n') 6�def test_)!_s6Á_EHLO(self):%^à.write_line(b'&¯ example'))[¿ from eggs@3±assertEqual|ÿ.channel.socket.laêÿ [SP ]ƒmissing_+‰ OHELO:,ùAâ�chevronsÛB<á>é"Ÿ b'250 OKÃoempty_É©/:<½Fÿquoted_localpartˆ¿ ä <"Fred Blogs"rO.comØ3Àx÷?, '�‡ $Ÿ_no_angle¶.!žæê £ Á>B ,7Ÿwith_sizeZ]¯ SIZE=1000ù248^ne@Àchannel.sockó et.last, b'250 OK\r\n') ñself.assertEqual(ñchannel.mailfrom, '"Fred Blogs"@example.com') Mñdef test_nested_MAILM!): p\ówrite_line(b'HELO N – )O ‹T:eggs�3Ospam3üDsock>ÂÆÒb'503 Error: î Ÿscommandb4OVRFY& á ®!±252 Cannot `ñ user, but will accept message and attempt ' + \Èø¯b'deliveryæ_syntaxí Áà!Q501 St:áŸ
¤ EXPN_not_iÃomented­6­3 2 L �‚«0no_!L„#Dº/ý Psend §o firstÉ�eed_RCPTiJOFromODATA / þPneed Ú þ !ÒB9 M�? to1 Š-dOTO: Ž 'OEHLO&3!é p` [SP ]K1ûlowercase_to_OK5À self.write_óline(b'HELO example') ³self.write_)ÿMAIL From: eggs@4¨RCPT to: <3>hÁassertEqual(yñchannel.socket.last, b'250 OK\r\n') «Àdef test_no_Ê_rD!):!ÏS Ì&? toÉ •dh ðb'503 Error: send  o first¿data_dialogÁL‚¶‚�2ï_To:spam(_ôxtODATA×" àb'354 End �ô with . ¿ˆŒ<%@more.™" ýlp ?ùserver.messages,×ò[(('peer-address', jport')-9 ', )['Ø] 'ÿný<')]©¨_syntaxç^¥ 1º ûÎ%Q501 Sú : MÉ!!&”' $[¾#ÿ transparency_section_4_5_2ÊÒ< ºïë æ R ..½ ( šÍ�received_ 0, '‚Å�multipleÆ3À:eggs@examplSe') ÿself.write_line(b'RCPT To:spam@exampl1h0ODATA‚ œdata\r\n.&ÁassertEqual(¹õserver.messages,×Þò[(('peer-address', jport')-u 'eggsñ )['(,'î].'ÃQ')]) ’ñdef test_manual_statusÃ!):"°ò&# checks that the Channel is able to return a custom K L ×_HELO Ï©MAIL From:3:çÞ c-ð .socket.last, b'250 OkishF'‘LRSETˆ<Œ³  K tð5foo3B©[( 'ò ×* [% ø ù~_ºm8O 26¤W_syntax­-? hi‡%Q501 Sk : Kñ ¤ÿunknown_command•¿UNKNOWN_CMD™" Ób'500 Error: �' "p¿" not ' + \F ¯recognizedòýattribute_deprecation0€with supÏ.;ö_warnings(('', D=ÐWarning)):  ò spam = self.channel._SMTPC ”__server 2òwith support.check_warnings(('', DeprecationW5)):?Gm@ = '™'7v1êOliner:UkædOstatçUlèd�greetingÒToîd�mailfromîToîdrcpttosíTnìdOdataéTkædOfqdnæTkæd/peJVk æÀ with suòpport.check_warnings(('', DeprecationWW)): ò spam = self.channel._SMTPC e__conn3with sur*k @ = '•'t:æOaddrr:ækæô @unittest.skipUnless(cðIPV6_ENABLED, "IPv6 not enabled") class ²D³%XTest(û def setUp(öösmtpd.socket = asyncoreRmock_ ,Dâ.old_debugstreQLºDEBUGSTREAM1-x 'ú = io.StringIO()7ñserver = DummyS(-ñHOSTv6, 0), ('b' Aâödecode_data=Trueuü#, ±ê‚|.acceptŸAØ�•l.>&, X, ¶§ýðWithDataSizeLimitù(cqCase): y Ê ^ð# Set DATA size l†ð to 32 bytes for easy ö1ingŠåbE!? 32I+~ �tearDown¯ —close_allüÿSçõû G£¡write_line™ , Ÿ>9¯Á.queue_recv(.›Phandl'Fad()qš_¿q_dialog} wwœöb'HELO example'H  )ÿMAIL From:eggs@3±assertEqual|£Ðsocket.last, ób'250 OK\r\n') üself.write_line(b'RCPT To:spam@example1ÁassertEqual(Bûchannel.socket.last, stODATAd"TÏôb'354 End data with . <%@more.™" ý . ?ùserver.messages,×ò[(('peer-address', jport')-u 'eggs¹ )['Ø] 'ÿnýQ')]) Š�def test_ñ_limit_dialog_too_much !):4í ]_HELO U )©MAIL From:Ï ¹ Iˆš‹ uûíSThis …ÿ is longer than 32 bytes'} ðb'552 Error: Too RQ mailÊsò') class SMTPDCqð WithDecodeDataFalse(unit®¶.TestCase):Ç]setUp¨Cmtpd¼¶ = asyncoreRmock_ÜÆ?ñold_debugstream = sLºDEBUGSTREAM1-'û = io.StringIO(é!‘ = DummyS/P((supð.HOST, 0), ('b' ?`conn, ;vîL|.acceptiA,Éml6.>&, X %aarDown+ R—close_allxa{UH™b2Ù �õå¶ , ëŸ.úõÁ.queue_recv(.k-Phandl'9ad(�st_asciicwÑÀine(b'RCPT Tóo:spam@example') ÿself.write_line(b'DATA! ÿplain ascii text- .ÁassertEqual(}ÿ channel.received_data, b'h·Ñdef test_utf8.I!):ØX Õ_HELO þïMAIL From:eggs1oRCPT Tb9Ù‘ enrichedd£: \xc5\xbcœa\xc4\x87` ÷—and some L1 ¯ `d¼ (/b'Î9\n'>j/b'Çâ class SMTPDCGðWithDecodeDataTrue(unit0Á.TestCase): eI]setUp@ömtpd.socket = asyncoreRmock_ J§uñold_debugstream = sLºDEBUGSTREAM1-'û = io.StringIO(²ñserver = DummySñ ((support.HOST, 0), ('b' v«d7Q=9s�conn, addrè€w.accept�g# Set J@ to M€?8øÂÁŒ.`&, z,B¾f°#Ö�tearDownMÊ—close_all¼Ù�e„ Ú2O mœ , sŸ.mÁ.queue_recv(.k-Phandl'Fad()q÷_ª× pwý(›Ö&Û' M Љ¥Àample') ð self.write_line(b'DATA') !ó utf8 enriched text: \xc5\xbcŸa\xc4\x87I ÿand some plain ascii1 .ÅassertEqual(²¶ùchannel.received_data,('Í�żźć\n â class SMTPDCdàTestWithEnableðUTF8True(unittest.$aCase):ƒ def setUp(c¼ömtpd.socket = asyncoreRmock_ J5Èñold_debugstream = sLºDEBUGSTREAM1-'û = io.StringIO(ñserver = DummySñ ((support.HOST, 0), ('b' v«e:_;=<w�conn, addv0.„|.accept¡úÚVªn>&, X ¤«äÕ�tearDownjØÉ—close_all·Øºe‡ Ù2 2—åA , ðŸ.9lÁ.queue_recv(.Mk-Phandl'Fad()qõâ_MAIL_command_­såü_when_announced1’wœÌEHLO example )§«'ƒó from: BODY=8BITMIME×½Š'.encodeYRWutf-8€¨³–)Íü.last, b'250 OK\r\n'7€process_ç£�_message#&ð for mail_parameters in [b''‹]«õÍhb\aV\> ' +n$J(P[0:3]¢7250rD ޤrcpt to:\i.?354D åc1  ,ifpz == b''Áà self.asser÷"tEqual(self.channel.socket.last, b'250 OK\r\n') Yelse:K_asser\ ;? }óSMTPUTF8 message okish‘Eñdef test_utf8_dataÒ)ž–÷ write_line(b'EHLO exampleÙ )`•ò'MAIL From: naïve@Côé BODY=8BITMIME µö'.encode('utf-8')Dk*S[0:3]‹«å'RCPT To:späm™‚Xlb'DATA£ã<354@ ·âó enriched text: \xc5\xbcŸa\xc4\x87I .§ ö¨�receivedf,(bã8�>¼\ð_command_limit_extended_with_SIZE_\åOehloåðfill_len = (512 + 26 + 10) - len('mail fé1 ˜¾11' +Ú6…b'a' * (‚O+ 1)0 ° £À‰à b'500 Error: “ too longZ·\ì(ë�/b'æ+ ¦iY multiple_eÖsM[r_engthSgÐfor char in ['ñ b'6c']Ê—“ I&* {O b'adNNˆ7500 D%’‘7/25‘ðrcpt to:') ñself.assertEqual(ÿchannel.socket.last[0:3], b'250Dÿwrite_line(b'data%i?354D iŸtest\r\n.*n×ð class MiscTestCase(uniti.!):D@def q__all__;bÑblacklist = {1ñ"program", "Devnull  EBUGSTREAMpNEWLINE ÊCOMMASPACE",JðDATA_SIZE_DEFAULT/Pusage pOptions Åparseargs", C} Øsupport.checkÑ•, smtpd, Ï= ò) if __name__ == "__main__"$<P() imgt codecsÅhtml.entitie%sy e.¢40uniEj¨Å’PosReturn‹ò# this can be used for configurable callbacks$ân__initß)vpos = 0.ahandle W, exc2old/:}Breal$3if "<0Å?ô = len(exc.object) +3Fò# if we don't advance ñ time, terminate on the next Dðotherwise we'd get an eïuss loop-·0 <=j.startÂÃHr¾’ ("", ‚) # A U EnbError Á with a bad w£ attributeÝ@BadS�C(Á  5.5€, "ascii‡æ", 0, 1, "bad"Œ¯O= []äöåOžæl± ç/DeË$oui ÉSNoEndà>àÆ5Æïbytearray(b"")ÒAdel Ö9endÏb³Ï Eï À __init__(seclf): �UnicodeDeõ+Error.__init__(self, "ascii", bytearray(b""), 0, 1, "bad")P4ó.object = [] # A f‘Translatei 'ðwithout a start attribute class NoSD(àIdef Íû8 û"æAdel ê²ä_n endã?End“áK/ "â?endàÖÆOæ`å´ qð CodecCallbackTest(unittest.qCase): ócñ_xmlcharrefreplace>q## Ð unencodable 4öacters which numeric¡ entities.q¼a# For —Ñ, latin-1 and5ð maps this is completely i gmentedIAin C;ö should be reasonably fastw°s = "\u30b9 d1õe2 \xe4nd eggs"[ÅassertEqual(Â!s.%e(]"A9"),4¡b"ス!97½514; ä„ –ŽM?", �*)2Cname3TȰtime use a -ç5Xy forV7#+�s, if onePavail€.”“Ê„f“7excÅ)ôif not isinstance(exc,ãEÛà 8<’raise Typ"ð("don't know how to handle %r" % ~ÎAlU ý@c in-zQ[exc.›: Fend]ò8>tryàl.append("&%s;‡Uhtml.ˆ*`point2)†[ord(c)]mD¡except Keyïm1#%dnQ Pñreturn ("".join(l),ð3endXršÐcs.register_eÐzÀ "teþ st.xmlcharnamereplace", C) ñsin = "\xab\u211c\xbb = \u2329\u1234\u20ac&a":ñout = b"«ℜ&r ð = ⟨ሴ&eur#Cÿelf.assertEqual(sin.encode("ascii", "teÚŽ), sout)’Î�ÎŒ-latin-1ŽAo\xa4&r¿iso-8859-15�@def HG_uniq(self):#ð# We're using the -as from0uniž÷ database this time,EQand wI doI÷"syntax highlighting" here, i.e. we includeFÆòd text in ANSI escape sequences. For‹Wit isE±useful thatÁðerror handler is not called for every ÿlŒ!un—Pable b¡acter, but6–a complet•8 of‡@Às, otherwiseùwould output manyAžnecessaryÿÏè ã7excâæ!iföòisinstance(exc, UÜE€E( 8< ra­AType"ó("don't know how to]p %r" % ~ÇAil = []xcݰexc.object[ `start: Fend]¦G“l.append(–•.±�(c, "0x%x‚vord(c))';ñreturn ("\033[1m%s 0m2W�.join(l),ÂG.end4Ács.register_T(Óµ Š:", S‡ctG80001t®ó1mNOT SIGN, ETHIOPIC SYLLABLE SEE, EURO"ðCJK UNIFIED IDEOGRAPH-`M'0mg˜ Ò"”£'A\xacj/1m­W ¹¯7Ë 0m¿ /1ma5á¸À def tesó t_backslashescape(self): ò# Does the same a ’"unicode-6÷" encoding, but with differentMEbase,%s.ðsin = "a\xac\u1234\u20 ö8000\U0010ffff"2¡out = b"a\567!\u89ñelf.assertEqual(sin.¿Åe("ascii", "ÿreplace"), sout) ‚¶�3latin-1ƒ*Oxa4\%¿iso-8859-15„Òdef test_name A\23òprefers ``\N{...}`` q¯# sequence:1ð(b'a\\N{NOT SIGN} òETHIOPIC SYLLABLE SEE2URO('‘$0 b'<ðCJK UNIFIED IDEOGRAPH-ˆ&}\‰%')?kŠ[…͆/N{ÄwÍÆ5?xa4€S À"deQ_callä ‘This is a7t for a 9 9… handler*Â# that allow�4!of�uinvalid";ö*"\xc0\x80" and returns "\x00" instead of raising an errorŸõ# All other illegalj“s will be¶¦d strictly@$÷relaxedutf8(excdGpif not �`stance$2, UgD[ eE• 8<¸Re Typ"ó("don't know how to›p %r" % ~ A ifõ.object[exc.start: P+2] =mK"AX" (X,RGP+2) #wùry after two bytes†OelseW ai3&xcyyÁcs.register_­ ("‰.f7", ¹À # all the "ó\xc0\x80" will be decoded to "\x00" �sin = b"ab:€c\xc3\xbK9eout = 9p00c\xfcG)òelf.assertEqual(sin.‘õ("utf-8", "test.relaxedutf8"), sout) «#¼Úð 1" is not valid and a UniæDìUErroreraisedJõÖ1µR<.s(^&, Ê,\Xå Þ@def  _charmapenÉu(self):Zc# For # $ô ings the replacement stringü?@mappahrough8F÷ again. This means, that> toJ@ableG�use e.g.F"�" handler=e<µ0has=phave a �ª…for "?".1/ð= dict((ord(c), bytes(2*c.upper(), 'ascii')) Fõc in "abcdefgh")Ròä‡b"AABBCC ²Ž3cs.—_5eÈ0, "nDct",™M)[0]»Ag d¼/, vuwJw§[6Q"?")]á7XYZ{ö7DEF 2XYZ" ¯"®Ð # wrong typeÙ0Õ�AOType>š?‰ uR`internº ‘Awith¸ð.support.check_warnš3(('B_CÕ ebeen 'ͺ ó'deprecated', D BionWp),J?y mÕ $b2Ô"Ãù"ô-ô"$•¥Ãif len('\0'.X5AÞF== 4 :°s_wvK(exc2!if< isinstance,,@@DR pò("don't know howæ p %r" % Ž [Ipeturn (fW1", 1ò ÊCJÀ b"\x00\x0E0\x0Ð".decode("uni ÿ -internal", "ignore"), �"\u0000"-) ýself.assertEqual("a(b"œ ¤ oreplac¥ o\ufffd«lŸbackslash´³¹ócs.register_error("test.hui", handler_æåªZ�P V1\@def PQ_callX(c%):X"öW1(exck�r = rangeõ.start, exc.end)E*Áif isinstanc.2, U, EnyEm ^8ñl = ["<%d>" % ordjù object[pos]) for pos in r]u/elwD²wÒsr &se>Á¡raise Typepó("don't know how to[0 %rçi ÉÐreturn ("[%s]"§"".join(l)p3QÊÄ1Ï1Àð2j ’oif notÊS . ” ’ Uö +1) # skip one characterœl2l2lDs = ¬ö81\x7f\x80\xff"_�ósy@asci£¯å %p[<129>]q ¦8>][<255>]&¼€*2õ€|uÁv �b"\\u3042>xxxÛ`escape}ß.Â�Gð[<92><117><51>]RаÀelf.assertEqgual( �b"\\u3042ðxx".decode("uni ù -escape", "test.handler1"),H"Fõ[<92><117><51>]xx"&%) Ýself.assertEq“w³cs.charmap_‘^b"abc‡û, {ord("a"): "z"})[0]›ßz[<98>][<99>]‘ ð"g\xfc\xdfrk".en¡~("ascii‘ ÿb"g[<252><223>]rk€*~, |@def ×Ð_longstrings(ž%):­#" " #õ to check for memory overflow problemsBÀerrors = [ "B ct7QignorYareplac 0xmlø5refG¶¥"backslash'd "name]6ó# register the Àðs under different >s9#ä@prev9õñc from recognizingT;prerr in øJÁG$s.”_$(\0" +4#, %clookup#Uerr))f…l = 1000H1s +eÓ.N£ ‘ ­0uni­Q[ s*l-s0("x¥Ö ša\xe4") ]ÐB2enc3platin-18Œiso-8859&5"m`"utf-8> 7 $16 732"¢;Œ{':tryÄ4uniâ@enc,�v!‚except U'EãVBpassÿr;_A³ionobjectar{°, exctype, W, msgíZ# Tesx` subclPðs: construction, attribute assignmϰand __str__/uversionK#ÜÐwith one missì@arguA**ȱRaises(Type Æ*ÇV[:-1]J d\Ÿ too muche(fT + ["B'"]1q!ofÅ0wroÏ5ypezWVÑspam", b"eggs  42, 1.0, N. ^\‘range(len¥)ÎN·kH sP0if (#B) is§;[i][_Ð continue  û# build argument array &í callargs = []ðfor j in range(len(-=)):+Yif i==j!nÿ.append(wrongarg)OOelseL™>[i]Kôself.assertRaises(TypeError, exctype, *œ%) �ð# check with the correct number and >5 ofhs>Texc =a (* �•óEqual(str(exc), msg„ñdef test_unicodeenº(A‡.®ð_exceptionobjectx(•†UNEN ù["ascii", "g\xfcrk", 1, 2, "ouch"],0!"'0 ' ž‚c can't ¬Ð character '\L'N@posi¡A 1: QO !ÑL4Ñ)sÊ/-3Ì^PQx", 0ž›<0Ï__u0100Ñ5M nÓaOffffÓ6MÓn0U00¨ª7QÛ'  dewe4DN AbyteM%(b )ƒ!¸ NZ 0xfcO~Àexceptionobj§ectargs( �UnicodeDeiError, ú["ascii", bytearray(b"g\xfcrk"), 1, 3, "ouch"]<!"'< ' \‘c can't djNñs in position 1-2: G�!) ¢def test_u­ translatee°q(self):*ÙÀ.check_excep]?objþ TQíì2ìޛРcharacter '\.'íë¼À@�u0100rk"Â(CÄjOffffÄ,CÄi0U00ŠŒ-GÌiRúõbadandgoodstrictÚsÿ2# "#õ " complains about a non-;ª passed in<{rtRaise-OType#ß"s.w_•s %42c) ª¦the wrong ®Etype<%©Eù ‡©9(Ò®Œ¢P# If £wcorrect¥&isV,ŠrM? itÁ— En³s"B(˱"\u3042", 0Áìçh e>¾c B§r@\xffo±Àes( ð UnicodeTranslateError,  °cs.strict_e!s"Eõ ("\u3042", 0, 1, "ouch")\!) ñdef test_badandgoodignoreexceptions(self):/–2# "#õ " complains about a non-;¥ passed in=L.•rtRaises(o Typu%42E᧦the wrong «EtypeF¦B¨ä(�[P# If ¢wcorrect¤&isR,†Pretur„ÿn empty replacementÓYEqualx c "›Ân/È¢ascii", "aq!b"o2r)®f("", 2§ u¢-/De¢ÿbytearray(b"a\xffb")¬p ý(H'ëÐëÑ$Ò\vÓ3©2ÔEu¨˜ÕÜ÷ø–¤ BadObject‰œ[ ‰Vƒ o# Withé3, "ô'" Ýà"?" or "\ufffdç$]ÐèE?éÀ self.a×ssertEqual( úcodecs.replace_errors#.0Uni* DeE%ù ("ascii", bytearray(b"a\xffb"), 1, 2, "ouch")),uÕ("\ufffd", 2) oself.a³3”Translate¶�\u3042b"£#®ódef test_badandgoodxmlcharrefK°exceptions(Ï!)::L=# ".õ " complains about a non-F pEd inHW&ZRaise·2Typó {¿=cs.€ù ,%42k›½¦the wrong ÁUtypesR½M±õ†}Ïõ an only be used for encodingFà  � ‚ Æwvu0Õu©ï³W wv?", £ `# Use AvcorrectCÑbcs = (J�9, 10, 9     0èA 9J01@cs +kÖxd800, 0xdfffˆá"".join(chr(c)+wc in cs(Ñ•ŽE’åŽÜ"a" + s + "b"è Õ1, 1 + len(s)³m0 Àô¹"&#%d;" % cùR!) U>Ÿbackslash= -<\ ; <»ù:5À coödecs.backslashreplace_errors, €UnicodeE…("ouch")  õ # Use the correct exception.•tests = [gÓ("\u3042", "\ )ƒR ("\nMx0a"a.61C\x00/00#ff/ff4u01@ }D\uffD #0U00HJ+&10RU9 +ý# Lone surrogatesT$d8pu Awdº #Q800\u L\0]€Áfor s, r in ò:ïú with self.subTest(str=s)&*%ÉassertEqual(H"�Ë48ØnAÞPasciiÊa" + s + "b"‹;ó1, 1 + len(s), 0(<((r.L$R„Translatô &? DXJ/b" bE /b"* çx+ ûbûbytes=býe/Deý”`array(O@ + b,"b¦O1, 22æ!) ê1defAó_badandgoodname¬_ s(C7# "(õ " complains about a non-@ pd6d i©Q.‰rtRaisesG2Typ J7cs.zN!42Û4ø± VVwrongTG typô±Àr, ö codecs.namereplace_errors, 0Uni)E…("ouch")  7# "Iõ" can only be used for encoding@õself.assertRaises(‚ATypey ’¹ º'DeÀÿascii", bytearray(b"\xff"), 0, 1, ã­Q‚Translat÷Ÿ("\u3042"�õ # Use the correct exceptionS•tests = [eeú "\\N{HIRAGANA LETTER A}")€±("\x00", "\ Rufbf9!ùN{ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH "—›Â"HAMZA ABOVE+ÿ ALEF MAKSURA ISOLATED FORM­”U000e007f’¯CANCEL TAG/S10fff/3U00 èù# Lone surrogatesÀW$d8'u A#h ud #B800\sL\0]€l�s, r in õ:SQwith ÎêsubTest(str=s)&*% ZEqualŸ"`I/3œEìœÚ"a" + s + "b"z;Õ1, 1 + len(s)Ë#<((r.Ê$!) 51defDµ_badandgoodòeescapei s(0G )_$ =Âblookup+('.'“;# "õ " complains about a non-Œ p·6d iÿ�ml w« !!42(7²­Vwrong«G typH²D}Ó ÿ×9notÖt´Ù/ onÖ)0dc8”Æ À # Use thóe correct exception ófor s in ("a", "\udc7f ed00"):,3ûwith self.subTest(str=s&*%ÙassertRaises(I#‘UnicodeEn_rror,(ðsurrogateescape_e+s,Tý ("ascii", s, 0, 1, "ouch")mÂZEqualÁ‘ $á� "apA80b"“2–)Ù¶(b"\x80", 2Ÿ ©k/DecÊ ‚DÆÿbytearray(b"a")a°Y/ד;b˜?1, cûd õdef test_badandgood5päX s(Œ 'µ0 = Š’cs.lookup)(','/9# "õ " complains about a non-Þ ”6d iè—.ªŽPTypeEQ õ u¥ q!42æ®–the wrong�e typesN®BÃè(þÀ ðan not be used 4¿translating¶ e f ¹Tsª(° 80ÐÒ@Use v 2enc Putf-8 F16le b &32O32be*eäwing=enc#?õ "1 ¾NRa(enc, ]7eƽ {J'$ &RÀrror(enc, "aû".encode(enc), 0, 1, "ouch") ðfor s in ("\ud800", 3fff `800\ud)):Iûwith self.subTest(str=s&z%ÙassertRaises(I#0UniÂEÈoError,(ðsurrogatepass_e)s*R±("ascii", s%olen(s)*™tests = [”v("utf-8,ú", b'\xed\xa0\x80', 3)Ÿ5M16le8¯00\xd8', 24b4Pd8\x0h4/32h8O', 4p/32p¤x<;obf\xbf8Pff\xd4á%16¥4_df\xf44h<x V0<' J…8ý5 BØ>FŒC B„YRJœ o]£ß1encî@b, nêÉË MBing=>ÙŸ, bytes=bâ _Equalá¹*Üú, "a" + s + "b"Y7{1, 1 + ô ù@((b.2 ç=!Deë‹rarray(bÏb[:n] + b"b"Òº n?b(s[:1]nþ!) v@def bð_badhandlerresults( <ó = ( 42, "foo", (1,2,3), (1ACNoneÀo",), ("foo"ö, 1, 3), ("foo", NoneS) ) ð encs = ("ascii", "latin-1 Œiso-8859E5") B for res inUults:eð#codecs.register_error("test.badhandler", lambda x:H¢Dd0encd± a!ùself.assertRaises(„#PTypeE€,°"\u3042".en¶%?enc Ó dÕ(Np bytes)Þ·šŽb"\xff")~¯("utf-8", $ 7$?+x-G niù‘-internal.L\x00/)ƒQwith Öÿsupport.check_warnings(4”;# uvý has been deprecatedL;ö+ú #†0.ded"±�&=1def0€_lookup(Î$Ó`Equal(˜’cs.strictG3s, D"("$&")qNbignore8N$NxN $N `áõxmlcharrefreplac´-  ;" "YŸbackslash… :„'Oname5 zådŠ!unú4ablbLmentš/*†G(exc¶àÐif isinstance 2, UãEX‚ 48ö return ("\u4242", exc.end¥'Nelser÷ çò("don't know how to k` %r" %[Wd¤ê?ªB¢²"A Â}ÀC ¥À "\u4242»".encode, >encù"test.unencreplhandler"=!) @def .ñ_badregistercall(self):$sø# enhance coverage of�Modules/_¨1csmD.c::V‡_error()SrPython/2,“PyCodec_RŠE3•ñ.assertRaises(Type&#, G pF, 42s@!Mbdummy"NÂ9olookup7;T 5Â; ç`unknowËæ7tä¯L, ³=", q©"ÁÿxmlcharrefvaluesÃuòXMLCharRefReplacXsÎñ # and inline implementations*ðv = (1, 5, 10, 50     0Ì 50A Éö = "".join([chr(x) for x in v])(cK&Eace"E ‰sYn0encp÷("ascii", "iso-8859-15">1"rr1 `=ˆ. HLs(ÿL err& deùohelper"°Objects/uniFoŸ_^_ñb +"&er ‚b"\xff".`&, X  †2bad1»return1(exc45 42¦Ù:cs.- Q<", Ó“Ñ V"W\&—`-escapÅß^)/x0`Mya Àt.baddecoder£eturn1") ð)self.assertRaises(TypeError, b"\\Uffffeeee".decode, "uni ò-escape", "test.bad#rgWuyyyycOraw-gÏKdef ‡u2(exc):#ù¡¶ ("?", NoneÙÐcs.register_e (á=2",mIZ 7xffð_asciiJE2") Àáhandler = PosRj(v¿ 2posù3", F._ü # Valid negative position�•.pos = -1òÔEqual(b"\xff0ç*("æ�ˆ), "0è‰2‰7:‹Nå out of boundszOr3hVIndexi)/, * !¡ª©G‘Largest v: �ð (one beyond end8Vinput· 8Ê8 Ç/In£¨ ‰ÀLÿRestart at the "0"ˆ6Hd\=g=t Ëclass D(dict3ZÀ__getitem__(‰[, key(_JHuJ¾UK¾‚charmap_Nˆ.ñ, "strict", {0xff:¼}G• Î3Val…/, ^?D()U #T²ssys.maxÜ3+1}|`F0_enTahelperfaö# enhance coverage ofÛ£# Objects/_ðobject.c::unicodeó_encode_call_errorhandler() `# and "5ersð self.assertRaises(LookupEE’, "\xff"._õ , "ascii", "test.unknown") Prdef bad1Õreturn1(exc):#�5 42À²cs.registerÆ(h Q-",dèÒOTypeÐ hÙ 2Ù¦("?", None™â2â2Iâ72»3q = PosR»?¾ 2posÑ3", F.Aõ # Valid negative position3¥r.pos = -1ñaEqual(—0˜(—�˜), b"0艥‰.:‹NÖ out of bound¨ 3ÁXIndexð) Á*à  ©¨G‘Largest v9 �ð (one beyond end7Uinput 6È8 Å/In¢‰¾I ó0×Ëclass D(dict޵À__getitem__(ç[, key(º&ËuTãðfor err in ("strict)preplace ¥xmlcharref>[¥"backslash(g "name€¿ _Á Ö0Uni 0cs.Ž3map>î,Ç�, {0xff:Ä}|¤^3Val/, \?D()S µRÀ "\xff", errñ$, {0xff: 300}) def test_translatehelper(self):$(ø# enhance coverage ofñObjects/unicodeoC.c::0_en÷_call_errorhandler()e@and "7ersñ(Unfortunately the B÷s argument is not directly accessibleHñ from Python, so we can't¦ that much‘Çclass D(dict 9±__getitem__0[, key(,Àraise ValueEú“f€.assertR%&s(&•, "\xff".›V, D()ž=þssys.max˜?+1}R 2Typ´ŽQ-()N‘bug828737µcharmap = {#þord("&"): "&",</lt>g1'"'[9quo }‚ðfor n in (1, 100¿)ùtext = 'abcghi'*n¯#·(õ s mutatingdeÖr¹baddata = [c²("ascii", b')2q("utf-7 ?++"O8", ? !16@‡B/32!  r-escape)n\u123g�Craw-’0,‚internal^/¨]Þ¯×replacing(exccÕ�if isinstä 2, U¿Dž¸ 48Bexc.ìY = 42£ àreturn ("\u424.0o!FelseH2}@("do¨Âknow how to 0p %r" % Ñ|N²cs.registern ("ç.5", ™yAwithû .support.check_warnings(,# Šõ has been deprecated›ci(Ping, Þ)xê ” * “dY.\o ü$” X#29b"" ©$IÀndle %r" % eSxc) ôcodecs.register_error("test.mutating", 9°# If the deDñr doesn't pick upámodified input•followingƒõ# will lead to an endless loop'Qwith ˜õ support.check_warnings():,ÝP# uni›ù-internal has been deprecated3ð for (encoding, data) in bad `dðself.assertEqual('.I OÑ), "\u4242") �Á# issue325831defì¢_crashing_U0_ha r(zñá# better gener¶ð one more charac@to fl¸ñextra space slotxÕ@# soöõdebug build it can steadily fail1­Àforward_shorHÇthan_end(exc¨`Ðif isinstance 2, UªDKEƒ 48a# size×Òc, 0 < }š < exc.enÖ<ñreturn ('\ufffd',*vstart+1Õ+Nelseê¡raise TypeŸ@("doí€know how¹›` %r" %_W†e@v#É F$",ä BD Ž bnb'\xd8B00\x'º 8Zá'utf-16-le', '…«9'),?rx Ž500'/1ÊÂÞ/00ÊbÊvL11\xÆ˜Ö /32 6 11’œ%<Ê Ò¨5ÒyÁ€replace_gP_longš †º%–°object = b"ÐU" * 8�d§)¥À how to handóle %r" % exc) ý!codecs.register_error("test.replace_with_long", %) Lõself.assertEqual(m b'\x00'.detÏ('utf-16', 'm9'),@p'\ufffdE'%Õ‰/32‰&� @def ÔR_fakeRp_class(™%):²Åhandlers = [,"’cs.strictBs"Signord"±Ù#Ÿbackslash,Oname'¯xmlcharref-blookupçü('surrogateescapeù4Hpass2]Wàfor cls in UniF!Enñ,D�E‘Translate¾©×T FakeU;G(strç)_@__ =‹›Ÿ£ sn)� H“.subTest(,=!, ëlO=clsŠID®¢Raises(Typä%, L Û)gFØŸException}{P   )Õ 9(4°()) if __CÂ= "__main__"è@unit9.ó() # Check every path throughñ method of UserDict fromð import mapping_Z#s k`collec²Ðs d0 = {} d1È"one": 1} d2ï, "two": 2} d33$0hre@W5} d4&@NoneC G} d5 1B1} hæø Ø.RHashMîƒProtocol«Ptype2{ë.Q ¹$0Is(¢P.),56cNone(mÀ;‡ÑOFalsÒQ‹Ó8§Ÿ±Ìš‡æÇ$Î_before_19000@same!%B but¥aì <^Ì??1, •6Vï=O0001=¤À self.asseô rtIs(type(newdt), datetime. 3) �self.asse6…None(m) ðresult, m = xmlrpclib.loads(s, use_builtin_qvs=False^‚R,) = KZxSEqual*6 dt>$ Ò�wDateTimu 7 Óðdef test_bug_1164912 (0%):šdì_(—(¬0_d,Y@ummyÞ�pdumps((/c| ömethodresponse=True)„´·qInstancð×_d.value, strÊò # Check that the output of ¢ð) is still an 8-bitC5ing·s7 ±;g°s¦�ìnewstyle_classŸ— T(object¸NEpasstWt = T¸–t.x = 100"Å.y = "Hello"O((t2Ý?t,)œÛãt2, t.__dict__•ïHœ_big_longîè÷Raises(OverflowError,–H¿s, (2**99,)g!ad†gOTypecÏ{(1,2,3): 1}jÜrecursive_seqoQl = [C]v®†[3,4,5,lŸl.append(­ l¢˜ £é{'1':1, '2':1}ªÖ{'3':3, 'd':d¥d['t'] = t.® d®! 2**31-1Ï„F ¾>(Šj%4)¯& öhMAXINT°oMININT8ئ'(z +1ª¥9kÓ-kCéd(�_write(s´. j§MarshallerÈ m.ë_„æÀ.MAXINT, dum³my_write) þm.dump_int(xmlrpclib.MININT, dum2öself.assertRaises(OverflowError, S,gnnAXINT+1pVÞ-p¬‘def test_pdouble(ò!): Áº%ös((float(2 ** 34),)^+Mü))]2¾)e_ + 42j -75)) $'(s Fpass.Gm = ¾¦arshaller(&1n-5 5j":o% :0,P=nonNñvalue = alist + [None]=MŠarg1 = (,=Istrgc•8€, allow_wG=Tru÷ÓÅaEqual(‡‡Ä`loads(xw)[0][0]� CTypeÙ£1, (¥[ +Œencoding}¨ö = {'key\u20ac\xa4'Ÿ6',$}V½54), ç='iso-8859-15'évÿ"" + y†.…" d!, Î ‚Q.®)e(¬ø, 'xmlcharrefreplaceÁ|!ºÿ°Ò(@ ` ³ïmethodresponse´ /Œ×0namé'˜WKÀ methodnamóe=methodname) ÿ#self.assertEqual(xmlrpclib.loads(strg)[0][0], valu=H1], |}ðdef test_dump_bytes(�!):Ÿö sample = b"my dog has fleas"% Á6&, ÉrBinary()üÑfor type_ in ‚,^arrayA™� " =A\–"7s =…ç1s((7I,)) +™result, m3�à, use_builtin_±Hs=TrˆnC(new]2 = Q d] ê1 /0Is(vb)'sJ�`�IsNone(mæ-GFalsof…/,)çP DòÝÃÌ_unsupportedäÙResponseErrorþ ›òdata = '!><û£><5s>'H®yRaises(pþÄ , zO = (‰Dp¼'ª™%2'a"', ' C')  3òð�”˜ð�”«ð�”¦ð�” ð�”¬ð�”¡ð�”¢ = P0mðint>205618394746093.781250AGJ5dGUgc3RyaW5n/w==20050210T11:41:23'ò�'<þ1ô#b205‰"i2»C9876543210A4', 3§bigdecimal–.e—" —".DC&('¨D%ÉÜget_host_info ñ# see bug #3613, this raised a TypeErrorS=’transp = ¨‘.client.TFort(÷`ÂassertEqual(<.‘`"user@¡].tld"buÐ ('hosŸt.tld', ñ[('Authorization', 'Basic dXNlcg==')], {})) Hñ def test_ssl_presence(self):!l6try ¥import ssl$�except IZError30hasd† = False8?lse*6Tru) …ð-xmlrpc.client.ServerProxy('https://localhost:9999').bad_func&()…½ïNotImplementedÅq.assertÆ(Ö2, "Ž Ž@'s eÐ with SSL sup3"t/OSh g ´ükeepalive_disconnect¼ðclass RequestHandler( !.s2š.BaseHTTP#þñðprotocol_version = "5U/1.1"G*hcdè n|do_POST¨<²length = inÌñ.headers.get("Content-L'&")P=¤²rfile.read(Q(1if +± „I"cclose_`ý– Ú-mreturn²response = )ôlib.dumps((5,), method'=`³4 = w.encodĕ»Tsend_,÷·žStatus.OKd7x sd, len(T�xAsœw¤VwriteO :�¤0 = $¦¤èâdef log_messagêû, format, *argsû6ý # don't clobber sys.stderrŒFpasssoBrun_l([ñ.socket.settimeout(float(1)) # D{shang ifai fails}M+"_rñ(BcFirst ÿ and attempt at secondKsRetried6Tñ†8 = csn#(( «.HOST, 0),œ’ú²addCleanup([·_ï- thí2 = Qing.T†(target=† 5g.start¦ ySV.join<0urlç²://{}:{}/".I*(*¬ adÚs= ¼’url) as p‘À self÷.assertEqual(p.method(), 5) Oself, ô! class SimpleXMLRPCDispatcherTestCase(unittest.!):g=1ÓExc(Exception"Œô"""Raised inside the df`d func3ñs when checking forfD”chained e`Qs""" @def �ð_call_registered_X( ŒöCalls explicitly 3‹]wö# Makes sure any„- r×tÌÆ has no otheÆ#<ÒRto itÊnöexp_params = 1, 2, 3ì:â*/åH› þ. ,Rˆÿr = xmlrpc.server.(bŠ$r.D“(‰6Bwith™Ås©«0) a¦Rc_ctxn×Z4r._ $(' ù ',ãK}x=!exb.Y†.args, (‰/,)@~IsNone(AŸ__cause__7`ontext9Ú�instancec/ó2"""ØaÏ3  attributeUaçŽ X0edC¥ 'efD/, 9×Úƒ(.N¡(¤ì(s0ÿ&0Œ½¢eE's `]`1rÀp_method = '“method' õexp_params = 1, 2, 3 õclass TestInstance:Aòdef _dispatch(self, b", V)15óraise SimpleXMLRPCDB erkTCase.IExc(sB g´�ÿer = xmlrpc.server.t%()a<³.register_iú(œ&()5Pwith ü€.assertRàsÇÊ) as exc_ctxvM™ä O«qcEqual([ð.exception.args, (>JÁKoIsNoneLŸ__cause__7`ontext9¼3Ttest_aÀed_func_is_n|Ž6p"""Call;–plicitly ; ;í  which is Á?"""Gs(j‚, name='a'tRegex(E£%, 9,A, ('B',))èV®0_haP[‹ SðAttempts to call {xñ&ntTHon am]_Je(objectjTNßcannot_locateR¥a=–that the ß J JF6kW FHelp¬P(unitÓ."¾l•lescape‡é3­Clib.1ö"a&b"), "a&b"_=<=/lt<><g<úTFaultçùLrepr÷f—êQ`(42, 'W G èSf<,I 42:<>&ÀssertEqual(r epr(f), stñ) def test_dump_fault(self):#ñf = xmlrpclib.F#¡42, 'Test %').s.Vfs((f,)"©(newf,), m+vloads(s(‡Â.assertEqual81 {'¦qCode': ‰‰String':˜}Osm, None ê ¼ÒMarshaller().ÉfO{Raises($,5Ü3, sluüotted_attribute{Ð# this will rf$ A+õError because code don't want us to use˜õ# private methodshÊ e,*$ ôû.server.resolve_d×tˆ, '__add,3elfâCTrueBN ð(str, 'title')) class DateTime–�Case(unitÛ.Ô~e9 uð with mock.patch('time.local e') as _*-& _struct = ._ (Oñ[2013, 7, 15, 0, 24, 49 v196, 0]xa }Ó.return_valueq k6$Ó(_¶ÙñX %6žW/t)- % f ö"%Y%m%dT%H:%M:%S",XÙì®2vÇõ = 1181399930.036952õÈdîO�ņÎÁ!k?(d)É]_tuplïöd = (2007,6,9,10,38,50,5,160,0·Ù' '_ì0609T10:38:50'•Â@ ¡; §2e?strgdW@date7_ ½. oŸ1,2,3,4,5½2dÍ102T03:04:05dr�~ Í— 1ðval ="" % id(t) ñself.assertEqual(repr(t), val) (ðdef test_decode(4!):Fad = ' uõ908T07:11:13 '#ö t1 = xmlrpclib.DateTime(ˆ3t1.^d?ref9”datetime. (€Ö,9,8,7,11,13)G° äƒt1, trefàÅ)t2i_X�H2H(¬comparison,dnow = ]¾G.now dÛ �2@now.wtuple()Â#WT vs. 2„¾STrue(e_= now,&±!= -&Qthen :% +w˜ödelta(seconds=43 C>Z 'y0 < / í?strèdœP.strf-ÿ("%Y%m%dT%H:%M:%S"˜q0== H'f ¿>_­¿(À}ùJ&?str� <¥3 *õome other types`dbytes�astr.enÝv'ascii'md«î»GWwith ¿÷Raises(TypeError+é#� == 1970E+2!= ÄG+0== barray(QÿÞ"™7™+€< float(*’,>*2<*>Ü*ð class BinaryTestCase(unit|."):•ò# XXX What should str(>ò(b"\xff")) return? I'm chosing œP# forð (i.e. interpret(Qthe b�åÒa as Latin-1-.dDó(text). But this feels very unsatisfactory. Perhaps weºEÁonly define †c), andÃ4 r"Ý'Ýð ')" instead? def testó_default(self): õt = xmlrpclib.Binary().ñ .assertEqual(str(t), '') &üdef test_string`ñd = b'\x01\x02\x03abc123\xff\xfe'E�Šd‹“Üd, "latin-1")šodecodeš' deÅ€ase64.enLgbytes(�/t1H 3t1.†/deÓ O1), Ô)2l"_bµY2Yð: ADDR = PORT = URL = None # The evt is set twice. First when the server%‘ready to ­. # Second,ñhas been shutdown. mðuser must clear # a�event aftf&t =”Ahe f�@time|Qcatch8s}áset. def http_›ór(evt, numrequests, €Handler=!, ó1ing;ðclass TestInstanceCXl1divuc, x, y:ÂÒreturn x // yK8³_methodHelp@Kname@0if – == 'div'{GbP'ThisšGÖdiv function'vÏzFixtureJr@static“­`«‹getData(�#42ie MyXMLRPCSe2(|.’x.Simple!Yp_¥t‚# EnsureûAocke¹ñalways non-blocking. On Linux, s* Ýñ# attributes are not inherited likeyùon *BSD and Windows.N`s, porâQpw.acceptnÃTs.set¦G(Tru0 WRà +ot¾Ç1Ö=uR +Ä›; = ¸ü("localhost", 0)<,<±Q - 3log•ðs=False, bind_arctivateX6tryú¼ç'dlpglobal û,ú,ù¶! =Ë.µ0get |N€#connect}ñIP address directlyÛ“is avoidspƒ.create_;8ionQ`tryingP u0 us 5allnð families, which #cauñ9'''&µreturn Truey§(name='add¥…k_(x, yYUx + yZ÷testInstance = TOClas„i5(Bð, allow_dotted_Ÿ s=ÊD¥evt.set() „ô# handle up to 'numrequests' .gwhile $J > 0i§T_@L‹?B-= 1�öexcept socket.timeout[Apass‡vfinallyq7Hclosëf = NonЯP_Õ_Jxer(evt,ä,H* r=Oàc¨ºžc�div(self,ÚB// y %8³_methodHelp@Õz%0if – == 'div'{|vthe divvrA=doN‘MyXMLRPCSís(xmlrpc› .MJHPath$Þ‘5getFCÛ�# Ensure Ôâóalways non-blocking. On Linux,eOFñ# attributes are not inherited likeyöon *BSD and Windows¨N0s, õ0 = µ.š0.acã s’¦(A°KZR]ô+ot—ùw¯: = xbSimpleuRì+º (Uˆârpc_paths = []¡DöBrokenDispatcher¢ÛÃ_marshaled_d#æddata, v , j ‚'€aise Run:�Error("b€I3er"ùé; = žú("localhost", 0), My,!Ð  ð logRequests=False, bind_arctivate ) 4ø serv.socket.settimeout(3`erver_G(Atry:>Bõglobal ADDR, PORT, URL8 = n0getxCnameWNð#connect to IP address directly. This avoids A£et.create_;8ionQ`tryingP à"localhost" us 5allnõfamilies, whichÌò#causes slowdown e.g. on vista-ñ supports AF_INET6´eü¦er listensT$on*e only.öURL = "http://%s:%d"%(PŒ5W§aåñpaths = ["/foo", e/bar"]n@for )1 insâcd¾ðadd_dispatcher(3�, xmlrpc.ˆöer.SimpleXMLRPCD+)±R@.reg ñr_introspection_fun sà 1Ÿmulticall-‡L.get¨Vs[0])vhF(pow›=1=ûlambda x,y: x+y, 'add'P 5ñ"/is/broken", B )!ev—5() ©°# handle upÊS'numrò$' .gwhile $J > 0ÛòT_@ z?B-= 1�dexcept„:[2pasægfinall2q»8losAu = NoneÄ#ÿ»ð prevents errors like: #/  def is_unavailable_öd"e)íú'''Returns True if the given …!isÃproduct of aE-sidòd qAd by8×'temporarily •ø°sponse some‹{# ‡€by operaas²�non-blocküŒRs.'''Û#H we get a -1fò code and/or empty headert �if e.err3 ==D5.11 isëI¶rNM@xc_m 4= e>äE('X-/w¡ AttributeÍc±# Ignore OSfs herexekSstr(e|ËOand �4in Ds.lower(* Ý`Dmakex§ÀskipIf(condi°ƒ, reasonE@# If•Ðskip the testñJ, we have to make a request because # the server created in setUp blocks expecting onQ�come in.Cñif not condition:]ñreturn lambda func:!àdef decorator():¶_´ç_and_skip(self)g6try:±xmlrpclib.SÝàProxy(URL).my_o¬!()Œ1†except (=ñProtocolError, OS n) as eu òis_unavailable_V[ion(eºt3rai�ö unittest.SkipTest(reason¶c,Û!j class BaseXUCase(n®„ÒHandler = Non>¡_count = 1sòthreadFunc = staticmethod(http_m!) ,ésl Ù@# en>ñ traceback reporting:&¨.RÒ.SimpleXMLRPCÛu._send_CQ_headÃBTrue‚HU0.evý—ing.Event!#Ì$rt-)_h_sž—�_args = ßc!, m : häj"= œTc�(target=Rv , u= JX.starÚ@²addCleanup(KS.join§%¨# wait for4`to be ñyù lfì.1Bh£evt.clear(\�tearDown'wt)onsýz‚terminatŽ1c{”_# disQHTFalse]Š„M(réAst_sÁ1 àBp = ûàóö assertEqual(p.pow(6,8), 6**8§ý#ñ# ignore failures du*Pnon-bF>‡socket '0' eZ5µG!3# p«R;rvide ad˜ al informaúå[y output5„IÎð("%s\n%s" % (e, getattr "O‰s", ""))мst_nonasciiÐ@_strõ= 'P\N{LATIN SMALL LETTER Y WITH CIRCUMFLEX}t'§×BhBÀTIN SMALL LEóTTER O WITH HORN}n' Etry: ùp = xmlrpclib.ServerProxy(URL)+óself.assertEqual(p.add(start_string, end )),>m 8( +98†except (¡ñProtocolError, OS j) as eÙð-# ignore failures due to non-blocking socket 'unavailable' e]s†¶§if not is_*_ jion(e)~43# p®R;ðvide additional informaù in test output€P€Îð("%s\n%s" % (e, getattr ñ"headers", ""))) F1defZð_client_encoding(Sº “–= '\u20ac>Ý Bxa4'aŸ[*…ï='iso-8859-15'sŽ2.$x.M$!s.±Pw´ünonascii_methodname{>'Z8ætêšt(42), 42gÄdñÿ¡# [ch] TheoÀ 404 is causmólots of false alarmð¡0XXXþL_404ò# send POST with http.Íñ, it should returnwE andQö# 'Not Found' messagepaconn =[ ^°.HTTPConnec£¶(ADDR, PORTB9 .request('¥÷', '/this-is-not-valid¤±response = >4get(Ycclose(É´ ‡ðresponse.status,s 404) ñ self.assertEqual(response.reason, 'Not Found') 8ð def test_introspection1(L!):#^ exðed_methods = set(['pow', 'divamy_funC0add…têšt',NRÒ'system.listMi@{OHelpK5˜SignatureO�ulticallN1Fix?]n6try Îöp = xmlrpclib.ServerProxy(URL8+–S = p.Ûñ(*ˆ Ôw?<), •:†except (�ñProtocolError, OS j) as eÇð-# ignore failures due to non-blocking socket 'unavailable' e]sç§if not is_*_ Wion(ee3# p®R;�vide addi  al informa1 inÄy output€PDÎð("%s\n%s" % (e, getattr ÿ"headers", "")))  2 #‘/´ Ø-`divhel10!odW{úðBõ, 'This is the div ®Bœ<ÿ,† @make_requ_ÿand_skipIf(sys.flags.optimize >= 2ò"Docstrings are omitted with -O2 and above"ÄÒ3³©native docHNÝ yVã³'µ1«»mM¾/my¹èÀrmation in tËest output ðself.fail("%s\n%s" % (e, getattr ñ"headers", ""))) Fð def test_introspection4(R!):#l÷'# the SimpleXMLRPCServer doesn't support signatures, bªñ# at least check that we can try makinggEcallz6try‡‹âp = xmlrpclib.‡¥Proxy(URL)8+ô divsig = p.system.methodS¥j('div'5úÒ.assertEqual(F6, 'Ü5 noó'edA†except (¡ñProtocolError, OS j) as eÙ�# ignore ÉBñ due to non-bloc!ðsocket 'unavailable' e]sü!if¥7is_*_ Wion(eÞ,3# p®R;�vide addi al informa1 in=—HPmulti ’)U KMkjCall(p/�.add(2,3pow(6,8ªdiv(127,42"õadd_result, pow 3div 5 = …(= ¯N+2+¬ .p;6**¼ /“x, 127//Ì]ýÿ9Önon_existing_–¾ b²this_is_not£s˜Ñ ¹ ¢"# $.»s contains;'ò[{'faultCode': 1, òString': ':'S2 ' . "ÊA" is=Õbed'>}]0'„ &ÅÌB[0][¥µO], 1· @ÀltString'],  û&':method "this_is_not_exists" ' Dõ 'is not supported')$eWñ (xmlrpclib.ProtocolError, OS u) as e:8dð-# ignore failures due to non-blocking socket 'unavailable' e]sN!if¥7is_*_ jion(e)~‚p®Rà; provide addi. al informaù in test output€PPself.Îð("%s\n%s" % (e, getattr ñ"headers", ""))) F1defZ€_dotted_.`ibute(T»ñ# Raises an Attr%cò because private æQs are�allowed.q¯bassertU(R,*. ñý.server.resolve¾À, str, '__ad7QÖ.{CTrue@O (Nvtitle')†‘# Get theDCðrun faster by sendL`a requÁAwith-†_simple1ð# This avoids wait;1fora�vtimeout6ÑQ(Ú"pnames_tû: áïXXX also need 7Bfals뀉2 = ™ŠSœñ Proxy("http://%s:%d/RPC2›§ADDR, PORTNsdata = ÛöFixture.getData(v¹Ä`Equal(9l, '42'üÌunicode_hostÒhº2 ’\p.add("ar¢\xe9"), "a ~Ÿpartial_p¨ó# Check that a +ò POST doesn't make'|÷ loop: issue #1400hpconn = ™ð.client.HTTPConnecn(ž96.Æ ('}A', 'Ò ?ñ /1.0\r\nContent-Length: 107byeÂQ]close²cD¬xt_manager¹Do1URLò€ y”F2, 3PaÂ2NotW1p('trans‚@')._·'¦ S� (None, çkh- a¬Ñ E_–_ R:try,cÀerver:  ôserver.add(2, "a") õexcept xmlrpclib.Fault: (Epassòself.assertEqual(]õ ('transport')._connection,:K p(None, ñ)) class SimpleS³óEncodingTestCase(Bas)¬Ñ@staticmethodsódef threadFunc(evt, numrequests, €Handler=‡3, er\µShttp_ëK ö, 'iso-8859-15') �3estF_j(Rjñstart_string = '\u20ac'DŠ8endBxa4'a2try 7p =ÝV–Proxy(URL+ˆ Úp2� ~)ÚOÈ&+ ·v}(~ðProtocolError, socket.ej) as eÞð# ignore failures due to non-blockEFÑ unavailable R%s.U±§if not is_*_¤Wion(e¥03# p²S;�vide addi al informaù in test output€P„Íð("%s\n%s" % (e, getattr ç"headers", ""):’MultiPathç"58 = A(ïmP¯µ3¡_count = 2ÁjÚ\path1Ђ g+"/foo�_òp.pow(6,8), 6**8‰,+gRaisesHÆ!, Âl, 6, 8†¬2¬ O/bar° g°+¯?pow¯3¯Ÿis/broken±6"#A²òcase that verifies"a 0 usmòthe HTTP/1.1 keep-alive mechanism #does indeed<P subs˜$nt–Ps on LVsame O%AKeep\ï$#a^" hõÂ0sup¸s¯„and logs2±Ato añ#ª@variNRÆ#stT‘.!.ÚjXMLRPC)ZqparentC »Aƒà protocol_vóersion = 'HTTP/1.1' õmyRequests = []õdef handle(self):9.;¾.append([])'Áreqidx = lenL99)-11qreturn _ÈparentClass.Š1£b_one_rÈc ¯�result =Y@eî[Ÿ×]û$aw‡Jline ÜŒ a³HhCr = Œ$æ\setUpÙs#clear DA log0± Lu é—÷BaseServerTestCase.vò #A test case that verifies1a s>´ using the mò keep-alive mechanism #does indeed<P subsÅ$ntÖAs onLðsame connection cQ KeepX º 1(ÎWÑL_twoZâp = xmlrpclib.\–Proxy(URLÕ•#do three®.‚ö assertEqual(p.pow(6,8), 6**8G:+>Âp("close")()mó #they should have all beenípd by a ÄlØrÞÛuH), 1‰Rcheck;ðwe did at least two (AÐthird may be aZk‹b#due t‰ßad schedulingarGreater“µÐ[-1]), 2) #.ö special attribute acces¨p-,AoughÁÑ__call__ #funÄ.Å 2Å�#ask for3f �#be¾d�/‚_count=2 3(5som6qs with S|‚îCVd #thisØtrigger a newµ4tn+CÄÂ[ ÝÀhave all beeó&n two request handlers, each having logged at least #;„completeDsñself.assertEqual(len(RoHn3.myos), 2)AGreaterHO[-1]L72L šñdef test_transportÕ!):öp = xmlrpclib.ServerProxy(URLßv#do som:Å with close.M1Föp.pow(6,8), 6**8Q5p("”1").Iÿ () #same as above, reallyb%V6")(w ¢è1 #AJò case that verifies gzip encod‡ôworks in both directions #(for a‚p and thXÐsponse) @unitµ�.skipIf(Z is None, 'Pires Ò') class Gzip¾ÚTestCase(Baseø#EÃ0sup#Ás keep-alive Dlogs±ÕAto aô#|�variable%6(b!.s_0.Si‡jXMLRPC)¡™aarentCÝ£Aƒ?ò rotocol_version = 'HTTP/1.1''!|do_POSTô#store content of last àïv4c!__3__.<Â_length = in…£.headers["#-#&"]¯Pqreturn Wp.·‚3estu: = ]ö˜% T›ý†…#custom ¬!, õBe reµ º Û±our perusal•ÃPfake_¯r = Fals*€dparse_L‡ù[Œ0+T=RB.getY(XO, 0)[.• K‘ÁSsend_Å¿Bconnók, bodyÇ"ifБU±#add a loneê Öõ to induce decode error remotelytDŠ5.puCÒ#-E±@", "¡"!õ'#1tUp ¡5.se(=Àdef test_gzióp_request(self): @t = Æ.Transport()õ .encode_threshold = None"ôp = xmlrpclib.ServerProxy(URL, tU&=tVoö assertEqual(p.pow(6,8), 6**8+ažR¾õHandler.content_lengthŽt°³0 #turn on  Ö5ing9“b“Z†True(a>bßÑp("close")() �ÿdef test_bad_gzi¸Eat.fakeb0 = šÓ!$cmØÆRaisesRegex(åProtocolError,quöre.compile(r"\b400\b")Bvwith cmÐIP Jkgosponse +!E�Õ–l!-™O #noß*rBt.re aŠ’0 #always‹/@#û ±Ö}ž.:old[‘Ÿp @unitˆ€.skipIf($1 isý0, 'ºPires õ ') class GzipUtilTestCase(F+):ç@1_deeMlimi 1max¦%à = 20 * 1024Ì0dat¾‹b'\0' * :'gÊš‡(Gaœ.(5d1 ãBlen(-Bõreturn 'I am broken'0sup\.”Žj~äbn€Ý ev?÷threading.EventÚƒ# start «)¢õhandle requestsÆ)�_args = ªv.evt, 1-D"= vT€€(target=°_H@er, K= U F.ž°Õ²addCleanup(dS.joinQˆQ# waie_xbÒ7adyÏ lfÂ.1 h€evt.clea 2L�tearDownýdt ûŸP‘terminateI1Ëc {€# reset -y.ÊÒ.SimpleXMLRPC'.If= Falsu]mA rf�default_0 = ªZ0–R8HF#r.“° =4h ^basic]’check thaŽfÚ4 byO—: vaï¡7 J¤È[,W s`enableiÌ0 reÏ5ingO�$r = True);!# Aba call`should0‹q just a-Amoke0‡ðtry: ÷p = xmlrpclib.ServerProxy(URL) öself.assertEqual(p.pow(6,8), 6**8/†except (ZñProtocolError, OS y) as e:gð-# ignore failures due to non-blocking socket 'unavailable' e]sN§if not is_*_ jion(e)~ð3# p®R;ðvide additional informaù in test output€P9Îð("%s\n%s" % (e, getattr ñ"headers", ""))) F1defZ_>@_no_v(P·ö# use the broken message clasŒ!.sãò.SimpleXMLRPCRequestHandler.M?C>¨ = Failing�Û:try@P?ìO˜8“� and has›Ԣ# The two  -sN¯ ùñ shouldn't be sent back\…his case(T “sTrue(e.N‚.get("X-QÖion") is None¦BFPtraceŽF;elsÂP²)('÷Šraised'áOwithã~Â# Check thats•¦/­d­o/3´#3  when flag�&se. –u._send_Y_ë0 = û“ÿ!#WetˆÚ£ÏŸhe responvðexpected_err = "invalid literal for int() Ñó base 10: 'I am¥%'"ƒ7`Î (, †ÔÀt("X-tracebaóck") is not None) Uelse:ñ self.fail('ProtocolError=óraised') @contextlib. òmanager def captured_stdout(encoding='utf-8')vü """A variation on support.Að) which gives a |q streamÀñ having a `buffer` attribute.!1"""Corig–r = sys.£õ = io.TextIOWrapper(io.BytesIO(), Ó W2tryÜN\yieldegfinall& v ô class CGIHandlerTestCase(unittest.R}`setUp(Ê‹ó.cgi = xmlrpc.server.CGIXMLRPCRequestj1() Q�tearDownTX1¬st_cgi_get5Ewithçö EnvironmentVarGuard() as envGÀñenv['REQUEST_METHOD'] = 'GET'ª&ð# if the methodúÂGET and no ræ_A!isQÁn, it runs hh¸ T0getÉ©out output Õ ´=|.ãŠdata_outèÂ0Ž´“#ù# parse Status header—cr.seek(0¢;]5 = &Zread(%s\=¹.split()[1]ipmessage�‚ '.join(_1C2:4]S}çÂassertEqual(m{, '400'ˆ˜,rs, 'Bad ¼›[¶…ðœ_response‘ÿõ = """è”_)"fooðdatetime argumentD. Pê•.log = []^’expected_ˆþ= b"my dog has fleas"-hØ�xö (2008, 5, 26, 18, 25, 12Æmarshaled = �zdumps((�%, p¶), 'foobar'OÚg(*argsˇô�.extend(#ÏãrŠ�.server. áþallow_none=True, encoding=None,'¹|à.register_func^(Ï*_;_(/óö˜Dhlog), Œyõ@, mya4 = (#Nelog, [žFM]’0Is(w(q ), B7 k2),  Þ3cgiWN_hasí\_flagò2 2CGIRÊHÍ-r(ø Ù!2(`.8`µ_ƒÀ1 ¿ÄS×ö(("localhost", 0kÀ use_buióltin_types=True) rserver.x_close(�lf.assert7('†.use_buiUñ) @support.reap_threads def test_main():y*pun_unit!ö(XMLRPCTestCase, Helper…DateTimeKÇu Binaryf FaultBUseB±T DqSimpleS" …Encoding @‹KeepalivC?1, )2,@LGzip~OUtilrœMultiPath7IProxRilingQˆCGIHandlyŸ†Dispatch ûñif __name__ == "_î2__"ïßñ() """This is ab""" "tðn't a doc string" from __futur^ imcñ nested_scopes e3f(x^s3g(y!Áreturn x + yrðg result = f(2)(4) # ð8s some corner cases with isinstance() and issubclass(). While these # úñs use new style ,!es=òproperties, they actually do whitebox Hðing of error conditions uncovered when us)¡extension õ3. :o�sys –û3IsIâQExcepe(7. ^.À to make surýñat an AttributeE³žQacces¢Dthe K!'s–#A's bqÁis masked. 56was"ða bug in Python 2.2TJP2.2.1‘4e eÌ@ washôcaught but it also beBsclearedO@(leaùêâan "undetected‘"‰Ó de–d’Set up isê#@þb, cls)¨-#r-! i¬aÆ@, or5Iuple%h1 __6D__ ay&k 'ë'5.__!Os noX^ñ Sounds complicated, I know,^tÜPmimicóPsituaTô3 anG ²@ raitG?its˜$ iIñgotten. In thatÃ,~“) should aFalse.�Aº bhas_no^S(selfüZ+— I(objectH1get$ 9 #ÚDmustŠ2an Oº·‡EËðNone __ñclass__ = property(getC) µ C(object): ûdef getbases(self $™return ():!__5 Uó.assertEqual(False, isinstance(I(), C())7ð # Like above except that 21.__Ò6__.ƒ“raises an/1ion­p# other>ñn AttributeError ÿCtestÌG_4t_than_a4 _e5 #Š/ E\(¹w Runtim˜wâ ä eˆIˆ $ ÁeäEå6 å®?drRQ(s(Rl%, m"ð # Here's a situation whereÿu(cls, '‹2') ( o.P@# Ifmtˆ{ is not~±, it should¡get maskedH˜Pdont_?_noŽrI: passß�3T¥/ ¦,\h?get¥ R#�rwhich /…/î‚ a7Typ‘‘ŒrJ ˆEÇæ¤  /Šî- Rcheckzrwe don'¸< noasxñsee: http://bugs.python.org/issue1574217/h_ î ® í > =ÓÕ›s£wc, bool` # ¦ð another code paCth Õclass D: passñrself.assertRaises(RuntimeError, isinstance, c, D) # These tests are similar to above, but tickle certain code paths in # issub—0() ggead oftõ () -- really PyObject_IsS8h # vs.I°A(). ]V Test4ðExceptions(unitÄ."aCase):1defÜð _dont_mask_non_attribute_e(<2dm1C(o¦SPgetbac 9 r� €Ž!__>ä__ = property(T%) ,ˆCS(C)ìxí sY£, C(), S()YÀ+ SApŒÆ E6Typö i# Likeæñ est the second branch, whereº ofË#0Parg (@ clMQg) isðed. This means:p first 3CmustIõreturn a valid oó, and it's okay for it to be a normal --Gñunrelated by inheriú„U.)  ¿_in_cls_arg)Bžc @o&B)$fF0,%Qmeta Ö!es|õcreating abstract¨¹s·A%C¹ Vƒ�__init__^!, u´" =";5;4H;ðOxVc__call‘VÏ g+) í F_ ðkfN.À = klass ó def getclass(self): preturn  .k!!__-ä__ = property(Cá) # abstract )Ces A„Super = CUµ(bases=()) )_Child)>N,7…# normalqy !Ïbpass ](í ñTestIsInstanceIsSub8 (unittest."CCase> # ós to ensure that isiDƒ and issI… work on(W#½.;�s. BefoUóe 2.2 release, TypeErrors wereFòraised when boolean values should have been áóed. The bug wasIòtriggered by mixing 'h'¬‡S withC' 1xÁis case trieEdC allEácombinations. µ&_d_š ÃŒÞá×÷assertEqual(True,·#2(),I!))|;0Fal’�<n<$ êD,ˆÅ 3$< Ä€Á,à Å! €Í U ;LîL,‘e �ˆeª åD;ÔKÛ(—D1M1„˜C eAQ? :�ý B ó÷Ðself.assertEqñ ual(True, issubclass(Child, C)) ßself.assertEq9 _Super9 OFalss„AbstractB|”def test_¡#_a'(“!):&¥$#  Ê%es*½ |), Í ;JP JBÖ ;Œ ‹ Iª hÕJB/I1)) .^tuple+S� with a #ÿ as the second argumentK ‘#, I)> h<,< [5y# < ¼7 òj." ()EÒW Fbint, (¡float, intFA œ Ebstr, (Í1strE‹]þrecursion_limitgçmake sure thatg” raises RB¡Error befo-¶e C stack iÇq# blown� ÓRO(O,0Gã!, äÜ 6¿isinstance_Û›·A, ''ß0) ¯0P(fxn,ÖÃ, compare_to=:# M§†calling +Ódeeply nested9bfor it¦#c9Bwillæ å±eventually.Ë€†_arg = (ž,}_õcnt in range(sys.get¡{3)+5Ï S ð,) fxn(að+rg, tuple_arg) if __name__ == '__main__': unittest.ð() """ Various ñs for synchronization primitives.2´ import sys ôtime from _thread $ƒtart_newÕ, TIMEOUT_MAX>34ing¨‚weakref cª` upŒâ def _wait()í # A crude ±/yield funcÕïnot relying onô :áó.sleep(0.01) class Bunch(objectxU30A bB of !s.… ±ñ_init__(self, f, n,¯ó_before_exit=False^ZB ¶Construct ap4`n`tP runnå†the same2`f`’H@If `(y°` is True, >Æñ won't terminate untilÛI°do_finish()?fcalledh¼õe.f = f>Zn = nsHzed = []mA_canBP-otY IþäB = sY.sL/()7Õ.__enter__() &èDtask˜% tiÏq×ing.get_identb(¶.append(tid‡%2tryö fJofinall)cIdW`while =4b}.�  §pÇi in range(næAûC(MF, ()jexcept„  ! =É•YRraiseœ¤êAfor_q!ed”�û1len.&A) < kn û _hG`'a Êa# WaitÁT s =ò¥ä­x|fNone, ¼µÍ?­.þ^ÄaseTestCase(Í.G`\setUp \¦s‹”ing_setupdHrtearDow›`Æ;™cleanup(*fK2Øreap_childrenkÑassertTimeout»÷, actual, expected‚B# Th‚…qand/or N�() can beÐÕrecise, which¸#Fðwhy comparing to the eóxpected value would sometimes fail õ# (especially under Windows).&ôself.assertGreaterEqual(actual, ere* 0.6)8õ# Test nothing insane happened'_OLessWð10.0) class BaseLock^ s( aCase):V1"""ös for both recursive and non-Rlocksó>?ðdef test_constructor(®gE80 = . Vtype(@del  Q?repJb…aRegex(D\p), ""’>_Ukã:x.acquirúE5°6®'o�_destroy•|²¬lreleasel3ƒR�Ctry_‡†QTrue(xKfFalse)~• ³„otendedŽa~x±result = []tX|'f(†).AdÌ ÷Bunch(f, 1).wait_for_finished¡!(d6[0] ·Ï=_N = 5 —Ò) ²Eb = Nâb$Ystart#_@a3dlen(b.]F), 0Z Š…q8b+N)ROwithŽc°UÇG_terr=Non†��if err is% <$,Praise+rhÀ # Check theó lock is unacquired õBunch(f, 1).wait_for_finished()(õself.assertRaises(TypeError, _with, 7¿# Check the†)‡ðdef test_thread_leak(˜!): Ò4# Tj shouldn't )A a T7÷ instance when used from a foreignMR(non-oRing) ."Y = …. Gtype5²'f(Ÿ£(.ˆ,hreleasG‚n = len(~øing.enumerate()l³We run many«As in}öhope that existing"…ds won't×Ö# be recycledî,5- /if°V != n²ø¶ re£ða small window dur«^whichÃ%'s³Gôtarget function has Í‘ning, but{s stillLð#alive and registered. Avoid spurious failures by @®aJöbit more (seen on a buildbot)_Ãætime.sleep(0.4Üfƒ�Equal(n,g!) †ƒ5limeout1Ž Â@# CaC@set œÀout if not b;1ingg  #DValu$.÷0, 0q:•# Invaliddv:Þû[§V=-100ABƒOverflowÄ  E/1eF1öTIMEOUT_MAX + 1–(# Uis ok‘(�/F*7At1 =Q.>k QTrue(@’,Wout=5Z/t2Jñ# Just a sanityŸfQit di~ractualld|gþ•öLess(t2 - t1, 5éÅresults = [](â eü©G.appendÿ(0.6 S½º;: cFalse(Y6[0]M%TÖ'@1], »Ð def tesó t_weakref_exists(self): plock = . etype()cref = CP.ref(% 8ðassertIsNotNone('1)) Evdef tes‡deletedˆ<@del štÛ ™–Ð class LockTeEBase1"""K"ñ for non-recursive,rs(ñ-(which can be acquired and released from different threads).Aq0#reF *#»� needs topc¢before re-=2ing_ ë¢phase = []º3Ž#f(H.`+D€.append( *:7ówith support.wait_<ÔtŸ“start_new&j(f, ()‰¡while len(²f) == 0u_mmfEqual(Z:, 1{± [–1–‚ 2Œ…#?æcέÁaÃbû9ez'�b = BunchÖZbÇfor_finished6ydp�°þstate_after_timeoutŠñ Issue #11618: check thatñ is in a proper R R! amP0# ([czero) iR-Ï.–QFalseµ³eW=0.01 œL-cÜ(;Trusb0Aing=�†Ry(‡ƒcs*=ˆ(Ü @.. E…3_un7 8„# Cannotgð an unacquired lSock Àlock = self. etype()ð assertRaises(RuntimeError, 3†.release6hacquirM D{. EÀ÷“def test_Nƒ_save_unÐ d(T!):,E™# Cannot 1F an 4(2Út- mz¦ Æ"€ÿdifferent_threay©… from a 8 8Vªx y'f(Ú4.û�÷b = Bunch(f, 1, Tru6try F3.GkfinallK¸b.do_finish�“.wait_forQed() ú×Ð�_is_owneI ½`False(0.N)B)AI±result = []þ~ Ù).append’æ)daä&a;[0]®½;A |¢ð class EventTests(Base C¼°1"""6Rs for0‘ objects.% XZlis_set evˆÝev[µCevt.JS]FRM/"8;_clear¡« ;HÑ_check_notifyJW, evtŽS# AllÓas get -1iedE„UN = 5�!s1 À resÃults2 = [] …def f():0res+ÿ1.append(evt.wait())(2( æb = Bunch(f, N@bRÖ_for_started(_nmôself.assertEqual(len(¦F), 0;¬7setMjifinishk [W¨, [True] *·/2/º\Àtest_notify(<j`evt = §.eventtype·d_checkA6evté÷# Another time, after an explicit clearR &x Ót?outÔ\ „ šQN = 5u“L¨;0.0«At1 =).º]@r = v60.5et™6;+·(r, t2 - t1‚÷�LFalsŽÔfor r, dt in G ÌÏ;B*(rÞ @TimeÔIdt, a# The ¥u is set˜u^V9c ›1¥AÔh´‚set_and_&»ñ# Issue #13502: ¦a that DÒ) returns tru:w when tHpa#ª‘ed before&H ing threadw•woken up.9B † mW ÖÒ×"Eisleep(`z®È#˜ reæìinternal_locksÒa# ensu•Àat condition‘€still us§ca Lock…X¦Awith~_]½ (‘.acquire(Õk"�_ÙÀnal_locks()  ówith evt._cond: õself.assertFalse((‘.acquire(ð)) class ConditionTests(Base RCase)]1"""e`s for y4± variables.#+ ”def test_wšPªB0 = . atype();÷# Be default we have an RLock: the„scan be j§d multipleN4tim£_rv hreleas¤.ðlock = threading.³Û7 ú5ˆ-Ý6ÇØàh.ŸE_True(D -_(UiJnKr°9N* \? \ÄM#un pd_wait(DU. Raises(RunaError,R.X/) wonotifyyAZ{r_check_r£ññ# Note that thissð is sensitive to timˆA If:cworker¢së‘ð# don't execute in a<Áely fashion,@Cmain>@ mayz nkyLðare further along!7Øey are. The K+¸efore issue™îÁ) statementsØ ryƒmake surpit doesʧrace ahead™o·ÿ Se¦ lyæLrassumesc ÷ÌÇ not subjectióto spurious wakeupsö­absence of"½qan impléašU`detail:¸$ C„³Ðcurrent CPyth²0but€general,­Pða guaranteed property_ì0s a%@gramSHðconstruct. In particular, itÕspossibl¥t­¸0no 'erLbݘveniently¢`shouldK+ir% ever change�ÖUN = 5\“gy = []osults12Õphase_num = 0Bž'f(–x?›Ú…….append(S $–à = cond.wait()' écond.release()òresults1.append((Ê, phase_num)1LnacquirL4adyI@p1 = HKwait‘¬ 2c¬ æb = Bunch(f, NÄ b.uÇ_for_started�€# first #ø, to ensure all workers settle intoÅu beforeí@# we õtinue. See issues #8799 and #30727.4õwhile len(ready) < 5:Ñ_š±(g.clearóself.assertEqual)fs1, [] Ð# Notify 3 thJBs atu�ïn>&(3R ŸJ = 1Tãþ•3 ë ×(True, 1)] * ¦42Umake oawaken æÏÍÌ �5�à: they might bu"ir¥` or se‹±z.´ 5´2T´+ÂÄ2Ä8Ä5C + [Ö2Ö2ÈÖ 4 *# ãä Ü© ÜKnÞaa#inÝÔ#G_all‹ 3É+×Çã �v�‹ÇÆ(E, 3 åafinishæö“def test_¾¶) 0 = . 8typçd_checkA&†4# A”AtimeE/1 ernal stat – still ok_ »Z@out(/¼Àcond = self.Ãcondtype() Åresults = []UN = 5…def f():;Kx.acquirO t1 = time.lp1 = A†wait(0.5�$/t2A8lreleasy\òs.append((t2 - t1, )fÀBunch(f, N).„×_for_finished²òself.assertEqual(len(N s)>dfor dtk3 inus7Q€Timeout(6 °# Note that*°ceptually (`"s theö dition variable protocolëQ@# a çõ)() may succeed even if no one notifies us and before anyæM×òout occurs. Spurious wakeups can.;ñ This makes it hard to verifyÔ]l value=àIn practice, tJ¡implementa0hasÍs� HƒSFalseÐ!) «íPtest_0@for(/ü0 = . O‘state = 0M/Q >Awith¿ 0!�¡(lambda : b:==4â:”­6TruØ(ÕS', SEb = $1kb.Ystart-iúgange(466§.sleep(0.0UžU += 1T2�.·yµ¥Ó=�Þ_•…°YæSsGnû/dtøð,kout=0.iG hQ - dt ü (!) Ô{(£GNone^v!±# Only incr ! 3ýRs, so-ö == 4 is never reached ¸3ã#¸hƒf¶‹Oð), 1) class BaseSemaphoreTests(BaseTesñtCase): """óCommon tests for {bounded, un ñ} semaphore objects.=E 1defCó_constructor(selfnrñ .assertRaises(ValueError,  semtype, va = -1)`@&Ñsys.maxsize) K«~acquire§9m =�(…$m.9›©m.release( J2J`vÝ�_destroyåš 0delEø te7j7k aN = 10Ñùåm_results = []12€phase_nuÝ[ 'f(¥ p§.append(se÷¿.…+i '%seÅ*U2+Uöb = Bunch(f, 10n÷b.wait_for_started”¤while len(¸8) +b2) < 6$ß_QE¬ÊUEqualL3 + W¦2, [0] * 6™ÅßÅtÎi in range(7�åŽÇ/13È!so/Ä1Ï)ÐP + [1ÚÇÚ2Ú6Ú99ÚJä2ä¾P# The õis still lockedö@Fals`<)ƒ# Final =ð, to let the las ·read finishdpù0 ú˜µ’p, [Trueò�(6 + 7 + ,1)5Dtry_ RÔ se\.È(ï#lfþk R D`,G YÀse)) ó sem.release() ðself.assertTrue(&ñacquire(False)) -Ódef test_try_"°_contended(H!):*Z`sem = ¨.semtype(4u#m.C‹Åresults = []Iw'f(Z^*`.appen|O´'/÷Bunch(f, 5).wait_for_finished¬ò# There can be a thread switch between åping the‚¥aphore andâ"# Ç&®,20ref.÷ s will not necessarily beJ…ordered.‚ßÓEqual(sorted(SA), [2�] * 7 + [ < 3 ùÍŸe_timeoutó2óhðRaises(ValueError,!, ‘#, gO=1.0Gª ¯1o0.005)46�ib³1t =.!wÏ— þdLO - tTÖ|dt, 0.5ý�default_v¶ û #‘ initial +X is 1� ©È§+ñçEb = Ü12bæ1sta_~ $b.5€h3(cLwithZHU_7‹err=None)]™#J I[A0Ûlp_ Qq9nif errÁrN#Õ’{ëã½½4Typ¼o%, y1¢ class Sem1ªTests(Baseï1"""þ'ð for unbounded semaphorÁes. """ ñdef test_release_unacquired(self):'4Ã# Unbounded .õ"s are allowed and increment the semaphore's valueM`sem = b¸.semtype(1).c(�B’ class B¿S—ªTests(Baseö&ú'T for ÙP*ÒCannot go pas2initial.ðlf.assertRaises(Vk`Error,ƒK3/m.J4ù¤_gaarrier7^ OCaseXB2w objectU‚QN = 5ödefaultTimeout = 2.0È\setUp¶¿b_rv BN, tT= h8*oarDowne †.abort()˜±run_threads9(, W°b = Bunch(f®Wlf.N- fëøb.wait_for_finishedh„multipasf£results, nxMw�.parties`!ðtEqual(m—$ ¸i in range(`yö[0].append(True?$ gDlen(9¯1]), i * m5¹ U@y$0y(i + 1) Ь n_®fing, 0Ó#kQFalse.4gbrokenH¨+,8Wses=1áµxƒ that a 92 is6¬• lockstepþ>N¥ = [[],[]]& 'f(um΄>¤ öfä1_10çhŸÝQworksªö10 consecutive runãFbreturnŠ a,10—Ã_0˜ Fþ+ËT from„ÇM ޳sn r?ØTÀs.append(r) # úself.run_threads(f)ñ assertEqual(sum(results), Qange(EQN))) <ñdef test_action!):v5""" ¢Test the ',¥' callback#/}U = []!o>(fj/Æ.append(TrueÞ¡barrier = ¿4typÐ", V3jfe9f.wait(,€YA7lenA10+ ˆâtMObortLpat an a.‚ will puc©ñ in a broken stateh…k1lR2¤ 6tryô^io6(Sf i =›NN//2K'õraise RuntimeErrorÌ„ûnÖ1)FPexcepG%Qing.B@BDz¢W2WÁG ÂØ g¡Bpass~3 N•V1), 0Ä+ 2=?N-12n¯.~tõ4ØOreseØ! '.1' oÄ~a freesF„Cing Í Ù%Â3ïÚiÖp# Wait ÒlÓTotherÑ€ are allÄ6ZéáYwhileÙ4.n_<>N-1m=M·.sleep(0.00ß}“ “Nelse] P§ O$�©&­"9_±p# Now, nži again† #Ól3C?Â;Àqual(len(resóults2), self.N-1) ðassertEqual(len(res2321) 2ð def test_abort_and_reset(G!):$Y5""" ñ Test that a barrier can be <õ after being broken.=I–e1 = []"23,±.AtypeÂ&.Në'f(ÔØ6tryå2i =YOf.wait(J$cif i =,NN//2K'õraise RuntimeErrorì½nÚ1.append(True”Pexcep›‘reading.B}B¤z¢W2WÁG ÂM1Ipassüó# Synchronize andB4the[—. Must s)0firoL”ó everyone has left it when w ,i¥"soÊnLB`enters@pbefore —ãо$if­2½ -Q -yO è =šÑ3ÑC?`run_th'6s(fE<_1), 0+™,S­˜4/ou� -¦nS ë çO // é@# On!T• is late!uÓ¡—.sleep(1.N # Default &0outGQ2.0, ¥ iszshorter€·Rl"s(Ü,–~N�ÏV, 0.5T ASa´dÈ_ÈŠx•Lî3's >[ž7‡# create‚¯with a lowBÕ Þ-,uF=0.3òÙ:Q& Â5&r‘nk À of 0.3s.  øtime.sleep(1.0) ò"self.assertRaises(threading.BrokenBarrierError, bV.waitJFBrun_=Qs(f) gódef test_single (0!):"�@b = .^ftype(1_bo(°import unitgQ fromq 0sup" $gc tweakref„operatorDcopy bpickle\drandom^ärange, shuffle4„warnings¯collection5.ab™ðitertools class PassThru(ExcepC;`pass c`check_b#u(!rÒ@otyield 1\bBadCmpŠIŒ__hash__¢�return 1D)#eq's, othertÐx0Runz9p²ReprWrapperu‚'Used toµ÷ -referential repr() calls'}x¦Át.value)}`HashCo–“ngInt(int=ð'int-like object that c,ðs the number of Ó$s (1 is�(edžCinitžs, *argshä.f`G = 0Ù  4#+=‹QœDint.—þøÂTestJointOpsv # €s commonöboth set and frozensetÅRsetUpWCz—sword = ²'simsalabim(%&«madagascar&û0letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZNH¥1theU€G½Pdict.<Rkeys(%•Y€_new_or_Ú CAType÷,×~{, [], 2€:Qt()._s|__, a=1U uniquifica ˜`actual[Qorted&.s~pexpectes"d"  bEqual(S$, ;+H·  ¬E J<[]]1lenå mÂ$U.s), ,d)LŒcontainsQ‚for c inÙ®ît0's,=i> ùDs.__”[oðs = self.thetypeó([frozenset(self.letters)]) ‚assertIn&rthetype 3Q, s) 6Òdef test_unio3!):SAu = T&s. ¦.otherwordy‚for c in.gHLHœaEqual(0'u,8)d Gh E"s,x ì¡¢)#u);1bas(1óRaises(PassThru3ÿ, check_pass_thru()E œTypeErrorF7[[]ÊQCQ5t, úà, dict.fromkeyøÿtr, list, tuplet 'ƒ'abcba')Ü�C('cdc') t('d'ÌÅQ YefgfeS?efgU-9ccbSP-)efOö#q'), C('ìéOü\Õ# Issue #6573xu¨ODx¼r[1]), xo2[2]É4lf.H@[1,  ú!or÷i‚ã ÷þU@s | ‘ Å?, iÊ-:ì v @?tryë@IvVuexcept  >½+/lsHü fail("s|t did not screen-out general iterables"a in®?ecthq 'x?íoio7and5§dY†pi]?lf.p"w >V–(EcQZMVÀsection(C('e÷fgfe')), set('')) ñself.assertEqual(öthetype('abcba').intersection(C('ccbT/bcV4&efUS4æcbcf'), C('bag_¿ Os = ø"z" H)if>  == frozenr%):Ewgp·id(s), id(z›Oelse9#No¬ <hñdef test_isdisjointÓ‡#‡f(s1, s2ž÷ 'Pure python equivalent of P!)'k1¡return notc+s1/&s2+ñfor larg in '', 'abc1aba "cdeÈ!, {k, 'ef'!1¤Ï¾i{«rC_CÛFset,û, dict.fromkeys, str, list, tuplêJps2 = C(° Æ`actualö'1.Ÿp'µexpected = ÿ É) ¤i$, B�7RTrue(6@ is F or qFalse) �³Fpass+Òfail("s&t did€ü creen-out general iterables"o¯differencev %È:Ucö`lf.let+ Î9—01i, qd and cÇ"inQ5m,JToú:âialf.basô1ðRaises(PassThruLVlf.s.€, check_¸g_thru(Î�µJöKF[[]]ˆ`VÀtuple:  ñself.assertEqual(ðthetype('abcba').difference(C('cdc')), set#B')) NCTXefgfeVcW/7ccbUª4Rb§0JM0·C('a'), C('úYNÁdef test_subí!):»Ai = ½sñ–otherwordë ç1s -6?, i:`frozenX@ 6tryµ¹-z5lf.vÙúexcept TypeError>Fpass+:lse]ñ"fail("s-t did not screen-out general iterables") Qm—ymmetric_JY~s/ÜN‚for c in»lettersë0Ai, ( ‰X.d) ^FÞ)Hs 4lf.6,¥:`iûalf.basr1óRaises(PassThrun/s.&€, check_Ôo_thru(¿TU F[[]]œrCr5t, ´à, dict.fromkeyïtr, list, tuplX$E{æ…dÜ$_�?efgd<�2Á § ef½ –?xorY¤P‚ Í?s ^ &^Y¥û M z À except× TypeError: EpassJelseñ'self.fail("s^t did not screen-out general iterables") Qðdef test_equality(M)`€.assertE# r.s, set aword))N³1ofrozen7A == Rf, Falsel/No Pother?¥ 9 ¨? ) !­LTruegdsetOfF sBn…t = map(„ñ, ['abcdef', 'bcd0dcb!fe—fedccba'] Š—thetype(t.Ò�len(s), 3­Ìub_and_super«sp, q, r±¤m´¡º ÀŸƒ%o(p < q¢= ?q < ?> p_Oq >= po(q < r@ =! > A5¢'a').issub?bc'Ñ2$42per64È#3g?cbs3%5 haŒpicklingHñfor i in range('÷e.HIGHEST_PROTOCOL + 1(iCp = .BdumpLši«('du*gloads( "½°s, dup, "%sÙa%s" % ¾e7dupF1if k=)ƒ in25t, Ñ Å91q.x = 105½ç 0ë&pï!.xñ,.x5Ator_nÃ_protoÇ!qitorg =›^ ÀionB‰continue[dŒúdumps(it, protocµûL  1 - *%(Ø3,))$ðdef test_deepcopy(.)ÍÆclass Tracer!±ef __init__6w, value='T." =% JChashJCbreturnÌJBÄF¯, memo=Non”QÚÀ¢6+ 1‹;#&102s =‹W6[t] du:N.“&(sº#No=×id(s), id(dup6úfor elem in dup‚0new  ]t]2^-Dt , - -!gc1§õ.# Create a nest of cycles to exercise overall ref count check½mAæEpass"y`t(A() i§range(1000Ü!sR.ŸÇ\ªQsub =wesPset([,]1subÆÐ_with_custom_Û2ÅBug #1257731i=! H..^h¤´_Té $Þ@int([²elf) & 0x7fŽ6=H( f=Û0.ad› 3xIn(s, f-hremoveífA�f.discarVWЄabadcmpûÓó$lf§([BadCmp()sð# Detect comparison errors during inwáion and lookup/ÖðRaises(RuntimeED,ì%, �/, ‹L0.__fains__CHÍ ÂPmutatË op,Á if hasattr”W'add'C㩎=Àses(RuntimeE÷ rror, s.discard, BadCmp()) ô self.assertRaises(RuntimeEAhremove@Aðdef test_cyclical_repr(P!):"föw = ReprWrapper(}@s = -Æ.thetype([w]pw.value$L)if1 =AtlpRÏbEqual(•ö), '{set(...)}'hJelseB0namw8ð.partition('(')[0]fà# strip class 2¥…b%s({%s‡`)' % (>,D1)) GZ_print[Iöfo = open(support.TESTFN, "w".:try-ëfo.write(str(s[‡fo.closeõlrl+ I³fo.read(), ¡�nfinall¡„ækunlinkõ ‡üdo_not_rehash_dict_keys�an = 10¼@d = ,Q.from0 map(HashCob÷ngInt, range(n)< ö‘sum(elem.�c?P for – in d), n  Zdï \Ï.difference(X8€if hasatGÖ, 'symmetric_o‡_update'^h/s.-£9-d2ÒRdº8-d3cofrozeni\_, 12358 u;d3,ds {ýcontainer_iteratoañ# Bug #3680: tp_traverse was not implemented5Dset Mu object´Ð"C( iEpass*wobj = CÛðref = weakref.refFDÊÓ§et([obj, 1óqobj.x =�(/B0del°%, Žðgc.collect() ðV self.assertTrue(ref() is None, "Cycle was not collected") def test_free_after_iterating(self): )ïsupport.check_2r, iter,›ð thetype) class TestSet(ðJointOps, unittest.RCase)v>a = set±1basQdÅMinitµ*3lf.L!()4Ð0.__3!__5W.wordZpEqual(sÓ`+, J_otherO0T€ðRaises(TypeErro\q†, s, 2);Ö8;1);ñconstructor_identity�5 P†range(3)ºt#s°2NotYÌid(s), id(t)˜Pset_lP� �g–t([1,2,3]d€{}uOs, tm0_inTœion_orderõ# SF Issue #26020 -- Expect left to right IŒÀ = {1, 1.0, ¶§1len1ßÀstored_valueH.popÖê€(5lný e]/atþë¶expression B÷µevents = []»§record(objgk1b.appen 8G{9C1), 2 /3)VZ�, [1, 2, =[�ˆ\_hashó»‘1 Llf.sWMcleaAN"s.Ý ¾(['t(døæ)=K0ƒ-opÊ0dup?4 .c!‡?dup& ÍSf d(01¶œ$á4lf.ß À?add� s.?'Q'dcIn('Q'[…úW »‚0s, ¾=³—$[L, []ãoremoveæð'a') selfó .assertNotIn('a', self.s) &ôRaises(KeyError,Ï.remove, 'Q'8 OType9'[]8" =„ñthetype([frozenset(ŒXword)1±¡"In#;0(, Ó²-�\#R_ 52 O!) ’def test_aP_keyey¡_unpackingÂ!):.°õ# bug: www.python.org/sf/1576657*öfor v1 in ['Q', (1,)]IM:try²sA&v1,texcept "^ as eDåv2 = e.args[0]“AcÑËEqual(v1, v2j/lsZ;_fail(C O==key|G3, 4l q6key¦ =éUTrue(� is key,"cÿshould be {0}, not {1}".format(G L›)á ƒÑ|discard°1$s./'aA|ŸBƒ{/, „^z.Sh%' 2 ä`^d1pop‹$i#ƒrange(le_'s)%>Delem; s.J¾ ±Â1?+'9’ôôRaises(PassThru…C÷, check_pass_thru(ySŸTypeErrorT J[[]]GðcÈíÑbæá…“î. s|o=ž˜&ssp!tû:cbcû;, _̘/t)À¹ )&Íp-t)1and~øœ?s &›>»gÀ.assertNotInð(c, self.s) def test_difference_update((!):&*ƒretval =@.1µ.otherword):IÒ.assertEqual(Kf, None'‘for c in z.D" +nU�”"if2b1�and c notI< ;? ™(InOelse; ?Not>_ôRaises(PassThru…Eö, check_pass_thru()"QŸTypeErrorR O[[]]Ežsymmetric*, O¶@p, qpò(('cdc', 'ab'), ('efgfec1ccb!ef Gbc')k{XCU±set, frozen ÿdict.fromkeys, str, list, tupl«´öthetype('abcba'p`©s¡l(C(p))¼>B™Ct(q)p%s™defghihž�Ä‚8lf.þe–CCc'a'ºó|rb žcœO¤?), ¦)¥@FAisub¿Î0s -:t%ðþ²÷J (/s.; Fl`U ¯m#( clG) ^ hÓ÷+)iEÀlf.s.symmetróic_difference_update, check_pass_thru()) ñself.assertRaises(TypeError, Ÿs.symmetr\F[[]]Oòfor p, q in (('cdc', 'abd'), ('efgfeBcefg1ccb!ef …bcef')):©°^C[±set, frozen údict.fromkeys, str, list, tupleFJ2s =Þöthetype('abcba'Ê&!oEqual( Ï(C(p)), NoneLdat(q)) éàdef test_ixor({@.s ^ºt¦.otherwordl$c$"" +ì. Aif (3b28) ^9 @In(cÑFlf.s‘%?els…|:Not>  nplace_on_¤ÛtÎvs.copy(}at |= tMˆ=îÍt°?t &3-3m€» ^UèD|weakref-û‡gallahadþCp = @w.proxy(Ò Fastr(p)x'(sÝk ˜ €n#Re­s»pÌrich_compareÐòclass TestRichSetC( äa__gt__@§, some_setG¢àõgt_called = TrueÄ"ºreturn Falsklklk,/geÖeÖ,klk_ð# This first tries the builtin R set ÷ ison, which doesn't knowOÑhow to handleLòcustom object. Upon Î@ing ‹°mplemented,2N correspond,…0 on*c right[Å is invoked.C my¾²= {1, 2, 3}úRPmyobjo ÌÒ@!< -VÀ self.assó ertTrue(myobj.gt_called) ÷ = TestRichSetCompare()%aset > -Šself.assele+/<=f/geË+flfð@unittest.skipUnless(hasattr(set, "•_c_api"),+mp'C API .ò only available in a debug build'ˆ1def/](}%):aŒPEqualŽ0().`10), ñ) class SetSub -LDpass"&*˜thetype =J�4bas4setNJ÷WithKeywordArgså�__init__ã`, iteró=[], newarg=None‡SOset.6ï½ó ƒ"):ˆ<k§fs_in_s/'lf@'SF ®ñ(#1486663 -- this used to erroneously raise a TypeError'4Ç"ø1Ï FrozenSet(¾¥JointOps, ¥4Cas+²f:�x°–’�÷As = wX .Õ±[s˜k.other#FºW, setN®�õsingleton_empty_µ4¢Ff = – ef¼[,(8[]))().''×I@zrange(0|h… f±]Á„Ñ# All of the 2í÷ s should have just one idýäç¡0len³Ð(map(id, efs)©žq©üconstructor_identity¤ŠbFú&3)¯ti;�`id(s),Â,t)9Mhash€ %.’ž'abcdeb')uï7„ebecda')ˆ)ð# make sure that all permutations givpe same We valueÐun = 100±seq = [rand<À(n) for i inà range(n)] õresults = set()ƒfor i in3U200):<¶shuffle(seq6Rò.add(hash(self.thetyp/)1óassertEqual(len(Ba), 1) uÑdef test_copyQŽ1dup¿Qlf.s.!`!id?Ì.s), id(dup)dýfrozen_as_dictkeq²seq = list(Qb10)) +�'abcdefg'†['apple'pDkey1®ç?Lkey2!preverse»q= ] , B#Noe0id(+/0ed = {}� d[*e] = 42 ¶&l2], 42N�_caching{ºfé=Fcda'� lQS(f), qÜeffectivenesswen = 13ÎH^value5add! =r*ÞA€elemmask@Û[(i+1, 1<‡EF = =» efØ[,(8[]))()E''),y#' < +I)zrange(0|±…  x), f, FÐf¤5F)]Îa# All Oõ subclass instances should have different idsK4—@len(ÛÀmap(id, efs)Ý ð # Tests taken�m¬Ÿsets.py =! È2_se¨ot() #B," ·›BasicOps:i=repU"ifTÆ is not NonewX C/f.set),DY`check_*@_aga²q_values9Ù0tex*T¿PTrue(.ö.startswith('{')gª.3end,},[Presul{Tö[1:-1].split(', 'U(@.sor»"edáÙA = [Æa) for 2 in#sçD fU¾�., ;|YMprinÁ:tryÜpfo = opöupport.TESTFN, "w"ò²fo.write(stIª $Hclosž;frfÃò±fo.read(), ^!xzmfinallÚ.‹sçtunlink(ö Dalength—²‚S!lf; Q; _e?ityX.TSõ Õ¯equivalentV&• VcÚ}õÀsertEqual(seðlf.set.copy(), self.dup) def test_p_union( !):#‚result =;Uset | %4Ò.assertEqual(6p_emptyq/?setr'Ý_Iã_ä5¯_intersect[&[6xûb+ EtjózkŸsdisjointá(i,)ú5not¡ ýœ XH .,=?set…LTrue}Kx~}$?ÿ_symmetric_difference‡% ^O}$-¼�$>[¥ �÷-÷7wí*CwO_revé-Qó2_iteraJ…for v inXÀÄ¡ŸCIn(v—hvaluesõta0 = Ô !se2ð.__length_hint__i"leJB ¯�picklingd$ÇPprotoËarange(+÷e.HIGHEST_PROTOCOL + 19åBp = .À.dumps(self.×set, proto) úcopy = pickle.loads(p#ñself.assertEqual(Q>,P[ Û"%s != %s" % ;o)) #-:ø class TestBasicOpsEmpty(°, unittest.aCase):È‘def setUp«Êõ°case = "eT*"7"ºvalues = []0set%=4\.+lb?dup'ªlength = 0fBrepr¡oset()"`RŸSingletond<¤/Ÿ (number)l3mS1mQ{3}" @X1_inæ BHaIn(3, ñKset);?not? yNotIn(2BHP_TupleäFt^ã¿(0, "zero")ím‹'‹/')÷<Ç ¿õ<9BQ/ri?tUèßûï, operator.addS3Ø °bONone_S_tringx Àlf): ó self.case = "string set" #ðvalues = ["a", "b:c"]&0set5=A(8)'?dup'±length = 3 @Ñdef test_repr_!):MnQcheck’_against_¹o() #-:ø class TestBasicOpsBytes(`, unit¶.CCaseµÎ_setUpÊ“bTQ’b“b”/b"•þaMixedSÙ 7ð_warning_filter‚support.… +s(ü 9§.__enter__*=r.simpled±('ignore', ÈW‚ ` ÌOand DCBáNÝS4ÝoarDown9Æxit__(None, )R/'=: ñƒbaditer(ñraise TypeErrorÍ¢yield True39goo4 ‚ðExceptionPropaga ({ð """SF 628246: Set constructor should not trap ²a©Ks"""em…anceWith�ÉpassertRû%s(S,ã%, ! Å`sa?outdâ# All of these½Dbles×äload without e7.|I˜t([1,2,3][1t(()ð{'one':1, 'two':2 Šhree':3}+{range(3AZ'abc')ò ý changingSizeWhileIteratingj … Êàtry: û for i in s: Õs.update([4])úexcept RuntimeError;Fpass.:lseâself.fail("no Nð ion when changing size dur ÿiteration") #=:ð class TestSetOfSets(unittest.RCase)Ä@def Ð_constructor(Ñ A÷inner = frozenset([1?1out,¡element = 'V.pop(zió.assertEqual(type(4&),r3GAadd(k)¡ð# Rebuild set ofõs with .add methodÆGcremoveJ –-,R ()qâ# Verify that El workeahdiscar¬�# Absence¤1Keyo¡ indicatesG#OfineJ�BinaryOp \setUp!g=±(2, 4, 6)) DT#eq:¡ñ# SF bug 6431154W2set{Ý{2:1,4:3,6:5}l�union_sub‡9ÁPresul„.¹|¹'[2ª~6|ã äx?perz3?, 8ƒ[f3†moverla¯É ­(lfÿ3…5‚3O, 6]ƒOnon_‰30int…cY & à)f )ÿ � ÞË”3‰ ŠŒ‰â4€ „ðempty_set) def ótest_isdisjoint_subset(self): �result = V.set.3(0…(2, 4)))2)ÂassertEqual(C‘, False) )Ndef �0perSBƒ[ƒ, 6, 8]‰1overlap �[3, 4, 5…2Onon_‰&=Tru�ïsym_difference0 ^ ¹ â@É. - [6(, ~€ †+† †…‚Ÿ2, 3, 5, �?[8]œ  G? #=:ð class TestUpdateOps(unit .CCaseùMsetU†T"se“!t(sL, 6)Y_unionÀD|ØOt([2$ .,äqr´F t-µ€27} ê7*B_ò®H¦ù|5«¢ ƒš .ù¼method_callºL!.ux¸­9… 0intÁ/ctz&z¿* ‚/ z y�À.set &= set(ó[2, 4, 6, 8]) ñself.assertEqual(”set, set(5A])) 4ñdef test_intersection_overlap=!):)`L2 &=N3ƒ5€4z n~øŸempty_setó ¢method_cal4÷.$qupdate(V‰ ðsym_difference_sub]u�" ^„()x6� xp tþz�€8€} u|Ÿ2, 3, 5, ˆ‰[ˆÍ€µ � ˆ’˜symmetric9š,& Ÿ-Ÿ6 t› v›š{– z–"�{ŒŒ!÷ …«{/ /#=:ð class TestMut¸@unitù.CCasedOsetUýðvalues = ["a", "b>c"]#ÿ½.5 î¯add_presenj….add("c"ÞÀ self.assertñ%Equal(self.set, set("abc")) def test_add_absent/!):#>š.add("d")oasserti/d"j’until_ful�nQtmp =¨hõexpected_len = 0�‘for v in ¤fvalues¹½1tmp¸vN RE+= 1SNبlen(tmp), 9S 10tmpmw k¯remove_preo '?("brÚHÝ:try1ËBset.7 ñpfail("RÉ€ing miss÷element should have raised LookupErrorÐhexcept ŽKpass©˜_B\empty±¤0 = ½Ö³;4 C -CR H~d‹discard!(7("cRd¼ý"’I#A.' p “\clear·Jz«c Ò<, 0a=": "issuperset", !} 0rev$a = {"=8.==0!"!!<": ">5><O½<±�def test_à±bset(self):Îæ@x = U.leftyFrighÀfor case in å , P, "<"=>&="cg¥expected =AvNsw*ù# Test the binary infix spelling..òresult = eval("x" +aù+ "y", locals())6{ÂassertEqual(G$, § /“õ"friendly" method-name�ú, if one exists¬"if›!inã Su� s.2M 4ß = getattr(x,=[I]ºCÜ# =±.(y# @�# Now do¦s³“operands *dr¤) =Ã*¿ gºÝyÝBO+ "xÞ52if U˜*y˜^™x™"/#-:w class¢"`Empty(š·`, unit[.CCaseVI @"t(ÒE 5  = "both e]"û sX "Ù¢/ èS?Nonë$S[1, 2æñ÷ev_ pair÷o}÷'âñj,Onon-ö3NõEÀ TestSubsetPðartial(TestSubsets, unittest.ñ Case): left = set([1])Uright3, 2@name-ñ "one a non-empty proper sn¡ of other"Mñcases = "!=", "<o=" #-:€ class á÷¯NonOverlap 5 0neiê $, ŽcontainsO #=:÷ñOnlySetsInBinaryOps: …@def ÿ³_eq_ne(selfÂ# Unlike the»¡s, this is7ñing that == and != *are* allowed.eKZÁ.assertEqualk.=¢set, Falseo8!ses6D8,¦:p?Truo! "lf³", 7ßD±ge_gt_le_ltßJpÿñ Raises(TypeError, lambda: %Û< ® D°E%>‰0>‰3 ÚÏ  ?setÎ!DŒE*D+‰Fpupdate_9LatorJ2try¢D6|TëTuexcept o =Fpass+:lse\æfail("expectedJ+")Dº ±'ifEŸIsIterabliGset.DkíeŸV¼S,† ¹Lnion¸@] ³|_yDµ F [@Ë?À) elWse: ñself.assertRaises(TypeError, “set.unionqother) Fðdef test_intersection_update_operator(G)w6try ‹ r.set &=scauexcept ˜ =Fpass+làæfail("expectedJ"Ç ¾'if¤ŸIsIterablV9Q.ã)¹ ™7P.~,<�+ãÄÓr­‚ lambda:7ç fÀD9" &F6setG�'Ò–+� x6 ïsym_difference8'^8mÉS%�žsymmetric"Y¬+ÛzŒÀ†J' .Î'|L^vD9 FL()Ú¨+ÞŠ\ X1-Xm ÅS-TÀself.set.difó ference_update(self.other) Uelse:&ùassertRaises(TypeError,)- ;zset.dif|:›e–def test_KÀ)­n©‘ lambda: %Rset - d¸D9F6setC'if[ŸIsIterablV Ð�+y W,°_) #-:ø class TestOnlySetsNumeric(ðInBinaryOps, unitÍ."CCaseÆåQsetUp ›—¶ö = set((1, 2, 3)w$æQ = 196<Œ� = FalseRODict i0{1:+?:4} ?TruS�Operatorio„O.add -W_Tuplei�(2, 4, 6Y A-VoStringi_'abc'$ V?Gen>ÀstCase): ó def setUp(self): Ggen(ûfor i in range(0, 10, 2&*uyield iQ`€.set =sº((1, 2, 3))$�other = ~ÿIsIterable = True #=:ñ class TestCopying: Š�test_copy3!upÛ lfè.#Ü€dup_list#öorted(dup, key=repr);set);.ðlf.assertEqual(lenZC0), Rj È&¡)Í~bn]`[i] isËlK[i])%Odeep*!.$ M8 À##print typev0), * Žg¶W©¹ÊK[i],V/#-:àgEmpty(ñ`, unitì.3ase3)âà?) ¸OŸSingleton¼;€["hello"ÓÅOoTripleÂ=ïzero", 0, NoneÊTuÉ?()ÀS0Nesšòù/[ê’), (3, 4)˱:=Ò¿Identities(ÃÀ def setUp“(self): ð.a = set('abracad*')$b$¡lacazam') "ü def test_binopsVsSubsetsj2a, Dalf.a, ybB‹ûassertTrue(a - b < a‡#Ÿb - a < b#?a &F #F _| b >Œ "a #F ^Œ+ <ßcommutativity:&ßEqual(a&b, b&:#|#|# ^#^#–if a != b> º3Not`-=,-aç�summationð # check that sums of parts eÖ¥ the whole3Q”`(a-b)|¿)|(b-a), a|°1&1/^b+aRƒby'ª,u¢ÇÓ,)ü/\, a^b˜œexclusion{ —Âinverse operÆù show non-overlap�a, zero8ôü/t(µ®Å?( Ð"&ag( `a&b)&(ø,ò # Tests derived fromÇïitertools.py = cR(seqn]À'Regular gen/1or'�for i in ,Jòyield i class Gò 'Sequence using __getitem__Nw�__init__¼]„Ÿlˆ!qn…7L:i»7Pretur¥0lf.>4[i]œIœ8ßator protocol¢*„Wi = 0µgì¯,4nex,"if}ri >= leôåð): raise StopIt·"io2�vCž]oU += 1Fv;g<ü defined with aEÀ÷Àseqn ð self.i = 0 def __iter__(!):¢for val in6Fseqn"Pyield$’ class X õ 'Missing __getitem__ andk'e}3nit} , dƒ’.! =7z Ç4nexJD"if¿�i >= lençUõ): raise StopIterationdvu!lf,[r]U += 1„return vN\Eor m¬) CÑŸº¢E¢±Test propag� of exceps¥eê%/»Ûd3 // 0ÌSÌïimmediate stopÁApassÎvG¢ `` from \ðtools import chain y L(óè'›àmultiple tiersž@Cator�ÜEò(map(lambda x:x, R(Ig(GVD))))2[tVarious£àArgs(unittest.!uCase): Á_constructorP­78÷(set, frozenset&*s'ô"123", "", range(1000), ('do', 1.2)Ë2000,2200,5)PTgTÿG, I, Ig, S, L, R.2Tð.assertEqual(sorted(Äó(g(s)), key=repr), )OWReÐs(TypeError, \@ , X^:"N:ÊZeroDivision|EB}tÖìinline_methodsÙsÆt('november'öõAdatazÎ$c, 'decZÌM_–_ós.union, s.intersect differenceªsymmetric_œisdisjoin‘ok A>°expected = ¡(Qdactual(g*+äif isinstance(co, boolÆfsÊsÀ, expected)  oelse: óself.assertEqual(sorted(actual, key=repr), ‡expected)_Wÿ Raises(TypeError, meth, X(s)9"N9ÉZeroDivisionzEA´ðdef test_inplace_œ@ods(Á)7ô!for data in ("123", "", range(1000), ('do', 1.2)÷ 2000,2200,5), 'december'[‡_zAnamecô 'update', 'intersection_½:µ'difference2Î 'symmetric_ �V”g�ÿG, I, Ig, S, L, R.2þs = set('january'ß't'o.copy(!’getattr(s+�)(list(g(…)8Y8t832æþsÝùt-) PLó› ¨ÜY>N5Y3ºEaÒ class bad_eq=aa__eq__Sw, otherA’if be_bad0È«set2.clear%rO ©Ýpreturn Ž2 isoŠChashŒ…5'0 ÂQdict_‚š@ÊHËr§+ðTestWeirdBugs(unitÌ.CCaseá¹ñ_8420_set_merge�#rñ# This used to segfault< cglobal­,é12, Ý#É… = False‚set1 = {8()}2 uiuY'75-^8Tru]Áw ­"1.< 2ÀWµæ ½¾ #f: Noneæb ¹?t1.”(S©Äðiter_and_mutate(self): ó # Issue #24581 ös = set(range(100))x.clear(oupdate/¨i = iter(s2 Da = lissa6Asi) ¢ðdef test_merge_and_mut�aself):%ævclass X>›__hash__(1 preturn %&(0Ó?#eq=7, oq!]otherD^RFalseÒ4”sä{X() for i in ´%)}ìÏ'{0.PBñ) # Application@ÿs (based on David Eppstein's graph recipes = PpowerXUð"""Generates all subsets of a‚ñ or sequence U."""ÕUTU6tryÉ x = frozenk’[next(U)]*N+S+ �qyield SlA | xÐexcept StopItÃ6ion….‡)gcube(nþJðof n-dimensional hyper,ò�singletonÌ[X2[x]üxÑü1n)]¢L˜dict([(x,1x^s3s7]]éõ0_0hVÚAline+(GÝÑ, the verticeÙÒwhich are edg!G,±†with two/ñbeing adjacent iffOÑcorresponding;K shWa@%ex=RL = {ÿÌG¬yFG[x]ünM o#,zqz2¢ if z != yw8Xny = <y<%y]<x<L8ix,y])]ÖRnx+nyÒæLaUfaces…"'R­L!f ¹¡. Where a4 isrf?®an that"'hð # currently limited to tria¡ñ s,squares, and pentagons<fÂv3v1,³in G.items(AC$2°à œ3KG[v2¹>ºif v1 == v3:�continuež:”?[v3Z(gf.add(ŠÍov2, v3FOelse†È/4 n r–4Ð2J%Øð if v1 inŸ G[v4]: ÿf.add(frozenset([v1, v2, v3, v4]))?Oelse] �or v5 inŠ¥ if0b== v3 < 2f 9�continue±%f1–5  0( D, v5,ðreturn f class TestGraphs(unittest.qCase): °@def ¤_cube(self~Ag =  3)Æ# vert --> {É}b5€ices1 = îgÞsõ.assertEqual(len(0B), 8{q# eightiK\€for edgeYªg.values()»e54), Ûa# each`ñex connects to threedsv¢2Ò$v ˆs‰vpsùS 0ertåQ2) #z˜J€originalLÇe©�faces = (g 2D), 6g2six?ìÚQ{3a4B), 4ZÉa is a squareÁˆ­octahedron‘ð # http://en.wikipedia.org/F/Cub=Àâ# 8 triangularÝc and 6ƒ0Æ12 identicalz Sing aV!leNÏ�=[c¡€ = lineg£#(g&:õ"V(OæV1, V2, V3, V4SÓ _å), 12)# twelveÇpgqà =³þ»ÿams m¦four other²­ ¶›d | Ȥ$Ç,‹,Šs£�oì� ™~%!iz¸÷ collections.defaultdict(int1oÅÊTA �T[Ou)] += 1× @%s3%3]vŠx A IÀssertEqual(fòacesizes[4], 6) à# six square f$" õ for vertex in cuboctahedron:%-dedge =,8# CA-Pices yAseICube[ðself.assertEqual(len(/C), 2ÅP# Two eV define an - S×@cubeÛt! оy4In(0Ÿ, g) #=:ò if __name__ == "__main__"™�unittest.¤() import  T.mock80sup2&os T.path¤contextlibDsys �ensurepipñ ._uninstall class TestE2´PipVersion(³.bCase):q@def «£_returns_v2‰) ˜•ö._PIP_VERSION, J$))›—‡pipMixin‚ksetUp(sõrun_pip_patch =wg?Fch("o_0%")wQ.3 = Q.start(-.P_valuc0S¼addCleanup(T2op)Y5ö# Avoid side effects on the actual os modulóreal_devnull = os. „"osÃ'osHQed_osWDám0.stÜ×MŸa»®*ó|¾h"§×os_environ = 43os. `.copy(óªBootstrap(f,8ütbasic_bBLping�h'� à 8P_callo•nce_with(ñ2["Êâ", "--no-indexÍfind-links",9Ý€ð.ANY, "setuptoolsA;pip8]GCfРadditional=hH ùòµ_args[0][1]C% N MZ<•l“E__root�(Ç="/foo/bar/"Ç�­IÀind-links",  ûunittest.mock.ANY, "--root", "/foo/bar/", 9À "setuptools+;pip%]4jS!) @def Œñ_bootstrapping_with_user(self):,Ž¥ensurepip.1((S=TrueT(7P.run_+ñassert_called_oncea(V2[€"installë¢--no-index«find-links9÷a§=D[opgradeG+J‘ªM^¿verbosity_1Q//=1šŠvIh2I2I‹Ji3J3JŒK_ƒregular_öO)4phQEqual>õ.os_environ["ENSUREPIP_OPTIONS"], cŽ ?altœÀp(altinstallƒ=True) ñself.assertEqual(ñ os_environ["ENSUREPIP_OPTIONS"], "altinstall") Nñdef test_bootstrapping_with_default_pipa!):3„¥ensurepip.8(/¯oNotIn(Ÿ+, Ä ¡¼™œ_conflict¢ÂS(÷Raises(ValueErrorÎÒsÑ/, ãQFalse�@.run>|.calledÒ4pip±ñment_variables_removedE¨%# xó deliberately ignores all pip V V½õ$# See http://bugs.python.org/issue19734 for details< ¥ ["cð THIS_SHOULD_GO_AWAY"] = "Z… fodder"CÄ<Û,b2`°ig_file_dis_W1theWM MÎM_20053M å°CONFIG_FILEãó os.devnull) @contextlib. €manager ø@fakeŸ–(version=�_[sVERSION�3if († is Nonet=7elsãclass FakePip(Ns#__UD__ =aEX;òsentinel = object(=@origÎð = sys.modules.get("pip"/:0%[!²1pipe6tryÞPyieldgfinall5if |4is  @Ê8del—rQ 2Ÿh" UcTestUnÓ$(E•°Mixin, unit‚.'kCase):õu<ó_skipped_when_not_U…Y; ÓF`chelper«àÃ1O¯¨@warnµ”for_wrongT @ »Ä"not a validz"Ì2Dòsupport.captured_stderr() as òå À¹T´ðvalue().strip()# ÿ,self.assertIn("only uninstall a matching version", warning)DaFalse(Uñrun_pip.called) 0•def test_e.!):•�with fake>(`ensureWA’_helper()b' �Þ_ˆ`_once_d(r2["¢a", "-yÓ-disable-pip-`-check^pip",I«setuptools],¼«Ï_verbosity_1/6T#=1~ö:d/-v@T2@@2@qAU3A@3Arvž"Ó/ "à ðpip_environment_vari;œs_removedI%# Þð deliberately ignores ’Gpip V VKõ$# See http://bugs.python.org/issue19734 for details<þ$os¸ð["PIP_THIS_SHOULD_GO_AWAY"] = "È… fodder"C[¿$q†¶!No—‡!, ,²IH…Ãconfig_file_¿|@the |M Mór_20053r/;QEqualX.ÆàCONFIG_FILE"],ð) os.devnull) # Basic testing of the main functions andó8ir argument parsing EXPECTED_VERSION_OUTPUT = "pip " + ensurepip._PIP_)ó class TestBootstrappingMainF|$(E<°Mixin, unit­.7ñCase): defÆ$_bLñ_version(self):&*Awith+ò.support.captured_stdout() as 7;O÷ .assertRaises(SystemExitg0þWS(["--š5"])–ƒresult =xö.getvalue().strip(+�bEqual(</, Œ:QFalseü.run_pip.called)P!V¢7ë¸exit_code =íï]Q ºoC_v`_once_›(2[ò"install", "--no-indexÍfind-links",9;ðmock.ANY, "setuptoolsA;pip8]GCfæ@addi9€al_pathsÕ9elfhµ_args[0][1]CØLlen(MO), 2Ñ3‹3, 0“Äa_error¶ ψ¦qreturn_ŒE = 2®jõ¬NÖ9Ê#UnÜa?,uM›"._$¢Æ @ÆP fakeV((þ 7M7>bê!-yÄ-disable-pip•`-checkÁ 4Êzÿ ¢¤ž^ n »Àalue = 2  ôexit_code = ensurepip._uninstall._main([]) 3õself.assertEqual(Dñ , 2) if __name__ == "_DA__":D‘unittest.Zñ ) """Tests for HTMLParser.py.""" import html.pdpprintX÷ class EventCollector(A.g1): – de¶pinit__(ãâ, *args, **kw)» .e[as = []>—append = '.)‰?.__~£Bget_}¥˜ò # Normalize the list of .õ so that buffer artefacts don'tœð# separate runsAõcontiguous characters.2LpprevtypPENone'Ý‹8 inYD:)&[0\2if &= es= "data['’L[-1] = (!!, R[1] +'[1Õ6Jelse�L¿(•ˆ›íýE = L‚return LÐò# structure markup‹ñhandle_starttagíÇ, tag, attrsùmc4(("2".)Z?end]5` &¸±)O)¨¿# all otherscommentab+1", 'df×?refLoharrefLcI(F?eclF?eclFoentityÚ-P/pi”/piB—unknown_dÙ?ecl´0 0O,\ÚjExtra(î×L E.:Ú…r_text",𻞠()ð­CgsÖ¼ðfail('This should neñBver be called with convert_charrefs=True') def handle_entityref(self, data):&*ÿ.fail('This should nesô class TestCaseBase(unittest.&):œàget_collector(„“Õreturn EventC% ðWFalseð¡_run_checkQð, source, expected_eR5s, zW=Nonez&if@ is :+/;0 = ·.Ê)-†parser =Qƒfor s in¡ a8|.feed(sOv.close(Ò3 = 7Ž%2if < !=  }Ò ”"received;Õdid not matchF5" +Þ&A"\nS‡Â:\n" + repr(™)5 E´7ûpprint.pformat(ÒJ RÉJ)Gl_extraM184|ï,, ßEkä3) bQHTMLPZV( uc|ñ _processing_instruction_onlyØü È6" >Y>", [×�("pi", "0*")]¿t/ ?v/ ?x¶¿simple_html Ð"" <š">&mò; sa±Ù text 𠇏U2a-- t2I•/Html> ""· ("±$\n%`("declå+0ata+?€starttag n]ú"("0ref OÂ&32¥$+ O1a\n[ $\n-b_ Å imÌ`[("srcpñBar"), ("ismap",)㯥 \n¦!溊 ðcomment", "commàent2a-- --commöb"), ("data", "\n`endtagFhtml,1]) Hñdef test_malformatted_charref(self):)uõ._run_check("

&#bad;

", [+/s("start’p ]¿ÇH³&("Óp%])kö,# add the [] as a workaround to avoid buffering (see #20288E Ûe["
Hÿre_pointy_bracket·!< ¹>¹r< bare>N$< O IÍ ë`_end_bŸ?ary…Ð""""­ WW (";g"<")]) ÑL>L>LÝ&FŽ_artefacŒ0outN?= [¦ X1 ¥[ð2], R© a »#31V3=h‰3!'<5>>ÌÀ b='<'", ">"Ó], output) ð = [("starttag", "a",b e>")])]3÷ self._run_check([""ca /W3‹f b=h™•5Ì3'4 ÿ/bpcomment-Oabc"U %™ ¬-an-entity-ref;Ä!"<6!='œz tag'>"[ñ '

"y'aSCRIPT*'0<\nOJ pü@docu÷‹.write("~ ); :õ('\n//<\\/�P>\');Â<]]>Ö1'\nñ//\nvar foo = 3.142 +\n’1sty�/le‘X`\u2603G Eð# these two should be invalid according to)_j5 specuù# section 8.1.2.2›#¬Bˆ" !‡0ele6R')3Pstyle œ ATYLE è &M Ü%v% %ð _lower = element.lower()  ðs = '<{element}>{cont & ¬-an-entity-ref;=Dô

>õ''"""&¹‰y3[' +2, ' D ', & '�š2'\n10 \n F\n']…9 I$ =Y.Yš().strip(¢=`:TÈ2ú.=* /("&³„�= ý (convert_charrefs=False)oÈ `‚html = (ô¸I'm a validúƒ†'#µme too!-->'¤!/-- 6ÿI have many hyphensK  00a >Ÿ`middle¶›D and8*--7!8Ëãexpected = [('_', " 0"b:';',/--'%#--,\À--'),  ù('comment', ' I have a > in the middle '), 8 ?4andC*--BU! ')]Cñself._run_check(html, expected) )ðdef test_condcoms(7!):€6ð = (''@D@48]>o5n©7]>pretty?8)nÞH = [7"º¹"�JÄÁ@ÏÁ*Ívert_charrefÉù# default value for con4Å is now TrueTô collector = lambda: EventCCs‰Fp.assertM(E<().v6¼¿p'"3C" 2x22 Fx22'þ!# ö S l!ofzõtext/attributesô H€starttagh0a',[@href¯foo"zar')]<0dat5Õ'a"z'), ('endM°‘J×¹‹GXÕ@'a Ó'.format(M¤Yö%, ¯= &()¨ ]!atOïbeginning/end d&"E‡x„3A ('y Xdz /X"˜? –§’W¥#ñ{0}{0}{1}'.format(·Ÿ, charrefÀWõexpected, collector= 5())ˆ!# µ¤ truncatedañs at the end of Efile:öhtml = '&quo &# &#xßðfor x in range(1, len(35)):Cª >$u[:x], [±/)]¶Lâì õa string with noó™ •'%h here'Ÿ© ¥|#g`remain¡°tests were R�÷"tolerant" parser (which is nowGÀdefault), an×âeck various kiÖÑbroken markup<@def w_h_g@ing(½ ÷<§ ð>te>>xt&a<\n#±ó'", []ã ©A"'", [('data', " "$>9ÿstarttag', 'a$', []: b;b</=5end{@( A>€uôdef test_slashes_in_,(Ž!):( �'Åp"var"/>!('=ñ0foozYvar')yõhtml = (''•Ùexpected = [(‹ îYimg',"1[('Õþ’902'), ('Ýà*')4 (ßáFÞq', Noney(ami ³1 (' ²4re*]/) Ù$, ;Mñ@a / ž/=1bar>ò<0­¨3› #=æ©4bar]¥OšçLšAõ#see issue #14538L[`meta><4 /  b1///€fQ]~@A�ƒ†)žMFØ3‡ÿdeclaration_junk_charsŠ  "',  ð$[('comment', 'spacer type="block" height="25"')]) Fñdef test_with_unquoted_attributes(self):-1Å# see #12008 html = ("< õ>"<UÀ" software-and-i")Åexpected = [$ ('starttagål', []),&Œ&#('‘;”`'), ('™›)O ­'q›€ºP0_ÐÂ1Ê000%� R é trÁ˜ d$!('üYÿY 7"6/-14Adata ¾†0[('C#FG7E{i;!en54 ('p {'é3end PÐa1Z-Ê!1/�\u , ü.Åô�ªI¾6 ('%{']š¤À._run_check($, G ë(Ÿa_betweenë Vð',8 €|)2[('¥‘ §£ ˆ: ¡(',', None–¶O¸Aßeird_chars_inK^_valuQf ¡bogus|&#()>1Q síÿinvalid_end_tag&qA colle,ð of broken end 1õ .
is used as separator.lðhttp://www.w3.org/ðTR/html5/tokenization.ó#end-tag-open-state Å# and #139935ò = ('
ó div end tmAd-leaderBoard1

yignored�5],ðself._run_check($, w!) )°def test_broð_invalid_end_tag(E!):+2`# Thisšðtechnically wrong (‹°"> shouldn'q G1 inxW'dataP# butP�probably ƒ�worth fix“ itŽP addi q to allN‡cases of …�previousÚ`, it w“ö require a fullMgsing).I?seeP@'1"> confu�‚Varser;víì (/0, 'píÃb%z?, '¬):%Ðcorrect_detec¢A_of_›BsCZ/27ª–€style=""r>möe rain h2ò C¡n Sp- §‰¢K ÷•,±0yle,')ª 2báÙðe '), ð ('starttag', 'a', [('href÷some_url')]), P('dat.m'rain'5endS ; 8�= br‘}? inEOspanD /Sp C Å¥ÇUdiv');] õself._run_check(html, expected) )ð = '
The žU'PcE = [Ú ¸ s á'), (',', None 0foo?bar"̇b„ ¾FAlšIšàdef test_EOF_iÅ`arref(×%):XÇ# see #17802AThis? ýðs that the UnboundLocalError reportedë"WissueLñ is not raised, however I'mAsureZ÷ returned values are correct.Oð Maybe HTMLParser should use ÝÐ.unescape forYs�ØW a&ý2/a&.!a&$'b' O™centity¹b‘¡ J;J'ÿœµ¢rÿW5é O^|_methodPPfrom v0 im 0Â2p =¨æget_collector(ƒBwith"ðassertWarns(Deprecation7ingÆÇ„ñ"""f&#bad;k8èjuEqual(pBE(s),Á3(s)õ übroken_comments a= ('8µîç   XÀ ('comment',÷ ' not a comment either --'), #('#ÿ', ' -- close enough0 M ô<-- this was an empty‘: a!! ano±Tbogus5H !!!9]Êñself._run_check(html, expected) )ð def test_broken_condcoms(>!):$„# these À are missingò '--' after ''L‰ò = ('�a—DÿIE 6]>foo IE)°startendtag`', [(' =')]ß‘(1’ im™a[('src�V�<}�b¼>foo@\b=' ÷[ Ù GGß%þconvert_charrefs_dropped_text)ñ#23144: make suaat allªaevents@åtriggered when¨# r  is True, >² if we don'C! .¡("ùðr = EventCollecó tor(convert_charrefs=True) õ# before the fix, bar & baz was missing0ò parser.feed("foo link;@amp;?"eõself.assertEqual(O†SÙget_events(),!°[('data', 'rà'), ('starttag![])”'He ('end4 0¼¸5')]~ô) class AttributesTestCase( qBase): 5ðdef test_attr_syntax(ÿ!): ð¥output = [D ("ÑÀ", "a", [("b v"©'"c d ¦e", None)]pÁ{ò._run_check("""""", ™G=Q b = @1 = B? = Dá\nb\n=\n'v'\nc a"v"\nd ?v\n‘€\tb\t=\tM!tc M!td ;v\tMu ¨lvalues¨ÿÑb='xxx\n\txxxE yyy\t\nyyyN‘'\txyz\n'Tmõ [ñ_"Á F (&‘A[Ã8")]V"ð&à rÁ# RegressionWõ for SF patch #669683.e ¢ú"Y? ‘W![(‰"A ¿bug #921657ž·‡—ü href=mailto:xyz@example.comº ®0AD½w Œnonasciiñ# see issue 7311;® iÿ"\u4e2d\u6587Ó�',Mñ[("starttag", "a", [("_U a)A’  ("…@‡ïŠðdef test_attr_entity_replacement( !):,iú""¿b¼c&><\"'š «¿funky_names¤ÿa.b='v' c:d=v e-f=vš!a.œ v"), ("c:dª3e-fM ³Yqrefs_inlOibut»E foo='€jÿ#97;a&unsupportednMq0foo»™\u20AC&aaGƒ Ñ/„2…r*ÿ$>' %[ ç;pHù&ù1 x¹0='%s'>"x_/%sv< \Ÿmalformed¥àA3357>1N: = -.cð 'style='color:red;bad1'>0 - U"SW B+C2B2B o G(d3H3H! =1'JG4' Ö4LhÉexpected = [õ$(' a''v@', "/KÀ P('datA'7fð'), ('endtag', w'a'), ý,('starttag', 'a', [('href', "test'+style='color:red;ba2'")]J0datA'7õ - bad2'), ('enda 6€ O\xa0ƒ/d3„3„H4„4„‡] ñself._run_check(html, expected) )@def bð_malformed_adjacent_attributes(L!):2ïÅ# see #12629$pú''1M[>x> ,3y60('z€'­o""', NoneeF\_x')])ÜÛhÚ)ÛÈñ 755670 for the following 3s,*  ÿ a width="100%"cellspacing=0 "Òo", "a"?Q [("e*g/l@","0k]ýø«ÿid="foo"class="bar"¥9 id¢a¡f!",g )]v pvmissing�l_value”É/v=¸Cv�&ù—javascripŒ@"å/[(uÐxô¯end_tag_in€ Lq1745761Ã` ÿ'http://www.example.org/\">;'>spamó TESTDATAFILE = "N,a]TÉEtxt"'0URL&–Ñ://www.pythonâCnet/L/" +mA + "t´ def check•(MRfile)SQhdr =D±.readline()qmreturnlõ in hdr class RangeError(:^Bpass…sNFC(strX<€("NFC", "0K1 K2Db Db1 K2punistr(äÈ ð = [int(x, 16) for x in Á.split(" ")]Q ‚Ùãif x > sys.maxç#WraiselOHë"".join([chr(x„Y© (.�4Cas7)S(selfñŠ´# Hit the e)a early“":try½L< = ›(±õURL, encoding="utf-8",TX æ=ìÄ5©p Permisœ¯ ¤æP.skip 6(f"- eÝÐ when downloa¤' {»?} "«af"into4 ½ directory"©1(OS¢), �…Ö²ú fail(f"Could not retrieveŸ5")  Awithó“Drun_›«_µs;3K%+›,d¸µpart = None� 1_ZV = {}©.ŽOƒ# °`if '#' ( #0 = Œb'#')[0Ž"&Ctripÿ!ifZ'cvcontinuÏ2.p.startsq‡("@Part" )1 ¢'i k*Ð1,c2,c3,c4,c5¡» oš';')[:-1]6àý“# Skip un�åed characters;â•Ð # try at ûleast adding c1 if we are in part1 !ifp == "@P#-":%4?tryÿc1 = unistr(line.split(';')[0])Qÿexcept RangeError_OpassD?lse7 þrt1_data[c1] = ÿ™continue _ê# Perform test{ðself.assertTrue(c2<† NFC(c1) 2 @3),   J4>4>5>3>Dˆ5D(cˆ?D(cˆ5Jˆ?D(cˆÆ5NFK ˆ\h;*3ü € ?5),> bÚ5NFK$ œB6œœ #‚# Record€ 1 ¨ !›Ö äE Çê for all otherpc&r�ú(sys.maxunicode+1)ešX = chr(cÑ@if XD” 7ëq  Xe3C(X D KKB, c)½1def¯À_bug_834676(Y¼q# Check Bbug &0ðnormalize('NFC', '\ud55c\uae00') if __name__¤“"__main__5@unit3.ð() # Copyright (c) 2004 Python SoftwœñFoundation. # All 1ðs reserved. # Wr[ñn by Eric Price #Zóand Facundo Batista “3‡ð] # Tests are built arœð( these assumed context defaults. # test_main() restores7” original6ó. ORIGINAL_CONTEXT = { C: C.get^ð ().copy() if C else None¶OP: P+ð } def init(m): >Ñnot m: returnDºîCÍC= m. ($± prec=9, Bing=–Bñ traps=dict.fromkeys(Signals[m], 0)L6m.s߃Ð) TESTDATADI©€'decimal\ñdata' if __name__ == '_s2__'ìðfile = sys.argv[0] 8  __&1__ Vðir = os.path.dir\(!@) orñcurdir directory =ëPdir + hsep + ¸ð skip_expected = ˆleisdir(W)}ñMake sure it actually raises errors whenIXñand caught in flags # Slower, sincPðruns some things several times. EXTENDEDERRORЀ = Falseš)ð extra functionalityrñthe C version (-DEXTRA_FUNCTIONALITY)` p = True£ò hasattr(C, 'DecClamped')øˆ‘requires_‰_‰`= unitÔ.w`UnlessÉŽ0, ") Qìd with ¿"")Ì/if|/Ifxrregular€à") class IBMreCases(ØÙA"""C.Qwhich–rD6 LqagainstŒ1IBM( cZQ.""" Ÿ5£setUp(self`=.‘YCelf.•-Ü.Oread2°ignore_listýB'#']—T0# LoÖ�dividual „Í idøñat correspond toäM`we're "`ping få�ne reasonó…another.410ed_7_p`= set(©Xð# Skip implementa'ò-specific scaleb—_;�'scbx164'Ü65',ð# For some operati÷'ons (currently exp, ln, log10, power), the decNumber ð # reference implementation�oses addi al restricAs onX{contextVúand operands. These?ñare not part ofL�specific�;SrhoweverÎTeffec8 [ódoes show up in somec T€testcase¤…We skip Ð that violate  h{, sinceSñDecimal behaves difa Ffrom‰C forWt"so V!ùwould otherwise fail..¯'expx901',235/ln[ Z YX/ogYZ[ \}powx118/4ä.40A Ž`?400�O4008x/10x1À5]) ù“if self.d–U== C: ¹# status haìùSubnormal, Underflow9X2@ped_ ÿ_ids.add('pwsx803')151`# Corrè£rounding (q<Ó_, toom{owx4302nÐ 2Ñ24d4dÿ# http://bugs.python.org/issue7049dLmx32dö w1'6'OB# Ma"0 dišiãÒto setter fun’aò ChangeDict = {'precision' : c!_ »¨' ?_methodE ¼maxexponentHDmax_E $in) E/inE\clamp?}Êð# Name adapter to be óable to change the Decimal and Context ò# interface without;1ing=õ test files from Cowlishaw.Dðself.NameAdapter = {'and':'logical_,1| ¢'apply':'_ . òclass':'number_4 Òomparesig':'c �_signal';Wtotal=<(maz=_Apbcopy_d̰@pyab!6 eanegateà3py_8D6 4 Âdivideint':' _ 6 Pinver3U7 `scanon‡f':'is_:Afini3is_ 4#in*m82nan  .1orm‹Bis_n 4qZ– 0ËeÆ!is'/edw 5issd d#ub¿™s:Bzero1 0 0maxj_:'maxt3min0/in0€nextminus _ – *&pl5 4PtowaršA_8 'or�/orË Preduc Ÿ?ize2 mainderneal#re_Ÿ àsamequantum':'_: €quarerooOsqrt© @toen‰ßto_eng_string5)!gru to±e__valu$to>Hx':'?Oexac²2sci9=sci²À  ð'xor':'logical_4} õ# Map test-case names to roundings.,cself.RõDict = {'ceiling' : ROUND_CEILING,8l V'down5ODOWN2 Vfloor3_FLOOR4 Zhalf_k_HALF_p<7eve§<?EVE¬<&up®:/UP° 3.(050N05UPÛ!heß ß†s' errorç¢the actual ïE/Ní`lamped×’decimal.CÞ ý'conversion_syntaxGÿInvalidOperationP AdiviN}by_zeroOD!oByZeroM­impossiblePŸ$undefin7Qinexact—à i[_contexE{Noª•P�overflowGOÝ ­`­/ed= �subnormal}SA à¾2UndØ —ðThe following funcìõs return True/False rather than aP2# Dw› instance¤LìFZÀ= ('is_canon'Ñ ¨1ofinite./in0?nan[¡·qZ0sigšZsZ>åĉâsame_quantum')Íðdef read_unlimitóed(self, v, context): ñ"""Work around the limitations ofõ 32-bit _decimal version. TheKñ* guaranteed maximum values for prec, Emax etc. are 4250,H¤but higher@ñusually work, exceptUrFØcorner cases.IôIn particular, allÓûIBM tests pass with´Haof 107©e00."""0if _.‰== C andÆ.MAX_EMAX ==ó†�FCread¥À._unsafe_set:(�)~9 Oemax9$Oin(-sbreturnã³dcreate'&(v©JelseðD=".D`(« ìÓdef eval_fileÐ Êñglobal skip_expected<$¦ ‹�aise unit•.SkipTest>Qopen(tZ as fBß|line in = ÷.replace('\r\n', ''){>a#printB :tryŽ12t =¤;~(–%Pƒ ŒEk0ionö(?ionp#-rSpd whereCù re shouldn't have been one°�‹ffail('U5"'+‚ó .__class__.__name__ + '" z!on-2 '+ó HHsE(ò.find(' -> ') >= 0ÐÁ[:2] != '--'Ànot s.starts#w(' --'OËðs = (s.split('->')[0]«]->' +ÍR+%1]:-:†).strip(Å[sr87r´Qignor¶qZ_listâ# $í§}ëò, 'NotImplemented--', GŒ<1if e i %€elif ':'|s*¿directive(sA b81equ7ž‘RfNbfunct,Ãx…�.lower() „x¹ç6:')š1if D7'¢Jing'äaéRÆàingDict[value]# Uelse::tryÁvalue = int( )4€except V&^ErrorBUpass 5ñ funct = self.ChangeDict.get(ö, (lambda *args: None)v%‹Wðdef eval_equation(]V, s):xò if not TEST_ALL and random.š() < 0.90ÂfreturnH[ö.context.clear_flags()$ IPSidesõ¶.split('->'ÒgAL = &³[0].strip()- )‘id = L[0]û;Šif DEBUG¼ prºú"Test ", id, end=" "XW[š1].lower(!�valstemp$*2:€¿1¿ an ÀG#io1_a (Typeb¤, AttributQIndex)Rraisekñdecimal.InvalidOper,GF�FixQuotes` Lñval = val.replace("''", 'Single8%')µ'""', 'Doubl™PO DC *8 ‚W, "'"‡�K, '"Nß׿‚if id in9ûskipped_test_idsb @fnam/'¸NameAdapteràk]3if 6¿= 'rescale'f7A¡ = getattrï”,M_¸F = [±pconglom«%''˜qýE = 0Rtheirƒž[Ûnà4s[x/p] for x:2]X&rSignalsR¡]úmoetraps[Cõ ] = 1 #Catch these bugs...¿ s ÐmX i,7È2enuN7% < if+p.count( š % 2 == 1�Ý„A1 - Í"if8 Ö p+ ' ' +… NR]Iinue+{ Z9val;) #'= bJv = j AÀin ('to_sci_ ngdto_eng i_ðif EXTENDEDERRORTEST:  ÷for error in theirexceptions: ) ñself.context.traps[E_] = 16?tryS`ifunct(]ÿcreate_decimal(v))_¹Îh OpassG �Signals[Žo] as e\ 0ðfail("Raised %s\p%s whenßdisabled" % \ˆb(e, s,Ý /ls �Did not r¨™iŸ–(Î?, ské0ÖIv = 2 Ù 3eÈEùread_unlimited(v,\ #õvals.append(v) g÷ans = FixQuotes(ansñif EXTENDEDERRORTEST and fname7ðin ('to_sci_string', 4eng)-n 0f^V* ^5-7%Ò7 Eöˆ#Aýdl#5ñabove, but add Íù cumulatively, to check precedenceH�ordered_›»1[e P^O�@if e% ß]_K  l ÄÔÿ š«�; expectÊ9" %6  �(type(e)¯ šDr# reset_ ¨Ðfor error in ûordered_errors: ñself.context.traps[+u] = 0 0Šif DEBUGBÈprint("--", J)8:try3ö result = str(funct(*vals)4£²if fname inZ€LogicalF2?ionË Z˜Reval(ð ))) # 'True', 'False' -> '1%0'±ñexcept Signals[ÖÁdecimal] as  Ó$ðfail("Raised %s¸q%s" % (2(, âeÂ: #Catch anyXõ long enough to state the test case.ª'�`ERROR:… Fr�Å"myy@‚ü6get/()-æ.sort(key=reprdVtheir? '«"•assertEqu–e, ans,&Ñ  'Incorrect)ñ wer for ' + s + ' -- gotç¿ sý,Tº …z�flags setÓ|Ê^)FJdef _•)=‘return [eØìx"if©”B[e]]ðiðchange_precision(l , rIÒ’ == C and_�.MAX_PRECA4250·¤^8°_unsafe_setp(%Oelse=-! =© Íórounding_methodÓ× Ž 4 = YÃmin_exponentV7expQ(NPemin(t›R' ¡Emin = exp2&?maxÍn/axÍ/axÍSclamp“ • æ1 = ø class CIBMTestCases( GâC = C3(Py'4 pP # Th¯pllowingBsses ©âbehaviour of D9` accorÊÕtPEP 327´ðExplicitConstructionÄP(unit÷.ÒÄq'''Unitss:C DÀuction casesñ$ of Decimal.''' def test_explicit_empty(self):#'80 = #.dG'ÃassertEqual(!4(),{o("0"))}Ÿfrom_None�/õRaises(TypeError‚ , aƒ ?int‚•#positive5d =þ545) .Ãstr(d), '45' }Ï#very large ] 50?123d- kOnega½-¾-¿Ezeroõ 0¨0 õ single word longsZ÷for n in range(0, 32ÃJ#1sig&k(-1, 1!%xH_-5, 5'+iP¶* (2**n + xÔ"÷i#i4 ostring´�ðInvalidOperationÖ5elfç sÌlocalcontext5ïo#_Aô50'') 9NaN?int@ˆBƒOfloaC2.34ˆ!45 IÁengineer not9˜#e2TY.5E+3ß@justQŸ a numberUBuglyU 1ðleading and trail ÿwhitespace permittedj‚1.3E4 \nn6+4'ÔÔ r -7.89< xÑ" 3.45679 " ?¶ underscore“ ’1_3.3e4_0•�1.33E+41Ó01_0>+00²†unicode rð�žnò["", ' ', '\u00a0 f205f']ŠE7É8À:  ñ,self.assertEqual(str(Decimal(lead + '9.311E+28' + trail)), @ 8%) /õ with localcontext() as c:"Tùc.traps[InvalidOperation] = True-## 'y stringâsRaises(-T#, ñ‰, "xyz")@ù# Two arguments max `˜TypeErrorYP1234"a'y"ï€# space ÿin the numeric partq Ñ ‚1\u00a023ݽL D RÊÑunicode white׿(s¶0I �é# embedded NUL1a 00a Gð# underscores don't prevent e%s/v0_2_ÙxÑ@cpython_only[òdef test_from_legacy_) s(p){€import _0AcapiA¡"0 = 2".d".'Ó 'Cê6s =g.4 žQ('9.9'“±@s)),¯596 ­ƒ.create_Ô(EÞFsexpliciO]tupleG Q#zero_d4d =ŠP( (0,o), 0) ÿ dö'0'T6#in5 X�1, (4, 5Z9-45\Ofloa^¶^¿, 3, 4), -2¿Y45.34g_weirdÅda, 9, 1p5v5wù-4.34913534E-17�?infæo), "F"f‰Infinity_Pwrongç¶ber of item è·MValuX( )“¸‘#bad signÀ self.assó+ertRaises(ValueError, Decimal, (8, (4, 3, 4, 9, 1), 2) ) �self.assI /0.J5�(‹œ%) œ…#bad exp­1¬�'wrong!'ý!P/0.J5!'1•æ÷Åcoefficients_"xyz"ì$ ïONone8(L-‚/J/10Ì.J“7'a'ßkð def test_explicit_from_list(ƒ!):'BÍ0 = ".dy.Ë4d =–Ï([0, [0], 0]ˆ÷Equal(str(d), '0' HI1, [Ýé54], -25bÿ-4.34913534E-17p ±jp)p>(à)BàçOboolç%N1Is(J ¿(0)), False³ /1/?Tru.#[V÷k¡’ 5\4#1)flP •#positive™Ê&45e*dx¨È e (45±Ï#very large t 506123d{D ‚Onegaë-ì*ð-45') #zSero åd = Decimal(0)edñself.assertEqual(str(e), '0') >ñ@requires_IEEE_754ðdef test_explicit_from_float(W"):@˜‘0 = ".d .(r¦?0.1¨„type(r),ì+Ó1r),¶�['0.10ÿ55511151231257827021181583404541015625'nSTrue(Ó(ÿ'nan')).is_qnan()93inf9�infinite=->õ¹6> W5o'NaN')Þc¥cIyhi-j'00.0Ÿl6-.™õfor i in range(200):B0x =ð dom.expovariate(0.01) * (ran(‡2.0 - 1. I†÷2x, ²Òòx))) # roundtrip¤õócontext_create_ÚlV#üInvalidOperation0 R§eûÚ†.¼a nc = copy.¦�3getÍj`nc.pre73Gu# emptyyã(âd\�<;nc.@Fƒ # U None æýRaises(TypeError, t,=õšS5intR­?456°ÏIsInstance(d© “o(45678¹ 3ž'457E+2')ÊistringͶ'j9Ù ¾ +S.µXð# leading and trail ðwhitespace should resuãlt in a NaN; ð # spaces are already checked/÷ Cowlishaw's test-suite, soCÂhere we just=ð that a trailing newline results[ŠFõ+self.assertEqual(str(nc.create_decimal('3.14\n')), 'NaN') CÕ# from tuplesSd = D>ñ (1, (4, 3, 4, 9, 1 5¥4), -25) )=–d|ö-4.34913534E-17'4q¹{<5uªýêwprevdec 50:123²9(1JýUj.00E+8ØÆmore integerÚQnc.prÜ%28ñönc.traps[InvalidOperation] = True0Pfor vŠ�[-2**63-1 $31e31, 0,d<22**' %, I )]:4vlRp¯ä(isinstance(d,Ê)4=@int(§v/3–.uRounded%ŠŽsRaises(*-, äg, 1234r”hstringt·hÂÿ@0E-0nƒ0¨D"45?–=B-Inf? WinityÿFbNaN123H ™2# i½– argumentõb‘ éšV"xyz"5F¯ValueError@9D5J?TypI"$‡", "5678’°# no whites‘P and “0rscýD ppJÿ is done with this methodÊ"¾’Úji12_34"€too many|× payload digiÙŸƒ$gà5') seÿ'lf.assertRaises(InvalidOperation, nc.create_decimal, D#å('NaN12345')) 0œnc.traps[f•] = False+%seš­Equal(str(‹ h , v/')D@True?Oflag ¤%¤%)­/ó def test_explicit_context_¯°from_float(N&):‰“0 = .Ù.(,nc#Cd(f>r =$F(0.1#egÍ“type(r), r+ø*['0.10¿55511151231÷ è(ÿ'nan')).is_qnan()†:C3infC�infiniteG"-H@  ×)§?>wÃw I:?y')|&@} -~100.0½r-8±`nc.pret5100õfor i in range(200):Š0x =ð dom.expovariate(0.01) * (ran(–2.0 - 1.0óI ¨2x, Umòx))) # roundtrip5•äunicode_digits�e÷ ]K(à©values = {öÚ'\uff11': '1'{‚'\u0660.3712e-€3' : '0.V<372E¡-nan\u0c68a6:‹-NaN24009}§ºànput, expectedÈÖ{.items(Ñ ˆ± (iQ&))S³) class CE úConstructionTest(ÀuctionTest):ÿ# decimal = C class PyExplicitConstructionTest(+):L#P M/ImK�unittest.YCCaseD€'''Unit ds for C �² cases of DÁS.''' †f>#_i|ó_from_None(selfiý<0 = . .N'óassertRaises(TypeError, eval, '4`(5) + lÏ', locals())™ ?int˜™u#normal©©Equal(str(š¥45), '50')5õ#exceeding precision R NÔ123456789000,Š(ü ostringÿ“œ—?"3"–Ofloa˜•™?2.2™�eË*"O¸ & -50Å?rop´Qá# Allow other rðes to be trainedÔinteract withZsF8" Ewsádef __divmod__¡,h()‚return '/P ' + -—*Wr)XLS + ' >'ÁY/ltT?'lt¨gOgO/ležežOgO/eqž/eqžnžnžÛ™..c:G(E()$ 0)‰( 1�@�q10), E(@%10[µ A£(¢Àal(10) < E()ã'), 'gt 10') ñself.assertEqual(eval('Decimal(10) > E()=l=%<=>/ge{>l>=>/eq|!>n|6@# in3ð operator methods and then exercisem9¥oplist = [‰â('+', '__add__ r +),*-5sub* ***5mul* */*utruediv. 2%2&mo° */]Xfloor^ 5*¼5powŽ »%] òfor sym, lop, rop in l:%i“setattr(E+plambda ð, other: 'str' +Lq + str()z JruJ<! +–+] Jƒu€Xym + ‘'.Ž  Á'ð)îô ÿsy‡q 102xâÿ class CImplicitConstructionTest()²d‚C = CK/Py3L#P MaFormat‰�unittest.CCase‚€'''Unit  s c0theqmat funËA.'''b1def*!_fZPting(iMxU! =p.â.Îó# triples giving avC, a .,jñ expected result�n·_valuespeÀQ0E-15 e ç!('%42.3'?2.3) @0E+2Pp2.30e+25õ # preserve significant zeros¬°o5000šJ?000w´1.234567891 0e40†<+40@y!1. _1.5e+$"0.0%/-1I70.0&è 0.ç011315.ÖO50e+}È@, '-¢ð+1'), ± ('e', '0‡e+0'),  #E1"1".D-"#2E".6‰AE-15k!.0?e-9- )/+6)19.90 í†$911Š+Ú1a-1.23e¹ »?e+5‘/’456789e-3e`234568 ƒf"<R~.Á!1E-2F/.0#d.00E-8&Ãrû'), # loses exponent informationN�23.2>3 "°/32¯_3.20E$%�'-6ù˜!.6š0¡û all zeros treated equallyFP[d(• ".0”&‰üno decimal point€2ez"‘3.1415926Õ3(1| (.$4*/41²-/59†7/2_ü # round-half-even!8C Ä91 ¨ dg¢j ßÂ!3/0e‡G`"E"D-Ï0xÕ& Ð4 (''7w?e-7J-}O-0e+ë!.0I CÈô # 0 sig fig -> 1 X0.0nƒBÌsame for 'n'81z (2(å5*å7-å8/å9CÀ14159265', '÷3.14159265'), §('.10g', '$ û), # don't pad ?%<10E1%_ 0 -A /-2B 3!/.0…#-4#$ Ê".3¬$%ÿ # all zeros treated equally@"E1í1.00C'-(12.3¶?234Q €1.234567¿123.457 0, '-)% ¤e4NaN 5fa-NaN12w )+\`NaN4564+ )!.3u!In[ŽInfinityP1.16"-*+Ù#-sÊ ,),Ø11.0¶ #ð# test alignment and Kding:å0 ë<%n123 è>%J^%KJ(=+&+•"#<�,BNaN#Q+2-4.ý?4.3,+XQ0.013c+ ?###[ / /"@>.Æ@ 0#>5#"*!?^*¼Ž, '?123?ª%|Q%123%J\B (' &A-45.… î#/=É)/ @#/=T@, '+,/-RO, ' -D\x00ŠiŠ-�"^1Ü2nfQÏž4„ æ$Á#å 45z µù# thousands separator"0(',31aP,234,n ‹+5,ü('?,34žN%vÀ e$##23!À (',c', '12G), 1(',0/0'€-1234567$p-1,234,- ,n23,456W7’W*1)8) *0+&0,,û # special case: extra 0 needed/+L+Kû but not if there's a signH H¿k >;+09+í †ù# ... with fractional part...*6('0—0.56„í ìÛ  ,¯ O, '0Y%10Ý./ 1//,01 21Q8,.1fP234.5 ` Úõ # no thousands separators in€~ {“.0789d1 R!,%"023.˜0¼2,345.6789%˜C(',e2�®^?e+5,E,E, ºÉ# issue 6850r('a=-7.X.AUpaaaa0.1t /HL2209I�<^+15.20ô!in‹ð<<+Infinity%<<'AsNaN�Â(R=10.1k7¶2 1]Æðfor fmt, d, resultôÅtest_values:+ªðself.assertEqual(format(Decimal(d),O)M%) ?‚# bytes 2• argument [ôRaises(TypeError, `R1).__B³__, b'-020'fAdef ºn#(T)ÂF0 = ".dµ.«6try5÷õ from locale import CHAR_MAXÀ�except I· Ds¢skipTest('N.Gš”availableÒ|Ö÷make_grouping(lstÕ$ðreturn ''.join([chr(x)k xÐPlst])ù…øæ == C else lstþqñ get_fmt(x, override=NoneÞK='n'�)ifS[ ÿ§Àn Decimal(x)÷ .__format__(fmt, override) Yelse:ýreturn Decimal(x)NÆ_localeconv=ZIæ# Set up some ,õ-like dictionaries3•en_US = {Š"'d„ê_point' : '.',#€groupingTmake_»([3, 3, 0])3Ðthousands_sep89','U%} _fr_FR™,™�CHAR_MAXš™_ru_RU™+/: 1& ˜_crazy˜&1 ˜Ÿ1, 4, 2, 9-¢¿dotsep_wide¨ü b'\xc2\xbf'.decode('utf-8'Wy'À‰m4m’¡ô self.assertEqual(get_fmt(À‘'12.7'), d3), QB B6,7'LB¶B*`B0-2&…È™123456789Ÿ3,456,789ÉCWAo3 456 „f0123, ߯-78-9012-3')¿šÑ`, '.6n'0'1.QO7e+8ÙI,I$"I1$I&’9å# zero padding< $, î#037?2341>4>*5>ð01234') ðself.assertEqual(get_fmt(1234, fr_FR, '06n')0S') A €5, en_US:5B�12,345')AƒA'7‚0B'8B,D(9D0#10E0ŠR€6, crazy”S-2345-6–DV1D)XD*XE*Y/-0H+1¡H-2H0I-3I J5õ# wide char separator and decimal point0øD/`('-1.55pdotsep__t2¼HG¿'-0\u00b400 1$fIKó@run_with_locale('LC_ALL', 'ps_AFÜ�def test�_î_î_ê_ê(â!):^ž"# Z f-0 = U.h.M�# =r.y‰conv()['%%']¡�thousandsÒ= %=$ifè}¶!= '\u066b'ÂôskipTest('inappropriateD,H'¥B °'({!a} not ©)'.format(è,Ž);9if Ð µcµD±,H�±?c'). ì C('10@.123>'¸?1§c/%66 bB]÷ðdecimal_from_floó at_argument_type(self): qclass A¢.decimal.D'.Ádef __init__0;, a#'a!.am1 = t%a)pöa = A.from_float(42.5=¡ssertEqualh ˜3, aa/) Y W)ÆCFormatTest( õ.R = C /&Py%0 #P 1ñArithmeticOperatorsl�unittest.CCases€'''Unit µs for all aF$ oGà, binary and u B.'''/ÉB‘_additionfcÃ1 = �éE(Sd1 = -†('-11.1'u(d2W22.2'°D#two<sÆpadd1+d2,)"('de1O2+d11c±#with otherže, left¥c = d1 + 5 dc` -6õ‘1c),mH(d1) ŒJrigh�o5 + d1�Qqinline ”ôwE= d2 v ]}O`t _u?ÏsubtracÒŽ-Ò-33.3')B9d2-þ1þˆÓ-Ó1_\ ìÔ/-Ô�+wÔ-Ô©x^Õ/-=v ×2-38 `Ö¯multiplicaÙÀal.Decimal  ód1 = Decimal('-5') 8 d2E3') D#two6sôself.assertEqual(d1*d2,)v('-15')a0N2*d10aõ#with other type, left¥c = d1 * 5 cc_2� cA(c),lH(d1) ‹JrighŒo5 * d1ŒPqinline “dÌvE= d2 s \zN_q ^7r>ðdef test_division(š!):„–0 = .Ù.�Ã2Ã"/Ã!2.á› ô*2/ó00.4õ×Å5/ 42 d Å/1.ÇL?4 /Ç00.8î »T lïOd1 /Ȩ@#]É//=u Ö6waÌ_floorÒ<”Ñ$ Ò2° :d2/Ð0/õàÍÎ1^Y=þÙ., ‘?7 /Ë‹(kÈÉŸp[í &?/= îÀqual(d1, Decñimal('1')) def test_powering(self):!0Dec40 = ".d.E(Sd1 = U('5')B(d2#2'z5D#two5s1iôassertEqual(d1**d2,*@('25ÁB0W2**d10 320aõ#with other type, leftµc = d1 ** 4 dc_6� dA(c),m4(d1}½ŒJrigh�7Œ/d1�P16807ï^ »� qinline "íxE= d2 \ w-#\~ _u ^3390yBÊomoduleȃ%LJ£K)2%ðÄ!%Ë 2 +Ï/, Á/% Àç Š `¼%»X‡º/%=k É\´¯floor_div_¾v`(p, q) `ivmod(Ã&d2× ›pÅ q* d Tïp:(,q,Á ¥ òì4ëÁ ëqÀright ó (p, q) = divmod(7, d1) ðself.assertEqual/ÏDecimal('1')*5q, *2* ‘type(p), /d1V #q,­ð def test_unary_operators(Â!):$Ô“0 = ".dÌ. (ù+#F(45)ÚP+45))XO# +D-D-D-DGabs(G8), L@) #Îínan_comparison'# ð involving signal Cnans‘ InvalidOh2ionly# orderNç(<, <=, >, >=)]°only quiet ^÷o# alsome—:ityp_==, !jSdon'tkõ, but return False or True respectively.©‹P / 0 `Ìlocalcontext5€6n =yGNaN'¤si7Inf7f62')lqTñpairs = (n, n),iiffÚs<s<s,4s, DDsÙr0_op‡ûV.lt, e g%ge“L J'eq=&ne#�ults whenõ is not trappedhÇfor x, y in C&+ ²?1 op/ê(+ ¯ 04 go10op(j+ exÎBed =ß0if bs3@ne e¼<!4Is(Nm, got,-1".r {0!r} Þ±ÿ.{1}({2!r}, {3!r}); "P ëï{4!r}".format(2{Ñ¡.__name__,޼)ÞÞâpeat the above‘this timeÙÀXwith ©š() as ctx²@ctx.',s[KV] = 1sG1Ö@ Q(Õn+Às:  ögot = op(x, y)  ÿ expected = True if op is operator.ne else FalseDäself.assertIs(Ro, got,1 "2Ï {0!r} for "8£ÿ{1}({2!r}, {3!r});A ï{4!r}".format(w ¨ð, op.__name__, ]í9)) @Éù in snan_pairs:$(ußn equality_op(,lñRaises(InvalidO°0ionž»"eqžûK$neK ¿»ãqã/ +ð_orderí- ™ðdef test_copy_sign(è)v Decimal = ".d.ÂF(1).P6-2)YLEÅ(& ;o-2), d6οTypeError, Bò , '-2') class CArithmetic�orsTest(ôC = CI/Py2JñP # The following are two functions used to¢p thread)Áin the next Ù! Èh:S1(cls¹m = cls»   + ÍëDivisionByZero2 0‹Overflow*$?Und%&`Inexac¥Ð"pgetcont õ(_local*ßGd1 =_A'd33£I+Rd1/d3;¨Âfinish1.set()°synchro.waiUAB2 = A Xwith ’†() as c2¡MJ’£(c2.flags[]sM*> ­ÿ, c2.divide, d1, 0; e Bl¹3¹ “X3½. † 5öàInvalidOperati÷on, c3.compare, d1, Decimal('sNaN')) úcls.assertTrue(c3.flags[InvalidOperation]7edel c3JF�False(c2GC!2 D@¨Equal(testº?0.3ÐB2üB …ò1 = getcontext(òY!1ÚSexactô for sig in Overflow, Und üDivisionByZero, _:‚˜pKqòsig]) def thfunc2(cls):ä0 = @dò.\ r + 4 ¶ 2 0û *$ %&!In^ $"© %(SlocalÓ *ˆd6"(1Ed3 =D3 ‚ = d1/d3;Fthisg…G¡.prec = 18¡L2LXwith ž‚() as c2í '—q9— *tRaises(�×, c2.multiply+a1e4250r'), 999õ M wTxÅÐ3Ð]Œ Ô .)/Œ0…3.traps[j@] = LJ#@//Zidivide.-/ QlbX40[@½2ôÌi�¨synchro.seüsfinish2+f®Yê åW1îbÍGzÖð class ThreadingTest(unit.CCaseì€'''Unit ðs for thread locðLal contexts in Decimal.''' # Take care executing this test from IDLE, there's an issueP“threadingM°that hangs 5ò and I couldn't find it{1defd_Eq(self):L�‚DefaultCÁ0 = #.dÄ T6)if(Q == C‰9notÖ.HAVE_THREADSvDiõ skipTest("compiled without ³%")® # -e the " ó isolation" of a Ía. Also c1D~#E àñ, which acts as a template for1ug-local–.Êsave_prec = f. (Nemax(LEmax(/in(%in(l_ = 24!eq = 4250({-)*Ɇynchro =¸v.Event(¾)finish1)2)|tJT-ñ(target=thfunc1, args=û&,)�*th^=2={X.starâ5th2)÷H.wai129u0sig�Signals[0ž]PËassertFalse( ¶flags[sig])ɇth1.join¦ÄŠ KÂ+ä(] ä(](Âin class C“0ingø(Å D = C6)Py)7 P7‘Usabilityl@unitŸ.CCasepq'''UnitWs8` cases„ ‰çñarison_operators™&):–?c7elfŽZ(!da†('23.42'ß/db š<745'D#twoÈsµ|aæGreater(dc, das#_Equal( ¿Less(da, dcH E%!bF7Not$jIúÀEqual(da, dbC) õ#a Decimal and an intÿ self.assertGreater(dc, 23)#¿Less(23, dc QEqualA/45ƒÏuncomparablef3NotIŸa, 'ugly'n (O32.7&�object()*ÅY sort´Óa = list(map(eÇ, range(100)g•b = a[:]ñörandom.shuffle(a“ a.j(¥Ca, b›¢def test_dår_float_bPison(>%):x¨0 = .7.8dÞg('0.25†dÐ73.0WS0da, 3.0Ï!Ó& š0b, ‰K%N* 8?1.5OHarw(3.0, dÁ –) (ÝO, db’"–' Þ& I‘oH$1,C ?1')|v?lex~tÂ\w(1.5+0j“¦*&Ð8Q`R(Ñ$P C'�ODdb, +ƒåÉ+1ór3.0+1j)x'UÄIs(db.__lt__ÿ, NotImplemented²9e9$grCå9raction¾ 6‡SF = fH!s[Da3].F~-|ContextT'olocalc,À InvùalidOperation = self.decimal.Inv C ôemax = C.MAX_EMAX if C else 9.i]§C.MIN_EMIN.-.9/Btiny^0HTINY11272c.Àontext(Emax= Æ, Emin=emin)º³with localc15c):IßPc.preRE ôassertLess(D(0), F(1,“ /))N ?F(-I , {O @0,1)*À"1e" + str(e[)‰ MD("-3èQu�=iðÒ¸ÓEqual(D("0.1"½/100ã1ì9 a3?300ä2NotM`D(1)/3P?1,3z0}3<8 zÛ“bÆF(120984237,�9D&"9 ?max rGreaterS-D(9Âh¤T�(D('inf'�Ç?,12=?/99> x-y;wø|Raises(M™Ð'nan').__gt__O-Ä ÷Is(NotImplemented5p.__lt__ãWZ"D(‚Fß�¦Âðñdef test_copy_and_deep €methods(¯oDj yµCd = †('43.24'©«e.&(dm.¯Å·id(c), id(ddA¯E dF÷úRhash_íì!†Áí#œ ,0ef yGit(d]M1a =ÒÀ b = d.__§hash__() úself.assertEqual(a, b#•return a 9ð#just that it's ZEable!æit(Decimal(23)S ¯'Infinity'$-%onan123G 0NaN ¨ôtest_values = [°çsign*(2**m + n˜9 õfor m in [0, 14, 15, 16, 17, 30, 31,l1ð32, 33, 61, 62, 6 ¯4, 65, 66]A}n}€range(-1„0h l/Ø2v[-1, 1][�.extend([xÿ"-1"), # ==> -2(0(_zeros'00.0)!-"# ?0E1! ~-0E12")�Ö010.Cÿ # negative exponent›@23.0[ 23¡_Oposi_€4.5678E5; †A# a ½ ÝQwhich‹c(n) != 0 % ÊO64-1É#íPython pre-2.6g"ÿ2**64 + 2**32 - 1Nâ# selection ofž"s ›ö fail with the old (befor7³`# versDÀ2.6) long.__9/__Ÿ�"1.634E1M o90.697'o188.83'_652.9'_56531&'])Zb check\ñS(d) =Ìqint(d))îƒintegralc 7in ×:"e ök1it(:!),;0it(q)¤¿Asame'«@to a�+cN&3)i !:òRaises(TypeErrorš$, E#'sÒÕ<STrue(Ø0WInf')0 y1?#¢ c esîa˜ð float match whenòyCðrepresent exactly! Tp.Ãastring£�'inf', '™a, '0.0^.0e1'ÞÀ '34.€0', '2.5‘112390.62`-0.515 3] õfor s in test_strings:&Éf = float(s)¼d = Decimaló self.assertEqual(hashit(f), Ed)) Oú with localcontext() as cŠñ # check that the value of Xð doesn't depend ongÏ£# current kÚ (issue #1757âxâ×"123456789.1"»T©c.prec = 6kDh1 =ïxZ2*10323 f33 OˆZ1, h2Œ%3äJ1000µ'Ï1100 ** 1248ƒ  :&x)x2def’ðmin_and_max_methods(°)I0 = ".d’.ddކ('15.32' dyG28.5l;%15Øl-&28\„#betweens+” öIs(min(d1,d2), d1~&O2,d1& &axLÓ L&L2Ô ³� and intº lºlnàDax(lº lº¯as_nonzero%Ÿ#as falseòF(&0)«7?tru6ETrue5}'0.372'Ó"togБ#Test str’Srepr ú.ª™ôÁ ó)¥„str(d), *Û#•ƒ >ª?"žep") # !3Æ_tonum  { ?int (Ù'66Þ ûé#4Aint(©&66$ &;(15ƒÜi 6^Ðfloat(d2), 15s.32) e#flooråtest_pairs = [-û('123.00', 123),o3.2', /54?899Ž-2.3', -M@-11.�=-11�000-0ENÿ 89891211712379812736.1',  W]þÆfor d, i in >: ;ñself.assertEqual(math.zõ(Decimal(d)), i)84öRaises(ValueError, A$, B'-NaN')C*sC/oNaN123ˆ �OverflowÎ ?InfE/-FW…#ceiling´ò#4A('3.òòò2Mòf7‹ò1|ñ)@ð+ Bï Bî% G§-ý2 Dìÿround, single argumentû6 û‡@-3.5T||40T10I2® ­„&ÀEqual(round(óDecimal(d)), i) ôself.assertRaises(ValueError, round, ='-NaN')>%s>*oNaN123~ �Overflow¿?Inf@*-A>#!ötwo arguments; this is essentially equivalent?ðto quantize, which6õ already extensively tested:Å_triples = [×ÿ ('123.456', -4, '0E+4'),%3%3% �2, '1E+2% 1%/.2' 0&Í”IO23.5o “ì6& Þ*'0OO5', u4&zG , p g@, -2¹"Jc314', # Û]ïáfor d, n, r inK<:%9 ¡Equal(str(ã(Pd), nD1r) <2defRÐnan_to_float(J)]ò# Test conversions of d”‘ NANs to ;.VŽõ# See http://bugs.python.org/issue155440£0 = ~.^.'s€('nan', 0123N#'-W2468'Å”2f =§s"|QüTrue(math.isnan(f+aign = "öcopysign(1.0, fc T˜üign, -1.0 if s.startswith('-') else 1.0¤‡¥)@OA- E1357X D5d =RséŽ <, dÖQeval_§× }Ø #@U zero«@ (0,f), 0) ¸ñ�0d, ’P(reprp¯É'#iþ ]�1, (4, 5_*"¾Àd = Decimal(ó (0, (4, 5, 3, 4), -2) ) õself.assertEqual(d, eval(repr(d))) ,e#weirdòd = Decimal( (1hea, 9, 1qw5x!ðdef test_as_tuple(²%):†‚0 = ".d‘.½…ith zero;Á0 .}"),R`0,), 0ÑNE#int [?-45]G5_ÿcomplicated stringnÿ"-4.34913534E-17"|à wô%# The '0' coefficient is implementation specific to  7py.HðIt has no meaning in the C-versE1and[`gnored&reCpŸ"Infinityû&Ô:'F'Ö@lead‘:s—ì‘should be’?ppe`` 0, 4,pŽÄ �|B  –0ro0), 37l‹637)E`Y, kÿNaN diagnostic info s0!'nät) Cu/'Nnv;), 6a$ÈZ6w@ For\4Gies,¤–ðalways silently accep†7anyFªž@lˆ�8‘i ï-ð aeJ 0, 2, 7, 1Š6Ê@8aé�integer_r@ñÀ # excóeptional cases õself.assertRaises(OverflowError,)0ó Decimal.as_integer_ratio, …('inf'))DmK-n_ValueØ1O-nanÙ k6psnan123nHõ for exp in range(-4, 2):!¦%Vcoeff'K1000&*@sign)Š'+', '-'L&6d =ÝÀ%s%dE%d' % (?!, o,›õ8mpq = d2(#*0p, 09pq Ùÿ# check return type(vÿIsInstance(pq, tuple|5_, int2q2š€normaliz>ÿ n: q should be positive;Bp,@rela,ïly prime to q.9àÏGreater(q, 0ÛðEqual(math.gcd(£_), 1)£ ðthat p/q actually gives the correct v�¬ `Ep) /�Sq), dˆðdef test_subclassing(óþ÷ # Different behaviours when 7`š}0 = Q#.dx3 My(‚ņy = None8Gd1 =71“)d22We1 + d2¨žÚ0Is(5(d)œ)ƒÕ‡d1.max(dT@Pcopy.'(d±CÁ*ã0d, JÎ¥`P.deep iE#ñ± „Æf('1.0'Àxdׄx„(ÿxÌ #‚em~Àelf.assertIsó(type(m), MyDecimal) ÿself.assertEqual(m, dåIs(m.y, None) A## T(^5x =mVŸ4x),*(�x�|t~um.y = 9/Ž1�,’M NKIs(x/ð def test_implicit_context(8%):©R" =Qdµ.'3getA *©ôCheck results when @dgiven ˜öly. (Issue 2478Fc = ]( HCstr(±Å(0).sqrt()),½31c(8#))k<Ÿnone_args5$Cs 2ŸTlocal ˆ1üInvalidOperationa 9ìDivisionByZero7 5ŒOverflow/)?Und*+œSubnormalU+|Inexact)'|Rounded''^Clamp'ÂXwith }(¶†()) as cBVPc.pre±7j0Ema &99i¸- 4/•V"111"ù:g[e9999"z 0"1eb# e#° Unary funcFs"×c.clear_flags}„�cx.exp(Ç=ºú), '1.609487E+48'ËGqTrue(c.m[Û].â .¿tRaises(Ë0, yÆ,¬Ç µC]E(0‚Is(z.is_ú +, Falseó<s9 ?B {ïJx.lnXÂ�4.709530¾ÀrtTrue(c.flaçgs[Inexact]) ûself.assertTrue(c.flags[Rounded.�c.clear_$(Jÿ&Raises(InvalidOperation, Decimal(-1).ln, context=NoneN ˜ T9]) ТùEqual(str(x.log10(‹ß), '2.045323'™_|ÖbwbaZAæDivisionByZero? 0)µbÞ! S>3¾ical_invertæ1111000ì Ù0, yå\ï! Vñ.Îy.next_minusí19.9_E+999ó  w'sNaN')lýy/plü�Infinity÷5för¾z.normalizeòÙ€OverflowÑIÙ!I ÄÃ×ßz.number_clasªB+SubŽ'B-Oz.sqú0E-1005 Ù]ClampqÜ .ÍÀe(c.flags[Ro—unded]) ÿself.assertTrue(c.flags[Subnormal0›Underflow0�c.clear_V(|’Raises(OvEÿ, y.sqrt, context=None> ºD9]) êéc.capitals = 0ù Equal(str(z.to_eng_string(ŠÊ), '1e-9999'— g*1 „#ù Binary functionsŒ1 an¼�ûx.compare(Decimal('Nan891287828'): ¤ ð•ans, 'NaN@ ”0©ÀInvalidOperaÄ%, ’%, “MsNaN‹Z Å `ÍW&Ï_signal(8224!+-1æ~nÿlogical_and(101!/10#{[, 123|ZŒ/or&1+/orvx(0 "xp?max]7max-CÀ c.clear_—flags() úans = str(x.max_mag(101, context=None)4ÿ self.assertEqual(ans, '111')õ Raises(InvalidOperation, wû, Decimal('sNaN')„ ·ƒqTrue(c.Ý[`9]) 8�c.clear_.  /in&0$/in}*'w zïremainder_near' *y.}., ž âM‹rotate(2žù "/00 "x.výn�scaleb(7ý"o.11E+9ÿ"xÿ;000}þZ_shiftý]uý< 6#Ð Ternary funcœs$:0fma 3¦ ?225€Overflow:7fma(`1e99998}ÀNone)  ñself.assertTrue(c.flags[Overflow]) *#é Special cases ù c.rounding = ROUND_HALF_EVEN)ôans = str(Decimal('1.5').to_integral(Lá=None, context)))OÉêEqual(ans, '2''Ÿ?DOWša1šZ/UP3aclear_ú(0Wõ Raises(InvalidOperation, ÀJsNaNÁ Ÿ² { aƒ}Ãb'o_valueh‡ 5n! |t”·z�_exactzˆ 4z" |z•·zT)UPN?ð 0001').quantize(exp=Decimalñ('1e-3'), rounding=None, contextG)) úself.assertEqual(ans, '1.501'+$c.WÙ = ROUND_DOWNOñans = str(Decimal(K0Mæ.quantize(exp= ´90´�1ë/UPH7Êclear_flags(d�õ Raises(InvalidOperation, yI(, F)10û· ¯oqTrue(c.•[u5]) 8£with localW"(C_d()) asm:1n+Ÿ.prec = 7¯Emax = 999lin = - ‘2ctxì� ŠŽ÷õc™:, 7Ž,¨,§.1in,¶Eðdef test_conversions_from_int(œ)³ô# Check that methods taking a secondå argument willDô# always accept an integer in place of aG.:^Ò'dÓ.´ E"õ(4).compare(3),XX 0'3)²i_signalp7w&?totv 6u+O_magïy:}ÿ10101).logical_and(1001Ý;|Cè D/or~%o¢}%x~';ü¶567).max(12MÀ  ôDecimal(567).max(r123))) &õ self.assertEqual(9P_mag(5,4<\ 4<q/inm%in²iÚ!in4Ú"¿next_towardâ8yÿ1234).quantize(100)Æ 6u/009ð768).remainder_nearñ4{<€ÍIŸ.rotate(1v1nì+Qsame_f umef ;|0kÿ'9.123').scaleb(-â 8y@cÏ456).shift(-c1mcU‰…-12).fmaè45), 67Ú<‚ 67‚Æ�/45xg´Äùù class CUsabilityTest(!): dMC = C5)Py(6 %P 7ðthonAPItests(unit .zsCase): q f P_abc(™‰¬ " =¼œ.@(7Ú¡True(issubóJ±, numbers.NúOFals> OReal<¤IsInstancet=(0)wó ³?Not= vïÀdef test_picÃkle(self): ÷for proto in range(pickle.HIGHEST_PROTOCOL + 19@ Decimal = V".d. e,Csave!0Ãys.modules['*']2Ê# Round tripK=V4elf† 2Cd = –ù('-3.141590000')(Cp = ÿ‚dumps(d, 'e'zloads(p °assertEqualG*e)ÞFif C‡"à# Test interch�yability§*Tx = CkÕ‹23e81723Õ._y = P. ]sbC+‰ 4x4†WPWrc*sxdPðhÖIsInstance(r,ë4 œKr, yœ\¬s^ yZyÏ 4 xÚG c®.as_tuple(an9 ÷"sŸ vyyT ~Í ƒ KTÌdef test_intá÷  @ð x›-250, 250óú s = '%0.2f' % (x / 100.0ëð # should work the same as gifloatsü Ê»P(s)),(9nðto_integral in ÷the ROUND_DOWN mode éd = Decimal(s)ör = d.to_integral(I *ôself.assertEqual(RÅint(d)), r) \.õRaises(ValueError, int,’v'-nan')n<s<�Overflow{?infz > -?öðdef test_trunc(Å!):Š-0 = ".dŽ.8÷ for x in range(-250, 250KOö s = '%0.2f' % (x / 100.0E&à# should work &€same as gefloats¢1œäܤ (sä9n_Û‰f¯]Rmath.¤ ¶ÀSfrom_äVelf):ž ƃclass My0+ År�__init__0;, _#•xñ&y'‹«¡True(issubx(xd)šò".í60.1Ñ_î†type(r),Ö-0str, \Ë['0.10ÿ55511151231257827021181583404541015625'n‡r.x, 'y'åÿbigint = 1234567890   î!U(�—I]'»Ÿ.is_qnan(F„F0infMeJ%ÏKæà%),g B$o'NaN')p pI/yu+5v-w /4Typ.dÐ, 'abc') ð for i in range(200): 0x =ð dom.expovariate(0.01) * (ran(©2.0 - 1.0)Iòself.assertEqual(x, float(MyDecimal.from_ñx))) # roundtrip Mòdef test_create_d9_9hÄ[0 = .1.Uë|Context''mInexac'¤OcOB‚(prec=5,Ñæing=ROUND_DOWN(£$yU.ü™math.pi),8ì–('3.1415'p ±&UP5¯Q6¯straps=[’]­yRaises(%1 :r /X}ý_repr(_k(-0.0)Ï "Ý_-0')"r/¸q1p3à1à]�quantize(‹öHìvalidOperation&*In 4 = `Emax=9€, Emin=- 9³ìëé…7.335').üL.01'.O7.34L; ™w"Ú Œ3Œ ¥ i_A"10e["%%, }@1e10C'), ‚%=cô)½¦5d =L×"0.871831e800}5d¡fd, exp=Š�"1e797");’  xͳ8.71E+799')ºzcomplexÀ Decimal = âself.decimal.D3 Cx = õ("9.8182731e181273")(FÿassertEqual(x.real, x$ imag, 0$ ±conjugate()Ot œ1� Äcomplex(x), ¦float(1)))îÆðRaises(AttributeError, setattr, x, 'â_', 10ÁCC, H,#__$__Jkð def test_named_parameters(/!):%/@D =  N|Context'Holocalc,1üInvalidOperationa 9ŒOverflow1Sxc = ©(¯`xc.pre1U`xc.Ema� i™&-1UXwith Òv() as cS6çc.clear_flags(®px¶D(9, xc), 9§*g=2/Ÿ, value=9j8)ï™xáàO Í , D, "xyz"ÜaÎ�JF�True(xc.N[M]4oFalse(8 qÔ,™D(2).exp('7Œ ¦Q, D(8A Eú0ò-*lnñ�D('0.7')ø µo-1).ln M8 så�0).log10öO-inf÷@äªnext_minusF/-26 ?àplus(context=x÷c), D('-0.9')) óself.assertEqual(D("9.73").normalize(context=xIO1E+1Iú999").to_integralKO9999�Z-2000Gj_exactM'N 12Ü“[_valuä?123JË0.0625").sqrŒ`D('0.2#mFhcompar‰ê, other=3), -1‘úxc.clear_flags(Õù Raises(InvalidOperation,˜ 0D("s”q_signalEwnan'),  K{�True(xc.¢[‚]³oFalse(8À±0.01").max(‰K0101´Ë00.0£ó¿OG2�@_mag¡L-0.3Ÿ TšÌ3½o#ink0l O¾S¿{n±next_towardÅÍ “$P. �quantizeUK1e10Î b!f!9.˜àremainder_near[;1.5¼) Š5ŠæH 9. ¡fma(third=œ9pó/7)y7†yû�TypeErrorŸÐ1).is_canonicÒÈHofinite E/inG29nan‰À ÷* self.assertRaises(TypeError, D(1).is_qnan, context=xc) CsC0_ignedˆ,JzeroCÌáFalse(D("0.01"wnormal(  ;Tru=?sub@Žoadjust+šconjugate ÓZradixAËøEqual(D(-111).logbC?, 2F:07ºical_invertA1A'Åú').number_classD4'+S¡'Oû21').to_eng_stringP 0.#  '1I1logÞ¹and(D('10')\?, 0• J/orI-“xJ)Û23').rotate(1Ò3Ò?ÿxc.clear_flags(\X™Overflow,  1D('…Šscaleb, Å =þ1xc.Œ[l]•l0œjhift(-›2 ëú.from_float, 1.MH»(0).as_tupl`EÍ€1).canon O(), ©¿0("-¥‰copy_abskyG /ne$-Ï�?"x"�a, xyz=BÓðdef test_exception_hierarchy(Ž&):ðdecimal = self.decimal# òDecimalException = d.4ËInvalidOpera4 4_Float2 0èDivisionByZero– 0‡Overflow*$=Und%&—SubnormalK&wInexact$"wRounded""YClamp" #ü self.assertTrue(issubclass(Ÿÿ, ArithmeticError))H ³,, Z/))� ÉF5DTypeγ  …% } , ƒ��#, úI7S7À# /, x8ç8_ê:ë¬q"%"?%)?%'?ÿâ`Converg`Syntaxú Û‘P$¯ImpossibleR5ó_finedQ@Þ$õ@Context  ²ú CPythonAPItests(!):»WC = C7*Py)8 #P 9“pÀ(unittest.TeñstCase): def test_none_args(self):" Context = “.decimal.'üInvalidOperation0 9ìDivisionByZero7 5ŒOverflow/Ý¿Sc1 = ­%()A'c2óprec=None, roundingEEmax "in E`‚capitals$c clamp DflagBtrap �öfor c in [c1, c2]~_xàassertEqual(c.²F, 28D)Ðÿ, ROUND_HALF_EVEN:û1, 9-Qin, --9.+?, 1,H:, 0)r_signal³a, c, 'k_', []1�1 ¡*, |,÷x‹"])�Ñ@cpython_onlyL|þfrom_legacy_strin†€import _¬?Axcì$`0rndbRàZModesg$c.-& =iŠ.unicode J(rnda¥O!, .�s`&''_[ò Raises(TypeError, setattrþrC', sw$q o\x00UP}5âdpickle[ ™Pproto›brange(*÷.HIGHEST_PROTOCOL + 1•Öéu(Csaveº0Ãys.modules['*']2!# +U trip°K=V4elf 2£­‚LCe = ñTloadsþ‘dumps(c, )Ë6 e9- Em­ e.-@ax, -/ax-€1 5Ï95 5!e.h/ À.flags, e.flgags) ò self.assertEqual(c.traps, e )) 0ù # Test interchangeability&ðcombinations = [(C, P), (P, C)] if C else [9P)]?øfor dumper, loader in U:0Ð4Pri, _+þ enumerate(RoundingModes)7;f;òOrderedSignals[‘]DHtH ÄEàprec = random.rnz(1, 100Å4Oemin<o-100, =/ax=y0capð® µ2° _clampt2~áÁ# One module2sT Qsys.m-ás['decimal'] =;/er< �Ÿ.Context(0 £Æ=p, Emin=š �ax=emax,CrÂ=ËO[ri]>�capitals=›!, j=>oflags= ?[:fƒPE*tiü8: nppickle.�¯s(c, proto9”The other?i?$;? Cd = ©.+s(ˆñ ˜ÄIsInstance(d„ç FÞ"d.�Z  d. , Ã; ax;/ax;-, L , ?¨E= R"_s<(ˆa, d, 'R;', T1er]TZ$gZÀader][:ti]) ' ósys.modules['decimal'] = save 2ñdef test_equality_with_other_types(self):.cDOMCelf.N.V(7£.assertIn(ù(10), ['a', 1.0, µ(1,2), {}])oG/NoJ =>ÛLcopyÆñ # All copies should be deep=œê#|Context'Cc = (àad = c.£ õE›ß(id(c), id(d)*c.flags0 6Etrap6 6!k1ä2t(cQg.keys(�#k2!d!ØÕfk1, k2c !k#, S)PÜn_clampÞòIn Python 3.2, the private attribute `>¥` was madeûð# public (issue 854¹L6old>¨becoming a@Ðroperty wrapp`«q`. ForF·duration of®EBonly½µ­£gettable/s — via bothCv6 an²7; i&3,Ë]B…removed.Åì'ðâ„Raises(A� Error, getîb, c, '¢'÷/ab˜ª¦½¾ ®~7(-1Ýà c.,o-1), dæCTypeÿ3^, '-1ö,ddê‡ ÏÎö2&ddÇ)» odd(1, * `21‰g`dd, '1Š›417 “compare¡YÀ d =ö c.compare(Decimal(1), 3) öself.assertEqual(;01, 6d-\61•/, löRaises(TypeError,àP, '1'rÑ8 1;!) 9“def test_7€_signal(!):#0å0 = ".d\.'|Context'rOCc = (e6d =à‰cÇ BÎ4v =Ü.I¨ã ?ê ?totérˆr x¯_Aç3hf… o?)<‰Hä&Â/, ãO_magÐp±Œ8 Fë Eï7|Ù¼Ü/Lû+Îÿopy_absöjƒq?-1)Í 1-—NÀpy_abs, '-1'ñ) def test_copy_decimal(self):!%D0 = .&.'|Context'pOCc = %()>id = c.‡aF(-1)(ƒËassertEqual(5o-1), d0ûRaises(TypeError,qo, '-1'onegatem†4!;Osignm„ü /-26>_1, -26 f0bn941, <ž¨~Q, '1'±;ã;1Í2ã_dividÞi�Y Æ :?1, Â,Zf5»/2),v·2™7³²O_int€h£…T º>¾0bÂ9Æ-EÊ$;Î?modÊNÀ= Context()  ô d = c.divmod(Decimal(1), C2)) ,õ self.assertEqual(:�1, 2), d,Zf51’jõRaises(TypeError,ÜP, '1'¥Í7 �1, '2') 8Ðdef test_exp(!):!×" ='dL.'|Context'gOCc = (V¯~X?(10¡ ,/10œû0exp/0ö?fmaöh~ö8 3®4  C2, 3, 4Ú,co52«›j–p/4)Ÿ;s ï1fmaäªàî7`2, '3'O7T3, '4bñô# Issue 12079 forÿ�.fma ...b,Z )§'Infinity'@)s"not a Á"}x÷„@snan€V1.222j#ðA and.2(ä>,Ÿ'u/1)l'ÿŸd1is_¡eth„Þp 2v9|Bis_i±&Àontext = selóf.decimal.Context Cc = %()òd = c.is_infinite(DAF(10)'úself.assertEqual(4o10), d/úRaises(TypeError,or, '10')§ðdef test_is_nan(v%):¬š0 = ê'å 'j �[ /?nan_ormall„2  9qaøf‚ 07osignedk„ 2 9ns‚ 0 ( Asubn<l‡5 < Ozerok‚0 Àis_zero, '10ñ ') def test_ln(self): Decimal = ".d.'|Context'fOCc = %()>“d = c.ln(WF(10)yÁassertEqual(+o10), d&ñRaises(TypeError,]^, '10òOog10õi€ø.û5þbýkbô0ogbö?ogbú�ical_andk†6), á%og?O1, 11d:1¡�±—'zèÂí1, 1? ¿#oinvertØp‰k/00Ù Â11a!y%/00õ‡/or$p&orû?or(ú n3iÊ)l¼ Œ/'1÷";ö xÏÀmal.Decimal  óContext = self.decimal.# 'S c = %()òd = c.logical_xor(DAV(1), 2fÊassertEqual(?01, :d1d:1¡/, túRaises(TypeError,ðP, '1'zá<1?)fÐdef test_max(F%):Uæ ¦'¡ 'gÑÍ ~X Å/2)” 7_1, 2)Iî)`2­/2)dq1maxfœ)_.†4�/2'�O_mag¡k‚E ¥;©-\˜­6±*Bµ!8¹/inµi/in± ?in(­ `©[ÞV/in¡4�¼¡k‚î ¥;©-\h­6V(ðin_mag, '1', 2)# ñ!self.assertRaises(TypeError, c.min_mag, 1, '2') 9ðdef test_minus(D!):V Decimal = ".d.'|Context'iOCc = %()>2d =Ÿ3us(ZF(10)!|ÙaEqual(Í us&?, d)~us, '10þultiplyiƒ4), 2 <_1, 2)=.^/1)71˜n‚z…'tä9 ¾?nexÃo…ZÈ 3/10¹:MÒ /plÔj„¶!9otowardãh†æ?é1p#:ï'F—ò <õ�ormalizeÓi„aó 2ã9à, '10') dóef test_number_class(self):  Decimal = ".d.'|Context' (Cc = %()[éassertEqual(c.”k123), ƒ()L0J/0)H?-45J"))÷dg?plu_cad = c.50ë -1,d[ðRaises(TypeErrorž4m, '10'úOowerZbû€ü4), 4 91, 4), ±p+X/1)41�ht/4)¥¯±°'«Œ6o1, '4' ümodulo=5, b=8, a=2), 1!�quantize$hƒOà 2' <01, à* .^j702ózö2Àö9ù2áremaindåj„X  =Ã/`Ä8Å'DÆðremainder, 1, '2ñ') def test_remainder_near(self):#' Decimal = ".d.'|Context'rOCc = %()>kd = c.‰cT(1), &2)5�ÍassertEqual(B�1, 2), d4jv=1ªzýRaises(TypeError,üP, '1'½"í?^1, '2ê_otateâi�d Ú :Ò,ZÊ5Â(Aº7²Osqrt°hH0} -/10q¸430¬Ïsame_quantumi‡ ’ Ǿ 2rŽ ;Ê'G�Š =Ö_calebÖi�^ ˆ s:Ê,Zˆa8/2)Sv ¸À self.assñ2ertRaises(TypeError, c.scaleb, 1, '2') def test_shift(self): Decimal = ".d.'|Context'iOCc = %()>0d =ž€ZT(1), &2),‡âassertEqual(c.¹�1, 2), d+Xd41�hvØP, '1'¢õÉ6«oubtrac®jƒM ± <´.^·7º(C½9Àßto_eng_stringsh ˆ`0p 6/10vØ =Y0‰oto_scirˆ6=¿integral_exk;to_Œ& :* A._valuenk³Œ.!:.Àlf.assertRaióses(TypeError, c.to_integral_value, '10') ïself.assertRai@û10, 'x') class CContextAPItests(!):m³decimal = C9+Py*:PtsðWithStatement(unit‚“.TestCasezñ # Can't do these as docstrings until Python 2.6®#%P! c?ôhandle __future__ s{!s 5@def 1r_localc¤(bŠt0# Uƒ€ copy of““ current 31 inQblockZ94get = U.S.-‚ /¹_¶orig_ctx = P()Xwith ; ()$Penter8æJ0setM_final! à—4Is(œ%, 9õ, 'did not restore>ŸcorrectlyçWIsNotS«Q›%thRH(;R, '__ô_ returned wrong :#.?arg1„suppliedT2_ ,ï *- /Y2 î=3new;Ê�(prec=42­ 5´¤TEqualo.ï#, Ò seHÀF%, ÌJ\pnested_h_Z7D�]=áT ª' *-|Clamped[XðOverflow = self.dóecimal.Overflow ýorig_ctx = getcontext() Ç.clear_flags3new>C;†Emax=384C¥with local_u as c1:f�ñself.assertEqual(c1.o$, ¥Z7Wtraps7 71c1.ù[Clamped] = True“éc1.Emin = -383®#No±§5,4 u5sRaises(~Ò, c1.create_d¬¯, '0e-999'D°&É /}³)„2„Q2x#, ; h:e:: ªÒ, c2.power, Dï('3.4e200'), 2M sFalse(cÁ# »V3ˆ]hodel c2{Ä[HD1D!V1q„;ò2 © 3 d 1cú�def test_­ð_statements_gc1(})¦H0 = .2.âU Š:5> B 3Ñ'F hŒ4J7N4 c2cVÄ/c1‡¾ÑD2DT šL3LV ¤T·u3u? Ó'_ã ,ð getcontóext = self.decimal.getcontext s - .£with localH•() as c1:#Xidel c1bn1 = C}‰(prec=1)!o+(nv"n1x2x|n|ðassertEqual(c2.‡+, m-À2Ÿ,n2Ä2Ä%È[n[ Ÿ«#()©N,n3’3’ 8lf.{7•3•3•ú3U þ#c3ôy1LcL,n44D©#g/n4³6V:848¬ ¤#c4!d5¾³c4 class C}ïWithStatement()ˆ5NC/Py/DPˆò Flags(unittest.TestCase):m@def  _f(À_irrelevant(,¢åô# check that the result (numeric!+ Jå raised) of anÚñ# arithmetic operation doesn't depend onbrcurrentQCDd F'B ''mInexacÁ'|RoundedN'œUnderflow)+^ClampR'œSubnormalRÈ£Ìws_error(;,AË,)if²R == C�B.Ó[…] = True¡+4if .Rtraps.S0¥– GNelse1V_6Û‹)ú$Cöúñ9, Emin = -4250Vax =  … røðing=ROUND_HALF_EVEN, traps=[], Ãflags=[]) ñ# operations that raise various 3ð, in the form (func1¥, arglist)OM5= [mÿ(context._apply, [Decimal("100E-425000010")]),;Gsqrt92*7add)õ"1.23456789"), y¯9.87654321u\multi²P(xsubtracÉ !]Å:try³° individuallõ then a whole lot at oncegèð ets = [[Inexact], [Rounded �Underflow RClampªSubnormal]¶õO#, M%, K#, I&, GÚafor fnis…`:»dò# find answer and¹Íód using a clean ‰ A."!r_(×c anŠfn(*args0;k#P k, v®U×.items() if vã\çRextraz<4:etsè-R# setàÐ, before callã  Ý6Œá&‰z‚‘…-*d_errorÝ,˜ +Lnew_A £#=‡ñwe expect to beôQafter‰è5#edJ = ¡(Ô ´—ï!if B notži"d ‘q.append‘' ,·sort(key=id³U/awe actéM gotW|¡ bF.– ðself.assertEqual(ans, > �c "Ûó produces differentá@s deFòn–s!_: " +cg@ %s,3‰ %s." % ¬)Ÿ Ü×[,­ áêJèUæ+! "çÀted %s, got ò %s" % (expected_flags, new ñ)) def testñ_comparisons(self):%) Context = “.decimal.'mInexac''|RoundedN›vCc = c(²õ# Valid SignalDictZžóassertNotEqual(c.ÿ�c.traps). %#, 7x3 = JIt+q […] = Truew‡‘äf!×o+"+4³%{}f„d.updatecUdOÄ¥dt[? ÿ@íh (Ì(, k_# Inv[ü‹f:False Š>mu["xyz"]ne:ñ@requires_IEEE_754hÜoat_operationD ÂKâdFloatOE . 5olocalcq(Xwith v() as cÀ�# Ü  is off by6aulA)iè(h[±]¥7ð# implicit conversion sets the Lä0qc.clear|&s(<ƒ•Zp(7.5),  L0"‘² ‚“c.create_ý‹;N# ex=€does notFECx = 8p.from_f�¸=ð­s>›&# 0 æšÊx¿DÀ) ÷ x = c.create_decimal_from_float(7.5) ð self.assertFalse(c.flags[F0¯Operation]6ŸEqual(x, [ ?TruZ ‘#Ù set the trap c. Ÿ0 = d ,ù # implicit conversion raises)�c.clear_ú(ëR:(2, Dg6Ž+ þ—6N# exNŸis silentQ£3.š3{ 4„‚def testmÀ_comparison(g!):%}0 = .©.'|Context'' ‘ . 5olocalcaSÞ*À_attr(a, b, ,`ª×, signal=Noneðôlkpf = getR] Œ#if`J == Ø\lZ°¹œj, f, bYOelseB �Is(f(b),f <hƒ(èMG�”small_d =Av('0.25'^:big 73.0A58X663.0¼JzeroL0LNneg_$-%![50.0o:1u:inft‡InfinityÅ? (-)%cÈO'infF!-"¨¾odoit(c¥ u# Order6I1foræÑ in '__lt__', Ne__'7t$¤1d, –.ƒ)-jgjgjÀrt_attr(big_÷d, small_f, attr, c, signal) ©# Equalitypassert_<(JS�'__eq__'WKNoneU>Åneg_zero_d, ?f, D— CK?Á4'?{ò4infý Bü20d, 9 ö_# IneÐ0big!_'__neÎñDecimal('0.1'), 0.1ËAÔ >  D = G¼0NaN¼ float('nan õdef test_containers(Q=:wùc.clear_flags()õs = set([100.0, —;')]/Belf.Ǫ¯(len(s), 1(qTrue(c.} [Fæ«Operation]ª© #if3 Ü�s•rRaises(]Ë, sorted, [1Ü-.0ÛOelse\ F#FŒù4×b = 10.0 in [ŸÃj, 1.0]Ñ �@{�A:'a'…_:'b'}‰,Çnc = Context§ with localñŠnc) as c¯{@Falsu^trapsu5Ldoit? Èk Á/c.s0 = � X y  Nƒ 6b!T$_oo�_default(*)=Ôê=dV.S.š ''ðInexact = self.decãimal.Inexact ñ FloatOperation= self.dec-  5²context = C %()AÃassertFalse(-z.flags[S]8Otrap8q`aclear_.�[þ�] = TrueD& ¤ -âEá=á7š£) class C[F7( !):¸¥…3(Py'4 PhsSpecial:ós(unittest.TestCaseo0"""S the Uâ templates."""@def ?_$_$(8M}SBasicw yí1�Extended4 73getŒ f-s--uInvalid> ` 9ìDivisionByZero7 5ŒOverflow/)?Und*+|ClampedSÒ{Ð�_signalsÊ(, ¥1, 'ÿ%',\8[*, Þ$, ¿%, Ÿ#, �]M)ŒFsaveÑÄw().copyübb‰iprec =¶.de` 2 Y56f = NonM2try¢)>? = Ue = 441Z;5forf9 in¾,E v?µ(ˆ‘!G �!¹.…IsNot(c,•O.qEqual(cô,Ü.�except EŠion as eÁ‘ex = e.__%__˜ofinalleDØ„ 9WŽÝ]Zif exÑ‚raise exÐ.tdefault{b,Dú ªðBasicContext = só elf.decimal.BasicContext ƒExtendedH = s4 7BgetcJ 2-s--üInvalidOperation` 9ìDivisionByZero7 5ŒOverflow/ *ÈassertEqual(OŸ.prec, 9)/ J23]�_signals(q“, DefaultŸ¥, 'traps',6È[*, ð$, Ñ]9)Ü6aveφ().copy(×d�_._ø+ =¦Ü^•ex = None{Etry: ÁHc = w Csavehc[< "!i = 961Eb óÜh$, {,s·(~)'t|IsNot(cí M.¤6961*�except E>Jas el�µe.__class__'kfinallš à^Hû"D/¨$Zif exœ¡raise ex ¡“ CSpecial+s()CæC = C9+Py*:PtÜ`InputV�‹ò(unittest.TestCase):ç@def "_i¾ Å¡ÜÄ nB u . �]o ¾Y # Ie, Emaxàfor attr in ['!@', '#"']\^0set)«1, 9 × ©g6)7Rãs(ValueError, zA, c,¬7, -öœ#lf @?Typ?W'xyz'×e# Eminpê'A', -ìã é5)6 ¨èD', é\=åÀ c, 'Emin', ³(1,2,3)) ÿ)self.assertRaises(TypeError, setattr, c, 'rounding', -1)A+9@,?1.0B,W'xyz'õ# capitals, clampá@for d in ['&A', '(5']:+TQOValuRU L@!2 ?Ð~[] qInvalidõUibuteàÜAAttr$2¯emax', 100`¿signal dictb¿¶'flags', [] ?Keyš=/{}= utraps',´w #{'DÙOperation':0}9õs cannot be deletedZ {@precwEWP'Emin™Ÿ¨@'ÏÆ±Ppc.__delG1__,- á"s×§ågt'!9†v„sÿconstructor‘”Context, h!=9: Ð?{31?m=î8×=µ )r%_=["P"c:S@=["Q:f #  e\Šuversion#Ô3r_™_(0,1)…š@(1,0sclass CY`InputVû³()ïÂdecimal = C G/Py1H#P IG1SubYòing(unittest.TestCase):Ã@def "_c¦'_s6Nà): decðimal = self.dec# D3 = ."wContext""hlamped""çDivisionByZero) 0hInexact"‡OverflowL$YRound˜"bSubnor&=Undm&÷InvalidOperationš  5ƒclass MyS(%):"¨Ðdef __init__(Çà, prec=None, rç3ingEEmin "ax OS ‚capitals. cÀ CflagF Btrap+ ÁnÛ.É)S!ifÜ€ is not ã L.! =2JN/=UVbR+ = J/axJ0ax J/axJÁN/$= VS,=<MIMáif isinstance(5o, listT&Á = {v:(v in a) for óOrderedSignals[ì2] +*}°VbJ" =( '1if õ×5×&××*× " =¾�3 = ©(œÛ¤_@attrr ('ŒD', 'F ù axm 1-',T{! 'x'ª'ý›ðassertEqual(getŠ@(c, 4), d)æ#1MöRaises(ValueError,�R, **{æF:-1}6c =&(&=1^«c¶/, $‚ 3ã, c.quantize, ¤©('9e2'), 0Ýðrounding ò2 self.assertRaises(TypeError, MyContext, **{'rounding':'XYZ'}) 6c =-((ö=ROUND_DOWN, prec=13y„Equal(c.8&, 91 ò plus(Decimal('9.9')), 9) —… # EminuîOValuï:?':5ç ?=-1Û,7, -–x = c.addÁ•1e-99'), Óß2.234e-2000') x4)0.,ð for signal in (Inexact, Underflow, Subnormal, RãÕed, Clamped):<S@ÒTrue(c.flags[a]y%ax=9yoax':-1z?ax=yGax, xŠ$Ov �K/1e� �"ifGdŠZ == C8…{y pt�capitalsx#>| %/=0�$c.'', (ôscreate_.�('1E222'N òto_sci_string(x), '1e+7ì0# cµêí;?':2t!uEmax=99° - wû ±_I3strí/.0 E+¦ô•ã:à %#=[³ö, DivisionByZero]Ñ ÷1 ô·d�c.clear_�(v�OrderedS#s[v] tOFalsÙ Otrapb ^:^ %^IÀf.assertTrueó(c.traps[signal]) �c.clear_(Bfor -Á in OrderedS>µs[decimal]:GNþself.assertFalseuñ class CContextSubNing()^lC = C?.Py-@óP @skip_if_extra_functionality^ñCheckAttributes(unittest.TestCase): ÷@def –_module_a4 'ò # Architecture dependent c q limitsW0@JõEqual(C.MAX_PREC, P ®1DEMAX1 1 qIN_EMIN1 1ETINY2 ) ÇðTrue(C.HAVE_THREADS is N or B4/(PKK^ °__version__ÍÏ–€dir(C), #P)*Ü qx = [s lgI#C.Þ°()) if '__'s(õnot s.startswith('_')]ÚyPPP( W�set(x) - 1y), ú³úDX/(9û3/C.Q(üÄŸ Coverage1�adjusted(dç0®0 = .GÅX‰9å('1234e9999').f†), 10002NÅ# XXX raise?=t¿ V;nanP0L7>inf7o$�anonical .3getg 58o+E9).c}ÎCx, 9ÚqFc = [0\cSh]\_repr~pSfault2d.copy(®À c.prec = A4250# Ÿc.Emax = oin = -÷ rounding = ROUND_HALF_DOWN\Ècapitals = 0…lamp = 1õfor sig in OrderedSignals[self.decimal]:1¿ûc.flags[sig] = False!Ktrap!"–Åc.__repr__()õt = "Context(prec=$, ø=öU, " \CŸf"Emin== , kLP=0, c/=1GåQ=[], ÎU=[])"iñassertEqual(s, t) ódef test_implicit_cÕ6)MD_0 = n.LÑSlocalC ,~2Xwith v() as c{& c.e 0—1i0U# abs­ÎCabs(ÖÆ("-10")), 10û6_# addH D¬7") + 1, 8DZdivid� �GŠ / 5, 2HO_int“Ll/ 7, 1M?fmaF†.2").fma0P0.01"0HIb3NaNE�ü.is_nan(), True�ÿthree arg poweraç5powš�10), 2, 7 V?expJ …à@.exp¢3I½_ormalOú,ñ4R VAsubn%Y7\P/lnQCùa20").l˜ öFlog1»ÆH1“ }Ologb’!58“0ogbJ ßlogical_inver.:] §OminuG -;DC�multiplyñ2") * 4H_next_”“.6Ð(), 9)  Á# next_plus õself.assertEqual(Decimal("10").5D(), ‰'2E+1'))I¹# normalizea-b6 b/-1c¯umber_clasÇ8h1'+Nw'Ä +œ"-1"), -1DŸremainder| % 7, 3K�subtractJ-Jïto_integral_exS�.12345").BI91) œÿ# Boolean function¨GTruenû").is_canonical(_G9ofinite6LBsnan¨ m)Ýosigned7€is_zero4%œe# Copyõ with localcontext() as c:"éc.prec = 10000x¹228 ** 1523Ty = -'x"úz = y.copy_abs(òæŽ?z, A@negaõ ~D•‡1v �ðdef test_divmod(x)A0 = ".dW.²… ,1ÀInvalidOpera` 5 9ìDivisionByZero7 Õ*sq, r = äC�912837129+;100-~qfŒ10901935j 5r5 940öÈž0NaN–7ƒiqº0nan"End r ØŒc.traps[€Š] = Fals“LÀ c.trap÷s[InvalidOperation] = False ùc.clear_flags()úq, r = divmod(Decimal("inf"),  :õself.assertTrue(q.is_nan() and r7 !c.—Ë)) ©Å'?101ƒ º�infinite¿v_0), 0¹sIÿtraps[DivisionByZerod5/11áš=Ÿ [+ “ ø‘ðdef test_power(%):P20 = ".dQ.'Ìlocalcontext,1ŒOverflow-)|Rounded(TXwith kù6s cË ¥c.prec = 3aRøVEqualUÆ1.0") ** 100\'1.00')ê “Ç]ŒŒ§1§~Emax = lin = -Ö"c. püQ10000ü X("0.5cO'inf…“�quantize–U € v & ©Ø¼ ŽÄ0¥E99).T_"1e1"° xþ“d6_radix $ðgetcontext = seó lf.decimal.getcontext Fc = %()òself.assertEqual(DFÿ("1").radix(), 103c(\Ðdef test_rop(e!):�c0 = ¸µð for attr in ('__radd__', 5sub 5mul ptruedivqu=VdivmoL SfloorAigpow__'¿J¹7`Is(get¨ <,»ò )("xyz"), NotImplemented)æ&e-5HGš1.2345678’5“7˜Q —'10N0S--T10E+8 ý~ôRaises(TypeError,C ("©§O, "5—IL5, 8ôscreate_· ýE· ".CÔ¼�DValu×*c.a|, ["%"]†%Ÿsign(x, 1}ôclass CCoverage( ]êR = C +$Py#,Àmal = P claø&ss PyFunctionality(unittest.TestCase): """Extra f/ñ in decimal.py""" -@def Eó_py_alternate_formatting(selfY]ò# triples giving a -R, a D`ñ , and the expected resultrF)S = P. Álocalcontext!µCµ¥values = [?ô# Issue 7094: Aת×ù (specified by #)@Á('.0e', '1.0ke+0'),$#%.&1.0fCJG ".#gB1‹"".0#Cb# ƒ1.0%;Ç?00%E %.&]E³for fmt, d,£×ÎЈÒ.assertEqual(w(?@(d),O)Ma) cla7�Whitebox2 $A boxÙ 1 ¾exact_power(ðRarely exercised linesä2_>.Éó !Xwith z() as cJ¥c.prec = 8`a4x =Á¥(2**16) **j"-0.5"' “%x,0æ'0.00390625'))£j6j�12885819l "256e7"Ø q1525878Ê :B'-0.ß < _"0.2" "n «q r¹5**2659© 81O � 9Ž*5'R/20Ti2**578¢]ˆd’€immutabið`_operaÿsm6Do ñcheck that it didn't change inéŸl objects…‡DefaultC› ¿á8setÁ€ >f.copy(Qàc.traps = dictó((s, 0) for s in OrderedSignals[P]) åsetcontext(c) öd1 = Decimal('-25e55'6b (d2>h33e+33>}õef checkSameDec(operation, useOther=False):5Ð%if Õeval("d1." + R– + "(d2)"Ý-ó self.assertEqual(d1._sign, b 52int4?int32exp3?exp32› 5›?2._›22._› fOelseywŒ] &d1ñ-|1|+t1}§ &‡"__abs__Ë ¶dd__", TrueÊ &_divmo)/eqN/ne%l%tJgJgJ@floa()�floordiv—Ohash› /inl _truncB ´?mul¯?negl 0booG/poŠ ?pow‡/ra±„þOreprÙ rÔrtsr?sub:ÀcheckSameDecÓ("__str__") ÁcheckSameDec ¿ub__", True&truediv*�adjustedq�as_tuple!compare’ ?max" /in" �normalizŒPquant! ïremainder_nearv Qsame_Y/um+ ?qrt(`to_engß?ing& ±integral") ñdef test_py_decimal_id(self):"*DS = P. ?Cd = 6(456ed[ÿ .assertEqual(str(e), '45''#No*Ïid(d), id(e)À|rescale½¯# CoverageÐ ËÁlocalcontextñöXwith v() as c5Mx„"NaN")._§¶3, ROUND_UP÷5"ˆ¯(x.is_nan(õ]_roun±ôsõRaises(ValueError,Þq"3.1234Åv8, 0Äð class CFunctionality(unitb“.TestCaseX¨"""Extra f/D in ‰2"""p°@requires_e2_2ÄÇsc_ieee_À óissue 8786: Add support for IEEE 754 >Ss to � module.n¥-C&'C.$åDECIMAL32 = C. (64 ,64 8128!2128‡ùMXtñ,Áj(åzèš.clamp, 1‡WzsignalsZß, 'traps', []7Dflag7é1c =~Q(+[½�.prec, 7$ �Emax, 96% gin, -9½ý5resTrJ°/64g °1Œ ±/38K !Em²6383r³À c ó = IEEEContext(DECIMAL128) ÿ self.assertEqual(c.prec, 34% ŸEmax, 614' –in, -6143Oo`_rest(€U, c) ’õ# Invalid values+«øRaises(OverflowError,ìg, 2**6t=V^:&-1«7C1024Çñ@requires_extra_functionalityÐÃdef test_c_cžk!):œµS = C. $c8ó flags=C.DecClamped, trapRoundedÓò_D(, E1 a1b¼ü�onstantsüp# Condi3 ›Z…cond = (·”àConversionSynt«%@Divi~ByZero,F!£ImpossibleQŸUndefined=3FpuPmsInexactAÕË>!POperaú8bMallocX°\Float3B s“Subnormal*ÝQiÑf#`!¶•N#C.go32, 32G*_64, 6H *_128, À C.óù_CONTEXT_MAX_BITS, 512Îcbðfor i, v in enumŠ e(t�  öwv, 1<DmS = C. uÁlocalcontext!Cµb1 = 10**35;$b26„Cv() as cËuac.prec>0? Çi in range(50a =‚dom.rand)yb1, b2)L-b-®1000, 12001­x = a ** bLCy = B0(a)$bHÄò.assertEqual(x, y)Tðüinvalid_constructionþIöRaises(TypeError,Ó¬, 9, "xyz"dïc_input_restric¹# Too large¡ô to be converted„; IÜPOperaØ% .C… RFRë~I+()FS ˜,é,†cN"1e9…f\_reprãa# This5 is õ-only because flags are not printedž#4õthe same order.sDefaultC *ZFloat³ o Fc.copy(€+ê0425ê%00iPc.Emaloin = -ProundJ÷= ROUND_HALF_DOWN\¸capitals = sPclampy+o0sig=O4ÌedSignals[C]¶�Å[sig] = TrueFì_traps "c.< K G"c.C'o×1c._K6__(|Ä"æ(e=B$, 9=7U, " \\Ëf"Emin=~ , ¬L`A=0, U/=1Gõ0=[CvOed, eÐivisionByZero"æL—R Ð, Overflow, RfâSubnormal, Und]R"lž8À "FloatOperòation, Overflow, Rounded, Subnormal, UndS])" ñself.assertEqual(s, t) ð def test_c_context_errors(6!):%HCS = C. ±InvalidOper¦% .Â& ZFloatJ *SlocalµL&8get$"s""ñHAVE_CONFIG_64 = (C.MAX_PREC > 4250T/c’3(ñ# SignalDict: input <8q|²°Raises(KeyE˜ÿ, c.flags.__setitem__, 801, 0)AOtrapA]Value„4del„ˆ EˆE 6M 4Typ‘Ñsetattr, c, ' �', ['x']A'—@y@ •€_{0:1}€ @€@Õð # Test assignment from a ÷al dict with the correct length butIRone i¶U key.5d =bVcopy(Àjdel d[�]9õ["XYZ"] = 91283719Ï :dv<6doIcÅcorner cases–ûint_max = 2**63-1 if ë@elseE31-19g8"_e=o10**18<9kÀ# prec, Emax%inV@for Ä` in [''@', ')&']‡EWQP', °X E™'Emin', -H¸ÓÂtµconstructor2À ],*=týA<A,?in=÷ðïfversioÐ¥1E éŽ(+1£Àlf.assertRaióses(OverflowError, Context, Emax=int_max+1) ïself.assertRaiB Cin=-C/-2C!_clamp†+ˆcapitalsFÍ+# ÿÑgeneral Value,ò for attr in ('prec', 'Emin axo ¾5'):CC@0setgA, c,p#, C†J$ŽKú if sys.platform != 'win32'½,Á-/, ¾ÿEI½51) S ÂÐ: _unsafe_set¤,Kemin%axKñif C.MAX_PREC == 4250 ¸ EÂ[(c, '�5'),pí%g7 uOemaxu`/inuÐ2ÐNÍc€/, UYZ'), 0ÕL 1107Š0Š<s"/ -M8À[_4<t |î!, ª,$['&]R 9S¹ @Àtr, 2)  òself.assertRaises(TypeError, setattr, c, ’[1,2,3]) >ùif HAVE_CONFIG_64:%gOValuhZ2**32fG&E+1) ‘õ# Invalid local context ©²exec, 'with?>õ("xyz"): pass',M³ u6s()ÛqO‹“C=get /()šp#Ecsaved_8 = h%V ?", 98µ hÁðdef test_rounding_strings_interned(O&):ðàõIs(C.ROUND_UP, P �.FDOWN02 vCEILING58 VFLOOR64 IHALFÑ8Íp:<7EVE<< (05~Þñ@requires_extra_functionality#c� _eª2ýsCÜS = C. G POperae% .�Overflow& ÕÓ"&)$"s³"" gñ = (C.MAX_PREC > 4250RécL (õput corner casesgýint_max = 2**63-1 ãP elseF31-1o$# C†general ïf›{ <£'_allcr', �ÖàJ$-K-jðif sys.platform !=ðJn32'Õsâ 9 º!¼I¹ Ú ?{ÁÐ for ÷attr in ('_flags', '_traps'): ðself.assertRaises(OverflowError, setNR, c, ¯int_max+1)J--K*-2Kú if sys.platform != 'win32'½ÈÁOType½ pH »51) …# _allcr�OValuž':G', -X@!L?~v[1,2,3] úif HAVE_CONFIG_64ƒcâG2**3¦~G†o"# ï", í1for½[]Ô 792ÐC 3'x'Gð def test_c_valid_context(i¼q# These,`s are äÐcode coverageí•_decimal. ‚DefaultCWZ = C.*qClamped# 2Und& qInexact SRoundX ‘Subnormal:cJc = °c.copy(?|ð # Exercise all getters andÍ oPc.preS'34r¡÷ing = ROUND_HALF_UP#¹Emax = 3000kin = -Çcapitals = 1.c`F = 0ÞåŽbEqual(¡F, 34`%²,±4 REmin,¬( 1ax,ê' å/, ÀÐö7, 0±ÑqEtiny() /33y @Etop*G2967U munsafeñif C.MAX_PREC == 4250 2c._B@_set4(õ�} )Oemax)@in(-N S‚!, ,0À selôf.assertEqual(c.Emax, 97) >sel0Tin, -019) 2ñ@requires_extra_functionality"ò def test_c_valid_context1(k!):*�‚DefaultC$Z = C.w+Jc = f.copy(Ë\ ÷–_allcr, 1&"c.E = 0ˆ;0ûÙ\roundËõ# Restricted input._sDecimalà !In(POperaK% .SlocalS*&�MAX_EMAX" ‚IN_ETINY ðint_max = 2**63-1 if C.H±PREC > 4250P else'F31-1¬Xwith šv() as cùÒ|.traps[í…] = True‘-¢|Raises(7#, g±("1.23").__ª9__,KO -ó-("uJtšrä@int(Ã?+1)w /C.` y]$(Mf-{ßOverflowErrorÖ12í r5Ó.+14oformat5ªÍ¤ ÿHAVE_CONFIG_64 = (Ÿ‡YKTypec14ªö__, "=10.10", [], 9FMI,/[]× OValuØ #<>ÚÓzmaxsizeõ h íU ‚“a456789<eÔL £"=%d.1" % �øŠ�integralXÀ): DÂecimal = C.D # qInexact ²localcontex! 'Cx = WE(10)ÿself.assertEqual(x.to_integral(), .ùRaises(TypeError, :o, '10'h:o10, 'x=&)öÞ o_valueä'@ê'@ð(CöLö(@ö(@ö)CöXwith ý…() as c:ìN/"9H.9") h–(ROUND_UPØTf,l?'10'')¿I�%�Mƒc.traps[�‰] = True^ æ.u ^Á&, _Vðdef test_c_funcs(_)Ðñ# Invalid arguments8Kì3 6‘Operation% .áDivisionByZero, *8get‰"ŸJ·Âp('9.99eY�÷eng_string(), '99.9E+9'U1Þ�°6pow—¦1), 2, "3"Ü> “ÿ 9).number_class, "x", "yH øsame_quantum, 3KB”÷ß ­ "1.2345678àk6izeB'1e-±e'), []E %�Àuantize, Dec°imal('1e-10ó'), getcontext()  õself.assertRaises(%,©TypeError,1Deckô "1.23456789").quantize, ‹%10E�c ROUND_UP, � ¥with local5e as c:"ùc.clear_traps() ù# Invalid arguments reÆ c.copy_signFÆ1), "x", "y"9‰L ßanonical, 200;Ois_c>'Ïdivmod, 9, 8¼$Qsame_R!umI3IRÅEqual(str(c.À(�Ÿ)), '200'D�c.radix()- ã!c.úÿ[DivisionByZero] = Trueœ` 5æR9).__9O__, ¯ H"c.=->¢“(c.flags[ª­Operation]éé.@| D 7 'J ! O ò lô¯c.prec = 2  NV, pow ¥S, 501šðdef test_va_args_excep¼ s()ªöS = C. �C Æ5x =Â"…1"„þófor attr in ['exp', 'is_normal 6sub lnjlog10'NPS'logb&·p_invert¥next_minus pl ÓB'x1ize/¡umber_clas?"sqUöto_eng_string'];G0funÄ0getè1(x,ð6ÞÌA#, H?="x¼<õAONone�Àin ['compareð', 'compare_signalÿlogical_and', '$ or23maxA_mag #inGÑremainder_neaK`rotate<ascaleb yhift']:Eðfunc = getattr(x, )$ðself.assertRaises(TypeError, Aß, context="x"<6"x"AeNone) { ð x.to_integral, rounding=DR&[]’O"/{}M/@[], ‰Ù o_valueß< Uå/Së)_exactë= Uë0Së–fma, 1, 2Q 1Ÿ ?4(�quantizeŠÂ¼7+ F ~G' %šCZ(Sqc.powerÝj2, mod”c =b?@=@ùð@requires_extra_<‘tionality"³def test_c_—°_templates(¼)¿—aEqual(BhsC.Basic?z._trapsˆðC.DecIEEEInvalidOpera�|âDivisionByZero›Overflow|l@DecU�>uClamped(À¸DefaultºD‘ ”Þð_dict(self):  ñ# SignalDict coverage ó Context = C. sDefault#  +ñInvalidOperation- .áDivisionByZero, *�Overflow$ ‘Subnormal 7Und? qRounded> bInexac SClamp8  3DecX?nal"&Rself.ŒCTrue€Si[sig])|2OelseLOFalsMNJc = ½v.copy()&) … methodsA ¹�vc.traps¼�c.clear_(Lk2k.keys(qN`[k] = %„?v?]valueA «v�™ ), ]Oitem\ tvByÄc.flags.get(1)Ž08Is(-¯"x"), None.\Equal1@, "y63c÷Raises(TypeError, rQ, "x"B_, "z"Õw4len{2), éÚQ = syùesizeof2š#G #¤‹__repr__²1et c/;.;é‚1c._©6.yµ[Ñ]ax aa °j6[1s:# SïQ from¯oionaryÿìRd*d[„ ~8E = dÇÊ V Ji?¡ ¡�%d[œ3à = d aóssertIsExclusivelySet(Underflow, c.traps) õ# Random constructorsåIntSignals = {ó Clamped: C.Dec,!URound!!sInexactB!“Subnormal#%Ü%%"Ov$#ãDivisionByZero) /óInvalidOperation1LIEEE} µIntCond = [ JsºImpossible,áSfinedˆFpuErrorž”ˆsContext.¸oMallocH`ConverfSyntaxi]Fólim = len(Ordered6E[C])ãõfor r in range(lim):�!t! %r])XŠingModesM,@flag¾rç~.sample§6, rª81 =µ?dom@t@Fprec?†ÿ�1, 100006Oemin6-4/, 7/ax70m cÍ72 7capUÖ?0, 2rb3 = ½(D=!, ûAing= p, Emin=. Xax=em£Å �capitals=È!, =!, 1a=list( )ò G$3 )a$aself.a¦‚Equal(c.Öi3ú3ing 8+ , ,3 ax3/ax3[ , \7„Š>Yf = 01T9x±(F |= Ô?[x]Ot_Z?, fœ'œ?Àc._traps, f)3 õfor cond in IntCond:$¡c._flags =( ôself.assertTrue(,ù &DecIEEEInvalidOperation)>9üIsExclusivelySet(5A, c.‚)¶Otrap¶,¶>V¶¢def test_i _override(E)tÃDecimal = C. ø6try*žõ from locale import CHAR_MAXl�except IZErrorD�².skipTest('N.Gó not available'Ï|Ó÷make_grouping(lstÊ$ðreturn ''.join([chr(x) vxsKlst]S´get_fmt(x, $ï=None, fmt='n'c,ö(x).__format__(fmtGi†»E = {1¹"'dˆê_point' : ',',#= a[255, ;0])7Ðthousands_sep<5','Y} £?dotžx¢o3, 3, ž.?sepž.šBy<=fô == 127: # negative ºƒe<ÿ¡ÁRaises(Value>#, £z, 12345ß> ÉuH, 'gHl N3dotInH#3sepHÕ¨ÿexact_conversion¨ŠC`contex¼(C.g* éó üBwithëZ†() as c:#V!c.w[I@] = ¥ .•# Clamped–Dù x = "0e%d" % sys.maxsize%o s#, •7, x| b'(-d*-1&g*ð # Overflow x÷ = "1e%d" % sys.maxsize ù!self.assertRaises(InvalidOperation, Decimal, x) =¹# Underflowxz'(-|9-1)*"ðdef test_from_tuple(I%):\³S = C. Álocalcontext!& * ."Ov& &MXwith ‡†() as c:#´Œc.traps[‡z] = TruÚ-Ž% ”&½y¹# SSIZE_MAXéx(1, (),bäòEqual(str(c.create_d]Á(x)), '-0E+9'E¨§0, 1, 2®iA,, µ †N(e/INeLh0-107iL²lˆmO×_Errorq¼+¼ SÂ" B»h£ b27 bÓ B¤¯# Specials»?"N"°Äb#KsNaNµá?), V@/ 1X)#1'9ºˆ/of¶ðHAVE_CONFIG_64 = (C.MAX_PREC > 425ÎÐ00) ó!self.assertGreater(Decimal(0).__sizeof__(), 0) õif HAVE_CONFIG_64:"Dx = Gº10**(19*24)Q 2y252 ºÆEqual(y, x+8¤Oelse— –?9*2• 14) íðdef test_internal_use_of_overridden_methods(ß)¿NS = C. Toñ# Unsound subtypingp×class X(floatQ�!asŽœger_ratioy(…return 1YA__abs__8 ϱ•Y•T|[1]*200WOI(inê¯bit_length¬ XZ¯Dp(I(1), ®O)öfor cls in X, Y, Z9X}å+Ba.from_Ù(cls(101.1)),äA =9ð @requires_docstrings @unitøð.skipUnless(C, " 2Ò C version") !åSignatureTest(FCCaseÎÔ"""Function s2Bs"""¤iü_inspect_moduleD@attrESdir(P^û0if û.startswith('_'%-‰continueEÀp_func = getG1(P,O c&C&@if (DS == '�A' orQpContext †Ÿ0.is’5(�)Ì„p_sig = 5_4 _c2Ý Šú# parameter names½'!c_� = list(e.6Šs.keys()M8p80[x âxßÖ?} if notÓIxÿ]d m½#, Ž_ EUmsg="à� mismatchÂc%s" % ¸ƒÁc_kind = [x. û:À.parameters.»values()] ñp_kind = [x[1]. ýfor x in p_sig.parameters.items() if notM\ýx[0].startswith('_')] 1&# ]:þif attr != 'setcontext')xñself.assertEqual(cÚ", â,^5 Umsg="” €mismatchÒ%s" % p_func)Ððdef test_inspect_types(�"):#gcPOS = $4._PUõKind.POSITIONAL_ONLY¬POS_KWD9–R_KEYWORDuð# Type heuristic (�ö annotations would help!)Zÿpdict = {C: {'other': C.Decimal(1)Qo'third,x(y(z(a(b(c(?exp*omodulo-Ÿnum': "1"”f': 1.0�roundingoßROUND_HALF_UP2‹E C.gš?()}1PBPB,Ê(Ê(Ê(Ê*Ê-Ê8/P.ÊPÊ}Fâqmkargs(Îge, sig.àG c#kw%{}Õ.cRname,[k“7|Qame =lÜ�Iinuec,ÍØn== POSR*§�.append(ý[ë ][§-])[Belif½]®a N? = dc/seMðraise TestFailed("unex~"ed•àeter kind")  ðreturn args, kw$ ¥def tr(s):ù2"""The C Context docstrings use 'x' in order to prevent confusionNñ with the article 'aBùdescriptions."""<pif s ==r#: Ë?'a'$&y'$b$z$c$_s{doit(ty"ùp_type = getattr(P, ty)˜c$C$@for @OBdir(X m“!if(p.startsPO('_')-‰continue�gp_func·p,\ ¾/c/Ó/Ðif inspect.isiÔ(tªup_sig =8”signature7 Ø6²)Ã/ú# parameter namesö'!p_� = list(£.:Žs.keys().@c<p[tr(x) áxÞcêG]«óself.assertEqual(Y#, ž,ƒ Umsg="¼ö� mismatch–c%s" % £‹Áp_kind = [x. Ó Ÿvalues()]�cI IJ0# '!'ÐÊ%F2Is(ÉÏ[0], POS_KWDÄ 6¶6Z–remaining”_Qif tyÔ�Decimal'½È‹ƒ@[1:]  &A  B ?¥ else: #ðmethods are posiõpal onlybãPC ver.© êBlen(|0), ¿)ùºì›Q# RunºÐ­W_pds = mkA(C, Ùf?tryKºVp3(9)s (*Z‹, **kwdsYÀ excepÿt Exception as err: ÿ{È_e‹À�w+)[C‹ ›]~ñ # Dynamically build customŒ@ def)̈�each fileg�Ÿð # directorñ y and add the definitions toñDDecimalTest class. This # procedure insures that new files do not get skipped.;1for"0nam<ñ os.listdir(directory):+j€if '.decˆ ' R&in@L÷.startswith("."CG…continueXÅhead, tail =Pµ.split('.'))ñif todo_tests is„ANoneAG'in'¿|Kðer = lambda self, f=9:`.eval_(F + f›Àsetattr(CIBM €Cases, '`P_' + ž , .er7/Py85del*,\4ailb! 56try€run_unit„ (*_M&es� b^CC€from docAñ import IGNORE_EXCEPTION_DETAIL„4RsavedÉó = sys.modules[')']1Jif C{G9I = C=+ñ©ð(C, verbose, op^oflags=ºI­I = PtpPpKUgfinall¿` C.setBöext(ORIGINAL_CONTEXT[C]nP* P*0if Í m�warnings. 1('C¼#s AR: no Á (3d _Æ1.',Á9RUserWZ«�„orig_sysJâ{ `raise vð#Failed("Internal error: unbalanced number of chang-?o "²O "†°.") if __ò__ == '__main__'¥"roptparsõ0p =…!.OŽP0r("Vð.py [--debug] [{--}! |Š01 [,²2 [...]]}]"Pbp.add_ã#('>°', '-d', acûÐ='store_true'?€lp='show:e_(šoÁ before each$š r¥', '-sr Àkip over 90%’ÿ¡arithmeticdseñ(opt, args) = p.<_"()ì ifT.~z}#�(X@=Fal R=True7Aelif_<-Ö;,h=Œ!, ­Q=opt. ]+seXÀmain(arith=Tñ\rue, verbose=True) # # The ndarray object from _testbuffer.c is a complete implementation of # a PEP-3118 b6Ð provider. ItA£independenctNumPy's° # and the |ñs don't require ..´"IfVÄpresent, som9¤check both\ ³slògainst each other]EMost7‰Ralso Uóthat memoryview(;á) behaves in #ısame way asðoriginal. Thus, a substantial part of*' #a ðis now in this module°ô import contextlib@unit¿ Ï ,0sup4”itertoolsRpermuÚ s,ÅBduct,drandom)ôrange, sample, choice‚„warnings sy÷j‚, io, osWtdecimalXD@fraceŸF­ try: °I¡* except I$RError2¶w = NoneKN0strõ?>octypes}>Swith œð.EnvironmentVarGuard()KBos.e1, \ÿ lt.catch_"()ñ$Tnumpy!1as _¹$¾à SHORT_TEST = Wo # =2 #¸ R†ÿ lists by format specifier7” # NativedTchars¦1ir ÿÑs. NATIVE = {’’'?':0, 'cbB h 2 'HiI l 2 'LnN f 2 'd`P':0 }w$@ doe/ t ’ø 'n' or 'N': iféBdel ÀQ['n']a@N'] 9õ4{œã# Add "qQ" if �«n<Qmode.W.Gõ.pack('Q', 2**64-1)"�}q'] = 0Q¢Ueâk@pass0StaêdÆ ‰STANDARDÈp(0, 2),PØa1<<8), ã'b':(-(1<<7), l 'B':*h*"15+ *$16Ui+"31+%'IU$32+l+À'L':(0, 1<<3ô2), 'q':(-(1<<63), b'Q':(04+f+d3102D ñ } def native_type_range(fmt):¡"""Return S of a1 1A.""")Òif fmt == 'c'<¿Plh = ©A256))'el+?+)f) ]d4ü: 8&seµó#for exp in (128, 127, 64, 63, 32, 31, 16, 15, 8, 7.ò6tryN°struct.packa , Õbexp)-1ñ%Qbreak›sexcept F^errordEpass6|(gó 1 ifß�& 1 else 01<<=ròñlh fmtdict = {“'':NATIVEž@³<':STANDARD">=!•#ifçá�\ inc�R['@']¥s[fmt] =¤ Õò MEMORYVIEW = ËÝ.copy() ARRAY~k -vqif not Â"bBhHiIlLfd"”Adel QÏ[k] BYTEFMT] ;BbcVLXúvm'] = Þº0['@a6¨1bh@ð # Capabilitiesðthe test objects: MODE = 0 MULP1 capO%á# format chars ð # multiplier 'ndarray':&€(['', '@<>=R!'], 1213'].'D` (['a.R$['7Cnump{76 }nÀmemoryview':n @m�m>nubytefmtë @b7b7 ÕArand³¡_fmt(mode,a,›¯ Ý€dom itemŽ! aÝð specified by a FÑ and a single 3ÁUacter0x =9Š$(*¯I ][ð]û!if� ?@Cs([x+  ifÆ.‘–xgb'\x00ú0Á# http://pro˜±.scipy.org/AÄ/ticket/1925Õ9 �S!1'©½(^ool(xÑVf' orà—7Òðpack(char, x)  ðx = struct.unpack(char, x)[0] $ñreturn x def gen_item(fmt, obj):&B"""R)àsingle random ,A."""%`mode, añs = fmt.split('#')!Ž[w‚for c in/e��x.append(a£range_fmt([“M¹ú[0] if len(x) == 1 else tuple(x)Ù@s(n,›Jxݘa list ofàõs (or a scalar)ï@if np0F¾”Fÿ`lst = °1* niê#(nnK�lst[i] =“;k2lstáæ½ä¼<ò = choice(cap[obj][MODE]K0xfmš)Q+ '#'b³.strip('ambÊqnmemb ='¼ð2, 10) # numberD“ +2ersTGor _ñõ<«Â€fmtdict[ž"])±!¦multiplier2Ý3ULTÝ,á1+= þw * int(@7if >1j =$+¸�ñördø$Ì Íu+!s,ZÚ »ðobj='ndarray', C=Nonx PÖA’om formatZaÌK@ is NÒ= !if ;ÍWiɇ=ò ¥ …χ «v/#ª „ ( +A˜NÙ Piter_a ÙÃñ Iterate through supported /dÅcombinationsÒ[\môÝ$B ing#>Qyieldë‡}ðeÑg!(n,i, testµÜYX(1 ˜ ) ›Áall possibleïPs and1mat_! |åacters plus on�ecompou2 9ing"t·, µ«v$ifÖE != Ž5ö¢< � ") ç‚is_byte_�N@ 'c'­‚Yor 'bðB' in fmt def isò_memoryview_format(fmt): """æ suitable for 31""")qx = len;òreturn ((x == 1 or À2 and fmt[0]P'@'))7u ñx-1] in MEMORYVIEW) NON_BYTE_FORMAT = [c”c+ô fmtdict['@'] if not is_byteÝŸc)] # =2 #®ð Multi-dimensional tolist(), slicingå ße assignments‹7× def atomp(lsÂðTuple items (represent‘ñ structs) are regarded asF$s.ÝrÌM€instanced , ã!) z z6/is2@prodGm¡Product ofZA ele%‹!ifgà=0§„o0G�sc´v vlst[1:]6ax *= v%AxÎñ strides_from_shape(ndim, ,O§ize, layouo£Calculate DÎña contiguous array. L9¡ is 'C' or†ø 'F' (Fortran)ú�ö!()=U ==Uè‹=X(Å Q) + [Aize]EM1i1Brangú`-2, -1¯([0[i]L"+1OOelseˆv( +•B:-1]Î] ‰01, ‚-‚ÙšßA_ca(÷3, sNñ"""Convert flatâ™â to the nestedGQationâ=m  CñR with?H 's'Ùµ��ü¸]ß_en(s))"[0w0lstd0] * s«/A) // .( ° F }Ÿ@stard"i*W£¸eUi] = e[,:+.A], s�7ë3lstŸfŸWj¥pˆ o5O[i::f Àt def carraòy(items, shape): if listpâ) and not 0 in)Rprod(8s != len1FJÿraise ValueError("5!")|¢return _caMš¿ def farra´†f´sindices*ó"""Generate all possible tuples of 7A."""`iterabõ= [range(v) for v—]*CjUuct(*:)Eàgetindex(ndim,i“, stridesð """Convert multi-dimensional0�ex to the¹PitionƒAflat=¸qret = 0š®i+À€r-Tet +=‹P[i] *m)[i×2retÇÔtranspose(src'_T “æ˜þ that is regarded as aç°ò matrix defined byð: dest...[k][j]­q= src[iuk]... ¼f@,¢ðë1srcm G)sš a_from_# ‚, 1, 'C'7d7k[::-1]= es´ [0‚×2srcWÁ ndà ×Ö_fr = c“J+/to+“Ä1t@[to] Yrc[fr_ôsten(lsta3"""šlíM= []š1lstš‡if atompO¿hI[lstˆ~y[0]) + 31:]Š’X §C or ggscalar¸“2 # ¯œÂD‡ƒSsliceNQlst,  1Getêe™0Qafter+Aing: esVa^'H�uobjectsR O[‚Alst[R’s[0]])] +uº4[0]½[b¿9e!Mß-Õ  Î „[“7subt·Òf ø]ß¡m_assign(l>rl¹Res, r äÀl slice assiñgnment: llst and r òre the operands, rlslices* Áre lists of › objects.WDmustJ2havdôsame structure. !ðFor a two-dimensional example, this is not iÈÕed in Python:J ‡�[0:3:2, 1] =ê�[1:3:1, ]2ùInstead we writeLãQs = [ ‚(0,3,2),û]Æ1 r&0U1,3,100Qmulti4€_assign(œ,¯#, �,W)i1"""�if atomp(Æ!):¹areturnCÁmc5, r]E[1:]a eI€for l, rk1zipŸ[˜0[0];Clst[ø)ßÈ)„’¢#¥ def cmp_dèƒ"""Compa»<–Wz]½£$].@‚lshape =Ì_|á r (U7(‚if (len(XP) != ?)¡!-1 bi_XrangeB32if W0[i]YU2[i]ªûZ 9O== 010Š>0”›XF"""RÝr after Ú2ingzœ—=]™i( <Õðraise ValueError("lv  Ž–different�"s"É0?lst�o # =2 #²gRandom¬v7Ð # # PEP-3118fñvery permissive with respect to-bcontena@@y_buRñ. In particular:^B - F±can be zeroï-ÓSides øany integer, including1aoffset0Apoin“6€locationLСunderlyingjð memory block, provided that itú!a öcple of6‘itemsize.Ê€The funcisjQis se3 teYpverify P ¶ðin full generality. A‡�valid iff—3fitiFe # Õ Ï� ð't' (short for 'tuÿ^ple') is fully defined by: # # t = (memlen, itemsize, ndim, shape, strides, offset) # def verify_structureH°: """VeIñ$ that the parameters represent a valid array withinAÆÁhe bounds ofCòallocated memorylpô char *mem: start5ƒphysical4d blockd<)�: length7o82: (y`)buf -e\1"""#ifa% %Š·Ëreturn False/c< 0 or=+Å >b?lenD Wany(vr£ for v in ÷)@…+] <= 0(Â== 0 and notQtXI0us JRTrue (£min = sum( `[j]*(s7a[j]-1)ÁjL`range(†)<Â$ifß1[j]¾#Oimax_>B> 0)¾Å0r +iÑ &axÄ#<=År@get_àÓ(lst, indices¡¸i÷E lsæalst[i] ‡2lstW#s_index(?3, tY@"""LL0ionò!anžj¬ underlyingªDory.Ð-VA = t�3p =Ë×ÎÛEp +=Ê3i]*½ épç÷is_overlapping(à0TheFÇ@ 't'3,ó if at least oneë d%ioˆpis visiw°twice while00rat#ð through all possible tupleºñ$ ÙJ-‹R= 1<<ŽbS ndÂ0@ð#!i y6ory@! biTE1<= 95 anduRS el÷90¤/1�“`[0] * ¨²€for i in,!ge >9[i]¨hQ, max"µV”mq = len(&)z5‘tride = 5¨%dzero_s+1TruÌ4Rn & 1ÌRFalsea3Gs = õ[™ -1Õ%*0-¢â‚ã}8ot œ¾ ['= ž Á‰`-2, -1“™2 *=÷P[i+1]ãb† (if®Ÿâ CnU†((1,-1)[Q2)] *÷?‡1‹K0imi<rimax = $¡0Ø�/Dsum(’2j]*�p[j]-1) Šj;;*²¬6if C 0ù != l - Ú€¾§.<é3 = +0+ (WK+1) . ì8 (-€! +Ž 56Z—?minœ� å,�,ÆQ defÕ±slice_from_ �Ãlen, listlene±"""Create a<1om 40 ofÈ Œäthat fits intoFA."""‡© ar‰a% -=""st4jbep = (DÀn - start) /Ö/ slicelen if ðelse 1 step = randrange(1, max3+1)#o#vstart +F*=#" =(&`, stop"epD2_, tcontrol0ò_indices(s, listlen14if +!\Alen:n¸ñraise RuntimeErrorÑreturn s defÖñ_from_shape(ndim, )Pó"""Create two sets o.òs for an array x with=! 'D'xJ‚uch thataof(x[l~gs]) ==rA."""@)� = [0] * ¥+˜@n inågÖÏaï1[n]Hv  ð@l+1) al > 0 05š3[n]'FQ](blen, l¿o»:Âctuple(}2), S)ß‘_aligned_ƒ¢s(maxdim=5Æ3=16è!(l¼3, r_o4) sÝ8ä#y[«å]), where x isJGO”x' and y- u²':*šÁ4dimÀ1min®A = 2xn0"00´¢if n >= 95Ä<%el'0'W@all_T�om = True`¤000)k8oQFalseœï*Ü;¤)}s*  ,, @smal0ŸöEL9bigA. 0if 1!< g3J,‡,-µ!## ™a_`‚fits the;‘er value.ë66if € rŸ ¾-˜‡çJÇ.Lv(1,-1)[O 2)Ó1n2yj!s_Œ ÈL+Q"_,ØUQomã qC¨�#�¼@‡uZ$I)æ"ofß¡ame length‡óNbiggò s_d×Àslice_from_s“licelen(s ƒ, big) õif randrange(2) == 0:%Ärshape[n], l =F{, small.hs/ Ê = s_big, s_4Oelsep7½p2y 5creturnÇ", Ú‘, tuple(l"$s)rB de%ò items_from_structure(fmt, t)ÄB"""Rd‚a list o:1om =U for <� 't' with1mat¤ñ 'fmtchar'."""rmemlen,Eeize, _2 = :ÞAgen_m(6!//6A'#'+±‚'numpy')Ý|ndarrayÛ8!, 1­t, flags=0ë> Q the P �Qed byc4)Øandim, h,*Ìides, offsetêy(¨5=;B=strCpformat=ÍSÛb=ìÁND_WRITABLE|þ0=_4+9/X0buf±1yte³‘òj, v in enumerateR¾%³¢.pack_intoöqbuf, j*_vTú c&�(buffer=2¢¨œ‚Qdtype¾ «) # =2 #jÿmemoryview castsu7_T¶ƒexportery^8CNonešÁ"""InterpretyBraw ©y'JV' as ‘Rxmasize '‚ize'. Ifƒ=n,\0new�öä is assumed toGabe 1-DZE n *®}6lenZB0givÕ3EusuaI constraintÁ contiguous Àqs prod()g‘óapplies. On success,˜ äk)™‰|sFÖcannot be met@>pa chunkzPbytesâiŸ$edNbas NaN’Qresul%Pfloatêvversiongr'nan', h8adlen = ä .n´Ðif shape:  ðif prod(shape) * itemsize != bytelen: *Ñreturn None, 7Beliff == []5ðif exporter.ndim O0 ork(&se_ãn, r = divmod(³,])ž½¬e = [n]@if rê0P+ä3Vmem =Î too"s(d >d�mem[i:i+`ize] fò÷ in range(0, len(mem)­!] h6Gª;v;c¯+ò = struct.unpack(fmt, v)[0@Ó!ifí3AðX'nan'Õ.�s.append( )¤4s5%) !b else #4[0]&Ñ def gencast—2s()’²"""GenerateN s to test -qing."""%nQ#32CµUyieldêvyd,B4, 6µ1min�@ = 1½3ran$’100) > 80Å2tX&@A, 5)ã_’w)‚ ' =‚O2, 4‚V_ # =2 #^aActual°su7/ƒslices(né,Òall possible (�õa single dimension@ÁÿBuct(�-n, n+1),¬?ge()Äm_â(åФq tuplesª'ˆ'Ÿ`iterabb= [genh©2[n]n|n Ú*K¶rLÿ(n, allow_empty=False[í"omUªT0 ofÎagth n.)õ If zero=True, th˜qmay be v°, otherwise#dy willBqbe non-) minlen = 0°ÁSn]w1Gë1ÉæDê&2"1a_from_ ¦ 9, nCsD!ïEâÙG5”v€À ™ �eÐrations=5): ñ4 """Generate random slice tuples for 'shape'.""" # non-empty -s+@_ inHPge(itVaions): ;Ryield\!(r<(]A[n])lnAandim));¿# possibly w=�, allow_X_=True‰ rinvalid&ùÕÔR0,1,0HÑò def rpermutation+³ble, r=None1cpool =.O2ble€r = len(# ) if r is <q else r7 ™Qample1a, r)) ‡óndarray_print(ndz@"""P ›•debugging 6tryÛâx = nd.tolist(§ðexcept (TypeError, NotIŠamentedu ESbytesFôif isinstance(nd,—9boffsetƒ TRflags &¼2Á = 'unknown'%> 0"Q(%s, È= btrides "ub] Lcñ "format='%s', itemsize'³u=%s)" %•@ (x.u u u", r,;¦p-n!, krð!sys.stdout.flush() ITERATIONS = 100 MAXDIM = 5 QSHAPEò if SHORT_TESTi >’A3E41genRÀ0s_U3 = :`=ò @unittest.skipUnless(struct, ' ñ module requiredQthis 9/')F3, '  objectHõ ') class TestBufferProtocol(¥0CasÝB§setUp(selfu# The s«ps need S±of(void *).IC._™_p = get_.{averify|�, result,æ9=-1i0e�={1}, fmt+‘ readonly�2ß`R-1, sëC5"ls`;Òd=False, cast 1VÍ! b{Ð contents agasó expected values. Default�°# are delibøôely initialized to :Vtypes"ifÛ%÷w²_len = prod*$)*L{ ÌB`if noth : ™ðray has been implicitlyû cast to unsigned bytes ùexpected_len = len(lst)(ùelse: # ndim = 0P E•itemsize )÷+# Reconstruct suboffsets from strides. Support for slicingCñcould be added, but is currently only neededCåtest_getbuf().J6= (ë¦if result.":6èðself.assertGreater(F, 0)ì)â00ÜÑn in range(1,W)iDþif shape[n] == 0"&Ybreak¥<U><>éc0 += -‰44* (~/-1ÞVs = [Dq] + [-1|vã#J-1)]#à# Not correct ±ñq has ocÖdEöthe first dimensionÌí¶j z™of_void_peO0] tryð item1 = get_pointer(result,U Œ1525 ?(ls/ Ðf isinstance(12, tuplª`ñx = struct.pack(fmt, *=•OelseäON®b.extend(xnÿexcept BufferErrorxb»ñTrue # re-exporter does not provide full bT ¿Â]breakñself.assertEqual_31, Û 0!ifq—´�# test toŒsˆƒ m*.2Y, b) t7X?hexTãm = memoryview|tðh = "".join("%02x" % c cb3 ®!m.ƒ?, h¥ÿ)lst := expected multi-dimensional logical representationðpflatten)Tplementsª}C-order6±ff = fmt ifÐN 'B')] ed0 iyQRules&@'A':[Athe hÿ is already contiguous, returÕ:ôunaltered. Otherwise9' aN> 'CÀ@.â1or %0€['C', 'F>A']·cµ"= ” T&#ifW ==QK)›6is_›¿, 'A') or \d?? ;/C'�3P# ForBü@ing x!nd´,@vert 3 # „/ed·0 tolBtranˆ’(As = Upose(a", w‘ ¢Í(K==C,«mat=ff,N •þflags=ND_FORTRAN.V0: #™Êf-ÈÀtiguous(resuÿ lt, 'F') and order == 'C': ñ# The flattened list is already in C-O.H õexpected = ndarray(U�, shape=ß, format=ff) SÒcontig = get_ �uous(resuæ²PyBUF_READ,é)Gòself.assertEqual(Kß.tobytes(), b:ƒTrue(cmpˆD$, ï)Äpif ndimƒ0�’?nue¶nmemb = lenL² ro = 0 if ¶ÿonly else ND_WRITABLEdð### See commentïótest_py_buffer_toü„¼? anpKðexplanation why these RÏs are valid.‹0 To°]*™R'C', "FULL_RO2 ff2), {¯* itemsizeDòinitlst = [struct.unpack_from(fmt, RO, n*K ¢Pfor n‰arange(‹/)]!ifˆ@[0])q1q*²Av[0]Ïvl]›yÖ* Ôvlags=roÞ/mt5 y÷memoryview(y), ñc#0/F'x? = 0F0ÿkÏ|ND_FORTRAN,É®9[TA[-A[MÀ inÿ'itlst = [struct.unpack_from(fmt, contig, n*itemsize)  ÿfor n in range(nmemb)]6‘if len(inˆ¯[0]) == 1:-v*²Pv[0] lvl/] ;òf = ND_FORTRAN if is_Ûÿ uous(result, 'F') else 0H´y = ndarrayµ�, shape=Ð, flags=f|ro,�mat=fmt4÷self.assertEqual(memoryview(y), ¡&))ßÄ#p_format¶)@:tryI?m =` õò+except BufferError: # re-exporter does not provide full in‹9ionPwZreturRex = àB.obj�…instancešé¡2 aP@Is(mNJ, ex}%up.nbytes+¯pected_len5$, 3-, ”¤readonly, _`ndim, +­atuple( )4!ifØû(sliced and suboffsets`ØÂPstridWf h8h#, ;wPn = 12ö;0¾U+lsw l&Wm), nWV6rep“€tolist()f2fmt`}1.to:(< h_rep, �mìˆ�ðdef verify_getbuf(Z�, orig_ex°22q, ¦g=False�A×simple_fmt(exè�B ex.šA['' or%B'gS’match(reqîU(!&Ó ½ñ(# writable request toî-ù f|³D(ex.–�ùPyBUF_WRITABLE)) or<P# can®4`SlicitãDuity‰ 7(/Ï", cÑC_CONTIGUOUS)†VGex.cT HFHfH?ANYJä�À # buf÷fer needs suboffsets ö(not match(req, PyBUF_INDIRECT) and ex.>I) orBP# bufhÿwithout strides must be C-contiguou|rSTRIDES{žVex.c_C�µrSIMPLE| aFORMAT¿kWRITAB É "NDŠ $bY))): Gñself.assertRaises(B ùError, ndarray, ex, getbuf=req)DfreturnXàif isinstance(:G ò is_memoryview_format(ex. )):[Plst =Óvtolist(yJelse,Dnd =±v°RvFULL_ROAW_5nd._~ò,# The consumer may have requested default values or a NULL Ê.Kžro = 0 if»è ) Ðé…readonly>#fmW‚itemsize Bndim 0if ¦  R$# Wö refers to the original abeforeFcastýgLö equality product(shape) *Fÿ= len still holdsH @calc(6) =J¡does _not_I HS%''¥ Úõ _ex.tobytes() # Issue 128342H+NDÂ~E = 1:ö! =DjÍ÷¯@ÁBžG†- Ýõverify(nd, obj=ex,E7*= ´, fmt=fmt, Ô?=ro=%=!, =,�=ö=òlst=lst, sliced=)�“def test_ƒ_(ÛªÖYs = (ßú# distinct flagZ�u$ND ó ÅCÄC_CONTIGUOUS.F8ANY ª„compound¤­b‘eRECORDŒ?_RO-ñçD-éƒàCONTIG_RO,   ) õ# items and format…_fmt = (5ð([True if x % 2 else Faû for x in range(12)], '?'),Bð 1,2,3,4,5,6,7,8,9,10,11,121b1B1›(2**31-x)©!(-0+x)ò®&l'  ö# shape, strides, offse0Ÿstructure0�], [], 0?3,1 9-<-11W6S"r-8@3, 4;¬O-4, y02, [@[4, ›4š!E8c õ # ndarray creation flagsE!nd ká0, ND_WRITABLE xFORTRAN |$TÛaND_PIL,8PIL('¦…û that can actually be used as¸Rreal_6·= (0, PyBUF±jFORMAT4Ÿ$å|3%) ¨‹Ä , Å"inëÒ:%Q% iz¸ÄÖ.calcsize(fmtï,Uõ?:urea96r = [v *‹tQv<W]›:g5 *=5 #EU3in : F$ifÁô(7C&ND_')»;�continue!bif not$ Z?PILVW_� üÊ~s.[03‘Tex1 =G(H,ò‚mat=fmt,š=jIy==× =­ 4Aûex2 = ex1[::-2]ÍONone³mÉïmemoryview(ex1aoif ex2Ám€ I2Ið1.ndim == 0 or w1ã  çðself.assertEqual(m1, �2[?ex2w òvÀssertEqual(m¯2, ex2)  for req inouests:)<-Bbits.al_flag04ðself.verify_getbuf(ex1“ 1,s|Q)sC mB ifÙf­@­,­ G¿sliced=Trueí <‡/m2†9Çöitems = [1,2,3,4,5,6,7,8,9,10,11,12]>õ# ND_GETBUF_FAILGÑex = ndarray(Tá, shape=[12], -== ôô assertRaises(BufferError,X8ÊP# Reqµð complex structure from a siõ exporter. In this·ò"# particular case the test object is not PEP-3118lUiant.Eb8þ†[9], [1]ß .", 0=PyJfSIMPLE0 IoWRITABK2/ND�0STRIDESJ0¿C_CONTIGUOUO1FO;?ANYQ'nd+ex®÷Iö"# Issue #22445: New precise contiguity definition„žpŸ[¶ ,1‡j7,0,7]ý,Porder, 0,ÓzFORTRAN(Ž » ØnÙON|ND_‚FÕ C(is_Ô@ous(F'F')+48C8F5çwçr+°¨?“^— Ond, Ï<Ó1def‘_^`_excepþ s(…)µÇÀarray([9], [S1]) õndm = ndarray([9], [1], flags=ND_VAREXPORT) 5ô # Initialization of a newIv or mut±n existing j.L£for c in (…�, nd.push m %):/·¶valid typesLöself.assertRaises(TypeError, c, {1,2,3}5[57'3'97_(3,4)9!¿3], shape={°"@[ Ÿtrides={1ý!B�M�offset=[ØÔformat={’ G­F-agetbuf� o¡ND_FORTRAN’ is only …’without sa�æ E= †p £œ¡)�# ND_PIL³Ÿ ndim > 0±'(=PIL�"In"Oitem§GValu¨[ã® <X'XXX'A2, fk:"L"MMecombin´µC and;' …struct.ej_[1000…B…µ Òv1,(2,3)O2}ÔO!+2,Ó!Q" {#3 0n =h©MAX_NDIM+1:Ø4]*nç_[1]*nE% }_]-÷!>+s†OverflowqÊÈ{[2**1285q# prod(àA) * y±ize != len( µ»C,4,5¿Àe=[2,2], off—set=3) ù# Invalid strides.ñ"self.assertRaises(ValueError, c, [1,2,3], shape=[ J=['1'])P ˆOverflowSO91],@º ·Ÿ=[2**128]àäcombination ofïB and¼ù ¨02,1 ù1÷f†oformat‡ @,3,4~‚2 ‰3@vO="L":_offse™#Œ—I/=4 d kK3 ß#x" ßI?=""à †struct.eF(G)Pùn>@#$»Sping outîûthe memory boundçsitems =Îù,4,5,6,7,8,9,10]‚L A¸ÃP-3, -ÀÞ5“2Con=Ü¢consumer: ² argument iÔÔ 7TypËÃbytearray(),R>="Q\ „ÿ original base object: getbuf�,[èW U½=PyBUF_FULLSkv€s mandat÷Ofor ­ ß %[ÛC"# �öWRITABLE request to read-only provider�gcBuffer!nd‰“, b'123',Qümñ# ND_VAREXPORT can zôbe specified dur7�6ion’Snd = x@([9]Û˜], flags=]ÝŹsnd.pushHÍM$Boper¨µæ0s: PE/pop4 µ, ŸÀassertRaisesñ (BufferError, nd.push, [1]3) þself.assertRaises:Eop) 0ð # ND_VAREXPORT not set: `ñ /pop fail with exported bŒsDünd = ndarray([9“®(­ÿm = memoryview(ndÈ+0¶ m.release(}²9op('óSingle remaining$: %„‚hdel nd“·get_pointer–WCType3@, {}V,2,3]Õ?`b'123'G åð list(range(100)), shape=[1]*uOValuµnd, [5]s2r?3,4å p /2,@+3c ~ -? �Overflowå0Q1<<64„sA# to å) needs format (ex®1&À33],0F='L'= þöex, getbuf=PyBUF_SIMPLE.ö 2nd.¢ë#b_from_eÿ?ex1¹ 7ex266ex1¦ Ô2Àj6nd.´¬Ï [¥[(1,)*200]g·—g}9 =Õ…MAX_NDIMù •"ÂnNO1]*n‹ Ð #)·_contiguousÐ �D‚ Šô[ÿ, 1, 2, 3, 4, 5D$V—"xyz", 'Cœ�I_2**64IÒÀs, nd, PyBUFÓ_READ, 961) ñ self.assertRaises(UnicodeEnòrror, get_contiguous, nd, PyBUFSNU�'\u2007'r oValueEj? 'ZK*¥255, 'A') ´S# cmpÞ(§ö nd = ndarray([1], shape=[1]%>4TypËWÿ, 1, 2, 3, 4, 5@ {}u9 ª){}ï#isîÌò: Zõ# Cø¯Sr =ü3201ý“def test_ÕÐ_linked_list(W%):±for perm in÷utations(range(5),š•m = [0]*5B CF,2,3G öflags=ND_VAREXPORTâAóm[0] = memoryview(ndΪi§š1_È"¬nd.push([1… q,?m[iu5F@Û[i]].release(ºs zcBuffer ³*opŸbdel nd» ÏÜformat_scalarÑP# ndi¦20: "ªBCfmt,0, _ORiter_S+(0àðitemsize = struct.calcJ(fmt³ zJB(), b=7pverify(Ç•obj=None,·e•= P, fmtZÏ, readonly=1@ (=0œ¯strides=()6Blst=ÖÞ—=–1xG%n]änÌ… = randâ&10d¾+½DÂ(b©«(0, ND_PILR‹ ì�5†]ñ", ÿÑI6v5izeÀ, fmt=fmt, rÏeadonly=1, ñndim=1, shape=(nitems,), strides=(_ize,)J Alst=,!) ró def test_ndarray_format_Yq(self):+  # ‹0 = �|–õ = randrange(1, 30)"‘for fmt, ‚`, _ in rvÙpt-Pize =ïöuct.calcsize(fmt^,b@stepYƒ[-5, 5R*1if )F== 0à‚continue)‡r = [lenz0[::N5])]í)J/#*Ï*€offset =mà*D-1) °®< 0 else 0˜þPflagsÿ¯(0, ND_PILþ™Snd = ÷Æaà]ÂY R ==äÎ=!, ˜= ³90 jÿ.verify(nd, obj=NonewRÙf†rb†Ûf%b©jLtrancÎ.ö 1,2,3,4,5,6,7,8,9,10,11,12;/exÄX(3, 4"Œ){ þóex, getbuf=PyBUF_F_CONTIGUOUS|VORMATA°ñ assertEqual(nd.tolist(), fNW�)tŒmultidim ЕÏΠʥ_4[v`2, 10)�b;I Ÿ²Sprod(L⃄Åpermutations/:ß-ÈäÐ c6ä V˜M˜ë#if¸r= 0 andŽ3 =="™A# C é   câ a/Í O‡öa_from_ž(Þ^_>'C'mœ ls5c½¦J/í�4À fmt=fmt, re¿adonly=1,  Pndim=�, shape=£, strides=IŸlst=lst) sÿif is_memoryview_format(fmt):2¸&# 2Ô: reconstructŸ:ûex = ndarray(itemsà€=€E'ndEò ex, getbuf=PyBUF_CONTIG_RO|FORMAT)Nóself.assertTrue(nd.]o == ():!mvˆ. ß_from_buffer(9sÿverify(mv, obj=NoneÎ~7Dize= P, fmt3O, recLbg2Mk ¡# Fortran þ� Úß,aflags=¿|ND_FORTRAN ôÄÌw('Š!, ˜�ize, 'F'åqlst = fé ç//ndŒ -á2 “def test_óð_index_invalid(øgå# not writable! 3[1]‰F=[1]OKÆð Raises(TypeError, nd.__set.†__, 1, 8;ÇÄ6(ndWQEqual¯!x/mvxÙP# canó¥be deletedõ!, ÓÏ=ND_WRITABLE±�5del8L uæ¥# overflowù7O[gF<<64ê9@E@IÀ self.aóssertEqual(mv, nd) aself.a!ÿRaises(IndexError, mv.__getitem__, 1<<64=s=U, 8) ~…# formatiõs = [1,2,3,4,5,6,7,8]"Ñnd = ndarray(/Â, shape=[len3)],Yÿ="B", flags=ND_WRITABLEà ‚struct.eWnd.__Åo2, 300@ SValue@ >Ö1, (100, 200)Eÿmv = memoryview(¡Â‚ÂÀ4Typ¿ = ¿”‡¶°(1,2), (3,4O5,6)º'/LQ»ù {¹ù ü„b'\x001'À“def test_• _iA€_scalar(`!):)r"#  Ï1Ë/()µ 0"sxAp[()];  _Fx, 1š,_...];,p.tolist¯%nd á@/mvl?mv[l&ËËËÊà 88 px0ù« s ;¿<²z ¼ )%mv£)S nd¢O = 9å _9×5 k9!ndáO = 5l 5l6 m5m—Ìnull_strides�e®Æ(Ø´range(2*4))›P[2, 4`T Ôóex, getbuf=PyBUF_CONTIG¦ `# Sub-ùðs are only possibleÈõ full exporters.¸âòðBufferError, nd.__geti³tem__, 1) õ# Same for slices.óself.assertRaises(BufferError, nd.__getiU?‘(3,5,1)) Fõdef test_ndarray_index5psingle(h!):1•## U�Pfmt, kps, _ in §r_format(5?CSnd = t(5 shape=[5],ívmat=fmt7hi\¬range(-5, Z'°³Equal(nd[i]ž3[i]ý+/GIF*-6”>5|ôif is_memoryview1ûr¦Vmv = -:(ndŒ$�ý mv )MTQ 3U*mv› UBY¡ÿ with null strides³'/ex³ ÿlags=ND_WRITABLEÆ ý0ex,Oòbuf=PyBUF_CONTIG| kFORMAT4¹  Š 6nd.�q_from_b�(nŽ1Is(@eq__Ãÿ, NotImplementeÔò 6ÿ«'°&›å = [1,2,3,4,5] î6_RO1íMåÛåj//ó]gSIMPLEÔñ7ÏsÏrassign e valueæ�Û%_‰?iteå.Àt, flags=ND_·WRITABLE) ùfor i in range(5):*ðitems[i] = single_ '/nd$ ðself.assertEqual(nd.tolist(), S9s) V2ð Raises(IndexError, nd.__set:x__, -6,  çK5J –ÿif not is_memoryview_format(fmtAŠcontinueÞÐnd = ndarray(Åâs, shape=[5], Rÿ=fmt, flags=ND_ÄVmv = �?(ndýz mv? % 7/mv /mv */mv 6 K  ƒ# assignsò value: lobject = r 1`ÍëKDiterF …*7…î_-5, 4±£Å 5+1]Êñ psíWÓr+ZrV“def test_} _iV#_gK�multidim(Äœ_Û†(2, 3, 5An'ƒ = prod(*wêÅpermutations+:)_M1andc(j )`$`§(0, ND_PIL½°A# C rÎ�º‘sæ` ls%cg Ù ¶,º‘l3[0] ?[0]Å9� N`lst[i]Ø4[i]PÀ))  ô for j in range(-shape[1], 6): / òself.assertEqual(lst[i][j], nd ¯.tolist())G„k„2„/2]„’ˆ'[k‹][k]) †ý# Fortran array qnd = ndc(items="Ý, format=fmt,=žaflags=¾|ND_FORTRAN~lst = fr¾<i<0<0<4¹¶ v6|�[5I“def test_  _sequence(L£ 21.19ð Raises(TypeError, eval, "1Ö¸nd", locals@ömv = memoryview(ndF\• mvÕ!} )mv}Ýþî _ªRiter_ '(5 þ 5°H=[5]A¥7h@i, v_�enumerateì’ õ"v,ž:[i]UY.QTrue(bDã&fif is_fÞ;fmtà.“ Ñ/mvO/§ÊÕ 2Ù#mv8ÁÌlice_invalidƨö = [1,2,3,4,5,6,7,8]Cõ # rvalue is not an exporterJ/xl? [8ü¶ND_WRITABLE®m:6(xlÄ€xl.__setÂP__, sçs(0,8,1)JmJë _ full9/exM%Ðxr = ndarray(óex, getbuf=PyBUF_ND) õ2self.assertRaises(BufferError, xl.__setitem__, slice(0,8,1), xr) Jµ# zero stepÐnd = ndarray(Dös, shape=[8], format="L", flags=ND_WRITABLE¤ömv = memoryview(ndÀSValue¿nnd.__g¿O1,0)D/mvD ë?2,4í+eî6ë(È1È/0) \n&0)D|n ?TypÉ_"@%$" <(=ˆ3 I9{})µõ: not implemented0ÔFNotI)Ë ‡?Ö ”Ý3 m 2 Ú di&3ingÅ�/xlóBó /xrFbmyq6(xl mOr€B½_[7:8]MñEqual(xl.tolist(), -|zm{z/mrz mz¦&# Á–5izeÃ3ytüÃÿ'Indim¿À ndarray(iteó#ms, shape=[2, 4], format="b", flags=ND_WRITABLE) ÷xr = ndarray(iteI8F3÷ml = memoryview(xlOrðself.assertRaises(ValueError, xl.__set„ÿ __, slice(0,1,1), xr[7:8]Mð Equal(xl.tolist(), [[1,2,3, Ÿ[5,6,7,8]>‹ãNotImplemented”m” CJm®$²# differing¨xN�Ç«2Ç! sô¶A­z“§ŽAmAz¦�# _testbuÅõ.c module functions)W¤4TypäÔp_indice±ão2), {}ê F&"#O", 1F 0�u0), 4) Óx"¡?PIL‡ Í÷x.add_suboffsetsxey&B"k2`ex, ge³¸=PyBUF_SIMPû« ˜@def _²_FQzero_€(V%):=I4 = ‘,ŽÏ,9,10,11,12]k'12ŽLÔ y± F9å[4:4] = y[9:9]¿Î´&xfܱ `my c_ml, x @$ml¼/mr½ ã <ÚR3R~&I4, 3Æå¢x[1:2, 2:2…?3:3Š À.tolist(), cñarray(items, [3, 4])) def test_nd&ñ_slice_multidim(self):+/õshape_t = (2, 3, 5)³ndim = len('}~ = prodAfor 4õ in permutations+:¯„Qfmt, T¡, _ = rand!(nz.ó ize = struct.calcsize(fmt )ŒPflagsŒ§(0, ND_PIL&Snd = 8^Æ=‘, format=­S= �J lsSc‚ J œ, ¥¡r _}(,I)1:ålisterr = None¼6tryñoø"a(lst, sÛ9�except E�ion as ed¤ºe.__class__V/ndÍ)!nd¶Ï1nd[ /s]—À2if ,3or ÷Œ¡.assertIs(8,6y/lshPdEqual(0.to�#()×d‡-ÿredundant_suboffsets96, 2µº<°üÈH.add@ /exk 9Y úmv = memoryview(ex@š–'jÅŽ¯»ŠÄ” ƒK¹fÒv®‡ ¬À ð if nderr or listerr:  áself.assertIs(4,2)2OelseHðEqual(ndsliced.to�B(), !) Wñdef test_ndarray_ð_assign_single(ž)qðfor fmt, items, _ in §r_format(5-ê1lY*1gen s(,r ,0Pflags/Â(0, ND_PIL):à# Af = 3Á|ND_WRITABLE *Snd = (ò²shape=[5], ó=U.=f±H/exL7ómv = memoryview(exÓi l| = Noneëïdiff_structure. Plst =ø_ms[:]U6try; ˜²lval = lst[%L/r/(/ We6 @len(©P) != ‡é pcept Exion as ³Ô£¿e.__class__Ä#¢ {$nds˜[ eÐשÖ:if z4: #|ñ cannot change ƒuQ¶ T¯ValueError½_W[ga?lst] ?î£ÄMfot is_ör;fmtth�continueS mvª# S'mvS/mvSA©S'AV,‹$, VÀor)  kelse:  ÿself.assertEqual(mv.tolist(), lst)?O, nd5�Is(mverrk?err9ÿverify(mv, obj=ex,¢ ä itemsize=nd. ÿ, fmt=fmt, readonly=0I @ndimEa, shapT �, strides! P 0lst.o!) Éðdef test_ndarray_slice_assign_multidim(¹)Ü…Ö_t = (2, 3, 5K°s = len('~ = prod2foréõ in permutations+:¶UST¡, _ = rand!(nå/€or flags`§(0, ND_PILÙ*_&ÿrange(ITERATIONS,4l7Bs, r Œ a_from_ (Í œFSnd = �(Å0=Br, formaNÂ5î=Æ|ND_WRITABLE’: lsÒc {«¸¯err = None�6try6l Presulsg,yA(lst¥‘Z»�except E�ion as ezººe.__class__[¡/ndã)3nd[]×[ ].Æ›Ä2if ,3or ûë¤1Is(8,6}ø Pô'ndôa �Ðo~ # construc¡ of valid ¹sZNÄ(0fmtîÎfmtdict['@']"ŽPize =€uct.calcíC(fmtÄ4t_­2ureWàize, True, maxèoMAXDIMà X1max �=MAXSHAPÍsf(ņ>*t)Ëß² ¹i¼ðfmt, t)  ôx = ndarray_from_structure(items, fmt, t) 2Àxlist = x.to =() $þmv = memoryview(xGfif is_$Ý_format(fmt):Q} mvoYv{ òself.assertEqual(:!, »¯¿if t[2] > 0{a# ndim ÿ test against suboffsets representation.Ãyvî, flags=ND_PIL=òyy !, ? [ ¿y‚Ã]ž/, b0½÷-]'ï‘if numpy_ þÏshape = t[3]×�if 0 in )D�ñcontinue # http://projects.scipy.org/ŽÏ/ticket/1910rzI¸Ã�*ÿverify(x, obj=None,o1dize=z. -=1¯readonly=0JT0=z.,<1=z.D�, strides OUlst=z Û1def²_íðrandom_invalid(pp# excepÂÂs during consion of ; 2s0Pfor _÷range(ITERATIONS_D(0fmt*Îfmtdict['@']7^ =Áuct.calcsize%v–ß Ìÿ ize, False, maxdim=MAXDIMT 2”4^SHAPE Eqg(Xˆ>*t)7á0 = ´ ÇRtÊ<rnderr =Õ‚>tryNõ'$ E_ as eeœ½e.__class__¢1QTrue(4èž1_À try:  ÿy = numpy_array_from_structure(items, fmt, t) C�except EŸion as e:+?mÿerr = e.__class__ 1ñif 0: # http://projects.scipy.org/OÏ/ticket/1910Hyñself.assertTrue(:R_err)|²def test_nd @rand Àlice_assign(E)Ý�# valid s$ $Uments†÷ for _ in range(ITERATIONSFž(0fmt*Æfmtdict['@']k%’bize = §Ó.calcsize(fmtÌ)“lshape, rl­s¶Us = \¯5’_aligned_5ñ(maxdim=MAXDIM, maxV^SHAPE#@tl =ýdVPize, Š", D©B+�ñ˜ BãB¶ûgverify‘O*tl)7"r7l£ö VOlrr/;´§xi¼ Ç“Èyxd=•=r¶3xl[U‚] = xr[r.]W`xllist%@l.to (Or%r% KmïÏmemoryview(xÖmÖ$½vEqual(m›", ±¤6¬1, xÂŒóif tl[2] > 0 and tréØ`# ndim.:œý against suboffsets representation.)Hy-ß î, flags=ND_PILúOXO .O @y@}Dy©õ†F = yœ) Íö1, yk5o1, yý½ ¶y¶(bºyº( † ¾Ðyllist)  ðself.assertEqual(mr.tolist(), yr :) 5ý if numpy_array: 0òif 0 in lshape orr37ñcontinue # http://projects.scipy.org/}Î/ticket/1910£LHzl =©ÿ_from_structure(litems, fmt, tl)È/zrE rErEól[lslices] = zr[r¹`ÿ ot is_overlapping(tl) and n/r)S0# S{÷ assignment of Z sLà# is undefinedÙoNumPy.1[ÿverify(xl, obj=None,2gUtize=zl. ©=­¯readonly=0O@ndimK!, ƒ Bqstrides6 P, lst1)Ï r ù?=zr-ùG/r.ý#r. ý.ý±def test_nd°_re_export(¦Ýö = [1,2,3,4,5,6,7,8,9,10,11,12] nd†T(;Æö[3,4], flags=ND_PIL„'ex7#nd¥–ú�True(ex.C< & E¹% Is)Pobj, NI"Göex.suboffsets, (0, -1)˜1AFals!c_ü_guous* f*Rx  Qzero_ ¡ # së @î2foroÛ1 ‚ ²å]´0²uï`ømv = memoryview(j =n*mv�%'ndÚ*[]sS .þ]Ü O,3,3à m ›m?3,0mÀf.assertEquaòl(nd.tolist(), [[], W]) ñnd = ndarray([1,2,3], shape=[3,3,0], flags=)>úself.assertEquaw *s [• £ ²“def test_®à_zero_strides(Š%):s #  2forÍç in (0, ND_PIL9� 5 q/=[ ÿmv = memoryview(nd9 Omv, % Õ61, ]`8?, 1aloffset[ b¦range(20)):2], ?&=7š¥ /&/, ' Í_7,8,9µuÌ_from_bufferÅ  ë3ê m].”v m½ ýŸget_pointÜfCiHÿ3EÓxnd[i], ½ƒnd, [i])˜ éù__nullí!exgħ ’T2,2,56� È!ex–Òbuf=PyBUF_ND| fFORMAT« § •%exgÑk?(exOmA., N ¤cmp_contigã0vªgFalse(,äb"123", b"456"}6L(12ô',4py~ 274,32š Ox, y� [1�œ ¯format="B"Q9Truõ¿x, b'\x01')0-4, x‘d„MhashyAa = �.c('L', \y €aðRaises(ValueError, q²ð# one-dimensional  ò b = bytes(list(range(12))) "ì nd = ndarray'Õ, shape=[12])2ñ self.assertEqual(hash(nd), b_å# C-contiguousDv?3,4w%`/2,Ù(�Fortran ßy"_spose\V4,3])^ºö4], flags=ND_FORTRANE£­02,33j¯6±6¶# suboffsetRÆ ìëX2,2,3]6PILïY`# non-�g forma®7‹=O='L'‰Pnd.to{%s(ïödef test_py_buffer_to_¿(Þ&):ð # The requests are used in _IE?.c:Qïâ# to generate 7òs without full in$0ion.©Eing.D‡5= (Û¢# distinct òPyBUF_INDIRECT, tSTRIDES$ND ySIMPLE,C¥# compound  SDFULLF :_ROG'eRECORDz-§�¶D-dCONTIGƒ +õš‡¥ interfaceÕáÿRaises(TypeError, ëš, {}, 'F'õ  �ôscalar, read-onlyk• 29š0(),.wmat="L"b†WRITABLE2�for order¿B['C'¯e 'A']:g­*n, s%)tB(nd,oÕA‹<iJ9b, ¹‹Pzeros�”±Àray([1], shaópe=[0], format="L", flags=ND_WRITABLE) ðfor order in ['C', 'FEA']:&-*prequest, s%)òb = py_buffer_to_contiguous(nd,o#, A‹<õ self.assertEqual(b, b'') �ðnd = ndarray(list(range(8)), shaz2, 0, 7 Bh½ñ### One-dimensional ,òs are trivial, since Fortran and C�'J3†he same.„:# oc5)f#ë[0, ND_FORTRANO Ä5[1]¹ ½h½/f|¿Äqndbytes1.to (W“æQ.žÇ ê-î-DòÖö* 6f, 2, 3< <b<ù ®f, non-še inputÄh 2s€trides=[ CÉŸm›*Œ—ò[PyBUF_STRIDES, KFULLj8¦-¢6g[::-1]L“> ˜>try—1�except BÛ_ErrorhX5nue}H5###:ƒ_MultiÏ}À ### ñ" ### The goal here is to preserve the logical re ntation of# Kòinput array but changEOphysFØif necessary.M ù _testbuffer example:!=! ±'C ¬ KI - <á >>> nd = ndîp(list(rîÿ(12)), shape=[3, 4])B1.to:"ï[[0, 1, 2, 3],CÏ [4, 5, 6, 7!p8, 9, 1I81]]D ïFortran output ->2py_¥ÿ_to_contiguous(nd, 'F', PyBUF_FULL_ROõYø b'\x00\x04\x08\x01\x05\t\x02\x06\n\x03\x07\x0b'Œ ÖÜñreturn value correspondèCthis ˆL forC{$'sð  ÷ [0,4,8,1,5,9,2,6,10,3,7,11] 4»¾ÿflags=ND_FORTRAN=/ndTw~='^�he same,"`š‡ü memory are nowŠ5in ¦Order/_NumPy) cíp takes !5’initializÚµ �¹`Here's#ïÑ sequence in   D ‰  $V™ 0€‹Q=byte~ ¥)UfÉ¿, dtype='B'€›`[[ 0, ÓÔÕ|P[ 4, ÝÞß+88, ç¦Yuint8¨ ›Oõ)f:ú°.tostring(o¦?='F-; ›? 8À= ndarray(buóffer=fortran_buf, shape=[3, 4], 3### ødtype='B', order='F')9 >o>>> ndÿarray([[ 0, 1, 2, 3‰ ÿ[ 4, 5, 6, 7+ ò8, 9, 10, 11]], ½Zuint8´œõ multi-dimensional, contiguous input.ölst = list(range(12)Yõ for f in [0, ND_FORTRAN]:@ rnd = nd ;lst”ö flags=f|ND_WRITABLEcA‘if numpy_C ] naa"1(buAbyte3V(lst)ý4 ,L  Ï:*ñC' if f == 0 else = @Æ# 'C' requesiV;J0: #B0 to5 G1xøYòPsposeí›, [4, 3])l BFˆ†'pexpecteÑ@x.toa*s(­ö£9/nd:NT sM>tryŸ`b = pyøvfer_to_Ø@(nd,D,z ¶>�except Bu=_ErrorfUMnue Nôself.assertEqual(b, ú)/ð# Check that output can be used as the basis Íconstructing}a# a C ðRðis logically ident LVè/.LyY![v|v”+b]Q½5 ÷memoryview(y), ?nd)( ½ eõb, na.tostring(¡ aam iʆ C':9'F'${† w†•‰ † _ƒb¥£? = Ö~$Ö[PyBUF_FULL, 4_RO�INDIRECTí ;tSTRIDES;+NDAeôÀ= py_buffer_ûto_contiguous(nd, 'F', request) ýexcept BufferError:$3U=nueýself.assertEqual(b, expected) /ÿ.# Check that output can be used as the basis for constructingNòa Fortran arrayXðis logically ident 1 to\ inu/.Ray = nd1([v‚þ$v in b], shape=[3, 4], flags=ND_FORTRAN|ND_WRITABLEh '÷memoryview(y), ?nd)9‘if numpy_œ¥ eü b, na.tostring(order='F'aT# 'A'% †if f == è{x4?lst)1Ú = x.tobytes(ENelse{9/nd:FÊÖ[PyBUF_FULL, 4_RO™INDIRECT, ;tSTRIDES;>ND]¥>tryK�b = py_bu}_»A»: Ï0Rƒ¼>µRwith �f Î#Ô/fË—AËñ # multi-dimensional, non-¾ þ<(nd¼ïist(range(12))È'7PIL*U# 'C']ß$C'8Ž6_ROó›â*² ‰ o�Ÿ #`òŒ9 òFÑaspose(Ps‘G4, 3‚À_WRITABLE)  òself.assertEqual(b, x.tobytes()) 'õ: y = ndarray([v for v in b], shape=[3, 4], flags=ND_FORTRAN|ND_WRITABLE)P y÷memoryview(y), Und)) 9U# 'A'ðb = py_buffer_to_contiguous(nd,,ö, PyBUF_FULL_ROÓ ƒ_b, ndý4Wò3–def test_ã struction(Å&):aitems_’ñ = [(9, []), ([1,2,3], [3ölist(range(2*3*5)), [2,3,5])]Pö# NumPy style, C-a:†y ‰ŸOö# From PEP-3118 compliant exporterZ0'ex|Wg=çÑ-8m =<*ex/ð€True(m.cP3,]‘v0ndiyOlen(”£strides = R_from(;Њ, 1, 'C'‡rlst = c{ÿ „Ûõverify(m, obj=ex,¤§Jÿ ize=1, fmt='B', readonly=19±=¶†,Ü=äA{lst=lst¿è *m2Ùm% ý2þ¡1PyMPView_!BÔd(): no] Î'nd²ex, getbuf=ï¢CONTIG_RO|oFORMAT6þ4nd.¿ þ9á6nd.¡Æ{(Y ŒONoneŽ� cformatüŸWSIMPLbÅ �i',{,¹+ÀrtEqual(nd.s×trides, ()) ùm = nd.memoryview_from_buffer() -ñlst = [items] if ndim == 0 else  2ù self.verify(m, obj=None,%�Cÿ ize=1, fmt='B', readonly=19‹5òshape=[ex.nbytes], sý_=(1,)Awlst=lstóõ# NumPy style, Fortran contiguous:Ç2for»!, �2 in_:Hö# From PEP-3118 compliant exporterZ!ex¦aarray(eg=^þ, flags=ND_FORTRANäá:(ex¤öassertTrue(m.f_ä, *µ‘q = len(¦ I”$ =žx*(;âŠ, 1, 'F'>‰f¾„Û /ex[}&¶˜zz}¿(¼ Vm2 = *(m% ý2}þ•R# PILyôe O[1:]iV:PILnIŒeÑcÑ–?ex.Ôë#÷ # Invalid number of argumentNº’÷Raises(TypeError,ñ§, b'9', 'xð# Not a buffer provider3: õself.assertRaises(TypeError, memoryview, {})5ö# Non-compliant buffer provider^öex = ndarray([1,2,3], shape=[3]R'nd)öex, getbuf=PyBUF_SIMPLE.µB‚·&nd7e ¢CONTIG_RO|ufFORMAT>u-•ndim > 64 Šu[1]*128¯format='L'… OValu°ù»66nd.éb_from_Ñwòget_contiguous, nd, D�READ, 'CÂKFK(o[::-1]œ˜—def test_ ¡cast_zero_´(I)ßô # Casts are undefined ifòis multidimensional andu† # =Pains k‘s. These 6]àregarded as C-/l7 byGQNumpya"PyU_GetCš±(), so they³ªnot caughtH1the F forocity in_5().~ƒitems = åC<<Q([0,3B[3,0 U 8[L™-•×True(ex.c� -cmsrc =ÆÚ:(ex"O@src.üG, 'c‹h# Monoè`empty b€ can be 7ç (issue #19014@(�fmt, _, _,Riter_V(1, '–'-Ó'b'›#mó»O(fmtóðEqual(m.tobytes3 N"/@list.A[]) þøcheck_sizeof = support.)y7 p<Lµ `qév9"npalcvobj%õbase_struct = 'Pnin 2P2n2i5P P'(@per_»b= '3n'­e‘1 = ó†range(8)R™(°(A!, ›(|c+ 1 * fAa lýp[2, 4],˜?"b"v*a)tÀtruct + 2 * ³per_dim)) ða = ndarray(items, shape=[2, Ö], format="b"8öcheck(memoryview(a), vsize(base_struct + 3 * wx–def test_?0ñ_module(self): .©õclass INT(object):Q�__init__<[, val%)X`.val =!DC>treturn E Ÿ/DXŸO3dexä¡!Sf(): Ã7¼ values = [_¹9), IDX(9),=ÿ 2.2+3j, Decimal("-21.1"), 12.2, Fraction(5, 2Bÿ[1,2,3], {4,5,6}, {7:8}, (), (9,5ñTrue, False, NonÏtImplemented¬°b'a', b'abc2yteåH), b?bc'yCBr röf, lambda x: x]a“for fmt, _0 in"r_[f(10, ''Ü/ex¦&10¡föflags=ND_WRITABLE´Å/ndK6Fm = ´F(ex)õk±.pack_into( Rnd, 0  š`m[0] =m_oÀassertEqual(){, nd[0]r[ƒ3 = }@calc| o`if 'P'‰:fmtO½ŠcontinueÓÌv467wa_err =« ËY>try7;/×:, vÄ7dexceptð_error` ›m/ ãT#mv'mÂ0m[1Âv2¤`(TypeE¢0, Vw o) as e´‰Ae.__.__¯#ifÿ¶2or 7SObIsNot( ;]c 7d3?elsÓIÏ!1]Ï1Ï® �cast_zero*Aidesè(ð# Casts are undefined if strides contóains zeros. These arrays are ÷-# (sometimes!) regarded as C-contiguous by Numpy, but not byEÕPyBuffer_GetC65().$qex = ndƒñ([1,2,3], shape=[ µtrides=[0])6öself.assertFalse(ex.c_˜*ömsrc = memoryview(exHðRaises(TypeError, ;Á.cast, 'c') ~–def test_R_$�_invalid(S!):,L## u formatö for sfmt in NON_BYTE_FORMAT>Bs9ƒ = '@' +5ñf randrange(2) else`;ðsize = struct.calc(S-‘d‘-d•9• •?‡™W ™1 'Rlist(ûF32))/@2//sZ#],n=êQÝ"Íh  å�, [32//d�.DXé°, sitems, _ôRiter_F'(113 î61Ý*mt+ÖŽ®_‰�!ifØ(isó¹J ¼3;OValu\D,"C b  ;"ÃDbytev•T) andà–ÚVÞ9GÝX áEk/_hH6'h'&d&d& tbB2*2*BjB2,2,Ž t‰ >î%=[nhn¼ ½7120¶^G,4,5JmVwõcorrect number of args#Ê >‰¶N-—, 1, 2, 3A‡CdestÜF typ±‰ À.cast, {})  ó # incorrect dest format ÿ self.assertRaises(ValueError, m.cast, "X")3@4"EY") j#³õ not implemented&Ã/=BÄ/!L4/l4/BI4x5:S# src_óex = ndarray([(1,2), (3,4)], shape=[2],G8="I˜ÿm = memoryview(exG FNotIàƒï__getitem__, 0A"sA?, 8D itolistœYU type[ 6;Å(range(120))8¦1,2,3,4,5]“3=Typ¬$B"`/{}± eKsµo2*3*4*³&…Overflowàc·g[2**64âB/-1?*–_,6,7,K80• Ì [”I'x']ÛpN-D -> OÒ [9ªb _ in “¦3*5*7*11)]™x3,5,7,1F˜.I˜Ì Ĺõ with ndim > 64È'nd… O8O&28‰?'I'U&nd]É'I', [1]*128zØQ->lenAàa multiple of µ?siz �£@�À selfó*.assertRaises(TypeError, m.cast, "I", shape=[2,3,4,5]) ¡# product($ð) * itemsize != buffer 3õ ex = ndarray(list([9 for _ in range(3*5*7*11)])~%])Köm = memoryview(exOselfÝBÝ&…overflowŒ,nd×ËF128)ÅP128],îvmat='I'±*m1Í&nd\!B\2\ if sys.max¦Å == 2**63-1:ÛìP 1.I'B',7; @[7, ð3, 127, 337, 927g649657á;zEValu¨{`2**20,á13z2õIõz 1zOelse|EÏ1, 214748364hKS5uìàfqr3~xœ–def test_;_í(j){Ábytespec = (9®0 (åÁ lambda ex: ÄQex.to2H()))X('b',0Ð[x-256 if x > ó x xR]ScSzÿchr(x), 'latin-1')TÓòiter_roundtrip(ex, m,ÚW, fmt&2src=± struct.cal(,< �­€fmt, to_ ï÷ q:`^mÂq(' X%Xlst =U "æø.verify(m2, obj=ex²& Ô!=1ÿ=ƒÏ, readonly=0A @ndim=&S=[31*4 ],4‰ides=(1,æ ƒPlst=l–¯W=True¸! m3í7€ð self.assertûEqual(m3, ex) þlst = ex.tolist("±self.verifyF}obj=ex,JYÀitemsize=srcÿ, fmt=fmt, readonly=0C ôndim=1, shape=[31], strides=(W)D õlst=lst, cast=True) ¸#` from mt = 0 to 1)m =€quct.calÖF('I'0åex = ndarray(9¹©], format=.Adest& , æ! =“_¶(ex, 'B', 1døm = memoryview(Ñ m2.ê7('B˜ À?2, À z¸1²€²1n=ªÎ¯/1,©¡1x§1§0§Hl¨D[9]*9³»Q± »#I'Û5ize[]ÌHd'=[>Ö"¯��'ZÝ0À'()ÖÔ)&.ñ: roundtrip to/�UbytesÚ0for@#, v@_ in "r_Za(31, 'M5'):7‘•m(„HŠ)ZUiter_¨œm�9fmtXÙ5ñÞn(Õ©0xÿflags=ND_WRITABLEA–def test_´_’p_1D_ND(µ¡ð# Cast between C-contiguous buffers. At le'3oneU mustç¨# be 1D, a*û* °'c', 'b' orU.>\!_t`V0gen°'s(¬,@char)Êfmtdict['@']s*0tfmW ('vð@')[randrange(2)] + G„2t¿N ®.“n = prod(¿A) * Bð ð$ obj = 'memoryview' if is_byte_format(tfmt) else 'kfmt' ðfor fmt, items, _ in rF n,n-)::Iðsize = struct.calc(y00hap10[n]±Rn > 0¢/[]1#ts2_ 0+ [c/] /Óex = ndarray(ÒB=", =¡Fm = VO(ex)it]–q= cast_P(ex, |0, t«!, |=+P2if S� is Noneptðelf.assertRaises(TypeError, m.‰€>)+K�continue!“�== 'nan'”Ip # NaNsDðlists are a recipe}Ÿ trouble.W¯# 1D -> ND“'ndß0 ^á€k m2ä(# B-0ndiDlen(Ç@ qstrides¥. É2lst% to((vsê‘verify(m2ˆO=ex,R‹‡Cize=€@fmt=Ï, readonly=1Fô= !,îæ=áJ�lst=lst,%_=True›1# Nÿ1ÿ m3º2»Ã4&¿†iæ0 = ß&ð_ = exÞ5ex.Þ³ ß3ß ^ÞÂÝ*øÜI î4îÁšif ctypes(#øùmat: "T{>l:x:>d:y:}"âclass BEPoint(Hð .BigEndianStructure):  ø_fields_ = [("x", ctypes.c_long), ("y˜double)] G°point = BEP É(100, 200.1)(ñm1 = memoryview(8 #2#ª1.cast('B'ÿ self.assertEqual(m2.obj, J,«itemsize, š-¿readonly, 0†OndimVpshape, º�nbytes,)^¿strides, (1/€uboffset29)) …6x =åÏJ(1.2… ªx ¦c¦ Fu¢é–def test_#€_tolist(+&):És# Most )7�s are in -æ.verify() etc.9¡a = array.a('h', cÇrange(-6, 6)“m�³a g �/,  .¯5, a žœV[2::3_ y>e"nd á2*3*5*7*11)), º÷ =[11,2,7,3,5], format='L³2eöºE, ex  œ`[(2, 5–u7, 11)]–2�/lhŽóRaises(NotImplementedError, m—•†b'12345'Ž1Ž6"s"3�+p"a",b"bcde&f"¢62,3¤/'s1I×DreprÕJ ’9�r�0.__A6__([[ðTrue(r.startswith(" Ïgetitem__, 0»(1,2,3)ö?iiiø‰áNotImplemented;,ž“È# range—Qlist( 6(7)«7qölags=ND_WRITABLEh©_;ä ©V2**64X<µ w'2.î909¯#RÇ/-8Ä 98<²# multi-dim‘%alŽ K´'12µ?3,4·2\qm[0, 0]àG%2%%3­1'&o-1, -1(@3, -ëzÈF²ê(:–À withû self.assert_out_of_bounds_error(dim=1): µm[index, 0]Afor « in (4, -5:Owiths29~Bm[0,`s¿€Raises(I—E¼õ , m.__getitem__, (2**64, 0))´A10, D?)) BOType‚00, � ? .>.Á€õ# Not implemented: multidimensional sub-views6øFNotIEÀ¹ B0:ðdef test_memory�€_assign(›&):a¥# ndim = 0¾ö+ex = ndarray(12.5, shape=[], format='f', flags=ND_WRITABLEúR}7(exµ[()] = 22.5t—*pEqual(m&,%;1...<3<63.5<bÍ sÌŠ34.7Nµ# read-only´ (ålist(range(7))2&7]‚�D2, 1é›w—¾_« IÐ6, 9?‡2‘ìç=0=1Ärout of „Ò#o-8, 20Ð <5’öpack_single() successõ0fmtóÆfmtdict['@']!0if $•== 'c' or*?')-…continueþ Êu[1,2,3]à ö?fmt8 Læ‚i = rand+V-3, 3M!0m[iâ8¡ùZi], 8;&Wex[i]v î‘b'1', b'2/3'ùI'c',‘ª ÀE) mó = memoryview(ex) µm[2] = b'9'ðself.assertEqual(%,$%) &ð ex = ndarray([True, False, õ ], shape=[3], format='?',A‚÷flags=ND_WRITABLE£¾ 1¾pW¾"1]”¾õ # pack_single() exceptions:J(ndâFb'x'ÕSÕOc', À&ndÛ¬÷Raises(TypeError, m.__setitem__, 0, 100à �õlist(range(120))~�1,2,3,4,5†e1f ¡for fmt, _b0 in dict['@'].£6s():Ôðif (fmt == '?'): # PyObject_Is³P() acw¥s anythingsB‰continue if€Z c'Yú special case tested abov7P m2ý`1.cast´¡3ƒlo, hi =þŠ2d' '˜*f' I£-2**1024, TQ!= 'PÞ÷PyLong_AsVoidPtr8ùnegative numbersItbEValuc2dJlo-1G©FZ"xyz"GŠ'hií # invalid mç º6'c'so`b'\xff'xæõ not implemented‚†„|O"xL".¬ÓFNotI”8Ñ °�[b'12345Ù/"s«kÿ# multi-dimensionalw2x03,4zöø!0,]%42u�`ex[0][ &42{bm[-1,-=3= !2]&43=0# eÿÊ}Pindexwk(3, -4jWwith œð_out_of_bounds_errËor(dim=1): õm[index, 0] = 0 Afor « in (4, -5>ówith self.assert_out_of_bounds_errw29‚Bm[0,` wP€Raises(IŸEMð , m.__setitem__, (2**64, 0)»D10, GDEOTypeˆ00, C߇B .A.ʆõ# Not implemented: multidimensional sub-views6zFNotIEƱ0, [2, 3]) Jðdef test_memorycp_slice(`"):&êñ-ex = ndarray(list(range(12)), shape=[12], flags=ND_WRITABLE)kEFm = j3(ex‡µ# zero step0…z*HValu¢g*¸f0,2,0)sCmC,†ž Bbyte i[1,2])Ç`0-dim Kÿing (identity functionœ Äè(o,À)¹NbÆ](; e(É1[ÏØ váv$/, ñ qinvalidóue tuplei !Ù ù/{}ï Hå A?{})Ì& rvpÿ is not an exporterá™à 1,Ù$[1†]ó# non-contiguousN`assignr¶d¶›0, ND_PIL�?ex1±ÿstrides=[-1], offset=115 €ä|ÛÓ?ex2ƒ024)Ù4ƒAQmÓ@Àx1) ð m2 = memoryview(ex2) ´ex1[2:5] = m!m2) ?ðself.assertEqual(m1,I)E&2&Œ’1:3][::-1’P2[0:2)1]R9m1[*m) *|¢,Q4:1:-”¥Œ4§ /º.¬?–def test_øp_array( &):Á*0cmp-(ù case, a, b, m, singleitem):§ûfor i, _ in enumerate(a&bŠai = a[i½mmŠ Wjai, miVG\' =« ©"'ifj != aiÎ% x#NoÒNa, my2 b2OelsezIw/ta öMó++ì—-ai�’&mi‡OnL«range(1, 5K"Pfmt, �sš7ñiter_format(n, 'í'C°G`lslice71gen ?s(n,0r$0 Ù1aòo.ˆ(¸'0b4 mÚbØWø NOm, aŽ/Å.tolist(), a ATbytesB C€len(m), /a)íÑÆÍz!²¿_err = Noneå¿have_resize+ ?tryöulþ[™)'a™"a[”+À a[Òlslice] = a[r / óhave_resize = len(al) ! /r)=�except EŸion as e:/ƒÿ array_err = e.__class__ 5m-ONone%?tryw &m[mØ §Ô7if tÿ: # memoryview cannot change shapøRáself.assertIs(ˆ¿, ValueErro¾ Alif 0E or ™I n<+/ls Z¯Equal(m, aQ û3Å.tolist(), a E TbytesF G €cmptest(Çò, a, b, m, singleitem)ä@def )_óñ_compare_special_casesJ"):6îaÑ?.pö('L', [1, 2, 3]žb(#7]‡Q²# Ordering ‚˜isons rai¬7v =Ÿ(“wbƒfQðttr in ('__lt__', e gg)xGÖ°getattr(v, ö)(w), NotImplemented}Û?a?v?]°# Released ‘s0e e—æ to themselvesµ'2v.rP(¤ ºOv, v5Not"|A"aDÈ’ ¹Ww¬ kOv, w¯ w�ð# Operand does âi½Pÿ buffer protocolYv e# NaNsrnd = ndH’[(0, 0)],mö=[1], format='l x d x', flags=ND_WRITABLE@nd[0o0(-1(¦oat('nan')#¬‰(nd), nd�ñ Depends on issue #15625:/ð struct module does not underÃstand 'u'. ¡a = array.Å('u', 'xyz')$öv = memoryview(aÿ self.assertNotEqual(a, v" ev, a) _ð # Some ctypes format strings are unknown to the¦uct moduleÊ#ifC:Zä#Rù: "T{>l:x:>l:y:}"&âclass BEPoint(‹ú.BigEndianStructure)\`ó_fields_ = [("x",†Ý.c_long), ("y]~pv% =€†100, 200Gj«‡5 "b©"±bH&P'ã¶TóRaises(NotImplementedError, a.tolist –def test_ùð_compare_ndim_zero(\&):R‚nd1 = ndÓó1729, shape=[],G='@Lä?nd23öL', flags=ND_WRITABLE< )6nd1wœ6nd2ÀGDOv, wwc>_ ?nd2B 9w, ½ ¡1nd1£Ç"ÿFalse(v.__ne__(w)Ê&w&#v)ò0Ïw[()] = 1728bl("+"vì�$1$4$7/eq7& 7'ndÃEµ(range(12)) 12 Äv|ND_PILª/exL7mû'exë8½m�ˆ1m[9 /00  6$#&0: eœ !("Ö1.2, b'12345'1/”o='Lf5s4FhF,Œñ^>À self.asserãtEqual(v, w) £self.asserOw, vov, nd2!?nd2B wB1B 1£¤ð# struct module: not eÍ#ö-nd1 = ndarray((1729, 1.2, b'12345'), shape=[], format='Lf5s'‹8nd2F-GhG,�[öflags=ND_WRITABLEp÷v = memoryview(ndwu#No¸×"Ú"Ý$à$ã$"ndæ& ‰� !f12) x–def test_Pð_compare_ndim_one(C"):1xÁ# contiguousF K0[-5KÁ576, -625, 6 E729]R5S/@hQLK,Ðõ âYB¿E“ ¡ÂHwÃk’,÷Ñ¡,/ì¡ÕOnon-72-â3-* Ly�nd1FAˆ@ˆ8E@h',ŽÛÆflags=ND_PIL¬Þõ, struct module-»"Wh 0cúF,?> Àî–def test_Bá_compare_zero_Ê(ß&):; # Bs inëØp900, 96äI7=[0Ç‹ ;-<W<Ø wù2ÒE!Bc ;§ lS@??= hK >~G iŠ�Æ  À_strides(selcf): å# zero stridesùnd1 = ndarray([900, ÷ ], shape=[4], format='@L')D2D 5t7=[0BAöv = memoryview(nd1]w&2)Õùself.assertEqual(v, > !w!2_ !B! B¡Bw¤ y,‚§uct moduleD ˆ(„O)]*4‚? Li„@ >‹W!L hL�Æ–def test_mò_compare_random_á s(Ö ?!ó single character nativeYU = 10à1for4õ in fmtdict['@m']:#©³fmt, items,j 0 = ~ fs(n, 'Àq', '@',\ÖK€or flagssº(0, ND_PIL)q*'nd¿e4n²›Q= nHm«#W ±m�.H”i[::-3]#j1#T3om óenº_D›range(100C7 ´  DW›ü¤ ¯multidim_c ÿ C-contiguous, different valuñRlist(Ù•-15, 15))ýv3, 2, 5('@'(nd÷J_0, 30Ho:Ànd1) ó self.assertEqual(w, nd2) !#No$v$H1H5w) kõ # C-contiguous, different values, struct module8÷2nd1 = ndarray([(0, 1, 2)]*30, shape=[3, 2, 5], format='=f q xxL')J2JO-1.2Mg< f 2QK÷v = memoryview(nd w2q’n> !k³}wY£õlist(range(30))¤J2, 3¤LR(nd�DèD–òH%21¤G3, 7Eo! b B E �GG7, 3Gk= Qx lŽ­í©®S1Dl—¦s+ !+L 4v, “–def test_Çð _compare_multidim_fortran(•():ÌFÒ  w-15, 15%5É=E@h',J·ðflags=ND_FORTRAN) nd2 = ÿ,ndarray(list(range(0, 30)), shape=[5, 2, 3], format='@h', õflags=ND_FORTRAN)(öv = memoryview(nd1w52) 9ùself.assertEqual(v, > !w!2_!(NoE$ H§Hw­õ&# Fortran-contiguous, different values, struct moduleëdnd1 = ”õ[(2**64-1, -1)]*6“ �?=Qq‘ 9nd2mhqm /qQm þóRî‚w-15, 15„ñ7, 5„l… òq 3õq-öøó” /0lÿ™>Œ?À nd2 = ndarÿ%ray(list(range(30)), shape=[5, 2, 3], format='@b', õflags=ND_FORTRAN)(öv = memoryview(nd1w52) 9ùself.assertEqual(v, > !w!2_ !B! B¡Bw¤–def test_Þð _compare_multidim_mixed(G&):Û!# õ C/Fortran contiguouswlst1 = Ÿ†-15, 15)âplst2 = C`spose(5A, [3¼&5]* ndMAndarô5st1é-é(l':c:2:Ol', –ÊÒ“ ü, struct module¢ù[(-3.3, -22, b'x')]*30&¸[5] = (-2.2($eÈ=_d b cË%_d h cϧÿdifferent values, non-h)ex48 IWBõex1[3:1:-1, ::-2]Þ exÝBb aA�ex2[1:3:`cs(No¨f$i$:v, ¢OsameΣ Ýp[(2**31¢- 0)]*µòW11, 2å?=iiæ&k>kðHÀassertEqual(“v, nd1) ðself.assertEqual(w!2!B! Bc ev, w) ƒõ# different shapeòex1 = ndarray(list(range(30)),-ö=[2, 3, 5], format='b'À ndDõex1[1:3:, ::-2]b?nd2bO3, 2b D?ex2bùv = memoryview(}w2 šyX yš#NoßE$ HiHÄ ï, struct modulÓ/BÓÿkYÔõ[(2, b'123')]*30¨5¨2¨/3s×$eie­ë–def test_”ñ_compare_multidim_zero_‹(†():­Bs inJh¬ 0i�D h5, 0, H@EqÕ ˆœðnd1 = ndarray(lióst(range(30)), shape=[0, 3, 2], format='i') ÿnd2 = ndarray(liDJ5, 0D@Eöv = memoryview(nd1aw52) ~ùself.assertEqual(v, > !w!2_!(NoE$ H§Hw­–def test_çð_compare_multidim_zero_strides(Q&):ë #  7nd1€…[900]*80½w4, 5, 4½/@L¾>;t G0, 0NMÆsÃ!À!Ov, w'1.toîE), w î °,¹¯uct module¿–(1, 2)]*1ÂG2, 5q?=lQÀ?Ã< ÀL¬À  ñ flags=ND_PIL|ND_WRITABLE) ö ex2[2][7] = (1, -2Qnd2 ="Õ1:3:1, ::-2] <öv = memoryview(nd1<w&2)9ùself.assertEqual(v, > !w!› !B! B¡Bw¤õ# suboffsets, different shapeòex1 = ndarray(list(range(30)),-õ=[2, 3, 5], format='b',D‹³O ndh@ex1[‹Š2" ©† L3, 2†bí bës(No0î$ñ$?v, ôï, struct modulp[(2**8-Jo1)]*40B¹$2:°U exÏ–?Bb'fëÍs¤s 5 2 Oi', ö! ãp/@Iq6gîs2!ÿ!üåýðb'hello', b'', %273ü3ü_5s0sP ]Âð2] = (b'sushi',£ b'', 1) õnd1 = ex1[1:3:, ::-2] ô ex2 = ndarray([(b'hello',Ið]*27, shape=[3, õ], format='5s0sP',Pvö flags=ND_PIL|ND_WRITABLEŸ™0][2¶ = (b'sushi€Z ndª?ex2É÷v = memoryview(ndw&2)ùself.assertEqual(v, > !w!2Ä!(NoE$ H§Hw­õ# initialize mixed C/Fortran + suboffsets70lstölist(range(-15, 15)Á0lst\E`spose(5 , ïV2, 5]*N/'-X@l', HqH2d H GpFORTRANN6PILRsBµ"ü, struct moduleÄžbsashim ùsliced', 20.05)]*303B[11]TQramenTÆspicy', 9.45=Y�< 10p 9p ¦ 0>P’lf)œ–def test_Åá_compare_not_eœ#&):½Á# items not "ð for byteorder in ['=', '<>E!']:/>x §2**63]*120š05,2bF+'Q'PNyN,T SO ï „YC3][1I = 1óax?byŒ 9;a, A #?b, F=Oa, bl&LÀ sel÷ f.assertNotEqual(b, x) ñ x = ndarray([(2**63, 2**31ð15)]*120, shape=[3,5,2)],HSù format=byteorder+'QLH')0yxVû, flags=ND_WRITABLE|ND_FORTRAN–ƒ[2][3][1p = (1,  )úa = memoryview(xby4selš—a—B #?b, FàOa, bl&L,–def test_òð_check_released(±&):[ U.�('d', [1.V‡.2, 3.3]Šm1aÅ#m.d(/Q# PyM~öView_FromObject(9’÷Raises(ValueError,¼6, m5#O.casQ/G, 'cé¿# getbufferš�—Otoli™1å to§sŸ#m.2P…sequenceâ} ù eval, "1.0 in m", locals()U�ubscriptVøm.__getitem__, 0LŸassignmenMsM7, 1€€for attr¿¡('obj', 'nI €readonly �@size  _ndim'A'j&qstrides �uboffsetÏc_contiguousGf%' '3%):Tv® XðPibute] Æ# richcomparþ �/m12b{¼Mfm1, m2ý'm1Bi6 9$�#}*7=0Œñ# Many implicitn€s are alNyjn–verify().lt¦ð-529, 576, -625, 676£, -729) õnd = ndarray(t, shape=[5], format='@h')0öm = memoryview(ndÿself.assertEqual(m,  .tobytes()* 5[t]¢1¢o>hQiLl¦w;ö _ in range(12)¹W2,2,3½=½Ž0¾!5,ÀE,2],K6<×m�# UnknownŽõmats are handled: {õ purely depends on itemsize.ã¥if ctypes:ï#\ù: "T{>l:x:>l:y:}"&âclass BEPoint(Hú.BigEndianStructure)\`ó_fields_ = [("x",†Ý.c_long), ("y]~pv% =€†100, 200¹jaØ5 " ßa±", È7¿–def test_0ð_get_contiguous(T÷ñ# Many implicit>·palreadyS4¦.verify().Êõ# no buffer interface 6�úRaises(TypeError, –ó, {}, PyBUF_READ, 'F'Ô+ð# writable request to  Ï-only objectzB¥|Db'x'~ŸWRITE, 'CFnon-Y „ æp[1, 2, „î2ž¦trides=[2]ø6¼ ,ndºAºwscalar,-BGfrom…exporterF Â99q6"L"¸qfor ord Q ['C'Äj, 'A']fÐ ÿ(ÆþI\ë$ [(I~/#  j"ð, flags=ND_WRITABLCE) ðfor order in ['C', 'FEA']:&-òm = get_contiguous(nd, PyBUF_READ,I\6ÿself.assertEqual(m, nd$ •[()], 9) ‚õ # scalar, writable request#Ë ndaE = 9=¬â _WRITEãJƒ™)10šF(O, 10J ê)Rp# zerosòUshapeñnd = ndarray([1], ð =[0], format="L", flags=ND_?ABLQcÿRaises(IndexError, m.__getitem__,  �×.tolist(), []“ ."•range(8))9z2, 0, 7?pòTs¥(m)ý []õ# one-dimensionalÛ KVKhKR¤º9%nd †[1, 2, 3M bà f, non-;( ,27€trides=[ &y> .ø7 ßÔGTypeÓsÓO×q3À self.assertóEqual(nd[1], 3) Õnd = nd[::-1]ðfor order in ['C', 'FEA']:&Còm = get_contiguous(nd, PyBUF_READ,I)6²self.assertš_m, nd$ �.tolist()- 6ÿRaises(TypeError, m.__setitem__, 1, 20?™21& Y1Yö# multi-dimensional, &e input‡aarray(åörange(12)), shape=[3, 4], flags=ND_WRITABLE�¸³TE´"nd¯%m)Œ ™ßð–cBuffer˜ AEB�6'F'åsÖ»šï ¯¶|ND_FORTRANÕ ºm +·X‡ÿ)<º#Cºf‚Onon-†C×6PIL{ ÓEe,xúCJ§G#·« W¶[1,2,3,4,5]í ¦trides=[2]W¼'u¶‡True(m.c®²ðdef test_memoryview_serializing(E&):77# CGÖðsize = struct.calc7('iAa = 9.',  ê�&(a÷buf = io.BytesIO(mð = bytearray(5*size)# õbuf.readinto(b)õself.assertEqual(m.tobytes(), b) *õ# C-contiguous, multi-dimensional*ðsize = struct.calcF('L'xö(nd = ndarray(list(range(12)), shape=[2,3,2], format="L"Aöm = memoryview(nd buf = io.BÈGIO(m0 = ßy`2*3*2*ž"*0�Fortran 0#�1 #2$,—# öflags=ND_FORTRAN#[#\ /#b]@ˆ#‰–def test_û`_hash(?():®æ¥s exporter¤sv . |Ab), /m)0€ mc¹•.cast('c'ìF3,4]ƒÏ —`cjbj7nonœlxle[::-2](„x„ôs»'30íP3,2,5í™ ˜ó0«*nd0 ¼o slice±!0m nd[::2, ::&-1w ½x8¼ x»ÿ with suboffsetsËX2,5,3|6PIL¡ÙSe@ity-ë¥ invariantɆ¸11.''Boa .x¨y‰ XbXM‹'(yX ×aP~- ÷$(a²áÑ ß Àange(12)), só hape=[2,2,3], format='L') öm = memoryview(ndõself.assertRaises(ValueError, m.__hash__) Nÿnd = ndarray(list(range(-6, 6)), s’h’^/12�/= #/< %C–def test_�_release(&):ßö# Create re-exporter from getbuffer(Gƒ), then N  e./‚a = byte0![1¨� œa hHm) #’_¿ ÁB¤ÂšXedel ndA#m."(äµ(1#m,5ö=PyBUF_FULL_RO, flags=ND_REDIRECTŸ7nd2B?nd1D ÖIs(nd2.obj, mf"ø7o1, nd2= ‘# chained s-U :Z( m&m1Ê '2('m1è  24o >#?ê%8z/m2 ]I2%m; tsp# Allow{ònging layout while ¸cs are Õd£ C¢ÇU¯‡VAREXPOR°m•œ^óõnd.push([4,5,6,7,8]Y 5]¬0mutm‘ í QxËÀoryview(m1)  õself.assertEqual(x.tolist(), m1 3) 2õ y = memoryview(m2) NyAE, m2 2/nd2¶m2.release(GyŽð nd.pop() # pop the current º( ¶ „3edel nd'm1€(x*×# If multipleGqs share¥÷same managed buffer, implicitJ1 in9scontext<÷r's __exit__() method should stillLUwork.õdef catch22(b):ÛGwith¹š(b) as m2&*Fpass7öx = bytearray(b'123'Á VxV1V”&m1:j  m1[0], ordj'')¿ˆ"nd†é°range(12)),…÷pe=[2,2,3], format='lªÿ@öx, getbuf=PyBUF_FULL_RO, flags=ND_REDIRECT°Dz = @y@ ì¶Is(z.obj, x` JzJI8HU[0:1]†÷ , [[[0, 1, 2], [3, 4, 5]]]aö # Test garbage collection`2for#ºH(0, * ª¯7µ ñ;*¶xÍÑ/m1’ Ø 4C ƒyt.‡y‡/m2‹"G �3Z*“z“"w3û $$ ¿$ß‘Ë/ ;52[12/ ; 3[âA3; ;/m3<21‰çQÀ= ndarray(m1ñ, getbuf=PyBUF_FULL_RO, flags=;) ý with memoryview(y) as m2:*9_del yïz = ndarray(m2‹"a �z�3�2“z“®catch22(m1û $2$3$ÿself.assertEqual(m1[0], ord(b'1');52[1;2;53[2;3; ;@m1, °5m3 E#ð .release() fails if the -õ has exported buffers.G‚x = bytefb'123'ê3�Raises(BFjError)õ1ªx %ÐeyŒrvm[0] ==˜ú–def test_d _redirect(©"):)D'ndðð[1.0 * x for x in range(12)], shape=[1•—format='d Aa = #.o('d', S )‡qk(nd, a2y¤x“ ºND_REDIRECT1ØyD$7m =R'(zÁL\8ºIs(y.obj, x‡ $z$m$‘ m¥l #y�#×$�[1:3], xQ %1, y-z-å:y, #Oœ4Ãfrom_static_ûr‘fmt = 'B'Gw lsö [0,1,2,3,4,5,6,7,8,9,10,11]ÔÅ# exceptions@±)AType'", �>—, 1, 2, 3d#­5==xR%9(c7(Іõverify(y, obj=x,Rèÿitemsize=1, fmt=fmt, readonly=15@ndim12€strides=jÀ lst=lst)  òfor i in range(12): õ self.assertEqual(y[i], i)&Ydel x%y öx = staticarray(7öy = memoryview(xQyBxQ"ndgöx, getbuf=PyBUF_FULL_ROdDz = -y- m«zG§Is(y.obj, Ë m @õverify(m, obj=z,û‚ÿitemsize=1, fmt=fmt, readonly=15@ndim1ÿshape=[12], strides=[1]5vlst=lst傟, y, z, m‹4ö, flags=ND_REDIRECTrž@ ±5z±Ñ ÑxgÑ€ # ‹ôe==NULL‰ Æölegacy_mode=TrueºÖ yëONone~\K!‘!a 1jC)r?Is(4Ìž* DÀf=PyBUF_FULLó _RO, flags=ND_REDIRECT) öm = memoryview(zð# Clearly setting "õ.obj==NULL is inferior, since itYõ# messes up the redirection chain:+ðself.assertIs(ycf, None� #z#y m  verify(m, Å%y,� ÿitemsize=1, fmt=fmt, readonly=15@ndim1ÿshape=[12], strides=[1]5vlst=lstÅñdel x, y, z, m Ÿ–def test_¥ð_getbuffer_undefined(!"):4È%# &ñproc does not adhere to–Ðnew documentaœuAðnd = ndarray([1,2,3], [OóGETBUF_FAIL|ND_–UNDEFINEDÚžâ�Raises(BÁ0Err=ÜR, nd)Æú¤issue_7385æ x£„©•"òx) if __name__ == "__main__"Ê@unitª.ò() # Copyright (C) 2003 Python Software Foundy„ import H T.mockdshutil„tempfile5sys 4tat otos.pathTerrno …functool-*4lib 0subR’ess from ‹ ¾ß(make_archiveø„register&¿_format, un–ö;getC3s, Rdunpackˆ -‡R "ryK{ª =• s}�SameFilee)\8tarÈ"zi×i]g0sup-.!ÐTESTFN, FakePë B2 = ² + "2" tryÁÂ1grpô1pwdðUID_GID_SUPPORTGÁrue except I¼ÍM/pFalse × _f% reMÀ(*args, **kw )@‘# Pretend§adestin( �|pon a di@ent 8qsystem.°rh1 OS”‘(getattr(êò, 'EXDEV', 18), "Invalid cross-device link")±{_° ¥@ ,p.wraps(açßÄy sbuiltinib = os.uÒ#8 = J%À return fðunc(*args, **kw 3) …finally:òos.rename = builtin_'ò)return wrap def write_file(path, content, binary=False)e@"""W0# *&p* to a ?Ð located at *K1*. s#Ifð is a tuple instead of a string, os.9ñ.join will be used toKqmake a % Y¥*[’true, the�@“opened inÑIAode. 1"""Pif is–4anc «û\x) =§(ë”Pwith oJs'wb' ifxò else 'w') as fpRW1fp.†(U)šHread™ë �RÑ;os from’ÿr’r’&0fp.…(‘qlistdirß�res = []DAfor {Ùin sorted(os.67÷pK_,AP%%ifo!is|—) and notglink(p\;±res.append(•V+ '/'Z#±r¥ E&IF + nMÜÑ5+Xðres class TestShutil(unittest.!CavX¨§setUp(self¢`super(/C!, !.-t�ƒ.tempdir°Y�tearDown\0_Qwhile{e :d =V.pop(A¤‘.rmtree(d¸òin ('nt', 'cygwin')) [0mkdÚ ¿€"""Creat0 õorary directory thatd@clea%#up´‘ZsR›¬^DA+E ìq.�ë ‹ d #dá_ü_works_on_bytesô tmTbylvictimtÇtmp, 'killme os»2ir(6Ÿ©–®(p, 'someû‡'), 'fooUL‚ƒfsencode9aàself.assertIsIó nstance(victim, bytes) Äshutil.rmtre%!) ñ @support.skip_unless_symlink!’def test_>”_fails_on%q(self):,o`tmp = –.mkdtemp(‰ödir_ = os.path.join(tmp, 'dir'( os=0ir(1•? @ÄB , HžùassertRaises(OSError, +8TTrue(Èaexistsk)f .l/”/e�es = []M}!ong(*argsim‘s.append(!< Ê(m#, L=}¢Equal(len(^O), 1)#Is"u[0][0],× isn4]Y7/1]d4IsIÙ202][5±Æ%HworkÆsÇ1ˆGdir1ˆLdir2)#ñ2*3*3)’for d in Hb, 3ƒBˆOfile¸f`write_(w1, 'foo!â L“',7os.Ž2òT0'L3L2ä0 I˜K˜å>MÃ# make sure Âÿs are removed but not followed}€VlOFalsG1GFOdir3.è)6^Ûe  # 5ñname is guaranteedù1to ˆù, = ü0.mk €ÏFileNotFoundŠJ…H#˜Ò that ignore_Âp option¯ ho˜T,@=¯$L#ä1ing ìotmpdirîEæ�dir, "tstwf"), ""Íß 8À with self.a÷ssertRaises(NotADirectoryError) as cm: õshutil.rmtree(filename)$ô6# The reason for this rather odd construct is that Windows sprinkles pð# a \*.* at the end of v wñ s. But only sometimes on – buildbotPðpossible_args = [JIå, os.path.joinו, '*.*')]ßaself.a8öIn(cm.exception.L g<TTrue(seexistsu)2P# tesû°at ignore_eš1s otC hod¢¡,@=�hš‡6= [adef on (*b);‘s.append(!¶P=³¢Equal(len(bO), 2)#Is"a[0][0]õscandir0YU311],|21§IsInstancei02][9`þ Vq;Yã1ã/rmá1¨Çá11][¦/, á;á "P@unit ð.skipUnless(hasattr(os, 'chmod'), 'requir!s.2()'Ê FñIf(sys.platform[:6] == 'cygwin',y‡ "T͋Рcan't be runrC9ÿ (issue #1071513)."~ ÀÐgeteuid') and‹ ()•0Ž€reliably¿Hroot•E6467•±Í2_onX( ¶.�•State = 0òos.mkdir(TESTFNç*5¹addCleanup(2$, /I0`child_|_‡ = ‘5C, 'aÎi9?dir8 b8ñupport.create_empty{ÿ.R‹Ùò²y&0ld_0mod1tos.stat&@.st_þGold_rý6j‘DyCÐpath).st_mode# õ# Make unwritable.ô new_mode = stat.S_IREAD| EEXEC-ôos.chmod(self.child_file_path, L)1 ?dir0hTESTFNST|´addCleanup(•$, 5@old_fØŒ8 ÎFM „LKÑÕhutil.rmtree(Åsnerror=�Òeck_args_to_oÛó# Test whether ö has actually been calledþ]²assertEqualÙy•State, 3,¨M‘"ExpectedX5 tozñ function did not happen.") Oodef chÔ� , @Á, arg, exc):5yr# test_,_©òs deliberately runs 6ñon a directory that is Îö 500, which will fail$a# This“Ó isdm8n s»8s9ñ 99.9% of the time it initi“hs7gremove¯ a W1 in:¸A, soRfirstRwthrough==Ý2os.Y“pHoweverJñme Linux machineØ·ning ZFS onSñFUSE experienced aí´ure earlier¬wprocess<òat os.listdir. The ÀCpmay leg8Pbe eiп1if ²ø¡F < 2"!if«junlink"&Gùlô½f8*el`_rmdir_ ^/seM 0Is(Þ,R  ¤ÆÜ1In(Ù[Vâƒ]B">ð True(issubclass(exc[0], OSE›)9šE+= 1Ï,elÚh{ÙT\•-ÖÕ*¿+6= 3¬uðdoes_not_choke_on_ÈPing_l5²:tryÓ3ori+! =È6)ÁÀraiser(fn, *ø`, **kw \-”ðn != TESTFN:  ùraise OSError() � else:&úreturn orig_lstat(fn@1os.1 = g)r Iúos.mkdir(TESTFN<³write_file( „, 'foo') LÓshutil.rmtree1QzfinallyȞĢñ@unittest.skipUnless(hasattr(os, 'chmodŒÃrequires os.šr@supporC!_uD�_symlink!@def dô_copymode_follow%vs(self)µ tmp_dir = <Gtemp´Psrc =ˆ£path.join(4 4?dst+Fbar'=@src_µ0 z0?dst0 Gquux1ë=src«=dst3os.V(>¯Á"A¡ "»BÀtat.S_IRWXU|Ù G1 # š1 toÏ(h;O;¼ðassertNotEqual(¢A€src).st_,ÉCMHò=»7dst"Belf.jg'Á# On Windows“)¢ does not ´ ƒös (issue #15411Œ ifÏÆname != 'nt'Ø:#I0rc nTX(‹), +1IºSº9µ¿GqA×'IºAbothusv?Á=¢ l§ ¡F¢ç4_to¦¥“À, 'baz')  ðdst_link = os.path.join(tmp_dir, 'quux') -ÿwrite_file(src, 'foo=dst`os.symq>1src`"A¡ "SchmodBÖtat.S_IRWXU|s G1Q$U$lV“', *O[ # Ì1 to%3os.N¿ Nxáshutil.copymodT~:sfollow_9ws=FalseCðelf.assertEqual(~¼!MP).st__,¢Ë 5x5j&Noml2,L5dstHQ# src2q - use zœ‹(Œ>"/, 9 ¶5src¶Ì?dstÌD&, ÌIzò@unittest.skipIf(hasattr(os, 'ÏÐ'), 'requireså£be missingr@supporOt_unlessÄq@def p_ý5_to 2wo_dq(self)::¹¡0 = –.mkdtemp(ecÕ µÂ+3barÒw±07baz0Á0`~“'ñ # silent fail ­€ýsôÈSsC Ùéqos.utim< , _%ôaõÀ ñ! src_stat.st_mtime - 42.0)) # ensure different #3s õwrite_file(dst, 'bar')ðself.assertNotEqual(os.pU(src)u$, 6dstJ`ymlink9,·"‹Jdst_"õ if hasattr(os, 'lchmod'):°Ö2os.iB , ±†.S_IRWXOrPµflags') andl=Ï, 'UF_NODUMPq: s4u°×µ =8lb;+…# followß±¹shutil.copyY$, S,Y"_s“fs=TrueyGû ¼ü?odeû'odMs# don'tș!GFalsZÏ KÒ ifiu  in ’supports_d  M@for q� in 'st_aB!', K'0:ð# The modification 6ðs may be truncatedU€the new ƒ.G…BLess�0get“1ÿ,§-),CG C)CI + 19t¨¤* pAm W ‘!rcض˜' �–7Q—˜“# tell toÅ@ butM  is not a Ò{Û | Ö¶–O(abst! -È0tat¼u% <‹ ú0A.1) "ù@unittest.skipUnless(ï!ch �4 R4ÿerrno, 'EOPNOTSUPP:8'Ê �"requires¢&, tB & EG"Ä@def ç_Ð_handles_harmö_G€_errors(…X�tmpdir = ’.mkdtemp(]¾1Í¢path.join(51, 'V2. 2.£9ð1, 'xxx') à write_file(Ã2, 'xxx') õdef make_chflags_raiser(err):&-×ex = OSError(BF Bapath, Uû , *, follow_symlinks=TruecKéex.errno = err‚Ÿ9 ex{return ‚#4oldc = os.ì!:tryì0for~0 inäno.EOPNOTSUPP, 8¢`/ =[{2ñshutil.copystat¯11, ¶).ð# assert others�Éors break it,Œ Þ +Pß {Rself.~R'#s(+, ÀºÁkfinalln ¦­¦ò @support.skip_unless_xatt{Ptest_;(§Z tmp_dir = –.mkdtemp(Û2src³c.join(4v, 'foo'+Q=src?dstJ?barJbdst, '¿Q# no Ð0 == uproblem!rø’6dst¯Õ# common case:aos.set\(ÆPuser.êg, b'42§,­,3,’ƒCöEqual(sorted(os.lis•O)), ß)á OåUOos.gí/),. —vp# check+{³don't affec– Ÿs^ os.remove(¿MlVÜ@os_emw‘.EPERM, ' ÍÁ@_on_º±_foo(fname,”÷, val, **kwargs&,!if%q'>℟ÏBNelse1Uorig_s�L ’ CdQ5�°> =  -±Uf2In(¬,M·Ý¿ë·ÅšÁ# the source³system not 2ingð s should be ok, too. ÷& def _raise_on_src(fname, *, follow_symlinks=True): 1if 0z == src([ù# OSError(errno.ENOTSUP, 'Operation not supported')eôreturn orig_listxattr¨ ¥ J:tryŸ Pe = os._ �* =0 )Âshutil._copy¦†src, dstˆlfinallŒ{Š ë dÃ# test that lkÁstat copies ws20srcPð s.path.join(tmp_dir, 'the_’t±write_file(¿6src¿Sos.seƒ`'user.K÷value', b'fiddlyS?dst‡ Ç0ƒ;dstB ú¥ dôself.assertEqual(os.g¶Q ¶)·?@�Ä.skip_unless !€@unit°AU@A(has¾ðos, 'geteuid') and ()P!0,GF õ'root privileges requir;×{Šº s(Çð# On Linux, it's only possible to access non-ìcT for ;ª±# which in µ˜ °b. ThisÎ÷should be expandedNôas soon as other platforms gain4Ž@exte? buibutes.Kö0 = –.mkdtemp(Ù* 7foož@src_Ó7baz0Î3 OSdË_œ"¿B€trusted.J»'42p /¬ï 4.3'åVFalsez¹ 7barv1dstj7qux0“ OÅ_œä?ƒ1 =á+F'qU‰3ã]Rd#s( ,î.®  æÂ„ Àos.getxattr(ñ.dst, 'trusted.foo'), b'43') @support.skip_unless_symlink!Ôdef test_copy�s(self):"G tmp_dir = ¥.mkdtemp()!ósrc = os.path.join(41, '˜+?dst+Ibar'V_ª0 z0íwrite_file(srcz3os.û1src_q÷if hasattr(os, 'lchmod' 2os.GBø, stat.S_IRWXU |O_å# don't followpshutil.‚RÜ*˜V=TrueP�ÄassertFalse(� is7_(dst).¥Equal(read.6),  9‘os.removeQ·#È(¯›âÈ %adó,‰Íæoç^0øè¥¥).st_mode,  9X4¢"2 £ÿEµflags') andÏ, 'UF_NODUMP#:.%4�£Rè 5 Ì_%l &€+• 20/, ^�, Ïek=dst°+ if¨€utime in ­+s_÷‰ð for attr inÁ 'st_atime', m ;: ð# The modification *ýs may be truncated in the new file.Kðself.assertLessEqual(getattr(src_link_stat, -),C �C8dst>U + 1)B`if hasWê(os, 'lchmod')ò£Ÿ —¤.st_mode, kh“F6NotIÛ2D ¬µflags') andÈ œÆ'Õ7 ’!) @ð@support.skip_unless_xLâdef test_copy2(] tmp_dir = –.mkdtemp(8ósrc = os.path.join(4v, 'foo'+?dst+7bar+`write_�a Jaos.setÊ Puser.og, b'42Kqshutil.ä-6dst•×ÝñOos.gmê.edst, '›)v¡os.remove(�t®0sym^! °_s¶;7src@¶ :dst+ æ€Ð51-1ê>uá# don't followSä!U(5T /lf=FalseVATTrue(  is?àý2s!ad0 ),Q#re5C#ũê)9jürmtree_uses_safe_fd_version_if_available�2,@func|Ñs = ({os.openÞT unó •rmdir} <=œ  þÙsœ0_fd_4@listË in^s>°+} k=if Ü6… 6ð) se÷&lf.assertTrue(shutil.rmtree.avoids_symlink_attacks) útmp_dir = self.mkdtemp(%ód = os.path.join(6Z, 'a'+ osDJir(dItry:y„Rreal_­�½�_safe_fd5ýclass Called(Exception): pass.ðdef _raiser(*args, **kw )‘•-` Oa ¤$ =d1V¢RY"s(º#, Kÿ+, 0ofinall47‚M†Jelseææ�EFals30_usnP_funcP '7¾j‰ƒDtest³ðdont_delete_file(]��# When câ` on a 'ò instead of a directory, don't QA it.uÊ€handle, ¸0 = ÙI@.mks å’os.close(3»›a¿TNotAD}]ErrorËpC¢os.remove(Ÿ@copy­^_simp 3srcŸ²¾ £3dst% ¥:emp2 , 'destinaãºçšddCleanupH#, †Ô0 ‡ƒdirname(¡)A4wriþ(^0, '&Ç.txt'), '123¢X\ˆ ;'e* qa456') Ÿ>i¡§Î*䆣 is(²= |³YÑ<_isdirJ Ò)J• K,Þ Â‹Òactual = readó tbEqual(C Z Í[…f õ@support.skip_unlesS°ËqsÙ6ë2lÏnðsrc') dst_ódir = os.path.join(tmp_dir, 'dst') 0sub /0srcg, 'sub/“os.mkdir(!IR´write_file(70, '`.txt') 'ooe\Mlink•Z0, '1@dst_ 1õ@sub/"5`os.sym(*~5£07)?êÐif hasattr(os§‰chmod'):?Aos.lBø, stat.S_IRWXU |O_ µflags') and{LÏ, 'UF_NODUMP€: ‚4uæR\l 6&áhutil.copytree"Eƒlgs=True9 elf.assert‹ isÄL•`oink'))NPEqual@OreadL,«ç&ˆª*5ˆ&/s"ÔI]¤.st_mode, ¤c ù e 2 f!) -”def test_þà_with_exclude([ñ# creating dataBcâ/µgexists ôAtemp·0mkd ( :tryˆH6|(/ ;-§estination;°ÖÖ?1235!mp 5Z§ì0, 'l¥'š .:¦;456¦q 2r/2's1‹ñassertRaises(shutil.SpecialFilez,Åž9", Ó2†>yI __$__{znfinall…rremove(²l!5r@supporh!_ui�_symlinkU BÂBß5dir«LÚpubdir =³“path.join7A, "s"E^ Ñ O(,y O ”dY(2 cõIB¼ù1�¶{!  µ 4’le®Ñs = e.args[0]ëÀ{¢Equal(len(8J), 15¡src, dst, &@_msgaja§"`%s` is a1" %V {;elss�©elf.fail("ðshould have been rWd„D)rm…qignore_ïWs=TruË…¬ 6?2, 7jsçT_func®+_2rc_D¬†mkdtemp(3dst!6os.e .ã, 'destination6_Qwrite«2((sk0, 'LP.txt'x71231Ÿ n ;�&')£e* qC456'£¦copied = [ÀEíµ‘â5q.appendÛ&Xï,ñÿRð, copy_function=ƒ_copy) ñself.assertEqual(len(copied), 2) *ñ @support.skip_unless_symlink!�def test^Ôtree_dangling' s(k"):Q~D# a & Mñ raises an error at the endh8 src_dir = R–.mkdtemp(Ô3dst!Áos.path.join€.ö, 'destination'>3os.�ú('IDONTEXIST', M…0, '÷i.txt')Domkdir(4£4Ãwrite_file((ã^* jg, '456µ ÇRB (E?�, shutil.õ—%, [&âY‘ñis ignored with޵proper flag–O+ =(`£ u2Á ¨X,†XV=True{ fNotIn(¡Ã@listšX)4 if¦stû)3û�wëèÊ ~†D%):úM‹HG @real— G¥Oopen|5 R'w'ÚEpassëÕY%),6G6C2_toÇ9�target_is$aectory€º æ>Åos=Fals/6 isšB40, '¶ù~“ TE#[GK ttp5{‡, methodÉðfname = 'test.txCt' õtmpdir = self.mkdtemp() Âwrite_file((,ö, fname), 'xxx'+%û1 = os.path.join4WK2xqmethod(T#, / l>l2¡mtreturn MT12) ð@unittest.skipUnless(hasattr(os, 'chmod'î€requiresáD@def C`_copy(H!):cð # Ensure that the copied †ñ exists and hasõsame mode bits.I0!1,7ùg.r�pshutil.ƒ&%´assertTrue(.w/2)/PEqual0Astat)`1).st_™,2S8—]utime—5 —2˜81andaßÐmodification •¸&2й_“ µª$2$w515ýI¸@for ;� in 'st_a!', m ?!Thî Cðs may be truncatedQ=1newGèBLess¼0get‹Ä,œ%),<<ì<F + 1ï if·f,tflags')Ò1E $ ÿS>Å Á>«„support.ÛQ_zlib>Îmake_tarballE°creating so² ato tarE\àroot_dir, base õ_=]Cs(''•5ð*—‚# force ÷B to MC•directory…ƒos.rmdir�ó`# work¸àwith relative Âs@$»D0dirRArel_ë�M>! ?¨, 'archive”¥´change_cwd(�i7V_Ww0absÐ(rel_base_namGe) ô0tarball = make_archive(rel_base_name, 'gztar', root_dir, '.') Jô # check if the compressed aµwas created�óself.assertEqual(-%, |Æ + '.tar.gz'º9ôTrue(os.path.isfileG)10tar*C.is_ 5@withÀ*Dopen$P, 'r:‘u as tf:ÑœDCounÚPf.getNIs(),15@['.'fE/sub /2';@ './´18 2 1sub93']½Çtrying an un¼5oneª ðsupport.change_cwd(work)ÊX V J {/')ƒ@def Pinfo(‰ , bæ=.!ú*arø =M\ñ#f.sort(·Ñreturn tuple(&»£S_äs¨<§dir='dist'³#‚ë`someth to—Œâ0 = ÷‡.mkdtemp•V4 = tTjoin(6º6dirÅ0os.\Pdirs(<°, exist_ok=½)QwriteË()'Ø—1'), 'xxxå+2+Ekdir%±‰']'W"!, ‰3^ '2'_"ifÙ+di xKo'outeru*ó‘@§Ñrequires_zlibâð@unittest.skipUnless(shutil.which('“¢ 0'Ne× he7ê³mand to run¢šeAÂ!_vg �Àu_×"è € «3, 'É‘À tarballñ = make_archive(base_name, 'gztar', root_dir, sdir) õ# check if the compressed tarball was created6óself.assertEqual(-c�ß + '.tar.gz')9ôTrue(os.path.isfileG)¡3now�… anotherœµusing `tar`c‹D2 = ^Vjoin('.2 �Âtar_cmd = [';z'-cf', 1åEdir]u±subprocess.PA_calQe, cwd=€5ƒ wstdout=RwDEVNULL€G&2)yq# let'sá„are bothGs’XØ…_tarinfoŸ/, pKP# tryžWan unX5one%¬Æ ‰=Ä8Œ�í6CŠßfor a dry_runÉ1,EÑ l=§ÑÀ«Lžƒö&ñ@support.requires_zlib°‘def test_1zipÀ•!):!Å#¸`someth eto zip$Ú# =_v_Z's(þ`tmpdiráp–.mkdtemp(ò# force shutil toˆeã•directoryƒ“os.rmdir(YI@work¶àwith relative ´6$ar0dir‚RArel_‡1£°! ?ƒ'”£´change_cwd(�ŠŽVw0absÌ(—72ðsub/file3',  ´'outer']) õwith support.change_cwd(work_dir):+3ðbase_name = os.path.absU(rel_ )7úres = make_archive.Ð, 'zip', rootw!, J�¬óself.assertEqual(res)“@+ '.G|2TTrue(³Pisfil„/s)-0zip&C.is_ q1<T.ZipFTj as zf:‹CCounÂ0zf.»ylist(),4o¢['dist/', 9sub ?2/'90Ä1>2L3@ Ñrequires_zlib™ñ@unittest.skipUnless(shutil.which(ÅÇËò 'Need the zip command to run'Š@def et!_v(@�)0 = $�._create_Ø"s(U}Qm»AjoinZÓ.mkdtemp(), '£‘< ÄSÀð# check if ZIP ¡b was ²dfoÈé€í*D)ýS# now~† another›µusing `zip`šE2D�>2‹±zip_cmd = ['P, '-q‰ -rY6èEdir]z±subprocess.Fc_call(Ve, cwd=…5Mwstdout=RwDEVNULLƒ:¯p# let'sÖ•pare bothMs“5O)9³> +O2PÁQùeqsorted(‡8), 2M6+!un¶ÆÀ8,d:$@ß9ÖÀelf.assertEqóual(archive, base_name + '.zip') ôself.assertTrue(os.path.isfileD5)) 2ð# now check the ZIP ,õ using `unzip -t`2Ázip_cmd = ['“', '-t', £]+õwith support.change_cwd(root_dir):+Á:try±subprocess.¦ƒ_output(‡—, stderr=(fSTDOUTGwexcept &rCalledP\ÎError as exc„�details =.��.decode(e:ºs="replace"w{ñmsg = "{}\n\n**UROÆy**\n{}"3Èófail(msg.format(exc, ‹Ããdef test_make_�(?\�tmpdir = –.mkdtemp(©R$= 2Rjoin(93, 'YjÁRaises(ValueH(, ޲s, 'xxx'@Ñrequires_zlib ×Ì_owner_groupã#²{ �7Q and ;,ñvarious combinations|€ð# this works even ifôre's not gid/uidÝ9úif UID_GID_SUPPORTN‚ö = grp.getgrgid(0)[05€³P= pwd'=pwu'Oelse\='g'ëv‘€_create_ùs I! re0Ž(h0, '¸., “!, ¿=,X K=Ë™4res:N¤$oDOtar' (.àJ¤(A'kjh3g',ª�'oihohohXÂÁ@P@unitË.skipUnless(™C, "Ry�!%pwÓÉŠ0tar_³v „?dir`3Àf.mkdtemp(),Ó 'archive') õ group = grp.getgrgid(0)[0]#°owner = pwd#=pwu#õwith support.change_cwd(root_dir):Nx‡Ó_name = make_Q(base´, 'gztar', G™, 'dist',NR¼=!, ì=%) Cõ# check if the compressed tarball was created6óself.assertTrue(os.path.isfile(ÎÉ)m2nowqsoerightsW8 =}JZ.openO-:tryXãfor member in L´+s(ˆ6ÉbEqual(,v.uid, 0),0g0kfinall¡“cclose(˜def test_?l³acurrenQP = osÚf¥K÷_breaks(*args, **kwDÃôraise RuntimeError‹tegister’ó_format('xxx', _`, [],  §R – fì[Nî=ÿ¦.mkdtemp()æ@�except E:ion "6pasXO³êB', ]jÅ?unr# Ö0tar'°_in_curdir(Ž˜å# Issue #21280ãú0 = 1"{F ‰ˆ@', 'x)Aest. q Kþ'G7@Ñrequires_zlibT´0ÿ?zip)šEzip') Õ%o)7)dR&):¿‰RØRs(TypÖ/, E¹F', 1ëH*Ÿlambda: xš mZð[(1, 2), (1, 2, 3)])3 ð%register_archive_format('xxx', lambda: x, [(1, 2)], u file')H7às = [name for û, params in getgEs()]CÔself.assertIn�X)²/un´ “E/No–ôdef check_unpackå(Ò, Zmat):é1ò_with_converter(ý†a path:åc.LE�lib.PathG(BFakeC× Ò¯%, êàroot_dir, base 0 = 7�._create_z&s(¼ôexpected = rlistdir(F&÷.remove('outer'Yp´` = os.)Q.joinÇÓ.mkdtemp(), ',ÿ3ile;EmakeTõ›á„ò# let's try to Pq it nowi·ttmpdir2š!7…g(;§)|(O),oŠeEqual(X,$, v ½ðand again, this time Õ1 thÕmat specified°V3Ñ;$3)t=Hà;àó Raises(shutil.ReadError,²{goTESTFNfO_ValueIÞ�ȈKtestŠA_tarÇiÎ:E('tañ@support.requires_zlibºl/gzn0Áp?bz2o bo0oOlzmap xp0pO?zip»4zipl  À_registry(seslf): óformats = get_unpack_&()(ódef _boo(filename, extract_dir %):X_ñself.assertEqual(2O, 1)' c¿'stuff.boo'4 [�G'xx'¼Šregisterß¡('Boo', ['`‘, '.b2'],çQ, [('T'°]~#‡archive(¢+, xÄ# trying to „0 a o G…er again3�Raises(R½…ryError,H Ì , Í52',I€ èáõ# should work nowE$un· o;&2bz˜í1In(U /O''),˜{D4NotG uFêõ # let's leave a clean state$ 2¡”ø[#, fŠÿ#@unittest.skipUnless(hasattr(shutil, 'disk_usage')í"(ð not available on this plat�"Kß}_9(ÇÒv2 = Œ.)°os.path.dir0(__Â2__)\ïL �Greater(PŸ.total, 0+Oused* oZOfree/‰<k’ 4pÌ óUID_GID_SUPPORT, "Requires grp and pwd support˜  os, 'chown($'rO3os.¼Ü×›#íñ ed-up automatically by TestS~õ.tearDown methodA÷ñ†mkdtemp(@0 = 0.mk S(dir=@0QwriteDn'ŸMƘ functionèWwith jBQValue?ÎúÊQjà PoLookupQð, user='non-existÅ¿oZgrouppÀ groupname')3 õwith self.assertRaises(TypeError):+2ÿshutil.chown(filename, b'spam')X=G3.14Uõuid = os.getuid()œgg¢def check_¶ópath, uid=None, g êjEstatép  ifF€ is not M ,$ZýEqual(uid, s.st_uidPÇPgPgPö©*žÑ(QÆL#GIser=L'ogroup=åú'62dirÞ �' í(J"E1 lJ/ K. user = pwd‘ pw“Ä5[0]R^` = grp% gržu% ™…Qser, B1+Wy TųS *RSFðtest_copy_return_value(ä= # #A and r2 both 2ð their destination �.cŽ´for fn in (ÁWopy, 2l3`src_di‰‰‡.mkdtemp%?dst%2srcõ”Sjoin(]v, 'foo'†T`write_„'#arv = fG#, „ E´{!0rv,âƒ7` ? a?os.7Zbar')7v?£ ú Ctreeÿ_s itsþn" =’Ë ! ˜ Èðdst_dir, 'bar')# ð src_file = os.path.join(µdir, 'foo')0Qwrite2#; $ðrv = shutil.copy%.1dstAUôself.assertTrue(Нexists(rv),¡Equal(readPc6), n!) Å”def test_šD_samÒQelf):'$# $÷,() should raise SameFileError if the source and destinationN2are)Eame.j3‡mkdtemp(ò£@rRÒ)s(Ó,¿ , §É ¢b# But (øwork too, to stay backward compatiblû�NˆL Ùðtree_return_value(ò Ü' 'Xs its¹ [ ?dir§i!0rc_ 0+ " "Dæ£ddCleanup($ rmˆ#, B , ^?srcž#™w6êy¯—k[  ],+rlistdir�ð class TestWhich(unitg.fCase):€\setUp’¡.û< = q.Ìprefix="Tmp"¥T V ZR# Giv”nFö an ".exe" suffix for all²ñ # It's needed on Windowsû°not harmfulöother platformsE™å ðàNamedTemporarygV(dir=1®TœC,C#g=".Exe‡�os.chmodÖÇØ`.name,Ÿt.S_IXUSR»p‰k.close.û ^_split} ÷Qbasic)  nüôEXE in a directory, itÿ#be/&edËðwþ¢,F¼;dirÎñ\2rv,Ù< ¿²absolute_cml Æ¡When giveni`fully &ðified path to anó executable that exists, õ # it should be returned.!örv = shutil.which(self.temp_file.name, path=Edir)CñassertEqual(rv,  F!) 3ñdef test_relative_cmdv!):!»ô# When given the -Š÷ with a directory part to anN àbase_dir, tail ` = os.a.split®.0rel *Tjoin(BR9Æðsupport.change_cwd(I=†°z¤ ;“ ¨>•V# But#0n't9õsearched in PATH{öies (issue #16957)\à ŽCõ¥à Ý6MÛœIsNone(rvoZ(Q7# IºRdÍ0dir ùå3™.ǃ˜çú if sys.platform == "win32"E,õ# Windows: current´ây implicitly oÑý<’SÖÜaos.cur)-¿)±Oelse›dOther È#s:£mPmatchgö º]¤{¨ ûP@unitkð.skipIf(hasattr(os, 'geteuid') andà ()X0Dfò 'non-root user required'øÜAnon_Ê�ing_mode: {1SetÚ7¡ read-only�Ñask for writeÝ%sý{2hmo7 ­Âstat.S_IREAD˜¿ ifåaaccessŽ 8wos.W_OK¦8aA€Test("ca¦s½"nÈHÈã> =}‰ Ùg_3Õ½DÈÏ Re"ì 8âc8?À) def tóest_nonexistent_file(self): ð# Return None when no matching executable >õ is found on the path.Mñ rv = shutil.which("foo.exe",+=~U.dir)4€assertIs…Q(rv) ñ@unittest.skipUnless(sys.platform == "win32",2Õ "¥�ext checkÃÒWindows-only"‹@def k_-_->ing1qAsk forqwithout"î° extension,Õn ensure that©„# it getS�properly P7Fc Aˆ_[:-4]h¡Equal(rv, <AtempQ.nameF“ + ".EXE"Šqenviron& ·’support.E)ömentVarGuard() as env~©°env['PATH']>0elf!&#X¹õ¾%Må ×OmptyÕàbase_dir = os.ž)ÿ ƒ °change_cwd(7û9, \Þ 4]$&''º = Š)@_no_¶Q R.pop( ,� Ÿ!Èõ class TestMove(]bCase):wí\setUpÛpú0 = Ø"Æw3src)Q,@.mkd (É*?dst*TJ~Ajoin™.Adir,š˜g=„=Â7opegGa, "wb"ÄfÂêf.write(b"spam4RarDowJ%?[d in Ê/ž:tryvNif d††rmtree(dnexcept9FpassQ_move¬÷, src, dst, real_dstª<'/"r20con’¨s = f.read#@w(l¿a~(, fÀ óself.assertEqual(contents, f.read()) -ñ False(os.path.exists(src)) /ðdef _check_move_dir(?ñ, src, dst, real_dst):3e~� = sortedcAlist@_'pshutil.^yT« ØY‰ì'BtestêAfileë×�# Move a ñ to another location on the same%usystem.<.QJgP.src_!, %?dst˜ ¬5_tož³¡inside an ëing dir¶<;dirĵÁ@mock_rename^ ÆP1_fsÈ{ ÄŽFy l(—]_ž+ ŸÑ¦ ,H?elf"Ò!ƒœ r<`= tempE0.mk (�6tryæ¿yњРXÚ£NkfinallR cg&srmtree(RI#jexceptžBpassÍ€ ?dirá!]à%ØøßÈ5ˆh­`,¥D%Ajoinž.' 1basÝÑDdir)Lg†‰p�4sep$” Î P% +7sep^-Àc_dir))) ú" @unittest.skipUnless(os.path.altsep, 'requires °') def C¢_move_dir_90_toq(self):+/u._check2$@.src1+ +h!, 40dst,JN’BjoinF'E‚basenameeA))) I¾òexisting_file_inside_deu<Å@# A (ð with the same g ;?ñination dir already l!s.�ÆF7opeÃ^g, "wb"w,Epass9ó assertRaises(shutil.Error, šF\<. Edontž`_in_it/�Moving aßú,! r‘A an �îUdst =Ÿº›¢dir, "bar"]òz.åJ=dstÛeçlÒfalse_negativlöos.mkdir(TESTFN�6tryΠ�for src, Ùóin [('srcdir', / :')]9=… = "bar"ddst = ·Ajoin;.³Tdir, :ô3os.�+&V, dst'pshutil.¢G(dstü6dir'`final_ëˆ,ˆL| isN(Y°( E5­-„dangling±Dª?src ‘V'baz'@ÁG'bar0¾+rc´n=‚‹W'quuxS ê*G¦¬ 12Õ# On Windows,¡@realaó does not follow ’æs (issue #9949N ifCf= 'nt'  UEqualÉqQ(src)ˆ@readÝÕ¸_OelseY&Ø.px3/irsh!mk•&rc“‰•ãG ¯ ¢Ìreturn_valueñXrv = CqïU 7ý±1rv,yÎ×HÉp1basW–övA))) N Ç#as…_Ñ)–¬$æÉ»­Ö@¼@6âpecial_functioýŽÀmoved = []  òdef _copy(src, dst): Ömoved.append(%)%pshutil.(ñ(self.src_file, �dst_dir, f¡_function=uF:ðassertEqual(len(Tqd), 1) oÁ@mock_rename¾Ptest_*f…_specialh“Ó)ad = []AäEŽÞñupport.create_emptyÑ(os.path.join‹‡'child')G'1H’t‘5ð 3) class TestCopyFile(unit�.Rase):ºò_delete = FalseA¨Faux(objec{p_entere«2ªò_exited_with = Non Orais4âq_init__†!, *1_inO=cÒ, suppress_at0TruÃ\C_?* =OZ40 Z- =m6®CreadªW*argsÂU™return ''5_5ä 3ˆVÛ >x! exc_type, 2val /tbX •2<qÅ"if! M {(ºr ¹ ö OSError("Cannot close"a*;U —˜�rtearDowµóµÑ ®Cdel FopenNR_set__Û \!.!0 = 0¯t1 = ¬±st_w_source`a_failsf`,(ŸE§, mode='r''&4if $€ == 'src'ð* z'zÄ"6*"'ƒçò 0 # shouldn't reach here.9^ø >Å&VR#s( #, T|Á,Ëp, 'dest'L!¿0_w_g KtsȺÅFJ?k:»{‹p °¿Ú ±À raise O÷SError('Cannot open "destfile"') õassert 0 # shouldn't reach here. /ðself._set_shutil_Z()&P.copypP('src D', '…„U…STrue(.–._entered®*òxited_with[0] is O<WEqualg=…1].args,ò( U#,)°def test_w_îÐ_close_fails(Â'):+0 = f.Faux(´?9 $j’n�(*ùname, mode='r'):È4if $E == — &Usreturn ŠE ¤'F" Gðu¡Ï +Oraisʆ¡'Àosource£I ÆÂÿ]R/#s(ÅŽ ˆl,Öm=Çø fFalse(,ù(FNone  _¿b_|ô move_dir_caseinsensitive‚™@# Re5ðs a folder to the same Y,ðbut a different ] 0srcyp = tempq@.mkd ÚΣddCleanup(Çrrmtree, I , ð 3dst`ð os.path.join( ð os.path.dirname(self.src_dir), #/Nbase0•.upper())8OéassertNotEqualcQ, dstl 4Etry: }ªshutil.mov ='tTTrue(´disdir(p¤kfinalltXos.rm0ð class TermsizeTests(unittest.RCase)»@def ñ_does_not_crashü#¯ð"""Check if get_termŽ_bö() returns a meaningful value.0ðThere's no easy portable way to actuá! ck@the _u of thej|£, so let's1Uif it‹ðsomething sensih…instead.K5""" k#= Äå*{,sGreater0æize.columns, 0¹é1Bline/a‘ýos_environ_first“‘'�ment variTös have precedence"ˆ€with sup€".Ed=òVarGuard() as env#ñenv['COLUMNS'] = '777'µ0del8™['LINES']a"ZO777)Î.«Ò ­íÆë:888ëÎ-÷3888Ìù4badú ôº6:xxxÏ ð:yyy!ð"î-@É skipUnless9òisatty(sys.__stdout__.fileno()), "not on tty"šK haI}r(os, ''jøP'need¨ 72()'säŸstty_matcj &Ððame results ignorà6envAThisÒ  will failµ¢stdin and õ are connected toþ`differLi!s x °s. Neverthe„e, suchEñsituations should b��tty rareƒQÀ size = ó-subprocess.check_output(['stty', 'size']).decode().split() òexcept (FileNotFoundError, Permission4; rCalledP�/)):0ðself.skipTest(" ø invocation failed"˜õ pected = (int(size[1]), õ0])) # reversed order vúwith support.EnvironmentVarGuard() as env©0del•['LINES']PölCOLUMNðactual = shutil.get_tF@nal_Â&() âassertEqual(exó", H,ðdef test_fallback(:_éT ÷# sys.__stdout__ has no fileno`6 ¡öswap_attr(sys, 'Dw', NoneÚ=;V –=(10, 20)H?|jPÏ.columns, 10/Qlines]Ã] i Dt a ú‹ on UnixA%or.ð not in (0, 1, 2)3yWindows6Jñopen(os.devnull, 'w'ÌIf, \/ y fv*_30, 4v3vð40) class PublicAPIJ`s(unit.4Cas@ð"""Ensures that the correct values are expo=!in"p]‚ API."""ê�¡module_allÁ\ibute�œ.l‚True(hasíð@'_'¤0tar*Àapi = ['copyH0objà Dmode nstat',ôùI*2 1tre?1mov$rm·NpSpecial)*e 'Exec  make_archiZ•ê%€_formats›„registerA�/un3 'ecunpackHsIG 1”c Ý'ñ 'ignore_patternëPchown`_which™ÅD>4ÐSameFileErrorC'] õif hasattr(os, 'statvfs') or os.name == 'nt':6=õtarget_api.append('disk_usage'),ðself.assertEqual(set(shutil.__all__), R )) if __€!__‚ƒ__main__ˆ�unittest.¤() import ` from ! 0sup".…_urllib2&panepathyT2url Y$os dsocket@k.errorereques*Ssys †.ðDires("network") TIMEOUT = 60 # seconds def _retry_thrice(func, exc, *args, **kw )©ófor i in range(3¼"ry$ preturn T (*DNÊúexcept exc as eBPlast_5= e2[rcontinudraise ,ןwrap_withá¹+=ped¤ŒÊK,,¬5^ñ2 # Connecting to remote hosts is flaky. Make it more robust by ¨³ing # the cLðon several times. }Gopenþ@ = _ˆòj:ø0url<,ÂjF°P.URLE¹pôclass AuthTests(J.CCaseˆ0""""s Jñ2 authentication features.""" ## Disabled atÀmoment since reTðno page under python.org whichHÐcould be used—KHTTP~P. # # .à`basic_¤(‹"): $´http.client>>purl = "#v://www.š/"ÈE/m"g'_<N G *�realm = 'f R'M@user"Z Æ loDer =Á.getLogger("1Jnet"ß:À.addHandler(¤ing.Stream"))ƒQ# XXXDprest of9!se—ðs aren't very good -- @y do±check much.Ú�ñ sometimes catchò major disasters, though.ŠKÜ-ftN�urls = [fx!'f\³>Ù.net/README',/(0ûnon-existent-file;c None,{°.error.URLE )f]ti_”Ýs!2s, rextra_h¢$s(�°f.write('hiÓGre\n/"J @‹/'9ð :' + sanepathname2url(os.@.abs¢);E(F@///n0nseEÒ/etc/passwd',�÷6ž )¢�¦!, ™=8Zðfinally: oós.remove(TESTFN) ò@self.assertRaises(ValueError, urllib.request.urlopen,'./relative_path/to/file')Yð:# XXX Following test depends on machine configurations that are internal ¥ð# to CNRI. Needñ set up a public server with the right authentic`ó#tB foržÐpurposes. ##wA def`_cnri(($):!ùif socket.gethostname() == 'bitdiddle'37Plocal/ (.eè.reston.va.us'l/elnÿ.concentric.net} Š k/seµ HNoneœ5if J€ is not $ Eˆurls = [='?ö://%s/etc/passwd' %[,7Bhttp7simple/4odigest4¿not/found.hl]Nåb•ü = HTTPBasicAuthHandler()ä.Q.add_`ord('b6_S‡_realm',%¯ 'jhylton'0‚'V'zd¨D'© / ©^ª? %›.gc(", rextra_h`Qs()+[S!, ±] ë0urlDDfragò/_C = "z www.python’vÀ/index.html#-"yG[ñ support.transient_iî et¹#c%):7;\req =�R— 8 7rÆY(req).3 �Equal(resÝiurl(),+” lÐredirect_url_ø- v %€ 4/R-/�:“A‹B </re•RÀ//www.pythonðtest.net/elsewhere/#frag") def $ñ_custom_headers(self):#'õurl = "http://www.example.com"'÷with support.transient_internet(urlUYðopener = urllib.requ³bbuild_%()a3#4R<f 2ÍÓ.assertFalse(C.îŠ_items()g|.0 !V?TruU4#as{Û('User-agent'“·:add.A.r,'Test- ¬Æ/erÍTEqualóJ.getlš mpP@unitNÇ.skip('XXX: 4@imdb1’ is gone'¥„ü sites_no_connection_close�q# Some 0å do not send C9!: : ã. >ó # Verify that those work properly. (#issue12576':URL = 'и' # mangles‚�g@ ;URL6tryƒCG .0urlâ(C~ as res9=Epass ðexcept ValueError?e=¹cfail("m aed for‰…Ying \ei¥#""ª�Änsœ<>req­ ”ëres = req.readcîm¬_ãB_url',¼ðs, handlers, retry=§Ñ imU time‰uloggingƒdebug = „„Logger("{qlib2").*cî O*ª)w"ifº }T`_wrap_€_âp_thricep~ÄeHA.URLQ¦+J!in3 hX y0subÉX=2ë²if isinstan€w, tupleo'0url•ãq, expected_eruþ-a CFNone�'Í 6ôfÚnÕuTIMEOUTFÀ ð # urllib.error.URLE ñ is a subclass of OS/ dexcept#� as err:+>Ïif expected_) -õmsg = ("Didn't get=fÀor(s) %s forÿ%s, got %s: %s" %†](�,ð, req, type(err),l/))M ñself.assertIsInstanc>,²ï_, msgJOelse;±_raiseŠ< ?tryY ÿ with support.time_out, \lŠ5ÿsocket_peer_rese>!io…?° ßbuf = f.read(V+pdebug(".€ %d byte%� len(bufâäâ?out  €print("" %`Àfile=sys.stdbef.closeÝXÁ.sleep(0.1) Cðdef _extra_handlers(š)¬R = []6Pcfh =�òrequest.CacheFTPHL†Uð.addCleanup(cfh.clear_c4ŒÆsetTimeout(1‰p.appendCÆ�treturn %2 �I Test(unitt¨CCaseç¼_http_basicÀ¯SNone(Ü getdefaulta³purl = "Wñ://www.example.com"‚¼ Kóransient_internet(url, _=}¸<Ðu = _urlopen_M`_retry8?)Ɔu.%ë u.fp.raw._õ8.geìÆ B_³L} >ÔMet.sÉ*60|€ofinall~©ˆeéÄoEqual(à , é? Çðno_timeout(self):# õself.assertIsNone(socket.getdefaulttimeout())6õurl = "http://www.example.com"'õwith support.transient_internet(url):.’}s}&60~):try:Ðu = _urlopen_}`_retryh#, Ç=å L;úddCleanup(u.close)ofinally·miq u.fp.raw._Gy«r�def test_q_J?”FV+12¡ž/.aQ % oEqual( !, dÕFTP_HOST = 'f„`python)q.net/' ,= ftp_basic(w:`Ý V©  »a B Š^Ü_n1uˆÁcÄ? ;©©Ÿ"<È­ ku&Í <² , ç/no±Ú ^·Þ. ¿<rß4)aÀrlopen_with_÷retry(self.FTP_HOST, timeout=60) 'ÿaddCleanup(u.close%ðssertEqual(u.fpÓraw._sock.getc@(), fñ if __name__ == "__main__":ƒ�unittest.¤() import a from !1sup"ñ_module # Skip*`_idle xðtkinter wasn't built,Ñis missing, #ðcl/tk is not the 8.5+ needed for ttk widgets4 or7r0lib8P (Aùinstalled). tk = ¶#('ˆ£') # Also!3s _.Aàtk.TkVersion <“=Uraise,.ðTest("IDLE requires tk3Ô or later.") ± ’ ')ScBefore”àing and executm3of 4Qtell ~àto avoid chang/NÄenvironment.….ß!Q= TruÌUv$�.libregr 8runð_inner # call load_ñs, when present here, to discover2sBrun.oÐ.FW Ø'Ø'›òtk.NoDefaultRoot(MØï„exit=FalkCtk._ç"_d<‘_root = 1.! pNone # øR case¥óhe select.devpoll() function # InitialþÐare copied asÅv"A_=T.py" ›$os drandompéRJ.ÚMDrun_&á, cpython_only]?phasattrÇcect, 'Í2') f'qp works Rð on Solaris OS familyäñ def find_ready_matching(r, flag)lQ = []‹ Áfd, mode in 1*Z"if&CJ¢.append(fdqreturn ð class DevPollÜ$s(,.qCase): ŠÃð_10f¶pu# Basicø@ of Þq objectL/áCreate a bunch(5ipeˆR that;c@with-"m.’F=p =ƒ�NUM_PIPESÛ2{ÁMSG = b" Thi‰a¢(.""â_LEN = len(MSG>r‚6ers£Mwrit…r2w = {}V2w2rßiØUange(°W_Prd, w<sos.pipeçÃp.register(rè�p.modify(C<v.POLLINÒ(C4wr,S*:OUT+Àreaders.appe‡nd(rd) úwriters.append(wrÊr2w[rd] = wr8P2r[wr5rd –bufs = []cwhile g:*ƒûready = p.poll(z_8� = find_2¡_matching(ú, select.POLLOUTGqif not *N †Šòself.fail("no pipes3A for½Jing"Zòwr = random.choice�f .1os.Ì–(wr, MSG)"�   # er_ *IN‚ M 7 >âassertEqual([w"],F¸:ers‘ rdAçXiers[0]!�buf = os. 1(rd:;_LEÚ €�len(buf)0¦ñ' t“os.close(û0) ;‚ >Åp.unregister1 O " ?rß6movr Ú»ó, [MSG] * NUM_PIPESNð def test_timeout_overflow(I)îp´$ ==0dev…0w, â0os.(=.úw€Ê 6(-1ô„.'ƒRaises(OŸpError, 2Y O, -2<(o1 << 3~)B/64Û0ž°¹(u ”8“Õ)A&63º‚"pMe`open_fþ = !(_w__, "rbN8À.addCleanup(-+Š®f2\'nošÅÖ•#" <Á method and Ƶd attribute4¡á³IsInstance(n.KV, int­5FFals0gX“ÎY>TruX†(ÀssertRaises(óValueError, devpoll.fileno) õ# close() can be called more than once/H5Hö operations must fail with ‰e("I/O *2 onud ...")göself.assertRaises(DÍÿ modify, fd, select.POLLINI4‚registerƒ.(unQ¡ð def test_fd_non_inheritable(#%):2™$ = (Ø£ddCleanup(".Ì '|ÉEqual(os.get};O¬()), False¸üevents_mask_overflowº}I» çw, r = os.pipeÔ=.>&(wÊå# Issue #17919+: ]O›- Uv, 0, -1ZC$1 << 64H!ì1‰%A‡Ñ@cpython_onlyw¿œ_c_limitsÈ`from _¯ñcapi import USHRT_MAXZu^ð�º? + û"r L% cSmain(È€run_unitDð(DevPollTests) if __name__ == '__:2__'3ƒ() """ UGà for time.strf  ž„calendar4sys 1re ÒZÍ0supÕ#OJ¸ð # helper functï`fixasc4#(sñqif s[8]Ñ Ê#sñ[:8] + '0' + s[9:]C‚return sDóescapestr(text, ampm]ME# s to dea—°possible lo v0sõÁt have regexuòsyntax while allowing  Ausedn±comparison.<ˆAnew_…R= re.¹¶ –.replace(0àç^,ð = new_text.replaceõ (r'\%', '%') new_text = €.replace,:,:,?,?,ereturnTð class StrftimeTest(unittest.qCase): –ñdef _update_variables(self, now):&À¢# we must /µ the local 9õ on every cycle<P0.gmü“ @ime(a$anow = V "# if”¡[3] < 12: Wåampm='(AM|am)',Jelse"@PM|p"#?Njan1x}0.mk(…a[0], 150, r1, 0)))K%6try2³#8]Œ$tzm•tzname[1]�0· +0+úexcept AttributeErrorzÞD&''¡�F3] >Cpclock12š ow_E- 12—(el50É 4/y$&12ƒ™î2now‡QsetUp{vQ¥mport javas9p.util.L”Ýe.setDefault("US”9KIXHBfromè1e i%A set£©e, LC_TIME‹bsaved_"& =.(-|€MC, 'CÜ 3�addCleanu% �(, v’Vö#_s  ^†æ.(šr ²$[@est1' @2%`if supÈŠ.verbose»tprint(" Äð, platform: %s, Python versionU" % \d7T(sys.= , 6¸.split()[0]Å÷for j in range(-5, 5“V#i#2 $2argRý + (i+j*100)*23*3603¨Mq6argUV,]/1($2$u<K êŸE1imeŸb for",¿cL+»jn.õÆñ2# Make sure any characters that could be taken as regex syntax isÓJpescaped– 7strÒõexpectations = (:>ð('%a', calendar.day_abbr[now[6]], 'ðeviated weekday Â4'),KÀ ('%A', ðcalendar.day_name[now[6]], 'full weekday W'), u('%b', D¡month_abbrF1F�eviated !KBKuK‘Dì# %c see belowªÐd', '%02d' % å2äÛ#of™ÿas number (00-31)ñHG3G2hou5/235I5óself.clock12, ';O1-12;j;3·7ppjulian ¾�(001-366=m=ô1=Bí}M@4@ainute,%/59xAp', çð ampm, 'AM or PM as appropr_Sr5rñseconds of current time‚/60‚UH ((ðB7] +–»jan1[6])//7Ò 'ðÿof the year (Sun 1stmwm10?%¤@((1+o’6]) % 7),T«þ\P WP«½(T¾ - 1)%7ÅÄ/MoÄO# %x:X�:”DUþî 5]ñ�%H:%M:%SáyMC`0]%1007iÿwithout centuryCYCms0";8O# %Zã%S single per�X signƒ%) Xõfor e in expectations:(ù # musn't raise a value error):try:>�result =ìP.strfõ0(e[òInow)C€except VbEamjZHdfail("Wó '%s' format gav¦ƒ: %s" % vP)yð if re.match(escapestr(e[li2), Ï)މcontinueÏcif not5>?®[0] == '%'Hm ÖAdoesI°support staðdðY(%s)"€;[2]ÿOelseŒ €Conflict]@ %s m:5àed %s, but gotl†", b)˜Adef ÒAest2/,ìuðnowsecs = str(iónt(now))[:-1] ÷now = self.now õ nstandard_expectations = (%Ä# These are .õ but don't have predictable output?ƒð('%c', fixasctime(. ²„, 'near-¼) format'),L¥x', '%02d/@' % úÂ[1], now[2],{0]%100)Fÿ'%m/%d/%y %H:%M:%ShZhs\<Ptz, 'º  zone name6 Ÿ .€ome platÊð specific extensh :A('%DqÙ  'mm/dd/yyŽpA('%eS 2dÅÿ'day of month as number, blank padded ( 0-31)T€h', cale9.E`_abbr[``1]], 'seviatedf-›K('%kŸ3>?hou�/23�nB\ÿnewline character¼r/7:! %ã(ärclock12E4M25],>MampmJIA? %ppRp†§è/04])Ì„=!s'ˆÿsecs, 'seconds since the Epoch in UCT?t|\?tab T+¬Ž&[5´8"3yN3vð† Ëø 'year without century rendered using fieldwidthâ&) ÆPfor e/noÏ:h:try‹�result = ßP.strf B(e[0)Cðexcept ValueErrorEC[rmsg = "(¬§ '|ùat (%s): %s" % \p¢’eàBstr(v) ,þif support.verbose›(žprint(msgC‰continueŒðif re.match(escape‡eyB$ ™u™""SÅ/s 7 3 ƒelif not”3 or ¯[0] == '%'§.0Doe£Pt appÖ$to ä­à’ Ê ÇÀ if support.¯verbose: ðprint("Conflict for nonstandard '%s'ïmat (%s):" % \K^ß(e[0], e[2])))tð Expected %s, but got %scð(e[1], result)) class Y1900Tests(unittest.RCase)ãñ2"""A limitation of the MS C runtime library is that it crashes ifµàa date before v-Ôpassed with aàstring contain A"%y"FA""" @def ­2_y_S_SS(self·?ñ# Issue #13674, #19634AÁt = (1899, 190, pò if (sys.platform == "win32™O8or #p.startsÜñ(("aix", "sunos —olaris"))°F0 È.ûrtRaises(ValueError04„P.strf (.6, t½,el¯``Equal(9B}, "99")sl Sg¢(Gx1x¯, 0)), "00}_afterïƒ O2013ƒ 13ƒ°if __name__ú¢'__main__'#;¡() """Unit¢s×A __iñcecheck__ and __sub‰.átimport V­pABC(typ™] Y`(cls, n)ð"""Implement isPance( a, cls)zª return anyN.§&(c]0í`c in {¦])‹1.__ç7__}NX¼?sub»1O(subºPcandij0s =Øö.__dict__.get("rñ__", set()) | {cls}TËÿÏUã‡sub.mro(LÁInteger(metaîC=ABCÊy… = {int}ØsSubInt(@2"PTypeC9s�«¾3IsSYULrnal ,)?gerí¦int), Trueö?@floaAWFalseþ ¨Builtin§%isSint, ·¡ 9o,jÝ Ðissubclass(flóoat, Integer), False) ñself.assertEqual(issubclass(fl<(=&,)?@ð def testIsInstanceBuiltin(V!):%h ei28(42ž?Tru� 8 š;H3.14uv; x>í0ActVn(()£Ý? §B ¦Së¦g¤=¢  �BehaviorYeYSubInû‘“ • < ;?ƒ?), z <t>–>°²¶ =(>|Þ<@ in;y9u‘p-%>êKì=ýî@;w© 8r;ò if __name__ == "__main__"Ë@unitð.ñ() FORMðøAIFFCOMM8@@»€�FLLR ÿUÀÿÿÿÿÿÿÿçÀÿÿÿÿÿÿ<ˆSSNDáQð! Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPXhð!ô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPX`hpx€ˆ�˜ ¨°¸À—À@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿÿ'À¨x¬H¬H±†±†¸ÿ±¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZžYØYØWˆWˆS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸Àÿÿÿÿÿÿÿ(Àt Ô Ôô,ðô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b (08@HPð)ô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸S¸WˆWˆYØYØZžZž (08@HPX`hpx€ˆ�˜ ¨°¸ÀÿÿÿÿÿÿýÀ@GäGäNzNzS¸àS¸WˆWˆYØYØZžZžÿœS¸S¸NzNzGäGä@@7*7*-O-O"­"­tt Ô Ôô,ô,èŒèŒÝSÝSÒ±Ò±ÈÖÈÖ¿í¿í¸¸±†±†¬H¬H¨x¨x¦(¦(¥b¥b¦(¦(¨x¨x¬H¬H±†±†¸¸¿í¿íÈÖÈÖÒ±Ò±ÝSÝSèŒèŒô,ô, Ô Ôtt"­"­-O-O7*7*@@GäGäNzNzS¸SÀÿÿÿÿÿÿŒðimport unittest def funcattrs(**kwds): �decorate($Ð.__dict__.upd$<;#areturn]Rð class MiscDecorators (objeñct): @staticmethodódef author(name(,×decorate(func ².__dict__['EP'] = I]'preturn 2b_ # -ó class DbcheckError (Exception¯Çñ__init__(self, exprstr,‘Ã, args, kwds3³õ## A real version of this would set attributes hereÚ‚.x""dª± %r failed Y1=%s…‡u=%s)" %Q� (Ä@) õm*ôglobals=None, loc ÷""Dîðor to implement debugging asser\!s"�g5 #¡¦ = compile†a-%s" %ƒ0.__3±__, "eval")^óbÞ"(*§ **"²"pif not <i#, ìç 04Yraise<;�:Î –'ݺî* °ountcalls(c ³ ¼ 'Ëaf¸·¤Ž! =6œÇÿ]%s[)ò0¥;all?CE+= 1D#1f K'àŸ¯»"E)†.imemoizó¡saved = {}j :try ”@[ä]AeËA KeyÜ 8sô 4;Oe = resUtlOTypemÀ# Unhashable«uS°�{ ¤AŒ)(ETest¿°s(unittest.0CasØn˜q_singležQeC(obje52=Vsfoo(): Ï!42ot.:�Equal(C.,B, 42%&(()(Oh¾Ç_tÝ ÍÀ @staticmetShod õdef notamethod(x):"…return x÷ self.assertRaises(TypeError,IQ, 1) 5aÀtest_dotted(Aeõdecorators = MiscD!()A‡@'ö.author('Cleese'%jsfoo(): ·%42Bw¸aEqual(*F, 42A$o&, pTm׌argformsÙ€# A few %ðs of argument passing, as we use restricted Mbø#9°expressions c*� noteargs(*‡, **kwdsm)Bke(func $qsetattrÂ, 'dbval', (WU61r+SÀt³Nð = ( 'Now', 'is1theVime' gv÷ = dict(one=1, two=¿@Ž$/f1 ?1() !1. q’`'terryØðgilliam', eric='idlðjohn='cÔ2³%84^¯2³&845#³(”%),]º…¿)üAV1, 2,œŽ3Ûy³3³CT), {}bEbŒ_dbcheck†@'n`[1] is§M Non<[(a, bÖ_a + b¤(š3àÉ*D¤-Qf, 1,ˆ.Ì|memoizeÌPcount'&{}E@-œ@'acalls( s“bodoubleé? * 5=�.__name__O'Ãñøj†,»B$=0Á2ð# Only the first ¾Ö with a given=Qbumps+%\³# †y (2Õ 'Q2s['/!']É¥ .&UC_3), 6ª2†ð # Unhashable arguments do noót get memoized: # ðself.assertEqual(double([10]), [10, 1‚counts['9o'], 3).&_*14) `ðdef test_errors(Ë)äò( Test syntax restrictions - these are all compile-time NHm9ð for expr in [ "1+2", "x[3]–(1, 2)" ];5ó# Sanity check: isD‘s a validÀession by itÉ?vE¡(~0, "ö wSexec"+0codï� = "@%s\n*Áf(): pass" %r as�Raises(S8E[,! Z„€ö%# You can't put multiple decorators on a single line2™’ ÆüŒ"@f1 @f2½ 47run nXH§unimp(funclr8ñ NotImplemented?£ñcontext = dict(nullval=None, X=ÎsR, excx0("uÑq", Nameb%),dŠ #("jo", Typ3ÿ.attr", Attribut=Æ¡ )« "\nš@ f()9*¿F$ =§(>stréó’exc, evalè±�þz_ÄAçclass C(objectu@1Lös(abc=1, xyz="haha". *zbooh=42 †3fooî¥ return 42—ËÒ@C().28), M(&v.abc, 1t'\xyz, À,È|¥ÂHSorderÉ#·Hthat3«`pplied±the proper F0 toÔ gäOAtheyê�Eing.Œ»callnum(num¶D"""D¶‘ factory šwÃV$or`placesŽfØ{Ued-in¤” with one:Ê9éue of 'num'"""Kµw†à return lam§bda: num µreturn deco¾@callnum(2)1³def foo(): G%421ñself.assertEqual(*E, 2,#‡ ñ"Application order ofŸñrators is incorrect") M‰¡test_eval_6(€!):]ä# Evaluating aQqed funcmðinvolves four step gr eachG*‹¶-maker (theECthat sg(orŠMT 1:š e K `Jname222 öarguments (if any²# 3: Calln0to ×» }4=# P Whendôre are multiple{@ors,#selˆshould bî±performed iLc above"fo�R’, but we L�`iteratbProughy7Rpreverser‹IyJdappear�rsource.‡]aMfs = []¡X_ÞG(tag;.b@nd('1pdec' + -„,QL e(à L$‹PÖP0ÄN loÖðclass NameLookupTrackobject’²�__init__�{, index'‰»." =%t KugetattrNf*N1if A == T…' X opK@, reÈ ('V!',@Y;)elo?argd¡args', str!)e/seºpð False, "Unknown (Áb %s" % ã¿ /”%s%d' % (—”%6res¬üc1, c2, c3 = map(+P, [ 1C 3 ]Ì‹“expected_”N ‡21', 0 */1'\ 6 2C C2C3C C3C‰5 „ 71' ;]´@@c1.o‹v(c1.arg-ð@c2.make_decorator£(c2.arg) ú@c3.make_decorator(c3#õdef foo(): return 42@ñself.assertEqual(*o, 42) %óactions, expected_5ñ# Test the equivalence claim in chapter 7 of&Qrefer$umanual.€# gU = []á?bará�bar = c1&1&Q @cH Zf(bar))„ D�D§ $ÊCQclass?C DÛ°s(unittest.\bCase):§€_simple(p)):#wplain(x�õx.extra = 'Hello'41x@FªõC(object): pass… ]Cm,l/½Odoub½/te» %10t¶a�add_fiveO+= 5G@E5ten %,15 _orderÅ`applieÊ?rstË�= 'firstÍ QosecondR "S @¡.˜2%'_ò') if __name__ == "__main__"þ2ð() # xml.etree 1ò for cElementTree import struct from) up ".s !Å_fresh_modulTTtypesašs cET =? 8%('­.£%',Aï xR=['_eÔê0'])eo_aliaskl zr&, ¼/']± Eôdeprecated=True) @"ð.skipUnless(cET, 'rSIres æ") P@Misc!0pÒ# Issue #8651i@Çp.bigmemd(size=ò_2G + 100, memuse=1, dry_run=FalseV>ñ_length_overflowÏ , T„0dat}ab'x' *Üðparser = cET.XMLParsser() Etry: ö#self.assertRaises(OverflowError, parser.feed, dataMkfinallQ#� = None jðdef test_del_attribute(y)Œòelement = cET.Er('tag')H®&Á.tag = 'TAG'dPwith V ÏArÐr4Gdel TLGgEqual(%,x–z.?ext{ IsF|6ext}’ ex6_'TEXT 8“ 0ext{9?ail?ail2ail/IL8“ 0ail8AIL¶ -5 (N, {}ð = {'A': 'B', 'C 5D'}[ª^�I7Œtrashcan2‘# If this^õ fails, it will most likely die via segfault.ðpe = rooA w'Eðfor i in range(20 KKD4Sub¾We, 'xGn|hüsupport.gc_collect( ��_ref_cyclFó# bpo-31499: xml0°dealloc() cM1ed évaation U when“#E—ólear() was called previously by the garbage Ä7or,O^&šJñpart of a reference Þ.ù3ý ‚ BAXMLPºýòŽ# Createnñ using an excepqto keep²UframeËL‘alive, so"�€Ïbe destroyed N ›cr”a ValueÀ 2¨0 as½Ð:  °err = exc ð# Create a parserõt of reference cycle2'Q_ref_%()ÿ&# Trigger an explicit garbage collection to break theiñ# and so destroy-~r³support.gc__"()Ýõ def test_bpo_31728(self):<±# A crash o±QasserŸôfailure shouldn't happen, in caseÔLÞ€s a callîqclear()j€ readinge@textWtail,N@whil”`setter"Bð__setstate__() is alT¥y running.Jðelem = cET.Element(''µvclass X>|__del__7G.Àm?ailʧ0 7= XOH.7 #�· AOail A*‚äY…Á­šõY+² !Ë{'tag': 42})Á@ause« ú¹Ö }/p @unit¾ð .skipUnless(cET, 'requires _œ¢enttree') ÇõTestAliasWorking(ICCase # Q thatXPcET a9r moduleV"ivø�_##_w] Qej%p7fooo4.qâEqual(e.tag, ''ü"@Ècpython_onlyÀcceleratorIm0/ed6C a>c was iC@, asæQected2'‚correct_+L_cETFS# Sub“lB funÊso it retainçq3its£æ Tð`A.__mÕ[__, '8¹ Î ¿r*.x"×Ü_comes_from_Cs # The type9ðmethods defined™PüA cod¾àtypes.FunctionsType, ÷+# while the type of methods defined inside _elementtree isCõ 'òself.assertNotIsInstance(cET.E[¡.__init__,� s.Functionµð ) @unittest.skipUnlessA¹, 'requires¨ò ') @support.cpython_only ²µSizeofTest(YaCase):» def setUp(Á=.usize = j`alcobja('5P')J5u# extraE?¢truct.calc;PPnnP4?0`check_ of.× )³$± º«u7('a¢’kA(e, ì)iÏ_with_attribuï, href='about:„# +—>‘ �children“ª÷for i in range(5úÉ@3Sub¸$W'spanÅð# should have space U$8 �A now±Qcx ô% +=A sOu8P')) Smain(ØPfrom 50 im. `_xml_eððR# Run+ñests specific toC=Êa¶ Drun_e(²@Miscrs“ËAliasWorking±cceleratorIª&ed!мAsameß‘ suite as½Pq module .4$@=cET”ðif __name__ == '__%2__'A7#) \�asyncio u contextlib>Aort ðmanager, AbstractA<C4M”ExitStackgf=Boolsi‰c•*˜ *ë‚™šFBasejN_²_a(uTq"""Deco¬#burn anà )%r into a’�case."""€@#Á.Zs\Äðper(*args, **kw }]acoro =j &G%bloop =•Ðio.new_event_(ähio.set!&%2tryöZ0retö&.Ðtil_complete(¢>kfinallB;Wclose�[‘BNoneS|ðwrapper classð TestAbstractAsyncContextManager(unittest.)ðCase): @_a/_P def Ñ_enter(self): 5áclass DefaultE"}9=a‘__aexit__`{, *args.2åwait super()._60È(mí* =›)¸Ç±.assertIs(aW5A.__aìc__(), )]·DwithR as cgˆ gK,,TbCis_a¿ m€MissingA1(mFpassľž÷Raises(TypeErrorvÈ t ·ástructural_sub¥?ing½™ºFromScratch1\†¨ ‘•preturn Ø DTW exc_type, pvalue, *_ebackcFNone<q<tTrue(is÷(eß/, £ K¶8 ¯: 7 ó .oóJíöçQAe3 ˆ 0 = 9ŠIFals‹*cœ"?xit›mš ?xit™ ǽÏ'°”l_plain´¥state = []a@^ =2{woohoo(ËP–.append(1Ž‘…yield 42M 169993kÇl†xê¾aEqual(QV, [1]Ki3elfÔ)[x, 42$¾xeDc, 999]éd X�_finally— À @asyncconÓtextmanager õasync def woohoo():#ùstate.append(1):try-1‰yield 42*ofinall. _6999aûwith self.assertRaises(ZeroDivisionError°Ð=Ñ^ as x©\aEqual(ŒV, [1]†Ò -_x, 42(/x rÆ Å(* j—r�, 999]) ^!@_îQ_testÍG_conóa_no_re�(e9@9 /QûULwhee ï,bctx = (÷await ctx.__aenter__ñ # Calling õxit__ should not result in an exception]Ê"jFalse(nOQ(Type-%, ï("foo"), None)R#Qtrap_0_afØ_throw^&~b£ã›*�g / �Id†bRuntimTHŒ Q€T'foo'€Ñ""no‚v81if LQ"2-ƒ£ãosecond> Më _gÂÈÍ#ïnon_normalisedO8Å [�¿q SyntaxÒ9Ž€Àwait ctx.__a³enter__() õwith self.assertRaises(SyntaxError):-4ñ await ctx.__aexit__(Runtime/b, None!) ;Á@_async_testP def ð_contextmanager_except(•|¡state = []C‹@H >dwwoohoo(L=P–.append(1:tryõ…yield 42b¬Ñ ZeroDivision^ as eD uše.args[0]}Wü‘aEqual(9×, [1, 42, 9996ëÊì€x€TK}xu ¥�>xrCF(999)Žmâl?"œ_stopiterH5*Õ*@for h³ð in (StopIteration('spam'), Ah ”ÃÐsubTest(type=(h)4ˆ° %¸h{ëEž0ionced(ÄQeIs(ex,'(?els*F„fail(f'{˜ÿ} was suppressed'e#bwrap_r¸eç(:‘=ÙSc£›gö (f'caught {exc}') from excŸO‹ÜG M0V1 / 0f“# If the ‰ È c?pedþ,(a ˆ,oÀ# we also unBÀ it, becauseñcan't tell whether}+@pingLqdone by#0genšþor machinery or!ityFGÕM!ÚL`#|_create&|attribs·2ð**kw): û def decorate(func): ÿfor k,v in kw.items('6qsetattrJ],k,v)Mpreturn k Œ÷@asynccontextmanageröttribs(foo='bar'q8à‹baz(spam´µ"""Whee!"""QÄUyield˜Abaz 1Ztest_“_÷ŠGselfi`baz = �._create9º.÷assertEqual(baz.__name__,'bazç-Sfoo, ¶ñ @support.requires_docstrings!×3docÛ(jÚCe3_, �)i³!@_ã_ŽÄò–_instanceë–_given_cmÖ(_(None¶ Üb­Šwith bazu€pass # µÃress warningø ŒkeywordsÛÃ# Ensure no $ö arguments are inhibiteþ~ Ã:awoohooq,Û,Zws, kwds4ù_ ,É'] ^2=11a2=22d2=33gê=44) as targetQ».R%0, (PKF�44)) clPTestA{ ExitStack(EBase`, unitm.CCaseíDKSyncD .ðÆ@staticmetho€]àrun_coroutine( 7;qloop = 2Ðio.get_event_(O)f*ec_futurZ€,ð.add_done_callb lambda f: ^v.stop()7¶|foreverƒüexc = f.exception!ªif not excÇ]�šf.result({Nelse4« =S$._‚"__QW>try@Praise@ "Ç68excp3 = Œ FJdQclose1 ù Þp&a9Õ^ðdef __enter__(seglf): ñ return self.run_coroutine(å__aenter__()) :Ádef __exit__)ï, *exc_detailsdJ Doeðstack = SyncAsyncExitS”�QsetUp�Å€loop = a9Ðio.new_event_%()Ö!8set!D*’addCleanuv.Nc.close»!@_RQ_teste ­Œcallback»Áexpected = [>¶›((), {}),/1,2ÿ), dict(example=1)T%a&]©`resultÒQÜ(*args, **kwdJõ"""Test metadata propagation"""h+l’.append((VTŸ%}Zwith Xa() as x 1Ffor LÔ in reversed(²€d!if5P and „ T"2f =s\.push *,  óD#ellc-îW[¾-×·/se²&«¡±ssertIs(f, = (Ê wr rÇì.(_”s“ Z@b[1].__ ?d__oB=’NotEqual(6rCEname@2.__ ¸ IjIsNoneG8docFö‡„,%, ÂWÁ¬½ac_rais¿õZeroDivisionErrorþ_{P_exc(J@type�c;_tbUÃ*Is2y5f�suppressh o êOTrue­*okz¬­â¤Õ?exc#¦`class ðCM(object): ð def __init__(self, check_exc): #".!& =- +Sasync\caenter^Sÿfail("Should not be called!")[x¸Ï*exc_detailshjawait Á(4 iÀBwith1eh±stack() as a.push_>_4º(_expect_okƇ’assertIs(<2_öïbacks[-1][1], D¿cm = ExitCMh´ –/cmŽ%0.__»M__, Ek‘_suppressQaTI.G½ l� Ã?elf’ št Eß9/t121/01@ñAtestuþqcontextj¤�class TesÌgobject-T/__R úresult.append(1ì IØø  Ý‚ V"3)ýQ = []–Ñ+~YA$¿S½X@Y"ó # Registered first => cleaned up la““€õ  f# è4> ´pNotNone}*it(mÚ.úz_zB º2w·bEqual(+ã, [1, 2, 3, 4]0Ï:üexception_chainingÙ•# Ensure + +õ matches the reference behaviourK:OPraiseI(Ó £g˜Tsavedð = None asy÷nc def suppress_exc(*exc_details): änonlocal saved% # 7 = M (Åreturn True :tryqñasync with self.exit_stack() as 3¯a.push_B`_callb6PraiseçÕ, IndexError)�=A?Key?)ŸAttributeEý(«¸$OValuuU1 / 0gexcept*t:excršÿassertIsInstance(exc.__context__, /= I9 p# InnerwÅeptions wereâ%edÝèU»=Non·z {Oelseçfail("ExpectedC†, but no£Q was ™&d"XÛ# Check the iÔÄÏ* =”5[1]%c;/, 5  ã, ZeroDivisionÎò if __name__ == '__main__'.�unittest.ñ() import dis from ît_module2IÉ _opcode = )#("±") class O)dTests(@.bCase):’†q€_effect(.BcEqual(l.C5ö dis.opmap['POP_TOP']), -1ðI!DUIA_TWOM2L(ÿBUILD_SLICE'], 0œ- P1P<3PðRá&s(Ó/, ’, 300003CÖ ñV6,“ R"R"R $io*ðsocket import dateôtime import textwrap„unittest”functools0con44libtos.pathðthreading from N n0supvtnntplibôNNTP, GroupInfoO&3žT.mock9äpatch try: Ássl except IëRError#óssl = None TIMEOUT = 30 certfile = ×d.join(  dirname(__&�__), 'key7ò3.pem') # TODO: # -ýPthe `0ö` arg to more commands)e£§ conditionðauth and `usenetrc` class NetworkedBÁTestsMixin: 1def†â_welcome(self)/0 = ³.server.get!()G+!óassertEqual(str, type(-+))uLhelpr»resp, linesv.pPTrue(9ð.startswith("100 "), 71for^1 insíÆ ” ÃOlistÃg¬ Ä/�rif len(+_) > 0Ž Z:F[0])UÇ 3. Òm_activJ!, 7Ù–GROUP_PAT’ç�ƒunknown_h ÄCôÓsRaises(p.M‘Permanent<) as cmÀ5ö_shortcmd("XYZZY" Xb = cm.”@ion.Oonse`ð5ð8ß2new· è0# gÅp gets a^óstant influx of newóð. In order not«astresslw # Îñð too much, we choose a recent dateƒ0Upast.DAdt =‰.(¦.today() -Êdelta(days=7M¥&dt1ž@IsIn #ce´7[0]–T >8\, strpdescripæ °Òp_check_&(°x‘# Sanity '�”Ðdesc, str)  ñself.assertNotIn(ôGROUP_NAME, desc) 11 = &pserver.mriptio>8p_check_,(ñ# Another sanity *qj¡¼In("Python"—õ# With a pattern?l°6PAT•¯ ÿShouldn't existkæ"zk.brrtt.baz"káQEquala, '') [�def test<hs§!):!›Brespsî6.Ý ïñ# 215 for LIST NEWS&aS, 282uXGTITLEr·UTrue(�Ð.startswith("_`") or ª a82 "),¡IsInstancevs, dict+ã!s[—¼¿]—HgÉ �_group†;ult�*zW¾�˜æ5, len(result))9ð, count, first, lab =B&ul� Z(,¼#b1tr'ins*•*¸)BLess¤R/§z R'11RE?ate·=;ate»d-y % , Ttime. 7?# SÙ rGreaterôA¶.year, 1995Hu".G2030§Ã@art_0õ$, <i# Some~sóqa fieldoð ionary returned by OVER / Xeú¥$v »ò# NNTP has 7 mandatorywsT *V….keys(),1‰ð{"subject", "from.ºmessage-id"6À "references)C:byt ylines"}e�<Ev ina‡.values(i— ÷v, (str, type(None))ËÿQxoverÆSü:namÏÀr.group(selfã.GROUP_NAME) ðresp, lines = self.server.xover(last - 5, 8qif len(9u) == 0:T[JökipTest("no articles retrieved"Op# The 'd'*ö# is not necessarily part of the output (cancelled?P€art_num,Lr_dict =å5[0]¨¤õassertGreaterEqual(=�ýX3OLess0 ,p_check_S‡\ !) ‡ò@unittest.skipIf(True, 'temporôñped until a permanent solution'Lw'Hòfound for issue #28971'­@def „_òã)Í!Âcount, first k, name4`group(Bm st¿=KU - 10¸"! -"¶,` range·m*�x }¾(Cr, None)߀±H ¬?end¯1j¯&-1À‰57¸ \U0 -XQ# XXX  "mõage_id"Çðunsupported by gà# 503 Overview CG-ID :zõAxhdr³õD±z’'subject'W^­ç2 in»”*}†‘str, type•C[1])dê†W_“ó , & 8=?qm`IsInstsÌ6’nntplib.AãFInfoÈ ifÏVÂÑ]\Í-u.number˜V-.sY¹)v, bytesR{ðthis could excep_åally happen...pTNotIn._ós[-1], (b".", b".\nDr\n"›ÿó"FIXME: see bpo-32128.d­ö¡_head_bodyÒ ÅÀ, count, fir`st, lañ name = self.server.group(ÓGROUP_NAME) õ# Try to find an available article+0for’_num in (s0firz e - 1):0b:try«resp, head¬@(artc£3ðexcept nntplib.NNTPTemporaryErrš>s ek�if not e.tûonse.startswith("423 "²nFraisü!# 5pNo such#þ" => choose another on>zcontinuUbreak5;elsÇ»ñskipTest("couldÕ²X suit°† number"AB°assertTrue(  €221 "),  7ccheck_ _!?¿, ­"k, bodyÜÜ›2›k›Ë ž¡"0¡n¤ñ# Tolerate running the tests from behª q virus ¥%erEñ blacklist = lambda line:ú�b'X-AntiG'û�filtered_’_<Ps = [   !inÄ. s|&‰š(6%)]7rm6pk tjEqual(|%, þ‘+ [b''] +Ü„!) ¿1def¡Ñ_capabilitiesr[b# The ”a under4³ implementsÑñersion 2 and has aeSø# couple of well-known wÒ. Just sanityv that wuP# gotW%m.[Ä_GÆgs(caps¾~_U v['LIST'Ã%\¡IsInstanceN;0, (B0, tÈ)q <ðn('OVERVIEW.FMT',æsD5mrGreaterÐk.2"_vU6, 2=î18getQ(¥Ä°is re-emitsC… commandI  b U0‡6 TnzloginNÀThis test muó)st be the penultimate because further commands will be ¥# refused.ðbaduser = "notareal"!(pw†password#ó# Check that bogus credentials �VailurŒñself.assertRaises(nntplib.NNTPError, %Õserver.login,˜Ó¸=Ð$, §õpw, usenetrc=False)Hö# FIXME: We should cÎycorrectÐÁsucceed, butôLwAòrequire valid details for some Ñ €where to× inÚMð%test suite, I think. Gmane is anonymous, at least asèdk&thm1# oR1s. d@def €_zzquit(l!):Ua# This"2 muyòcalled last, hencŒ6namk¢cls = typeRQ6try^bq. .‚•kfinall03cls/r = NoneÈÁ@classmethodmÙRwrap_Ys(clsÙ“Wrap all !ñ in a transient_internet() exception catcherb¾ð # XXX put a generic vers,ÊÅest.support?5 ›(™V°@functools.Ãs$@#D2pedb V#Swith }.Øzg[_HOSTƒAža preturn ž"peq.ÝL;dirt"pif not %p.starts§!('„'…vcontinu[F–‘ = getattg,S<&l°BableF(b`# Need”TÁa closure soí5Ñ remains boun,¹its current/# Äs½,O°«)Ûë*�_statemen«'Ûis_connected(M1has4s, 'fileyã) Í ÃlOj.help(†=C (OSÏ1EOF  Ft3Truð.ÆQCLASS¬=Öý, timeout=TIMEOUT.½ šv([ ã ,P +'V TgÚÀSS(self.NNTP÷%_HOST, timeout=TIMEOUT, usenetrc=False) as server: u.quit()±self.assert?ð)(is_connected()) NetworkedNNTPTestsMixin.wrap_methods()òEOF_ERRORS = (EOFError,) if ssl is not None›1·+= (ssl.SSL9Ž class ƒ(–°, unittest.«RCase)mT# Thiò supports STARTTLS (gmane doesn't"òwñ = 'news.trigofacile.com'I GROUP_NAME( frØp.lang.python'=PAT&1*' Ip@CLASB @k( def setUpCC(clsåðÛÂ.requires("nÂ"Õ$Dwithð.transient_internetR.€ý\<2tryR Bcls.b0 = >Ë MÁÒH í <vexcept V§Vraise#@Skip'±(f"{cls} go@ eºC on Ying "m© Pf"to QD_!r}")Î�tearDownÑ!ifR_ FŠv$å% @  skipUnlessg4, 'D SSL /')p@_SSL%st"):Ôð # Technical limits for trppublic ™ó (see http://www.aioe.orgj°# "Only two�pcurrent ˜ñions per IP address are allowed andª]# 40052day.c-Çed from eachP"."×´²EnntpªÒù?comö #ó€getattr(kalib, '‚QSSL',8C€# Disablîñ s it produces too much data q_list =CÚ B7the)ö will already be encrypted.R…starttlsV@ # #a-n0ed {@s us>@a lo¢p (or soÓ@mockdit). #ö_ýSËÆIO(io.RawIOBÓò"""A raw IO objectK<€ commandÈ`receiv5 nd3Rcesse-ôby a handler. Theñ can push responses whichBthen[aIOP”3.""O·�__init__(z,eùËèÐ.__init__(selCf) ð# The channel from tUlient&ÿself.c2s = io.BytesIO(F/toD?s2cDd£handler = ƒq.start(2ác2s.readline, ±push_data) ?@def #Aable5!):¶return True-Owrit-n[!, yañ"""Push (buffer) some%€ to sendtE."""ž posÕ‡s2c.tellv–seek(0, 2’Ì!e(•W97pos)0"7, b)1"""*¸Fs usηŸ·kbµ˜¤‘.ÿ÷process_pendingÏWlen(bÕþCinto£?bufÚPwants“4¸ a responseà�2b =‘¼O(˜6uf)óAn = µbuf[:n] = b²Ø@n Îómake_mock_file(Ôõsio = _NNTPServerIO"Q‘# Using B’öedRWPair instead ofÑandom ensuresÖqF`isn't ¬-.â ^’(sio, sioèÐ4ð) class Mocked¾¢TestsMixinOñ# Override in derived 6!es~ _g = Non×QsetUp*Yruper().žóhsE(O�tearDownL O3del NlcXÐ, *args, **kw ¬”ä\ó L.u_1 = i4 =§ñ± = nntplib.LPBase(L‚, 'test.''±‹DæUæáWithReaderModeï(ÿ¬WmsÉŠpermode=÷zt2v1HƒsD"""A‹À for RFC 977ç@welcÑp= "200 C e "é´,ޱ>Êçñin_body = Falsemç allow_postÈ=¿ ._æc" =nÀine õself._push_data = # $ûlogged_in = False �user_sent Ë# Our welcom6shandle_1() UÀdef _decode(} , œ!):•°return str(÷ , "utf-8", "surrogateescape"Sñprocess_pending[U0if m†.in_bodynrªwhile Truebline ==P_read%()®$pif not E!× 8–“0.ap¼(B_Ï == b".\r\n"gYbreakf+trïŽÄmeth, tokens߆Š_callbacC2"(*2 , ,=¼ °ofinallu0ff = Non8i*! Í ”ÐB̃.Ù ËÖ Ò0±.endswith("¯�âñraise ValueError("¢Àdoesn't end Aò \\r\\n: {!r}".format( ®>=„Y[:-2]Scmd, À %k.splitÍ#¡ = getattrI.ËBr, " ñ_" + cmd.upper(),Ç ŽH@1if C!is]ï%�{unknownÌ?elsÓ�oã Ì�except Eion as ^+Ùïcommand failedËn from ÅgÕ !*³yî *6:V = []ÂaexpectL"Þð"""Flag that the cli:2is 6ñed to post a requestQ5"""‰yá�~Ç| Bñ"""Push some binarye `kO5ˆZ, litâ`a¥0ingHeral` li,àtextwrap.dedenµtY#’.join(lit”Êrs()) + 5)!enD''WÀ self.push_ñdata(lit) def handle_unknown(self):"þ.push_lit("500 What?"BwelcomeB P*COQUIT@ Ÿ"205 Bye!�ODATE> ÿ111 20100914001155HQGROUPIw, group"ifö == "fr.comp.lang.python";?ÿ211 486 761 1265 B)}OelseP ³411 No such—²{}".format(»e2HELÞ×—ç5""\…Çù100 Legal commandsû) authinfo user Name|pass Password|generic EKdateIhelpúReport problems to h7Ö _223 0q³ 30S³ÀArticle Founê”2NEX¥’ ª—•7 <668929  � retriev~ `?LAS`4ýb Ib�, actionaq, param Û#if%g ¤¨T215 NxPs in " "ˆñhigh low flags".7 Í 0R52340 02828 y9“.announce7C1153 m0993 mB}free.itP68002 ƒJ1C1254 O0760¿}„.learner>$00O0001Iotw.bbsÅ%30‰ Ŭ�&elkACTIVE"ifM‘¶*distutils*'À selÿf.push_lit("""\ ñ 215 Newsgroups in form "ÿ high low flags"Bðgmane.comp.python.distutils.devel 0R14104 / mN6cvsA0 1LY.""")fYelse:?sel+S ‘úelif action == "OVERVIEW.FMT"¦¢ÉáOrder of fieldÎýoverview database.ÿzSubjectrNFrom?DatD®Message-ID2®References?Byt?Lin�Xref:fullÅ[ «NEWSGROUPSYù assert param is not None`#if!¦éClangî Q8®'²pDescrip¯}d"¶B Œq\tThe P† Puter ­?uagúD 9˜ñ*òyÃ.announce\tA Öments about tº (Moderatedü9./âV5{,++ ç ´ñ '501 Unknown LIST keyword') àdef handle_NEW_(B!, 8,n¡e_str, tim )üñ# We hard code dif ¢t return mLðs depending on p¬d~¦`# arguíA andqv syntax,Aif (‘` Ø"9ª#Š20100913ê`Ç'w082004"Ó’C was¬N�RFC 3977WËat (NNTP "v2š>¯ €230 listáÃnewsarticlesTðv2) created after ûMon Sep 13 08:20:04 2010 follows û4 Ró ^²Sat, 19 Junï18:04:08 -04008ñ<4FD05F05-F98B-44DC-8111-C6009C925F0C@gmailIÐhvalf7$ort$1@Þh¸¯\t7103\t16AQXref:8 úñ¿.authors:57Já¡8\tLookingÿa few good bloggersO¹L²Thu, 22 Jul¹�09:14:14¹À "\t<ÿ#A29863FA-F388-40C3-AA25-0FD06B09B5BF@gmail.com>" ß"\t\t6683\t16#nð# A UTF-8 overview line from fr‹Ýp.lang.python–þ&"59\tRe: Message d'erreur incompréhensible (par moi)ˆìñ"\tEric Brunel .IMpexpect_±(9=5‚R440 P®ç not permittedpIoassertòVg kR240 A•Ç received OKi5QostedÕ! =v °SIHAVE±!meó?_id½&J ¾I andПkã == "ÙðSubject: I am just a te¬*ñContent-Type: text/plain; charset=Áæ; format=floweB˜_-ID: 7"""üóÊ ó@This—¾.¿À ..Here ió s a dot-starting line. ò -- Signed by Andr\xe9."""#psample_<ccle = ôhead + "\n\n" +Bbody9õdef handle_ARTICLE(self, message_spec=None):�)if@ is "!µGñ.push_lit("220 3000237 <45223423@ex¹u.com>")a,elcO== "7w0q%°/4"b)h/seN ð430 No Such ArtiÎWFound^ereturn1 m\˜=.") OHEADF1c/1 MÙ4� OBODYF2c2NÙ‚öƒAUTHINFOúcred_type, dataW¯_logged_inå á'502 Already L2F In'›ÿnª == 'user'U2if uZ_sent '!íõ'482 User Credential‰GSent„>,el® Tû381 Password RequiredI7_¬ð = True ÷ elif cred_type == 'pass': þself.push_lit('281 Login Successful')2õ_logged_in = True#Jelsecñ raise Exception('Unknown� �µ{}'.format(²ñ )) class NNTPv2Handler(1)lb"""A h!á for RFC 3977 /¡ "v2")""" ¨3def-à_CAPABILITIES( Q#¡fmt = """\6ò101 Capability list…¹VERSION 2 39°IMPLEMENTAT¹INN 2.5.1{}'9HDR³LIST ACTIVEù$.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMTR :POS"RN $.?äpif not 2.  \4fmtä0'\nDöAUTHINFO USER')oLS8°ÝAMODEÕ7, _Ø ‘( óÔ sent despiteýhas been advertised')KVnømessage_spec=None~Return:²!_X;5ü‘CapsAfter—ü c Èthat allows êp only aW lïÜ>1Øb·ÿÐ'480 You mustuG in.[ìsuper().% � ßModeSwitchingqserver ùstarts in transit modeŒ__init__�!_s}­ed = False ¹4HcU¹aq"{}p ™c¢"if$a] AV ñ•-=” üg, what¿gassert  1and-xqreader'X–.Ø B7Â'200 PostingË}ð1v2TestsMixin: ódef setUp(self): ‚super().!) .Ítest_welcome5ñelf.assertEqual ƒ.server.4 , jf.handl a�authinfoB—i¯ölf.nntp_version == 2ºÁc‰ÓIn('AUTHINFO'}’a_caps)Ú5plogin('íquser', 6pw'0T# if [á is gone from Zø we also know that getcapabilities(Mñhas been called after ‰Ú as it should°å?Notè9Ã=datÀ`resp, " =§­_è9ö"111 20100914001155"â 5UnPtime. (Bü, 9, 14, 0, 11, 55)#LquitdBFalsá¶.sio.closed޲ åQ"L å�205 Bye!Û?Truv {=help� ,  –{ÿ00 Legal commands ËU1, [—û4' v ôü Name|pass Password|generic ',HËu øReport problems to k ŽCp°?, "jž_=íÀrver.stat("<ó 45223423@example.com>") ÿself.assertEqual(resp, "223 0 retrievžÃ“ °�Kx±wr:") ?las&<Ž 4o"4z ã adescriÿ  .÷"comp.lang.python Î9�, "The P- >Puter BWuage.@/{x<| eÍsüÅLs‰/s(Uf'215 Dw±s in form "p ˜?".'ð/As, {ÓF“:y ,A}s²h*‘ P¸> ùã.announce": "A Öments about t�†ß (Moderated)"?ª }±À(self): ð resp, count, first, lañgroup = self.server.ð ("fr.comp.lang.python") O1°assertTrue(cñ.startswith("211 "),|7cEqual(Ž?761%¬O1265%ß?486%Ü/, Ý ÂâõRaises(nntplib.NNTPTemporaryError) as cm:# T Qg.develWõexc = cm.exceptionS r@exc.vIonsezÁ411 No such ð5"),F™F!) 'ðdef test_newnews(z)ܬ# NEWNEWS Ïñ [20]100913 082004Qpädt = datetime. ö(2010, 9, 13, 8, 20, 4Àà[, ids£š"‚V", dt@Åexpected = (‹�Ð"230 list of å articles (ÞŠ v{0}) "4@creaMáafter Mon Sep ìp:20:04 ÏŠ follows=�).formatM.J†_version®h.rÿÅ)jids, [®ñ("7ó"'Å[+ôMessage-ID: ") def _check_article_data(self, lines):*.ò.assertEqual(len(%J, 9)( WBhead,O[:4], Cbody,<-4:- �¢x[4], b"ÔDtestÒÍÆ•# ARTICLE°Ñresp, info = åsserver.(¯‚<ü"220 3000237 <45223423sDóart_num, message_idm! =‡š�o;mš]"”j ´ à’>E numB¯4¯CI4IYš IM/idHÉ3Y0SS0çME×Non-existent RBwithÔöRaises(nntplib.NNTPTemporaryError) as cmö² 7"\r\n':ðSubject: I am just a û ¹Àe\r\n'  ò), ascii(data)) ñ self.assertTrue¥.endswith('/ðb'This is just a teËrticle.\r\n'0P.Here1ÿa dot-starting lin1Eÿ -- Signed by Andr\xc3\xa9s æ�1def«`_head(ñ!):Õe# HEADÂresp, info =qserver.<7bEqual(9ö"221 3000237 <45223423@example.com>"Eñart_num, message_id,1s =„—µ¦o;mU +]"”?p_check_®2cle8´sg8E num¥<©4BjzÔ@C4CYš CJ/idB½S0MS0áGE×Non-existent OÃÅöRaises(nntplib.NNTPTemporaryError) as cm"¨7"ìßSubject: I amg5 óð self.ass÷ ertFalse(data.endswith( ðb'This is just a teËrticle.\r\n'0P.Here1ÿa dot-starting lin1Eÿ -- Signed by Andr\xc3\xa9s�), asciiÇ1)) �1def«Á_body(self):Üe# BODYÐresp, info = +�.server.<)(ÂassertEqual(9ö"222 3000237 <45223423@example.com>"Eñart_num, message_id,1s =„o;mU š]"”?p_check_®2cle8´sg8E num¥<©4BjC 4CYš CJ/idB½S0MS0áGE×Non-existent OÃÅöRaises(nntplib.NNTPTemporaryError) as cm"¨7"íßSubject: I amh5 ô´µ?TruÚÀ b'ðThis is just a teçrticle.\r\n' pb'.Here1ÿa dot-starting lin1Eÿ -- Signed by Andr\xc3\xa9sñ), ascii(data)) �ñdef check_over_x°resp(self, , qviews):6É À.assertTrue(*.ÆÒswith("224 ")C)7¦Equal(len(`6, 3,rart_num€& =‡?[0]Q6&57K®ws5, {GÓó"from": "Doug Hellmann ",]psubject`ð Re: ANN: New Plone book 9ü strong Python (and Zope) themes throughoutb@date_üSat, 19 Jun 2010 18:04:08 -04007 message-id=ý <4FD05F05-F98B-44DC-8111-C6009C925F0C@gmail.comç¡referencesNÐhvalf7$ort$1@Ih#B:byt8L7103¨:V,16@xrefpFnewsa Žacomp.pPÉ.authors:57"Ÿ},A$ w1w-!["ˆ], NoneR2R7]O°"QMÇÀ d'erreur inù÷réhensible (par moi)"ÿªùôãÓ}ý1 = Gqserver.,v(57, 59ë"R O ƒA ‚ð# In NNTP "v1", teõwill fallback on XOVERÎ g ¶f¶·(õsample_post = (~`b'FromDñemo User" Î2b'So: I amE 1ü'Content-Type: text/plain; charset=UTF-8; format=flowedF5à-ID: �@°def _check_¹°_ihave_sub(ñ, func, *args, file_factory):@áq# FirstÌ�prepared Nõ with CRLF endings4:s›€ x_v1 = 8+ ((A+),ׄu = NoneYaresp =Ø%(*f HË("a# ThenîGsameê�"normal"¹ó -+¦y should b‹’# convertnANNTP>Q and Ž.¼ôo5°.replace(b"Û†", b"\n"²çMpreturn – è‘ � Œ€success_3š ŒWtáa bytes objectYª4Aäö+V ð=QT.ž\(, ž-'# –_arrayš=Uqž#a™9@io.B‡/IOš,Õn iterable of,!ediU<)%'(býk!‚(b.split)ækeepends=True)«Ò.%f^O”" úDnon-*þ>OFalsÿÀihave_sub(fuónc, *args, file_factory=iterlines) ðself.assertEqual(resp, success_!) .àdef test_post(8!):Ja.checka_ihave%€.server.6û , "240 Article received OK"’Ñhandler.allowSµing = FalsevQwith {ÂöRaises(nntplib.NNTPTemporaryError) as cm¸¼¦·Qample{ œl.Ðcm.exception.-Uonse,¡_ �"440 PostÏìnot permitted"gCh7i%35i’transferrl ­²"¹Ž?Ìò ("",ùs‹§?3>§ø¤‘too_long_V9­ädt = datetime. �(2010, 19, 0, 0bÎADataÉà Ððnewnews, "comp.lang.python", dt) class ,‚v1Tests( !v2ÐMixin, Mocked un¼0st.CCaseþ0"""As anZB v1 ’ò (no capabilities)."""b¸Á_version = 1G _§=O2v1H 8šLcaps…# =-‹8get‚(~àaps, {}# o4ntpÂ?, 16ioPmentaLk, NoneŸ‘ŸB2ŸÆ¡2¡2¡\нú 'VERSION': ['2', '3']2Ä'IMPLEMENTAT*0INN,]2.5.10�AUTHINFOTMUSER"0HDR i@LISTp'ACTIVEb `.TIMESÚDISTRIB.PATS'¨Ó� 'HEADER0‘NEWSGROUPðOVERVIEW.FMT'],  Ä'OVER': [], _'POSTOREAD2%})Añself.assertEqual(ÿserver.nntp_version, 36±implementat=ð&'INN 2.5.1') class CapsAfterLoginNNTPv2Tests(MockedðMixin, unittest.aCase):É0"""Ðs a probably <B v2 Ëð with capabilities only a~ lQ.""" O÷A = 2‚handler_º=¼H$F@def ­`_caps_n_n_nh¿ÅwˆC<, {¸Ü.Q'mquser', ?pw'²áIn('VERSION', yIhŸ SendReaderM›BWith BMode¤,ѬASame€s as for¨Pbut wòll NTTP to send MODE ËaÒiÔthat isn't in%ÿmode by defaultØË’Switchingø×±we_are_in_r$_xãconnectå…Õ„ AMiscÜ(Qi�decode_h� |&§gives(a, bz­~Jlib.S a);u6Ov"" , ""k‚a plain �K", " 2¥àextra spaces 8 >ð=?ISO-8859-15?Q?D=E9buter_en_Python?=O1DéB en ½ð=?utf-8?q?Re=3A_=5Bsqlite=5D_dõl=C3=A8me_avec_ORDER_BY_sur_des_cha?="+/F " X@áEnes_de_caractÁ8res_accentu09es¸ KRRe: [”]ö`lème Ž Žò BY sur des chaînes de lcères hNéesbÿ=?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U= )—§de matricehÑ# A natively p-p (foundÔýthe real world!ö¥úMessage d'erreur incompréhensible (par moi)"<? "B)àýparse_overview_fmøó# The minimal (™¥) responseÜ li¥à= ["Subject:",ñ "From:", "Date üMessage-ID:", ±"References/`:bytesB…:lines"]4ñself.assertEqual(nntplib._parse_overview_fmt(=)q�["subject_@from@datem¨ idr– µ"¢)£õ# The minimal response using alternative names7­b = ["S¡ L.BKKLK:L�ðVariations in caF4ÕéAFROM 2DaT€Ø€QBYTESB4£àFirst example åŸ RFC 3977;o: Ì, "Xref:fullG�"Distribuä&î�p, "xref%d¿("]oSecond‡c ö‡OFULL‡&‡´–A classic‹?INN M† `—1]) +‹def testlà(self): ó# fmt = nntplib._DEFAULT_OVERVIEW_FMT + ["xref"] õ# First example from RFC 3977&•lines = [?ð '3000234\tI am just a teúrticle\t"Demo User" '>ƒ\t6 Oct 1998 04:38:40 -0500\t@‹45223423Be<45454qnet>\t1¨ B÷17\tXref: news.‰` misc.Ë:åU363',¾>ˆoverviewzdparse_(;,Ÿ)Aô(art_num, fields), = 2&öself.assertEqual6“6234Q +X5, {N±¿subject': '³è30ɺ 8@date8Ð 1 message-id7<Ý 4£references4 ù 1B:byt- ­K,178*}£„# SecondjÀ; here the "„" õ is totally absent (includingÍ#8õheader name) and comes out as None1ÙÁÃ'\t«›ep!['&!],}üGThirûöö is an empty string, while "Þ"É#!õa single space.æš •Úz�v'], ' 'ß~A'') ¥1def _%$Ptime(B!):#u'çgives(a, b, *c!0Ð.assertEqual(ÿnntplib._parse_datetime(a, b),  -. U(*c))4õ # Output of DATE command!ðgives("19990623135624", None, à, 6, 23, 13, 5 4`¯VariationsTE", "XR‘�;"0Ê ;O2009È´»def test_un‚aself):%…÷# Test non-legacy mode¤1) with a �eÜñy, M, d, h, m, s,-`_str, ø uyAdt =& ë J˜5½Õ.assertEqual(h è/dth (Ñš¤o(, Falsev+ORuÕ ³=O20000, "= 1=¡5, 1, 2, 39`1006059v010203"v9# 2# r‹á(q( áÒ‡0‡ý ñ//001ñ7"20è11") ÐëP_6(‘âWS– (RFC 977É/# ]§_, TruíL 1;îÌ_, "00é"ÿçÀ(y, M, d, da±te_str, tim G): �dt = date . ™(y, M, d)(ðself.assertEqual(nntplib._unparse_<E¹(dt, True),Bu (2 �uñgives(1999, 6, 23, "990623", "0"/F2000//00/1/©5, "100605]Àò!@unittest.skipUnless(ssl, 'requires SSL support'”@def 5S_ssl_(E€T0„(hasattr[õ, 'NNTP_SSL')) class PublicAPITests(žCCaseap"""Ensužñthat the correct values are exposed in"p]‘ API.""" ˰module_all_¨_ibuteÔ_A_Óñ target_api = [ö'þTError SReply›A=„Temporar,IŸPermanentBƒProtocol+AEDataõdecode_header']�úif ssl is not Noneqì�.append(³æFo4set.B0), Q%$ MockSocket% !ñ involving a mock s>r objectU(Qwhere+_�ÓServerIO file.üfenoughH2_  = ?E_gðcheck_constructor_e…ditions(#ô'’, handler\ uƒexpectedHPtype,ô:msg5`login=»¡, password"):«{É,_,_ îÕPreateÄ0necÅ‚(address•3out³Wvreturn É,()|t=losœ\ƒnonlocalå _c-dY+×! =Ô„"Þ@makeý(/T, mod„$¥* =¯(/&"_,N = \_cbC2sO #Pij… = False,s‘ÝÄwith patch('ÂE'ù*ck E), \OÛ ±óÏRaisesRegex(§ (M‡úð('dummy', user=login, ”password= 3) öself.assertTrue(socket_closed'õfor f in files:?F C$f.>'ðdef test_bad_welcome(4)GÃ#Test a bad #� messageDgóclass Handler(NNTPv1J*B‚= 'Bad Wt'J}ð .check_constructor_error…ditions(1Uk , nntplib.‚�ProtocolE;,�.�!) Bÿservice_temporarily_unavailabl5 5 5b "R400 S–a7ATy8Ÿpermanent858755028a8AP8qÏcapabilitiesv (� respons|!íh¤Ü_CAPABILITIES{²‹˜push_lit(…_……q = '201;!y~ADRepl²j7iesªŽñÜlogin_abortedóŽauthinfoyCãvt@e.comØËfpython ¬¯�AUTHINFO©{, *argsY²º% ªö 503 Mechanism not recognizedÀ¡3 2 •,³°o$, \2) K byBtext¸A"""Bp encryp4ñ and actual SSL module"""fmRwrap_el<, *jpreturn %p @unitNñ .skipUnless(ssl, 'requiresj“support')²ÐMockSslTests(ñMockSocketTests): @staticmethodó def nntp_class(*pos, **kw26areturn'Ãlib.NNTP_SSL-ôssl_context=bypassI1 ]Á LocalServer• (unittest.CCaseu•£setUp(selfŠpsock = 2et.!()É@port up `.bind_ (*'w.listen=kñ .background = threading.T (imqtarget=7Qrun_sÙq, args=r',)t7elf^l.start~’addCleanuù0ejoin) �v¸0 = �#(sô`HOST, õÿ , usenetrc=False).__enter__x Y.¸xit__, Noneˆ¦ù«,›±ò,# Could be generalized to handle more commands in separate ¥sóAwith_˃°[client, _]û˜ock.accep];¤ÂòExitStack() as ct X.3=(mׂ%Der =H3ç.makefile('rb'BVò.sendall(b'200 ) ^jy\r\n'vªwhile True¸Pm¿:0er.Glineõ$@if c+ñ= b'CAPABILITIESoW3 «žðb'101 Capability p:Y4ŸVERSION 2) rSTARTTLªQ.I O¼(el c [er.clos_T 0ñb'382 Begin TLS negotiation now®™Icärsl.SSLC×/ð.load_cert_chain( ‡eLË]`.wrap_0*etþdä", `_side=™dâ&2g–©;a ª ÞAQUITnÚÓ ’a5 Bye!4§]breakŒ?els¢‘ô raise ValueError('Unexpectedó {!r}'.format(cmd)}@<ðskipUnless(ssl, 'requiñres SSL support') def test_starttls(self):!pfile = `.nntp.Isock2elf5^vYð# Check that the ;ðet and internal pseudo-tÅ really wereb¥# changed.ªðassertNotEqual(@,ÄŠ2�22 ¼4newÀ§Qis anq&on°k¡IsInstances(ÿock, ssl.SSLSocketvdrying Yÿ when it's already active failsùRaises(ValueErrorñò) if __name__ == "__main__"'@unitD.@() -ðBEGIN PRIVATE KEYðð- MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDDe3QWmhZX07HZbntz4 CFqAOaoYMdYwD7Z3WPNIc2zR7p4D6BMOa7NAWjLV5A7CUw6hZANiAAQ5IVKzLLz4 LCfcpy6fMOp+jk5KwywsU3upPtjA6E3UetxPcfnnv+gghRyDAYLN2OVqZgLMEmUo F1j1SM1QrbhHIuNcVxI9gPPMdumcNFSz/hqxrBRtA/8Z2gywczdNLjc= ->END²CertificateSBData +öVersion: 3 (0x2ÖSerial Number04ò82:ed:bf:41:c8:80:91:9ŠõSignature Algorithm: sha1WithRSAEncryptionVðIssuer: C=XY, O=Python Software Founda3õ CA, CN=our-ca-serverH…Validity¬ýNot Before: Jan 19 19:09:06 2018 GMT1èAfter : Nov 281)271tSubject¼ÿL=Castle AnthraxÎ ËÕlocalhost-ecc‰Xú Public Key Info‡lRid-ec*Ke ×-Key: (384 bi":publð04:39:21:52:b3:2c:bc:f8 ÿ27:dc:a7:2e:9f:30Bñea:7e:8e:4e:4a:cEÿ2c:53:7b:a9:3e:d8:c0:e8B€4d:d4:7ao°4f:71:f9:e7‘ÿe8:20:85:1c:83:01BP82:cdfÿe5:6a:66:02:cc:12:65:28:17:58:f5:4„ð cd:50:ad:b8:47:22:e3:5c:57E 3d f3T/76„°e9:9c:34:54J÷ fe:1a:b1:ac:14:6d:03:ff:19:d¯„à0c:b0:73:37:4dw%37B%ýASN1 OID: secp384r1$õNIST CURVE: P-384"ÀX509v3 exten'sÌÀ X509v3 Sû ubject Alternative Name: ùDNS:localhost-ecc"ù X509v3 Key Usage: critical'TñDigital Signature,7ÉEncipherment4[�Extended-d (\ðTLS Web Server Authen‡dtion, kClient MuÿBasic ConstraintsØ�CA:FALSEHSh  Id“Ofierfÿ,33:23:0E:15:04:83:2E:3D:BF:DA:81:6D:10:38:80:C3:C2:B0:A4:74xQority6z °keyid:9A:CF€6E:EB:71}ùDB:3C:F1:AE:88:6B:56:72:03:CB:08:A7:48€�1DirLð/C=XY/O=Python Software Foundašñ CA/CN=our-ca-s½ O±serial:82:EA41:Ci91:9B 0øbInformfoAccessvñCA Issuers - URI:http://testca.p¹ C.netÙ/pycacert.cer}üOOCSPLZocsp/ÂÁCRL Distribu+"Poˆ .tBFull¾ � ÖQrevoc/B.crleª@ AlgOðhm: sha1WithRSAEncrypžyð3b:6f:97:af:7e:5f:e0:14:34:ed:57öde:ce:c4:85:1e:aa:@à84:52:94:7c:e5(Pe9:9c€ð8b:ad:b5:4d:16:acdH81:e@ðb8:a2:e2:50:2e:cb:e9:11:bd:1b:a6:3f:0c$€d7:7b:67Ò€Qb3:43_pd:c6:87h 6e÷ 47:78:ef:2f:8c:86:e8:9b:d1À 43±c1:7a:91:30€Ð4:d6:9f:41:8b4P0b:24 78I€ñ11:8a:fc:2b:cd:c9:13:ee:90:4fIp3:51:a3@ 9eX(06€@8:f5h 12Pf0:f2Ï 40½ðf5:96:c2:5d:cf:e1R'ff@ bfhPeb:74è c2˜€21:3e:27[ f1R€af:2c:62—3P00:c8eP1b:c3î 8d€€89:e7:40Àà67:1a:33:fb:c0 96Ÿ 36® 25tP82:d8 27€0f:f7:69 ff''92Àð10:d3:d2:0a:db:65w af@ ebP76:f3d 7a[ 9eç€ 33¥€15:42:06"ðd6:54:49:fa:84:a7:0e:1dŒ–72:ca:19:@ 8e“€aa:a4:02:€3c:f6:1cI8 59Pb0:92¡7À c8÷ ba.P03:4eC f2ô 451øe3:35:a8:b1:68:58:b€P3b:20@eb -ðBEGIN CERTIFICATE-----ò· MIIESzCCAzOgAwIBAgIJAILtv0HIgJGeMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODAxMTkxOTA5MDZaFw0yNzExMjgx OT5MGM—B–`RcwFQY–ðHDA5DYXN0bGUgQW50aHJheDEj MCEG‚ðCgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xFjAUüðùBAMMDWxv Y2FsaG9zdC1lY2MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQ5IVKzLLz4LCfcpy6f MOp+jk5KwywsU3upPtjA6E3UetxPcfnnv+gghRyDAYLN2OVqZgLMEmUoF1j1SM1Q rbhHIuNcVxI9gPPMdumcNFSz/hqxrBRtA/8Z2gywczdNLjejggHEMIIBwDAYBgNV HREEETAPgg1sb2NhbGhvc3QtZWNjMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEð BggrBgEFBQcDAQYIKwY-@HAwIeòDVR0TAQH/BAIwADA=ðQ4EFgQUMyMO FQSDLj2/2oFtEDiAw8KwpHQwf¿øR0jBHYwdIAUms/PbutxPds88a6Ia1ZyA8sI p0ihUaRPŸž/ RŸž o,gb MIGD¶BAQR3MHUwPAðMAKGMGh0dHA6Ly90ZXN0Y2EucHl0 zÁdGVzdC5uZXQv ÷GNhL3B5Y2FjZXJ0LmNlcjA1iñ wAYYpaHR0 cDovL3Rlc3RjYS5we†5feLm5ldCrÀvb2NzcC8wQwYžðfBDww OjA4oDagNIYyRQPcmV2 =dàð5jcmwwDQYJKoZIhvcNAQ ÷ÿ£ADggEBADtvl69+X+AUNO1Xft7OxIUe qoRSlHzlzumciIuttU0WrK+B6rii4lAuy+kRvRumPwyi13tncrNDFq3Gh6xurEd4 7y+Mhuib0UOMwXqRMOkU1p9Bi5sLJJt4hhGK/CvNyRPukE8UM1GjxJ7WBkj1QRKv 8PJxQHj1lsJdz+E4/78Q63QvwiMhPif18fKvLGKCMQDIlhvDfo1xiedAtWcaM/vA i5YMNnglJ4LYJydSD/dpzf8rkhDT0grbZe2vkOvbdvOKehOexjNXFUIGE9ZUSfqE pw4dFHLKGY4rqqQCVDz2HCOBellUsJJlcsjlup8DTjDyTUWF4zWosWhYuTsgo+s= -----END CERTIFICATE----- """Unit tests for the copy module.""" import copy Creg tweakrefóabc from operator (ôle, lt, ge, gt, eq, ne 8úunittest order_comparisons = =› equality&S ;O/+ @ô class TestCopy(’.ñ$ase): # Attempt full line coverage of copy.py Òtop to bottom@1defwñ_exceptions(self):_c¡.assertIs(QbError,]e ).¡True(issubÎ ;Eoð)) # The copyñ() method def test_copy_basic(self):#ex = 42@y = -.5(x)7ÿ.assertEqual(x, y)g:/fçclass C(objectƒ¦�__init__Ÿ[, foo%)U`.foo =!›D{D?�return CdHÞFC(42 Ay.__àV__, x L¸<y~-èD�registry«ËhH Ÿnew__(clsFbobj = Š5.__0°Q0obj©oO5objІqpickle_ìº2@(C, \&,)w…9öRaises(TypeError,§', ¨Breg.‡k V_C, Cl ßÄÀ0Ÿreduce_ex† <�o, protÕ¦c.append(1ž-c!""ž¦#__b2 i&<ö fail("shouldn't call this"mec = []b† *]aÖIIs(y†.oc, [1]0Éd'ZmOcant ÅgetattributelOname0if Ô.startswith("I"0ærx$ Ac|(F"'®Z›m8ñÐ.v òE # ¢-specific ê5xxx s`Natom ^¬&ic#ÜApassq (€NewStyleËÕ 1²+f(b "S�WithMeta$(m €=abc.ABCEÀs teüsts = [None, ..., NotImplemented, ÿ42, 2**100, 3.14, True, False, 1j4’"hello", ÿ\u1234", f.__code__5òb"world", bytes(range(256)), ÿ10), slice(1, 10, 2)JðNewStyle, Classic, max, WithMetac]ëõfor x in tests: ðself.assertIs(copy.�(x), x) ,1def;_`_list(7)Jxuv1, 2, 3x@y = 3RM uqEqual(ym]”;NotmfF¥ ò_tupleó¥ó)5 »O#Ã(6#fO, []AŸ Ô?dicÆñ{"foo": 1, "bar": 2}?·ÑH{fF¾ ý/seü\‹FDÿ„ÁZ<ô`frozenv_ ¼{œ0�Ô H?«_arraytfb'abc'iD<©­uoFÌinst_vanilla ã& Cƒ«æ�__init__1W, fooì%ÓPfoo =!{D%eqB_otherDvreturn K!= +E.fooR=FC(4270qü"=‡¯t )Ö�ðclass C:  ð def __init__(self, foo): `.foo =! DCcopyD?�return CdH)C#eqA, otherHŽ=+SR†x = C(42d0ÀassertEqual(®.�(x), x) =ÊPtest_�_inst_getAargs¼”zclass C,CQ3z|›X›,ô#ŽX„?newWK(intñΟnew__(cls« • = int.__. Ó[&†3getÀ�BœG›G@y = Çæ}� öIsInstance(y, C#$0y%ÿPIsNot>x> ÿ xk S!exÒm*u/exÁ(), {'foo': VEfoo}«lo(;Hfoo=,¢_state'”HwØo{"foo"ÔYÐJã¿ Ày(x), x) ó def test_copy_inst_setstate(self): vclass C@�__init__1W, foo6%M`.foo =!UDwH…J #["foo"]S%eqM_otherMvreturn ž!= +«R•x = C(42)0ÀassertEqual(?.�(x), x) +Ú ^g^ge€¯ɧÑ_»^ˆK'õ#L¤iÒ0# Sñö with boolean value is false (issue #25718 60.0õ¡# The deep7‹) method9 a_basicbh~%42V@y = M.6/(x—y¨9\_memonð6# Tests of reflexive objects are under type-specific sections below. pÿ!is|Òs only repeti-$ofY2í[çFx, x!Œ¶bIsNot(Ÿ[0], x[0]cAIs(y"Ly[1]fTbXl XXX Note: »Ñe's no way to6õ TypeError coming out of'# cÒ) -- this cant÷ happen when an extensionAPmodul©�fines a "á÷" that doesn't formally inherit fromE3Êò` Meta(ÑkEpass;+aC(meta =72 ª›so(C), C‘'Ff{2 C(î±1Y‡[=Nonesw»C;°‰ ±Àeepcopy(x)  öself.assertEqual(y.__class__, x ") 1/ 30foo-Qfoo) (ð def test_deepcopy_registry(?!):&Rl— C(objectGÐ__new__(cls, b<#bobj = B.0´&�obj.foo =J„`returnI‚qpickle_¤ ¡2@(C, Â\&,)w†x = C(42þpðRaises(TypeError, ).26, x7Breg.‹o V_C, C':y =E/(x‘duce_ex’ #re<!__>{, protoS¦c.append(1¦=%""nr#__b_XHö fail("shouldn't call this"mec = []b’2‡eIIs(y’9oc, [1]o .Ïþ  buOcant  Ågetattribute|GnameTº0if Ô.startswith("Y"04r”$ Ac˜(F2'¾v›}D è.vI # 2¦-specific cßxxx() methodsˆoatomic{ø*icaApassyõ°€NewStyleóµ 1Î+f(n "'s¥õNone, 42, 2**100, 3.14, True, False, 1j,�‘’"hello",  \u1234", f¿_ode__5Å2, C÷V, max*�for x inÈs¹1Is(µ·1(x)(¦þà¤=lisø”¦[[1, 2], 3‚œ€ŸðIsNot(x, y) señ8lf.assertIsNot(x[0], y[0]) def test_deepcopy_reflexive_list(self):,0fx = []¥.append(x)@y = J.Sõfor op in comparisons:<crµ÷Raises(RecursionError, op, y, t4é(ÿ6, y²>ÿEqual(len(y), 1&Àempty_tuple(? #(] ;ìAIs(x– ˜lŸ[1, 2], 3uï-5—› ³T¼ï_of_immutables6(Ê)Ê"? ×�6[],C+Þ ’áÁÏ ··â?dicþ„{"foo": v‘"bar": 3}¸"ò}3�Õ ÑÛÄÏx['foo'] = xÙÚoorder_àOTypeÛXeœ?ity[;>Ó?�keepaliv=‡memo = {Š r] , 6ë@[id(!)]õx$Pdont_*ª *¢ºf, 3, 4¬< Œð# There's the entry @new £Q, and Vð alive. ó self.assertEqual(len(memo), 2) U = {}px = [(1']Ðy = copy.deep @(x, <)# rFy, x÷# Tuples with immutable contents areDfor l.dÖ”def test_?à_inst_vanilla(§%):Rvclass CC�__init__1W, foo6%M`.foo =!UD%eqB_otherDbreturn±K!= +XR•fC([42]R”š ŽpIsNot(yo0, xÂIWÐJLwP~ ¸xO C(¦¯ñ3foo¶)4ê/__¬— YÚêË0getåOargsÎ\zÑJ“Ë›˜,¶ö?newµK(intOâŸnew__(clsÐ • = int.__. wšt­ ø¹&†3getÀûBúG¯qöIsInstance(y, C)¹• Ó>žKeðIsNot(y.foo, x.fñ%oo) def test_deepcopy_inst_getnewargs_ex(self):04·class C(intNû__new__(cls, *, foo&*Sw = int.1)d$(`.foo =I preturn & ‰ Æ,__È`E±(), {'foo':Qw}V#eqK, otherÞR—F2 ==+ Ræx = C(foo=[42]û@y = Š.“&(xSÿassertIsInstance(y, C$PEqualC?Not>¶0, xe!IsF 'æ†]\state�Xi�De__initvRƒ*D1getwH·o{"foo"Y#Ÿ/, Ý"¶s?¶\w¶!, Ľ*#[Æ]‰I Á;¼‘ûNÅ\€„ Ŷ» LÃâ0# S_ð with boolean value is falseó (issue #25718) †x = C([]Ðy = copy.deep &(xÿself.assertEqual(y, _IsNotp.foo, x!) •”def test_ð_reflexive_inst(ƒ!):,Ävclass CEpass"ãÄnE = x"óÔ (yÊ?, yÍOangeÄWI(intÚÉr@VI(10)ÒÀ4ÒP.stop´„— )ÃIsInstance(y.I:ó# _reconstruct(_stringT|C(objecWH¬__reduce__;y•return "") Ky(+Is5âa9³ûonostatPü1W(C, (j L!42¥6ß 1.__¼ __M RI(M—<:R!, †__dict__Ý*—C__eq‚{, other)‰ K2 ==0.]ë/¥E[42]%^§8– <Á>K/Fã ate_setµu‹»™»ó¢A.upd¯µ OÀ x = C()  Óx.foo = [42]   y = copy.5(x)÷self.assertEqual(y, 8Odeep<[pIsNot(yš!, ¡!) ƒðdef test_reconstruc €flexive(C!):*Êçclass C(objectEpass*fx = C(çtE = x"Ú» —5$Is×yÓý!# Additions for Python 2.3 and pickle protocol 2 ¯duce_4tupl_:!ñreturn (C, (), Éâ__dict__, iter::6\2eq_X{, other€)_ IA == 3ƒ2 Ž94. ”Þ¶[[1, 2], 3]×­Fx, y8|ò¯(x[0], y[0y*^* €N¡G5> ï ½A>-CNoneSvitems()_çdF¨F)F:‚("foo", Nß), ("bar", 3)ßXKŒ\ BÙ`R~ä ÜÃhb_slots¡¤_4 __ ZÀÕñ³È1Is(<!, q »@‹¿d…‹ Æ$ªÀsNot(x.foo, ñ#y.foo) def test_deepcopy_dict_subclass(self):+/0 C(%J�__init__7‹, d=None(,†if not dYed = {}t‹ð._keys = list(d.>()),uuper().‘d$­usetitem°Pkey, ³sR60 �aif keyæ6in »ò ¶.append(key²0x =t¦={'foo':0}@y = ·.À&(xW÷assertEqual(x, W_2, y J[IsNotJÅx['bar'] = 1 _/No� "{„Q±¨í_þ¤% ÉApassOTV¶[[1, 2], 3]ïx"• = [4, 5]2m…i |B(x),¨y¢”lï•™'ÇIs(x[0], y[0¤ " F²37n‰;X¬> %Aïo_tupleu&vu tÐKE(.G‹GGy), G!,ä6Zæ 0è<À(ìM}Æ9 2Ágetstate_excíó$PEvilS#w(object!à�%__G2 $(ñraise ValueError("ain't got no stickin' Ž"ÂÌðRaises(ValueErrorp, copy.ð, EvilState()) def test_!ñ_function(self):"&Ð.assertEqual(.Tç(global_foo), <bõfoo(x, y): return x+y"^W.õbar = lambda: NoneI`bar),  ø@deepÎü7Gbþ , éM á_check_weakrefü!, çclass C(object Epass�•obj = C()Cx = ^.b6obj2y =m&(xÊgIs(y, udel obj^A2�ñ–ôÔ %ó :\ AM9QtlOAdict�0, _ Gtype[•ña, b, c, d = [C() for i in range(4)] Ïu“oȆu[a] = b) [cd6v =p/(uÑNot(v, a o[a], b`Ao[c], d"–len(v), 2$[$Ð ù515Ùñ,ö÷# The underlying containers are decouple> [xOPNotInEu/ É0keyµ0%ÄYþ°.WeakKeyDicý?aryc_valuee'V?gûÎó Ý�__init__7, i ÜUi = ié i!=1Q# Key0n't;Qied, g¡Z%^ðNotEqual(v, u)  ò self.assertEqual(len(v), 2) "' $ßIsNot(v[a], b" _c], d"hD.i, b.i& c]&d&_del cžZÂ11) %ðdef test_deepcopy_weakvaluedict(ß!):+òçclass C(objectL�__init__9;, i#'Se.i = iWõa, b, c, d = [C(i) for i in range(4)].@u = ¦�ref.WeakV®¶Dictionary(3†u[a] = b; [cdñ# Keys are copied, ý5n't)0v ="$y.)&(uhÓ)#No,?v, " ‰Kñ$(x, y), (z, t) = sorted(v.items(), key=lambda pair:8[0]�’Ox, a¬ŠxDaB/(yÎ Oz, c^z^c^t ¾ , }´áÂÕÁbound_method›˜Ô?FooÖm4ÈEpass¦@f = G•f.b = f.m$gGf/ Ùg.m, g.Mp(g.b.__7V__, gJ€g.b() “¢global_fooaò: return x+y if __name__ == "__main__"õ@unit .ó() # Check every path throughdñ of UserList from colle¤†s import"!gPlist_#s ,‰" °^VTest(/p.CommonãPtype2K& =q�œ_getsliceæŠsuper().%fl®Ú0, 1, 2, 3, 4¥™.€&(l: ÞS-3, 6°W=Tæ€u[:i], lJ+!i:+:i:]+yjWyRjS,j]=Ìadd_specialsE®­v("spam"“ñu2 = u + "eggs"—€02, æB-)†r‡Aoðu2 = "spam" + u  óself.assertEqual(u2, list("spameggs")) .õ u2 = u.__radd__(UserL.*YZàdef test_iadd(:!):w†super().!�• = [0, 1]/Uu += —1\ ï,A!, G!) I‘Œmixedcmp•Au = LPtype2›(k]�$No�’$O, 2]°E°"� + [], u°.$ 2]³?, 1’ügetitemoverwriteiterNó# Verify that __40__ 7ð rides *are* recognized by __N!__´,qclass T`.›M%Ýd-[, key(,°return str(!… + '!!!'q?Pnext(–ü(T((1,2)))), "0!!!"­@userkQ_copy‡‚²A6, 8g9ó—v•F ›Ou, v/Q(u), òv)) if __name__ == "__main__"ž@unitû.ñ() """Test script for the binhex C modulebAUsesÁmechanism ofdpython53ñ Based on an original5  Roger E. MŒ.Šs importI³R from?(0sup02 E`BinHexÐTCase(9.!):É NMsetU#€f>1-_Ú.TESTFN + "1"F+_Š+2+3Vàvery_long_file~/__)"æŒtearDownª°aunlink.Í1nÿ $2$39ø DATA = b'Jack is my hero'¤2st_q‰Qrf = ope¿¡f, 'wb'ƒ!f.¤;.occlose(Œh.4ø, 21Xhexbiˆ2111´r´ðinish = f.readlin¥ &f.·À self.ði hwhile “¯[-1][0] >=8 F6?.po17 asÒ¡True(issub^(exc,yM1]),osivA` of %srK!._u.__> «á%1]2Cd–7Som…ðs require arguments; ju¿�kip them»}<¢verify_insŽ�interface¾(„�?Typ˜ Mpassuv In` ?set3?xc_B„j=exczØ ?#kfinall¼  g.closezË‚Equal(leÒÈP, 0, �Àccounted form& ƒpP_testyð("length", "args0strbrepr")9Jdef =ð_driver(self, results)3: ð(for test_name, (given, expected) in zip(self.interface_3¶s, results)PW,¼assertEqualUð, "%s: %s != %s" % (Q„›K “!) #2defº–¡single_arg°—Å# Make sure 0ñ works properly when n2 a L‘ argumentsŽÅarg = "spam"õexc = Exception(arg)%ô = ([len(exc.args), 1], [@[0],p%],;q@[str;0), b )D[rep#€'%s(%r)'[`±__class__._f!__k&)]§¶âƒ_driver(Ây_multixrcorrectq<0pleûks„Øarg_count = 3ðs = tuple(rangev))Ö š*zFÚœw¤6sy¢Ÿ/s)'¤˜4 + $&£4/no  Àthat with no�!s C is º@ _yZèö,Ã.ê�exc), ''N%O'()'D-ð UsageTests(unit£.bCase):†0""" u,T of eBs"""$ª±raise_failsœ—, object_¥6"""¦|6Sing '-ð' triggers a TypeError.j…:tryŽDen¹6eptD 4 eturn # W%is.B0Ñ%("Š' Xz¾ãStype(È)K_catchC'N pshould ge !6DÁåÒB ) Epass1- /+u +_ «:a ñÀ trKy: ùraise Exception e¾ (object_,)?Epass40šTypeError/Vretura-z -µself.fail("Oõ expected when catching %s as specified in a "– ñô "tuple" % typeÝ1)) 2‘def test_ò_new_style_non_´@ion( Ñ# You cannot :q a new-<ð class that does &Áinherit fromz¨e# Baseò; the ability wa:êpossible until2'Ž # introducÙ÷ so no need to support¤å¦¤—®E it.Û@NewS&CéSÛ *?.(_å)s(A)^( (µnstring¤@Rais1"a "ª%s b× yl"spam"%„ ¸{0Tryz"to·B an q Ú2# ivallowedµŒ*on�i�Ì� D ’+ •. ”ž_instance*C×4an &Z of aB subð¦won't work ¿xÑ ~£“ 9Wis baz p/ò if __name__ == '__main__'ñ@unitp.0() �1 im¢Ó_genericpath 9ôwarnings with .(t.filterÀ("ignore", "|!maup modulezÅdeprecated",”á D)BionWœFÀZ2 ÇôMacPathTestCase(à.+):¢0abs °ŒÃassertEqual(j.0¤"xx:yy"), Y\isabsW4 = NuQTrue((`ù!( ?:"))&EFalsx4foo'À self.assó ertFalse(isabs(":foo")) �self.ass(O:bar,:-Z4Tru�pb"xx:yy*‚ ƒ)T*Qü/b"üb%)&-Ó'ðdef test_split( !):ò± = macpath.¹aEqual((ä’,+M ï('foo:', 'bar' Vðconky:mountpointGg8w£û‡ xp:"), ('3§:p/") 2k› Nbkbl-b"Å­ŒÌ /b'95', zÔpbq/b'r-b"ACi w=(b'3¤n8Ljoin5[ E0('aÓ¿b'), ':a:b'ýv1:2 Me:4š:+Î :›ÿa˜1/a:0`_0^]‰+á1, ' 1ZC, 'cÂ?b:cš4+œ ž † :b /ñoÀ'a', 'b:'), s'b:') ñ self.assertEqual(join('a:', * 2 °b'a', b'b')O:a:bf?b':5#�k:7£:-Ú :u#b'4a§ue 3dØ0Å.þ. ,4@_gcŸ_a:b:c¤7-?8£":buëIæì߆b‡bˆ‰ðdef test_splitext(É&):…´ = macpath.+$ ü"ð(":foo.ext"), ('/')=A0foo62DG@ =€2„€G@7EC:1{0barw<CÄbÅbÆ$b'E ; Ç#b"·3�#b'�J,C @<0extCJC:HF=4²×JA.barF”ÙÞmismounÝÜ>� ÓÀl(ismount("aÃ:"), True) ðself.assertEqual(ismount("a:b/OFals0`]Z‹¼1b"a1ë/ì1bî!b"\ïðdef test_normpath(¹%): ` = mac".$3 ì"íõ1ÑO":a"K _1::c3abƒ:b:c:::d7dkxRaises(õ„_error, €P, "a:Îw@!b:ÂC9n(¾-ª±/bª3­D 31àZ , c« (*ãä)@å*Aæ¥S¸e‡‹ñ class MacCommonTest(bgeneri÷`, unit!.+CCase2 fmodule0 Æ.@_rel"Hòs = None if __name__ == "__main__"ˆnP() # wñ the Unicode versions ofŸÐal file functÅ # open, os. Pstat.qlistdir reŠ Amove $mk $ch ôrmdir import os %sy ºÐwarnings fromF½Sdata FíRalize"60supi Ù£A[]‚'1_abc', t2_asciiô3_Gr\xfc\xdf-Gott€4_\u0393!b590ac-c1 2555ð417\u0434\u0440\`u0430\2!41 3 43 394ð35', '6_\u306b 7d$93€7_\u05d4e>15e7 651.�8_\u66e89b9 05J2309”\s393\xdf,ó# Specific code points: fn, NFC(fn) and NFK Âll differentÕ�10_\u1fee#fdZñ ] # Mac OS X decomposes Unikò†names, using Normal Form D. # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html # "However, most volume formats do not follow the exact sp òation for # these n A0s. ¨ð example, HFS Plus ußÊa variant of×ñ # in which U+2000 throug™FFF, U+F9 FA‚VU+2F8 #D0 ar tdðd." if sys.platµÑ != 'darwin':·Afileƒ‘.extend([§D $- a$V0'11â 38Ê 3d’33d4.!2!€0a8\u030Y 3dA à8', # == NFD('+ R)É1'13R2±'30X 8e9@ab',z$ R/KCS4î0e9bî!c1d cf ddde™bw¸0'15�{T\ufad#!rk&\uAux 20o "lA2003DA:‡4='81A'ˆ“!00ˆCÃ@020'Ó!' n'He0') ==9Õ"# ¦8183‘0]) ›TIs it� -friendly?9ònot os.path.supports_u·_8G`sencodÄ=r0get#dsystem( 2try6Ã@for �2 s#.D5e(fiLUexcepÁE…feErrorCñraise unittest.SkipTest("only NT+Ûª�s with "j"À3 ½E ¬@ing"dEclasï@File}%s(�RCase)²Gp = set( ýsì~_Éq= None ¨0def/sUp(selfH9 i“os.mkdir(Ðr.TESTFN_!O§hExistsLÀ pass  ôself.addCleanup(support.rmtree, “TESTFN) 8æ files = set()±or name in [': > å= os.path.joinwg,<Pnorm(.)aA‘with openÊ, 'wb') as fi,�f.write(+û+'\n').encode("utf-8"]qos.stat0 wË, è" =&Adef Ã!F, s)ž&ifâval_form·areturn?`alize(D.N/PV.sxÒ_apply_failur>Q, fn, S,=oÿexpected_exception=FileNotFoundError=`check_)dW=Trueö¸ÉÞassertRaises(rÍc4fn(X—5excnU = c.µ.-è:if Ÿ `˜hEqual(\8` "Func� '%s(%a) fEed "kO "ÿ5bad„%Ethe µ: %a" %H `(fn.__`(__˜°)©ƒDtest sH“ð# Pass non-existing Uni §°s all over ®eplace.¤fò�"not_" +"A"} ´á,+ð,µ/_chdir0/rm0_emoveaGlistc'pys.plat#¶ == 'win32'¼ö# Windows is lunatic. Issue #13366¬_eò = NotADirectoryÝ ð�FelsewK�…Ò �?=f =ï“fåwf.close¹Gû #s.Oæµ Ša# SkipA ó on darwin, because@ doe‘!rmù2Ì1 toøõ# NFD (a variant of¶-Z). NoEÀlename to NFàC, NFKC, # ó6D in Python is useless, because darwin will normalize it later and soOðopen(), os.stat ñetc. don't raise any exception.9ò@unittest.skipIf(sys.platform == '…ð', 'irrelevant 2á on Mac OS X')N1def_®q(self):ø±files = set.> Tother!`for nf/9P['NFC’2NFDKGKD']nR|t™@nf, } ) ] _sx�!-=+sÇ�0ame3$ãuöð._apply_failure(¢f, name`,Æ/_chdir0/rm0_emoveaGlistc;¡# Skip the'B_ ôeuses aöa²£ differentM5tha@:NFD.:³oVs are=° even if wesL‡ G'J$ ·?sf0#ôwith warnings.catch_(F\ñ.simplefilter("ignore", Deprec^WR œ@f1 =S©ñupport.TESTFN.encode41get<Qystemfing())P/f2L (s)èéos.path.join(s{3, f¹ƒ'f2?õelf.assertEqual(sf0, sf2, "%a != %a" % £·<‘len(f1), A2)) /è rea ÀQ›S "3os.=*v, "tmp"ƽ#| ‚œdirectory…0dirZtGñ'Gr\xfc\xdf-\u66e89bØŽÄQ'.›-¤²“temp_cwd(“ ¤Ð(cÊ, 'wb') as f6\…f.write(/„ + '\n')�w"utf-8"Ø7•os.access8�,os.R_OKvì(Ð) class UniñÓNFCFileTests(ÞiÀ_form = 'NFCó' class UnicodeNFDFileTests(ÿ ): normal_form = 'NFDG%KC7H/KCI‘ K’ãdef test_main(½ðsupport.run_unit!(×Û ò,&NFج <ñ) if __name__ == "_Ì2__"нP() imØ” asyncoredbase64óemail.mime.text from sessage HE*M'PB*pbody_en>B as _( xTutilsDhmac esocketHmtpd 4lib$io ã%syU5timúUselecUEerrn<üDwrapL¤threading ûhïAs, mock_ºH&..`HOST, #v46Ø‚sys.platG¢= 'darwin'Ú"# ¿ô.poll returns añPOLLHUP at the end of …s¶R# on Uñ, so just ignore it#"óhandle_expt(self(2pasKs’×.SMTPChannel.67 = 0 Vðserver(evt, buf, [ ‘.listen()ˆsevt.set2try„Áconn, addr =Ed.accep, ex  ‡.ÿ6out>ÂFelseqn = 500|ePwhile¨¦ and n > 0-!qr, w, eƒV.ž`([], [£]Í0Jif wFpsent = 4š.send(buf8&Pbuf =‘[05:] «fn -= 1MScloseBgfinallFs"GvrGeneralý.bCase):rß €n G|OValu\0h þ ‡[ÓR1¿_debuglevelRÀ220 Hello wosrld") psmtp = šlib.SMTP(ö.set_debuglevel(1òwith support.captured_stderr() as :ovlð.connect(HOST, self.F\&Glose�ó expected = re.compile(r"^O0:",—MULTILINEObÂassertRegex(šÔ.getvalue(), ^!) °xdef tesý0_2(«)Ñðmock_socket.reply_ÿ(b"220 Hello wos-2È^ssg\d{2}:„\.\d{6} Œ1 ",Hô?re.«/ð # Test server thread using the specified Ý'`class ãÛRging_B(“àrv_evt, client ø!(-6try if hasattr/³ect, 'poll'Að_fun = asyncore.28FelseX8 4´"OE1000EVwhileb®ï_map and n > 0do(0.01,:öoa# wheno.õversation is finished, it willž@7seti,š@it'sTÀn ok to killÄ B'if?‹.is_set(oj¼+.cWVbreakIbn -= 1rexcept @†.timeout:pR4jfinall(noà¡Ð# allow some `0 foÒeÜÞØiresult3¦.sleep(0.55•ùvG_allm2çåMSG_BEGIN = '-õ MESSAGE FOLLOWS P-\n' 6:END40-- :2-4  # NOTE: S ·’objects if˜@s be.€are crea a non-defa!ð # local_hostname argumentNIòconstructor, since (on…�systems)wPFQDN Oáokup caused byn lÊ–às takes so lon™ at8! #cÒô@s ouvaÃî®dfail. ñ±behavior ofÀ0d.D¦ËS  åð DebuggingServerðTests(unittest.ò Case): maxDiff = Noneñdef setUp(self):)-ó.real_getfqdn = socket.+ � = mock_-ð4# temporarily replace sys.stdout to capture DebuggingServer output Ÿ£Cold_:=G�Belf.9ö = io.StringIO()$~"= Vj"Fø serv_evt = threading.EventL*oclient,3# CêÐSMTPChannel döì°DEBUGSTREAM’Wmtpd.² þò!# Pick a random unused port by passing 0 for thefnumbero÷!•ǽõ ((HOST, 0), ('nowhere', -1),FÖ ödecode_data=TrueÅð# Keep a note of what “£er host anÖPwere ×Egned}ù),G.Ò §name()[:2]B¡rv_args = P.8O #Â[ dTn�(target= Y_S@er, s= }PP.star¨­Ä# wait until'|5has/ að Ó.J �¶evt.clear()p�tearDown#s H„½ indicate tç—R¬ is finishÛ ° se j ß¹eêã�•terminate™(NþJW.joinˆ# restorñU†Ü%Bõg.close‚sÎHSrBget_@ì_without_xpeer¾s)70Hvalu‡ÿ$return re.sub(r'(.*?)^X-Peer:\s*\S+\n(.*)', r'\1\2'&xù, flags=re.MULTILINE|re.DOTALL‚|stBasicŇ# connece0mtpÐpmtplib.©Ê7%€, local_<!='Ç', timeout=3˜pmtp.qui…hÈßSourceAddressœðrc_port = suppoórt.find_unused_port() Etry: psmtp = ñlib.SMTP(self.host, D€, local_aname=')',RV ù timeout=3, source_address=m!rc°)°I„ÀassertEqual(­.H/, I&ÈØ', Ù ˆxmtp.quiPúexcept OSError as e`áif e.errno == º.EADDRINUSE,íó skipTest("couldn't bind to? “„ %d" % s6 †araise ²def testNOOÜ)wK ÿOHOSTú Ú,öexpected = (250, b'OK' Єnoop(), >0x ÑARSET÷Ñ‚OrsetÑLELHOÑ�# EHLO is€implemen^ñin DebuggingServerEÕÖ@ÿ\nSIZE 33554432\nHELPéOehlovXPNNotIþ&?XPN&{0502üE™Gnot ½%Þ€putcmd(',‰ ú�getreplyELVRFY7ÿO0Can‚ñ user, but will acAÕmessage ' + \ÈÌ ÿb'and attempt delivery2ÿ vrfy('nobody@nowhere.com'pvOveriFØ.чŸSecondHELëácheck that a s) *´ returns a *%ðit's a duplicate  ñ$# (this behavior is specific to smtpd.SMTPChannel) 8! ! =1lib$ñ(HOST, self.port, local_hostname='Ê', timeout=3Tf.helo(öexpected = (503, b'Duplicate HELO/EHLO'1ÀassertEqual(ÅV$, O0±mtp.quit() ÞÐdef testHELP(N!):úLö>0±0p()ï0SupNÐed commands: ôþµ MAIL ' + \¥©øb'RCPT DATA RSET NOOP QUIT VRFYJLSendõ# connect and send mail•am = 'AY• message'WB¾ˆ‡ö('John', 'Sally', mñ# XXX(nnorwitz): QflakyÕõdies with a bad file descriptorÎð# in asyncore. Tcðsleep might help, but should re–— be fixedJõproperly by using an Event variable./S.iV(0.01â` äÛà.client_evt.seAserv!wa Çoutput.flush±mcïð %s%s\n%s' % (MSG_BEGIN, m, 7END£ d€getvalue` ­“lBinary™ybz‰Q (seeÜÖ!in$ÐÙ–ÿ.decode('ascii')éCüNeedingDotQuoteòÕ# Issue 12283"'.‚p\n.mes.….†z JÀevt.set()  ñself.serv_evt.wait() 1 Çoutput.flushðmexpect = '%s%s\n%s' % (MSG_BEGIN, m, ;ENDSÈassertEqual(dÃgetvalue(), `!) Žðdef testSendNull!er=!):"´mŽA)• message'psmtp = âlib.SMTP(HOST,çñport, local_hostname='Ç', timeout=3Îömtp.sendmail('<>', 'Sally', m(ñ# XXX (see comment in¨É(c¶.sleep(0.01¶1.qužÒ¼aclient¾-se½ÚгpdebugouLèæd.DEBUGSTREAM.øðnder = re.compile("^‡�er: <>$",—MULTILINEG2~dRegex({UoMIle÷û.mime.text.MIMEText('…‚†I_õð(m, from_addr='JohnÀo#s=¢•Ÿšð# Remove the X-Peer hea`that DNõgingServer adds as figuring outK°# exactly w< IP/ðress format is putl re ×not easy (andGñirrelevant to ourÞ�). Typicð 127.0.0.1 or ::1, but ieJb`alwaysvP same¿`socket� by ÀU). :(@%_³íð3getç_without_xpeerÍrdel m['N%']N…Wå`.as_stZ·ñ¢æ wpWithAdd“/es„4�m['From']Øpfoo@barI,Rm['To =B['CCçi, Fred92Bcc!:Å Root , "Dinsdale" UÍ?mtpº,À) smótp.send_message(m) ö# XXX (see comment in testSend(ötime.sleep(0.01¦smtp.quit(ñ# make sure the Bcc header is stillf3he “.‘ó6self.assertEqual(m['Bcc'], 'John Root , "Dinsdale" ' Ý ú '') ŽØclient_evt.seè¬Aserv)waÉoutput.flush!RRemovdX-Peer!ö that DebuggingServer adds#ž_Z1 = h3getç_without_xpeertrdel m['n%']ã:# T£ö should not be transmitted‚L˜Ið#mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), 6END9Ìýë#, a/d' ous‡÷d.DEBUGSTREAM.getvalueper = reêrpile("^�: foo@bar0$",$–MULTILINEs¢dRegex(„", H+!fo¹rë(¼�', 'Sally @Fred Ê%',P ¾'­9'):0kto_addãðr"^recips: .*'{}'.*$".format(/)u‚?re."�Q5defZM‹ðWithSomeAddresses(NÕ5# MKñnothing breaks if¤aall ofh£three 'to'Nus exist#°m = email.mÐñtext.MIMEText('Až “'Ê�m['From']Ü'iRm['To ¥$, Ž#¢¯ðmtplib.SMTP(HOST9‘lf.port, Ò_Óaname='0', ƒVout=3™TÛSC .ËhíɧÀar.com$", reÓ.MULTILINE) öself.assertRegex(debugout, sender+õfor addr in ('John', 'Dinsdale'):U\1to_-ð= re.compile(r"^recips: .*'{}'.*$".format(/)),EI /reÉ'Í�!) `ðdef testSendMessageWithSpecifiedAddresses(SÚ±# Make sure %$ s8ðcall override thosemg.€­ñm = email.mime.text.MIMEText('A  6'†ðm['From'] = 'foo@bar`'YB['To ¥%, £#psmtp = Ðlib.SMTP(HOSTõñ lf.port, local_hostname='Æ', timeout=3™M.4_µ�(m, fromÁ='joe@examplE#!s=È7netïð# XXX (see commentM¼~‘¶.sleep(0.01—Squit(ü|Öà.client_evt.seAserv!wa<Öoutput.flush(lp# Removöðe X-Peer header that D\‘gingServeNsÕ_Zœ™3getç_without_xpeertrdel m['n%']ãpmexpect&ð%s%s\n%s' % (MSG_BEGIN, m.as_string(), 6ENDÏëgEqual(¢#, a/:½÷ mtpd.DEBUGSTREAM.getvalueº,9er !""^+: /0$",IÂØ-No’ʼnM B c!YpI h@<€Multiple�6i%erFs Toª 0ùBernard, Bianca |áthe_rescuers@R Ï-Aid-SocietyI…eÀep(0.01)  Ðsmtp.quit() ðself.client_evt.seAserv!wa<åoutput.flush()Wõ&# Remove the X-Peer header that DebuggingServer adds.>Rtest_Z1 = h$geç_without_xpeertrdel m['n%']Nð#mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), 6ENDσÇassertEqual(¢#, a/dÞ ousu÷d.DEBUGSTREAM.getvalueº0senò= re.compile("^:C±_rescuers@R À-Aid-Society20$",<–MULTILINE‹ºdRegex(œ", `+!foˆõ r in ('John', 'Dinsdale'):Rþ‰to_addr µðr"^recips: .*'{}'.*$".format(/)),EI ?re.É'Í�Ú@def £ðSendMessageResent(CÊñm = email.mime.text.MIMEText('AE" mB'+�m['From']Upfoo@barˆ'ÞRm['To J"CC¹Sally, Fred92Bcc!:ô Root , "™ð" UR-Date]ÿThu, 1 Jan 1970 17:42:00 +0000<ópholy@gr8?net,ýñ Martha , JeffBÙdoe@losthope.o]!ðmtplib.SMTP(HOSTÜ‘lf.port, 5_6aname='Æ', timeout=3ÛT._÷&(mð# XXX (see comment-j(X¶.sleep(0.01^„VCThe ø3Bcc�ös are deleted before serialization‰S‹ÂYløÿ: eãÀut, sender)  ðfor addr in ('my_mom@great.cooker.com', 'Jeffódoe@losthope.net'): L1to_P@= re<ðpile(r"^recips: .*'{}'.*$".format(/)),EJ Ùre.MULTILINE)/ó self.assertRegex(debugout, �!) 1ðdef testSendMessageMultipleResentRaises(QØñm = email.mime.text.MIMEText('AS" mP'›òm['From'] = 'foo@baOŒßRm['To XJohn'"CC¹Sally, Fred 2Bcc!:ð' Root , "Dinsdale" UR-Date]ÿThu, 1 Jan 1970 17:42:00 +0000<ópholy@gr8)Ýhý�Martha <€1>, B ˜- ×2׫Õ×psmtp = ðlib.SMTP(HOST, ‘q.port, ß_àaname='Æ', timeout=3…Bwith?!â§ValueErrorè“}c.send_Ñ&(mMðclose() class NonConnectingTests(unitg.jCase):€3Not4,edm # 6ò various operations on an unco0ed "Å object thatô # should rïb excepEa(at príÀ the attemptNûGÁto reference0ðnonexistent 'sock'C‘ribute of$I—K`causesÃ2Att1�$_ }æÖ s(0)•ServerDis,I_.ehloE(� 00, 'ï[ msg'jîNonnumericPortìQcheck¼S non-, ë¼As OS'‰  Í"ñR "5¯", "bogus"$ a(:^2 #)qrespons.0cliIAto aôsuccessful HELOUk0Badë&k VsetUptÀ smtpliòb.socket = mock_# õ.reply_with(b"199 no hello for you!")9àself.old_stdou_Bsys. %1utp!Çio.StringIO(I72 = V1 E0pord125 Ðdef tearDown(5!):Ögsmtpliø ó¨qÇ^ÝstFailingHELOeÿÔassertRaises(wøSMTPConnectError, ,§« RHOST,ñð%, 'localhost', 3) class TooLongLineTests(unittest.CCaseõrespdata = b'250 OK' + (b'.' *›ö_MAXLINE * 2) + b'\n' _setUpJ,â0.evøthreading.EventI“ì×ôû(�et.AF_INEa·SOCK_STREAM�Fë.settimeout(15!žg up `.bind_ $w1’rvargs = 3evt垨8ê2 = óTýð(target=server, ] @].star'²addCleanup(^V.join<qM.wai=¶evt.clear()#ŽP2 J÷†åð@Ú<§†ÿResponseException‹‰€sim_userØû{'Mr.A@somewhere.com':'John A'ôó'Ms.B@xn--fo-fka-~Sally B.Frs.C[4esl_kRuth C10} ša?= (™0, 'ª¡password')2ðcram_md5_challenge±õ'PENCeUxFREJoU0NnbmhNWitOMjNGNn'£� ó'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=wBlistC _-1':[´/'M]_H2Hi,0ð} # Simulated ¾² channel & cu P(Z0): O)0SimHCG'd."):8Pquit_¦q = NoneQOmail?rcp2ä2À = None ürcpt_count = 0 rse–disconnec&�AUTH = 993ñ# Add protocol state to enable auth testing.dñenticated_user = None ðdef __init__(self, extra_features, *argQ*kw):5‰,!._,+µ = ''.join('+û[ "250-{0}\r\n".format(x) for x int5 ])Aðsuper(SimSMTPChannel, ~%).¹£Ø!# 70reløñ stuff. It would be nice if support��this were•RsmtpdF'ñfound_terminator/K@elf.7_™!==ª.Œ;Sline �_emptystrµ?ß .received_,s?ðprint('Data:', repr('€), file=„Úd.DEBUGSTREAM?`U = []vd:try´:Tr_objectv 8ñexcept ResponseE�ion as eR°43yCOMMANDZ�òpush('%s %s' % (euccode, jerror)øAereturnX`-).Þ") JûŸÅôZ, argù2not·�seen_gree‚ í;ºP503 E ú: send EHLO first'± ­5if j�extended_�P or '¡'!"inŽ  �0��command "M"M¯recognized�ã r!isJw…‘¤'%óBad sequence of Ÿ¡s: alreadyòn¡ È =½v.split(lpif len(")«Ÿin [1, 2]°Â'501 Syntax:lÐ [RSial-r]› 3uthR@_nam '_I_â™÷ [0].lower().replace('-', '_] ¶”`’ = getattÁ,B|Ê’Attribute³ ª^Õ34 C?’parameterMãmplemented: unqIed 'Lö'•×;[d {!r}'C"‰»¼I >¬. jêˆ$W0[1])"‘== 2 elseJ))´¸ðed(self, user, “valid): 1if ð self.authenticated_user = =+¶push('235 A5õion Succeeded')6OelseoD5D@credˆaals in®N«Ñsmtp_state = �COMMAND vðdef _decode_base64(%‡, stringrreturn %.3bbytes(+0.enF£('ascii'))$—('utf-8')q@c_plainn‡arg=Nonep if arg is G334 ôBtlogpassþ í6argµ:tryl1*_,ß , Ksword = Y§.split('\0‡5ûexcept ValueError as ß(p.ãSOñting response {!r} into…E andˆ'ÆGó' failed: {}'.format(¶J, e)ù@ä Sž_±iñ(ê Q= sim$=[1]è?logè%#o \Êd 'Username:ù¦DÇVXNlcm5hbWU6–óelif not hasattr}'»_¨Í'‡^ %QÄ@PassDÄ ºUGFzc3dvcmQÄ #“©œÏ â% Òã2delY " ñƒcram_md5wô+Ó}\˜_challengßCphashed_…  ao#i Falsej_û©hmac.HMAC(+&¡p<[1]&,-a ¦AâMú'md5').hexdigest(“Ðself._authent÷icated(user, hashed_pass == valid_ð) # end AUTH rel?� stuff. ñ def smtp_EHLO(self, arg):Aõ resp = ('250-testhost\r\n'#'#OEXPNrSIZE 20( TARTTLS#‘DELIVERBY$ + Ôð._extrafeatures + «V HELPÆ)Ppush(:Oðseen_greeting =$ÿ!�extended_N{ = TruecOVRFYcñ# For max compatibility™ðlib should be send�õthe raw address.Œ if›€ in sim_)sË­æ¥%s %s' % (0d[arg],}`.quoteh()Oelse\À550 No such †:gD 1’list_namepv.lower(�6if #ò ò_! = s[]]<afor n,³`_emailK‘enumeratezL!7) d_+jgmtplib?ˆTÃ8§if n < lencJ - 1a+ Å-Ån7], ›ÁJÉ h h$`X)paccess kyou!')%OQUIT%"ifâPquit_¹¼onse is NonŸñuper(SimSMTPChannel,> ).¶_e¢ý» Å w Ø üclose_when_done(ØOMAILØ „ØÄQÄ c Ä^®disconnect‘è?RCPÀ ?rcpÀèQ è°ereturnÒ›Zªcount += 1 'A[:<-1]º?RSEÒ;Aset_; u„ÄCÄ•ŒEDATAÀg): ÷if self.data_response is None: õsuper().smtp_DATA(arg)#:mVserv.È1['f?, 'ÜŒN �tos'], ['Ùä]) class Sim¤sServer(&):™�__init__Ì×, *args, **kwÙ°# The base X äð er turns these on automatic‘, but ourHæ#<ðis set up to mungeIð EHLO response, so we need'wprovideMñthem as well. And yes,K‡0 is9µûD not.OÐð_extra_features = ['?«5, 'Ã]8AmtpdCRTyóhandle_accepted€`conn, ™†pchannelel_ö k4 Í{&, e È de"b_data=@ +eenable / 25 ƒprocess_T÷Bpeer3.°, rcpttos, ŒLFNone[‰ À  ôrcpt_options=None): +ðself.last_peer = ´mailfrom = &jctos = $ïmessage = data!4ail¯o.ixð class SMTPUTF8SimTests(unittest.0Cas\ maxDiff = (  def setUp(- <óreal_getfqdn = socket.@k ÖJock_-”ú serv_evt = threading.Event()*oclient,ò!# Pick a random unused port by passing 0 for thejnumberq›e = SimYõerver((HOST, 0), ('nowhere', -1),Bpdecode_o=False9tenable_‘V=True(ò# Keep a note of whatá@was ûEgned¥é.!= ó.¯ —name()[1]6`rv_arg,.7,B¤µ¦jí öTð(target=debugging_^@er, s= }PP.star:­Ð# wait until =eöi' h" a'Ó.J –Svclear()L�tearDown#O ;L`½ indicate tʯR¬ is finishÏ “ se † ÷¹ Åto terminate©(NþÆZ.joinû0st_y¼@_supg€s_extens¢ 0mtp pmtplib.â(ŠÄu”LÀ, local_host¤!='Ë', timeout=3'÷addCleanup(smtp.closALehloç`assertn8`does_e/ a )!haõ0n('-iutf8')%±st_send_uniEwithàA_via� 2¥P'¡a j ppcontainäSP!'.en\‡('utf-8'³uvåð'JÅ‘hn', 'Sálly', m,  ômail_options=['BODY=8BITMIME', 'SMTPUTF8']) 5ñself.assertEqual( serv.last_Tßfrom, 'JÅ‘hn';ÿrcpttos, ['SállyxŸessage, mq=In(àºD/, ?/ôua, []) jô def test_send_unicode_with_‚ñ_via_low_level_API‹!):A¯�m = '¡aJ" m!à containing XP!'.enax('utf-8³àmtp = smtplib.|(`dCHOST ñport, local_hostname='Ì', timeout=3_ ddCleanup(jg.close$—mtp.ehlo( ‡ –FŠ(…?', å,EÏ(250, b'OK')ylÇÏ('János'), <odata(m5ûq¼(ª´o¹çNoÂ*`_uses_ßýutf8_if_addrs_non_asciip`sg = ExM±õmsg['From'] = "Páolo "€.!To,ª'Dinsdale'rSubject$pNudge nb, wink† \u1F609;ð6# XXX I don't know why I need two \n's here, but this is an existing úÀ# bug (if it$ðone) and not a problem ¸Ð the new funcrhality.ÓP.set_Ÿ°ent("oh là,§žat I meanf?\n\n"§ç½dòðverts received /r/n to /n, so we cabeasily0Ethatž#$ðare successfully �HO&:(Íñexpected = textwrap.dedØ5""\WD/:  (DTo:  /: ÀF609  ðContent-Type: text/plain; charset="utf-8" .6ùransfer-Encoding: 8bit,ùMIME-Version: 1.0 `oh làþ, know what I mean?<E""")psmtp = •lib.SMTP(¹ñHOST, self.port, local_hostname='Ç', timeout=3a:°addCleanup(jl.close$¢ssertEqual%ÿsend_message(msg), {}5 jÿserv.last_mailfrom, 'fÅ‘o@bar.com'Bÿrcpttos, ['Dinsdale']?»ÿ.decode(), expectedDÐIn('BODY=8BITÿ'w Ó�_optionsDÃOUTF8? } HuR, [])Š˜def test_§ð_error_on_non_ascii_addrs_if_no_ýPutf8(P%):ipmsg = E³Mñàømsg['From'] = "Páolo <Õ>i.!To,·j’['Subject$pNudge nb, wink• \u1F609';½+yaRaises,»`NotSup¨0edE‹,¾Ì Ð.¾eð ) EXPECTED_RESPONSE = e¬ð$e_base64(b'\0psu\0doesnotexist', eol='') class Sim�ó AUTHInitialResponseChannel("\ž_9,S, argÆÐ# RFC 4954's &ò command allows for an -Bal i#-r€.P# Not7H’methods sHð this; some require aæ�llenge. 6M`PLAIN ¡ those, so) t£0her5öSee issue #15014�`args =ïv.split(  ifñs[0].lower() == 'z'M pif len(M%2##º °< �> with th÷³ ü5 64íF#�d. Hard ð;ñ w˜U;õFâ 1]Ú ‡Å5L×.push('235 Okã ereturn¾7ð571 Bad authenticacÇÀSimSMTPAUTHIò nitialResponseServer(SimSMTPó): channel_class = $ZAUTHIEC*2 ,K'ðSimTests(unittest.CCaserãdef setUp(self‹ó.real_getfqdn = socket.²+ � = mock_-öelf.serv_evt = threading.Event()W*oclient,ò!# Pick a random unused port by passing 0 for thejnumberq›z ±(6ö(HOST, 0), ('nowhere', -1), decode_data=Trueáò# Keep a note of whatš@was ´Egnedj“Ó!= ¬.h —name()[1]6`rv_argPå~,B]n¦j¦ ¯T¹ð(target=debugging_•@er, s= }PP.staró­Ð# wait until =e¯"' h" a'ÁÓ.J OS�clear() z�tearDown# ÝCÀ# indicate tÊhR¬ is finishÏ “ se I °¹ Åto terminate™(NþÆZ.joinû st<‚_PLAIN_ij#_r°^_logižnà.add_feature('H H'ó0mtp?pmtplib.¬2´Ó,Çý  local_hostà!='Ú', timeout=15q.·À'psu', 'doeshKxist›o.closeMauth)Žquser = oPsmtp. @word )'Ä$, Í.‘'plain', K_ �eÜûÂassertEqual(c°235) @supƒ"p_¹"s ©ôst_main(verbose=NonÏ64un_ó«rBadHELO swDÁ{General4ÛNonConnectingÀSMTPAUTHInitóialResponseSimTests, NSMTP»TooLongLine0ñ) if __name__ == '__main__':WAtestà() import unit` from  Paudios0sup>)$op8„byteswapb$io estruct$ys ñwave class WavÛ(X� .AŒAWrit%, +òWithSourceFile)�module = t@PCM88(�,.4CasEpsndfileiñ = 'pluck-pcm8.wav'k#Ñframes = 3307€nchannel2Ñsampwidth = 160rat©Q11025n8!48pcomptyp&R'NONE{›@not bressed Fª.ù�hex("""\Vó0 827F CB80 B184 0088 4B86 C883 3F81 837E 387A 3473 A96B 9A66 \Dõ,6D64 4662 8E60 6F60 D762 7B68 936F 5877 177B 757C 887B 5F7BDð&917A BE7B 3C7C E67F 4F84 C389 418E D192 6E97 0296 FF9°%92D C9&ð28D 6F8F 4E8F 648C E38A 888A AB8B DNå0B91 368E C48AD0"""^ PPCM16-(/16./2mÑ.gõ8022EFFEA 4B5C00F9 311404EF 80DC0843 CBDF06B2 48AA03F3 BFE701B2 036BFE7Cnõ8B857FA3E B4B2F34F 2999EBCA 1A5FE6D7 EDFCE491 C626E279 0E05E0B8 EF27E02DPà5754E275 FB31EŽ 1373EF89 Dêö72C 978BFB7A F5F7FC11 0866FB9C DF30FB4Rõ8117FFA36 3EE4FB5D BC75FCB6 66D5FF5F CF16040E 43220978 C1BC0EC8 511F12A4 ðEEDF1755 82061666 7FFF1446 80001Øö499C0EB2 52BA0DB9 EFB70F5C CE400FBCPð,4B50CEB 63440A5A 08CA0A1F 2BBA0B0B 51460E47 8BCB113C B6F50EÆu4150A59Pþipif sys.7Óorder != 'big^#‹¢%(=, 2B/24B,/24B/3B]À.fromhex("""1\ ô%022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 <õ$CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D<õ$B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A< ED8õE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922<ö#5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272xõ$978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EExö#117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F3´ö#CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2B´ð EEDF641754C0 8207001664B7 7F�14453F 80e1294E6´ö#499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE1´ö#E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0,õ$51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48´A""")Ûñ if sys.byteorder != 'big':ý�frames = %Rswap(ð , 3) class WavePCM32Test( °, unittest.RCase)Yñsndfilename = 'pluck-pcm32.wav'}$oq = 3307€nchannel–2Ñsampwidth = 460rat`Q11025n8!48pcomptyp&R'NONE{œ@not bressed FÄ.fromhex("""ö2"BC4#926B8#9C:"40<x>"80@%E0®BD$40F0H#FCJ"80L#92N"60P%34LR½T#20V"00X#C0Z0\#40^"A0`6˜b"80d#40f"80h#A0j"A0lEn"40p8Lr0;S06700v"D8x‡z"00|#80~"80€L‚"00„#60†"10ˆ#64Š"A0Œ#20Ž"40�2*’A”#B0–*˜#F0š"80œ5ž"80 B|¢"80¤#B0¦"80¨$00ª¬#00®"80°A0²"C0´6¶¸#80º"FF¼#40¾"00À`ÂóT3B270Æ0È2·Ê"E0Ì#80Î4d E13øÒ"C0Ô#90Ö"80ØÚÜ#E0Þ"C0à0äâ"80ä#90æ"80è$80ê0ì#30î]ð0òÀ frames = bð%yteswap(frames, 4) class MiscTestCase(audiotests.A ps, unit.-ñ): module = wave @def +Ã__all__(self.2ñblacklist = {'WAVE_FORMAT_PCM'}C(Øsupport.checkL,l%, I= ØÀWaveLowLevel³(Ál¯íread_no_chunks·¡ = b'SPAM'7£Pwith ß÷.assertRaises(EOFErrorõ.Ðave.open(io.B”kIO(b))6‡BriffŒ‹ÿ + struct.pack('n_kiÓa!, áh.p‚.append(&y!ÈVdict,æÍ.çþé Ç®1 édÉ)Çeô!_2•ކöá[CÞ50c, á4a  äCe1 ägçhç]errorÔ«Ÿ_too_many´÷, something, other8�¡ œrr~ YÀRaises(TypeE¾ ^¼D“Cb?fewÓ \ºýX¹/d„Õ l#"y_³“áÊnot_callableæ iÀ = "SurpriseC!" õc = C_not_callable()õwith self.assertRaises(TypeError):+Oõclass D(c): ...fZtuple7ðdef __mro_entries__(u ^bÖreturn object`Ä^Á7bŸEtest¢ay_metaÕ ¨¡_args = []?·,« Meta(typeÙað __new__(mcls, name, base s0RiŸ.extend([:]Ì6C�super().y ÂAØÎÐÌ’6(A,®—ÉBPD(c, û=Q PUx = 1¶F»`Equal(< A[0],‘s-1], 'D',@2], Ë-¯3]['x'], 1/AD.__ /__[,Gorig1?c,)] {[SD, A,]4 ‚‘… sÉ *ïZ *ñ# Substitution should ‰ð happen in direct F  gÆ/ C{5! yVRegex,˜œP"MRO ãqy resolú&; Œ9A"use s.*;()"ÿ)ñ('Bad', (c,), {}) /` TestC¤ÀGetitem(unit±.$asšÉ8#_g/"qPðž R@__(*.`, **kw _ögî,", 4åENone›¦C[int, str™Ò !m$T(C, (9) ;2{ÂOÓ‡1__(%Â/NPf'C[{#âðame__}]' ò self.assertEqual(C[int], ' C') +C)QC]') (ðdef test_class_getitem_inheritance(G!):.Y)& CG_Dp_(cls, P?.ð return f'{cls.__name__}[{0+]'y•D(C): ...  D  0D[D/_2Kÿ'Should not see thisQƒQkSbomethodi@1^| –eopatche'!�init_sub¸_¤ž,$,ЃÔ6 p1 =   `ê'…fßwith_builtins²kA(dictipcalled_?r = None”…G VN';B(A‰Epass%äWIs(B.P,¥wBi:?ints _error?ŸC_too_fewv àMœfzðÀRaises(TypeEŽ G† ÷VOmany¤«, one, twogš ®À with ÷self.assertRaises(TypeError): ñC_too_many[int] ð def test_class_getitem_e@@s_2(_H&* CYD_Ap_(cls, M?ޱreturn None†Pwith oÎ"()Ç<›eE: ...Uve = E().©¥ = lambda ²õ: 'This will not work'Eªe¨êC_not_callableP£¿"Surprise!"ˆ% s•LÀAmetaU›Meta(typeàN Âðf'{cls.__name__}[{>]‚'`Equal(�Ò5, ' /')ä àçIâ+êe'from rÊa5 C(=vS5w Ž ICF ±ó ) @support.cpython_only ÂÀAPITest(unitM.0Cas f+ Vq_;pcapi imk” Generic, QAliasPô¿³IsInstance(4ëZ(int)K#M3Int:$ =oo(5 YT¥­4ð.__mro_entries__(()), §&,)µbl 1?pasopC.__bas`\ �.Gorig3°–:Îð_, (C, int, object)>4if Ûâ == "__main__"Ì8A() #—± asynchat Ž# ++4ore Terrno esocket$ys ²_thread as 5ing%im\¾ã.mock HOST = ².° SERVER_QUI b'  \n' TIMEOUS3.0 `ð echo_server(threading.Thrð ead): # parameter to d ðmine the number of bytes passed back-3theDñclient each sendñchunk_size = 1 ó def __init__(self, eventŽ’±threading.T .0)G(>.=" =E psock = 2et.(”.AF_INET,»SOCK_STREAMa@portF up `.bind_ ½V1ñ# This will be set ifI €wants us=õwait before echoingÀa# datah.ð€start_ree_ýFNone_1run�S;¶ock.listen(´IG.setcconn, ¹!= (>h.accep*Åbuffer = b""³’# collectÐõ until quit message is seen2ò while SERVER_QUIT not in€e¹* = ¯v.recv(1Ý !ifC' 9Ubreak} Í+Åh*r# remov*²ÜWEIÉ—.replace(>f, b'')f"ifûù Îe%.g(P¶->b entir¦$of©"edæá:tryh0# täñmay fail on some tests, such asõ_close_when_done,Zb# sinc>f0s1phannel =` it's B\)I3W ±##n !ù.+![:8ª]==ûtime.sleep(0.00_"DQ+4elf_5n:]õ ex8 �QìĈ]ya class5_:¡(asynchat. _ "):Yrñterminator, serverÓ1G P‡ PconteÜ6= [ò»pcreate_Â/et€€ect((HOS°¯«iFset_Ú( (©ªž'thandle_sVê °œúys.platform == 'darwin'ç#Äôect.poll returns a¡POLLHUP atü0ends�V¤‚#re¾� just ignG)it+Óðexpt(self):  `pass ðdef collect_incoming_data(self, !):+/¡.buffer +=Hñfound_terminatorC =ñcontents.append$R)gp= b"" ©óstart_echo_server(^ðevent = threading.E(RHs = 5..T)Y.waitSclearò time.sleep(0.01) # Give ’ !A to Xp accept‘Ü¡return s, kð class TestAsynchat(unittest.CCaseåöusepoll = FalsexQsetUpI*ª_‚support.ævsetup()H�tearDownK ;Qnup(*fKGline a_checkX , !,/g_chunk·ÊÙÎ.Sy_size =gƒ$žÓwúìþá'BcÂsclient(. —&ÿ.push(b"hello "�world" +S ÿI'm not dead yet!,¶SERVER_QUITHa’Ðore.loop(use_€=ô�Á, count=300,û@out=l=Cjoin)&(s,sTIMEOUT;ø_äassertEqual(c.44, [ûN, b"å]N`# the ‹!• [�s below —ð receiving variously-?dÅ!# Q±s back fromWï€in orderóó exercise all branches ofGO_ã€.handle_­0st_®914 #ÀÀ one-charact|skF÷for l in (1, 2, 3D f m¦ƒb'\n', lFy4 ›2›?two›Ir�3�?hre:I;qqq;wnumericÔg‚ 7lenž`# Try ’õa fixed number of bytesèKëÀ c =ó echo_client(termlen, s.port) õdata = b"hello world, I'm not dead yet!\n"3pc.push(:H¶SERVER_QUITðasyncore.loop(use_poll=self.use ö , count=300, timeout=.01E0supºæ.join_thread(s,•TIMEOUT) §_ð assertEqual(c.contents, [¾#[:#]]8ðdef test_numeric_!€inator1(Q%):`ð# check that ints & longs bothJ÷k (since type is;¢explicitlyFaed in )Ð_chat.handle_ç2›_‰/(1Å2ÅÔ.R6R7one N`# Try ´ö ing a fixed number of byteñs, event = start_±vserver(õ9c =ËONoneÈ÷])Ì ñ€buffer, î Ìüsimple_producerÌž$_b'\n'Ÿ/\ng 2p = ­Ñ+m", ëv_size=8˜V_withëp sœ| �]", b")"²fstringä®Ïn‰ ǘÀ¬empty_linebAsB( (bs are µd correctly>ËÀr() óc = echo_client(b'\n', s.port) ýc.push(b"hello world\n\nI'm not dead yet!\n"6¶SERVER_QUITðasyncore.loop(use_poll=self.use ö , count=300, timeout=.01E0sup¨æ.join_thread(s,•TIMEOUT) È_õassertEqual(c.contents,%ô[øQ", b" þ#"]lð def test_close_when_done(�%):kñs, event = start_Œwserver(è.tresend_3òPing.EE1×* ×Õ,c.ðÄñ*1ò# Only allow the ,2 toAÍÐing data back)ág afterOAhas Àñ d its connection. This prz€s a race" di!PXwherešÒ es²1 ofY›ðefore we can cheªghat itNõgot any down below.sG.set :6 []Î#ãðmight have been ablew­á a byte or two’¥, but thisÌ¢# at least 2s t ð received somethÛ÷and didn't just failJ`(which<ñld still result in¶ ¸0havRe1anydé±.2ü Greater(len(s.buffer), 0ô+8éñ# Issue #12523: $ð ) should raise a TypeError i+P doesç(geR…s stringúL¥@= b'¾Es\n'h !'-aarray( ¬memoryview!0hR%s( ", ^F, 10R1–'unicode'8L(•o`É ”# [�$',‹ nÀ class TestASØhat_WithPoll(�ðusepoll = True ð class TestAsynchatMocked(unittest.ðCase): def ó_blockingioerror(self$(ó# Issue #16133: handle_read() must ignore BI0IOEIfBusock = ‰Pmock.ž)()$ü.recv.side_effect =Tõ(errno.EAGAIN) ?ãdispatcher = a. _ j+P.set_�0et(Ž÷elf.addCleanup(40delRGnnel€Kwithá�w.objectA3, 'Bna') as —1s0ró§À.assertFalse¸or.called) ÿHelperFunctionsüfind_prefix_at_end~aEqual(lOhat.<ü"qwerty\r", "\r\n"), 1oËMHdkjfO0ó¯NotConnectÿ disallow_negative_terminat E1259�Pclien²  ,t~8ÁRaises(Value1", E˜�@, -1Ýò if __name__ == "__main__":`ñain() # Author: Steven J. Bethard . import codecstinspectodshutil5sta$%sy%„textwrap'„tempfile¼óargparse from io •ƒStringIOÁ0sup¸2Qt$ÄStdIOBuffer(OðHpass9/.÷B\setUpQ# The]ðs assume that line ñping occurs at 80 columns, but thisb ð# behaviour can be overridden by settP÷the COLUMNS environmentIóvariable. To ensuršr«p#ô is true, unsetW.Lcenv = r&.En‡VarGuardóAenv.G#("Ÿ"ûj-€__exit__õײmpDirMixin(S"):þ…jh0_di s@.mkd ¢+3old*ˆos.getcwÅros.chdi.@-„ŒtearDown  9eðfor root, dirs, ¢Ás in os.walkOpð , topdown=False):  ðfor name in files: ños.chmod(os.path.join(self.temp_dir,Dõ), stat.S_IWRITE)KÜshutil.rmtree;aTrue) ,ðdef create_readonly_–3,¡­)¥_–? =   (;hß with open(D‘, 'w') asje/%a.write0 L#&K ö READ) class Sig(object):óƒ__init__ç°*args, **kw îu0 = Í/2 =  u/NStmò__dict__.update([¯c__repr¼«ñorted_items = sá.T&()(^²_str = ', 'kð['%s=%r' % tup ³#inVe]Gàreturn '%s(%s)8B(typy@).__½2__,(o Ð#eqÎw, otherÕYAvarsËQ) == *sÿArgumentParserError(ExceptionûpmessageI‚dout=Non 3err eMQ_codeža.Q V^6err1?&3 = ^ st’Ë  er¶jstderr²6 = 0 ð2Q_to_p-_"( _å/, ò# if this is being called recursively and c0 or 0out1 alby9°ñ# redirected, simplyR� the func½Q1let`encloszJRcatch#öòif isinstance(sys.œà, StdIOBuffer)ª':out'¡˜4(3m 32notþå 7, 3Û1and€# use it&ê @Fold_;ñ1outL_&= ®=(¶;<6try ÌŸresult = 1 )s0key%Qlist(óF)�/²if getattr(%`, key)w¸6out 7s8#, (2outý)l5errlÀ ÷ setattr(result, key, old_stderr) rreturn ,õexcept SystemExit:<ð code = sys.exc_info()[1]. *cstdout, ª.getvalue(Šž+?err+ö raise ArgumentParserError("³2", qPerr, Ÿuvfinally×Ì/$ =-5outÍ 6err Áerr class zRaising™P(argp£.1): ^Adef Ð_args(self, * `, **kw )©++_uper(| , O&).5sÄùvA_to_$1r_eH ‘Œ·Oexit±%«/¥+Ÿ Ë&Qñ¡V¢,}6»¡TesterMetaLS(typeòr"""Adds!�r tests ueQ the 0 îributes.œC“°es of this Qñ should specify?—followingC–a]ð_signatures -- a listYôSig objects whichZ¡>%of²9Ñto be created9Nfailmzds thatÌQcauseʰrBÝ0to I|successÀƒ(initialåñoptions, remaining�) tuplesJZhwhere <ø ieœQe strQBrgs ßœ%d,Ck© is a dictÔQmatchÔ`vars()lJ6FV ^)of‘[, andÈ2ebe anyEí3 unQùó2"""S¦ __øð __(cls, name, bases, bodyË·*!if#V == 'èVCase'})Šg”# defaultöE3FemptÁe`ot has™'Êrº'–a2cls$g = Sig“Z wV / =î-µa# func¯ð for adding optionalà arguments ?# -2õdef no_groups(parser,ZÕ_signatures):4m¥"""Add all-òs directly to the O9""";¥for sig in;h gkFT.add_òÑ(*sig.args, * kw%) jÙ2oneÚÙ-ñunder a single .Àå#= ½“e'foo')°êe \Bmany‡ô Eeachºsits ownü$i,ÿ¤enumerate(Ù  q ð U Š:%i' % i\@0T ¾À# functions Æ´0ing'žJ¸@listÏ·�P®i-p by pas£• a F |dreturn–¦eUs�s>0sysX…pdefaultÿ`to sys©vŠpold_sys~5v ='°<H = [0j[0]] +]0>try?ó ofinall@…„jð# class that hold �e combina  of one opa3î`# addi± method and41arg¯O5wöAddTests(object):šPð __init__(self, tester_cls,wƒH,j>(._ˆ:s =Bœ{4i¾usª/ ]P_name;elfx!._-__qk"?<º_ÍE[¿0ail&, ®successes]wÎG†E?unc3óV; £Às_name, parsße_args_name AtestÀ = '_'.join(.?s) 1ñdef wrapper(self, CUfunc= /):<€$>)(?tryA}!._·B__ =‚µNÿexcept TypeError[OpassC€setattr(½cer_cls÷u, 2*™_get_pars./er!¨Ì2er.4°_signature. œ kw6! 8^ 8pclass(*TB, **=£÷P._add\ruments(R er®ÁsHrreturn ; n<m‘_failures._>E2 = �wG.er~@for êq_str inE4er.q&1% =8~.split(]êDwithVñassertRaises(ArgP”`, msg=^ÜMä{!s(1:`succesp;B×, expected_nsD{EÑif isinstanceÄO, stöèws `result� 4- !r,½²+.­gEqual(á%, _êQ# addç s Sð each combination of an op 0als/¥ing methodšP# and)1arg$_ vsò[no_groups, one b, many *s]†F C@listcP, sys 3ƒ‘AddTests(ý ‡,±j°) bases = /bCase, é6 = berMetay'81', Kª, {}) # =E # OV»s$ [Œ-ºSingleDash(r|0"""¬Ž4 Í1a s;S-dashÓºbing"""ˆaÝúá = [Sig('-x')]ófÑ, 'a', '--foo )x "y'9[:K�ð ('', NS(x=None)), ó('-x a', NS(x='a')),  5 -1:--1;ð!] class TestOptionalsSingleDashCombined(Parser&aCase):˜0"""D an <‘ with a sCq-dash oX± string""" =ñargument_signatures = [ô0SigôP', ac˜×='store_true'(=yyy*�const', ==425zH]vDfail‡'lÂ'--foo', '-x'x 1 -zVz -x'ª½A'-yx !yzÖD'-yy3yyzQ {success$('×ñFalse, yyy=None, z %/?Tru.†o^‚É0x`�_x`0/ -a/ -cV ð/42|…/ x Äd#4Sk* 5àOLongÜÿmulti-characterì'»c) ‚|)…Pfoo -¥'"a'HK ?foo:Kl0NS("|!H"h$fo˜! Ãf©ÿSubsetAmbiguous´ �zs where�qs are sPÿs of each otherœ °C'), YoobarOrab'Î íPfWSb ‡ÑrÒÐ1, f� 1rab $†f7—6o7 ¥Àfoorab=None)C), ò('-fooa', NS(f=' ñfoobar=None, foorab ):Ebar >0='< ?rab<Iy4'a'xð"] class TestOptionalsSingleDashAmbiguous(Parser'aCase):ò0""" :ñ that partially match but are not subsets""" Cò argument_signatures = [SigKubar'), arab')];Dfail0‘'-f', '-f0'-f.ŒoBo b'FrsuccesswXË#('úzö3° 2¦�X+ba3e 3f„Ì|4htNumerich %ankÿ with a short opt stringYß1', dest='oneP#_P'-1 -~BD1 -y #2L?oneö1Ô �÷1Â?NS("-2©/-2Û BDoubÛjd;P-dashp?ionsBº½YÃ÷'x1 -x(0 --»oF]«=r"="R -2.5|Qfoo='Y¼J ( ¦PKMH² svt4ing"¸& }À-badger', ac)×='store_true'É.t® ¯Çõ"-bÝbrP'--b=Ò 4a=4_dge 5e¥¿=False, batRbat X½1%'XFÈ9bad.àTrue, bat=NoneS)), à('--badg', NS( ÿer=True, bat=None/e0r1ð$] class TestOptionalsDoubleDashPrefixMatch(Parser)aCase):Ò0"""Ás when one d=q-dash oRá string is a pRñ of another""" Kñargument_signatures = [<4Sig<eÝ ac¯×='store_true'g.]IDfailZ‰J 0', a#=2 radge 5'>{success™)('kAFalsÍÌ/ X/>'X'ú=.d[V‰„.ƒ/[ã 0�fSingle‡| D an »q with s?_- and�syOf', srt·=baz@�const', 3=42¾k©0fbaW2'-fRP'-baz›P'-b B´B¬%f=§r’~z „]ENS(f¤0 1-ba‰4e'ž/bad r8º/r=7 bñž+42ÌOba -Ð 2š’Alternate_Charsž s²ccustome›pt0 = ÙE _c~P='+:/\rdd_helpÙ)îS+Ú ::|¥Ú/ˆ @cÚ)È’œ˜ïæ!-h-ò +$::/ K¶  (Öž®:À'::ba B', NSð(f=False, bar='B' ³z=None)), °('+f ::bar #�NS(f=Tru7[/b', 2`j*42ho/ba +f2ð,] class TestOptionalsAlternatePrefixCharsAddedHelp(Parser1aCase):äñ"""When ``-`` not in p? _c@ñ, default operators created for helpJù should use theGWôrather than - or -->ñhttp://bugs.python.org/issue9444""" ,pÉø_signature = Sig(¶À='+:/', add_¢´)>†argument@Qs = [õK'‰ acX×='store_true'( @/baz} @�const', 3=42K]yqfailureŠÄ'--bar', '-f b ~¦ '-%%-oHrsuccessIZÓ$('WóŠ Œÿº0Œ4e²/baX�,WÿMultipleShortArgs_`Verifyò%t ªð must be called with4 iroCined>/es÷-yöŠ÷ -x> ·÷/+y(P´ ü&w'}¼_'-xyz/+x/-y+Dx, xy z *2ANS(xb/, . >+y 1O^?+yz19Ž»ŸOLongŸ  a combinaññ of single- and double-dash okv string›T!-vÔ�-verbose n_-noisS ³ +I-x -NNNaR-v x'4çÀ [ (ó '', NS(verbose=False)), J('-v#i>2%j + k>|j>¾OfaulÁ pspecify³Aa de3„ for an ÁxºkL?=42´!ùx—0, yF @$xx#' "y†6NS(E/'y4 bNargsDú Gnot = the numberGF&Î ã_, '-xé ¥ ™4x a/'a1 ü_1 argï%0, n./=1'ø7[)43ú3úsû-3û ¾à'-x a b', 'a -ö/ b*D b c#1, 'c?c']-$4Y>=Ù%$w'A7'?'#%_ '?', constL‹(+(¼^'spamV–.ðtype=int, const='4ñ 2', default='84'), ]òfailures = ['2'rsuccess'1ó('', NS(w=None, xóy='spam', z=84)_2/-w4! ³j' ixiO42, › xgÑo5 yg;y yg4o3zei+42izgŸ5ð] class TestOptionalsNargsZeroOrMore(Parser#aCase): 0"""Ðs specifying 8„ for an Nñ that accepts zero or more""" Kôargument_signat‰A`Sig('-Ûnb4='*¾’êõ�× ìaì { ušvNS(x=[]m $" aÏox=['a') ( b+O, 'b0ù}O+[]{y{$ƒ'y)�.4 ?One3??one2/+2 +2", � '-|1'a ›?y bP2±,<Yá1 (Choices6Rthe c5 =#4f',J^='abcõÆg', type=int,Ÿrange(5))"ðAf d'agÎ_'-g 6ñfgK¾D('-f–0f='W%c0f=' %4g 0%àÀ g=0)), ð ('-g 03', NS(f=None, g=3)), ”('-fb -g4&0'b'%4%ð] class TestOptionalsRequired(ParseraCase):Z0"""cs an o30 ac<£ that is rBA""" 5ñargument_signatures = [«õSig('-x', type=int,ES=True×]2DfailCr'a', ''{success]Z" 14x=1þx$42$42Aç_Store Pthe s(0for2e [!='N"')éOa -x ç-é4foo'   _Const _c.*3y',@T1', \=object(=&yM uDNS(y^�A'OFals, _f.Þ 2"zT8!-zAO-z a?z�vQNS(z=ï<<Ú;Otrue*m-apple!X 6=;"'- / b+o 0Gp& 8_Appen› ~a)1+ baÚ‚R+ 0S'a --  / a2?baz~M §0NS(#T['a'].SCbaz y ­,F, 'b1— _¯WithDefaulÚj@2, d…à=['X'])] fðailures = ['a', '--baz %a  ò a b'] success7÷('', NS(baz=['X'])),E $O, 'a)/ b1F, 'b6ð ] class TestOptionalsAc ðAppendConst(Parser%aCase):�0"""qs the a. _c/! aA„ for an XA""" 9ôargument_signatF`Sig('-¿I(='^1', f`=Excepª-;3c',„;³', dest='b'.�fÆ=A'a -0-bxÒO-b xÂ[=None¿ÊÞ%=[³ âpb -cx -yD /0, 'ˆ?_, 'yzȯWithDefaulÓ�¯¨âo¢ãU'X', ©è 4í)OCounÜc($¨‚�ŸN/')S"x !x”p'-x a - 2 xS~dNS(x=1lÌðllowLongAbbrevia1ÐA.q long o[”s to be a>ÿed unambiguouslyÕD-foo‚ë<› 'leϤstore_trueGD É-Q! 5» ½1foolP, fooŒÌ |le=FalsÚ\" 7h>' =!ba0NS(?p1az=UL|1bl ì' g„ 8'azÎele=TruÀ.@Disa1ÀestCase): ò """Do not allow abbreviations of long opa'ñ""" parser_signature = Sig(J_Jq=False)/†argument1Qs = [O<Ÿ'--foo'),€dle', acŒÏ='store_true.4nly]Mqfailuret'fbn 3', r d!d �2 2'CrsuccessDU¸ò ('', NS(foo=None, foodleü1nly)Ù(z…>'‘=Rnly 7¥2dle & 2�' Q2Tru›�4'7'Œk] # =p # Posik�al tests&¶ class Test/`sNargs !(P"aCase):40""") acðhat doesn't specify nIo@75¥ èËx?a bÆ a8aæ1ãÛbies anàf1å,5?=1)î7W['a']ð2ð32ð2ð¶$'-ã/ cå & bçùO, 'bþ¯ZeroOrMore'’unlimitedÉ ?'*' /-xù öì¾B� 13Default86‚ and a dWF!,=_='barU-D ßXH?Oneˆ%Àecifies one ò(or more nargs""" argument_signatures = [Sig('foo',0a='+')]2Dfail'‚'', '-x'rsuccessB,bø('a', NS(foo=['a'])),* b F, 'b%ð ] class TestPositionalsNÈ"Opp(Parser#aCase):a0"""Ts an * C? -x?a b çKNone4'a'ýDefault"’ with a dDo value!,C?=42*%$42 G#ŸConverted,>iôthat needs to be cpñthe appropriate type.8i %þ�1?',IF=int|C'42'^” ®„o, '1 2° ‹1®1¥¬ ò¥ G two !s XÒdon't specify�8 /1), ?bar»¹ _a b c èÐÜobar='bµ1 a "noøò followed by one1"Ú1® "--ä''[Ï22 ?nonÏ27 4&/ dC& cCõ!, LcL¯ZeroOrMore8À """Test aò Positional with no nargs followed by oneñ&unlimited""" argument_signatures = [Sig('foo'), Rbar',[a='*')]>Dfail3p'', '--5rsuccessQ/qÑ('a', NS(foo= ˜bar=[])),$/ b&>'b')/ c+F, 'c0æ] class Test8 sN0ðNoneOneOrMore(Parser(aCase):š0"""/ au~or morew++w _, 'a'| Xbp¢W;Can OYW+?WO b c[ †VÙ4'b''§ BZero¤[QÿÉ$?non¨*4@[], %'aCÇ[ö)H)+ , F0cYx w!y?+£y !/ƒZFÄY!Y?è?', default=42e/#42Žç ,À'b')), ]ð class TestPositionalsNargs2ZeroOrMore(Parser&àCase): """6 a ;� with 2 nBò followed by oneÑunlimited""" Iòargument_signatures = [Sig('foo',OQ=2), 5barQ'*')]GDfail<r'', '-->2'a'"rsuccess_4Èð('a b', NS(foo=['a=êb'], bar=[])),-/ c/5'c'2]b ?Onea@jor morec4+c!, Hj=6p®�5oP44?4O c d¢)ONone¤4'c'0¢ Z1gç½ 1mï1 — Ð÷6&'+bó+è4$‚„'é --@rsuccess\//((DNone)a$( <*6RM)}-ßChoicesStringt ò set of single-character cEgdspam',3ÿ=set('abcdefg')^ @, 'hl 42?ef'oq˜ˆ;g´z¥ (?Int%_integ#†type=int&�range(20!;44'15$15Ä Ac¿oAppend! athe 'a)1' a78 C‘³#',;=KeÝ&à2/AÍ!, |ãpê/ du ©!=[DÂo] # =Ó # Combined o*vs and pHo testsV�N·sNumericAnd£Ó ðs negative number ÑP whenNµßs are presentöx…œ -Êwdest='y¿store_true'ð-MO-315Ú "x=»ty=Falsexáxo/, #«6NS(H;TruG0-4 G&?(y=% …¹oAlmost¿;aTð numeric optionsñ are present""" argument_signatures = [ úSig('x', nargs='?'),ô-k4', dest='y', action='store_true3]9DfailgR'-k3'{success÷ ('', NS(x=None, y=False)…D('-2% %a$ #Ê n*')åi$[]mÙ(ta []ã 0['a/y=%T -- b€*;'b'r]qþ- –!a '˜|%À ('a -x bð2', NS(x=['b'], y=['a'])), ] class TestNargsRemainder(ParseraCase):20"""ðs specifying a positional with nJá=REMAINDER""" >ñargument_signatures = [Sig('x'), 3y',BE'...Q-z')]GDfail<r'', '-z2 Z'"rsuccess_4ï4('X Äy=[], z=None(_-z Z -:'Z',`X A B 2 ] 'A—B¢Z„p�X Y --fooCY> ¬ ¿ OpƒOLike» o)Ñs that may ortnot be ¥s· X¶ó-x', type=floatbO3¬, dest='y')Ë@$'*Õ ÷oa'-y2.5""xaB -a'Ý{P'-x -‚ 4@3 -3 É /Zb -2.5 `?3 -2da x -1„1/ À•ô‡£5z=[¨˜(»”Ò?2.5-‡/_ /ƒ0y=0eŠ3 ,-- 3 -,a’-´•ß±zçàPa -x ¢191.0?\.@0 3 ìq‰!y=8 � ¸ÿDefaultSuppress½ 0 acåsgs3Bed dE´qn ?'•ŒP=argpÿœ.SUPPRESS¦6bar¦*:@--baäÊÏ='store_trueFI _ ´8kfoo='aÐ2a b’a, bar=A EÊ«NS(baz=TruF'a #N,* |‡ 9 G¯ðDefaultSuppress(ð ParserTestCase): """ñ actions with a p,ñ-level default of SUPPRESS""" @)ó _signature = Sig(argument_<A=arg+.B)?(AQs = [ŸLú'foo', nargs='?'),6bar*s--baz',âÄ='store_true+]Pqfailure€B'-x'rsuccess(——('', NS()Œ2('a{foo='a') bº, bar=['b'])¯ºNS(baz=True!'a #lN,*/ a|9 ] class 4D242(D'/42>/42/—--versionõ T='1.0ÓjŒé 42¯"r=zÏ+42&n8, Euoy+æ /, =Øð @}ìE øAÀÿ sFromFile(TempDirMixin,  „reading ÝÕs from a fileüãdef setUp(self�Š`super(d †!, ,.83YQ_text¾§`('hellA ˜ world!\ný)ùrecursive', '-a\n'J%/'A @x"=�('invaliddÚ@no-such-path’~2@for , á1 inGîÄ&‚ = open(26'w'%#p.write(Nclose()Þ Ïmó_prefix_chars='@mø —k(-a�xyÙ+ ®L-` 'X @cÀ'@missing'] ð successes = [ ù('X Y', NS(a=None, x='X', y=['Y'])),-„-a A Y Z4;'A'3L, 'Z8p@hello X jcworld!uX="X ?s § E ²ÿ-a B @recursive» ?ùÆXI Z [”*'B T €["-a", "X3Y"]†'J„ð.] class TestArgumentsFromFileConverter(TempDirMixin, Parser3aCase):Ð0"""¤ reading aNñ from a file""" .ãdef setUp(selfC@1supp� !, 5.A)Q<bZ_text“!('A2',  "7\n'�]J�or path, O1 in¾\ïUt‚ = open(26'w'“#p.write(Nrclose()‘ „ž}Ú(ErrorRaising"):H{gcÆÀ_arg_line_to sz,¨„:0forû9{.split()-`if not0o.strip$(…continuehPyield@p`_ /=  3ðsignature = Sig({¢ó_prefix_chars='@¢¤_8 :CÔ'y', nargs='+.*bfailurp¯ �‰™¨™?# =‚ # Type ׿sion tests 0âÕ=0RepÔ#stÀC,J!_rçtp=Ÿš.G3('rIÄ”é.assertEqual("(@", rwM)ësOwb_1vfwb', 1Hz ,~ r_latin�€r', encoé!='=/_1 <¡ ßw_big5_ignore§w§C92s='Mµðw', encoding='biÿ g5', errors='ignore')", Árepr(type)) &ñ def test_r_1_replace(self): I0ö = argparse.FileType('r', 1‚@%');Jï.assertEqual("=9", §€ class R:s(object�–seen = {}Ì�__init__Äc, name-Ê�! =8%eq6Wother71if A in Cy Zftext =[1] Oelse2" =lf.read(JeTg.closeðif not isinstance(�H, stÄ@0 = ç.decode('ascii²Sreturç*‘?# –@Test™ðR(TempDirMixin, P.r"4Cas‡0"""T the 9ñ option/argument r@for Æing files"""±QsetUpæ©`super(`[!R,”").0P^V_×úin ['foo', 'bar']¬)™ñpen(os.path.join€¡.temp_dir,§QW), 'wV~Ep.write( (!" ßqpcreate_Ponly_A$(''Í@õ_signatures = [d‘Sig('-x',a=Ñ&))<-Ospam/4'r'2êDfailvi'RÐnon-existent-»R.txt'3{successª(�°NS(x=None, ‹=){:×P foo ½!, 7, ?% ?`bar -xC'?!d-x - -;psys.std¶ ³¿rè"®]y�Defaults€Aat a²1 isBe�d unless¢dZ"Peeded„q8S ƒ žŠ?ile]l'good'ZOV!ïO!cò #, F='noÏ;Öò # should provoke no suchp²‘ 1<Ö@3ð because default ñ*file is created successes = [('-c good', NS(c=RFile('ð)))] class Testð TypeRB(TempDirMixin, Parser#aCase):i0"""T the :ð option/argument type for reading ³Qs""" Dãdef setUp(selfYÆ@per(`[ARB, %.1)A,_Wò_name in ['foo', 'bar']®))ñ = open(os.path.join�¡.temp_dir,¨Qf), 'w'nEp.write(P(�"rclose()ë’_signatur¢6‘Sig('-x',4P=argpv.Š('rb')),1Ospam3]9Dfail{n"'' 8,È(K°NS(x=None, sHh)•ÃP foo {tx, ?% ?`bar -xC³?d-x - -;psys.stdö³Whs(objectˆ`seen = Ä¯�__init__1 , t00¢.! =ü8%eq6Wother71if @ notÂG€ ½ñtext = 'Check that¨Žeable.'¼�`if 'b'S`Z.modeT&Xë.encode('asciiøDk e(- õXÏQ.add((;areturnÜ:= ó# @unittest.skipIf(hasattr(os, 'geteuid') and os.v() == 00�à "non-root useš�quired") W ?? *W g _pPonly_¡$(''Ž6w�2rŒ&, «&˜Çµ YU˜,˜˜,?˜3out9™>outšðWB(TempDirMixinñ , ParserTestCase): argument_signatures = [ ðSig('-x', type=argpHú.FileType('wb')),1Ospam3]9Dfail{n"''{success–ð('foo', NS(x=None, s =W—)•Ä foo bar7, ?% ?`bar -xC?"d-x - -;£sys.stdoutxµ ] class ±Öm�OpenArgs(Æ¥0"""ò that open (the builtin) is correctly called"""�def test_8 _a^aself):™^@FT =( ù,caž5±(FT('rb'), b, -1, «é,0Qw', 12 0òerrors='replaceq?p¨uób', encoding='big5EFޏó0, 'l1', 'strictD>', ‡æ�ówith mock.patch('¿ s.šv') as m–31for—,ŸQs in � %)¼¸’m.assert__ˆ,0, *)Œˆ�Callable(TQŽAsomen+s¿toption/t¼sŠ‹ T-eggs\wcomplexP° #Sfloat!m ma²042j-\  /2iˆ (b=42 42à 3=42ÛH42.04"('2· 2j -- -1.57#2j7 7x1024.67.H04 @´¿UserDefined· ‚a user-d, ´³£ Mya•e^�__init__(X`, valu+." =!� C%eqAWother %Pretur÷“N0), Ua) == (=!, l õYƒ z "{àao�ãK!('PÞ=+a'ªR-xf gSÀx=MyType('f'ð), spam=MyType('g'))), ] class TestC!icp(ParseraCase):40"""1 a :"ic‘ type""" %2 C:kôdef __init__(self, valuV#." =! C%eqASother—=€return (�hÿ2elfUC) ===!, lñargument_signatures = [Ùc‘Sig('-x',ô#=CMn ]>DfailO{successbð('a -x b', NS(x=C('b'ÉÈFC('aÃvŽ7f g.f.ñ ÐRegistration(ÙëÁuser-definedöQ by r;…ering itüêBtest~ rget_my_žt;À'%‘{%s}' % s, óp›a = arg #.A¶µ!()q+.® ('}4', c7', – 8Dadd_iÚ?2 y1œïÁassertEqual(Ì!r.wÄs('1'.split(¶Õ („None, y=œV{1}') n-x 1 42tl |!42}W # =P # Acn %s�'RUserDz‘ ¦ ope/»! au¦¢O%"alk(M-)½e__call¥Ãr, namespaceÓ", |_µ=– æ2tryNÈá# check destin’C andN2 > Ü:â'ƒ'A: %sC~?Co ¶G -s(DflagE $ Id# when±�is before¥R±, badger=2,Ú.Eež is after?ýF expected_n½0NS(V=0.25ü"ifkþ in [0.125, 0.625]¥0\.ÑN = 2ƒlY?2.0P/84Q/se’qraise AIðionError('value:û %s' % value) ôassert expected_ns == namespace, ('‚ %s, gotQ J Y(JF_ns,d)–�except A™�ionError:oýe = sys.exc_info()[1]&ñraise ArgumentParserQò('opt_action failed:Ù &‡setattr(t'spam',Tv class PosiS1alA[P(argpv.1): .ñdef __call__(self, +rd@, opWÚ_string=None):trycÞ =@ is @Û  A D Ë>ð# check destinaÆ b§.(ƒ°'badger', '� $ Eƒ# when aìçcbefore< , ¶¡=0.25, and/FÐ?UafterQ@ýDçb = NS(Ë.=2"ifEÎ in [42, 84]ÇHU.É0 = Ë}lT1O?625P 2P1P/se⬠ø!('¸þ F@#B±ÅÆ?argÅ&– Ç?õ_signatures = [‘Sig('-s',Ñ= I!=O¦ý,6Á type=float<Qfault�)']—T S/V0int4args='?›_2\æÐ{successãàp0.125',½m=", œ3=2)Y‚I('42*`)4*©-s 0.625 12631\X84 -s`52.0ˆ$84-B] ‚ðTestActionRegistrð ation(TestCase): """ð a user-defined ac-ñ supplied by registering it""" A‘class MyA2¢(argparse."):&kñdef __call__(self, +ð r, namespace, values, op‚0_stqD=Non²K‡setattr(<Uó.dest, 'foo[%s]' %S)ІAtest‚ŸŒ6 = ÀrgumentPÑ1r()ð{+."('/u', 'my_ � >Sadd_ab£('badger',z=I¹yRÃassertEqual(ŠNÒs(['1']), NS(T= F1]')ƒH/42I!42J[ # =a # SubŒ0rs es& 3w6Add2›@the -s\emethod„ÔAQ³QErroréÐ, *args, **kw ÿ URaises(FAOR_get_÷m«ñ _help=False, prefix_charsÒ,Rˆraliases6¨£# create a8… with a ns¼³Y)ifwõj´1 = )ý:ingý(J5ñrog='PROG', descri«h='main'óŒX‰.æy?‘[0] * 2 +é7Ñstore_true', }ÿ 'tOelse [|ðo'--fooÜL0'bai¤type=float)4bar)}ÿ# check that only onera can bª%ed?›_xñ = {'required': }03if ÿ Ÿ Hõ['metavar'] = 'COMMAND'If5Rtitle3†commands4BT A3y3# =¨Ø6(** › Фñ*E"#+ð first sub-parser ÷ parser1_kwargs = dict(description='1 0') 7bif subAe_help:Z ['"�'] = '1 .¯if aliasesB %E1['1C1', 52']S}& =£bs.add_ ('8"**¤Û2ñ argument('-w', type=int,Å1='w<ôx', choices='abc'@x@¼À# add second¿-R 2³ 2³)Z³2¦ „`D2', `Q `2`y%5123%yA z  complex, nÖ5='*JzJËoOthirn3n 3n)Zn3¥£ò3n*nQ -3nt-Íty; %u'Z5...\u>¹ó# return the mainp!á ödef setUp(self)‚super().¤'.B"„elf._getë )qcommand±#1 = D6 Úf=True) 3tes`_aœ_failures³Ó# check some %* cêAfor E�str in ['Óa 60.5 11','c '+01 -I f2 -w']D2m% =tv.split('$sassertAP*QErrorçs,T'7Ñ Onon-"�iEqual(ÿŒ(ÿ”1 b -w 7'å)=÷NS(foo=False, bar=0.5, w=7, x='b'0!r�ÿ 25 --foo 2 -y 2 3j -- -1jŸ }žp25, y='_`z=[3j,@]§À sel‚f.parser÷_args('--foo 0.125 1 c'.split()), ñNS(foo=True, bar=2÷, w=None, x='c'4)>õself.assertEqual(_—â1.5 3 11 -- a ¦7 b£ CFals¤ò-1.5, t=11, u=['a', ñ 7 --9b']¼£‘def test_Ÿb_known5µ!):%ÄâJ0'0.wob -w 7Ù(}Ú0Ù1w=7yjb'), [˜«~ œ_-p 1 Ÿ1;'-peŸ£- ? -pB+£L_q -rsé00'-q´?-rsQD"-Wô1X Y¯/ ZX-W±XYZºKpPdest(d„ñ r = ErrorRaisingArgumentP×(t.@.add±$êö', action='store_true':2sub=Bs = G(ŸW='bar7*F1 = )8>('1- aÃW('baz$ÿ ¸0'1'‹Hz='2zS ƒ õ61 2Ó%) _ð–required_Ì�,—‚# Should@ the� commandXŒ6retO�˜—s(['run'] -Cret.N!, .¯W#Q when|*p is mis#ƒQ 7Q(•C, ()k™á_via_attribute'V¶o-Ã|ç/·.¥ð = True suÒbparsers.add_ “('run') ôself._test_required_su9(5!) 0Odef *°_via_kwarg(S!):2eCñ = ErrorRaisingArgumentP¡(�|2 = ;¾”ôdest='command', ¸_=TrueJALÿFdefaultý\î`# No e‡U here£6retn)‡_args(()a)óassertIsNone(ret.† !ˆoptionalKfOFals*VLhelp5*.kQEqual .˜õr.format_usage(),Äk '#ý: PROG [-h] [--foo] bar {1,2,3} ...\| ´ù), textwrap.dedent('''\�‚_¾±main descriG Bposi]# aEsmDá  í± ™ 'Å ' (Èk`-h, --:± show thisJ@ mes¥™ and exitZ! �a foo4 #L''')Yiñ_extra_prefix_chars"tñ# Make sure - is still used forl` if itÂa non-first V V�z1 = ™D_getM.„\='+:-ZJGÁ*/++Á wA(¼#} ž¼oÀ optùional arguments: ñ-h, --help show this ûmessage and exit:S++fooL 4 #a''')) �def test_%ö _non_breaking_spaces(self)�óparser = ErrorRaisingAÅP(Z�ø prog='PROG', description='main%')9fT.add_! Vt"--non-­R", acVÕstore_false',QŽã =' B¸containing O üÉ shall not 'Jÿ 'wrap\N{NO-BREAK SPACE}atF×LÓ.assertEqual(èRforma„€(), textbÉ.dedent('''\€uÿ : Uz [-h] []Ýõ i o�‹P� › Ã� ÿ„ .�Kÿalternate_prefix_char ÖR_get_Ï(6_='+:/Ú*()¹ ì'#ý+ýñÿ] bar {1,2,3} ...\nwz} c� @posi¼ƒ Ü ±Éû@comm' (î`+h, ++:yR4_²ˆ ta72z.I#FC?fooF‰ Fˆ ë"¨qy‚1 À1 help  2 u2 help  32 3! "ùoptional arguments: € -h, --[± show thisJü message and exit:C-foo~ D #a''')) ð def test_subparser_title_5f(self)™!ó = ErrorRaisingAÁP>Ñ(prog='PROG',b‰adescriw='main %')L…T.add_<0('-óP', acWá='store_true',4$=' K 5bar41bar>4(Gs = Œ(Aß='subcommands ø#='C‡RÂ`='addiwal textʽF1 = ¼W=('1-2-2-7Ò.assertEqual(R�.format_u½/()Í'# : Gq [-h] [â ] ’¿{1,2} ...\nu1(),õwrap.dedent('''\\¥{>0 ¯ 4posƒ² îØJ ¯ F2^ Í­( ¢ ³" «( Š _ ’_“�,0ñs_str, expected«¦Wwith ƒ¨:es(¨Âz) as cmÑ:±gQs(argx†.split()‘1î ™‘, cm.exceÚ.stdout}1ÍëÒb¯'5.0 1 -h'Úd1[Êw W] {a,b,c}Â1… ÖTxà DÔJ1w WyB w| r q2‡À: se÷+lf._test_subparser_help('5.0 2 -h', textwrap.dedent('''\ ðusage: PROG bar 2 [-h] [-y {1,2,3}] [zi...]] =Ú2 description@posiÙal arguments:=7 zˆ z ¼ DoXB `-h, --:± show thisJ@ mesÛ› and exit|à1 y2 !R'''))ŽAdef gÀalias_invocaÛf(self)Õ„0 = b._get_(:…es=True)h'ÅassertEqual(;.ñ_known_args('0.5 1Ré1 b'.split()),>à(NS(foo=False,Ú÷ =0.5, w=None, x='b'), []9›82›>ߌaerror_’CAµPYEo(Œr“� t¶µ3bÏ\#*, q maxDiff = Vµ �íbformatY)P?"""PJP-foo]ƒ COMMAND ...úzOmainL+¼J O nXRbø= 2foonz}command"1 ,031 (, 2½!1} 2O 2+3+3+0"""A7# =‘ # GroupsQ+s Å class TestP?s2(CCaseq0"""ðs that order of g_ }ðs matches construcº02"""dâ1nonAo_first„zRaising((†@0add¸f('foo'#l? = +_;('g/Àp.add_argume³nt('bar') òparser.add_argume#z#ñexpected = NS(foo='1', bar='2 Gz='31“result = ]_ös('1 2 3'.split()ˆôself.assertEqual(v", O!) ´ðdef test_group_first(=!): ×pór = ErrorRaisingAÞPñ(zI­ eW('xxxß1 27foo"� #x´²interleaveds\] €¢E 7yyyö1 õWfrell$ÖL !, 97='4<’ W/ 4Y$># =“ # ParentÇw/s ,² class Test5g s(CCaseŸ0"""Ts thaYÐs can be creah@withu|Fs"""' ÑëŠÐ, *args, **kw {)f?es(FA{QsetUpgVruper().Znbwxyz_pI’ y¯help=FalseF b7--w$x”< = } 7&(('×; (8('-âT ('5…,Oabcdý/F žaû q +'-b,c'a&>('c; ^3-d'¢hwú/C nô keÀgumentParseró(add_help=False) àself.z_parent.&åargument('z') )"# $õs with mutually exclusive groups1Zƒab_mutexaó = ErrorRaisingAkoParser¤Y? = R³�_�_4(è-àÿ -a', action='store_true'6 b6 ûómain_program = os.path.basename(sys.argv[0]g�def test_#le4(÷%):]p-J « =[<D.wxyâ]ÜÂassertEqual(Y.õ_args('-y 1 2 --w 3'.split()),ŒEÿNS(w='3', y='1', z='2')á " çŸ_B!ab#.S°ÜÄr$ V ( ‰` { ÂBgranŒåBs = ª †U^qÑ ½ã,°=e$z( ;Øœ!seeÚ.’&¢([]), NS(aÁ2, b )×? E'-a'COTrueB bBFCK„ Ý÷cÑ0, [“@, '-WéÅA‹G ŸEA/c';&=/'-A(½Aÿ=emultipsø(Ñ6#cd-,%ò\D[4˜.A-d 1-_2 3 41a1’b=None, d9w9GNz='4H * fÀ parñents = [self.ab_mutex_parent, Cwxyz3] ñparser = ErrorRaisingArgumentP(F#s=)=W°assertEqual*Aser.Uõ _args('-a --w 2 3'.split()),B†ÿNS(a=True, b=False, w='2', y=None, z='3')† ¹Ó(lš¡', ¢6 -b¥8æ`&b aódef test_conflicting¥ s(z!):(".o©*esÜ1argß.¦ l $ã %è=Mw�F)ĉÊsJabcdÍ )]Ñ@sameÈ _n Òƒm9|`61 2Ð äPCNS(w]e2e}¥1subcrG £O ºO»;U.add_g&s(-¾ex°$3>ƒ('bar', ŽÂ:9Oent]PCaöF('e''uäÀbar -b 1 --dê/ 4waÌëb'1', déOe='4|[ ‚BVä >,U0abcp© 7foo©[w¦c_group = M ¦ #(')² .7('c"nÉ­Û+/abˆqß G «Àe_args('foo ÿ-a 4'.split()), õ NS(a=True, b=False, c='4'))5ñ self.assertEqual(parser.ÿ_args('bar -b --w 2 3~vb‡ÿw='2', y=None, z='3', e”‘ArgumentP–eError(¼ø¨¯�, 'foo -a³(6ò^" † _ðdef test_parent_help(p!): ±€ents = [S.abcd0!, Cwxyz]7aser = zRaisingÀ»[=~så%�2 = c.forma¤+’rogname =�Åmain_program�§5aõ, textwrap.dedent('''\;ðusage: {}{}[-h] [-b BA-d D0w W‚y Y] a z^;Ãpositional as`"9 aq C/opA `-h, --ÁÁ show this 0mesÁ› and exitkÍ J-w WÅc²-ý $x$5y Y[3'''Ä( µ”, ' ' if  else '' )))\£cgroupshs¦o 1addò[Cgd@ent.#¤_rñ(title='g', descri‹W='gd'C :O('-w xm}ómutually_exclusive‡lmlyO zI% Œ"=[ ]‡¦FÐ:es(Ðê,¯m‘ ò�['-y', 'Y -z(Z'g9rªßýyí3x Xô‚ | -z Z]²+´JYm ‚ �g�*gd!! è@O-x X´(ð# ==================ø # Mutually exclusive group tests # 0 Ä class TestKEJGIpErrors(!ñCase): defcñ_invalid_add_argument_ƒq(self):/3‘parser = SƒRaisingA3P%().�raises = Fp.assert4+es#Q(TypeS", c.Œm_–ï, title='foo')ÍÇ+ / =šýÁM" =ÒÖ 'DValu(`P, '-- ü, required=True‹(AObar'0¯, nargs='+;&1t%1arg+|.PARSEROhelp÷!§prog='PROGÓ17 õ(©ýaction='store_trueq :¤*, :Mfals;2¬#2r\soup's­;Mnuts; ®õexpected = '''\mpusage: Œq [-h] [å� | --bar n] < opb4al rsÉ € -h, --+Á show this 0mes™ and exitš! Š =bar¢ ® 5'''0aEqual(ê�r.format_¡ô(), textwrap.dedent(M$))íMEMixin(objectùôfailures_when_not_?;ÏBget_—(5 =FŒ!).-Òeƒ: = ,ó$0for«²s_string in9¦ ¾$T(dA~,Op.split(ýý^Ë#tÿÀrror = ArgumóentParserError õfor args_string in self.failures + ['']:18"àassertRaises(eU0, pb_P,V¡.split()) Gðdef test_successes_when_not_required(d)wZ" =¢Aget_$r(5�=False).‡p³k?|" +P�F .Ñ, expected_ns;f¹}`actual$=#((x"0.heEqual(I zW S#?TruR GUj^usage× qformat_.'f/" F �6 é\ú(), textwrap.dedent(g Ypþbí .¶ …E|2è=NhelpWØ-¥×.¸ ;à±G+8ð%× ÍåÌ )¦á Ë-¨ :àpÜ:Ð class TestMuñ lyExclusiveSimple(MEMixin,%fCase)::Ú_$, ¦@=Non*>Ar = ò©…ingArgum Õ(prog='PROG')cgroup «sr.add_mª$_e«_&{† G>au ('--bar', qQ='bar |5Pz', n1ç='?', const='ZKzKàreturn parser ð failures = ['--bar X jz Y', !']4rsuccess5J(,þ ', NS(bar='X', baz=None)),,k7r Z4 4—`Wa>'Y'`zV*Z* Îð_when_not_required´OYz!] -_usageMA'''\#0'Ð: PROG [-h] [wqr BAR |rz [BAZ]§31'''?;b«^ (^)R^qhelp = Oõoptional arguments:� -h, --9Á show this 0mes˜ and exit7pñ0 {1  zQ ñ class TestMutuallyExclusiveLong(MEMixin,#bCase):§ôdef get_parser(self, O²ã%ó = ErrorRaisingA PB`prog='Ð'U9T.add_:)qabcde',Ñ!=' :Ufghij: :@grouÂ|m$_e_&(ñ »! ºUklmno€€ 9Upqrst9 9rreturn ¸¦  p¢AY“2¼iÜ!, ; %¯X×´Q Y --/6 X'Ñ$2NS(`':_yU>I]©1µ ©Ç…É5 ©H%=µÙý!, F_ˆý€/ÊŽËK  Gta ABCDEWâb FGHIJÅ[ÐQKLMNO{ûb PQRST0k0mù0*Œ)(Œ ›Œ,}ߣŸÀ show thñ is help message and exit ò--abcde ABCDE 1 Òfghij FGHIJ Òklmno KLMNO Òpqrst PQRST  ñ*''' class TestMutuallyExclusiveFirstSuppressed(MEMixin,.qCase): ªñdef get_parser(self, required):$ñ ò = ErrorRaisingArgumentP=Åprog='PROG')9‚group = Ac.add_m®$_e¯_&(x= G>aua('-x',¥A=arg`Ÿ.SUPPRESS9 ôy', action='store_falseO!'yWÆcreturnÅ:ñfailures = ['-x X -y']ø@succxC±° X', NS(x=' ›y=True)),%U -x Y* *ÇM�None, y=FÆO Œ¤_when_not_^ºypM›]ôu IE'''\L' : ’ [-h] [-y޽&M’I %-yeG1 = 8 opÝ4al .sË� -h, --9� show thï ° -y!oŒ� OMany�¹aadd = ¶ •½add('--spaml5trukºCmbadgerE ±FAladdG÷1 ë âÞ4 --¢y6 B'åD'--b %>&@P0NS(Z>", l Y=Æ ´Ž)è@0AB ÎÇE6#, ßL='B'…4õE7ìÊ >ÔsìpÏ-À ] ÷usage_when_required = 8notc'''\ 'µ: PROG [-h]1''' qhelp = 59õoptional arguments:� -h, --9± show this 0mes®• and exit6oó class TestMutuallyExclusiveOsrAndPosi€‘(MEMixin,4qCase): Tôdef get_parser(self, )® ó = ErrorRaisingAÖP=`prog='#!')]@grouAc.add_m´$_eµ_&(x= G>KÀ('--foo', acæá='store_true',G\='FOOŒ EEspam1OSPAM2 õbadger', nargs='*', default='XJgBADGERLrreturn ~Åfailures = [2'Ø0 --™H S',( X!X 2 ?Y ZCsfoo X Y/Ê{successŠcÐNS(foo=True, „r=None, ÷&))¨8%½ ;DFals<?'S';B4 pZ['X']rX Y Z',o ;–, 'Y', 'ZE ' £/('j4'X'£]ïE[7/'l! [à% |ÑSPAM |}" […R ...]ÇE)MtV§#p(p¡p¿ pŠ Â�" 92EF 2^5FOOd¼eU SPAMä}osMixedvhe ëx- x5²–# =³N¼6aŒ aŒƒbE àb help') ñ* parser.add_argument('-y', action='store_true', help='yC') \groupEcE cEcreturn’ \ð failures = ['-a -b', '-b -] ]7rsuccess8¨ô ('-a', NS(a=True, b=False, c x y 8)),@@8bI@­ @IcI€ Oa -xÃÝÂyD …1Å Bx -y€ E Ê<1, yÚD  ð_when_not_requiredêrí]±.A¨#©1 ç/', ²I@]ÁRusageæâ üE'''\ÿ'ð: PROG [-h] [-xabycU²1'''>§1 = N opÑ4al é%s:� -h, --9¡ show this£@ mesǘ and exit6xZx.aabbymWcEð class TestMutuallyExclusiveInG«‘(MEMixin,&bCase):±‚def get_t(self, »@=Non*|=ó = ErrorRaisingAGPZp(prog='Ä0qtitled_7# =ó @(Ús61='T= =‘', descriÜ!='ÞuRmutexX6 = g[‘ˆm:$_e;:(  aDhu('--bar?1barñœ;z;z;7|0 X „1z YAC-bazBr Y'A6A‹Âbar='X', baz "Ze0NS(,2-6'Y'tp  [û&('{O P-0M tà usage: PROðG [-h] [--bar BAR | ƒz BAZ] 1''' ñ usage_when_required = '''\.#S: PRO\(P \)1\DhelpMõoptional arguments:� -h, --9± show this 0mes¬¥ and exit 7ÈTitled groupMGq descriv3 Ä *dR3 zƒáñ class TestMutuallyExclusiveOo¢alsAndPosióñsMixed(MEMixin,;bCase):™ôdef get_parser(self, –)Ú ó = ErrorRaisingAOP=`prog='´'™9T.add_~Q('x',Þ1='x0 p-y', acÓÅ='store_trueFyF˜7 = ~m1$_e2_&(î= ½! ¼Åa', nargs='?�a� :/-bÆ bEcE cEcreturn õñfailures = ['X A šP'-b -^‚'-c X A'ºrsuccess.�(8ô', NS(a='A', b=False, c ‚x='X', y9)),>t?@None@?Tru?ª ?H~ !A TA¿ P ¾y5AÁ A U8not [)eeç è æ@ ¦ƒ‡£7 =  ¹'Ä 0[-y%brc] x [aòà ÁpÐÃx:R¿a¨7N"-y™� -bðcÈO # =4 # * ù·! i3ento testsfÀ============ñ4= class MEPBase(object): def get_parser(self, required=None):)-óparent = super(R , 6').GA )Dò ser = ErrorRaisingArgumentP†-uBrog=zò.prog, add_help=False, 2s=[ ]m`return!Dser ñ TestMutuallyExclusiveGroup”!sPç(†ä5 'Opassi oSimpled0_OLong].[ÿFirstSuppressedf 9qOManyp! 8oòOptionalAndPosi æ?}OsMix\v8o íEósF ‹<# =` # Set�¿ault tests (À�`SetDef0 s(HCaseÊEc_set_d&�_no_argsÙ’Ui† G.Y�(x='foo'% Æy='bar', z=1*/ô.assertEqual(NSO), 3,„± ”ã?[])dPo, NS()jObaz'Î+jxB/z'q!/2)?q³2v‚&\Bwith{Ò^AAÙñ r.a6d('-x',Jð='xfoox') ÿ self.assertEqual(NS(x='xfoox', y='bar'), qparser.¥_args([]))0aCo, NS()g?bazÆ'ex/z'l1j%Ï'-x 1'.splitÕi4ߨWoN"ñ def test_set_defaults_subO0rs(?!):,�ñ = ErrorRaisingArgumentPŠ(|..\ÝFfoo'%m3 = 28add…- V_a = 8./7('a[*_a‚TÕä„§‚$('aOijoparentg?entg õ©help=False#:entó0x='Î %?sera œ"=[ ]>1$),Ä}‘2on_d7_anù}1arg^.zx á #2!()=('X4 ?Vfoo=1ÿ]$2$#G2!0'X'µ$€same_as_÷aq!ž&²w='W', x='XNŽY', z='Z" ‰?'-w"Ðc?='Xt RPy', nÐ?='?\ e,%, fZ¸U½#õs set previously"¶ Z˜!À # róeset defaults ´parser.set_õ(w='WW', x='X', y='YY', z='Z'):ÿself.assertEqual(NS: ,;|†±_args([])) 1˜def test_¤À_same_as_add1Àument_group(™!):<bUñr = ErrorRaisingArg3Pÿ(Ö. {3 = @—G'foo?1.(O('-w! 4x',ÄO='XX/ Py', nO?='?+ z+dZó‰M#~ s O¥previouslyo~AQB?Z')$ŽrÖ¡<# =F # GŸð/s (ò class TestGetDÏ(bCase):«4gØ+×sIsNone(êbf"foo")M50bar5BY 1"--\%[4�D·¦, type=int3/42q¦Y442,X n‚&9(ß(foo="badger"˜c#i¡-Éÿ # Namespace 'contains': CCAoSimple\empty�ns = argI.TwpNotIn('8sZ!³,nsÍOnon_„0x=1‹]k ŒÀlf.assertIn(£'x', ns) ÿself.assertIn('y!No"xB#zEO # =ÿ # Help formatting tests0° class Test9F8AMeta�(type): Øñdef __init__(cls, name, bases, bodydict):. !if#P == 'bjVCase'#'breturne{@ Add0as(objeWX% Žo,î_=ð, func_suffix, std_¬›C:.-( =; r/O% =Z½&2for‘]Q in [k’_¢,^8 4_print3 j_file]qd�á = '%s_%s' % (·!._7)__P)íQ‘:€wrapper(¼•M= ‡A$>P?tryÏ!A‚¿" =‹ëuÿexcept TypeError`OpassCrsetattr=…�u˜ A9™_get_pars8/er+&a = arg ¢.ArgumentP@Ÿ*Œ1er.2ÿr_signature.argsW*4 kw6žôa�c÷gXer, '!„os', []ëѱT.add_:$(* eÂ@ *=ËPgroup_Os = Ä' Ê ‚+,º±`5in sz ? = _!(*Q *H2Ñ…êÈ;©Ð7? Ó2sub@s'Ø #Ô Àif subparserŸs_sigs: Òsubparsers = V.add_/()9Efor %a6 ins †:sny%(*Qo.args,}C*E kwGÄcreturnó fðdef _test(self, 3er,,n_text)N�expected ´ = getattr(>LÎ.func_suffix“eBiÉwrap.dedent( ?iÊ.assertEqual2 Áó@j_formaùì°1 = ÕR_get_î�X02, 'b_%s' %P% r¬l", B?())ÔOprinÓ@W_ÓÒ§old_streamLBsys,Žstd_nameTsb,Ð, StdIOBuffer ->tryÂ%»ô´ á¯).getvalueIofinallÓ ( 2lf.´ ® Y_fileêñ2IÒ=2, 'sŸ* =Ñ ¯·-{¸%¢ cBfQ# adds…" {Š,âå}_{usage,help}²8á$, à@1[('4Ï', 'stdout') ('i:]ãïAddTests(cls, „p) base +¤Case, Help0 = F*ðtingMetaclass('!:1', M�, {}) #?øBiggerOptionals(:�ð """Make sure that argument ëá aligns when oIðs are longer""" pÿ2arser_signature = Sig(prog='PROG', description='DESCRIPTION', @epilE�EPILOG'),†argumentqQs = [I|ò'-v', '--version', ac} v='0.1')‰Ax4þ store_true', help='X HELP7%-y#Y#5foo#?FOO%5bar%9BAR%]ë[group #@usagŽA'''\4 : ˜� [-h] [-vxÕ-y Y] foo bar31''' ú1 = B1 + WXÕ @posiw4al °%s: j="3bar coUaa-h, --¹@‘show thisÆA mes#‡and exitx -v9#! 9Òdram's number @xp/`k ,Öò0~t=y<10.1'+ð class TestShortColumns(HelpRCase)„0'''ó extremely small ÖBof c=.™-?ó prevents "COLUMNS" from being tooIÀin the tests rmselveskñ but we don't want any exceÒ1ðrown in such cases. Only ugly representac. ãdef setUp(selfððenv = support.EnvironO’VarGuard(f,U.set(æS, '15‡!\ð.addCleanup(env.__J2__)4p8=¦™qBiggerOùLals.6ÜBìJ K6 N @ N 6T ¡q%³! €v¾ (xB |“'-v', '--#P', ac7&=' v='0.1')‰Ax4Ástore_true',"='ø7%-y#ø #5foo#1FOO %5bar%9BAR%]ëgà (ͼGROUP TITLEŒ’'),MQ7baz‘Z‘%l-(…nargs='+31]hÄÁusage = '''\ÕF : 9� [-h] [-vx]õ z Z [Z ...]] foo bar bazFZÉ!= U" +j%÷Ë€@posi+%als0 n ÃU ŒÀcMaa-h, --¹A‘show thiszA mes6Land ›v9×! 9†dram's ç @xpãØÛ ØKf0k+zQB BA)uë3 !óé X10.1'p+6Pþ3¨*™,Ÿm='USAG¢:ÁF2ekiefekangä=EKIÍ,,8 Ýåàhelp = usage +ƒ '''\ ¶DESCRIPTIONõpositional arguments:3R eki÷fekang EKI HELP$3barc2BAR$%/ope £-h, --helpA¡show this õmessage and exitWC -x3Xzv --y Y: Y"2''' version = ð class TestHelpReformatting(RCase).ñ6"""Make sure that text after short names starts on the first line""" ØÐparser_signatNa= Sig(ÇÅprog='PROG',adescrie =' oddly.¶Ued\n'.';$ê¢is so longú itòÿuld go onto multiple „ñs when wrapped')®”Qs = [Âñ'-x', metavar='XX',7!='¼? 8 0Z}&')fnym yy(0='n!1l y}7]«Ç_groupÍ(`‡title', ˜/='ÅÂõÈs@'›èJ[Áp-a', acñÇ='store_true®-'#='«z'�a -a 6/ /Zoagain,“$bec_ over’'±š3')]ÏuŽ(!'\àw : ™À [-h] [-x XXea] yyy*r271 = 9+ +® Çtfv$\ Ç{Ï iü�p  !yyR+ ìCçâ!XXu×!-x�=’3 G\<`7kak ^ &\ `uSv™ûs*‹ W"@ingSVNU‘Àse): """ðvMake sure that text after short names starts on the first line""" parser_signature = Sig(prog='PROG', description= 'D\nD' * 30) B†argumentD`s = [ ðSig('-x', metavar='XX', help='XHH HXPJ20),5y4 yy5YYH YH4]:‹_group‘(’—ALPHAS'),«¯pa', actòµ'store_true¶ AH· HA„C10)]º†Áusage = '''\—Wð: PROG [-h] [-x XXea] yyy*1''' ë1 = 9" +NO?D D.$\ DWU!n@posi 4al c%s:5 ¿'œC\ YH4WP  ²o®°a-h, --a.aw this‘A mes¿‡and exit�±�·E\ HX2XS" úØž!-a[¹P\ HHA2µ &*Îqversionð class TestHelpWrappingLongN¸(RCase)Í?"""ôOlongónòh�='USAGE'ô Dëósv', '--úQ S='V Va  9%&25=* Xåß-py7js¹Ü_?2~&µNAH Aµ¹zõz¦ðDZH Z;tÓ ‘þ_–yÀyyyyyyyyyyyyoyyyy  _YH YH%\ *WTR Qõoptional arguments:È -h, --helpסshow this ømessage and exit@v@uversionC@¤program's onumberG?x Xna _XH XH%\ *WTRriALPHASf?a Aˆ_AH AH%\ *WTRPz$ ¡ _ZH ZH%\ *WTRP1'''  a= '''\³?V V.$\ DWUŒð class TestHelpUv( RCase)V0"""€ basic u' ¥Bs"""‹ðparser_signature = Sig(—�='PROG')~*Qs = [5ñ'-w', nargs='+',k='w'),(x(*(x(aab u2ic% %$'?L]–Ú_groupà(á#7'),ùýyÕ?xym(H%-z,3'z*dJ Â*+e+ +++]Ìø Î : ùð [-h] [-w W [W ...]@x [XAy [Y0z Z^ëÀa b b [c] [d?Q e [eZŠ0âS=¶+s%Oposi° aBa:7 b bcc$! À-h, --help ð show this help message and exit $À-w W [W ...]w@x [XU] x egroup:q -y [YBF8 y1z Z' zddee1''' ðversion = '' class TestHelpOnlyUserG¬ s(RCase)»0"""� basic u$,Bs"""ïðparser_signature = Sig(prog='PROG', add_jq=False)œ†argument:js = []I #"ô(i¥'xxxx'), [A-x',ã ='#!a Ea'), ] eOyyyyebDbD…y!C eò^©%'\# : Fõ [-x X] [-y Y] a b&îb# =¨b+ '''\£‹&Ö N5 xE1 aa3ô3b!xÖYÌŠx UH�LongProgw þ�Às where the \� is longˆo' * 60z  øSig('-w', metavar='WÚ [ X P2ñã#P'êÑP [-hY0w Wg`´positional Ús=aubd/op5 a-h, --Ø´nê¢O¢_sWrap­.bÂ÷os wrapÄUW * 25Û—$É%Ä%YNJz3Z%bÀPPPPPPPPPPPPP* ¯[-h] [-w WŸ] \ [-x X]T?y Yn?z Z M5a b`1''' ñhelp = usage + '''\ Üõpositional arguments:7 a b7/op5 a-h, --xd¡show this 1mes’‡and exitia 'g'`'h'Tðversion = '' class TestHelpUØ•LongProgPa`sWrap(!)RCase)j0"""¢ð s where the prog is long 0Y‚ wrap""" ðparser_signature = Sig(Eð='P' * 60, add_ˆq=False)â<Qs = [ÅG 'aBJ25),bc°g[groupm#­^%'\h/: ¯LÏO a/ b Cc)5o‰'ªg ´®cH¯äOÚ'HsÃOROG'±ù-w', metavar='W‘Ö(-x%X%y%Y%z%Z%.a'@ c$6-OROG ÀAC? [-e_áINa b –E+åÀ b s c õoptional arguments:à -h, --help/¡show this ømessage and exit@?w W'?x X'?y Y'?z Z'1''' ðversion = '' class TestHelpUØBPosi$`sWrap(!RCase)-0""" u0 Ös where the pD‚ wrap"""ƒñparser_signature = Sig(prog='PROG')§ž*Qs = [”5k'-x'),yz|a' * 25=bc]q [group¦#h!'\4¸ : ê° [-h] [-x X0y Y2z Z?.a/ bvHc.+í=åb+ '''\ÅOâJ®ag ¹®ÓW7x X´H-y Y5z Z9dO†sm1Ós’™s{KÉ, metavar='X" 'y'%Y%z%Z%±}½P] \ [#·Ü/[-Ã3`V£`  øâ™Àonal argumenUts: ¥-h, --helpÑ show this ømessage and exit@?x X'?y Y'?z Z'1''' ðversion = '' class TestHelpU±ðOptionalsOnlyWrap(#RCase)0""" u2 ë‘s where t¤are only oQ Ñthey wrap""" “ñparser_signature = Sig(prog='PROG')(†argument*Qs = [ˆ5û '-x', metavar='X' * 25),%y%Y%z%Z%]P‘[group—# m!'\4© : Û� [-h] [-o] \ [- jY/[-3³=Ðb+ '''\žT ò×OPosi<pS&`, add_µo=False"aÊß9bc8_ø(a/ b@´c.â”ä®ag ¹®cH¯© ÐVariableExpanФ cthat v2 s ˜e8ùded properly in¶sžH†type=int•ÍÌA'x %ùÁ)s %(default 5 /%'Í ac¥ó='store_const', AQ=42, o='XXX'yyyÀt)s %(const)cs'), ö Sig('--foo', choices='abc'$+ñ help='foo %(prog)s %(default <)^cbar', .W='bazmÿ[1, 2], metavar='BBB}?bar}Odestzrspam', ¼ @ Xbadge²40.5FH ]]ñargument_group_signatures = ["W(€#7'),%-aÂaw 26bq%-1¾B!])œÄÑusage = ('''\að: PROG [-h] [-x XyL� {a,b,c}¸0BBB 0a A2b BaO¤co2'''”Ç1 = 1 + ”&´positional z%s:! ZkÂGNone(})*E0.5 */opn a-h, --±K‘show this‹A mesY…and exitU J2xf¤h int %+y%y+h42 XXX'� ÂÎTya, b, c/¯V /vbaz bar´bB-a A5a�g_1b Bb%%-1#1''' ðversion = '' class TestHelpVariableExpan'UP�Supplied(#+RCase)£0"""s that v?ps are eEòded properly whengò= is present"""þfparserÒ0 = t ='-#',>',3FOOÆž@^#ÿ” 1FOOCc=ÍÊÇ#3NoA6sÅ/fith noÀ@add_¿b=False€� ̺7¶  Aress AÀ: """Tesðt that items can be suppressed in usage mesòs""" parser_signature = Sig(prog='PROG',;A=arg-¡.SUPPRESS)A†argumentCQs = [aNñ'--foo', help='foo :'),'Espam& ']-p[groupv#fq = '''\3‡´positional B%s:! n) E#/op= `-h, --2± show this¼q— and exitst FOO 1''' ·ÍqversionÞó class TestHelpSñO­(RCase)î0"""/Ö<Ú;"@add_>o=False2%{9Cm: : &ˆ£à" =&" +w%x~H8]ñGöB/�½.ã%HT(ŒöQ'), [T--barui]¤Z }!e[-h] [Ú]2F�ª{ªP‡§:Ÿ;¬KLµJ…_�Çm À [-h] [--foos FOO] 1''' ñhelp = usage + '''\ (õoptional arguments:� -h, --A± show this 1mesQˆand exit6@-fooŒ0 0–óversion = '' class TestHelpRequiredOž(RCase)¢0"""s that r1 ÐÃs don't lookRal"""øñparser_signature = Sig(prog='PROG')¯*Qs = [<5 '-í%',‚a=True,$$='þ1'),6�X[group^#­!'\:p : ¢a [-h] |i#^sôœÿAlternatePrefixCharsøïñisplay with different pK¿ characters,>_>Às='^;', add_\o=False'P^^fooAcpß='store_true'-ócµ;b', ';;bar-1bardZ@«’] [;b BAR�Œ\0[L#Ã" y!, ò„$ ï&�G No8E4theî£ñ can be suppressedv þP=&èû2ûL(Espam& ¬'ÉÙ_|*ôx ] g •"~@positRÓ! ]ĸñ<)™y%ONoneuñno errors occur if no¨ß is specifiedlIãÔð Sig('spam')q, ]òargument_group_signatures = [#Áusage = '''\4>õ : PROG [-h] [--foo FOO] spam*1''' qhelp = 9" +NO´positional ’%s: R/op, a-h, --o± show this 1mesÍ…and exitR% ¿¹qversionñ class TestHelpTupleMetavar(‚estCase)¿0"""+Ò specifying m.p as a t@A""" wfparser†Ð = Sig(prog='l!')($*°O5Q'-w',÷ =' ¤nargs='+',‚â=('W1', 'W2'))>x> >*>X>X>y> >3zY< Y2€/Y3€zB B)'?€ZDº­Ð/Ðw W1 [W2 ...]áƒx [X1 [Xòy Y1 Y2 Y3] \ [-z [Z1]‹KD~ýÏS Õ Ä>w$; -Ñ8 xÜ9H yêzõ9 RawText4 Cthe 'ZŸFormatter/ ‰84, f?_ÂA=argo.c adescriqp='Keep —MRing\nß' pexactlyëßit is written5‚here\n')(æ °ùQSig('ÒE�¡Š¿should alsor0� 'appearÁ`given ˆ',ði w'³™¹(º‰title', |‘TÊOtext¶ +',ê¿be indented;$ ¿Rlike Áˆ!! [´U--bar3bar]-þL[YO BARX!±Àformatting  ô exactly as it is written $Fhereõpositional arguments:,d spam: Fhelp?/op= `-h, --2Á show this ÷message and exits“--foo FOOx4·should also/&`appearýjgiven ìXtitleÝ4T“8tex‚®k»be indentedrhClikej mà --bar BAR ÄF1''' ñversion = '' class TestHelpRawDescrif(RCase)È0"""± the RawTex9ÂFormatter"""­ñparser_signature = Sig(„äprog='PROG', f?_�A=arg@.‘�j,Kd³a='KeepžTRing\nûw' X À5�B\n')ÝUs = [µ 'z!',¢L=' z?noto¼! Ãbretainì4oddNVing')&qRp {']žº_groupÀ(Pâ9', ƒ›æÀ +';$ Æ �! [´')3')]-u.&!'\§ : ¶q [-h] [Â< MABAR]Æ6{�1 = Er + '''\,[¸A â ¨B€hŒê È×q‹m 2¾SlAå�DefaultsU 0 ô^<l 8ÝÀption='descrñiption') argument_signatures = [ ñSig('--foo', help='foo ü - oh and by the way, %(default)s'),H€bar', acƒÅ='store_true]1bar] <Espam& 'Pbadged³nargs='?', ‘…='woodenF, H]±_group(@titl¿Rdescr\'=' É! [3ö--baz', type=int¢$42e3baz™]F›Áusage = '''\¬¥Ñ: PROG [-h] [²A FOO 3barqz BAZ] @[XG1'''Sç1 = V" +k%ÛB@posiÓ%alQ%s:3 p) c Š! " L": »µ)oÇqa-h, --D¡ show thisQA mesD¹Gexit‡6? æ INone9¸— y½WFalse¼4 U! )² W542)„¼qversion"ò class TestHelpVA~(RCase)�0"""Í541for^Á2"""fparser(0 = é`prog='–… Äs ˆG“'-V', '--~A r='3.6')ÔTÇ#äOV/âjä&³'¶Vì ï{dram's anumber¯ öÏ(  : �SuppressB !at2¶“ can be sGRed ing›sYê >Z´GvGF1.0'¾DðA=argí“.SUPPRESS�!e+'�ˆ 'mÕ¿/À-foo FOO] spCam 1''' ñhelp = usage + '''\ (õpositional arguments:` spam( N?/op= `-h, --2Á show this 1mes�‡and exitsÀ--foo FOO 0Õð class TestHelpSubparsersOrdering(RCase)Ð0"""# o$ó of subcommands inšñatches the code"""~cñ_signature = Sig(prog='PROG',(*adescri/è='display some…!')CŠmPs = [oð'-v', '--version', ac„&=' ‚='0.1')]¯s&WPname=�À@for '.0('a‹bcdeqq=q? † : 0ñ [-h] [-v] {a,b,c,d,e} ...2î ÄNø?æ €5Ü ßv£9Edram's }number ) `:0.1>+@With&3ÿ “_data = (õa¶7/')þ!('#b3Qc3d3e²3)L,=¼W2]š{ÄS¤ƒa  G¼b ?+À c ð c subcommand help d d+ e#e+Wõoptional arguments:€ -h, --ˆK‘show this›� message ¬Hexit9v9‘version 9¤program's nnumber@A''' M)a= '''\‰50.1 ,ð class TestHelpMetavarTypeFormatter(!RCase)æ"lódef custom_type(string)vrreturn 4ðparser_signature = Sig(êñ='PROG', descrig'=' %',Ä^ f·_ÚA=argm.ÛÑß)NÆ“Ps = [•P'a', Ú_=int)} /$-b08c8‚float, m�ú='SOME FLOAT')]¯[groupµ#uc  : b˜ [-h] [-b½&c pF] inŸ3oØ!= M" +c—ªìOposi0 fB[#\ ëo8 -óîLo # =A # O¼Fal/Pþÿconstructor testsPªƒInvalidAzCT.s(©Ò a bunch of i> ? ”Bs"""¶Ö`assert ðError(self, *args, **kw éi0r = .dPð(lK.`uRaises(g!, <dr.add_˜w ‘ Á_ValueÂPhÃ8%_³v_keywors“‚WPÿ('-x', bar=None„-ÿy', callback='foo'3³Os=()5LF={})¾ûðmissing_destinaEð(self): ó self.assertTypeError() õfor action in ['append', 'store']:+2N@=!) 1ðdef test_invalid_ope�_strings(I)\¦CValu§F'--'«$%uOtypek`foo', 3_='intz3Ï(int, float)"‘3x',› ='i %3?bazÚ#=(ö$, )vÁparser = arg ¡.ArgumentPVWwith °vRaises(Ûv) as cm]Usr.add_aZ…("--foo"×"—f-true"›k³In('unknown>á', str(cm.exce‡ ¢Ümultiple_dest¡˜ù+ ÃS Â!7r'bar', eô#ð supplied twice ÿ@posiœ alÚÑ!',P• I%no¼_U ìtsÒe_constx_á_false•­D\count¼xAttrswQdict(íaint), ¯nargs='+')+Ûchoices='ab')&%“x''-ÕP, **a– 5J"noÜS"# _!s YEzeroÌsËìyj% 'C?Ö!# ¨ù is always disallowed)ÿB× i!# �m*B6='*L k§ßmore_than_oneÃ#¯?"]:ÆÊ =0Ì2((2Æ0/\rÀValueError('òspam', nargs=0, action=G) ð# const is disallowed with non-op;Éal arguments>2forgù in [1, '*', '+']:(qò self.assertValueError('-x',„}='foo',9=Þ â .{(}7Àñdef test_required_f_„ s(’)$HIb'store3PSappenC[cå#‚xs alwayÉ )t�9Typ€GM='+'KBÎsparsersÇí_missing_paramÕpvcommandj'U!')l×:Ï, prog='PROGG)�… ¨¡_class=arg#.AP^1ÿBposiK üí  ?\=True\Ãuser_defined’\É­Ñ Success(ExceÑ{çFpass4A5–(object):1à�__init__t¶C�_strings)OdestA odefaulB N[False×0if …Q == '¢"if±5[)1Tš/3Uraiseµ÷{Dcall{ *é`, **kw Ù á¹0r =Õ Å(ŠR–#s(ñ!, :dr.add_Q, '--9¨�a#, ¸=Yé‹(‰=O # = 2 # ×ès returned by $F ƒCTestORN(!Ca¾åðtest_dest(self):# Áparser = arg ¡.ArgumentP%()+‘action = (sr.add_a-†('--foo'.òself.assertEqual(?Š.dest, '-[¯b', '--bara -a xay^Ax') àdef test_misc(õ!):`)]6õ, nargs='?', const=42,nrÿdefault=84, type=int, choices=[1, 2]Kð help='FOO', metavar='BAR', Ý_='bazJÌO, '?,íO, 42`éO, 84- _, int++", ,1'!, (-H!, I0i#, j_ # = 4 # Ù;áflict handlingÂsFá class TestConFHE([ase):@bad_j .#ÿRaises(ValueError,‘¥ c“_Ù3er=g#ª&ei •´+ ‡â gî¢6 fg#‘Ospam]o�6-kÇi�resolve_hBget_¸ O)6²(prog='PROG�ú}¨F° , ¬w='OLD X1v09NEW0îóApformat_eõ (), textwrap.dedent('''\ê¨pusage: Û [-h] [-x X]V! opŽ al(°sx € -h, --vð show this help mùessage and exit D-x XYNEW X e''')) ÿ"parser.add_argument('--spam', metavar='OLD_SPAM'):ï ã ×"Ù3elf2‘Ñ", ø).�argument¸.0 ¡(xžZfloatî=?/:2.50/`0.5, 1;2.5ƒA[ HH HYO0V M'']ä Fx', È á×O%r, Ô J ×È‘ MV')" % e#í%œnamespace&(ns N'0fooË bƒOspamY"0(", <)X Ø/ns¯p_starkwsï_notidentifierÈ÷**{'"': 'quote'}JÕW = ""È 0/""È2Ä?andÓ.]a=1, ¨Å& Ø5Ý4¥¢#Ïvalid': True£i+=)aÀ def tesót_parser(self): a = arg ¢.ArgumentP0Åprog='PROG')6¥string = (P"<ó , usage=None, description"Iûformatter_class=%r, conflict_handler='error', =öadd_help=True)" %ÝTHelpF\бelf.assertSÛaEqual(2r, ïj) # =ÿ # Namespace tests$ ÄU Test-(qCase): û1defA½_constructo­(ns©LÉðRaises(AttributeE-ò, getattr, ns, 'x')¿_Øa=42, b='spam60�ns.a, 42�#4b, J úeu.� , ¶O # =" #èa_knownçÄs2¢ class TesvK:PArgs(kCase):°‚|s_tupleD„2®<(()nëmÀrgumentParseSr() qparser.¡_args([]) €def testñuments_tuple_positional(self):/QGqr = arg A.Arg<Phy5add`O('x'š /,)žOlist�fM['x':"op(s)=W--foo-º±, extras = |ÖPknowne1s('8� F --bar¦z'.split(){Öð .assertEqual(NS(foo='F'),Üs,![']1', 4z']™ º_mixed>Pv', nö='?', const=1, type=int»& ƒ°--spam', ac¼×='store_falseq<sbadger'èðargv = ["B", "Cƒ v354"]D»2ËZ˲Pv=3, Ír=True, žO="B"Å ¬(4"Æ?# =" #a_interä}L/s < Å class TestI?A—CCasen�\basicE#mˆFing Š ’V and Ês€Úįprog='PROG ëš', dest='²€© ƒ5bar7 �requiredÌø­.@?cmdš Frest(/*'b� = 'cmd ÊA x 14ur y 2 3:<¼ ´}(WÁ # ‹Ð gets [1,2,3]/Ápite the fooª/fstringªõ`bar='yø0md=» ',DQ='x',k¥=[1, 2, 3] ¿{�# cannotnµ'É'X©$¢K I0["1@23¤/oð = 'cmd --foo xó 1 --error 2 --bar y 3'.split() ñargs, extras = parser.ð_known_intermixed_-V(argv@A# un(ó optionals go intoVkð-self.assertEqual(NS(bar='y', cmd='cmd', foo='x', rest=[1]), zu J#['íP', '243']×%) ƒ#Tõores attributes that were temporarily changed<uqIsNone(&r.usage�óbar.required, True’ðdef test_remainder(e%):t5# I~U and *õ are incompatible4–@ = EþñRaisingArgumentPàÆ(prog='PROG'¹91.adé/O('-z" x! ßnÁW='....Jî = 'X A B -z Z #K€Á fails with Kš (also 'AX # Gkqes(Type,ä ÞjßlNv) as cm²WI? [ñegex(str(cm.excePp), r'\.'7žexclusive7•mutually $x group;OŸworks fin=0^AE„_„_&( = 3 �-foo', ac]÷ ='store_true', help='FOOTEEspam1GSPAM2§rx“badger', ¹å*', default='XKgBADGERMç[ '›Ufoo 2ï…%�@=['1Ú2Ú$> , Û=�&  /'1§xÚç¹½ð°luding posiAal -ÿ/¼˜ºð.add_argument('ó"badger', nargs='*', default='X', help='BADGER') ñself.assertRaises(TypeError, parser.À_intermixed_cO, []GõEqual(group.required, True) class TestIOáMessageContent{("aCase):ªÖ# case where :ð gives different e¸" mQ:@is rà�d by 1stÜ�ing step*ðdef test_missingæãument_name_in_X(4™FAr = »FaingArg=PCð(prog='PROG', uï'='†C1.ad\9ö('req_pos', type=strp1-24opt2Tint, ƒ=‚²Pwith Ê þ ¸Òr) as cmŠ;�*(s(ömsg = str(cm.exception¿x¥egex(msg, ò)é!) »‘Ð9 ëÛ%ONotRÞ,?# =8 # 1� metavarÅ/s : ˆ4AddôMA}_öEXPECTED_MESSAGE = "length ofwòuple does not matchŽ"¦a1do_d5no_P¹,O`1argp.±]/rHs"--foo"a= g=5I£ A¥BValutl í(Öq ˜.ÐB[0], ïb# Unit^G forwvÀs BwhenýV=Noneþq__€q_string û·4Ç\Ì3"1"¬Èjº0k ühtê/()l1l o_("1",nÀgs_None_metaóvar_length2(self): ñ$.do_test_exception(nargs=None, metavar=("1", "2")) @Adef 8._._-o3o1T, "3"ta# Unitwô s for different values of²a when �/=?³oî%al·ostring¶ -no(6"?"'?"1"  m“0n “ kdtuple(d�o1o Ý qs ànrãvru2*u¯zeroormorew-*woy"my q{ êq xpz ë s}wt2+?one~3+~n}"l} p|p| o{ r{vzÀ self.doð_test_exception(nargs="+", metavar=("1", "2ð3")) # Unit ?ô s for different values ofCb when [2...A1def>_³_remainder_xá_string(self):tx2.do¸.no»7...½3"1"±plength0q,dtuple(&u1u,£t2t1x3x5?, "�/A�Opars�/_Ž n‹ ´ l‰ p† s‡ r„ â o‚s s}21 1,1»þdk!bf faiík hW eR iMiH22H2HÀ self.ò%do_test_no_exception(nargs=2, metavar="1") def 1$3_2_#ñ_length0(self):,0.ebtuple()f1f%_("1",e2e 0 hO "2"l3l 7iE, "3na# Unit¨ô s for different values ofÜb when ò3ä3äostring¬ 3HdH!bH fHfwÜ eH Ü eE iE ™ ÑlH?# =ò # from argparse import *u > Á class TestI9PStar(jCase):ˆ qÒuname in�†.__all__z~ôassertTrue(hasattr(· , H ÉJ exÑü s_everything_but_modules“•items = [ù] º,ˆÁEvars�!).I)()6€if not (Oñ.startswith("_") orÄï == 'ngettext'@¢inspect.isÅ( +]uµ7ÑEqual(sorted(�3), F|HÚ’WrappingMEß\setUpMWð r = ErrorRaisingArgumentPt%r(±mð'this_is_spammy_prog_(€_a_long_?ñ_sorry_about_the'H  # O%�as trigge’ library $Pion e¦ås due to usageVP# mesŒò matting incorrectly spliðon the ] chars ¿%inIlö = 'ÌFc.add_a<à('--proxy', me�tavar=meó ) def test_help_with_!q(self):&*!ptext = Ò.parser.forma@%()."ÅassertEqual(? , Eõwrap.dedent('''\9kò usage: this_is_spammy_prog¢ñ a_long_name_sorry_about_the MQò [-h] [--proxy ]4ö optional arguments$`-h, --ÝAshow¿ 0mesÒ› and exit • /…''')) ¹Smain(¨ðsupport.run_unitÚ!(_"__�ð)# Remove global references to avoid looking like we have)aleaks.�ñRFile.seen = {}W@set(¨D if ‚p == '__²2__'K£ð() # line 1 'A module docstring.' imÞÔ sys, inspect4$5 74ó(a, b, c, d=3, e=4, f=5, *g, **h5õeggs(b + d, c + f)L!11M"Cx, y2'"A˜"üNRfr, sàDfr =¦Ó.currentframe&sIÆc.stackQp = xU•q = y / 0‘ò20 class StupidGitFP"""A 2er,à in\"edG4"""*#27�ef abuseó#, 7íÒ_¥nother \tM?! containing!btabs \tDrgueŸø!40öÚp�2try÷QîçSexcep! exijys.exc_infoz!%tÀ@trac¹¡‘@property¯ÿPradic/F=ò'The automatic gainsayÓnEpasså#53åõMalodorousPervert(÷`}» Zd·9 Ti§ ‰ ¢ãParrotDropping:¨PFesteÀMGob(G+, A×UQasyncýólobbest(grenade�Ãò# It's intended thatÖð script be run by hand. ItPs spe0ñests on # hashlib fun$ás; it does not‚ø for correctness.ðûDtime T ´creatorFuncðraise RuntimeErrñ,or("eek, creatorFunc not overridden") def test_scaled_msg( ñ, name): iterations = 106201//'Q * 20$ñlongStr = b'Z'* xcalCF =ŒÐstart = time.!()öfor f in range(�”ax = loZ(|ƒ).digestF;end\]ñprint(('%2.2f' % (end-‹ç)), "seconds",÷¥, "x", lenlp, "byte(*Ls#e(­Z ‰Á åS200003¼I¼Ô5!'[i‹Ò(]'Ozero¹,™ ¹–<Â2"" ïsÃò hName = sys.argv[1] # # setup ouröQ1 toúò the requested hash # if Oóin ('_md5', '_sha'¤ñexec('import '+.¾$ =!r+'.new'(‰"òing speed of old",õ , "legacy interface") elŸP== '_´�lib' and¤S) > 3é, ©!0.%sJ?[2]µ 86" %„Ä2], getattr($,)Ð/==Ñ”lambda x=~‚� : x(%r)ã#0new= èÈ!así•É)œh $bt_call__f F8ÍNd"."£Ž¡¿"se-"|H8G ‹ @6B try{_zòe() except ValueError%a ‘ðpass argument(s)¿VÞ²ïSrun ahhY on:"F ë­î$‰±builtin md5'=shaDq‘‘'openssl_è�' 'fast'TsyN�KC¹,s 8ŽÐ(shaFOO)") ñ print(" 'hName' tests the hashlib.ö() implementation if it exists") L �otherwise*EusesTAnew(X)).<Hpraise ‹r_zero() ±scaled_msg( ÿ =106201, name='[huge data]'2 1?lar21omediumd 542414*small2 53362325212222&10d”õ creatorFunc().digest_sizexà %105Etiny.3# To!att±crashers in@Lib//ñ directory actually # do !4òinterpreter as expected # # If a+Àer is fixed,Ÿô should be moved elsewhere‹‡ð suite to # ensuðt continues to work cor¦ðly. import unitCDglob tos.path'@.sup8Q from•À.script_helpÅ_óassert_python_failure CRASHER_DIR = hd.join( 0dir?Ñ(__file__), "M erØB\FILESDùDIR, "*.py") infinite_loops = ["0_re*ð, "nasty_eq_vs_dict¢] class C "(>.qCase): s@±skip("these0@s ar«¢o fragile"]@_#.c2AonlyQ1def?_ q(self):#ÛPfor f8Ì.(./3%if�@base=(C)D "si:e‚g# Some° È` triggþqn excep° raŽ{ than aFðsegfault. Consider( t +cAÙable outcome.=i/ž~verboseÁi„Checking†2:",IžÖÐ/2 ¦ÓarDownModule(n Þàreap_children(›@f __zò__ == "__main__"°Mp() """ r€s commoná tuple, lis ´d UserList. 6ÌR4sys fpickleáa*úð # Various iterƒ€s # This»Pused ‡cRµpconstru"! (¿0and`ð_deque.py) def iteñrfunc(seqn): 'Regular generator'�for i in ,+/òyield i class Sequence!'ò using __getitem__Uñdef __init__(self,_‹`.s! =Œ7L:i7Pretur¬!lf>4[i]£�IterFunc£"itõŸ protocol©*ÂWi = 0¼gó¶,4nex,1if �i >= lenìÐ): raise StopîQationQ�vJD]U += 1MvB?GenAü defined with aXÌʬZ¾2valÀüÀIÉ8valæ‚NextOnly+L'MisÈ@ andÃ?terÕ,…Ò‚ NoeEor m!µ)?e�šTGenExï@TestÜ1pag� of excep$s®eü 8 íh3 // 0šÂà‚×ïimmediate stopÌApassë�š/}` from \ðtools import chain yYmultiŒ×�ple tiers±-š° Mñ(map(lambda x:x,tä (”iD))))XÀLyingTuple(t�Ÿ __t²61BŸList(list@`Commonö (unittest.CCaseNð# The type to be %!edÂ2� = None Àð_constructors(self):  ƒl0 = [] 0 l102U, 1] &öu = self.type2test()S 'l0 c 1 r '2)~u@u�u�u‚u‚uƒuƒv†tuple(u)‰õclass OtherSeq:!lÐdef __init__(í , Jseq))- ”.__data =(O3lenNE¡return lenpP®i–sgetitemK?, iNš&[i55s =ø({v›s„OÀassertEqual(®Bv0),·)cõ "this is also a sequence"v©pvpõ# Create from various iteratablestðfor s in ("123", "", range(100Í´('do', 1.2)Ë2000,2200,5)oPgPSà¢, IterFunc EGen,È¡amulti,¬Kfunc_, xÝlg(s)),ósìFµOStopQP c cj¢` ¦üRaises(TypeErrorâ^€NextOnly³ f%®JoLHÏZeroDivisionšaGenExcP™å# Issue #23757¬ZâaLyingTÃO(2,)î (1Q�List([2]O4[1]ÏvDa_truthž¤©fQFalse yß+=Tru* [4ŠHtíVvcö[0, 1, 2, 3, 4]w†i†å´uÅ›€@u[i][Q œ&Znt(i)+ q-rG, -1ÂPÀal(u[i], len‡(u)+i) ûself.assertEqual(u[int(i)], len2.òRaises(IndexError, u.__getitem__, -@&-1r@?= _Value}õslice(0,10,0)) ôAu = †¯type2test(b ß08$�‹Q?TypÓÄaÄ�[10, 11]”Ùa[0], 1·#1#±# -2$G -HèZa93Ç93%@def ÛŽ h%):wPl = [2¥, 2, 3, 4]"lX8J 1 0:ZVÄE@u[1:F 3O[1])6 1-2:Z 838 P1000:O], uc % :-,],)[g :^_:NoneZ1‰ @/:3BΣ˱# Extended sBx“:¿:¶0¼4z!_1=?1, ¾ :õ4¹2, 1, 0} !::¶—£![4º= 3>?3, ± ?3:3z° ?3:28, ?3:19%09æ¡0[!00lz œ" £Ò;Ò À[100:-100:-1Ó], u[::-1]) ð self.assertEqual(u[-100:Q-1], !ßtype2test([])=2<p0, 2, 4C�õ# Test extreme cases with long ints,=a =�Ÿ0,1,2,3,4Õ ÿa[ -pow(2,128): 3 ž01,2œkca[ 3: I?45)FŠ!) ´@def 6 _contains(N!):fuÑW 1, 2Ϧfor i in u:>M¼vIn(i, u›4ÿmin(u)-1, max(u)+1E5NotH£eõRaises(TypeError, u._Ü/__ö\_fakeûºclass AllEq‘ð# Sequences must use rich comparison agOµt each item°ñ# (unless "is" is true, or an earlier7– answered:A�So insta‡"of©�€be found’ôall non-empty s¹.�a__eq__w, others¹return TrueAð__hash__ = None # Can't meet ð invariant requiK9Ååx/()ß?In(314°é ða_orderöï â4A in-.}. If aóvhas sidñ# effects, these will be visible to~s.Ölater members¤p# In th'1estN "kaBða short-circuiting rGÒPDoNotÓÇEq(Exceptionýè6pasÕ7QStopCà*esU>� €…q¯checkfirstq81, ~'(){9fIn(1, J2/la] Z/, |[½kW e<, 1hö if sys.maxsize <= 2147483647d7-10nÂ;;Typ /õ class BadExc(Exception):¹HFpassÐ3:Cmp(°def __eq__(‡{, otherMQ"ifZ == 2Dr^™ôÆreturn False›ako, 2, 3c&2, a ,{WCmp()-_‰jg¢^Ê(ž�Y.¢+-Gù ,µÎ .£  Ø?, -ú Wú ZO, -2Šù4*sys.maxsize, )Vײå E),-§¦P 2SÁAÇq_pickleF??lstá§4, 5, 6, 7zòfor proto in range(T÷.HIGHEST_PROTOCOL + 1d]slst2 = 1Tloads>¢dumps(lst,_)ô:ø¿K_, lst(#Noš idXà züfree_after_iterating#ïsupport.check_2 , B,˜¤GŽreversedKPfrom Í0 im“ T Tarray $io tmarshal4sys @unitPà import os impðort types try: impñ_testcapi except IRError)"ò = None class HelperMixin)Qdef hò(self, sample, *extra)&|ônew = marshal.loads(kdumps(;)³;ZÅ.assertEqual*6new&æ3Ðwith open(supùö.TESTFN, "wb") as f 2”ifÑ•,brb &(fÇXñcfinallÛ7ëkunlinkú)ÈðIntTestCase(unit.,çÂè%Q_intsët # ;ð a range of Python -õ larger than the machine word size.T°n = sys.maxU ** 2cwhile xw÷for expected in (-n, nœ%Sª1 u}qn >> 1 tó.64ô€SimulateæØAing ¦TYPE_INT64Þñ maxint64 = (1 << 63) - 1n¤4min!---ì0basq $, 5%, 4D, -(Ñ JKÿ s = b'I' +Ø .to_bytes(.ú , 8, 'little', signed=TrueJÌ=gotïs'—Ûh>got,0if ð == -1: # a fixed-point for shift†Wright\”F% 0yNelse34>>=ãöb'I\xfe\xdc\xba\x98\x76\x54\x32\x10'Ú þ÷got, 0x1032547698badcf_tÿ01\x23\x45\x67\x89\xab\xcd\xeft-u“uÿ 8\x19\x2a\x3b\x4c\x5d\x6e\x7uö0x7f6e5d4c3b2a1908tÿf7\xe6\xd5\xc4\xb3\xa2\x91\x8]-u+9)ðLboolï\baï{, FalseWÎcbkOFloam%f<oBfew #ÊÀ small = 1eS-25 õ n = sys.maxsize * 3.7e250"õwhile n > small:Búfor expected in (-n, n)%)ôself.helper(float(7)))Rån /= 123.4567 ff = 0.–ös = marshal.dumps(f, 2K7got"vloads(s�°assertEqual>6got!ò # and with version <= 1 ½s|öled differently thenE¥1 ¥%¾-¿<¿* ·…ßTãå ', 8n *÷ôclass StringTestCase(unittest.1, HRDMixiu@def %�_unicode(x‘²s«ð["", "Andr\xe8 Previn0abcš "*10000]ÍOÉ�_�Bs)))¿’sÏ‘Iss_bytesrbb"b"/b"v±”Exception¢´‹e3 §=newà d�StopIterasH¤Þ )‚, new) ³OCode®R]co = ú.…Þ0.__=%__8à/coÕ $coÊAQAmanykmobjectWò# Issue2957: bad recuâ�count on ª @°`= 5000r÷# more than MAX_MARSHAL_STACK_DEPTH< de((Q,) * tFþp³ssœŽ_filenamðco1 = compile("xü f1Vexec"É8co2)y# f2 )21, .² 2(co(*Q »eco1.co¿W, "f1•020ð2") @supporðt.cpython_only def test_same_filen ±used(self):'+ps = """2°f(): pass\ng5"""/ðco = compile(s, "my_ª", "exec")*ämarshal.loads(–dumps(co).öfor obj in co.co_consts¨¬÷if isinstance(obj, types.CodeTypeØ0ï€.assertIt\²,sð) class ContainerTestCase(unitS.Ó, HelperMixinyõd = {'astring': 'foo@bar.baz.spam', ù 'afloat': 7283.430ninY2**20qshortlo`20lis3¹['.zyx.41']•tuple': ( J,)*1]ùboolean': False@`unicodBö"Andr\xe8 Previn1 } á@.]_dictsQelf.h=;.d)6ÊXÉ6 ¼.d.items())DïE !o.d.keyELsetsD«ž`ructor³÷(set, frozenset¶ º9X {@supporÕ eempty_n¡_singletonR}$# r€ñ) must reuse the J¸ Jż”="(²kobj2 =bpâ7objã Š?€$) uOBuffr¥jœbytearrayFb = Hb"ab§–WbÞ?newÝ bÛ`Equal(—a(new),{s�¯memoryview®¯sXAa = .l('B', °HaH 6newT($gs†˜¬ug_5888452lð# Simple-minded check àASF 53ñ: Debug build crashesy ïÌ[128] * 1000ñÌpatch_873224‡ƒ£úRaises(Exception,`ð, '0') self.aóssertRaises(Exception, marshal.loads, 'f') oself.a9Hñdumps(2**65)[:-1]) Pð def test_version_argument(f!):%xõ# Python 2.4.0 crashes for any call to¸pOx, y¸dEqual(�å;Ÿ5, 0)), 5@'1@ÄéNfuzzÝasimple ð that it's at least not *totally* triviað[” from bad U data&.Ác in [chr(i)?i¶range(256)]tY:try 9c#eF M?KpassÿƒŒ_2x_codeðs = b'c' + (b'X' * 4*4) + b'{U2**20æ:  ­ValueErrorÚs‰ŠArecu‘Œ5ŒD†__limiõCreate a deeply nested structure.€head = lNE= []ð # The max stack depth shoulF�tch the vC*‡/ccñ# BUG: https://bugs.pµ×.org/issue337ªñ# Windows always çsqsmaximum�Pon re öe and debug buildsÊñif os.name == 'nt'- hasattr(syÊ1getI—refcount'eA ½öMAX_MARSHAL_STACK_DEPTH = 100�Oelse929 �o7- 2µt׺.append([0]‘ûB[-1]z6ñ # Verify we don't blow out‚Qwith /ïZ$ =i.#(g~@new_'D s(<'1# D~!us¹ð to compare objects, it can \!edž5˜ÿçDlen(Š0), •)�3 P69ç:n~—´Ž™Àp!, ÊÓcüexact_type_matchÄÀ# Former bug3: ý # >>> class Int(int): pass%ðtype(loads(dumps(0I))))*<'u 'int'>°for typ in bö%, float, complex, tuple, list, dict, set, frozenset)µ¼ñ# Note: str subÀões are not tested because they get handled˜Kðby marshal's routines ´ðobjects supportingLÉ buffer API.K0subæ=ì2e('Ö', (typ,), {},{ôself.assertRaises(ValueError,”.m,çqtyp()) tð# Issue #1792 introduced a changem4howG¡ increasesâsize of ité#CSernalÞa; thisJa ensur9!at>ònew code is exercised 1def5s_large_Y(ëÄ=tF(1e6¹0Stri = 'abc' * -ô4Q(0Üinvalid_longs=T7019:#.Ý shouldn't pTð unnormalized PyLS‘is·¿b'l\x02\x00'>™*, k ò‘multiple_10_aný®d|ýZ12291ý#()þÔ be callable YR time/Š`# withÄóerleaved data written by non-±0÷`# Adap¤Àfrom a patch3òEngelbert GruberVp]R= (1,ð, b'def', 1.0, (2p', ['b'7c']œÏ5int«‹!b')W0123'!m ilen = len±6©$åpositions = []Ü:try±/Sopen(Pþ.TESTFN, 'wb') as f6:½dÑ#'kZ(d, f°#0if ãL) f.Ìe%à.append(f.tell±# r 1i,  enumerate( ÀkdPEqual+Z'(f(1)Pread(Rs ‡2_[i], /ofinallMCkunlinkR àloads_reject_uónicode_strings(self): ò$# Issue #14177: marshal.loads() should not accept uQ QJie = 'T'vú .assertRaises(TypeError,t,aI!) Eüdef test_bad_readerË¢class BadR§io.BytesIOð÷LCAintoEH, bu%Ån = super().1+“"qif n is(æNone and n > 4k,­n += 10**6K…return nøfor value in (1.0, 1j, b'0123456789',  ð}VO~,u¥](adumps(Ÿ'))¬_­1eofa‘edata =ô@ð("hello", "dolly", F%))�i range(len(J)Z¯ë?EOFé0s, ?ñ([0: i]) LARGE_SIZE = 2**31 pointer_size = 8 if sys.maxS> 0xF’ else 4 „¢NullWriterþqw 7, s¶°pass @unit3‡.skipIf(‘>w0, "'@ can”Ðrun on 32-bit(ctems")ˆQLargeì¥sTestCase(iŒ¤ƒcheck_unÝSlable³.*hg jÝi&, ((ð@support.bigmemØ([=ýò , memuse=2, dry_run=Falseµ7 _bé«C «Úqb'x' * 0f’8"st¡,` ;��* ¯?+ 10 5tupÛ (”/,)3'¤OlistÓ[£]¢h¢s®P*12 +`@.get1o£:-1):« /seÖ3ø{h®ÀARGE_SIZE,  ðmemuse=pointer_size*12 + sys.getöof(LARGE_SIZE-1), @ñ dry_run=False)ð def test_frozenset(self, N!):$Cö.check_unmarshallable(9arange(91)) ;ð@support.bigmemj!=¦#, Ù/2,¡ Ÿbytearray¡90izešõó CollectObjectIDs(ids, objõ3"""#ñect ids seen in a structure"""ë`if id(A!6ids=breturn&sds.add(+…;�sinstanceCõ, (list, tuple, set, i)£˜Pfor eq6objq¾ á÷/eltKdict[Ck, v^w.items(!fkØ!‹v%@ lenƒ¢) class IðingTestCase(unitB.Ó, HelperMixin™ñintobj = 123321uDfloaQ.23452str*‘"abcde"*3”{"hello":@¨, "goodbye:/}ûehŸ3²ArsamÏ’recursiveŠmÈ8Ô#we have two s¦OF = (Z~%]n0 = �è=), .Ss3 = ßr.dumps($2, 3¯T&T>€loads(s3q5ö#same number ofÔ¦ generatedÞ÷elf.assertEqual(n3, n0Ûuif not N õ #can compare with version 2d”/s2ó2ó*n*÷*2)<¶#old formatì@ mor½ùÙmqÿ«Greater(n2(1#ifæ3lex© s ò§in there, z™is largerH si… EbŠ­As2),¶ã)OelseG×L�?í"In’‘[Z.ôq!|"iCTrueIhF$Oj ìl $ É?Str_“À) señlf.helper3(self.strobj) def testDict!):.;Q.dict;"]#F^aModuleE`öwith open(__file__, "rb") as fˆjñcode = f.read()^4if =P.endsTg(".py"i)A€compile(,;†, "exec"XÚ,3ŽìœRecursionï@d = L0d["u "]'R·¿Bd, r^vve=True–Ql = [-cEobj]C¦l.append(l/*Û>3(lWð class CompatibilityTestCase(unit4.k_âA, veΞò…ñdata = marshal.dumpsàÉS%`loads(: O20Toýt 0/1/ 1/2/ 2/3/ 33) ï”InterningÙë1, HLSMixinÝQñ = "this is an iL¡ed string"<*Bsys."( ³ŠHe?s {‰®bP ìøassertEqual(s, *š_)pid(s), ZH2 = ËuE2M)î/Noð.O, 2)~ó#Noª©ö( Oùõ@support.cpython_only @U±skipUnless(-õcapi, 'requires #')·_CAPI_³ð¬«á_write_long_to‡ vôfor v in range(sÞG + 1£H¢3.py.gÄ0x12345678, –TESTFN, vÌR8 )O'rb'0À data = §f.read() ôsupport.unlink(kTESTFN+ñelf.assertEqual(data, b'\x78\x56\x34\x12') dñdef test_write_object_to_file(self):)�ðobj = ('\u20ac'X abö123, 45.6, 7+8j, 'long line '*1000§÷for v in range(marshal.version + 1rv_ scapi.py.®Zobj, 6, vzM›with openGÆ, 'rb') as fñ2F? = ž>Ïa.loads¬l), obj�¿_short_from�ÚwÚ!f.õ(Vxxxx'1r, p = �’© š”Á n ½–r, 0x1234“ $Cp, 2/ª+GKpÿRaises(EOFError¦%9…®ZdE . ™EO5678 46 ;#403"4astÔ9ÖjÃ@ïadumps(¯ŸÅ‡ÉgK+ b'°$Ì l+»RÖ+ —rçÀ witûh open(support.TESTFN, 'wb') as f: ùf.write(data[:1])"þwith self.assertRaises(EOFError)Pû_testcapi.pymarshal_read_last_object_from_file« }Çmunlink+©@def rd_7elf¥ðobj = ('\u20ac', b'abö123, 45.6, 7+8jˆófor v in range(ÒÇ.version + 1_[H4 = )Ædumps(obj, vV)[¯*ª + b'xxxx'Zr, p = Š& 0 M… Ê(·Equal(r, obM) %ap, len€1)) Õ(#/ÒJH9ò if __name__ == "__main__"d@unité.b() # #ùð codecencodings_jp.py # C - s Ð…Japanese`s. # •&0 im?¡ multibytec_  ‘ÿ class Test_CP932(9."dBase, <CCaseE­‘= 'cp932'ptstringW“Q.loadï)³('shift_jisÂ?sUa # invalid çsç(b"abc\x81\x00�2\x84", "iÍct", None),;/f8'bZpreplace>„Qufffd†ouff44"k D1\x8{H \XN‡Pignor‘  00>Œ`\xEBxy3 }�\uFFFDxyn�\xF0\x394 ñ@\xEA9 50'ab—§fd\ue038y'9¡# sjis vs V­P\\\x7Ý"´B2(b""5f"61+7cð…€3c\u2225 $0døÚ) euc_common�‰…�Ž0\xc1\xc}Àe), (b"abbc\x80ðc1\xc4", "replace ”abc\ufffdð7956"), (b" B@\xc8;F RL HPignor� nu‚rìstrict", None¥Pf\x83U� ï—«\x82\xFCxy9Á)xy2L6L” “0\xao0S#"L)3cJ'/\\))\\+@8eXY'ÜQ@fdXY(ð#) class Test_EUC_JIS_2004(multibytecodec_support.)BBaseîò runittes+aCase):ñencoding = 'euc_jisj'tòyPload_X)(Dqx0213')E«$0 = dacommon!°xmlcharnameA = (Äñ"\xab\u211c\xbb = \u2329\u1234 &a"÷b0ð9\xa8ℜ\xa9\xb2 = ⟨ሴ&r "goXÁoR+Šoå�P_COMPATp' àpÚ*pÔ' +À(‘5í"ô¤5<åp("\u203;"' 7e#€) shift @0enc.s/ å 8Ûofw#yR0defÐ î@ff44:), RS¾áÈ ªË%A¢g Ö PÓr ’"ÐÔ±1\x8’àreplace", "abcf\ufffd"44 c"), ð(b"\\\x7e", "strict )),)�x81\x5f\"61 7c1;ðuff3c\u2016\u2212qor (b"abc: 39:`replac€ ¶94oEA\xFC4Þ moFF\x589Xmð ) class Test_SJIS_2004(multibytecodec_support.&ÒBase, unittesaCase):9ñencoding = 'shift_jisT' t7cPload_Z)(F!')B’!1 = cb’commonenc1+ (-ñ0xa5´$3e -íõ\=ñ ½ËfðO64bfuL39xyµå œå2>Xxyd@0\x8\2\x84:"k4# v@DO\x88Hn\u5864‘lFC\xFBA'ƒc95b4y'‚ÿ°xmlcharnameë' =êñ"\xab\u211c\xbb = \u2329\u1234 &a"áÐb"\x85Gℜ ðQ = ⟨ሴ&r "K+_X0213+<xT+.F10!±å- —¸«Kff44pF/JVP|šõ# sjis vs cp932 ß[ à @5ÔV‡iPif __ò__ == "__main__"ƒ›ðD() # Verify that gdb can pretty-print the various PyObject* types # # The code for wâJð*was adapted from similar work in Unladen Swallow's # Lib/Eð_jit_gdb.py imgt locale$os rðsubprocess import sys óimport sysconfig „textwrapðunittest from  +0supD.!Drun_@ò0, findfile, python_is_optimized def get_gdb_version(): try  proc = sub ñess.Popen(["gdb", "-nx-F1"],F=xstdout=U?IPE8?err80unižõal_newlines=True)©Pwith áù¼5Qion =ñ.communicate()[0]?æexcept OSError@ð# This is what "no 2ñ looks like. There may, however, be other^†0# e[0s tI manifest t_…way too.-draise ñ.SkipTest("Couldn't‹ñ on the path") Bò# Regex to parseÏa# 'GNU4ð (GDB; SUSE Linux EnterpruÐ12) 7.7\n' -> S =õ) Fedora 7.9.1-17.fc22494ó6.1.1 [FreeBSD])<6.1)š]€(7.5.1-3^318)617.56ómatch = re.search(r"^âÁ.*?\b(\d+)\.3", /2if @cis Non#¨{EOu"unableMD GDBLt: %r" %[ƒreturn (pa, int(m®.group(1))g2))) È,ªd_majorÛ&in. => if<B < 7áu£\4gdbÊñs before 7.0 dir¨‰! "…2ÿ "embedding. Saw %s.%s:\n%s8 0% (÷ eE�XWif no¹B.is_Èd_build5Ãf° only workszqsource D0s aÏ�e moment.Žp# Locat~±of custom h<Öô in a repository checkout. _._Þ` = os. d.join( ðdirname(sys.execut°)#B 'ò-gdb.py') PYTHONHASHSEED = '123'išógdb(*args, **env_varsrp"""Runs|Ù1--b¢Qmode ›¨@addipal argu*±s given by [.ÆRHrs its (lñ, stderr) decoded `±utf-8 using òreplace handlerW"""z4if ¸¿2env_Ñenviron.copy(ÐÀ env.updñate(env_vars) else: ‘nv = Noneð"# -nx: Do not execute commands from any .gdbinit óialization filesJ_â (issue #22188�ñ base_cmd = ('gdb', '--batch 2nx')ñif (gdb_major_version, &in¶) >= (7, 4)Ùf+g@-iex]ðadd-auto-load-safe-path ' + checkout_hook_‡ proc = sub ¦ess.Popen(ba args,÷õò# Redirect stdin to prevent GDBZÏmessing withN òthe terminal settingy}w=Æ?IPEµ ostdout4?err4renv=envoý jÌ¡out, err =.�@unicÝ5ð return out.decode('utf-8ô‘replace')D ñ # Verify that "gdb" was built— yöembedded python support enabled: gdbpy²ð_ = run_gdb("--eval-ÄCand=C!imBósys; print(sys.ô±_info)") if˜ _'ð raise unittest.SkipTest(Ä4ÿ/")@can /À our custom #õs, as OS securityˆñ may # disallow this>Sout aDEizedH1. _Ù—py_errors20'--`0', ”h"Î9h¬ðeen declined" in1X.Qmsg =བྷcuse of®ò1: "˜nX+pð.rstrip()) defó_has_frame_select(·b# Does.¯d€gdb have: .F6.6! ?‹¤/, dX0dirVL)Vmq0e.m†ð(r'.*\[(.*)\].*y k„mJ<!"Uë arNRutputì2gdbƒϸ"câ! diõðm.group(1).split(×+ù""''ñaðdir HAS_PYUP_PYDOWN =L†ð BREAKPOINT_FN='…¥tin_id' @]sskipIf(öp.PGO, "0ðuseful for PGO") class Debugger‘%s(GqCase): Ê0"""|gd8 ‚ ! PqB."""4Sð et_stack_trace(self, source=ÑNone, script= / ÿ breakpoint=BREAKPOINT_FN,2·cmds_after_=f õimport_site=False):`5''' öRun 'python -c SOURCE' under gdb with a y%. =0Supfñ injecting commands ¯G the:¶ is reachedDqReturns+°stdout from|%ð: if provided, a list of strings:D’µþØ# We use "setª@pendÐðyes" to avoid blockRõ# Function "foo" not defined.|(9Makk÷on future shared library load? (y or [n])Nóerror, which typically happens ؃is dynam·linked (theKásDÀinterest are²be found in« ¤”0Whe#$is‡ï, we still get5€textiowr»r_writeEpemitted˜pstderr V· time, alas¤q# InitiãI had "--eval-¬÷=continue" here, but removed it to&Prepea�Hprin81s wþ`ravers*€hierarch|W dataMPstrucòsê§# GenerateѪs}ægdb's languageN$O= ['Î'g'ÿg %s' %,™Îñ# The tests assume that@firsÃ0ameH"%edö GÀ backtrace w 5�0ainÚ€gram couŒ¸"# znaoweveryÐguaranteed by€tó@fore¤n0!toC½p addres(f' ËmØsÀö¶óÕhÇ. For examplº H #0æ@PyObT!_Pb&..D /aƒdº@some Rßis can be e.gBÿ#0 0x00003fffb7dd1798„*;f'run']Wp# GDB a^² 7.4 onward¸0disU¡uish betweYµAvalugña variable at entry vs current (,‡ðhttp://sourceware.org/gdb/onl¶1ocsVYes.htmlIà# which leads ó"to the selftests failing with errors like this: à# AssertionE'÷: 'v@entry=()' != '()'1lDisablIñif (gdb_major_version, &in¶) >= (7, 4)†�ñ commands += ['set print ‹Õ-values no'] Œÿ if cmds_after_breakpointY/POelse<¸['backtrace…#¨ÀŸt# Use "À" to generat>²e arguments¦Pwhich%Æinvoke "gdb"�Pargs s--eval-X`=%s' % A for3in %s]Ý?\0"-- %", sys.executâ <ð.extend(subprocess._Hà_from_interpre‰†flags()) ûif not import_sitgñ# -S suppressesË’default '6 6‡¯~.J"-S"[source/Bc", #ä«elif scrip@8iû"M (' '.join(ï°gdb, captur¹æstdout, stderrðerr = run_gdb(*Kú, PYTHONHASHSEED=ŽperrlineM‘err.split%()Æ·unexpected_/[ýóIgnore some benign messages on¹.Si/€_pattern~(ÏP'Func‡Q "%s"1€defined.áß ¹à'Do you need "8úsolib-search-path" or <'*šysroot"?'Tð# BFD: /usr/lib/debug/(...): un¨áitialize decom¿ Ô�# status›"seß.O‰_aranges0'x Ž;Ë all warning7+: ;Ñå0 in €¥n‰continue®2p.startsn(®é èN^@.app_¬Æ# Ensure no 6Â%orn¯!.aÐfEqual(4ÈF, []¢return out¯pdef getX`_repr(S. &ÊV_=None1Ó g=False$ð# Given an input pythOÓ ”ðesentation of data,# ÷+# run "python -c'id(DATA)'" under gdb with a breakpoint onCð builtin_id and scrape out=÷'s representation of the "op"E¡parameter,E±verify that.‡�displays¶same stringF / VA �expectedE “For a nes(qucture,�òfirst time we hi¨$Gwill‘bgive u½�top-level}U +ôNOTE: avoid decoding too much@÷traceback as someA»ð codable characters may lurkÀøre in optimized modBõ(issue #19743).\·cmds_after_ë/= Por ["¤­E 1"]Iñ gdb_output = self.get_stack_.‡(source,wõ=BREAKPOINT_FN,LÍŸ=WÇimport_site= )š#ð can insert addiqal '\n'ìIspac¨÷in various placesP`in its^¡put, depen  on×V widt$ñerminal it's connóO`to (us`Vð"wrap_here" funcªÍöm = re.match(r'.*#0\s+þP\s+\(Ëð \=.*,\s+v=\s*(.*?)\)\s+at"1S*Pn /b5¿module.c.*'y),~fDOTALL••if not m:Õ†•.fail('UnêEtØ: %r\n%s' % (b )dðreturn m.group(1),׿¹`def asã�EndsWith ö, actual, exp_end)¨—'''Ensureæbiven "4"šBends„"FE"'''ðì|RTrue(>.6¹(4)`á msg='%r didM2endp!%r!RÄ)ô MultilineM+esüwpatternü K,?re.ç Ã¥ Ài)ÀuÁample_script»ªü findfile('"s2ñ.py') class PrettyPrintTests(DebuggerQ&Õtest_getting_ wf««F42)'§  .Ð in gdb_outpuñ%t) def assertGdbRepr(self, val, exp_repr=None):15ð# Ensure that gdb's rendering of theB÷ ue in a debugged processI`matche?�pr(value)4Dthis.x1gdb�,t _output = ²T.get_ à('id(' + asciiW…) + ')')zeif notâdàø0 = ÿA:n3dEqual(v0,-N ‚('%r did~@„óected %r; full ÚŸwas:\n%s'O? % € '))ê�test_intåÑq'Verify¸Ãpretty-printϲvarious intדB&42h0 /-7 '10* -+<000¯singletonsðTrue, False and ¤ò1¬ L" d ÁOdict¼4ionarieÅ /{}� ú{'foo': 'bar'}, ""=ð# Python preserveHqõion order since 3.6éE aý, 'douglas': 42� "<?lis<4é &[]øÃAŽ(range(5˜ObyteÏ4“ 'b'ö”@b'AnŽÀw for someth÷@hope�OsameH !stÿñ with embedded NUL here \0,Athenf0 moA?extX  ¶is a tab:\tï Z 6b' 0¯slash-N:\n4OR:\r4 PuU…¡‘ 255:\xffŸ128:\x80'H ![bœb>]255)]Ù�CÀhe pretty-pró inting of unicode strings' Pencod%ô= locale.getpreferred%()1õdef check_repr(text):V:tryAext.O!e(6ingU"ùprintable = TrueX‚except UËE¹neErrornôself.assertGdbR©r, asciiµ ~OelseH%) ™j&''[ðAnd now for someth€ÿhopefully the sameG Ëð with embedded NUL here \0 andLne` more ®'¾q# Test w…÷a single characte\#¡õ U+2620 SKULL AND CROSSBONES0'\u0s ‹Japanese¥Pð# (I believe this reads "mojibake", u¸& 3¸`s fromG CJKLõ0Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE)J æ�6587\u5b5P316\uAøa£p outsidÔVe BMPkõ 1D121 MUSICAL SYMBOL C CLEF‡0# T(is>÷ UTF-8: 0xF0 0x9D 0x84 0xA18% 16&0D836DD2 ßachr(0x�)<Àtest_tuples(çb'VerifÊupretty-c2of 5„> ®X(), '() 1(1,'/1,) ²'foo', 'bar-z'Ð?setÎ3Ìñif (gdb_major_version, &in—) < (7, 37a @skip™/(">p` needsVï 7.3 or later"y �set(), "+P['a']0W{'a'}0ñ# PYTHONHASHSEED is�q to gettPexactƒõzenset item order‚öif not sys.flags.ignore_environmentÔ Õ˨Ö­²> r4, 5, 6ê <¨`# Ensu=áhat we handle ˆpcontain<·÷"dummy" key value,Gö which happens on deletionç'W1‘output = Dget_ Q('''s!t(ð'b']) s.remove('a') id“(s)''') ñself.assertEqual(gdb_repr, "{'b'}") -ðdef test_frozensets(=!):Oö'Verify the pretty-printing of 9'31if rðmajor_version, …6min—) < (7, 3os‚¿.skipTest("v ` needs\ï 7.3 or later" …GdbRepr(µW(), "7Z['a']<g{'a'})Añ# PYTHONHASHSEED is­q to getQVexactD¸ item orderMönot sys.flags.ignore_environment­>ýð¹O, 'b¾ ÃO|4, 5, 6 MÊi�exceptioni # ïæ a RuntimeErro= ‘output = +@get_ ‚(''' tryYraiseQ°("I am an e`2") ’ %R as eBoid(e) ^ë5 "Õ)('„ ',7‘9 òdivision by zero�!ìS ”a = 1 / 0òSZeroDem÷@ d,('ØÿÙ&½modern_clas(‘ ¡new-style >¦ instances @F#Fo€ðpass foo = Foo() `.an_in�š42 id(foo�òm = re.match(r''ãÙÑTrue(m,xümsg='Unexpected `renderËP%r' %G( 1sub�ing_list%%an‡4 a D U™-(NCŸß += [1, 2, 3]°X–¥’±7À%r' % gdb_reñpr) def test_subclassing_tuple(self):&*ñ'Verify the pretty-printing of an instance E W'Hñ# This should exerciseWðnegative tp_dictoffset code in#F¡new-style ¸… support" gdb_repr, �output = ÖP.get_ R(''' CAFoo(·÷°pass foo =  (1, 2, 3))`.an_inSå42 id(foo)''')�òm = re.match(r''³�¦€¹ÕassertTrue(m,jümsg='Unexpected +`render¹Q%r' %!ni2Sanð , source, corruption, exp7S=None3‡ð'''Run Python ulc<Ãng variablesÙõ inferior processÝðimmediately before tak½Âa backtrace.Î~§ at2j0's ­`esentaÀ1 is!'…failsafe{ 0(a'if $øcmds_after_breakpoint=[8'¸%']mOelseJ >?Ï<ï\!œD ý× &* Ô$if! × ifœ? ==$#'Á managed to o³AvaluAspitp–c;Ð0# tvñ is good (see http://bugs.p­æ.org/issue8330Ë�freturnl0# MÞ` anyth“1for¡ñtype name; 0xDEADBEEF có5 to¤b# someA’arbitrary£¤ïpattern = '<.*]¾ ¡??ùþŠif not mÇL3(k;gdbg€: %r\n%si ŽR(Â)“§�NULL_ptrž@Ensu`hat a '  PyObject*ê�handled g/Vfully“zE = (¢¦ð <�'id(42)'‰8/ (0=['ÜO v=0IO ¶'> àself.assertEquñ&al(gdb_repr, '0x0') def test_NULL_ob_type(self):!%ð'Ensure that a PyObject* with : :õ is handled gracefully'JYõ.assertSane('id(42)',"pƒ'set v->a=ºcorrupt½##a ?ÂXŸxDEADBEEF÷0exp­M='42«²Ÿ_tp_flags¯ a ã»J J¿´8$->`=zìõ?nam£ôIóH_/=0î-ßbuiltins_helpë ôthe new-style class _Helper in site.py can be§'sqif sys.T@.no_1"¿áskipTest("needWó module, but -S option was used"mCq# (this±ðissue causing t4…backs inñ # http://bugs.python.org/>õ8032#msg100537 )8ó ‘output = Æ@get_f‡%__j _.l¡)', import W=TrueÉôm = re.match(r'', p¢‹_/(mðmsg='Unexpected render5W%r' %]Ùcýreferential_listG'ã1àce loop involvl a @ñ doesn't lead proxyvalxäòinto an infinitE6:''T š\CGº.¨ð"a = [3, 4, 5] ; a.append(a) ; i"^:EquF„, [...]]fyž5b®a¨b¨(©ªâðdict(self): ñ< '''Ensure that a reference loop involving a dict doesn't lead proxyval òinto an infinitEE:'''" gdb_repr, ¥output = \!H�self.get_$.À("a = {} ; b p'bar':aõa['foo'] = b ; id(a)") PLÄassertEqual(TA, "{;2: {P„ {...}}}?�def test_Dð tial_old_style_instance(#%):ve ç*’class FooN pass foo = () õ .an_attr = foo id(foo)''')��.÷óTrue(re.match(r'\) at remote 0x-?[0-9a-f]+>',Wžçª),°'Unexpectedý /ûesentation: %r\n%s' % pÂv])ó´?new´Ps(object ¼ÿéÒ  9…?`Foo() @ aG7b baSaQ%_z½QtruncÔ r'Verifyl¢very long ÂC is ;/ed1à #ÿ'id(list(range(1000))) ßð"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1Ï1, 12, 13, "Kð14, 15, 16, 17, 18, 19, 20, 2dÿ2, 23, 24, 25, 26P ð27, 28, 29, 30, 31, 3©ñ 3, 34, 35, 36, 37, 38, 39PÀ  ÷("40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, " B ÿ$"53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65P ÿ#66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78P ÿ#79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91P ð92, 93, 94, 95, 96, 97, 98, 99, 100123P 0104&5678N1N1N1N1N 1N1N1N1N1N1N2N2N2N2N 2N2N2N2N2N2N3N3N3N3N 3N3N3N3N3N3N™1š1›1œx 1¹1º1»1¼1½1¾1¿1À1Á1¦N Ã1Ä1Å1Æ1Ç1È1É1Ê1Ë1ÌN é1ê1Ï1Ð1Ñ1Ò1Ó1Ô1Õ1ÖN ó1ô1õ1ö1÷1Ü1Ý1Þ1ß1àN ý1þ1ÿ111111é1êN 11 1 1 1 2 €201, 202" 2 0205+678@9, 2 2 2 2  2 2 2 2 2 2 2 2 2 2  2 2 õ226...(truncated)") õself.assertEqual(len(gdb_repr),( E  1024 + /'^A')) 8ð def test_builtin_method(t!):#Wn , �output = &P.get_Žÿ('import sys; id(sys.stdout.readlines)'ÜñTrue(re.match(r'<“B-in ” Aÿ' of _io.TextIOWrapper object at remote 0x-?[0-9a-f]+>')ãÇU°'Unexpected  öõesentation: %r\n%s' % \>[ ÁS –oframesŽ„ðstack_trace(''' Û³foo(a, b, cÎ`pass ¨ÿ, 5) id(foo.__code__)'',À  õ breakpoint='builtin_id', " ·cmds_after_Nõ['print (PyFrameObject*)(((PyCodàv)->co_zombief+?)']),ñself.assertTrue(re.match(r'.*\s+\$1 =\s+�ÿ, 0x-?[0-9a-f]+, for file , line 3, in foo \(\)\s+.*¯gdb_outputK¯re.DOTALL)-÷'Unexpected gdb representation: %r\n%s' % (|+ˆÿ)) @unittest.skipIf(python_is_optimized(…!"P)ó was compiled with 8†ñs") class PyListTests(Debugger!):¯Bdef ª(@ing(½$, ãƒ, actual/„!Þ’EndsWith(%7%) ^æá_basic_commandcQð 'Verify that the "py-list"ã2q works'TƒQbt = ˆöget_stack_trace(script=bample_RP G•#']Ý5h @P' 5&\n± (6ƒßbar(a, b, c):9795baz9884(9(™z(*args—0>107oid(42)i 11.(2(°foo(1, 2, 3\¤S bt§Æ„¢one_abs_arå‚}_öne absolute argumentá’i/ 9”ÓÁ4twoÓsVÔ>twoÔgNÀ cmds_óafter_breakpoint=['py-list 1,3']) ð self.assertListing(' 1õ# Sample script for use by test_gdb.py\n'N6 N2(3(ÿdef foo(a, b, c):\n',b ñbt) class StackNavigationTests(Debugger!):KP@unitÅð.skipUnless(HAS_PYUP_PYDOWN, ""ÿ requires py-up/py-down commands")Rÿ If(python_is_optimized()É!"P-@ wasX³piled with <Ïk"šc_pyup_ˆ(ÊÞGñ'Verify that the "¿"`¸f works»Pbt = D`.get_sIr_trace(þ=_Ó„_cmds_–Pup', Ÿ up™3n˜ÿMultilineMatches(btG=ð r'''^.* #[0-9]+ Frame 0x-?aa-f]+,ÕÁfile .*gdb_sÝP.py, sò 7, in bar \(a=1, b=2, c=3\÷Dbaz\«s\) $'''^c?ø€¯_at_bottomú±handling ofý6#" ;ï o¢�EndsWithýò 'Unable to find a newer � f/\n¥P up£?top %upž?top›|žB * 5öa¢�'_n oldžX •¦S€up_then_Þ �€followedd4"™Àcript=self.gÿet_sample_script(), ùcmds_after_breakpoint=['py-up', udown'])Wÿself.assertMultilineMatches(btð r'''^.* #[0-9]+ Frame 0x-?óa-f]+, for file .*gdbèP.py, sò 7, in bar \(a=1, b=2, c=3\¬ïbaz\(a, b, c\)k*#10lzlórgs=\(1, 2, 3\)oñid\(42\) $''') class PyBtTests(Debugger!):Oÿ@unittest.skipIf(python_is_optimizedÒ!"P-ó was compiled with <rations"@def j@_bt(‚+ð 'Verify that the "py-bt"V±mand works'²0Pbt = D .g²tack_trace(„=›:/bt‡ET¾ñback \(most recent call first\0ð F¹"º"»PU;7 ò6 à< 4Â3foo<r< !12=!Î�class PyL¸ñsTests(Debuggerð G²J”} _Àck_trace(scrÿipt=self.get_sample_script(), ðcmds_after_breakpoint=['py-up', •locals'])Prÿ assertMultilineMatches(btxñ r".*\nargs = \(1, 2, 3\)\n.*") lð@unittest.skipUnless(HAS_PYUP_PYDOWN, ""¡ requires »ò/py-down commands"¾ RÿIf(python_is_optimized:!"P-@ wasX³piled with <Tationk@def š_@f0up(>!):á Pbt = IJtack_trace(ÉàNéSô = 1\nb = 2\nc = 3ê)Smain(öif support.verbose2óprint("GDB version %s.%s:" % (gdb_major_!, &in)@for À1 in(5`.splits“.� " * 4 +>PDrun_³€(PrettyP¬_TestsoPyListS QNavigX'?PyBCP€Ü[‘äð) if __name__ == "__¥2__"ŽàP() im®d types  � class j(.CCaseô �init_sub4 0" A�¨0 20ial¿‚ = FalseC!\ __'Yc__(cls|(Žsuper().0ç$@cls.V}7Tru|®;B(AhFpass¢ÿQ¼((AUv(g*(B'ÃꘗíOdictK(  =Ô•¯ýg!QØ kw½S ž,B, **H b[2 = ƒÀ class B·(A, x=3): Upass ðself.assertEqual(B.kwargs, dict(@)/ðdef test_init_subclass_error(Hi* AzA_>W_(cls9©àraise RuntimeEc… Pwith q¹R,(s(- R�;B(AN á_wrongá+¯, whatever� �Ý2Typ AÚ*skippedÜÏBaseWithInitÈB, **> ¦ÙŽsuper().5–0@cls.nÇialized = cl½ý©0out¬(¹ ˆì^Uass A1A4 wHIs(AžE, A) (“b 6 n odiamon³«i¦calls = []­¤ALefth] ,oMiddleÈm/{BÐB+= [e ×ORighØKé`cls, r4!=""·Le ¶ A(�", i!, Æ", ä"=""ª ß7!A.-5, [ÚI]7‰:) ¤*jg²�set_name˯DescriptorV<!__>�, owner, P 6û#" =+‹#?! =F  6 = £(MIž@A.d.Y_, "d"XÀtIs(A.d.owneñr, A) def test_set_name_metaclass(self):'+§ Meta(typeIÐ__new__(cls, M`, base s/3ïret = super().= …8œò.assertEqual(ret.d.uO"d")2 #Is/®owner, ret0‚return 0(t¦DescriptorG_?#, c™Ç#" =+¸?! =T �%A(²=� fFd = ³(è{BOA, 0QerrorÓ`@'1/qWwith ¨ðRaises(RuntimeE“z) as cm‹˜êNotGoingToWork"±Lattr~õexc = cm.exception‘úegex(str(exc), r'\bw?\b'sR:‘0×6 IsInstance¡ò .__cause__, ZeroDivisionIXÆ _wrongú08~BpasswîÿI3Typ/oællookupçpresolveD%[]_n� ^_P__getÒ_ Äd�.append('§mAaW = No€(¹2 †NotIn('_Þ _'ïÖ,Ò7  3@ is £ed up in iUc dict'{õ :�init_subà [š á8ef ¶>M*À self.nÓame = name õclass Meta(type):!ñdef __new__(cls,=`, base s/3ÿself = super().> l=°.meta_ownerHAelf. -Ó, +preturn œ ûAò�init_subüë2cls›0 = d ~—' ˆPB(A, ût=’ söd = Descriptor()Bز.assertIs(B‡E, B)‹"€Equal(B.…_, 'd'&H�ŠMt9�test_set_jð_modifying_dict(‘àpnotifieã![]B ô«a_T!, -ªaO‡setattr(&Æ + 'x', None -š€.append(Í{£ EaªIb c  SÛ FkRCountØ , ['a', 'bcd3e']çÌaerrorsgZ My²DFpass«Awithˆ’ÀRaises(TypeE_YÖ]C§(�=oË, otherarg=19=z* s.ûrA("My…Õ", (object,),do è³ nn�prepare_rI³e I¸÷!__ [üþ†amespace†„JDkC"gŠO—Àrarg):  ðsuper().__init__(name, bases, vspace) 3 ôself.otherarg =  *�class MyCQ(meta…=MyMeta,2E=1):5]FpassGiÃassertEqual(R}B, 1)/ðdef test_errors_changed_pep487(Jkq# These2õs failed before Python 3.6, PEP 487£Æ ÆW(typeT¿†£__new__(clFS õ:vreturn ” E=�J=£–@Adict?Ï8Pwith .dÀRaises(TypeEF ÝýÕ -� Í?<(=rÍ/ =FAÞ#Ó³2elf„æ%½ú@� éAt = A'New”ö', (object,), {}ß= ÑIsInstance(t,A'•@t.__žF__, g˜h°Q=N¹=»×ÀT if ƒâ == "__main__"h@unit.¤() import #_ñ_multiprocessing from. =0supE| B.PGOqrI`°.SkipTest("]ð is not helpful for PGO") .‚ .i�!llÀs_in_module_ñ (globals(), 'forkserver')ž''©ç´collectionsîTdeque(5R, seqª4$gc tweakrefDcopy Upicklgdrandomðstruct BIG = 10 p¾( yaSyntaxÃì’yield 1 �bBadCmpAa__eq__: N¼RbRuntimGkMutateJJK!, 6‡, resultT." =%§o1# =:©:Uv.clear(²Àreturn self.ðresult class TestBasic(unittest.ðCase): def  _b(�s(self):ö = deque(range(-5125, -5000))'“.__init__(2’for i in E‡200, 400hl–.append(iY:seversed`-D/0)CHleftGÖñ.assertEqual(list(d), —T˜Ú:!en9B600)C¼q� = [d.pop 6() ¼;U250)]2X/ft�?50)Ž È5^) Uright¡� .".rs(Ž µ) ¶1~ 7u ~81î%™lmaxlen™TòRaises(ValueError,³¿, 'abc', -1Ã828i>Citer�1ÿ&Bit, ±&=3=­it), []'Areprm'„—[7, 8, 9]e'@h9-d7á7, 3|dŸ/10Fs©G, 10áC!7Fò-Pd.ext'w[10, 11`hi [9‹ /J�_[8, 7L”Kÿ¤0&(dÑôsupport.unlink(fTESTFN'pfo = op 1"V, "w"'6try¿~°fo.write(stM*Wcloseålrl+ t³fo.read(), Àsnfinall¡„%�d|510){FNone~ « $, `Qõ, 2, 3, 4, 5, 6, ïk�yÀ sóelf.assertEqual(fo.read(), repr(d)) …finally:–fo.close((ôsupport.unlink(�TESTFN) Cö def test_maxlen_zero(self)c÷it = iter(range(100’¢deque(it, C&=0†I ÛÃlist(it), []‚ªb 2 = fb€d.extendUÑOwW1lefÐ{ tœattributey È").o, Nonen/_'abc'4!Ò4>4o;2;2;0;SWwith „Raises(ADWError½dA ®N[ = 10\count–ðfor s in ('', 'abracadòsimsalabim'*500+rMsAs = s¨ s`letterxSú defghijklmnopqrstuvwxyz'iU,_"s.×QL), ds(s, d, !¤KwATyperF)tõ # too few argsrCs, 1, 2)CJmanyDúclass BadCompareô^a__eq__¹l, othe¥r:± ArithmeticÈ©Œ[Ž,p™/3] U×bT% (˜&�Mutating++¶[d.popcH¥eturn TrueÜKm = {: \§3, m, 4, 5W!m.(T…(~kRuntim�7, 3Z#Þµ issue11004Oð # block advance failed aff ro7òon aligned elements on right side ofFV³[�F]*16)ÇiÂàrange(len(d)):' Åd.rotate(-1)öself.assertEqual(d.count(1), 0<(±None), 16) iðdef test_comparisons(>!): ¥öd = deque('xabc'); d.popleft(tÄfor e in [d,0/$') ¶), list(d)]jn} ãá==e, type(d)== de) andB!==K&e)�J!JAnot(EN$L±args = map( �, ('', 'abab÷B, 'x5w, 'cba'£0x0\ y� #cx == yR x)‡y), (x,yv@D!D"!=_D(< ˆ/< D" ˆ<ˆ">ˆ>ˆ">ˆ>ˆ"BNntai?rn = 200p{Pwrange(nŸúiú ¶QTrue(+d÷ �(n+1) notSdÐñ # Test detection of muta ±during iterèº °d[n//2] = MHÖeCmp(d, False¡Wwith ¦÷Raises(RuntimeErrorztn»>º½` excepÆs¶0Bad³«5oextendT&a't2TypB, d.L', _('bcdJ*dw!'a/zHNDHnõ/adòueZ3f?def× Ed + pIJ¼Te + f~ÿYs1e1£1 ‹bîðself.assertEqualó(d + e, deque('abc')) ñself.assertIsNot.d.) Ee + )W …†7g = ædef', maxlen=4¬h&6gh'Ä´Equal(g + hÄ0'ef.%) nWwith 5õRaises(TypeError):+&9@ + 'ŸMàdef test_iadd(R;d®a­¥d += 'bcd'e9„À‘list(d), \d´Cd?aq)·¯extendleft½ª 5F, d.P6, 1 (ûRü�reversed¸: VdR NJdcbaR€H `¯range(1000¼ =?MaSyntax„ O]fail(Á|getitem¾un = 200"‹‹n†2l =g”for i in  A.pop=50l*(0 ifFúdom.random() < 0.5S?ªd.append(iBlªjªp1-len(lA–FóÒ d[j] == l[j]Ô0—'superman a�d[0], 's$ -1%Igê]FInde#__ôG__, d8,-1 ie GVnVÐ1, 2, 30, 40,Z:, 0*Ñ II#ÀL"d.”Si), i¯)ÁOValuÂ4P$n+ýñ # Test detection of muta ±during iterT:Áø°d[n//2] = MPÚeCmp(d, False"ÒoRuntimÔ Ð# Test detect÷ion of comparison exceptions úd = deque(range(n)) ú[n//2] = BadCmp(ùwith self.assertRaises(RuntimeError):Q|µd.index(n) ó&# Test start and stop arguments behavior matches listH”2ele/Õ= 'ABCDEFGHI'e3non"V = 'Z Vs * 2X1s =q(3forº2in Ió-5 - len(s)*2, 5 +Y ??op >"RB›E 0s +æ m/?try“arget = scR,ç&op3iR Valuf>;<gH�?lse�ÉoEqual(a 1, t&Å‘def test_ܰ_bug_24913(VÉkv'A' * 3Gi½¡þ"Hello world", 0, 4™£ �yðto make sure in*tk!keÿ<si�iŠ 7 .Ð2„ (‰ "ÇÑ0(i, âÛi_d), s^øL6194h@datav?ABCx�, maxlen=8�IIhôs2, None¯1pŽ % ¼�3!),ÆØZ®" Ó:)+1„­¡žif i >= 0¹[zŸOd[i]äe÷>$-1@5ÕZ * n)C0ŸIsNone(d.¶€499, 5001ÉÅ '0‡/d ÊRmin(nKÔÓ.Ž6_bcdef“+C˜sŒ$z�2('aIÕ[-500:]¡!Ðdef test_mul(§'bcƒ( ÿT * -5ˆ*0)1)î'W 2.a±þˆ314µPt(d *EdjXD0) *rQ¸ /ì/m› ŽU-5 * œZ 0)1)˜2.dE314ç ˜", K/=5ð ¢x#bcÕþ »m3*'1¶|setitemºqn = 200,b2hrange( -i- p[i] = 1!iQ ¯ýlist(d), [10*i U]œCl = /P 011-n³'-1�ÉŽà7*i ã l[i] = 7*i ñself.assertEqual(list(d), l) &ðdef test_delitem(3!):Epn = 500 ‘# O(n**2)6õ , don't make this too big@õd = deque(range(n))kžôRaises(IndexError, d._•�__, -n-1;$n8”for i in Žêß’0!en/6n-iE*0j =D‚dom.randO#-l/ 20val 5[j]IsšIn(val, d9_del d7?Not:X Ë0úreverseú>pata = [&]om() ƒ  žLŠdata[:i])r`.Ï   5%d(Z¨ §šs(r, Nonecd{m§EType§@, 1)•û# Arity is zeroØ]rotatÝös = tuple('abcde'ËòÀs(ezs)#d.\�ÿ # verify rot(´’b''.joia 'eˆ't-u t)uûaüÓ_ÿ# check default to 1´cYfD Ý'*3geeeØD ‚i°«3vs.�… n times±TŽj iŒ#e^Ĥ ðúe<V-¨§Ñthat it works�Ž ­r�œ´±�½k@raps‡OwardhOe), ÊU h¨ À e.rotañ te(-1) # check vs. rot€n times ò self.assertEqual(tuple(d), 9e))1¡d.rotate(ihHmù that it works in reverseArskek$-nm kÿraps backaroundkue), s) +§d = deque(�e’dBIG+17•ð # verify on long series of}'atu drYHƒQfor i2Sange(_: g6dr( F¸?.ôRaises(TypeError, ÒP, 'x'Ó@# WrÅvarg typ¿Gÿ1, 10) # Too many argspÐ…(�î#A’ an emptyªÚÀ"d,"#()âÐdef test_len(Â)WúF'ab'Ž' <2$Ÿd.popleft– 818404�ÀUIndexÁ?pop-…Q¿d.append('c÷ ¿:ú/'d> 5OcleaÉ ®æÀŸunderflowÆ2-ï QËœSrË7100B-Y'ïø"d.[ÏÔ\1istÊ&[]J\i!# thl]º©oremove¦Ç'abcdefghcij@#d.9” á6'abFáG#ŒFMGValu3ä/, ¬e/|ð# Handle comparison e–¥£ð['a', 'b', BadCmp(), 'c']) ãe = deque(d) öself.assertRaises(RuntimeError, d.remove, 'c'7õfor x, y in zip(d, e):V]ù&# verify that original order and values are retained.BœÕTrue(x is y) %õ# Handle evil mutator¤Pmatch¥(Bl, Fals©df['ab']æÇ°d.extend([M`1eCmîY) 1¶R_IndexP j9PEqualU°)ôàdef test_repr(0tǦrange(200)ËýQeval(;dGw‘list(d), e+Pd.app A¥In('...', e�·_print¸s:trykôsupport.unlink(fTESTFNe›fo = open&Z, "w"+®÷d, file=fo, end='Qz.close(=hrh �—fo.read()IkfEl/fo„ œ=ini›šË5TypKñ, 'abc', 2, 3);S§:21);Ë LhashJ 1,Õ‰ *ýlong_steadystate_queue_poplefñ3Asize2A0, 1Ù 10 7000nå r:.#0P, popf@W‚2.i|ÂP[, BIGx+Y*(iv0x =o �Àif x != i - \ E"qPx, i-0 l (/8Ã1BIG;ÇžOrighŸ7‚eversed(•Ì©$­©£À self.assòertEqual(list(reversedd))),  6ñange(BIG-size, BIG))) :ñdef test_big_queue_popleft(self):&cEpass µd = deque()°append, pop.#d.R*¤for i in ršhl;&(i]30x =z�I–if x != iÈßE.assbOx, i Mrigh U!,  ¤ostack_,:I J52 6Ÿlen(d), 0;1ù N7"I;38ˆÿroundtrip_iter_initøF200)+e~œd¸#NoS!idºGid(e?*zãM+„:lpickleá±dä'©,:[, 100¹@$eû.HIGHEST_PROTOCOL + 19¦ —�.dumps(dÜ*Yvloads(s1(9Ae), @2 A1Adle3€e.maxlen- _¸Ÿ_recursiv€ d'abc'){;, 3;d´(9£Œ* eº™ DÀ self.asseû rtNotEqual(id(e), id(d)) §self.asser/B[-1]3e3³e.maxlen, d !) ið def test_iterator_pickle(v!):$�÷orig = deque(range(200{ð data = [i*1.01 for i in 9]GPprotoGp÷.HIGHEST_PROTOCOL + 1€„¤# initial ­X@itor¤(w Ksdump = o1s((4,¥1), š 6Vit, d7`loads(= 'Ø@i, x×@enumL e( Ä©‰d[i] = x¾p æ£type(it), 7orgpI 4Blist4{ã*Ÿ# running?0nex<f ™í8ÍC[1:]8# empty:ýúÑb1, lenýþhó[b�xhaustedfíÁRaises(StopI·Pion, Y!, Ò �´Â×ZÛŒdeepcopyÔ0mut²&10 ëäV[mut]H@e = D.Md›ÑˆAd), ¢Pmut[0þ%11f?@i*c, lYþ¶ú2Iö+À 11 óself.assertNotEqual(id(d), id(e)) *'Alist) +,õfor i in range(5):Nfmaxlen$[-1, 6(,Âs = [random.0() Aj<9i)]`8ód = deque(s) if p¤== -1 else,ê?eCn.copy( Od, e'.Š3, e 5 ñTrue(all(x is yú@x, yýAzip(v1)) �def test_´€_method(©X0mutR&103+V[mut]�P2=±mut[0] = 11 ?q4ö}reverseó.s1ƒ('abcd',—W2000) ŸÞZRA)), ÷-s)†L_new‡@klasÛTtype()(_JŒ¼/jZ¥¹ügc_doesnt_blowup½•import gcÖò# This used to QP-failx×A_tra ÷() under a debugEðbuild, or run wild with a NULL pointerS¡a release 4.EÍÈE�;100ö¦d.append(15~¾gc.collect(cüntainer_iterator&õ# Bug #3680: tpñ was not implementedØ' O… objectsÚc3"C( Â6pas* ð2,{obj = CÕðref = weakref.refi šif i == 0Ï*#co4ww[obj, 1O(z> G ‹qobj.x =.(} $0delE%, L‹ Ý£ )ÅNone, "CycleÆ!3ed"#°check_sizeoR0sup..¯@±python_only£ÓF ZÑBLOCKLEN = 641»@base05 = Ypalcvobjð('2P4nP') blocðksize = struct.calcó('P%dPP' % BLOCKLEN) ð self.assertEqual(object.__;ðof__(deque()), base?PchecksG 8aDCq + bloc³ O-7'a's0D * (ãH - 1´A@ |?2 *°€4+E F*43Gð class TestVariousIteratorArgs(unittest.!qCase): X@def B_coní0or(Ê!): Üôfor s in ("123", "", range(1000), ('do', 1.2)Ç2000,2200,5)LPgP@seq_~0s.SVnce, ÂUFunc,Š> *?Gen=OStopA˜itermultiCKfunc¿�" ìClistn@g(s)/ Á<ñRaises(TypeError, "…€NextOnlyYK-oMIÏZeroDivisionœ aGenExcQ›Q>ü_with_altered_data\2d =ô¦('abcdefg'ÄPit = H&(dfd.pop(OdRuntimR›next, it)ñr& _ey¡_on_empty_�¦x�–append(10*¢ÆD N|Spass äpWithBad ) __4,__Ærn mP1Sub{)lbasics\È™(625)¤d.__init__'00`i;s00, 400ûo#d.[iY:seversed`-x, 0yCWleft(G¡º»Ad), —T˜»:0en(93600q¼qA = [¼ 6() ¼JQ250)]B1X/ft�?50)Ž – È5^) ðright = [d.pop() ófor i in range(250)] õright.reverse()ñself.assertEqual()r, list(I¯150, 400))70)d)98!158pd.clear‚ @len(J10) 7ðdef test_copy_pickle(¸"):!ãód = Deque('abc';re = d._>_y Atypez eï+«pŠd0cæ A<Ú ’ [+lóVproto÷ õ.HIGHEST_PROTOCOL + 1):9i3 = .‘dumps(d, M·'@'zloads(s °#NoE!idH0id(¯F.p 3 /  ßde', maxlen=4ÿÞ3¹•_recursiv8\A*=dzïy,‡;, 3uupd.appen$Á oÃ.£ „9+ˆAe), �2 Œ1•3"e.d3, d 5dšWd.pop~³eñeÔ¢R¡ I 0Ge, dý$0d.x Œpì }©".x| k 9³WithBadIter½D ;, 2OÀ self.assñ:ertRaises(TypeError, pickle.dumps, d, proto) def test_weakref(self): õ = deque('gallahad')Cp = 9†.proxy(dJð.assertEqual(str(p), &d))…d = NoneW:Ï„ReferencÔ stÙ Äðstrange_subclass(IÍ1 X(Ñé¼ef __iter__8 preturn %7([]ÁÈ1 = X([1,2,32X4,5,6ð01 == d2 # not clear if this is supposed to be True or False, Œ £# but it u6Ñgive a System 2 S©WithKwargsc__init @, ne''=14D.()aOTeste@unitl. CCaseOq¸p_with_kt Äò# SF bug #1486663 --7úÐerroneously r5 a d æ Èý€nce(seq_¦€s.CommonÅÁPtype2- \|getitemWñ# For now, bypassŠõs that require slicing¸(_&£ ¼`5ŸsubscriptÁEpfree_af|\_atingl2P.skip­²("ExhaustedÓÉÐator doesn't ‰" ao") #=:ƒ libref+õ""" Example from the Library ò : Doc/libòcollections.tex >>>=r importÈ"c²{('ghi')>ˆ0mak12new8 …` three)!msIífor elem in d:GIÃae overÓy!'s8�ents ...:`print(Oñ.upper()) G H Ik¿d.append('j±<Padd až` entry.D©right sideI~left('fM/# I2Hµa# showô representa¬ oÛeY �(['f', 'ghiCj'])µNpop(©"# �À and remove ÿthe rightmost item 'j' >>> d.popleft() ð# return and remove P4OfOolist(dK` # #B±contents ofàdeque ['g', 'h2i']¥0[0]=«# peek at —g—Od[-1B A (iB¶Í(reversed(d)ãÙ!a ×C in >@ ['iÝâgâ0'h'#dâgsearch*BTrueÝ.extend('jkl'šñ # add multiple elemycat oncE ©(€@, 'j­kCl'])q�rotate(1mÃ#o '2ion6blNçg b-c#êa\6, 'ÃmÑ Í# make a newÄj orderÐ#- ß2_cleare£Wemptyßž57òcannot pop from an JÏÁ Traceback (®ð!recent call last): File "", line 1,– -t#Pvel- Ý3ï() IndexError:ù œ\('abc¤"# Á!))s SinputpvcFba™" mð ef delete_nth(d, n): ...»1 d.“We(-n))([" = ÅCdef'Ý o26+Pentry�3d[2ÑÅaÀÅd efÏ÷roundrobin(*iterablesÕupendingž$�(i) for iÁ5à whô: %stask =  <%*ry6°yield next(EbÀexcept StopIÅNtionCIinuem‹ ap \òçPvalueë,j2, 'YHfgh'4Qrint(7§÷ a d e b f c g hNTtree(GGdudNð c0len:> 1í�pair = [Nù,Ž]#d.ü7c›�d©ðprint(maketree('ðabcdefgh')) [[[['a', 'b'], ['c 0d'] 0['efg ÿh']]]] """ #=:ð __test__ = {'librefF' : p} def ñ_main(verbose=None): import sys,±classes = ((©TestBasic,úVariousIteratorArgs!1SubO~WithKwa6requence6!) t0sup¬�.run_unit¬ (*_c#es)à# verify referH‘ countingI if! ñ and hasattr(sys, "gettotalref5")-!gcG#*[TU] * 5òfor i in range(len(/)SEÙ(Ågc.collect()n_P[i] =Ò.Ì/Tprint�`P# docO Afrom<$ _dšu¶9(#,cÀ) if __name°A= "_Ž2__"ƒ5  ñTrue) # Also used by idlelib./  ðconfig. [Foo Bar] foo=newbar # ¸" v¦ñ flavors of legalÿ"il ñfuture statements ”functoolsƒpartial ‹.ž)"dxtwrapddedentE$os òre rx = re.compile(r'\((\S+).py, line (\d+)')âóget_error_location(msgf moMÁx.search(str:ñreturn mo.group(1, 2) P! FB(å.0Cas?aÂcheck_syntaxˆð(self, err, baseý¹Ãno, offset=0¡º0.v†rtIn('%sê|%d' % (G0), ËBerr)Ë GäEqual(os.path.>�(err.fil’)�� + '.py'K:{Â- çïœ0$_o1* Swith 9q.CleanI¢"('1ø'1'2ø©W^-¨&i"*¯.result, 6®2®"2®2®2® 3®;’Àe3'):  ñfrom test import  _future3 $2def3badq(self):#Pwith ö.assertRaises(SyntaxError) as cm37 }Abads4‚']ccheck_"eWý(cm.exception, "A_", 3)È4ÈU4*È$4È 5ÈU5È-_5", 4�6ÈU6È-6� 7ÈU7È-7È?, 5$8ÌU8Ì-8Ì\9ÈU9È-9È?, 0Ë/10ÌU/10Í-/10άparserhackÍ#n¢ that the *B.c::~_5P funcõ` works^…expected³ò# Note: although this]òmust pass, it's noú1ingt‡originalL†P buglÁof 2.6 since1¢tatement iSo˜Xal an—KÜ Òð disabled. If a new keywordOÝintroduced in— 2.6, chang�æ¡o refer to Nàfuture import.# Etry: òexec("from __future__ import print_function;E 0")Cúexcept SyntaxError_Fpass-:lseÁself.fail("sC eDõ didn't occur") B¿(À)Álðdef test_multiple_feaq s()€with sup…q.CleanI‘ ("@.¬'5"7ÐÊ!Ä -Iˆñunicode_literals_  Œ¥scope = {}†'4 Uñ; x = ''", {}, O@mñ.assertIsInstance(%ð ["x"], str) class AnnotaŒ!sF«ÐTestCase(unitê.ptemplatÁudedent(Æ5""" 6ap+>Æf() -> {ann}¶9...*bg(arg:*4;Non33var-FCvar20 = ?Â!š‘getActualS&, Â¥_Ó�2Ç.format(ann=FÆ"¢_ret_ann =äp['f']._´Å__['return']Å<0arg)<g<7arg90var415 m~']['var323 24¢ EqY±í!, ¿×5»121H�Þ¯.„sÓ°, expected=`ó, drop_parens=False, is_tupleLSauXÒ†:3%ifp1 isÓ EŽ' =Àu if not‰W else V[1:-1W(ifÆ `u2NotÁ j³�èö.replace("(", ""))Œ;mj¾ÂÔ1Åf$eqbâHtðeq('...') ó eq("'some_string'") {b'\\xa3i'Name'*L'Non> vœ% finisheGð1 + v2 - v3 * 4 ^ 5n»v6 / 7 // 8bŸnot great~1M+valþ+-A~int§r‚v1 ^ 123Ê | ß �Š(,b†Ïlambda arg: Ä=U;: aXo, b, c%"%q, *, d=Ãëv2, e='str': a^<`varargBBÀ, **kwargs: õbP'P3x: ‹y: x + yÙA1 ifI] elseg1strõ0one)Ž'or0 Tbytes) b#tC(r)z'J "0@Ýx3JRx > 0*-1"l ")D@0/ñ{'2.7': dead, '3 �long_liveߟdie_hard}:&¸ý{'3.6': verygood}O0**a)bc§¡!6'789@4.0'ë’gilectomy#m'3.10'Ron mÂ({'a': 'b'},øl", à , Ó1A, b'À ')-ò (,()/a,/ b=, cº +[]lð[1, 2, 3, 4, 5, 6, 7, 8, 9, 10� or A, 11 PB, 12 cC]") üeq("[*a, *b, *cû{i for i in (1, 2, 3)}@{i ** 2*1, _WXÁ'a'), (2, 'b 3, 'c')l?+ jpjV­[Ò ÷[Ò* ÒBÒ A(Ò)¤(Ò* ÒBÒ AQ{i: 0Ìy :", ÷Mq[(x, y)j 9\a, b)d*( -a,$¢Python3 > ›2 > COBOL‹€Life is  \call(?arg¿kwarg='hey' _arg, %ï*args, another5.A, **rsE]2='hoŸÿlukasz.langa.pl œ.me(maybeÚl1 .rea3?1.0Û....__class__gŒlist[strð1dic\, int"se PtupleN_, ...Êint, float, j 5slice[0/:1/:2:-K11:2(ÅXŸ:c, d:e:f†"(x‹ˆaG@'str¿óNone if sys.version_info[0] > (3,) else /Tbytes8'ùðf'f-string without€Ðmatted values©`just aQKing'Bœf'{{NOT a;.}}+Ysome tð {a} {few():.2f "or‚.‚,!rIð'''f"{f'{nested} inner'} outer"''') ñ8 eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'") Iï{(lambda x: x)!ÿNone if a else 0 ø'(yield from outside_of_generator)')�0l a + bü,await some.complicated[0].call(with_args=True or 1 is not 1K![x%x%aãbã;c)]¨+* (b0c0d0'f(\ayf“ "# <, 2#Ë(((a)))', 'a¯3, b (a ñ') if __name__ == "__main__":—�unittest.¤() import $re ¥subprocessy 1os R K0supSâ # Skip this !õf the _tkinter module wasn't built. #= J.Y!_m/$('"ï R�_2Tcl8©ÒTclError tryÍ_­Dcapi)ñINT_MAX, PY_SSIZE_‘ except ICKF0+ =1õ = sys.maxsize tcl_version = tuple(map(int,&ð .TCL_VERSION.split('.'))) +à_patchlevel = È· def get_tk"()›`global]8 3UQ9Q tceFTcl(ã €2tcl¤P'info·ÀÀm = re.fullm¿¡(r'(\d+)\.q([ab.]) 6', Cv major, minqreleasep, seria©‡m.groups® 8*Aint(1), X %{mð = {'a': 'alphañb1bet . ˆfinal'}[9]sT8if ³'2x( Ï1 = °¦,L5, 0gØQ0LbQlreturnE’ class TTTest(W.qCase): C¥góFlattenLen(self¦ñ2# f�(“:ñ.assertRaises(Type‘H_P , 8+° clž¬ \setUp£xËJp = Bwant½süBelf./F.tk.Às() defó testEval(self): `tcl = x.interp .e2¥'set a 1')0øassertEqual(tcl-@'),'011def_Nÿ_null_in_result�s ù "a\\0b"'), 'a\x00b') �ŸExceptionz"ôRaises(TclError,÷,$q 2r<Üthis is wrongz?Calëc2ÇR','a'¿$ ï 1ñ…p?xp© ã sr7tr�','is','voSetVarè?setvar(tB(¥/ ac�_Array†$?(1)ý‰2þG  Wpg:  „?(1)‡   ?® zûvHï a?Unsõ 1c¶info exists¬TuˆVR#0QÛV\)ã«ýo(2)',2®‡¯ÀsertEqual(tcól.eval('info exists a(2)'),'1') ÷tcl.unsetvar('a(1)ðself.assertEqual(.X6?,'0;!“”�def testU”ÐVarException(�!):%¼`tcl = u.interp¶ðRaises(TclError,Àîa,'a') 6u@get_ILgerslð = (0, 1, -1, 2**31 - ", P2**63 &63vð2# bignum was added in Tcl 8.5, but its support is able only since(!.8½ @if (Áõtk_patchlevel() >= (8, 6, 0, 'final') or9="Ÿ5, 8) <= Fu O42.07 ÄÜ!, Äy?¤&(TDValu)),¾E-°O'42\ ¡(UnicodeEno t.@ud80x§§#odouble& üKa' 42 'eŠ6$.585Â8B42.5l42(Àises(TypeErróor, tcl.getdouble) ý self.assertRaises(TypeErr4ï, '42.5', '10'B#bC= /cl~au ¸DValuÄTP%),ôû é\å ¡(UnicodeEn1y3@ud80}±ðdef test_getboolean(µ!):Å`tcl = ¥.interp.tká3Is(éI¯'on'), Tru211/42a�0), Fals‘¤ÒZ Ù5 , Øb @bA|$?1.0: ÀÂu'Ol/onY x�EvalFile  öwith open(support.TESTFN, 'w') as fSW:0ddCt%up7Šunlink, GÄ<õf.write("""set a 1ˆ=b 2ùc [ expr $a + $b ]#6"""gËQevalf Ó%ÄßQEqual6 ('„oa'),'1ö0b020c0A3') ÇË�·ÿ_null_in_resultÌ�ÇÁA} "a\0b"b ÁBŠ 'a\x00b—Àf.assertEquað6l(tcl.eval('set b'), 'a\x00b') def testEvalFileException(self): %ñtcl = self.interp?õ filename = "doesnotexists"#6tryJ4¤os.remove(>)-eƒ ŠZ as e?Epass0”ôassertRaises(TclError,e,¨ úßPackageRequir!€2,'pf" rgD DNEƒP@unit„ó.skipUnless(sys.platform == 'win32', '©¢s Windows':ɼLoadWithUNCÃñ# Build a UNC path from the regular.[÷# Something likeó \\%COMPUTERNAME%\c$\python27 B.exehõ@full�` = os.€@.absï¢executableÒ34if 6ª[1] != ':' rô DñSkipTest('AbsoluteÔð should have driv#rt=kCunc_žør'\\%s\%s$\%s' % (os.environ['õ5'],EÅ0193:]5not>g(º)0CanF¡connect toDPath“Çâwith support.EýámentVarGuard()™*nvvöenv.unset("TCL_LIBRARY"Ä\`stdoutPÿubprocess.check_output(U[éP, '-c  imž1 tk“ƒ; print(3)']ësº&SIn(b'%2', �+G¼_exprstringG o2calo Va', 3û Vb', 6 }(~¬, expectedÙ@esul>P*¨ M õqEqual(r;Z iÊ¥IsInstance43str% [v2ypew ™”a5 Q, '8.ñ'+6¦BbC? + A . ·w, 'spam}œ'Ú018.2l~, '14.2!p3.1 + $N'6.1!@p"$a.$b"d(5.¹}ð4*[llength "6 2"]*8LÀ check('{woó rd one} < "word $a"', '0') ïcheck('4*2 < 7Àhypot($a, 4)#/5.CP5 / 41_!.0?.25!ñ( [string length "abcd"] + 0.0 z1>P20.0/•O, '4œ±"0x03" > "2£ |À\xbd\u20ac"]¹3¶/r'5 'Ö…=abcS7'"axw .r/ "0b}W\x00bRõ)if tcl_version >= (8, 5): # bignum was added in Tcl 8.5JQN@2**6 Astr( 1)) (ñ def test_exprdouble(self):C`tcl = x.interp¡.call('setF', 3Ë:tcl Vb', 6 }¡~§, expected}�€result =.*¨ M*¥ÂassertEqual(;Z¼ /¥IsInstance4Sfloat' .ûRaises(TypeError,›–’5 `, '8.2G'+6BbC? + A /cl·w, 'spam}ž0'',ñÖ18.2lm, 14.2€3.1 + $aõ-.1<Q"$a.$'5.`D4*[lz16 2ö=8.0J{LY0-Y Y5A;O', 1W ©;U<S4z Q� 3WQ 5¬kw$ðAÄòOlongðMÀ) de÷ f check(expr, expected): Ðresult = tcl.*Along3)(òself.assertEqual(9X/¥IsInstance4Uint) 0[ùRaises(TypeError,—’3ß, '8.2', '+6'@"bA? + ? /cl±w, 'spamy’V'', 0Ž18.2hM, 14Í3.1 + $a', 68½"$a.$b"', 5 ý4*[llength "6 2"]', 8&á{word one} < " $aQ«4*2 < 7ÇÏhypot($a, 4)Ž�5 / 4', 1‚/.0¤( [string ÎÐabcd"] + 0.0 oUa20.0/5VW°"0x03" > "2ê> q¡\xbd\u20acG3Å/r'3ÈIW"abc"J ifà_version >= (8üõ: # bignum was added in Tcl 8.5w€c2**64'·�def test_2€boolean(M^`tcl = u.interpzk�call('setœÖI bö~4ƒÛ ©6· Þ4V<?Not™Z4046eanÈ6)y/, %AVFalseÛ�for valueÈ ('! 'f#= noGoff'}G#8+, R ‚'"%s"' %a) O{%s}) ¤1•@true0yes/on£ 7Truô¢(ð{%s}' % value, sTrue) ÿcheck('8.2 + 6', �3.1 + $a ="$a.$b"#ÿ4*[llength "6 2"])á{word one} < " $aWNFalsº¯4*2 < 7', Ïhypot($a, 4)s_5 / 4 /.0 ¤( [string âßabcd"] + 0.0 xo20.0/5\°"0x03" > "2› z¯\xbd\u20acd/r'6ö%self.assertRaises(TclError, tcl.exprboolean, '"abc"'c if%õ#_version >= (8, 5): # bignum was added in Tcl 8.5¤«¨F2**6ª"þ @unittest.skipUnless(tclq±, 'requiresd’38.5²@def N_Ñ s(þ!):lŠ`tcl = u.interp;¨§, expected=A€result =p.call('0'1r8,<Û.wantobjects(N&� bEqual(cQ‚¤/3¥IsInstance8:intˆFelseAEn=(Î�, str(int„*))T B‡'stZ_'trueŒ?yes/onfW?/no?off_1 < 2r11 >±œ<w=_zPfor i;’@get_›=ger/}° £"ifé€ ~iðw qÃfq<<¬!…�/ô$, õµª2**1000)) Ýpassing_valueŠ4"V($ ðreturn self.interp.có all('set', '_', value) ðself.assertEqual(passV%€(True), A if *ÿwantobjects else '1')M@FalsNO0Oµ'string'), ‡-g\u20ac>DG\x00€@D\xbd†DH ÐJLb85'),3& )È5strONCmXSc0\x8Z7~ -‰ WV�"bdã3‰)… &.‚for i inZùget_integers():t«0i),EŸfstr(i)tðif tcl_version < (8, 5): # bignum was added›Tcl 8.5Ž 2**1000), yófXp(0.0, 1-?1/3v€sys.floaŒfo.min, /ax:-'; +axké Œý�Vf), fñ.(Dç*f)KšFf = ¾OW'nan'�¾#Noöf¶& [Ainf'¤ "('*-E F< ˜I ù�CŸ K •:), ¦Vð# XXX NaN representatdòcan be not parsable by l* ØÒÿ(1, '2', (3.4,))  ð(1, '2', (3.4,))ó if self.wantobjects else '1 2 3.4') )õassertEqual(passValue(['a', ['b', 'c']]),7>(-(-/))†¡a {b c}') Pðdef test_user_command(™!):!fÕresult = None;‡func(arg15’nonlocal >7k = argIturnŒä.interp.create¦'¹~!',Ä ]‘ddCleanupÔHutk.deleK&, LBápcheck(v”°, expected=�, *, eq= Å %if71 isBY Y1 = k I’ 62r =‰;Fall(æ,ií‡˲IsInstance(­Z, str/%eqÁ !PK`Fƒ÷float_eq(actual' InSAlmosT?<)=O ¥delta=abs(რ* 1e-10@($‡True, '1à@Fals0'stringO\xbd^u20ac be$, _¡#À\xe2\x82\xacwž ;(bd3¹ b'!  •O\x00  Û#4strËq\xc0\x8Ž13 + ? K‚for i in®@get_²[gers(K®i?6(i)Cðif tcl_version < (8, 5): # bignum was addedjyTcl 8.50]r2**1000c i¬fBp(0.0, 1O-1.0©Ÿf, repr(fA01/3>Asys.¢¼_info.min, /ax­-'; /axœ2eq=y&eqJ`('inf'2)-*À('inf'), eq=³float_eq) ñ!# XXX NaN representation can be not parsable by B(@Ícheck((), ''à1, (2,), (3, 4$€5 6', () ý1 2 {3 4} {5 6} {}B°[1, [2,], [BB], 'B [] BÛñ def test_splitlist(self):ü0 = µ.interp.tk.-Ncall(#Dõ assertRaises(TypeError, R#0—, 'a', 'b:2m •cases = [³0('2‘;)), {}>'',/""áa\n b\t\r c\n 'Ú], 'c'L/b'2–'a \u20ac]]¿ \xe2\x82\x2´\xc0\x80b c dkP\x00b§c dÍr'a {b c9÷ ôwr'a b\ Áb'((,  Â"a ßt2™=2£U2+b'a 3.4èã %G 3.ä Ž&û f"[] �"['W'ïY †� ('í`', 1, Õ] (3.4ªú "2 if ùwantobjects else™: '1 Z'].Àtk_patchleve=Iget_F°if tcl_vers|‡>= (8, 5¯x!if�¥9or Y" = (8, 5~Lnif notyò or get_tk_patchlevel() = (8, 5DSí.ÉUocreate8 9'";|nif notò or get_tk_patchlevel() <ÁÄLð# Before 8.5.5 Çðs were converted to ús through stringc4 ö_ = {'G Lɲ¦ ^/, à `zVû(jP,Î#[½new_tcl_obj]¯�4TypÐ_oðTcl_Obj) class BigmemTclTest(unit.bCase):¤�_setUpv¦s = Tcl(³ñ@support.cpython_only @fñskipUnless(INT_MAX < PY_SSIZE_¦, "needs U"ðMAX") @suppðVort.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False) def test_huge_string_call(self, size): +Ñvalue = ' ' *Fñself.assertRaises(OverflowError, !pinterp.bA, 'spÁ', 'index', aQ, 0) YP@suppâÂcpython_only@unitòÄ.skipUnless(ø±< PY_SSIZE_ ¦, "needs U"BMAX" jL2L�builtinsPItk =!tkÞQ lO1' +r"“tk.getintXê\Œ­ ;odouble>%boolean?"Oeval9&/fiµ$orecordx"@addeèOinfoA"csetvar;0, '?'a'´E>A/, E$unGB‚=„BJ.BexprZN€?Olong=&ø)�splitlis³#>¸"Äcreatecomman_, max<LdeleGË‹6Ë2̃# These Eðs require largerˆñory for possible 3• messagesû Àe = '1' + ' £' * size ÿ%self.assertRaises(OverflowError, tk.evalfile, value)=�unsetvar=,5'x'Bñ def setUpModule():”òif support.verboseì¦tcl = Tcl(À÷print('patchlevel =', tcl.call('info', !B')) ”test_main}z€run_unit!ò(TclTest, Tkinter cBigmemñ) if __name__ == "_Y2__"¿JP() imß¶ contextlib”llectionsdpickler ”sys from § Vž`Case, Ùð, skipUnless, Skip ò, expectedFailureKDcopyG `, deep  !dtyping#ßAny, NoReturn!ÿTypeVar, AnyStr#ÿ , KT, VT # Not in __all__.0�Union, Op%/al#0Tupç Li³ MutableMapº/@Call#ÿGeneric, ClassVaÃOcast=Óget_type_hint­ A"no!ycheck, Ÿ_decoratotZt?NewAamed9€IO, Text�BinaryIO( Pattern, Mp—4abc âtweakref?4est=Rmod_g_°s_cache cgP Base¦Æ( 1): 6ëQIsSub2(P, cls‚ass_or_tƒmsg=None^F@if nj$ss@:04ñmessage = '%r isB$a B¿ of %r' % (LºGdif msgDœ"o�+= ' : %s[9msgIrì ü".fÇAExce(A)5?Not8)i4*0šRclearšsaPfor f«î ._-JnupsÊ f(i£ƒ EmployeÍEpassð„Manager(#i $ÀFounder(Emplñoyee): pass class ManagingFounder(Cer, 4ÐAnyTests(Base 0Cas]^ódef test_any_instance_type_error(selfVŽPwith ð.assertRaises(TypeE0+/$isT®(42, Any) x1subßx9TP(EmplO~–ÉQTAny, V Ï=rep4/aEqual(% ì, 'typing.Any'L�s‚.¹‚°Any[int] #Êð is not a generic 7.àucannot_… %ƒ'0 A(=È+ Z$Ä_¥S` ¿ßæ_tiate°,QAny()dvŽ(Lß`works_S]_aliaZñ# These expressions must simplyíUfail.Ÿ½¬Match[Any]Pattern"IOÜ€NoReturn£­ 1nor+²O• P‚Ù¼LˆÈŠª(LÆ1L)Ë Ð+%,c�qRr’–Ððtype(NoReturn)):+ Qpass ñdef test_cannot_instantiate(self):'@Pwith ÷.assertRaises(TypeError+/¯NoReturn()B%Ttype(GÀ)() class sÐVarTests(Base kCase):Ö¼basic_plainÏ4T =IF('T'¦Ñ# T equals itðÁþE"Z(T, T:bis an GTce ofeE1IsIp!ceJ{ypeVar)Ä3var›0ce_ _esÔ¼$isÁ1(42ã¾-‚“1sub’“RmA(int”fÝJlT, intq¿constrainedgqXj#X'tºXó½union_uniqu‡ N~YgYѶ2Not¹FX, Y;"U�o[X], X&H) O, Y]3 Y/, \03], a^ ‘ 5?int7 •(Ñ.__args__, (XG)Ð;”parameterA=3Is(Ïb ].__originw •› üAÿïA', str, bytesÀ 2A1g,A]�Lreprt 8%hT), '~S(K)K*V*V*aAnyStr� HT_co%ÿ', covariant=True,'Ý0_co_+>.Lntraae i4m-^'–çno_redefinitioåÀ self.aø ssertNotEqual(TypeVar('T'), 3) oself.a8ª, int, strB!) Mðdef test_cannot_subclass_vars(g!):)yPwith {aRaises±WError+/I! V Ñ #'Opass�0_itz“;Ž¿instantiate1ÙLA')(Žpbound_eU†-hAX', X6=42JÔ N¤str, floatZŒEmployeeÐÏno_bivariantÃ_ValueWƒcT', coVP=TrueHntraB) ŠðUnionTests(Base kCase):~]basicwAu = B[\÷]œÉ"u,1 dàö$isO(˜£ß&NI1N1œ?Ostr]X1¦S°—ÛuøL_anykÓ?AnyÌ’fu, Any¯*u1  >%u21Any‘[*u3fobject G{G1, u¯!h1 %2%3%A¬D Ì ", $J DM Pê0N‰IX2± }ordered  &ÏÀfloat, int]  ð self.assertEqual(u1, u2) !ðdef test_single_class_disappears(?!):,0õt = Union[Employee]+jdIs(t, # l4basjLkeptdudŸ, Managerm$NoÚs®–$n(“ß, u.__args__)Â#n(t +,6u _Ʀint, float¿väuµµµ#v,wM8 aLrepr� S%̱), 'typing.'Œ'inÉWuSF[%s.|B¨' % __name‚pé3Çp?u]pïT = TypeVar('Tù0T, °[þ V¡‡ Oint)EAListITO ™[¦ G'¡cannot_subÐ Wwith ¹pRaises(WErrorðìD1 C(  EpassÊ\$CtypeabD¾|o, str]fÉàI¿instantiateL,†(/'E 5 kcuY;ž intxÑI}P[fun,2S]), 'v˜'Ì_str_patternõ)# Shouldn't crash; see http://bugs.python.org/issue25390*A bstr, PgÀA2_etree†uòs://github.com/|/îUs/229ñ# (Only relevant for P²6 2.Ã6trynû‘from xml.‘ó.cElementTree import l�except I& SrD¹ SkipTest("T noœFund"•¾g , ›- ’A´<.k(*args£dreturnµ#<liQNor sÿ� this c”` TupleÄQs(Bas bCase):O‡ÎlbasicsÍ[Tbx(x,îüZ'tÒZÜ�A TP(*WTrue(³/Y)Ú@ 2&TP/Oeji¬M(!]K ~ 1,æ6Ànt, ...])  õself.assertNotEqual(Tuple[int], , !) 6? 9a...]) : def test_td _subclass(N!):#a1 My~(,"Epass/>ÅuTrue(isYDÉ)‡üinstance_type_error’HwithôÀRaises(TypeE0 Ÿ$isTs((0, 0)�VJ3IsI‹ 7 ·=rep¢Ç%B±), 'typing.'Ç 6L[()]:>®int, floatFNI ÌR'&É \ÊL#42Æ?M0Á õñCallableTests(Bas kCase):DòCšLCô(lambda x: x), ¥[½ÑM# �|eq_hash‹^³Ž¤3E_len({J_}), 1òGMOstr]H+Bƒß�G•+]E/ Ïrcannot_Y\tiateô¡(ëBG)H=c =%¨¡ic\;¤c�à def test_ócallable_wrong_forms(self): Pwith ÷.assertRaises(TypeError+2CSÏ[[...], int]L./()I4?[()”5¿[int, 1], 2á/&'•def test_œÝinstance_workŸ0+f(…ApassN’¼3IsIMD(f, «)+7Not.HNone12{«`type_e O5° qßP[[], Á]édB?Anyc2{ Í;jÓ îLreprÖUct0 =Q¥Fbool¦aEqual(Fäct0), 'typing.�?'²9ct2b¬str, floatÑk2k H tvt�..., strÖvk?:') Rë—…_ellipsiê,É;Voo(a:jU/T]8 Aget_¢ðhints(foo, globalsj1loc %),C N{'a'‡}Ú̼_in_generic;ò"# Shouldn't crash; see https://github.com/python/.µ/issues/259¦e.List[M"¶�] XK = »�Var('XK'ѹ, bytes) XVVªð class SimpleMap«"(GÌp[XK, XV…¢±__getitem__ëö, key: XK) -> XVZ6... ?__s7·, value: XVæ <:getk�, default6! =þÀ ...ù class MySimpleMapping(ñ[XK, XV]): def __init__(self):¸.store = {}1sgetitem4§, key: str>vreturn EX[key]EsEw, valueL E" ="M1get¾Š,Ûˆault=NonL6tryãç©ÿexcept KeyError<0defkƒðProtocolTests(Base 0Cas‰`xòtest_supports_inà ÷±assertIsSubà€(int, tyÜ#.S>AInt)X².7(No:?str:;“Ofloa•+ ]FA™$<› coãxõÌüƒ# Note: 0 itó doesn't have __1__._9\* Cß.n0B"0j‘v.„»C"CÈ$$>Ç® TTbytes¶$œ$" B ,hc?b'' BBÁ$<÷%ab­´Ú?Abs—í¨7¨:Ì\round4iss2ÃR6Å ;(t< ¬reversibleÎ6lis>R= “Ï9 �púð_instance_type_e; ¢Bwith )±Raises(Typek £$isT#(0)Àg.SupportsAbCs) õclass C1(typing.SupportsInt):&-ú def __int__(self) -> int&*•return 42@fK2(C1VFpass'f = C2(žhò .assertIsInstance(c, C1) WðGenericTests(Base qCase): [º²test_basics¾·ÐX = SimpleMap¡[str, Any]?Ó‰ö Equal(X.__parameters__, ()¸Wwith 4ûRaises(TypeErrorXrm>!V, strCYÔ+XK#ŸÓYÓ7XK,ÖY§*> „OSM1 }6intÍQissubZ(SM1,ܤ\]SM1()4Ggq _eË O@T = évVar('T'qSSàð7[T]*D&/[Ti&‰/[SE&©6 C(M&, a): ...‡æ4isi4�[], List[Z”Q[OlistS13Newõ ú+V+MyU6[T]^/S]d;_aÀ?Linit„5W/, ñ01, SHÙ_!`è’Xh™7[T]$ã'g%itKû__(cls, **kwargs26Žsuper().:5À)  ácls.attr = 42 å class Y(X):Epassñself.assertEqual(YJU, 42)%Wwith *ûRaises(AttributeErrorfXHCE = 1j< = ³;Z(YM ³Ø�W(X[int]* ³ ÝÜ $Z¹  %W%Ñàdef test_repr(0™ e%ñSimpleMapping),G  ""<ó'a.0_ty5.C6'>"³s)My2u# Ew½_chain öT = TypeVar('T'°SAS') R ü¿C(Generic[Tó/õX = C[Tuple[S, T]] +X,+�,#No/gT, S]]¦�Y = X[T, ”r&Y,&m *SP*hT, str’`Z = Y[�#Z,#b 'imK 'T„FðTrue(str(Z).endsT(OéC'.C[Ø¿2str3]')kc?newaUaàU', covariant=›ŠÎOǃList), '»Ø4É 7O[~T];+U]r?[+U;RS][T]: ~á* �· ¦0_coìxT†TSOŠTë¬ _~TS, p�aT, TS]=Y>  Õ1inty¯ fÖÀT, T]][List[—int]]), Ó'typing.List[ TTuple :#, 5]]'L!) ñdef test_new_repr_bare(self):"|õT = TypeVar('T')(Ð.assertEqual(Cä(Generic[T]), ±?~T]A¹š_ProtocolJ Lƒclass C(>õDict[Any, Any]): ...¹õ # this line should just work%ÍœC.__mro__2Odict)L�B`dBpass”fb = B(i¥b.foo = 42R |@b.__•ó__, {'foo': 42}¸V…@C(B[!á �Wc = C�Æc.bar = 'abcF „c„Rbar':3‡qÒsubscripted_g1Ïs_as_proxiesZ³Ô`+T]Øx¶?def¶CP.x, ')w à"C[,]-schangedw E(v 2strs.!C[á"0].zz?newv @z, '$r U(&].1~?C()Ï]³/()_Ö0D(Cû)ú ¡DË+.|ODEæfrom derived zPai $x$ hCr– SDS ‚Ò D[oZ 5#z'!šÿabc_registry_kepæ7¶ðC(collections.abc.Mapµ(, ¥ �"C.roer(intÇöIsInstance(1, C$’š3)._æWclearîC scaches_ð # To keep refleak hunting mode (nÄM‘false_subØ3 My#Ð(MutableMappióng[str, str]): pass ÿself.assertNotIsInstance({}, MyMapping)0ÙSubclass(dict23ðdef test_abc_bases(r!):„>³ MM(Mutabler²,0R±__getitem__O7, kR&¿return NoneBsB?, vE -V€?del€;Citer¸pµ%6(()x{?len?0ñõ# this should just work ÆMM().update(n¤,ú, collections.abc.¸D4 Ž{OLista -»1M) å°‚�multiple‡ 1ˆúÔ­ þå/2(> *,  ^®²Equal(MM2._èO__, uŒGeneric)3BorigGg¯öT = TypeVar('T'•ê@C(ty8R.DictÅT{1...•! ¶FC.__r¹F,¦ýnaive_runtime_checkf(¨%‡(obj, tpט0# CC` if a .ðionary conforms to ×J typYúif len(tp.__parameters__) > 0i`raise »õmplementedError#&1if Qnargs__FPKT, V�& AEVMall( 4isiø·k, KT) and veæ4ðfor k, v in obj.sL(>ú]True(™�{'x': 1},d7ingGGint]KOFalsLo1: 'x'LWwith QR /s(¡ 2Àt#T]e–g‚™$n ± ˜Bthe KÀc class  óif not hasattr(obj, '__orig_class__'): .ù raise NotImplementedError*ºreturn obj.Se == tp,iõ Node(Generic[T]): ...$òself.assertTrue(naive_g/p_check(B�[int](),O /))EOFalsF?strF8GList‡Wwith ÑRN/s(O {õ˜[1, 2, 3]ó óBdef 7“list_base.ì+tpc0# CL@ if 1ð conforms to a ÉA sub²dìôall(isinstance(x, tpý|Âs__[0].__arg žGqfor x i@%z0 C(Šß(Ëü5C™”  >°'a', 'b'], ? iñtest_multi_subscrt(WgöT = TypeVar('T'ÜUUVV |T][U][V:$AD(C,¿['¥aÿ Equal(C.__parameters__, (V,-1D1CÁ6e 4 huo, (intË f2.á0, (2#, ÍÏ !._$`!C,u:q§vßà ”., )EØÒ�ipt_metaÕM3Otype×E[.!],% $ §�Union[T, ù.", G@àCallable[..., 3Ÿ², (Ellipsis)�lhashesüAÖ-çâ.B.!OW S .Àual(A, A)  ÿself.assertEqual(mod_generics_cache.A[str], !) L= O�B.A, B.A#W@B.A[x%],^f; %) <š#Noì›$fÐ5 7-n7p Úl¦ŸÁA[List[Any]]Õ: ÊBy?º&?intÄÁ Aý¥ #z bTuple[Y2], Bé]Œ -� B§H PUnion%, ‰ã'Ÿ C+Z‡¼ 3y%õtyping.FrozenSet_| 6™Lõif sys.version_info[:2] > (3, 2):*é~¤True(repr(Éôó.endswith('z6]')sN «PRÝ_• €Cˆ+Ï ŠEŒµõdef test_extende _rules_eq(ÐãöT = TypeVar('T'�UUA x `T, T][�Pint, U <Ä—Iterable[Ld][T], !Àterable[Tupl³e[T, T]]) õwith self.assertRaises(TypeError):+2ATuplE…int][()]I% U]”U...] L�°Equal(Union(wV, intÇ2‚U][int, C ]str]]Mõclass Base: ...—€Derived( )!†-"][„ #, G‰ ŽYdT ?][1V ÀCallable[[T] [K'KT. á-Á..., List[T]r?], »PÜQ±1U][vT¤R-"[]:�ðdef test_extended_generic_rules_repr('@T = ?vVar('T'É(fÖ>°X2õ ]).replace('typing.', ''),éŽ 'J�àRƒ/L…ÚÒ…OptionalL! Sÿ@None¡/]]— Þ’*Ni+')md¼forward_refe™’foobar(x:xŸk'CC']]—¸/CC­ [òget_type_hints(lñ, globals(), loc ”H{'x'’UCC]]}['Añèö`barfooö+ATèa;Is(Â8–['x'], ATŸC† Ca&T]ó�2�C� 2‘ ,CTˆ1subå= (3, 37¦ðUúb[÷v Æ3ýÀ= B\!) äìPtest_î³repr_eq_anyø$hóobjs = (getattrßÀ, el) for el:“_N_ª"0obj#I o�NotEqual(Š–(obj), ''HŠ/,Pobj, ,­'4if ¬!ñ'__parameters__',Ì�) and lenm.#j) == 1¬Z�À[Any].__args©j(Any,)¹Ðif isinstancepk, typeFb/Cbase0Ž.__mro__‹-� ?B@48H0 ,  lpickleÂglobal C # "ó wants to reference the}fby nam?óT = TypeVar('T'u›J�B(Generic üBpassÀ/2C(BÙ+ V = C(˜¥c.foo = 42=Õc.bar = 'abc'“Pproto”brange(ôû.HIGHEST_PROTOCOL + 1Ô3z ="¡.dumps(c, M‰Èx'zloads(z ²x¾O, 42(Bbar,Ò+`__dictÅò{'foo': 42, 'bar':C}D`sampleô, Union, Tuple, h0, CEVar,Qñ5¼f, str].c[List]O!0...!1allÁW™], bytes]]À typióng.DefaultDict, typing.FrozenSet[int]] õfor s in samples:!Pproto"úrange(pickle.HIGHEST_PROTOCOL + 1)=ACz = 2‘dumps(s, Q)h+x+~loads(z$ðself.assertEqualOx'Smore_Év = [Lis…Iterable`Type, $,’–C0[ 0MapW]M€AbstractbPTupleTo, str]nª 6s”-ðdef test_copy_and_deep (ª@T = @vVar('T'³ñ class Node(Generic[T]): ...c€PhingsÑ�Union[T, Å", i@Callâ¥[..., T], Ž]7X\I¡Any, Any],‘[Bš= S*V &<Ë,´o:“)T¯CF0Var;÷Ý4T]]+Ÿ'T', 'T']Z]#”>.F÷[% It't®0+ [ð Ý À1t, /&t)“)\-o€öimmutability_by�| Žñ# Special forms like ÿQ’, etc., g‘ó aliases to container5#L## !B0and;ðe variabcles areGƒsidered »Qle by  5¸àglobal TP, TPB@V #¿_:)TPkPl:TPBÖB', bound=int�:TPV(V(Aytes—)¬Xô[™T¥?AÁŽžÍ]T1Is(NVX), X§RQ5Is(K*‰’ Ê*X)fø# Check that localûú py¤Û)TLmL±L±L±ÀTLV = TypeVaór('TLV', bytes, str) ðfor X in [TL, TLB5V]:!(ö self.assertIs(copy(X), XG&Hdeep*Q�def test_ð_generic_instances(i)| T = TypeVaÄ'o’class C(GB7[T]6Œi�__init__Vö, attr: T) -> Noneg1~.'! =. ´†c = C(42‚,REqual!c)@/, + / TIsNotZ?, c%T )c‘E = 1Í» 1fåfX', . ci&_[int]+i,0 Y�(ci), ciÉ'É +!ciÚ2’ ]jZ 4 /¡ci.__orig_äQ__, CS)ŽÙB±weakref_allá7ð things = [Any, Union[T, ³ò , Callable[..., T], Tuple,UAny],CÑOptional[List©Ð], typing.MapvA,‘re.Match[¥DAIter•Å'whatever']]ˆ¾t¾Ú Ó \3Ì.ref(t)(), tVÿparameterized_slot•8_Qó__ = ('potato',ƒOg·tU*.?E = 0/Wwith ÷Raises(AttributeErrorAŒy.tomatobI"H_intM°Ìõfoo(x: C['C']): ... ²ð get_type_hints(foo, globalsÎ1loc `)['x']9&C]M N+]%, ¨m¤p__dict}Ð/ D´â{'banana': 42}û–fd = D(Õd]e#](µà d.banana =ƒ 'yes' ëd_int.banana =õwith self.assertRaises(AttributeError):MT€d.foobarM&noiL"� Pm def test_e‚ s(¤ˆl?Typ³ñ B = SimpleMapping[XK, Any] n×÷class C(Generic[B]t!Bpass7¥lrepr_2¥ NTNJXã‡õEqual(C.__module__, __name__)²1:),)^ 'áaTests.hÃÆ..C'i¥X = C[int]S |X­qò(X).split('.')[-1], 'j"')d¸I"Y( “E Y˜1E5YÆ*Leq_1( Lž#, Š+5[T].?[T]12NotXV([K5V6߬ԌA#Õ »B/ àOA, AÎ OA, B"íA%"1, B=íômultiple_inheritanceÃ* , R : « OKT, NQC(A[T`ôV=!, Ó/B[K jn parametersr(U)� „_special@S = ™gVar('SW ‹S]): ...UaC(Listë #Ç1mroÀ¥C, list, B)�, objectÒ�init_sub•Ü_super_calledÐ"õ FinalException( ž ; Y*__„ú _(cls, **kwargs) -> None:bàfor base in clïs.__bases__: 0if ð is not Final and issubclass(!,)FYRraise&‘Exception;)yôsuper().__init_i¶__(**kwargs4ƒÿ Test(Generic[T]ŽEpasslðwith self.assertRŸ!s(á  ÏlSøu "égA_[int]lÔðdef test_nested(Û1): –CG = !ѰVisitor(G[Td37†a = None4m1seteo, a: Tœ‚.@a=g=7creturn›:v­yn) -> TqACV = êÁ[typing.ListZ]h0Int0((VJRappeni�, x: intÏ.-&x)j h× a.`([]D1&42rÕ€Equal(a.o£), [1, 42]„Å2Âtype_erasureZUóT = TypeVar('T';)GNodey cÅ_Z¹, label: T,gQpleft: '[C[T]'‚1Origh2 �`ƒ" =‹@ # =: T’.0eft-,O¿3al[¥]<™2 = >?2^foo(xT0o&(xìÔb!\de[T]c=AnyÞý0Is(P(a), c a)b)c) £•+, Ü{)/b.)c)^Z+kÁimplicit_any¦9 Cýj¦/7D(C] & ð÷D.__parameters__, ()…ÆÁðD[int] wi÷th self.assertRaises(Exception): eD[Any]/wi>1T] =Ðdef test_new_F`_args(‰"):#vûclass A(Generic[T]�Lpass/B³k_h«_(cls, argFkÑ# call object¤çobj = super().O)+`.arg =i `returng·Ó# mro: C, A, ë@, B,&�kC(A, B ¦ = C('foo' \åpEqual(c§#, 'ª,—2˜iainit__2kŠofrom_a&� ‡m)LIAI#k[T], AR #__a²ÎcÎ niX Ï¡ÒVÍQÐZ» ÷*c*‘ïú/no�2Ø\›TypeErrorrA²‘¼ñÐ E7> Ë-ub = 'b'™fÎD�|m  E`øA<Ü(!¬/'c(,Ø5arg«˜Õ b,§ô Ðýbc') cChÐVarTests(Base DCaseŽN Ubasicª�ëp/[1L.C�int, strJÀ ñ ClassVar[int][str] def test_repr(self):Ñ.assertEqual(%K´), 'typing.%')<Jcv =vW/cvQ¯VŸEmployee]["5%s.AÛ' % __name__)°cannot_subcE %Wwith Ó÷Raises(TypeErrorPTD„ C(type(8)%)EpassØe1LjkôOinitð,ã(Í *H4‘[Optional<])(ößno_isinstance,I*1,&%is‘6intVC) dÐastTests(Base kCase):ßlbasicsâÑûQcast(jv42), 42º,Qfloat)`Ø."Is\0o), int` 1AnyY^¸?lis‹ -PUnion#!, ”]bg aAnyStr*/ ANone( —e< —õ# Bogus calls are not expected to fail.yZ"42a~r'hello'3 ForwardRef/9s%ô Node(Generic[T]vi ___!__{¯, label: T 3 " =(nM#Reft =�@righ e['|‚add_both| N'uleft: '-×o[T]]',4z3: ',@' = …2`stuff:õ,Pblah=P(àleft  Ñself.right = " Ðdef add_left(-ù, node: Optional['Node[T]']):;A2.@Pboth(:, None)f� g^" =9d ^¤dݧEint]¥”ò_hints = get_type%(t¶ñ, globals(), loc )Eâ¶ssertEqual(V ['66'],-…?T]]@A)�•UƒYstuffƒD=æNotIn('blah', s‰�bs"s4V ['d ¯s´1‡#ˆ5X‰Zò test_forwardref_instanceŠQerrorZÒfr = typing.F:–Ref('int'–Wwith ›ÀRaises(TypeEVQ§$iszs(42, fr³¤�subclass¤_zO(int¥ _eˆ?ity;#6Ñ?fr,qr7#No QList[š1], <‰ \M_repîV�%KXC), " ,]"ÌTunionv$“ —€foo(a: U)=['TÚFpassÁ ¤ K?fooI,uy D{'a'�]?"?Namžp ï"noÂ]checkZ@Âÿwhatevers') -> {}B _th = =mÆc]th, { —o_class¼-* C¦Ñ¦ <cÖeC.foo)2 ØcÙPiF/()H iHkÈÆ !Pno_ba‡ AmethQá, x: int): ...d­P7D(Cd/Uc = C=ê# verify that K nL‘ affects ¶9¾€ C.¸q), {'x'·9 #á_ref_as_stringøÁÕ 1Ðfoo: typing.CÅVar[int] = 7±;Dl;4 E4'p'qF= r6¨ÿ expected_result = {'foo'ã}8õ for clazz in [C, D, E, F]�À self.asð4sertEqual(get_type_hints(clazz), expected_result) def test_nesðclassvar_fails_forwar4áf_check(self):<@0& Eàfoo: 'typing.CRLVar[«int]]' = 7NFNF' @!']@AAfor ñª in [E, F]MPwith Ä0.as3÷Raises(TypeErrorÛÊP >rmeta_nox )›@¥_decorator!‹Vmagic[(func“preturn …¤Ò IË.__name__, '' G@ œú foo(a: 'whatevers') -> {}bFpass™R9C<g¯ k 8fooøUfoo')Ò[th = Û6foo! Ofth, {}!cC/C.E cF� ‰?C()H iHÑ8Æýdefault_globals®„ode = ("~1\n"AN" RŠ , ÷CïP'D': y;X/D:X1bar™r, b: 'DXCVsuns = {}³Öexec(code, ns'ùßns['C']Z =ƒ, {'a': 32, 'w‚D']}) ïðOverloadTests(Base bCase): N o+_ßRfrom '„ import 1HBÂeRuntimÅ#3@F•Wblah(‚ás*: Ï}succeedqÒŸaq  —&Hó ASYNCIO_TESTS = """ fðasyncio T_a = €Var('T_açòAwaitableWrapper(ª.X[T_a]ó�__init__è`, valuO\." =_0__ao<io1Ite8ð[T_a]: syield ù&return self.value class AsyncIteratorWrapper(typing.�[T_a]): SÐdef __init__(U!, V#: ;R4ble6‡�" =3QSaiterRD) ->N‰:‡VÚK @aÓÁio.coroutine,³Danex´b6T_aLqdata = ;W from°Eq0if (6†)Kelse&—aise StopÒ5ion�"CM1à ³+en2int'z!42x 9x ýetype, eval, tb)BÒNone """ tryòexec(ASYNCIO_TESTS) except ImportError,'ö = False # multithreading is not enabled ; TršP# Def]ñ$ions needed for features introduced in Python 3.6 ¶atest i¢Ç ann_module, 2 36ö8¢åContextManager§òƒy: floatJ3B(AU@x: C]ñVar[Optional['B']] = g¹ y:Ƕb ’cCSub(BKzK''D3B()u°G(Generic[T�X7lst5aList[Tz$[]Á„¢AndForwardΚparent: ''¡‚meaning:¾|óCoolEmployee(NamedTupleº‘name: strABcoolå=¿WithDefaultHD = 0Ï^XMeth:xqJadouble®£¹22 *ìxUOReprU ÁA = 1ãdE__stÁXe0f'{,0.x}Ü "y}b>3addÿ~, otherªöáHasForeignBaseqb(mod_g„s_cache.•àsome_xrepr: 'XÝyg__a: '=6' S¢g_with(am:7 D[int„{?9� am as xxsdÀACM()).send(‘x=]WOcðassert e.args[0] == 42 gth = get_t_hints äðGetTypeHintTests(J 4CasÈ™P_D_iü_various_objects]ã# For invalid %Ñ should fail „J (!’AttributeQetc).bK1FòRS"s(CÀror):  ‘gth(123) õ with self.assertRaises(TypeError):+3@_'abc'B*aNone) Yðdef test_get_type_hints_modules(›„3ann-ð = {1: 2, 'f': Tuple[int, int], 'x': ±, 'y': str}|Ñ`û`Equal(âf6), sÿA o2), {}/3/ ñ@expectedFailure1 ¼_forwardref<ó)# FIXME: This currently exposes a bug in typing. Cached R± references‰>ð# don't account+ð the case whereðre are multiple`Pes ofB samÙPñname coming from difw#t ¢!he9• program.’2mgcBð'default_a': Optional[mod_generics_cäE.A],BˆBbB /B]T v5), ® clž | ñ.C), # gth will finduÖright globalnÏ÷ {1: ?.C]Õ«IsInstanceJ1.j_Æ), dict .Mñ'123': 123, 'o':D‚Ç?.D)áê2{'jE, 'k +úxY½z€°h-—¶¢2S¢"7str"¡5fooD?intæ ýBAndF¨˜ pa¤:': 5£, 'meaning ( )z ðHasForeignBaseCT ðsome_xrepr': XRep!QotherRÓ/.Ag! 'PJ:B¾ €�.__new__¸ Îðint, 'y': int})  óself.assertEqual(gth(mod_generics_cache.B), 3ÿ{'my_inner_a1': @/.AA A2A&0out‚@AA}) Âðdef test_respect_no_type_check(!):*é@°class NoTpC604:Inn}�__init__kÀ, x: 'not a †u'): ...i� UTrue(s*._¹?__)5DInn.€Bö ann_module2.NTC.meth), {}zûrABase(GB7[T]P<{(x: intòr ADer(^ 5'°)¦1'x'o 2getñhints_for_builtins£¾�# Should ±‘fail for .A-in þÿes and functionsÌ¥ DÌ l(?dir'?len'ïobject.__str__2/()4tstr.joi’Ç)¦üprevious_behavior”*kf(x, yC¡f.__annota�ñ__['x'] = 'int'n–O@ø>-ygÈKNone|QgQÖ(;–ŽX_withÑ †* AHBfb = B(¾b*A = {úO'A'}* µb, locals()ßt lCG-VaÔ;HCV, `__dict£¦£ p{'var':gDing.|[H7CV]·sB, globêo yq!, CpòOptional[B]], 'b&w OCSubzEz': p:iÐy': int, 'b': int, õ 'x': ClassVar[Optional[B]]})7øself.assertEqual(gth(G), {'lstAaList[T=0 cWp CollecXàsAbcTests(Base qCase): iðdef test_hashable(w!):À†óIsInstance(42, typing.H9¹7Not6/[]6j‡Oiter‡QI9‡ñ,# Due to ABC caching, the second time takes a separate code”þð# path and could fail. So call thi=1fewN%s.:8± 3+ k¡ñJust in case, alsoa issubB_() a Ø S-ElistÜq Ú5 C •AVš[int]:\n":?qreturn � 1êWrapper(42)\n"ÅÒglobals(), nsÈIõfoo = ns['foo']jAg = ™Ÿ–L†]3 Ÿ5foor8òg.send(None) # Run�À till comple ,# avoid warnÓæ9�coroutin_æÍ ²_CÙ²Wwith ·÷Raises(TypeError]>4isiV WÀ\W=86tryÓvŸ±except StopÄ 7OpassÀIO, 'Python ð63.5 and multithreading required') def test_async_iterable(self): #ðbase_it = range(10) # type: I5�tor[int]V3.AV ƒWrapper(M�+ð self.assertIsInstance(it,aFing.G?ble8:(Nos/42s×ÿ@skipUnless(ASYNCIO, 'Python p'?torp†?torp8;8e\sizedìþ%[]‹S6†3 ~�containen‚C:†7 ŠŒllection ôif hasattr(typing, 'Co.&')“9utuple()@@¿>ŸfrozensetBÆSubclass(dic»}L< A€abstract§¾M)A?6Set9’ 9 “0mut:iJ’M>‘£A ™ apI j¥(%{}7M8!5 „ßmS‹?]¾Ä³< ™PsequenK´•9S6 ‡=Ž$åÀSequence)  ð'self.assertNotIsInstance((), typing.MutableSequence) ;°def test_byPring(N!):#]Z5b''[`ByteSt<)6 Æytearray(b''œAB—Olist‘ �Subclass(*’LListâdúLÁcollections.7YDEæ{1 My(j ±[int]): ...ÒJ>=), x ÄcounterÆC9È `/sen5setL6Set.‹ mfrozen8ï%â/ŒFf’Œ8 ’?dic*ˆ=Dic�0no_¥!_iž0tiaa éWwith E÷Raises(TypeError™Ssð(…E'?[T]H3ÿ(_ÿs²æ"):ˆÌMÍÙK˜(Fpass:aa = My8_¸#a,*)„ 3 \ム, ç_ 'Žß 0no_P,A›ä.Eo[KT, V10M_str, 6 6E‚Eict[Q 3 ;d;=³ód­*);u0Map„A _ , òeAÀSubclass(dicñ*t, MyDict) def test_defaultdict_instantiation(self):.2à.assertIs(typeRing.DC^÷()), collections._)K�[KT, VT]S9�str, intU ©"„subclass*c!ef;typ[}U;Bpass•Gdd =H5IªQce(ddÙvÜG ®S¶2MyD*¥UNotIsE߈�@skipUnle0ò'ys.version_info >= (3, 3), 'ChainMap was added in 3.3'ÿ‹c)?mapª%i Tp Aêï,¡!Mœm CM—fq’e): ...œ 4Òe(CM[int, str #CM=µH=Ȥ Ø; !cm;F€< cm´/ üø$My+ >o;7„ð_dequeí%D= NS« ÖOque[€?queBo DÑDøº?[T]ÈDÇÂDÁ=counter?%C? A+EFI HKðC(typing.Counter[£T]): ... ñself.assertIs(type(C[int]()), C) *ðdef test_counter_subclass_instantiation(N"):4a$B MyC7`Cing.h!):b.Fpass@7d =>)*h¶IƒVce(d,-,7typ�1`collecésà ono_setßWwith ÂûRaises(TypeError§FSet(¤D&?[T]G2#ªû×â6 L*Is?Set£`frozen®¿¥e#F] ¢J,µ1—d(ÁXÝi Íß1™Ó/ Ã�no_tuple~:TR™Ê?¿*Bo”generatorxµ‘Kfoo(}…yield 42GAg = ( xSåÚce(g), ªGyƒ•‡: y’' J@[T, /ùQ, intY`–Eeasync_) ¾qns = {}4Îaexec("5 Duf():\n" $ "áð \n", globals(), ns) ó g = ns['f']() ñ'self.assertIsSubclass(type(g), typing.AsyncGenerator) ?Ðdef test_no_a!$_g"ð_instantiation(e!):5wPwith y÷Raises(TypeError+/„ÃO1X[T, TU2€int, intYþ3sj4ing!ðƒ@ MMA‡~ MutableMap� Bpass�<·õ # It's abstractx@vß‹[C(MMAy̱__getitem__Ç;, k&F¹return NonemBsB?, vEèN>?del€;Citer¸pµ%6(()1{?len?0›ñöEqual(len(MMC()), 0a�P callö#v.update$L1IsIl ce*(´/‚ÎBY‹[KT, VT] íèÿ/BèÄ¿B[str, str]2¹0ec(NoàPdict,cS,BY65MMA2~03B3C3ó BÞ"  ¤W =õcollections.abc.ê„T= ƒ<?B, <Àclass(MMC, có ollections.abc.Mapping) õwith self.assertRaises(TypeError):+2ð issubclass(MMB[str, str], tyZb.\6IsS=gC, MMAŠV3 I(IåIterable): ...…O7NotR}list, IQGQôGenerator[int, ]aÿdef g(): yield 0zwGú`)3ä2cÊn <w V£type(g), GYTtest_´ing_async_ga(¥9Ú‰A.ÀŽ]29jQasendO{, value$(Epass@9Sthrow:1typ?‘=None, tb KLuns = {}aexec('ì d&ö', globals(), nsµg = ns['g']J pK "L8Þ o xA� _ Àßinstance = G(ýI$(-‡Ä?  /Is> äÅH� Q’°L6 -g× ãAhookK&):9ÕDBasea§ 3@*emethod˜D_HeÌ__(cls, othez2"ifú.__name__ == 'Foo's,¹return TruezOelse6 \Falseð C(ò 3áJ Foo«:Bar�ŽQFoo, \ª)CRÞàSubclass(Bar, òC) def test_subclassing_register(self):*."ñ A(typing.Container): ...Q'3B(A C.%A.p%C)+{£.assertIsS�_(C, A$+No'Bá�DwBwDSwDw $t#M(‡ñ collections.abc.MutableMapR M“ 3M, †<ðÑj�_as_baseÐ'M(,–� ¼“‰é1 @Iterþ»3bS’(�SequencešS# >f 9¢I¢+ gI›7f–a, meta)=C{ABCMeta * B�kBa B£a VðOtherABCTests(Base DCase-†¦ntextmanagQê1@coClib. *¢J5():>‡yield 42:Em = .- „µInstance(cmâÉBextM¦a</42<vò@skipUnless(ASYNCIO, 'Python 3.5 required'mæ‡jasync_ ·ô…jNotACMApass€'öUACM()½Aoþ{Gå_ ¬èïTEqualæ5ò[int].__args__, (int,)Ë{Wwith €ûRaises(TypeErrorÉ4isi•Yxg&Àtyping.AsyncñContextManager[int, str] class TypeTests(Bas ôCase): def test_type_basic(self $H¡User: pass9B5()$0Pro "G„�new_user(_r:»[8`]) -> :6�vreturn 4"()×S¡pôù?varö^1U =áðVar('U', bound=å¨Å¬Éè?„optionalŒSA = O[[[VAExce&]]€»�foo(a: AÀ8 3 ½Êif a is Noneñ ?els.aðassert isinstance(¤þKeyboardInterrupt), sE:‹)±u0Newx sãSId = H"('u', int)ˆLName*',Ö.¹4IsIýB[Id(5)Z.\('Joe')bQEqualî]s + 1, 6Ø€lerrorsc“ Ó/Idý)Wwith ÔpRaises(¤E…)kQissub…Ä OJ! DL? nòX³$QdTupl¯¹ A E0EmpB2ameIó('Emp', [('nameT, ('iY],S `Emp, t—* jo}2EmpG, 42Pim = tP='JimÅ6d=1$•—@joe,9( “R‡@joe.�", ·?**idÅ%%imO?im'£y0im.Oï$`Emp.__ŸA__, ¦R.Ðfields, ('namÃe', 'id')) õself.assertEqual(Emp.__annotations__,.5acollec(ð.OrderedDict([('namppstr), (w, int)]~"Is{ßfield_types, �!) Ž�def test_gðdtuple_pyversion(Ö!):)¬sif sys.÷_info[:2] < (3, 6*.Pwith BûRaises(TypeError/3`NamedT… (' ð', one=int, other=�3f Ðclass NotYet(gs�a»hatever = 04Þl_usage0ÿtim = CoolEmployee('Tim', 9000=ùIsInstance(tim,=1Ã*˜@tim.ì!, ‹* Ocool®Sá!._JX__, ''i(!._¹së§j…l Au.xi , z~k z»t  • } I_ÖŒ_defaultV[jelleXSWithD/ 'J!q_G aF¯>n ep˜I.u', Cer_eDû ¯Sjoerd', 1Ág P.2Y¶3Í&î#ˆV I'P•dU॥1s, \L3=0)á@”exec(""" ¦nØSAfter ¶ x:A = 3ÅyC """Šèk|methodskÀEqual(XMeth(ó1).double(), 2) õself.assertEqual(XMeth(42).x, ?[0]4�str(XRepr8Ï), '42 -> 1'401�2 + u3), 0) �Wwith ¢õRaises(AttributeError):0Ôâexec(""" classÂãBad(NamedTuple1ax: int<Àdef _fields(o"Oÿreturn 'no chance for this' """­C2®osource®ˆ as well¶÷`test_ntÝ_keyword_usag_öLocalEmployee = T)("0", TÖ=str, age=int ynick = 2¶('Nick', 25)Œ�`IsInst�(?!, ¯+È&.…", [, Š!._Y__, 'Î ).L@, ('‚Ÿ', 'age')ƒ°annotationsŠPdict(L SQ?Is(�z_types,w9.__jQ|?Typw ' �', [('x',eP)], yº_90x=1V3'a'…Ï]pickl½âglobal Emp # $ð wants to refereàBthe <!byÆ# ; õB'Empé›p', str)ö$idùò0jan4PEmp(' V', 37Wòproto in range(¤÷.HIGHEST_PROTOCOL + 1¢š3z =Òp.dumps(a!, Pc*2.zloads(z$wL5 , 3) ZÀIOTests(Base 0Cas[.‹$io£‚Àstuff(a: IO)*jAnyStrÉz³a.readline(èEAa = E ÁU['a']l ÊÑa.__parameterZ(|#,)^ŸOtext¿ CTextÃsÀe ¹ðbinaryio(self): ð def stuff(a: BinaryIO) -> bytes: %õreturn a.readline() !2a =Jõ.__annotations__['a']'óself.assertEqual(a.__parameters__, ()W�ðtest_io_submodule(B)™ðfrom typing.io import IO, Text×p, __allc�__name__—0Is(6S?IO)%_)-„/1Cset(²0), ‚['IO', 'l G?'])Jï3, 'ð io') class RETests(Base CCasebð # Much of this is really ˜òing _TypeAlias. µlbasics¯ð pat = re.compile('[a-z]+',IÅQIsSub«q(pat.__ ÈPattern6 @type;?), 2 qInstanc-,m¾…ðsearch('12345abcde.'‹ mÁ_Match4 ¿omat), 0 ½5mat*»õ # these should just work!²[Union[str,]½~! {, str]]úa _eßá# We don't sup04isiû%).Xo/42Ÿ�1sä �òä �·Orepr{%V)Í�:�?DÔFHÆ? 6ÀssertEqual(rö epr(Match[str]), 'typing.C') öself.assertEqual(r@^bytesB1') Eðdef test_re_submodule(W!):!iSfrom ‡¡re import ‘ð, Pattern, __all__ ename__@O¦"IsÞ,PFÑ5Is(\}/Cset(‰0), !['cC', '??'])B"__¾z-re.`cannot2\class1Wwith öò Raises(TypeError) as ex:„cK3 A(í·†#Fpass9fõtr(ex.exception),ˆ> ’"type 're^à' is not an ac@�able base¯ce") ¦ÀllTests(Base CCase­0"""Ts forB."""µr, line 1)")(6tryz5÷ eval("""'''this is a test""7ú except SyntaxError as msgMÚò.assertEqual(str(msg), æ‰Jelse=ò$raise support.TestFailed if __name__ == "__main__"A@unit².`() """>ðs for http/cookiejar.py.""" imf4 os $re K‡%im oñurllib.request fromw.w o±(time2isoz,"2S, iso ¢2netscape,¶óparse_ns_headers, joinÛ_words, splitCöF ÂJar, Default²Policy, LWP#vMozilla‹ALoadþb, lwp_à0_stUñEFAULT_HTTP_PORT, eÆS_path…Preachð€_HDN, do²@_matZuser_T Cg_¿$, !ñhost) class DateTime(°SqCase): Ï1defê_v– ›ñbase = 101922700087·day = 24*36 ZK÷ ), "2002-04-19 14:36:40ZiB H+dayF/20F",2*H1H"3H2H/Vaz = b 50Â÷text in (az, bz:‰1`Regex(/ñ, r"^\d{4}-\d\d :3Z$"•FF"bad´MÕmat: %s %s" %�)NÄRC^VÀFri, 19-Apr-b†O GMT_ Ocº �"Sat, 20l;› mŠ4ooun, 21o3±o Moo2oÓÒ¸×ðnetscape(500000)# õfor text in (az, bz):%ñ # Format "%s, %02d-%s-%04d :Y GMT";ùself.assertRegex(]{,÷r"[a-zA-Z]{3}, \d{2}-b-\d{4}:‚.$"Pñ"bad time2netscape fÔ¥: %s %s" %ý!) �àdef test_http2<(Î"°parse_date(ÊÝareturny1.gmDN0R)[:6]q1b0gEqual(`ð"01 Jan 2001"), ( 1, 100, 3.0)¿Na# thisÆñ will break around year 2070ï0~ ƒ3-Feb-20|‚20, 2, 3y?, 0| /48|!98|O1998|• ·_ês¿#‘° supported Ôñ s. Test cases with 2 digit?¾#`ƒprobablyi!in&e 2044.,žUs = [ñ 'Thu, 03 Feb 1994 00:Ñð', # proposed new HTTP°:matFPrsdayK­I¯old rfc850G’obrokenL”Õ ÈÙ (no weekday)AË> ÂC” @Ï, no secondsÍ�ÜHT)tzO2O_24:00Odü#Äòtz) using hour 24‘yesterday'À2 '0'"94‹mì×9imeÙFÙH "7KVKI•'q# A few7 öextra space at various places: ' Ý ‰ á á7 '¬&Ñ#?à_t = 760233600sassume '°POSIX count»"ofŒÀds ró esult = time2isoz(test_t) ñ expected = "1994-02-03 00:%Z"*ñself.assertEqual(r^$, C,+\ó"%s => '%s' (%s)" % �,, J5)) L�for s in º%s:] “Phttp2íA(s),2V_t, sï6 ˆ.lower()>|M.uppFÛ2def ³�_garbage(Ö)éü[ƒ*''s"'GB ü Mandag 16. September 1996)¯01-00-1980/13O0-01/32h42 25iqWŒO61:0”#]00:62Fß8-Oct-3697739/01P9 Feb'ü42632 22:23:32 GMTIfWed, 01?8340 ]Ý �uIsNone(")æ3 "0°%s) is not J&\nÀ 4<eE) %s›&, Y˜½3isoo7elf´!÷parse_date(text|areturn™1.gm³M/R)[:6],0õ # ISO 8601 compact format7  �Ûß0203T141529Z"U ( ô, 2, 3, 14, 15, 29þ �AwithÈ¿ behind UTC•pß7:15:29 -0700žB�ahead of "A19:4 O+053 *M_ï_Èsø#  'ïp suppor¯X%s.hRKs = !ÉbÒ@ -00L R‚Má';+;& ',U� # zone¤�optionalw3:<Ponly û5ðT00:00:00', ÷ # Use T as separator ·'19940203', ¾# only date5õ-02-02 24:00:00@ÿ # using hour-24 yesterdaH}!T0ZE»ù ISO 8601 compact format Œù!# A few tests with extra space at various places=0' ËO3 ',TåH:00 ']Œ€À_t = 7602336*ð # assume broken POSIX count"–of second•‚for s inÏ:�ñself.assertEqual(iso2time(s),1o_t, s)5ˆ.lower()=E=uppE2defž°�_garbage(Ò)åýG[�'›GB õThursday, 03-Feb-94 ¹, f-»¦"(error --�ñ follows)\n\n%s" % f.getù z  3Z#, #°, """ When M³ing: '%s' E½:¼2Got ""~(¡", b)¦àroundtrip(selfC): •tests = [�("foo", .),C=bar  $“ foo &""�foo=", '/"' ³bar bar=bazHn;5;5‚RR baz'ôbz¸r/P="\""4†="\\"', 6r ž:r,,,bar'ø,C ú'ç)ú-1:), –ú'text/html; charset=iso-8859-1'Ä ."/� `¨÷ñ; port="80,81"; discardÍœ l:?bar8 ÔÐr'Basic realmtÜfoo\\\\bar\""Ô.;/)Ñ]@ñfor arg, expect in &úinput = split_header_words([arg]_ reVJjoin+F +ôself.assertEqual(resŒñ , """ When parsing: '%s' E«0ed:›2GotI´1was9w""" % (ð!, qšò) class FakeResponse Ðdef __init__(¶", çs=[], url=None^½Ž$ +õ: list of RFC822-style 'Key: value' strings°G im~e email!�.ixâ.message_from_T`("\n".—(»)�FPurl =Í^ôAinfoð¢): return +C" &ñteract_2965(cookiejarr, *set_S_hdrs%O2_in= 8 7�, "Set-C^;2"){�netscapeGA~½thdr_nam#Ð"""Perform a ÝÀle request /–}` cycle¦{Bing ÿ:S.2reqºClib.H".RPB(urlê…ujar.add“ÏH(req%ª =“4.geô"("‘".G]6R0hdrJ ÁJ5ñ.append("%s: %s�'S, hdr¡Q•Âb‰Ü1ext�ðs(res, req) ñ return cookie_hdr class FileCðJarTests(unittest.ðCase): def ò_lwp_valueless_US(self)-#m¡s with no 2ñ should be saved and loaded consistentlyqH¡filename =|õ.support.TESTFN'uc = LWPÊ%()ö#interact_netscape(c, "http://www.acme.com/", 'boo'<Õó.assertEqual(c.ð8s["<P"]["/aboo"].ìf, NoneM2tryIØ c.(ã÷, ignore_discard=Tru?2ç.KQkfinall”¥¥ os.unlinkKÆhõexcept OSError: passp42Nqžbad_magicf„ps (eg. Kñ doesn't exist) are allowed to propagatecÎ5c3forÔBjar_>)inv•, Mozillaˆ ñ, =C©Œ™c× ="‹AthisÕrwork, aq"KO"ý™#no9"ó z as excÞXD# anB sub'q(likelym�NotFound;­), but notªR# Loa& c²IsNot(exc._”6__,: Ä>lse³Måfail("expectedÂiqinvalid\'3# I0con¹Cs ofâs1—Abad Àv string—¦# causes aµ.ð ÛEopen™`, "w")�fÛ÷f.write("oops\nº¬áÁÕ&Gƒ K Ý&rVuRaises(ë", í,>o,°<«ëúQ# XXX–�# Get ridéÍð comparisons whereÐP actu_¤0ingûr / repráä# .clear() etc�IP addres7ð 50 (single number,N doÛónd domain-matching¦à functions (anò2d is_HDN)? See draft RFC 2965 errata. # Strictness switches óis_third_party()1ñunverifiability / &-&“ blocking-öNetscape cookies work the same as—õwith regard to port¤Aet-CA &ônegative max age(vIf turnTõhandling off, SG2�óshould not clobberº.-g‹#2 <ôbe sent if *any*/A areYúV1 (ie. V0 OR V2 etc.)NÓs (V1 and V0)æÙo expiry datent"Äbe discardedMå…Quoting:Îèóaccept unquoted«ó -attribute values? check,Bdq Whichß±required onÖaway inÈLout?~�lways re¦ƒ < Proper tesÐw of wheã¶%s kA(wai,3forÁm Path-match²‰(Œ.!V0»%V11Q:Aance#;[Drule352ÅÆout version ei@ject¹è¿ peculiarit0ô list from Ronald TschalarŽñ The first two still need2!s,–Arest¯PcoveruT## - $a only ��s around7~"es@ recognized»°such ## (¹òyes, some folksQI");k’any otherL‚n@trea¥0as ]ü:!.--Š”pace: whi ÇQnames±6Âs is ignoredAÐDefault path:Ã!no r`ameter3RgivenL)" d6s‡0theK 7iñest-uri up to, but’includingPÓlast '/'. NotJ@thatV¯ðentirely differjw%³e spec saysRCommaõWÆ delimiters:&0jusö¡rses untilª�next ';'Kð This means it w\rallow cd”etc insid9 3bot-$Pequalú!mmy`appear7Þ)t").‚BalsodŒ `if youl§d multiple€ò header fields into one,H“a-separcgÁ, it'll be a>@acheâÀparse (at le®!myJ¡starts hurtÀevery time IÃ"nk·�at code)Y0- EÙpes: Yout get all soM"ofó`format½��ÃHð empty expires atñtributes ("expires="). Be as flexibl ð+you ## can, and certainly don't expect the weekday to be re; if you@"'tKðparse it, just ignor_ðpretend it's a session cookie.Að- Domain-matching: Netscape usesyñ 2-dot rule for _all_ d8Ss, no‹�»ð 7 special TLD's listed inN!irð. And folks rely on�ò that... def test_nñ_return_ok(self):%)#'ý optimization: .6÷ ) should filter out mostH4s®! C,pJar bef[Qwe tr—Qacces"�m (becaus©aNómay require disk 5 --aõparticular, with MSIEr)–�This is o,Ña rough check“òperformance reasons, soùwnot tooN€critical¡@long$õsufficiently liberal.9Òpol = Default§vPolicy(«!Curl, @, okê[E®ð("http://foo.bar.com/", "blah ¯", False),8�rhubarb.@-�ƒ.<?Tru¾:'=?", q?com2•]§:œ;4  3f2`_Êß3Â,+?foo*o.local0- ][mÓest = urllib.Æ.Request(url®2n = pol- ,À:est6pif ok: ‡p.assert¯*(r&Ielse%:&ØßÞmissing_valueÜp = signP~€: headerðregarded by Mozilla×#a =qðb# name€0by Š.9jar3 �9@file;ð = test.support.ƒTESTFN õc = MozillaCookieJar(filename)'ÿ$interact_netscape(c, "http://www.acme.com/", 'eggs'=%÷"spam"; path=/foo/Kc¤b = c._ 8s["€P"]["/„%"]Áòself.assertIsNone(?W.valué(TEqual'1, "VÚD� 'Ä2]['Ú'•=X— Å3lwp/C_strÔE), ( rJ|"¹ª"; domain=h9; '='°ö _spec; discard; version=0')ž0old†– = repr(có c.save(ignore_expires=True, [9Itry:Ž×ö�c.revertw kfinall{Îos.unlink(c.I"# 4ñs unchanged apart from lost info re. whether P was _Uifiedí ëÜa,e.sub("±Rr=%s" % mZFalseLe3 Ó‘ ¥O/")ud% ´›1') ëð def test_rfc2109_handling(‹),`# RFC #˜Aare /šs ƒ965 or Ný,—ñ# dependent on policy settings”¯Dfor “%asM,D965,2U in [7;bôfault according to9ÿ if not explicitly,G(ü", Ë+ 0Z1#^vWÄ ­(`tU), #ßã here means noTW storà´G—($ Ò ] h¶A= DejPÌ *.È=$5%1965-6965'¹x‰’ "<eexamplŽð"ni=ni; Versiong=1") Itry:Âcookie = c._ ðs["www.example.com"]["/Ini"]Bþexcept KeyError_ò&self.assertIsNone(version) # didn't expect a stored ˆ i?lse^ bEqual(:.d#, ÷c# 2965jùs are unaffectedz.�interact_5Ë(c, "http://)=/",<@²"foo=bar; V ¦,`if rfcmô ç ¹;fooºG¡C\G11) Øðdef test_ns_parser(@)¦Qc = CSFJar(xBŒnetscapeF1acmlC ô'spam=eggs; DoMain=.:ÿ; port; blArgh="feep"'ƒ#r 'ni=niS�=80,8080L!`:80/",OQC):�expires=M)H'Û 'lÿ "Foo Bar 25 33:22:11 3022b'+«ß/', 'fortytwoÈBÿ=unladenswallow Hóholyhandgrenade'îj fsOaöU¦.domain, "B 5DTrueÌ4¯_specified1 fÿ, DEFAULT_HTTP_PORT9EFalsk9i÷# case is preserv#¶òhas_nonstandard_attr("›/")‹@@argh@´¡—l¤ ½· <n!, C°8=jm3, "\«10`Àcookies["wwwà.acme.com"]["/ƒnini"] ÿself.assertIsNone(cookie.port)'IFals&Å_specified) 1ò# invalid expires should not cause iå to be dropped@’foo = c._&ns["wwwÎ8fooÍ?pam6 Cfoo.·*Fspam(»² ˆ'¾P']['/Ÿfortytwo'�t“_value‘TEqualº'I, ''�Tthere…ñbe a distinction between a present but empty PÞò# (above) and a÷ that's entirely missing (below‰ÿholyhandgrenade$´ªmòdef test_ns_parser¨�al_names(ú'):Ø£ such as 'Q' are¶çÀal in first 1=tW pairK�of Set-CKv: heade Bc = FJar(Ñøinteract_netscape(c, "http://A5/", o=eggs'E%qversionE ; Ñ ;²sÐŽZT%n(I,òs­ *Ž'*UÌ”¼%ifh!is¢³uture, keepx1...Núƒf7… = time2ˆ.v()+3600´ad"bar";°e=%s' %™� “r4÷–len(c), 1$?nowÄ -+Q# ...Ì if9tpast or,'ucard it¥õPfoo="¦õn5Oh = s+$FIn('¢O', hKpNotIn("{#ð# max-age takesCÄcedence overò,nEzero0×is request toPódelete both newÉ@Ðany old matchk¨ð interaÿ6ct_netscape(c, "http://www.acme.com/", 'eggs="bar"; expires=%s' % ufuture)"ointerar?barq-ÿ self.assertEqual(len(c), 3•%'Ù'$ÿ; max-age=0' % 6 s ® Oh = ˜8\51) b# test1òy at end of session for cookies with no-Åes attributeN¨±rhubarb.netµÏwhum="fizz"'º2$ƒc.clear_©_¥(" $‚In('spamÓN', h'@if f RionalÕy is accepted ŽQ = C=õ(0, "name", "value",-�àNone, False, "ê¯python.org8 7Tru8/+ ]ÿ"1444312383.018307<¦Ë/{}‘&.Š&, † {ÄXXX RFC 2965uó rules (some apply to V0 too<1defÜà_default_path(ñ%):°#Yrpol = D5¾ Policy(rfcƒ=ge³cævJar(polò8¾ zP; Ver|?="1@In("?$c.÷[&/"]Ÿ9Lblaha£€/\º "Áûi[ÆÀrb/",  ô 'eggs="bar"; Version="1"') *õ-self.assertIn("/blah/rhubarb/", c._cookies["www.acme.com"]) E¦# NetscapeQc = C:FJar(q£interact_n3È(c, "http://b~R'spamÁ´§“/7", X—vµŸÌá:3£Ú›C¤6æðdef test_default_path_with_query(ï%):¹/cj¦Uuri =—aexamplø /?“/¾"Gyvalue =ñ�j, uri, 82# D· ·ñ does not include Ã�, so is "F"“%".råÔ:jÈÏÇ #°^ÿ sent back to the same URIfoEqual(é)꣥e3¤ ™�ases = [2¢¹quoted safe ("/foo%2f/í#, F/),,, ## r%C%_B mA/unµG%19oG Há9%7d,"7D ,C# un·t6#&"¹~+&"Dp o/( (@\176}9, " .šTo\031LX1%19 K‘("/\175foͤ4%7D -xÿicode, latin-1 rangDla\u00fcTQ‘%C3%BC"),‹ # UTF-8 enTdk O™bar\uabcd\�EA%AF%8D_\ ]Tðfor arg, result in casWes: ñself.assertEqual(escape_path(arg), result) 8Ðdef test_requ)F)Yñ# with parameters;vÓreq = urllib.C".RK(&*ð "http://www.example.com/rheuºaponticum;"8õfoo=bar;sing=song?apples=pears&spam=eggs#ni"); � Ureq),,Ÿ "– ‡m ?out#T?#4 ø æ0mis†Å final slashE  ý]°O "/"¶@ort(D¶’1acmŒ:1234/"&ðheaders={"Host": "ÛLo4321"}‘»‘ "�½iÿDEFAULT_HTTP_PORT¬=hos¬s# this ¥ö is illegal (RFC2616, 14.2.3R!1.5(80Ôô# libwww-perl wantsÈñ sponse, but that seems wrongÔ Õ?õ# section 5.2, point 1., and RFC 2965$!1,jggraph #÷uf¨n<N'.17‡sŒ( irrelevant<‹½†Âô# port shouldn't be in�-;¨îÿ:2345/resource.htmlb-Àme.com:5432"C}) ðself.assertEqual(request_host ñ), "www.acme.com") =Pdef t)pis_HDN(I!):[XSTrue(&‚"foo.barJ‡ /Ñ1foo2.3bar4.5~4FFalsdß192.168.1.1")0%.&à ¬_..foo[Z)cd~_reach}Õ& È8, "Ö¶º =6, " �8`local"L. 8)§4#2 d“"% þ)(|0|9, " :¯domain_matà  ,Vâeñ E 3 †1x.yÈa, "x.Y ~< ; . ¹xvQa.b.c©$ ³x;H>ñsexampleÖÕ|Pblah._", ""y8/„.rhubarb?¸>.L/Zuser_¡ *éD §Eˆõ�L%P9Å=!ABÐuser_domain_mñatch("x.y.com", "Y C)) òself.assertTrue(user_domain_m?=OFals>|+>.»!úù¼?@7>/m"<'.=)x)<'°192.168.1.1jýñ"# not both HDNs, so must string-compare equal to …¯xz5, "•†öGs# emptyµÿ is a special case°)h@ãdef test_wrong•(»!):!Ãñ!# Cookies whose effective request-host name doesà-[6 th¯"#  ƒ§rejected. nÐXXX far from ­6let@3c =�FJar(fñinteract_2965(c, "http://www.nastd5/",jÜ“'foo=bar; ö =friendly.org; Version="1"'u*ÛEN²(len(c), 0)Òa|/ctb"ôõcountry-code tld like .co.uk shouldÒúƒe set if(yPolicy.‚PUtrue.<Âcp = Defaultð8(8=›)cjŽpj6=cp"—¶netscape(cjœrexampleÎ÷/", 'no=problemohFÔÞ p'okey=d1; D„)=.†vÞVj), 2á°for pseudo_žRin ["У=1.za Qtx.us + ]e¡æg%s/" %tÒS¦'spam=eggsó?ë(ï TÎÀ_two_componeónt_domain_ns(self): ù # Netscape: .www.bar.com,  2no VLó should all get accepted, as R.acmeb _ and Oófor 2-componentpts like >.€õc = CookieJar() W# twoH#V0Ke is OK(£interact_nõ(c, "http://foo.net/", 'ns=bar'):Vÿ.assertEqual(len(c), 1$Ac._c¯3s["^P"]["/ÿns"].value, "bar"H·B), "¸Lô# *will* be returned to any other)1(unv¶RFC 2965)..y þ’ YïE/"),D’¯ò...unless requested©EwiseKÒpol = DefaultuPolicy(#g@striîs =2!.D;S+2NonŽrc.set_p^6pol*9 ""Á û, even explicità˜Ý`³# because .“ matches À -&/"_Q Ã'spam1=eggs;H==;#Ëÿif starts with a dot -- in NS rules,¹!º?bar¾2¾9¿ æú3 úTöT9Ý _@ "\Ï �i /W0]["m2m16|ú ”| FÁ³# top-leveldøµtoo general*ŸÞ…ini="ni"¶ùô5 ##§]€ protoco¤Pesn't$àow non-specialÈ Èzs (suchQ�as co.uk)4theô¢attribute À there are aôt least three ## æ# dots in it. ö2Oh yes it does! Real implementations don't check this, and real Köcookies (of course) rely on that behaviour�ñ0interact_netscape(c, "http://foo.co.uk", 'nasty=trick; domain=.(')éõ self.assertEqual(len(c), 2)÷$14) %òdef test_two_component_w�_rfc2965(G!):1ápol = DefaultC sPolicy(1V=True†Bc = '‚Jar(pol)}Le# two-z3 V1ôe is OKt@‘ <@net/;öfoo=bar; Version="1"'ˆÇ21$3c._ð ["¨€net"]["/ÿfoo"].value, "bar"IÂ%),ï $"$Ô31; èn1# wºô be returned to any otherU„(because1was?ied»!Cwww.y/"), ""ÛPunlesUÅÑôgiven explicitly, �0the²@ mus@ °# rewrittenÑÀstart with aé: ”.net --> Œq, whichêJ noýŒd-match<#£ñ¥¥'spam=eggs·p; path=ç›:¯U #«+R fromuµ/  *fW* getN6setò­‹“%esÅ8çp\//"›!W+ ºy0]["þ ¼ Ä "!¹”Æ q•ú ¢ –r „v 'Å1/"$Dça'Gðtop-level domain is Ótoo general õinteract_2965(c, "http://foo.net/",,3ð'ni="ni"; domain="0õ"; Version="1"')=õ self.assertEqual(len(c), 2) %`# RFC ‹õ doesn't require blocking this1¿ _co.ukÁ ¥asty=trickÅ.5Å3Å’def test_p_allow(ü%):µò c = CookieJar(policy=DefaultP(2s#edZês=["acme.com"]¤u *Fwww..)­VÐreq = urllib.lÄest.Request( ;&/"Ðòheaders = ["Set-¹õ: CUSTOMER=WILE_E_COYOTE; path=/"]Ô re=ÓFakeResponse(T…yQc.ext³cD`s(res,(�qm0û:ÿ¾<Â*1Â!Qcoyot,Ä!>Æ6‚# set a Ï£ with non-Ç_7...;µ~º¼>§¼sc.make_‡Sc.set ('?[0]¨2$õ# ... and check is ge eturnedSc.addu_RF(reqQPFalseD.has-"Ë"'dÔ‰ Ôopol = Å0rfcÞb=True,Ô ©¦Ò06polÓç”�dS“Q<G*Ïqp = pols£YÀmains(["acme“.com"]) ö c.extract_cookies(res, req$÷ self.assertEqual(len(c), 1) Ifclear(7òreq = urllib.request.Rø("http://www.roadrunner.net/"Cÿ s = FakeResponse(headers, Bà-'Í-Sc.addg_Ç(h@TrueD.has,!"C¢&") š223©ÿpol.set_blocked_domains([".acme3F‚# set a zc with „ „5...¸O´I!<Ÿ‰cc.makeÃ*cH1(7s[0o± K2Õõ# ... and check is doesn't get returnedXOFalsY Uðdef test_secure(µ!): for ns in t!, T# whitespace+z" ", ""'+Bc = ÙJ>^if ns7Òpol = DefaultDñPolicy(rfc2965=›Z5¡int = inteþ…netscapeæ(vý-""Oelse›%<šÉ z–¾; Version=1¡�p>polq urDL v`int(c,Óö , "foo1=bar%s%s" % (vs, õ¦­ ?2?"; hGH��á(©n$c.© ["fØP"]["/Á2"].},DR"non-!¦£registered·¯w¡ç '2  œ¹à") def teóst_quote_cookie_value(self): Qc = C òJar(policy=DefaultPõ(rfc2965=True))@�interact_ö%(c, "http://www.acme.com/", r'foo=\b"a"r; Version=1'KOh = O5Ïà.assertEqual(hk$`!; w±\b\"a\"r') »ü def test_missing_final_slash#2# M% ñ( from request URL's abs_path should be assumed present.wu_url ='"$ –�)`url, "(bax"CÓreq = urllib.Ø".RàF(url* m–len(c), 1$Tc.adds¦header(req!ELS.has_,"v,")ªÜdomain_mirror¤ poU)ý† b'poæ ¡rfoo.barÇ¡ ¨h—spam=eggsâjâb�NotIn("D÷U", h,~Á0"aba ä returned with…"T<B'"; Ä=Hô SIn('$L"M "'# "ÿ5notï8s# note .ó initial dot inàŸ c2Ld½[ÞAPathY D?B@l©/=/À selðBf.assertIn('$Path="/"', h, "path not returned") def test_port_mirror(self): ópol = DefaultCookiePolicy(rfc2965=TrueQ1Bc = (�Jar(pol)l urLõ"http://foo.bar.com/"$�interact_\ö(c, url, "spam=eggs; Version=1"ZOh = :"4sel$ No'b"Port""¦absent por%R with0pre 7ËæW!; ©ÊìÐRegex(h, r"\$I¥([^=]|$)",sÐ " ‰no value@N'ýo="80"'$,2ortF osinglem?,805K#dmultip%s;"ø �! "usB©2no_ÅŒ_comment¯ ˜·:œ'Ÿ'L"'Cºÿ="does anybody read these?"; = LURL=HCnet/_.html& ¨# Ì"C or QURL cµ-attributesp­ to serverÑ* _iõt~)csNÐó# add some random sË 04s, RPblah.uÌ.org/", 'foo~¥âMÀl"') ñ< interact_netscape(cs, "http://www.acme.com/blah/", "spam=bar; secure") OO2965K7<H"foo`¿; Version=1kGopath=/k!�sol.no",Îôr'bang=wallop; v˳; domain=".B?; 'Dÿport="90,100, 80,8080"2 õ%max-age=100; Comment = "Just kidding! (\"|\\\\) "') ¦‚s = [1, U0, 1]#Aname "à7foo&6ô8ø0, "\.2@.org6z["# rÙp½ulÚ]ÿõfor i in range(4):÷¦Yi = 01c1*cs+/ùself.assertIsInstance(c, Cookie)J 1ƒEqual(c.‘,@Os[i]9§ , 3¤, 7i , 36Ri + 1hð def test_parse_ns_headers(0r“# missing‘û value (invalid cF?o> ` n[o¼:"])Ô0[[(,3Kbar"@ ("As/"), ("Ha, NoneÇ$F0")]¦÷Ð$# ÝrexpiresôÉã'Pÿ =Foo Bar 12 33:22:11 2000õ3 ("E"Ù!̶Ø/ (Ê7Á†­ s íGÏd attributesœ&'îW'x%€', 'bar'I',ƒ'\'G0')] /Àal( ð parse_ns_headers(['foo=bar; version']), ,0[[(%Ô', 'bar'), (',¥, None)]])3ô# shouldn't addWB if u• is empty3þself.assertEqual(§¡""]), []) 6ódef test_bad_cookieÓ(M"):'Ã+"Šjar_from1"s(—1s):[4Qc = CZFJar(àòreq = urllib.request.Rû ("http://www.example.com/"Dô = FakeResponse‡/, A“c.extractЋs(r, reqgveturn cðfuture = time2netscape(.s()+3600jïó# none of these badÌsíõ cause an exception to be raisedZ5for;Ein [hb["Set-uð: "], # actually, nothing wro�ith thisC2DYditto(`# missNÉdomain value#Žò2: a=foo; path=/; V.B=1; B*"]7#'omax-agY2: bX)_=oopsKt¤K)\=spamKÕò:; Expires=%s" %  È]O ©#;?;(ibe set1Ç Šlen(c), ™L w ’invalid eÕhàtreated as sesß 2lý9 = " c—Lõ =Foo Bar 12 33:22:11 2000"]J1]i 3`T = c.Å+["8P"]["/cl Isƒ(z.°Ò) class LWPQ Tests(unit9.CCaseö # €s taken &Ò libwww-perl,aàa few modificaåPs andçi.fse_]_$_1Ÿï/#-/Oð# First we check that it works |Óthe original –& a{'# ¾¿¿Ânewsref/std/m¢_spec.html÷Ðp Client‰Ñs a document,-°receives in# rg#ÑT( öCUSTOMER=WILE_E_COYOTE™ð=Wednesday, 09-Novó-99 23:12:40 GMT # ö2 When client requests a URL in path "/" on this server, it sends:K göCookie: CUSTOMER=WILE_E_COYOTE/ - C‰ðdocument, and receivesœÖthe response:D ‡DSet-‹ñPART_NUMBER=ROCKET_LAUNCHER_0001;ò&=/E +g/; ¸ ¦ M4$äSHIPPING=FEDEX&foZ žï?fooòAÇ*; }i ¢ The last Õ÷$ is buggy, because both specifications say that theMEmost+! c²€ must beâ›t first. švJ ­°should thusNI }ð year_plus_one = time.local –()[0] + 11Æheaders = []3c = ²Jar(DefaultöPolicy(rfc2965 = True))<ã#req = urllib.ÿ".R±("http://1.5/",¼#\šõ={"Host": "www.acme.com:80"})<t @|t{|.….append(M")´ J ; "<ù expires=Wednesday, 09-Nov-%d…I" % úÜSFakeR×(°$, Œ&/"<¢c.extract_Ä`s(res,Òïz b3add^_˜G(req_ðself.assertEqualD.get."–_"), "`ÑM2Nð'$Version="1"') ò< headers.append("Set-Cookie: PART_NUMBER=ROCKET_LAUNCHER_0001; path=/") óres = FakeResponse(bø, "http://www.acme.com<±c.extract_c�Òs(res, req) _ ò = urllib.request.R(b†foo/bar"¥Sc.adde_Ÿ(f0h =jD.get!"Gÿself.assertIn(". F", h„ =òCUSTOMER=WILE_E_COYOTE3ü«¬'¬óSHIPPING=FEDEX;šFfoo't�ìœD b•š�È!No Š Ã?req¿ 'ºúTrue(h.startswith("33;")ñð def test_netscape_example_2(y%):¢# Second E"à transaction s 7nce/9ö"Assume all mappings from above have been cleared.< ÿ Client receivesk6¸6 Êj 1 Wh–y ¡s a URL inÿ "/" on this server, it send¤ îŽ  2cIDING_wD0023 Fammol >8¦Ò ² ñ NOTE: There are two name/value pairs(d ow" due tPðthe inheritance of the "/" mappinóg in addition to the "/ammo" mapping. õc = CookieJar()Æheaders = [].òreq = urllib.request.Rý("http://www.acme.com/"SÒ.append("Set-{ø: PART_NUMBER=ROCKET_LAUNCHER_0001; path=O režÓFakeResponse(µ/, ‹ß±c.extract_cý¿s(res, req)î4Sc.add^_™(_ðself.assertEqualD.get."5"),·µ"9 "Іs� VŽcIDING_•D0023ŒSß�!É�D ¢“_Regex“!r”?I\s*"| ? Óð def test_ietf_example_1(X%):b/#-/M� Then wezQ witha~Ðs from draft-—-ö-state-man-mec-03.txtS Ö 5. EXAMPLESˆ ¤rDefault÷Policy(rfc2965=True)ò#\B1 E&& 1 ð Most detail ofác and rd E÷ has been omitted. AssumeP{¡user agent3£no stored y.0 € 1. U<A<–-> Server% 9p POST /{ç/login HTTP/1.í*¶[form data]F &°identifies Yp via a @º32. ¬7 ->Ä` j©} 200 OK +ð2: Customer="WILE_E_COYOTE"; Version="1"; P1"o|H  reflects °2's ÷(ty+*q = inte<t(­P@c, 'ó •'Î'Î 'u“à.assertFalse(c“ookie) # ö 3. User Agent -> Server% Aý POST /acme/pickitem HTTP/1.1-Cñ": $Version="1"; Customer="WILE_E_COYOTE"; $Path="_"N¶[form data] ¡бselects an ¢ö for ``shopping basket.''> c 4. R"% w} 200 OK BSet-À2: Part_NumbðRocket_Launcher_000&3 Nu 0 /Sù… contain .!c³ð = interact_2965(c, 'http://www.A.comª %',z¡ 'ú– >' 5');ƒòself.assertRegex(Û ¤Fr'^\žH?1"? ?¡I?; \£/$'[5[*2shiªWÖ#L [ &-s=gA¸  ‹¾ Àmethod from .^ O 6¸LS—¯="FedEx"; Š˜ MBNew ŒB ref© ë‘"‘N"í€'Óí] Q%')7 b?/?;t r'\s*§\¡"‚˜ øx'û z7*processyÀ Cookie: $ãVersion="1"; #ÿCustomer="WILE_E_COYOTE"; $Path="/acmeA�Part_NumbDÿRocket_Launcher_0001KüShipping="FedEx9 Ķ[form data] ãöUser chooses to process order./ ñ 8. Server -> CVAgent% höHTTP/1.1 200 OK  *õ Transaction is complete. *ðcookie = interact_2965(c, "http://www.šA.com£/Ø%")Fòself.assertRegex(WF, r'k?lc?;\s*\ô\R/"'K;In(,", Y)Á#…p# The u…aBð makes a series of requests on the origin!§ver, afterP@each7ñwhich it receivU3new�a. AllPžas haveGsameQéò attribute and (default) domain. BecausA²‘ URLs all[R@ açqprefix,V that match‹:he z!, Û]Orcontaink"Òúƒd so farBðdef test_ietf_exa`0_2('):Xb5.2 E & 2 c This C£ illustrat¿`effectŒ• Í€gdetailQððresponse header¥às been omittedHBssumyHSÓhas no storedÿs sQc = CRRJar(DÚ Policy(rfcah=True)Ç| Imagin} s}U, in È¥to earlierØ,¬),ô R Set-¤?2: eï žÎg Ž ‰ ciding_õ0023"; ‡f/ammo"4 ì‚Âù G¦/specific"m9':“('M þ Kì'[`A subsünÄ1 by¢è³5(µ)B for}%of)ð# the form /acmeó)/ammo/... would include the following request header: # ÷ Cookie: $Version="1"; 3ñ Part_Number="Riding_Rocket_0023"; $Path="/acme¡HAÛLauncher_0001J"Œ @ Notí!atòñNAME=VALUE pair forcÜQ withàmore specific ¯S¶attribute, ð, comes bef<_6oneROlessRÉ. Further nÀSsame ­n €appears ±£µthan once. 7ð= interact_2965(c, "http://www.”F.comÚ>%")Gòself.assertRegex(X?, rí#.*ú ¹)–€# A subs�%nt‰!byˆÑuser agent to(r) serveÀ…a URL of¢#)Cform oparts/C ï§%QHere,¸csecondå!'s} sÒÖ0 isž a prefixÖ4URL« 2, sN¼B doeL0get›warded toTvT,ƒROIn("2_ˆ1Not9l7Êðdef test_rejection(Ï)ñ T ‚ of Set-ý�2 responséñ ased on domain, path, port.mÒpol = DefaultD Policy(rfcW=Truerc = LWP+QJar(p/G=pol&ø max_age = "max-age=3600"WsillegalŸ  (no embedÙFdotsJ%",Þâ“'foo=bar;| ="QC"; v9&1'}€OwFalse(cè(# Äx±>–ping=pong³·ùEqual(len(c), 1¿ …Dhost¯"oö" contains a dotæ²™À  ô'whiz=bang; domain="acme.com"; version=1') 7õ self.assertEqual(len(c), 1) %s# legalTõcookie = interact_2965(c, "http://www.a.ƒ,; Æ'wow=flutterÃCÆ2Æõcan't partially match an IP-address¢ÝG125."Þxzzzz=piŸAÜ*"il¤ðpath (must be prefix of requesþ&thÿæÃosol.noáÇblah=rhubarbÀ@ ; �¥="/foo"; 'l '± ë fì£O/barôhing=boÕ.ñR3ÜSort (î -p¿not in listúFzOffft÷¿ort="90,100ù? ù?ortù  p µÁ Ó r'[w=wallop­ó Ý r'‰Ž, 80,808 ð r'max-age=100; Comment = "JÑÿkidding! (\"|\\\\) "Ì4*‹ð attribute without any value (currx*2F�foo9=barI „,95qencoded¡ð# LWP has this test, but unescaÉ w9@ cha†ers seemMð# like a bad idea, so IX nkðs should fail: ##”¶À965(c, "httpÿ ://www.sol.no/foo/", ## ôr'foo8=bar; version=1; path="/%66oo"') Að# but this is OK, because '<'ñnot an allowed HTTP URLQF¥character:Ðcookie = inteê_2965(c, "httpÛ<Û—Ý *3cÝõ self.assertEqual(len(c), 6) §õ# save and restorepfilenamÄötest.support.TESTFNC6try÷» c.T(@ö, ignore_discard=True„2Çold = repr(c��c = LWPCOêJar(policy=polDoc.loadvkfinall¹Ê¥ os.unlinkK höexcept OSError: pass  uDold,ÚÛ@def Rà_url_encoding(:)I¡# Try someq'õs of the PATHs.­0# (÷behaviour here has changed from libwww-per>c`rDefaultPm@(rfc¾ºÛ €acme.com¸…%2f%25/"¯Ú @"%3cÂ0Anew%C3%A5//",6¨"foo = ïV#1"n� Y š¿ð<<%0anew\345/\346\370 £…'bar=bazxº‘5');{¦ _rhr2£pile(r'^\$�=\"?1\"?'J&.I�4ã0In(û2", ñ)bRegex(!,%?_re/7/ì-–SFalse–Š‚# unicodâdoesn't raise ‰5ionLÕt ÚD\xfc&”~mozilla�S( / e" M%“/Netscapep óv format›Àyear_plus_onå time.local –()[0] + 1DFy¸Š®=63 Fí> n0 �1žô; max-age=100; V¦"À interactÿ_2965(c, "http://www.acme.com/", õ('foo2=bar; port="80"; max-age=100; Discard; Version=1')N�interact b "foo3igsecureP5") Q³expires = " ÿ=09-Nov-%d 23:12:40 GMT" % (year_plus_one,—Œnetscape?foo .´a´ %sp’hAbhƒDomain=. /; yNcy6|¤òdef save_and_restore(cj, ignore_d2%):2N:try0cj.J(:=p3ÿnew_c = MozillaCookieJar(filenameð= rDefaultD Policy(rfcPo=True)_.load¹ofinall¥ os.unlinkÄxùexcept OSError: passdqreturn T/ =´!, âDñself.assertEqual(len(?ã), 6) # none â/ed:@In("„=]ó1', value='bar'", reprTøe¤VFalse¥ 4¥–2 of themª1 on²2Ttest_``_misc(šöó# Some additional N�! c² s E%s.”Ô‰Íó`header%[]-òreq = urllib.request.R(Í6bar 8foop#”öallows a host part that contains doto“Ò.append("Set-»ó : Customer=WILE_E_COYOTE; dÞ˜"âôÓFakeResponse(bÓÈÌQc.ext‰Z@(reslqdR# andÔ3theŽ0 is*0 sa« qwithout¿Ång a leading€#1 to?Û÷!. Should not quote even if strange chars are usAA# inJÁ5  oÀCookie: PARTó_NUMBER=3,4; domain=foo.bar.acme.com") õres = FakeResponse(headers, "http://www;G/foo?÷ c.extract_cookies(res, req) dòq = urllib.request.R(e ¤ i3adde_¢(fÈ÷ self.assertIn("PART "”D.get=!"C±&")  Cÿ Customer=WILE_E_COYOTE",reqIòòdef test_intranet_†ps_2965(e!):*»ô # Test handling of local >õ hostnames without a dot.CBc = ͲJar(Default Policy(rfc|W=TrueðAinte¼&(cñ¥example/",e¬ø"foo1=bar; PORT; Discard; Version=1;&k =Õr$|R'foo2{X1=".2"}'Õ¹2", ²)¨ 3ënTê£ á£þ=åóEqual(len(c), 3Ç},ns{8!/ls;�netscape? ) E „—5ô›<2Š æŠ�êÆ d ¹dÒ( Ó î2î¬empty_pathå`Afor % %Åó)# Broken web-server ORION/1.3.38 returns to the client r+V likeM ÂBSet-‰ö: JSESSIONID=ABCDERANDOM123; Path== A ie.ö#@ set‰vnothingü# In this case, “a) must?¶¦to / (root˜ I�I&[]O/re÷\0nts—/%SŸ.append("K ÀANDOM123; Pasth=") ÷"res = FakeResponse(headers, "http://www.ants.com/<÷ c.extract_cookies(res, req) aòq = urllib.request.R(b3add^_˜(_ðself.assertEqualD.get.!"C›5"),’ú÷ "JSESSIONID=ABCDERANDOM123íi÷2"), '$Version="1"' ð# missing path in the1E URI¥/re7W:8080°/c.;·Àdef test_sesW s(•%):5ð year_plus_one = time.local –()[0] + 1�ƒ# Check X Èõ are deleted properly byi"# W`Jar.clvBšv methodjÐ 'ilqmeisterp†scripts'³·%[]’Ò.append("Set-¤S: s1=Ÿs;Path=/T.? ûp1=perm; Domain=.£%;"†T "oÿ;expires=Fri, 02-Feb-%d 23:24:20 GMT" %F Ö ò"p2³€®š ƒ /s2u.`§'æU2: s3r’1;Discardù "/Ž›? û ’²6c =(¤" ‡¤# How many‡/oUanent‘¶do we have?u³ounter = {"à¯_after": 0ï"Y$ KobeforeL %}˜3for¸ácŸò£key = "%s_;# %-e.valueF-câ‰[key] = È$c…‰À # How many cnow? õfor cookie in c: ókey = "%s_after" %,i.value,ùcounter[key] = I+ 1 -Ó# a permanentTõ got lost accidentally7ôself.assertEqual(b"I¡%],y•before"])HØtsession}õhasn't been cleared3{E~0i`we did[Shave 1vstæthe first placUv,NoôH_àò, 0) def test_main(verbose=None)Úð.support.run_unit(îåDateTimeTests,kHeaderC: BFile,Ja12LWP 4ñ) if __name__ == "_Å6__"º×True) =ó Python IEEE 754 floating point Nð >>> from sys imOS¶_info as FI%Dmath&*qPI = pi ðE = e You must neve•’mpare twoZ`s withÀbecause you #`not goͱto get whatøexpect. We treatN@as eI@ if „ðdifference betw ò them is small than epsilon.º¡PS = 1E-15T°(x, y): ...pp """AlmÜ€ helper }‰Es"""-úreturn abs(x - y) < EPS NaNs and INFs¬S In å12.6&anewer 5($‘a number)ñ infinity can be constructed ÛÑstrings 'inf'7q'nan'. ðRINF =ž(")N-;&AN0H)HE inf= 4ÁAN nan The Gñmodule's ``isnan``—ôinf`` functionsÙàused to detect< DANAN:dÂisinf(INF), Á önan(NAN) (True, Ñé0= -1 ‡W# -ò Ambiguous opera�²like ``0 * ¸ orÓCnf -`result#2NaNqp1* 0ƒ-Ò%/A HowN0una… „QCinf s2infX*F—J1.5 06a/ 1000Î� Not a NtÊ#reí£to another©�, even it ¬NBµ= NAN False;< 0%>=à All operationó s involving a NaN return óexcept for nan**0 and 1**nan. >>> 1 + NAN nan**0 21 *11.010NAN$0 0S÷(1.0 + FI.epsilon)Tù Misc Functions =ñ! The power of 1 raised to x is always 1.0, evenêñspecial values like 0, infinityQNaN. À•pow(1, 0)Á=INF-2NAN) ­0­òdefined as 0, ifÃàpositive. Nega  ¹ôare a domain error or zero divisioÕüðsult in a silenté0é10, Ô0Ïý20, éðTraceback (most recTðcall last): ... ViE¡i: math´e?-1 QSZeroDãX×0.0 cannot beZ3a n7'oÅ™Ùï Trigonometrio|Asin(·RNS@‚éÒ?cos¶<R¶<S¶/tal=R¶<S¶ð Neither pi nor tan ³àexact, but youµÀ assume that'a(pi/2)Àb large« Çc#pipvery smo:Þ# PIB±> 1E10 True--²PI) < 1E-1556a–dAN), a˜0, a1BP(nan,@)4É", ? ß(ˆS“ _7aequal(âY!, 3', :", M (c , Ï) HyberbolKô import builtins¦contextlib$py $gc ðpickle from random import randraõ nge, shuffle import struct$ys uunittesóweakref from collections.abc MâMutableMapping+D m_`s, sup„` py_S$ =.Rð_fresh_module('$wÑ', blocked=['=A]) cNjLã @contextlib. ômanager def replaced¦Tname,óment): original(ž2ys.Û s[6](s( =N$2tryUYQyieldf`lL ˆñ class OrderedDictTests: Tã°£_init(selfÐ{4ÐGelf.@'Pwith ;÷.assertRaises(TypeErrorR/Cð ([('a', 1), ('b', 2)], None)+ õ# too many args��pairs = \fQc', 3pQd', 4 be', 5)¡tÍØEqual(sorted(»Qdict(lÒ)).items()), E # *e input¤a **9co# kwdsa IlistÀ©º Á" #Õb�9w�%],r�c=3, e=5s ?s# mixed¶cñ # make sure no positionalE¡ conflict Õ€possibleb d À _"8=42¨0[('vE2)])“;n M^otherNO Š,O, 42…6 (¼):!._e2__){¦5# MŽôthat direct calls to 4ð do not clear previous¯Ftentý8d =äa5šd´I&?Pf', 6ª�g=7, d=4Ídh÷#¤~ Ðg', 7)]) ó def test_468(self): àOrderedDict = .'ñ items = [('a', 1), ('b', 2 Qc', 3 Qd', 4 Qe', 5 Qf', 6 ug', 7)]W�shuffle(_)Bargd‘Œ %Hd = #**7HÏñassertEqual(list(d.oQ()), !) z'oupdate*$BwithHy÷Raises(TypeError|ƒÂ#).zf€], None)4ñ# too many argsÑ(Opair¹"¥oja$od³°(m) €ˆsorted(oƒ5¬ # ce inputÞ› **:�LOkwds�!þÑ 2²0!A # ]–!�ñç9Éç¿], c=3, e=5õÃ*SmixedÃ&ð# Issue 9137: Namedöð ument called 'other' or 'V'>õshouldn't be treated specially.*_]?=23"[(”f, 23)];qÙ6={}7ƒ.oè 6#[(O, {}sòred=5, blue=6, ‚!7,è/=8‰ñ %),d õ0[('h4m8ƒ re{X÷@', 8ÏPò# Make sure that direcRs to dö do not clear previous content@R# addI9s4A areAPmovedXuthe end‰ 6T;<5Øi<[('Z´], g=7, d=4‹À self.asser÷ tEqual(list(d.items()), ñ[('a', 1), ('b', 2 Qc', 3 Qd', 4 Qe', 5 Qf', 6 •g', 7)]) Uÿ'self.assertRaises(TypeError, OrderedDict().update, 42)?)(Š)C€¼°ðdef test_init_calls(ˆ%):XV = []–lass Spam'N=keyCK�.append('*'}!Šreturn ([ˆ Ÿ3 \+] ÍP._Ø(k2, [ÂâK@fromÜ Id< = w�Hod =ï.PG'abcÔB0˜¯o°ñ [(c, None) for c in F]^p �, value=F¥|[0®y0ò¾§?abc¢$„·IsInstance(ßXïMutableMappingÁ°True(issubcQB+, @l¾_clearÀ$PpairsÒ ('® ÂÖ  �shuffle(Uç V D½³en(od), len-N.ñA0,0del.q §del od['a'bRNotInx&od BwithQ?1Key>Í*dÀf.assertEquaól(list(od.items()), pairs[:2] + ð3:]) def test_set2q(self): àOrderedDict = .'Wod = ñ([('d', 1), ('b', 2 Qc', 3 Qa', 4 ‡e', 5)])M ['c'] = 10„ù# existing element2f222=new-ůassertEqua2Xz×!10Î Øf0ãZtŸiteratorsv$Ù` = [('Y m‹m‹m•16)]’á�shuffle(U� Ú Nò), [t[0] for t in{ç:B.key¹A%UvalueC1„! Bðåreversed(od)),TX  Ò7e0$od&nTSp m®Þ €1), Ñ L)¿òdetect_deletion_during_b?ionb$ ØQ.from V'abc''inÖkey = next(it-¦del od[keyBwith`›ÀRaises(ExcepÒ”Rô# Note, the exact e* r;õd is not guaranteed—A†The only"Q thatS³a) willELsuccB$×XÕcsortedzÜ'›TypeError |ûv], Noneƒ“; ,O;²  : à!<øCÀ t in pairs]3) ÿ,self.assertEqual(sorted(od.values()), [t[1] for t in pairs]EBitemD54arevers‚5)),¨¯¨G[t[0š>nA])) Cð def test_iterators_empty(!):$\àOrderedDict = .'Wod = (ØWU = [].Gd¡list(od), .=*B.keyF1½3«2k od#4Óoš=!ç<©"0pop#$xÿñ('c', 1), ('b', 2 Qa', 3 Qd', 4 Qe', 5 gf', 6)9qhuffle(U& ~ Rwhile¥ÚÞ _4od.ï"),2&()mBwith Â÷Raises(KeyError<bQW w2lenÿ0ŸŽ__last‚.Qi, i)¶i¶¢range(30)]›;objÊ Lô>8ð bj11FTrue8oè=9.obj), 20'.©gsàÀhk, v =¨dÍ :Žf(k), všÒ!f('xyz'D kÓŒ %�`, 1234ô�õ(# make sure pop still works when __missing__ is definedrclass M#(¢à): û def __missing__(self, key): …return 0Rm = M;U(a=1)Fð .assertEqual(m.pop('b', 5)+�a', 6), V+6�+€default=^3Wwith ¹ûRaises(KeyErrorÑAa') ËH`test_eð1ityJ5ÒOrderedDict =hDoÐpairs = [('c'þ", 7 2) À3 Qd', 4 eU1('f4]M�shuffle(Ugod1 = ~!2! 'à�od1, od2)Ä€# same oø” implies £›1 = c[2:] + &:2É/od‘#Not ”»# different–-in˜ð # comparison to regular dÀTis noE•sensitiveÔ:(#‰ )$Mú»clengthR/d ¼W  ól[:-1])ÃcopyingÂ$³# Check tha#!ed7`s are ]¦able, deepQpicklHõ# and have a repr/eval round-trip*>65/odý ëcãG(dupâ÷�msg = "\nÙ€: %s\nod@" % 0Ù3®TIsNot&_, msg+w?dupQ &1lisV±.items()), %odh 0len—9oen(od)0 Ctype1 2<0od.$(K69 ‰!# Cð e directly pulls the modusRso weR¥to fake itF’replaced_4ò('collections',¹ ûòfor proto in range(‘û.HIGHEST_PROTOCOL + 1= �subTest(O=043hTloadsu’dumps(od,•)hÀ check(eval(Ãrepr(od))) ÿ update_test = OrderedDict($.0ECbcheck(I:V~ ;@def wñ_yaml_linkage(self):!¢;0 = .'ó# Verify that __reduce__ is setup in a wa"÷supports PyYAML's dump() feature.Z0In ¢ó , lists are native but tuple&ot8ñ pairs = [('c', 1), ('b', 2 Qa', 3 Qd', 4 Qe', 5 uf', 6)]…+odœ^g#¢.Äuod) --><ø# '!!python/object/apply:__main__Qð\n- - [a, 1]\n …b, 2]\n'Q…ðassertTrue(all(type(•0)=='P for x6od.’{()[1]))°¿not_too_fat &ñdo not save instance dictionary if eneededÕ¬¯VB3IsI¤('©1__,±à 1BNone-6f_()[2].•od.x = 10Þ@REqual?l–['x'], 10A/ n¼, {'x': 10}Ìÿpickle_recursivÓ% ô ¢od[1] = odG)"# xð directly pulls the module, so we h¥to fake it%âwith replaced_4q('colle=2s',�¥€ñ@rotoò“range(-1,•û.HIGHEST_PROTOCOL + 1AETdup =4bloads(ÖÛps(od, peÁ8µÖIsNot(dup, od7&*²/ .keys()), ¤48 Is0Œ[1], dupg.ã¶É ö@)û�.´ó£Iod),æ"¦(z*"|Teval(�)¤©—Ÿ ¨/)"€€Àe(self):  ÷OrderedDict = self. #õ# See issue #9826Wod = 3÷.fromkeys('abc'))¥['x'] = odqõassertEqual(repr(od),#"aø([('a', None), ('b c Ñx', ...)])") Q�def test_hð_recursive_values(�!):*wv (õ"42ô.d@r = ˆðtñ # Cannot perform a strongerºñ, as the contents ofJFð are implementation-dependent. All we can say iTWat weCBwant� result, ™€an excepT}•any sort.;G.ÖÐIsInstance(r,Êÿ5od[Witems8_Againh�ñ¯setdefaultæ$°pairs = [('e1|2 “3 Qd', 4 Qe', 5 qf', 6)]“Z�shuffle(U M / _o³³ = list(od.<FU7od.ÿ>f10), 34Â# make sure aÆdidn't chang \ †&, ¥_ 7 “ª“&105”0'x'¥�added toò/enI ˜@[-1].jf› Cg', :c=9), 9KÇ¢b@ sti_ðorks when __missing__Æfdefine½rclass M#(vŒoÍKÉ[, key(,†return 0sÜ•p)5á 0 in¦to­# ‚# Given E4 a, b]@lete5re-!¸À# verify tha� is now latVhan b‹ !'a€1\Qod['b2@del 'a'¯ < ^,‰62)][G6 = s oK°X1U¡À¿move_to_end“Àct oód = OrderedDict.fromkeys('abcde') ñ self.assertEqual(list(od), 12ÿod.move_to_end('cN_dec')N 6, 0Ÿ0cabÐ2ŸQ<>Ÿæb', last=FalseÇù:bcaùWwith 7õRaises(KeyError):ôû 'xÆJ-qn—def test_2À_issue25406(¯™³" =ÌR¼ß É åcm%?cabµ aX%!acXÚ/aöUÓ ?bcaÎ Ñ!baÏÂîosizeofÞ$q# Wimpy8ð : Just verify the reported dñ is larger than a regular dict”0F(a=1bo_F(**dEðGreater(sys.gety"of# Ad)) u _views&ò See http://bugs.python.org/DA4286qæPs = '#õ6quick brown fox jumped over a lazy dog yesterday before dawn'.split()W 'Ls.F1od.p!),‹.5 hitems(6 Zοride_updated&V[€at subcl Qs can1c c ) ÷out breaking __init__0Bg MyOD(]å¬!Viû, *args, **kwds-1rͧ Exceptionp ð = [('a', 1), ('óc', 3), ('b', 2)] ñself.assertEqual(list(MyOD(items).Q()), !) <ðdef test_highly_nested(O!):"aõ!# Issue 25395: crashes during garbage collection9àOrderedDict = V.'¥obj = None÷for _ in range(1000‘•5O0([(C…, obj)])K0del³support.gc_³( Ÿ_subclass]¶deleted = [êŠ Úü ×|__del__µ;]b.appenò&.i5^P8“i“ v4›‹y•obj.i = iY¡;EêÉ!, ó•reversed(8<)))ß0delQ_hash\ision*_½¿’6Key1©„Cinit… , p 4*Ó�! =$["PvalueŠBtr(i²)±'sfsmbreturnŒt mB#eq@, otherG+trï€`²=F. o1úexcept AttributeErrorK'\FFals*·Crepr¹²=K?�blocking(D D‚# See thé2`-handl€in lookdéÀ(in Objects/o I.c).ü¹MINSIZE = 8€3 & $*-1èËá(i << 2) + i +:F + 1ظCOLLIDING =¥key = Key(!` idÔ#+E:SvaoÅP(pÆod[key] = ..!4od[W¤t'after'[eV T+kb'odL`[(key,»—|]œciD_24347jÀct Çclass Key: údef __hash__(self) +ðreturn randrange(10%) Jõod = OrderedDict()qfor i i?; bPkey =™5v¶od[key] = iiõ # These should not crash.pPwith Éû.assertRaises(KeyError}ölist(od.values()¸H#OitemG(repr(od†%ƒod.copy(šÜütest_issue24348ã´" =7x>/1M.€od[Key()÷0Ôö/isõ`od.pop}ü<667ü5"""bðdict resizes after a certain number of inSõion operations,EPwheth)r™ ±e were dele-ð that freed up slots5theG�ø table. During fast node lookup,nõ must correctlyIärespond to allßð, even if the current "ûA" is6sam�a`old on”’We verifyÎhâpby forc¬'a N�Ñon a sparse o!a›×hen perform aW[çDPtrigg›nC²s (e.g. €). One Xqaspect ¢&isH…Âwe will keepõ0izeå¢ „ at eachcI²call. This ie-Ñat we handled\ñ® pr=&ly´Š’ Es c0Wú'0123456789ABCDEF'Þ*1*’`if len Z == 4K!¬r‚ aãƒø0ælast=False 'Ö•= c0 + c1ˆ42keyq@# Di uyfœrmethods"'¥A_setHC-— � ^$._`ö__(od, 'spam', 1êy¼äNotIn('NULL',  ÞYN_del·À OrderedDicót = self.OrderedDict Wod = '()É['spam'] = 1h2òdict.__delitem__(od, ?RBwith‹õassertRaises(KeyError):Ož‘repr(od) �def test_jp_clear(Ö5ÇóV‰¦³•.àäNotIn('NULL', ÐÑ?popÏq‡ºK0pop"ít‹¾£7¯setdefaultì?.a³6, 1p‹#oupdateµD]±"[( ³]µ(Îreference_loFÑ# Issue 25935J¥+zclass A˜3`A.od[A0ENonenör = weakref.ref(AîUdel A)§gc.collectˆÆ IsXL(r()Eüfree_after_iteratingÃïsupport.check_2 , B,©)µI‘lambda d:S¯(d.keys())]C_value_G,^" +§PurePython9lTests(`, unitÓ.!bCase):ìÀmodule = py_ @ Ô…ðCPythonBuiltinDðictTests(unittest.ñ'Case): """Builtin dict preserves insertion order. 0àReuse some of R* O#0edDCÁselectively.42"""=¢module = bss<=†ñ for method in (("nQ_initxr_update 2abc Rclear ·delitem " +@1setM°detect_deleêÐ_during_itera <6pop<"re"m„override– uÒhighly_nested1 ›_subclassqÃÀ_hash_collis‘“").split(Åósetattr(CPythonÑ�î#s,K3, g)s "c)) del/E @7ÁskipUnless(cŠñ, 'requires the C verž0he ¯Qons mù2') å¨ †(%, €§·ÍR2 = Ž?.%øcheck_sizeof = support.­@pVQ_onlyC"deúF³_exact(self�Yxg=elf‹'@calc�$dtruct.k#ª`alcobj#¾Cg œËFEbasijô ize('nQ2P' + '3PnPn2P') + ~–('2nP2n')BPentryw]·!('9‰p5P')Mnode=wcHod =L(@ÖV(od, Êå+ 8*p + 8 + 5* ð) # 8byte indices$�*2//3 * 'e table�…od.x = 1n52od.”�([(i, i) ÇiŸrange(3)]Ñ"T + 3*ABpO, 10t!16Fv16 + 10Hxé�.keys(), ÙV('P')�$2%\value&p�câ»:iP2xn(`(od), 2 �3(od¹)¾*à +Ã0`key_ch  j?X× 2ð.fromkeys('abcdSe') ñ self.assertEqual(list(od), †'abcde')2Wwith 7õRaises(RuntimeError):`gðfor i, k in enumerated '+öod.move_to_end(kwz–Less(i, 5&�#š/od�Å['f'] = NoneÕf<µdel od['c']cç˜Pbdeaf˜ñ class PurePythonOrderedDictSuboTests(#1): {ñmodule = py_collB V(.ôTpass —C”  ‘c� �áGeneralMappingu"(m _t/`.Basic$„Protocol-@amethod) def setUpC’G(cls�cls.type2]bµ„F$�_popitem( I2d =€s_empty_µ(1Õž1KeyšC, d.W�) @unitl€.skipUnlRMñ , 'requires the C version of‘ections m7#')‹ÔbmÉaj"›�R]svL'Myª¾ e  ¹ M³¼ r¸þ’Ÿ À test_popite£m(self): @d = õ._empty_mapping()"ò.assertRaises(KeyError, d.popitem) if __name__ == "__main__"n�unittest.ö() import codecs„ntextlib$io dlocale%sy5Zôencodings from  rRmock �0sup‘R try²0ñctypes except I·&q = None6ò SIZEOF_WCHAR_T = -1 else0 Aƒ.sizeof(Ðc_wchar) def%±ing_checkerÄ,#erË%ã(input, expectìÇ`Equal(yr/B), (1S, len)qreturn |ö class Queue(obje1"""þqó: write bytes at one end, readž�the otherAIÔƒ__init__óEbuffôÖ_2 =  G?…<Os;1+= ;¨:š7=-1<0if "<0ÓŠsM‰�pu(Á[:0] # make ‡Á9�sL# y [:Ÿ]2(€ .:/vó`MixInCdÒStateHandlingm" _s#_h0_dehI™X, u, Œðfor i in range(„8s)+r¬Nòcs.getincrementale$r(`)¿9¢part1 = d.*b(s[:i]ß ¸$1get E@±IsInstance(*Š[1], intR!# .` that ç¡condition 6dñAdocuÉ9for¸6# IêDOrDv() holdËbif note2[1]¢‚# reset Ar to cdefaul9ó without anything])edžS4d.s3 0]Ó3, 0D&P# FeeŸt‘previous ¸A may¼pproduce}} outputv�PTrue(óá†?[0]€5TheûSmust ìBsame=t E…5 µreate a neww@and ‚$it}J qö# we extracted . ldO , Àoder(encodingg)() ±d.setstate( ú part2 = d.decode(s[i:], True*ðself.assertEqual(u, > 1+12) v¡def check_mÂ_handling_en_Qelf, ±ing, u, s):;´÷for i in range(len(u)+1"&@d = Nñcs.getincrementalX1er(-in ª1î"{e(u[:i]è+$g8 !~&ŠœŠsŠð class ReadTest(MixInC—SÞH•W´ @ial(ìr, input[˜ialresult­à# get a Streamm0er Â5theã  and feed õbytestring versionûB# ofs1 to-preader 41 by.Ô€ everythGçavailable fromNo š‰›S thatbÔ eÑ·appropriateLqentriescõ.'Öq = Queue(b""3r­Ôa.è¦q/gU = ""ZT+(cŠ)'Azip(§MeY 3½H€q.write(bfs([c])ˆ ó` += r.¹ Z& 0 uS#rre's noÈ@leftÒ·ubuffersi�(, j'ÚN!, –T2# dfñagain, this time us^'n _ $rE ) �@+çSl+æòC�ÓP�3b""Þ /d.Úê� whether×ðreset method works èFerlyÍ.&¥ Àresult, partÃialresult) ð# check that there's nothing left in… buffers9öself.assertEqual(d.decode(b"", True), ""k2U0, b([”CiterTF ene¢d = input.(] 6ing.¦eB,€"".join(e7cs.ƒð[bytes([c]) for crQed], j�‚!) `ñdef test_readline²!):Œ!0get1er(š"smù0o.BŒ"IO(ƒ=sreturn ×i ·(d´8—”0all¶sr°, keepends=é», size=None´;Ver = rÛøeZY = []QwhileJ'/32 = `.(ˆ¢« E ifë :b!Ybreak”0@s.ap( Zk#"|K"sSðs = "foo\nbar\rõz\rspam\u2028eggs"u€sexpecteò6|7v|baz\r|9|: noªv>:8 2 ÔXúsÖ”ùHi ;@Fals<–Bj010)m?�*, @…o­.€("\n", "£¤×�# Test lo1ñines (multiple calls to¨ ()2e&()¼*vwý:vwop1(i,ª1endI‘enumerateƒ´ |$vw¤õ(i*200+200)*"\u3042" +NýÝ?vwo7 µò H5vw)7'vwýHÃV[Gvwo)Z‹†wÍ»Qfirstƒð might end with \r, so%#)Qer haºàlook ahead whe"  this is aõ e \r or a (G²ˆó{ange(80 # Ž$inŽsŠ1110*Ý7*"a»— + "xxx\n�Åiðer = getreader(Ks) ýfor i in range(10):$3ÿself.assertEqual(&*preader.ÿline(keepends=True),8°size*"a" + 8?end,Äv O"xxx\n"•‚er = get (kOFals€áv4— wuMðdef test_mixed_mA2_an (×âs = ["Humpty Dïsat on a wall,ë 3ÿhad a great fall.\r8ú All the king's horses and a_men\rñã"Couldn't put »ñtogether again."]›ñdata = ''.join(õ;4™;s±ðm = io.BytesIO(Oq.encodeP Fing)U<preturn (6cs.c„4(c%) ¯ô# Issue #8260: Test Êá() followed by(vfdr²f”!),dOs[0]1:(),FG[1:]öh7âO3211ãn›äN1/1]0¢ 10*>3[le‡a  + 1:][:10ƒ_16636× Xp? ¼*(#Þ/(nÛ9(Cð =40, chars=5), data[:5])  ðself.assertEqual(f.read(), data[5:]) )-E'') (ñ# Issue #32110: Test Wän) followed by9pf = get+?er(yôsize=40, chars=5¶/:5¶1.-@0), ä  10*;o6:106]_12446 WlinesY|1, [ 0[0]B] + 1ðdef test_bug1175396(B%):ûUs = [c'<%!--=j\r\n',LQÿBLOG index page: show recent articles,>†today\'s*5 or à of a specific</e.JÎ2O--%>Pÿ<%@inputencoding="ISO-8859-1"3ÿÿtemplate=TEMPLATE.y0rimport=± frog.util, 6objects3 Afrom\ó.storageerrors �SEK-Slogging"Clog=ð.getLogger("Snakelets.Oer")=Puser=À.SessionCtx.AmEngine6 ?¶‹Aÿ FromDate(date, count=None):Ss™entryids=•ñ.listBlogEntriesQ?Dð.reverse() # descenò{"if¢œ\=©![:×]V?tryQ ‚return [¾ï.ìyy.load( iPe, Id„r Id in � Šxexcept /,xœ ðlog.error("Erro÷r loading articles: "+str(x))\r\n', ' ñself.abort("cannotJG">Rßshowdate=None!Aarg=ƒÿRequest.getArg(v0if 0Ÿ="today":QØ/#-ÿ TODAY\'S ARTICLES?�Àwrite("

Tn5\'s_

 ð = frog.util.iso’/) zóentries = readAÊ”FromDate(Y%eloactive eACTIVEŸ redirect­'Y&"("v/.yŸ_loginž¯LOGIN PAGE™p˜ —Lÿ OF A SPECIFIC DATE8(1 = Cú±Parameter("�éc¶£+ ’ten on %s¨%†`medium\‰Ph‘+/se£eRECENTƒB þoRecentŸþð =storageEngine.listBlogEntryls‚|1if CÜ%9?=[]Å&ßSHOWAMOUNT=10) Dfor ®? in�_…�.extend(U &, ŽS-len(>?)) e8if 2&>=K& <_break % $]Ôñstream = io.BytesIO("".join(s).encode(p Uing))>nPer = & cs… 2(g9˜�(i, line)™`enumer­A%):eÀ�ÀassertEqual(9�, s[i]) *�def test_@BqueuºLðq = Queue(b"")  òwriter = codecs.getñ(self.encoding)(q) 1{ read445Õ# No lineendsl.†("foo\r"iƒÂassertEqual(g.KP(keepP�=False), CAXr__\nbara-^Ÿ (baà Ÿ?baz]-A,5") š?# L­E4Tru¬ Ž ®)b/\nR"? / ¡°%^¯#@Û ™Gû,Dñdef test_bug1098990_aï!):!s1 = "x / y V\r\n"S2SPoffen‡AÀ: ladfj asklðklasdj fskla dfzask@fj l1 fjûzzzzaa%whereisthis!!!r3rAnextm.‘Ò = (s1+s2+s3) e  ,-ötream = io.BytesIO(sßÇHsH9y_), s102030"]KbB Ka”ss$b ,Þ stillokay:5+xx$4ûbroken!!!!badbad$5$PagainH& o+s4+s5,rÀual(reader.róeadline(), s1) ð self.assertEqual(reader.020304050A"") ñòill_formed_sequence_replace = "\ufffd",ð def test_lone_surrogates(2!):PDAñRaises(UnicodeEnPrror,\qd800".e!, 7 ?ingÏ”"[\uDC80];€Góing, "backslashÊ5"),�¡ "[\\udcP)‹*Oname†o¯xmlcharrefŒ��c+oignore” zBý?|F"# .Utial  eeacters*ÖN¿?800Å 'J€-.0bomM°_ðfor before, after in [("\U00010fff", "A"), ("[ ]F ç0("A*D&)]«#sÿ# =…Re^Å)[len(bom):]äF±ED]estring† +*ð2" + x4»0 = œ# +Ã�+5± ¦ sI®@7Ý ê'Deê £!.d‘Y u `7plÀ  ÿ"surrogatepass"), +étest_sequence),ùself.assertEqual(,�.decode(&�encodingm q ±"_tring¯/� "ignore'ïbefore + aftery1oreplaczi¥ill_formedµ_J�”backslash&ù= ''.join('\\x%02x' % bú ¤Ÿfor b in �1 µŸ :ð class UTF32Test(Read `, unitÝ.aCase):×± = "utf-32"ò if sys.byteorder == 'little':1¬ð = b"\x80\xdc\x00TOelse<4@A80" ‘ðspamle = (b'\xff\xfe['"‘0b'sp am F4¯b¯Ò³.ffi»F4)_@def Ñ_only_one_bomú)Zð_,_,reader,writ "‘cs.lookup1.T 9!# Õe some stream´ös = io.BytesIO(6Bf = h'(s. ("c"çd = s.getvalue_ð# check whether ðe is exactly one BOM &it¯4`True(d+‘jle or bv�# try to H@ it Ï\ dÞ! =3(er wÀ f.XA(), ’"â?badÜ † 4*Æ(ffa$ =î geÃd�Ý®œ Raises(Uni.rError, «�%ðs = io.BytesIO(Ã8*b"\xff") öf = codecs.getreader(self.encoding)(s/ðassertRaises(Uni@�Error, f.C!) `ñdef test_partialX!):MUcheck" P"\x00°ð\u0100\uffff\U00I00",.[@ð", # first byte of BOM £-osecond.Othir-mfourth[1 =>¿order knownœ'E +9¥dEv "Y�Ž(k=]` ¼�handlers½ �Equal(('Üjd', 1)›p.Àcs.utf_32_deÿ (b'\x01', 'replace', True){qk,WignorjµeÒ÷ DÉÔ ä —£, "strict"þ H-r_state‘N _º4ingdoÖŽ « P"spam1", D +lešzV,be£œissue89410# I #ñ: insufficient result allocation when c�ing intoõ# surrogate pairs on UCS-2 builds.+a€ed_le = ×`ff\xfen1' +Ù1e* 1024Fh^'»"' -ÀÀ32_decode(enócoded_le)[0]) "en²be = b'\x00–fe\xff' +1¥00' * 1024Fö self.assertEqual('\U000100-,.{ƒÀcs.utf_32_de(š²ð class UTF32LETest(Read °, unittest.aCase):pFñing = "utf-32-le"ñill_formed_sequenc”"\x80\xdcî!" /@def b�_partial(õfËe.check"8"P@ff\uf\uffff'" [<@ "|@90dELv "YÔŽ(kt]t)óosimpleòö"[Q203".z4 ping), b�3\x02\x0R"noerrorsn Raises(Uni*D0E5 , K#leN ];’üff", "strict", True–œissue8941™0# I #ñ: insufficient result allocation when ã–Eintovõ# surrogate pairs on UCS-2 builds.+]d´PžKS¡žBž(bž¢¢/80žÿ À "\x00\{xff", o"\x00\Do\u0100v "YO\uff Ž(k@\U006 8]¼!) ñdef test_simple(self):åã.assertEqual("[¢203".encod4 sing), b¼01\x02\x03"noerrorsn Raises(Unic DeE5 , ács.utf_32_be_d—Á’¶ü "strict", True–œissue8941™0# I #ñ: insufficient result allocation when •…ing intoPõ# surrogate pairs on UCS-2 builds.+]bd = b'`P0 …' * 1024- ¨'¨4000-!S(„ð )[0]) class UTF16Test(Read `, unitG.CCaseDA¡= "utf-16"´ö if sys.byteorder == 'little'~ðill_formed_sequence’"\x80\xdcLOelse4 dc8"øQspamlN'¹P\xfesZpam'ÂAbAeE/001 'ƒ{Ìonly_one_bomzð_,_,reader,writ*alookup1~œõ!# |Õe some streamõs = io.BytesIO()Bf = h'(s. ("õ"µ§s.getvalue_p# check"Pther õ e is exactly one BOM in it–Þ· (d/‘jle or &be¦�# try to H† it back\ d8 3(er w f.%A(), ’ ï?badÜ †¥Ic$ =ð geÅd�6elfóž B<­ø'„ˆà") f =ó codecs.getreader(self.encoding)(s) ðassertRaises(Uni@�Error, f.C!) 1ñdef test_partialX!):PMUcheck" ð "\x00\xff\u0100\uffff\U00I00",.[@ð", # first byte of BOM £-msecond.1 =>¿order knownA ¨š ò4 *> "nJ(k]Œ ��handlersŽÛ�Equal(('Üjd', 1)lÄÿÀcs.utf_16_deÿ (b'\x01', 'replace', True)Lqk,Wignorj†e£÷ ÒDÉØÔ ä2 b"ª“ "strict"þ -r_state‘ _º4ingd@§Ž « P"spam1", D +lešzV,be£œbug691291ø%# Files are always opened in binary mode, even if noA was ð# specified. This means that9ðautomatic conversionDÇ'\n' is doneN!onZõing and writing."ðs1 = 'Hello\r\nworld '“bs = s1{ ‡Hžô addCleanup(support.unlink, fTESTFNÖAwith/2"Ö, 'wb') as fpž�0fp.ÇeGd%ò warnings(('', DeprecationW)õW�Der =zÄ•DU', Þ=¨ ÔO º0Î%Ÿð(), s1) class ðUTF16LETest(Read °, unittest.ñCase): encoding = "utf-16-le"ñill_formed_sequence = b"\x80\xdc" '@def ZÓ_partial(self^be.check"8ð "\x00\xff\u0100\uffff\U00I00",.[@ "T„4 ¼> "J(k ] )lerrors:Js = Ø0(b'rA', 'è:d')@(b'AäZ#A$ B)CD3?BCD6&@\xd8\%A&T*AÐ"WØ+^ñfor raw, expected in‡sØ~ðassertRaises(UnicodeDeE• , ács.utf_16_le_d tO �õ'strict', True)+~¢Equal(raw.\"('o leì–replace')Ñ @lnonbmp@ b"›Q203".Þe4 ;ingJ§w�¶d8\x03\xde'Ñ k.Ý,~r ¯‘) class ÃBÃ(bà dcÇÃÿ¶À\u0100\uffffK", ð "\x00\xff\u0100\uffff\U00+002]@!) ñdef test_errors(self):iUs = [0(b'rA', 'p:d')™!400A&A' 000BÈC DZYOABCD6 d8+)%O\xdc)600A*AÖ dcy+dñfor raw, expected innsbPuð.assertRaises(UnicodeDeE› , ács.utf_16_be_d zO �ù'strict', True)Î~¢Equal(raw.\ ('utf-16be–replace')Ñ FlnonbmpF b"¡p203".enÚ4 ;ingP Ò}ÿ–\xde\x03'Ñ k.Ý,~r ¯ð) class UTF8Test(Read `, unit2.CCaseJd@ = "Q!8"�ÿill_formed_sequence = b"\xed\xb2\x80*_ŽTQ" * 3Y0BOMI+''äqpartialk›Zdcheck_"Gc7i8i 1F �A4 o\u07ff> "7M\u08mÞªl(Cê~.} 0@I gž|r_stateÏu 7fD} 104j´a“_handlingrq«€ RBu, u8µ }á•Àr(self):  ðfor data, error_handler, expected in ( +ð(b'[\x80\xff]', 'ignore _[]'),- breplac.b\ufffd:äsurrogateescapB€dc80\udcŒ| ™backslash…ÌÍA)):Èðwith self.subTest(6= ;=I FCg= x*w±assertEqual{�.decode(‹encoding‹ÏHx ªådef test_lone_sshœ�super().,)Ko÷# not sure if this is making sense for/°UTF-16 and %32é±"[\uDC80]". "¿2" _cBOM + à2]')Ƀ Raises(Uni†E€ eEBz) as cm>«Ï\uD800\uDFFF·õexc = cm.exceptionÀœ%°exc.object[ `start: xend], 'Œêþ:Dpass sß"abc\ud800def–\”\pxed\xa0²bh þ²"\U00010fffé�=Â\xf0\x90\xbfœ"™ ¶¼&šˆ\0 b20 Î /b_cW›V/b"P Š0 ÝPTrue(Ó¡cs.lookup_Ð(öÍ D§  t"ãðv#À b"abc\xed\ÿPxa0z".decode(self.encoding, "surrogatepass") @unittest.skipUnless(sys.platform == 'win32', ð 'cp65001 is a Windows-only …Ác') class CP(�Test(Read %, �pCase): f·C = "b!" @def ³_#æ59Qs = [-ñ('abc', 'strict', b)Öº('\xe9\u20a.þ b'\xc3\xa9\xe2\x82\xac'@›U0010ffffn±\xf4\x8f\xb;Yudc807NNonec(aignoreÍO breplac(?) ˜backslash2"\\pˆOname3 ŒÂp\xed\xb\0¥]Éñfor text, errors, expected ins=ò'if"`s not R %)>tryd1d =yM$e(ô'Š)¤5 except UniE… eE¶0 as¿o²òfail('Unable to „0 %a  } with 'w{'(Ë=%r: %s' % (@>rr)¼†ÂassertEqual(‚dp 6q4'%a"´ï, %r)=%a != %a±—/p ¥NelseA·~Raises(~¹º,oÝgx^xgyx_ 8› Œ? _ ;–;e’I\xbd~x'\ufffd�ëD(b'[ ]1[¤]1ñ# invalid bytesNIM*ffI¦©3[\x)ù-'[n R–"'[Î0 —Pescap38 dcx‘´Â 1Ê 1ÒÀ\ufffd\ufffdc]'), ] õfor raw, errors, expected in tests:,='if"ªs not None%)>try�decoded =x.¤('cp65001'‰)v8 except Uni@DFEµ0 as¾nòself.fail('Unable to u“ %a from |} with 'y}')Ê=%r: %s' % (@>rr)½‡ÂassertEqual(ƒdp�lT '%a#"§ÿ", %r)=%a != %a° – o ¤?elsĶ~Raises(~¸3raw¸/, Üd1defbð_lone_surrogates(w)Ï.< † En Á, "\ud800".e%, 0ŽJNõ, b"\xed\xa0\x80"ÈQ ×”"[\uDC80]ˆ(6÷, "backslashreplace"“ö Ïb'[\\udc80]'ÃrOnamemV¯xmlcharrefs��á(7_escapRxO*_ignoreÏ(9?c E Ïpass_handlerK>2abc9?def´ X± "M;Sºb0n 7ƒR| ç"\U00010fff\uD8y$4¢f0\x90\xbfD /\x:*À "\U00010fff£\uD800") ðVself.assertTrue(codecs.lookup_error("surrogatepass")) class UTF7Test(ReadTest, unittest.TestCase): lñencoding = "utf-7" …@def 0p_ascii(�)26ñ# Set D (directly HØed charactersÍñt_d = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'v\ÿ 'abcdefghijklmnopqrstuvwxyz.¯0123456789¸\'(),-./:?'™fÂEqual(set_d.Ìô iing), '/')M00.deÌ]MaÂO (optional j`ö o = ' !"#$%&*;<=>@[]^_`{|}ÅUïoãe’¿¢M 0ï oM5# + Y_'a+b'¦ob'a+-bÔ "Š^ŠÅWhite spaces•!ws`o\t\n\rR/ws©u ó-¿wh×# Other ASCII*ÆoÒÏÐ'.join(sortedüô(bytes(range(0x80))xE)) -H£ 0setLA_d +3ßo + '+' + ws)0 žE�@b'+AöQACAAMABAAFAAYABwAIAAsADAAOAA8AEAARABIAEwAUÆ Æûb'ABUAFgAXABgAGQAaABsAHAAdAB4AHwBcAH4Afw-').QpartiI'lf0ádcheck_" ÌÅð\x00c\x80d\u0100e\U00 Y00f',0[À+'a#++/+-be|c~¾• !d"À û 'a+-b\x00c\x80d', "bo\u0100Ž(e)ÿ6@\U00y{3f†]K!) ñdef test_errors(self):tUs = [ú(b'\xffb', '\ufffdb')¦E(b'a$a% )/0+IKvRvA+IK-š$›O+IK,%xmB20ac–sxt+z?wgrW?wgrY,Z,[-µB\èKwgrBb4ge/,+IKw5Z \u5/01f×g /8"ËÜ8bo3.˜ø. þÃñfor raw, expected inÍsÁ¯Pwith Ù÷.subTest(raw=rawé('ðassertRaises(UnicodeDeE& , ¡cs.utf_7_d ÿK «ù'strict', True)W1€PEqual«.bp('utf-7M–replace')ü ÐlnonbmpÐ _',p4A0'.enÙ4 öing), b'+2AHcoA-'±J¯ud801\udcaLÀlf.assertEquó&al(b'+2AHcoA-'.decode(self.encoding), '\U000104A0') &˜assertEquJI-w'\u20acvŽšÏb'+IKzYAdyg-› (ç wí RïQõ 3û‡ŽŸwgrNgB3KA+lµ9 t<s!4ñ def test_lone_surrogatesÕ!):$,$Us = [ÿ (b'a+2AE-b', 'a\ud801b'),&D\xff)Offfd)M$LAs&JH&—Q)JÈ/Ë2‡2±0d‘_  1f�"IK7Ê:q¦/5²n 7 Ã]@ñfor raw, expected in±sœŠQwith c÷subTest(raw=rawÄ('Š4rawË`'utf-7Û–replace')|ñ) class UTF16Exi@unit.qCase): À\]errorS‡ Raises(UniQDWE5 , Òcs.utf_16_ex_u@, b"»û", "strict", 0, True)bad_arg�OTypex ) ReadBuffer÷(\arrayWqimport 4 Qreadb€_{!e(E.@("b""mspam")�"6, 4x 4Bempt®À): sðelf.assertEqual(codecs.readbuffer_enñ(""), (b"", 0)) def test_bad_args(self):!_ðRaises(TypeError, Wk)?+ð , 42) class UTF8SigTest( `, unit¸.CCase³ëñing = "utf-8-sig"�TBOM =³@BOM_N partialdcheck_"S!ñ"\ufeff\x00\xff\u07ù800\uffff\U00010000",:[L "� # First Û�has been ùÏ and skippedb'Ö¿", # Secondi em�iAE" ¡8å�byte of ã@ed "k"Nãz&ÃG-�ô� X•O  w(M\u08¯� \V.OI�4�]¦ ªœug1601501§£# SF bug #!!: µ’ that theþâ works with a $nðOøstr(b"\xef\xbb\xbf",\]), ""¤,om�d}ðgetincrementaldeG'r(°')(BËBspamÆ‚ ¤"d.E2(s. ML), s¡Žstream_b¨cunistrCöABC\u00A1\u2200XYZ†´*Ã4cs.WP + b"=òxC2\xA1\xE2\x88\x8Ep®)er Ã/ðfor sizehint in [Noÿne] + list(range(1, 11)) + \ ù [64, 128, 256, 512, 1024]:3ðistream = reader(io.BytesIO(bytring))5o5Aio.S":IO($zwhile 1n¬þif sizehint is not None)-sdata = ¦.¤(> p.?elsH)) ÕA!if�v�]break7p.write(> \dgot = '‹getvalue2ð self.assertEqual(got, uný„¯’def test_„`_bare(;)²4õ = "ABC\u00A1\u2200XYZ"ÁâA = b+òxC2\xA1\xE2\x88\x834„àer = codecs.geB;¶"utf-8-sig"œ7forð0n [íÐÿõàclass EscapeDeP�Test(unitã.CCaseÛû\emptyõ ?PAcs.e_!_d`p(b""), 7, 0×>©ytearray()FŸ,Rb in ç3256úb§–F([b]dÖif b != b'\\'  à’‘(b + b'0'Ï C, 2)ÁÔ±×#RchecküAing_!erL", ˆÌ÷(b"[\\\n]", b"[]P ýr'[\"]', b'["]'@Sr"[\'?'@a /\\!a!?x07#b#8#t#9#éB\x0a#À check(óbr"[\v]", b"[\x0b]") acheck(#f#c#r#d#7#7#8$8%#41%!!G!D$10EAEC1010h/A0$5Fx­h/x4hõ for i in range(97, 123):¡¨Öb = bytes([i]¼€if b notCºb'abfnrtvx'@)ðwith self.assertWarns(Deprecation;ing{;(€"\\" + bL �g( c‡.upper()kso$kAr"\87\\8U.9U9U6s"\\\xfaX !) $ðdef test_errors(ãÄ�decode = ¢cs.escape_AÞ5ÐRaises(ValueES", -w, br"\xÓ68[\x\8bEqual(a†ðx]\x", "ignore"), (b"[¤&6)øCereplacDo?]?", F÷ 0ø$ U¶ _0]\x0û8ûEýH� class RÀingTest(unitF.CCaseC^r. `€f = io.Bž6IO(¢&f2u En~ÐdFile(f, "uni�_internalõHutf-…·f2.write("a{‡f2.closeiõ-# Python used to crash on this at exit because of a refcountP# bugD_™¢csmodule.cd #bTrue(f‰ð d) # From RFC 3492 punyG_R‘cases = [ló# A Arabic (Egyptiank�("\u0644A752 !28 3 144"Y >,ð48\u0634\u0639\°u0631\u0628 4A`1F", ò b"egbpdaj6bu4bxfgehfvwxn")!ñ # B Chinese (simplified):?€("\u4ED6 EC 3A C0 48€0D\u8BF4 †2D\u6587~ö ihqwcrb4cv8a8dqg056pqjye€C€½traditional� 5011\u7232i�@9EBD �!AA™�ötvzc91f659drss3x8bo0yb„ò D Czech: Proprost#Eesky( 0050\u0072`6F\u01›<0070073$174"> ", 1B!6E5DC7 76 E710D>"06 X6J&79†1ProÏÇ·Æ-uyb24dma41a†E Hebrewþ005D€ 5D˜d5D4\u0†!5E!E9„75D8˜>D¤ 5D´ 5E´"5D>P2> &&EAÖ÷ 4dbcagdahymbxekheh6e0a7fei0Ü÷F Hindi (Devanagari]0092ª 93„9]0094@d917\u0$b(94x 92’ 94à 91 94ÈVJ09>'39à8 h|ˆ3V2h8947>´†F0902ði1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cdü…’#(G) Japa ÷kanji and hiragana5 306A\u305C 7F 93ð65E5\u672C\u8A9E9×@8A71 57 664D8PD@3044F304BÝñn8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxÓ×÷ (H) Korean (Hangul syllablesÔ C1oðACC4\uC758\uBAAÐ4E0\uC0AC\uB7¢ B4õ(C7¿ D5 ðAD6D\uC5B4\uB97CJb74\uD5$ B2>(BA>0C5B^ 9Cp�098\uC88B>FAE4Có&989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5j6öb"psd879ccm6fea98cÿ  (I) Russi)‡Cyrillic!0043 43  44 43ò 43º 44Ø 43Exà 434e0 >8Vøb0>!0044J ˆz|4.4(3A>&38Aøb1abfaaepdrnnbgefbaDotcwatmq2g4l�J) Spanisborquol…G%"00ÛC0ð#00$&çÀ64\u0065\u00€6E\u0073!69DP70" "!6C5 6 >48 1>2D1 72D4 ˆ |2F 6F>B6C",�ñ$b"PorqunopuedensimplementehablarenEspaol-fmd56a"), 9ó# (K) Vietnamese:õ Tisaohngthch\D6 iti43ngV`tA(qr54\u1EAõ—68$C�Bq…F—_ 67978ó8>11ECpF >9vB‚\>@0056jK31ECv¯TU khC`chniti öt-kjcr8268qyxafd2f1b9g®÷(L) 3B<b33\u5E®ð42\u7D44\u91D1\u516B†48\u751Fšö 3B-ww4c5e180e575a65lsy2b†õ (M) -with-SUPER-MONKEYS‰á5B89\u5BA4\u59q�F8E\u607ì2¹7#/H0074I6Å&5‡58 50a05H$(4D>4¡4¡'4B2Ë&53ùÄø-pc58ag80a8qai00g7n9n øN) Hello-Another-Way-7ã2 305D\u308C 5E æ¦5834\u6240Þù-fc4qua05auwb3674vfr0óO) 2 30¹ 30Ë0306C¢@6839™“14E0´&32“ø2-u9tlzr9756bt3uc0v“ùP) MajiKoi5de0›(ƒ130Bý!D4h:'ïød9juau41awczczplåS) -> $1.00 <-d"00²3ä2Í2Ø3¾232‹3 2sf1-")ið] for i in punycode_testcases: if len“(i)!=2: ðprint(repr(i)) class PunycodeTest(unittest.RCase)@@def 0_en,S(self^ñfor uni, puny in)_5RcasesH-ð# Need to convert both strings`lower ;u, sinceÈ@ñsome of the extended žBuuse uppC{but ourE£ö produces only x2. Cœ�ing justÖ; toE2óis also insufficientº ¬ûinput charactersM(ar¸.uÙ.assertEqual(0strÃ.0e("�äÑ"), "ascii").°?(),>2, +!)  dec. ÞQ.bÏ)ƒóµ! =Ÿ,î  8s20Uniò€Internal+v9@RðskipUnless(SIZEOF_WCHAR_T == 4, 'specificþ€32-bit w(2_t'ïr¬bug1251300v0# D޲@with•«#_i¬2 uswðnot correctly handle ","ö# points" above 0x10ffff on UCS-4 builds¥eok = [A›ð(b"\x00\x10\xff‚", "\U00N"‰15d01\x0110411!]ƒOnot_–•7�‘"!"80º‰0!ž%!06O[ºS¶,ÈW*okGðif sys.byteorderKŠ"little"*ŒO0 = 2´s(reversed()i-Cðsupport.check_warna(þ+O\šu?”"vöñÀ Ëõh,('½ 3Åc has been '{ ó'deprecated', D BionWd)c sRaises(�÷àeError, internÏal.decode, @"uni,µ_internal")6õif sys.byteorder == "little":&còinvalid = b"\x00 11"*ÿ_backslashreplace = r;Oelses os";úwith support.check_warnings()Œòself.assertRaises(UVDˆ_Error� C» ™ ›#jEqual(h(g3, "”/")µ †'\ufffd'3šM 7£ï p!) —ð@unittest.skipUnless(SIZEOF_WCHAR_Töó4, 'specific to 32-bit wchar_t@def K_~ _e÷À_attributes('::tryG= ,('© ·Ác has been 'ÑŽó'deprecated', D BionWá)¦MÙá;300"¼T!~except j as ex1X½®¶ex.encodingg¶ >ÿ, ex.objectM 4+Ostar* 8*6endRÏ­_fail(šP@callJ ’R¢s.registerÂ#("­I"bTest",‚s.ignore+sâ4r =(3get  R’ab = "ab"jeÂý„ýN˜s("%s\x22ÿ%s" % (ab[:4], ab[4:]‚ dð "ascii"),  ô"UnicodeInternalTest") 1ñself.assertEqual(("ab", 12), ignored) /°def test_enQ€_length(B!):"Uòwith support.check_warnings(('u�#_iŽ JÅc has been 'HLó'deprecated', D BionWk)‘EÉ# Issue 3739bË2r =‰Ss.get,("­7Uù ;9–a")[1], 1h1 £\xe9\u0142:2t7 l8ƒs.escape’’(br'\x00'~ðH4) # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html namm p_ Qs = [Oñ# 3.1 Map to nothing.÷(b'foo\xc2\xad\xcd\x8f\xe1\xa0\x86 Cbbar�b'\xe2\x8$b 4²baz\xef\xb8 8@!l-qb\xbf',• •‚barbaz')Ãò 2 Case folding ASCII U+0043165ãFCAFE\HcafeW3WA8bitAòDF (german sharp s)Rá# The originalu cšñ is bogus; it says \xc3\xdfØ(69ê(ssŒ4Œñ U+0130 (turkish capital I È3dot“[V4\xb0é˜i\xcc\x87b5b�multibyteó1I237AéVR5\x83&ba^0\xc4äXe\xb9f6fPU+212ž033CžR1D7BBdð# XXX: skip this as>ñfails in UCS-2 modeD$#(z’4\xa1\xe3²ª�f0\x9d\x9�b«s# 'telc¤°8\x95kg\xcf×´p(None, qð7 Normalization of&006a030c20A04jxcX0 =7­$ a‚á86¨1FB7 and nˆ9�¨bî7î d@6\xc œÐ9 Self-revertI¼Vs/F0uû,½û’`\xc7\xf0ó¯¢#(b0/10  /39 fGe\x99f1fBf ÌkfÀ # 3.12 Selfð-reverting case fold ñ U+1E96 and normalization. (b'\xe1\xba\x96', )¿# 3.13 Selfn/F5ndnnõ4 ASCII space character U+0020Ä ¹( '@b5 Non-DO8bitIAI�\xc2\xa0P6PŸmultibyteU8168UbU9a\x8YHNone©7Y9200Y2U²á8 Zero Width SGeU+200b=4\xeFbF G9ž3ž3šX  #20àvcontrolâsã!10'7F­f10\x7fQ#\xO'21±ø aY'85Yú$85Y ¡'22RúWG180EWüoa0\x8e[3£…No-Break¬8FEFÿ—ef\xbb\xb¬'24©Ÿ8D17÷ßf0\x9d\x85\xbÿú5 Plane 0 private us‘HF123÷Ÿf\x84\xa3÷6S/15T 4Uïf3\xb1\x88\xb4Y7Y6YY10F23Z@4\x8³Z 8\‡øcode point U+8FFFùfV®ý[SI10FFþf§bT ¬�30 Surrog§£gU+DF42IPed\xbõ2E3B¦plain text›x U+FFFDNŽRNð2 Ideographic descrip‡ W82FFš—é–ù33 Display propertyPG0341§cñ1£ähcc\x81?ñ34 Left-to-right mark 2Ü›8Õ Ñ35 Deprecated@'2A‹@$aa� Äð6 Language taggË%ðU+E0001. (b'\xf€3\xa0\x8P1', RNone) ñ# 3.37 Language tagging character U+E0042.;d(b'\xfU_1\x82Uù8 Bidi: RandALCatTš05BE and sgïfoo\xd6\xbebare9e OFD50e¯ef\xb5\x90i/40i ?B38iW9\xb6iÑb'foo \xd9\x8ëš-41wÐwithout trailª`ÕU+0627 U+0031I�\xd8\xa7þ-42dýSZ>628Zc8¦%uÖò3 Unassigned code pointk0kõ# Skip this test as we allow u@—#˜í˜'# î( ,’44 Largerh²(shrinking)ë¢# Original!ñcase reads \xc3\xdf†Â(b'X\xc2\xadó9f\xc4\xb0\xe2\x84\xa1j\xcc\x8c-0'C ;gaa\xce6Ð0]CxssiC€7tel\xc7- 7( 'n5ÞoexpandÞ9Þ03\xÖ"e3Á/96âî(92,á8Í!\xN8 bd 1 bc N‹80\x8-bs28d\x29!2:#a2Õ cNA88')›ð ] class NameprepTest(unitŸ.aCase):/1def.#_n.S(self…�from encoŒäs.idna import 3I,ðor pos, (orig, ~ôped) in enumerate(7_�skC0if <1 isÿ¥p5pedv‰continue‘# The UniÀðstrings are givenšYUTF-85‚S= strÉò "utf-8", "surrogatepass"s�$ifò¿ `Input ­Ðains prohibitcÍsŽ_•ã.assertRaises(ÓeError,‹,> —NelseHœ ç/, ê“>tryV¬UEqualñM)À)  �except E¡ion as e:  ð raise support.TestFailed(" ð 3.%d: %s" % (pos+1, str(e))) class IDNACodec3‚(unittesMRCase)z@def ó_builtin_decode(self#œÐ.assertEqual(oø b"python.org", "idna"), )àC.D/."E@xn--Œ_n-mua�B\xf6©M™Nœâ H/enH,.4I a¸E/."F °Ð ‘GÛIh– O™ P  Plstream�@r = `Pcs.ge"Cder(8ö(io.BytesIO(b"abc")¦†r.read(3 #É:") Ž¿incremental*Apƒ"".join(¼Citerq (b³ú([c]) for c in c*),Uû‡á$’,.íö“%."p”FH. —ž–©2 ™v+.0(b"Icxam", ÿ# &3r;“ple-9ta.o= \xe4xampleÕDH!rgWõ |p", True´Œ¶p+oreset( XÀ9ta.o", ), "ó\xe4xample.") ò self.assertEqual(decoder.Á(b"rg."), "o 9p", True<1") 9ðdef test_incremental_enr(Š!):'œ ™�b"".join(;scs.iterHû"python.org", "idna")),?%$}.~%."[5A\xf6ÿ‚ @xn--Pn-mua,‰ƒÝCr = ò7getE(ï(L+.!("â/b" /r7JeP), b"P^O-9tab J(be,j+_resetÕYó Ö ¯(("Ú×lerrors÷ñ """Only supports "strict" 0¦ handler""8ñŸ÷,>b/æ7/2forzÐs in ("ignoreÛareplac •backslash¸Æ÷"surrogateescape"ë ïùRaises(Exception, ³]Ú,žáN ›_ð class CodecsModuleTest(unitÔ.kCase):íeãö áÙ. b'™Ìû\xfc', 'latin-1'Ìð 5m_PTypeEƒ,Ry4 ¡�abc'), 'Wk0Uni;DZt , î ffæcascii'0Ø#2Ÿ keywordshŸðobj=b'\xe4\xf6\xfÿ c', encoding='latin-1'), õ'\xe4\xf6\xfc'))ð self.assertEqual(codecs.de ð(b'[\xff]', 'asciiyßrrors='ignorev Q[]') m‘def test_¸ e(y!):´ˆ. ¿/, ôb6õÀRaises(TypeEØ , ø2cs.y4 oLookup6ÿ, "foo", "__spam__"I rq¢('abc'), b !´0Uni¬E½0, '½&ff¾�r#�Ÿ keywordsi Jobj=X‹—z‹+/b'Œ�registerŽm!<Ú6C, 42�lQŒ!:Š ­6¦ÌB , "Í2getÒ]">Õ: Ùàk2getâž%>ž :ž Oread˜#2get=œ 9› ?wri3$2get=› 9› Ϭ_issue1813I0# I #ò : under Turkish locales, Fƒ of someq failedD<öbecause 'I' is lowercased as "ı" (dotless iî2oldi# =rB.set(–.LC_CTYPE6ÀddCleanup(lo cale.setlo ", â.LC_CTYPE, old3) Etry: !G(Fv'tr_TR'DdexceptoZErrorTÓ# Unsupported(ù on this system„óself.skipTest('test needs TurkishD„÷ c = codecs.lookup('ASCII#VñassertEqual(c.name, 'ascii') …@def rP_all(4)Íqapi = ((-0"enyb", "de €register"C£EInfo ÁIncrementalEM:r",D"DeN¢StreamRead^3Wrin  L2get³D2get·i�' �7get% >r�CgetwŠ ? _e*¨ .bstricts-wreplaceVignor @®xmlcharref9œbackslash C&" @openœ¾\dFilev”P)9 (0BOM!dBOM_BE /LE'T_UTF8"YUTF16 ?_E'329*329/329($v "BOM64@!64< @docuä*ed^µÅ»Qv›.ÏCCounÔDapi, _Ã&__3@for Ã+in#âÒ€getattr(|0cs,3 ñ ‘£ddCleanup(ò”.unlink, jTESTFN–ñmode in ('w', 'r+wa 7a+'ŒªQwith x1sub-II), \d+Ñ.½�.Ž , 9 Š as fileDnw°IsInstance(,x¼—Ò ?ŸundefinedD¤ Raises(Uni·VbI¯ bcPïK †_, b'aL.—”6IÊ?Às in ('stric°t', 'ignore areplac ”backslashG): ùself.assertRaises(UnicodeError,,7Pcs.en `, 'abcrÐundefined', e:)s);g$"degbh ð class StreamReaderTest(unittest.qCase): – def setUp(˜!.rB0 = |Pcs.geY¶der('utf-8'Û0söm = io.BytesIO(b'\xed\x95\x9c\n\xea\xb8\x80')†Ÿ_q\lines�Af = c"!er.o „ÂqEqual(fÂQÐ), ['\ud55c\n©¤\uae00']) 7EËPdFile(6 °Qbasic�;¬Ke7h‰A(f, mA16-lÈzöe÷À(), b'\\\xd5w@00\x$aewwv­M� 8Dwlatin-1�ef.writeøgc3\xbcìfTSvalue¯ xf0b all_u_b�ings = [¶r"ascii"”X"big5 ThkscsucharmapFp037 H10062%12Wgcp1140**251234b(25~(25¨62588'42E4Ð'50—(72 ''77x8Ë'85¼)85'ž8�8œ'86u'86(86[6'86Ð(86u6u&69(874Ð'93h'9449êµeuc_jis_200HEx021�>$kr…egb1803ïUgb231{4gbk(…hp_romanÂ$hzEidna …so2022_joi_HlÐÐ Âò ] class BasicU[�Test(unitÜ.ðCase, MixInCheckSŽƒHandling™1def  _bKcs(selföðs = "abc123" # all Øðcs should be able.eqe theseÌB7for~nB1 %/cname =h„.lookup(, )._0%ifbP.endsY1("_¨�(AD += # M'elOQ == ":_1"¥MI" IJÅ.assertEqualÂð.replace("_", "-"), J)) RØ ¡@rt.cÒP_warnA(´š## ;-ý«ù been deprecatedb7–(b, size)ƒ1get%erÅM)(s); óH±, len(s), "E•ing=%r" %µIo(charsˆ de׈b? ˆO„ Î0?in ¾ !# ¡ù stream reader/writerjsÞq = Queue(b""Ï6 �Žq7níedresult = b""zžcªÃà writer.write(c) ÿchunk = q.read(%ñself.assertTrue(type(:Ç) is bytes, Gñencodedresult += C —Þq = Queue(b""J¨Per = Mbcs.get(`ning)(q7 de0}M= ""y‘for c in I©:(G�q.write(ü^([c])s( w2+= ¬njiEqual(@a, s, "ž’ing=%r" %­ö ©%if@ not× broken_uni î_with_statefulæò# check incremental Ž!r/ƒ²er and iter0()/ %K>tryg%? Ôwàlö except LookupError: # no IÀE�r(€MpassOelse³ Nġbˆ(Œs€$ L"+=ñ2er.óƒ7@"", çeuÞ¬¬ G…�' µW$+=².¯8r@ ¿ê ä4�‹:ˆ|`.join(7cs.Ä® /ž2(s,ƒŽ I ,�äÆ ìß empty stringÚ‚ 8/+ ²âð ("idna", "mbcs"):  ñ# check incremental decoder/enð with errors argu' F Otry: N = Vgcs.getv(ïing)("ignore")Sàexcept LookupE�–: # no IËEÂA”OpassOelseË òdresult = b"".join½1er.Åÿe(c) for c in sdžp ]S¢¡L.¿(bytes([c])žOÚílHòself.assertEqual(„8O, s,Š{! "t¤ing=%r" % !) Dñ@support.cpython_onlyðdef test_basics_capi(š)î`from _&0 imKµ_±,Ùrq¿Às = "abc123"¤2all5òs should be able toËue theseBläMpall_uniI_sÂu"ifKping not6ebroken9ך_stateful=AÀ(fetched via³n C APIc¾$erüaøŸ.üæ Ž’qÔ(ÑyHL4+= -_\8Ž"", True¨wc¿““B&¹O= ""¨ ± WrÎ/˜A (.Â0¾ CÆ÷("idna", "mbcs"¹5«±Àental decodeÿr/encoder with errors argument Otry:,cO = Wpc_increL#al(ïing, "ignore")Pàexcept LookupEš–: # no IUE¿A‘OpassOelseȤôedresult = b"".join(á."ï(c) for c in sȇ0cde/r P4 Ÿ"r.¿(bytes([c])œPØëmHòself.assertEqual(„8O, s,‰{! "t¤ing=%r" % !) Dàdef test_seek(y)ÌR# allòs should be able toKqe theseM��s = "%s\nqñ(100*"abc123", gdef456®"špall_uniê_s™i"if�õing == "idna": # FIXME: See SF bug #1163178¥@vcontinu¾Y•in brokenŽÞš_stateful’=R0rea²Rs.getª`)(io.BcDIO(sú)t.t'wrange(5³„ð# Test that call&ãp resetsµƒ internaâ Õ¾ and bufferîµ.H^(0, 0Âsdata = )(%f ß0s, 9 “Bbad_ú\_argsž" 4N<Š‹ &¬±Raises(TypeD#, ; â?!no§(�p, "punyÕ"³kO, 42'e'5N ''ÿ support.check_warnings(ë## Ý-„ùhas been deprecated‰Õ" ¡ ý ing_map_type_initializedS5romV@s imÐu cp1140Žð# This used to crash, ówe are only verifying there's no crash. Ðtable_type = ñ(cp1140.encoding_")1ñself.assertEqual( B&, !) 2ðdef test_decoder_state(E!):"ˆò# Check that get%v) and s`handleÍ "• properlyIÅu = "abc123"Dfor ΰ in all_uni�_s�‘&if20not6ebroken9BwithÍ:ful=Aá .cÕ%_¼O (yb, u, une)pNRK<Rð class CharmapTest(unit .CCase– ¸_ïrÂI à{0: sys.maxuniRõ + 1, 1: b, 2: c}…%) ³self.assertµU>D–¾Ya­}見Uo0xFFFE³eEqual(u¸¢ (replaceF)Goõ("ab\ufffd", 3)‹c°_N»eŸbackslasht9ÌsI¸-| ÃP_ignorå2ßL©#b ´ð class WithStmtTest(unittest.aCase):Æ@def 0_enT`dfile(× þáf = io.BytesIOfvc3\xbc" Pwith BBcs.EKFK°f, "latin-1”Òutf-8") as ef‚buLA’ef.read()Ýfo-ÓTrue(f.closed‘Ö`streamG�erwriterÝ!dinfo =߃lookup("ÌGÁSxrReaderWx0f, H.“fÀ  øinfo.streamwriter, 'strict') as srw: 7ò:self.assertEqual(srw.read(), "\xfc") class TypesTest(unittest.TestCase)W@def °_decode_uni(g)#~r# Most %órs don't accept 4e input­,5= [L`ƒcs.utf_7w,!8! _16_le%b%/exJ /32"‘?32_‘?32_‘ latin_1’ _ascii! }charmap#]’²if hasattr(ºs, "mbcs3"&Þ÷s.append4.2)[4forS4 in swQŠñpRaises(ÖdError,3`, "xxxù2Ô™~_escapeÔE-³Uing a˃õng is supported and gives the sameÉ€# result²N&òequivalent ASCII bytes _.@äÕj.Árä(r"\u1234"), ( F, 6)ZQbR(4raw5h§0U« O3U×Då<d , i¯U00110000"Z%6r"\E¤, "replaceºŸfffd", 10»& a–backslashj J³x5c\x55\x30@1\x3¦MbdÐhKÍl5epÀ ó(r"\x5c\x55\x30@1\x3ð", 10)) class UnicodeEscapeTest(unittest.ðCase): def ³_empty(selfÐ.assertEqual(VBcs.u`!_ea0_enÀ(""), (b"", �AE!deEbFE ¥4rawmVªƒ0 = E¢M“÷for b in range(32, 127O%òif b != b'\\'[0]1„ †q(chr(b) Àytes([b]), 1¡;tÏ÷K€ÏÏ7256KrË c%(bÁp + b'0'Öà� + '0', 2Ø  Û$ÛÛRcheck-Aing_!er¨", ,)-�('\t', brn.n'rr\\ Gw+0notoŽ'\t\n\r'KÙ9ò, ('\\x%02x' % b).é&()³ {^127, øV0s'\u20acñ z$€U0001d12m!) ’çR âe¹PÉ}-, ªýb"[\\\n]", "[]"×r'[\"]', '["]Ýkr(br"[\'='>^( a o"[\x07"b"8"t"9"âO\x0a"vDb"f"c"r"d"7"î&78#ð"41$!f#41E!B#10CACB1010e/A0#x‡D/x4D K| €%"\;Ð", "\U0001d12S0") õ for i in range(97, 123):!(Öb = bytes([i]<€if b notCÊb'abfnrtuvx'A*ðwith self.assertWarns(Deprecation;ing|;ócheck(b"\\" + b, nchr(i)•†.upper()�/UN–Nu ž7-32¡$Qr"\8"_8ÆT.9T9T6r"\\\xfaW !) Tðdef test_decode_errors(ú0 = $`cs.uni s_escape<PÅ@c, d…ò(b'x', 2), (b'u', 4 U ˜9þd‚X™²‚Raises(UŒDÀE¿", °,’:ÂcÆZ"0"*i¼6t?[7u~]ïx@dataï"3 I ó½bEqual((Y , "ignore"”‘"[]", len)$‰L `replacM †> ¢("[\ufffd]zrïØ br"\U0011000VF  0 W", 10E5 ("ÞL³ class Raw·EB�Test(unit‹.CCaseÿ£\empty› —™{cs.raw_§ en!("î_b"", à -ICbJIõ­€q£ÌM*ªQ2bN7256O!bád(Ž b)Ý0|b]), 1)ýƒÕK^­ #­À.assertEqualð(decode(bytes([b]) + b'0'), (chr(bñ'0', 2)) def test_escape_enCaself):"&0 =  cs.raw_uni 92Rcheck1Aing_0er(X", O)-÷for b in range(256|€€if b not$Vb'uU'›b‚('\\' + í3, bu1Âu20ac', br'\ $€U0001d12;(GŠïËeG#¥1G,®G78#, K[u¢B(br"=4", $9( GÛq_errors6G*@c, d@€(b'u', 41b'U O.i+�d{jÙò.assertRaises(UDƒE¸", Æ,Î:Pb"\\"¹²V"0"*i>2t?[u~.]"|Ÿdata = b"3 I ó½TEqual¬Y , "ignore"” "[]", len(.))�L `replacM †K¢("[\ufffd]zrï —U00110000MF  0 W", 10E5 ("ÞL‘ class EôEó�Test(unit.oCase):';Ys = [yb(b'', :0))’(b'foobar# 6)¢spam\0eggs-4\x094Aa\'b.¯"a\\'b", 3&0b\\b(b'b\\ 'Ac\ndM2'c\ &Bd\re&"d\ &bf\x7fg($f\ *]G’q, outpumÐ: ð with self.subTest(data=K): )ð assertEqual(codecs.escape_enB¥), output)E=ðRaises(TypeError, 9 I�, 'spam'C*³bytearray(bNñ) class SurrogateEÀÿ�unittest.qCase): Ã@def `_utf8(Í!`# Bad l,7".,ðb"foo\x80bar".deóÄ("utf-8", "s�M5"),KO J2udcL   ).¡u# Àta# bad-Ç `%d ÌÀ\xed\xb0-`\udced b0680"¢ |"# /- Î)3^ascii4b4$O4]u" 4Icharmapñ: \xa5 is unmapped in iso-8859-3O âx)a5l:=%Q[ ä2udc)Uz' Ê Xnlatin1A�Issue637"4 bf!f6%c"»d/-12öb"\xe4\xeb\xef\xf6\xfc"}0Bomc(qÔ'\seek0ä¡õ = "1234567890"¦Bs = ]?16"J_16-le b/329/32W ]32-bežô ddCleanup(support.unlink, fTESTFN{2forp0ingö ³ð# Check if the BOM is written onlyw once ô!with codecs.open(support.TESTFN, 'w+', encoding= y) as f:LWßf.write(data)nseek(08ð self.assertEqual(f.read(), iN * 25/f.O* ½ð # Check that the BOM is íÏten after a rcI>[0]ù.%No1@tell1_*Ï ðƒ±+) ^€(StreamW</r)mr×t?er.{ $J‚�òÁ‰ç?notëû) at a positionÖ€differen3!an8Ystart'I*f”!‘Á¨i £ ù/# ö| N Š |i­ brŸà%‘T ˜+ô bytes_transform_èQs = [i�"base64_-"",*uujquopri5hex6] d`aliaseb{N b3: [s1", \_64"]y'%uu �Ðquopri", "quoöted_printable", "quotedð], "hex_codec": ["arot_13Prot13q} try:;ñimport zlib except IRError$ = None elseðbytes_transform_encodings.append("8—)m-ˆaliases[$�] = ["zipê<-"]¨?bz2§Opass ?bz2Ÿ #žôbz2"] class TýC|àTest(unittest.qCase): ü@def Ò_basics(self)JÑbinput = W²(range(256):#Dfor e2 in*�V7Pwith n@.sub–(E= ˆ2¡# generic X±s interfaceÎ#³(o, size) =-A.get\%erm")(ãÐ@œÀassertEqual(MT, len34/(it de­to;oonž4i, Ê ÙLread×´Z6sinƒ€•(b"\x80",:¸&er:2get¼@io.BðoIO(sin'o¾9.(j{Sout, ¤))EOlineTøX-ýbuffer_api_usag`õ# We check all the ¹á1 ac+±memoryview À:)# úAand �7ing$�also thatiõy roundtrip correctly1€original&a"12345Ü s!Mtdata = ”…þ&= "(2¼|àencode(data, e«ncoding) `view_eÂed = codecs.(!, =ñself.assertEqual1No, datar� = memoryb((’ de›+’F¯, originalŽ_]ÏnÏNsôdef test_text_to_binary_blacklists°transforms(_!):@¶‚# Check ;4 -> õcs give a good error for str inputHAbad_r = "bade type"%;ù¥ in bytes_�åFings ¤Pwith ¸”.subTest(E= Ò2ðfmt = (r"{!r} is not a ,~&; �4Zr"use»ó \(\) to handle arbitrary&"  msg = fmt.}a¹+åüðRaisesRegex(LookupEú, msg) as failure+Á�v)�+YtsIsNone(Zñ.exception.__cause__) @zhÛx3str£kslumessaget!->{œŠÆfÏ(r"^'rot_13'ïç*´ ©ó"just an example ë""("Ë"r©îbì"w.�A andˆTarray öl#©”� 6.)Q = b"pe firstC€ensure wøeyP°mat restricws�:Z­#d_¾n˜¿ w9£wwð:  ðencoded_data.de (Ring) $ýwith self.assertRaisesRegex(LookupError, msg):?I’bytearrayg{)|>òdef test_binary_to_text_blacklists°transforms(Ÿ|á# Check str ->åðc gives a good e·R for ia inputƒµ1ad_ö in (b"immutable", Õ$b")…D<”subTest(bR= 48ð msg = (r"^'rot_13' is not a  ¯5; "±9ar"use øsjó \(\) to handle arbitrary&"ý,¿ as failureý�"("ÞyÒqsIsNone(Zñ.exception.__cause__) P@unit:ð .skipUnless(zlib, "Requires ƒ supportxqpcustom_#_¿_is_wrappedd-@^0mal¦+edaå!"^‚Aing .'Q_·'Xú&edé(!’E�“aÆ(b"hello", "SmŸIsInstanc’ ,‘;?typR)Û £?hex¢3hexIÿ¡|? b~Ÿyó# Unfortunately, the bz2 module throws OS+Qwhich%I-�# machine�ðurrently can't „2 :(çs# EnsurÜñ$ aliases from http://bugs.python.org/issue7475 workoR@ àÿ�e_name,g5in y_<{.items(É�expectedA" =„1s.l4(\ ).b•-}\x .esS^+=�À ÿ info = codecs.lookup(alias) ðself.assertEqual(Að.name, expected_!) @ð def test_quopri_stateless(J!):%h°# Should en�õ with quotetabs=True,#d¸ò (b"space tab\teol \n", "{-W&c"×� ËF3d, H÷=20tab=09eol=20\n=r# But s³ðstill support unescapedˆas and —sÀ"=l,u eol\n"' ¡Â@s.de (F ã,„ ‡®uu_invalid�öMissing "begin" lint�ôRaises(ValueError,@šAx%uutr # The(ð system tries to wrap exceptions in orderÀensure the elb # men(Popera0 be½‘performedy"-ñc involved. We # currently *only* want thi‘õhappen for relatively ¼' #®S, whe¢K� significQ"rm Ðthey contain h±heir # type­ a °le str argué.;³Use a localC€registry#`avoid ³ arðto leak objects Bn # 3e#`multipk earch funcEðs _TEST_CODECS = {} ÄQ_get_ÉO(éÄxreturn ?H.get) 5$s.‰(UQ) # RGð s None, not usable as a `¢rator tryyð# Issue #22166: Also neqo clear=`intern@@achecqCPythonobfrom _ 1 imÈ@_forö Ÿ! Iö*ò#ßäpass class EëðChainingTest(unitb.fCase):D^setUp³T{�'s no wa $un_# a,säÁ, so we justý ## iawe ren} ðone fairly harmº@ aftœ!heÚCðcase finishes by uÑÙ @reprΛ/F(ós module normalizesÒ2²s, although¸hdoesn'Ó# beÍ‘mally docZWed...x@We a<Qmake uAwe uzðtruly unique idLÖbcustom•J2to ”išsÌðc‚€when runMsO&%# ¦±times (e.g.ÎP huntë¢fﱩ _i"o8ð + str(id(self))  ôself.codec_name = encodings.normalize_ò(unique_id).lower() Iñ # We store the object to raise onàinstance becauwf a badHòinteraction betwee<¨÷ caching (which means we can'tFrrecreatŽ;öentry) and regrtest refleak huntWH1uns»s!4Åõmultiple times). This“E@need Censu!“às call back in"<`hto finBout ùQexcep$dðrather than binǺm[aŽ2clo‡Eo anªÕhat may chang±…next run?3robj_to_Û0= R=rmeErrorÐdef tearDown(3%):Bñ_TEST_CODECS.pop †u, None)0ñ# Issue #22166: Also pop from es;Áavoid appeard ofß àsNÍ0s._Ke‚6try¿ñ�_forget_Å Àº¤A Key DFpass-sN,ˆPe, ded>‘c_info = 0s.CÂQInfo(Þ7,öµü=¦†Æ°[&]…’ÏÃ@contextlib. qmanager�€assertWr­d@p, operaÑ÷, exc_type, msgüò full_msg = r"{} with {!r} ð failed \({}: {}\)".fÆ!t(z p Õ�!._"__ŠFy6ÊRävsRegex(½¯0) aéJught€yield ca\W3IsI0(%.Raion.__A›r³ D0NotQC€.__traceˆ#__Õ¨áC_obj¤×*args, **kwds™`# Help|€o dynamiØLÕRqd by a MÃý ¿dY’zcheck_w:Ž©Á=›± b = Õ‘) �.¥,ª� !ë"¡Fing"¤³œ§Á"str_input".3e‚ lÀtype, msg):  �codecs.en ð("str_input", self.„c_name) 7BwithõassertWrapped("decoding", exc_type, msg):<D‚b"bytes i.6/e(oFÃsg }æ«ñdef test_raise_byͤͳcheck_wÿRuntimeError, "") PBvaluõQómsg = "This should be \"JAx (sy~ÿgrandchild_subclass_exact_siz”%G8 My( çÄÖ__slots__ = (\Û TÝ,nkâ¶ü_weakref_supportÑ€ìOpass½ â cv5notz:‚, obj_to·|ÕÐûobj(*args, **kwds�& L ¿Aset_W(*e_obj, Ît*RNisRegex ª!Œ#Ÿã’hÈ v˜Ø) �—ÛIa yÞä%úüinit_override_is_m4©CustomInitÝ(<a!__^_€ 1ƒnh?new½!?New¼\L_(cl6ºöreturn super().__-_$ì ÁÑ?NewÐÿinstance_attribut“ ËÀuld NOT be w“rapped" øexc = RuntimeError(msg) •.attr = 1òself.check_not_wUñ(exc, "^{}$".formatL!) 9ùdef test_non_str_arg_isBY!):/ h ®|1), "1"e€multiplefsg ðmsg_re = r"^\('a', 'bVc'\)$,� >2), \žñ# http://bugs.python.org/issue19609ü+ÿcodec_lookup_failure1 ø msg = "^unknown encoding: •È[Fnameíá# The initial } }ó should not be ò­©Qwith WñassertRaisesRegex(L¾[à;Á"str input".¯!e(I~_ g(Osbu,¸ o7tb"bytesÙ de`ÙIb xܳ`‘unflagged•Ptext_©¡c_handling³²"°stdlib non-4*ñ s are now marked so they'reuíð# pre-emptively ski�0 by+ M÷model related methodsBôHowever, third party‚Awon'¡×,…Èwe still mak‹Asurewø&case where an inappropriate output type is produced i“.7ed 9%ly³nÚ0_toúç(*args, **kwds^#�return "jDY!", 0MìMeObP:strNj#seö(¦+, h("NoÛ9 or#Bs onYdös module function:p3d =ÀŸONone¼¶iSEqual¸)d,6¯Èg(g77d, Nf`# Textí$el·7…complainÇâfmt = (r"^{!r}¨2er ýñed 'str' instead of 'ë6'; � Š r"useAs\(\) toWÐ to arbitrary³ types$") ömsg = fmt.format(self.codec_name*Qwith õassertRaisesRegex(TypeError, msg):_fà"str_input".en[eðfmt = (r"^{!r} de/ùr returned 'bytes' instead of 'str'; "t� r"use @2cs.Is\(\) toW Ÿarbitraryb!b"Ï ¥ð @unittest.skipUnless(sys.platºÌ == 'win32', …0 ' ð pages are specificõWindows') class CodePageTest({CCaseàð# CP_UTF8 is already ¤Ðed by CP650015‘-!=  1def3�_invalid_¥_¥jÁ zT(Valuv7!cs¸>_i–, -1, 'a'ÇH”HbI #OSŽ?123�FŒF� Exÿ»B¼0Uni8EšÁM'cp9J&d¯932, '\xffh nDÙnþnÁb'\x81\x00',—ict', Tru² 냞 = ó…[4 , Ž/ffŠŸbcheck_>˜Q, cp,ûså for raw, eMâs, expected in- ['if"ªs not None%>>try“4d =*óD(¨ ” eEsexcept Nà0 asÏHÀfail('UnableŽyñ %a from "cp%s" €'Rp'9Á=%r: %s' % (¼Å\)HŠÚbEqual(†Fd[0]‡[3'%aa(¬ï, %r)=%a != %a´šs«"# ¨S 0 <=Í@d[1]0lenòàÀ self.ûassertGreaterEqual(decoded[1], 0) Rself.7NLess4Šlen(raw);_else:M  Raises(UniD…mError,6’%0cs.b_page_·À, cp, raw, e=‘s, True) EÀdef check_en:(Í3ftests)¢†for textHÁexpected in .-‘6if "Ÿs not Nonô:try:>”@d = œ Ý(Ü• cDcxcept FEæF0 aszò.fail('Unable to t0 %a Ñ"cp%s" with 'Ln'zÂ=%r: %s' % (µ¿V "M‰]Y…Ud[0],_B'%a..(­ï, %r)=%a != %aµ›6 t¬9õ 8Àõ)Ó¿¼a_cp932ÿô~ i932, (ðñ('abc', 'strict', b)¢ë('\uff44\u9a3e0û\x82\x84\xe9\x80'=#a°»or handlers†I\xffWn H0('['](Pignor‰Lb'[]q)creplac*y+Qu20acV -?-1xff+™backslash4\¡¹Ename3 ÿ b'[\\N{LATIN SMALL LETTER Y WITH DIAERESIS}› ¥xmlcharrefi\oÿ:O\udc~)ÿãsurrogateescap_ý8apass',U.a¿ (¿®À¿-b'¥ 4 Þ�Æë# invalid byte¹´C¼)½¼)À '[£.fd¿Àb'[\xff]', '÷backslashreplace', '[\\xff]'), B(b'[ó, 'surrogateescap7?udc8¾pass', Noneh°\x81\x00abc‘ostrict.Qignor’Caýo\ufffd:@\¿|1)) Qñdef test_cp1252(self):oà.check_encode(&5, ("&,('bp'š\xe9\u20aK1 b'=x80é'ç y-,ff)#Çû error handlers¦i\u0141Mô'(À,b'q('´?b'L)Adc98x «Î/984§%))æ®/de®�9Ì®š0e9\• ,«Å á3!ffé[À)z\_utf7{¯cp = 65000àŽ/cpŒ@�+AOkgrA-•{U0010ffä¯ b'+2//f/w4Yudc80_b'+3I`ñ ,9//0Xò ðùðø 3(úü 0$,ü , œë# invalid byteùib'[+/]W/'[T Àhœ ÂPmultix%�ff\u20ac¹ bÆî3 §*??™7©xmlcharrefAÿ€ÿ€ˆ„a0abcdeÅ•backslashZc� O[b\\xff\þ\D1ø±udc80\udcffdàsurrogateescapV ²Må~0subF(¹= ¾=Ì ÄK êð=expected):  ö'self.assertEqual(data.encode('ascii', error_handler), @ ¡expected) ,’def test_Yñ_surrogateescape_`(Œ!):1WPwith   Raises(Uni�E£E™48ð# the first character can be de=¡d, but not,esecondyEÍ'\udc80\xff''À'çf ÑÌlsb'abc'..n1), T+@for ¹ ª$, ˆY in (áb(b'[\xâ°]', 'ignore ;[]'ä -breplac.b\ufffd: ;C, '[l_udcffB™backslash…̯ A SqsubTestï=;=“óò g= xR þv ü À †F rñ class Latin1Þ@unitx.CCase˜ � ©OÈ@¥", Ä)"!('�0xe9’'& /’Ø¢ Žgx1('l&') g*gsyh ßB20acå k/b'l1êYb'[??ã:(4‘U000abcdei+  !\už\:Ÿ ^Z0xml\9refœÿ€�©Yí-, M.›�,¡ÎU=gÏ+{ ©9(Às(UnicodeEncÇodeError): ñ# the first character can be decoded, but not,isecondEð'\udc80\u20ac'.en7ñ('latin1', 'surrogateescape') @’def test_iW(self ñfor data, expected in (;Ã`(b'abcd,), [\x80\xff]$+sWPwith ‹�.subTest(…=Š=“ =A<±assertEqual@.ä)Lò) if __name__ == "__main__"¯@unit*.ñ() # UserString is a wrapper aroundªònative builtin s.[type.Aünstances should behave similar toEôobjects. import ¡Q fromÕ w_¾"s ´collections&Ïw classá„ÙLp.Commonö °MixinStrUni�_0³.ACasec"):œ'2µ' =‹±# OverwriteiQthreeõ�ømethods, because?#_�'t cope mðarguments propa)du¶›ñ# (and we don'tqA1sub51es)*Yachecke€‘¢, result, ¼", ¨tÐ, *args, **kw Õ6" =0fix(mÔT &&#¼1fix;û/ )!itßrBreal†² = getattr(qÛ,)(ÛB.§`. tÊqaraisesÊáco‘lb?obj96CoùR¯¢exc) as cmoXÄU£R#NoõÀstr(cm.excepëH), 'ù/Ccall-¼+?ect.6ectŽg9?ect½ A²] suEêˆðos module, thisÚÐwoefully inadÏ"te�!± # does add s Jða few functions whichò* have been determined to be more # portable than they had4rthought1P. im.™ asynchatN dcodecs¤contextlibtdecimalTerrno …fraction?egetpas…itertooldlocale?Dmmap o$Fpick$Ushuti~FsignŒUsockeÙ&stå†subproce‹%sya”sysconfig|†threadin%im¥uunittesgDuuid9àwarnings from & V0sup~¤ try: ñresource except I¦RError(!} = NoneA_fcntl>;_winapi= ?1grpÊógroups = [g.gr_gid for g in grp.getgrall() if @user!n 9Amem]Qðif hasattr(os, 'ABid')=Íl@= osNQgid()@"8if %2not�«H*¿‡.append(5)3ò]�1pwd…@all_ácu.pw_uuŠ0pwdµ!pw]k(±, Attribute Y€t_uDcapi`ñINT_MAX, PY_SSIZE_po0+ =1ö = sys.maxsize â.Ûä.script_helperþassert_python_ok8*ÿunix_shell, FakePath root_in_posix = False "&eu# 5("#ð() == 0) # Detect whether we're on a Linuxñ0tem\`t usesað (now outdated # and unmainta¡0) l=D3Lð library. There's an issuÉ when combiA Cð with a failed execv call: se<Âhttp://bugs.iQ.org/[X4970./ syRžq_info')ÃÝ‚.versionóUSING_LINUXTHREADS2p.startsµ((" ") elseRÜ@ # IÑ #14110: SomeMs¢pFreeBSDP0the�@r isXawheel ¥ó. HAVE_WHEEL_GROUPºˆplatform¯ƒ'freebsd5W4ó def requires_os_func(nameœtreturn $È.skipUnless(Ò24, 'KÂð%s' % name) def Àcreate_file(óname, content=b' ÷'): with open-â"xb", 0) as fp(,“fp.write(DÁ) # Tests wñing TESTFN class File  (unittest.CCase€ãdef setUp(selfmò if os.path.lexists(support.c,0œos.unlink'ç¢tearDown =n }•|_accessƒ0f =„ |,ñO_CREAT|os.O_RDWR)U�vclose(fàô.assertTrue(os.w Ø\kW_OK))¦S]rangeªOirst®&ð# We must allocate two4�secutive Jõ descriptors, otherwiseõò# it will mess up$ <ø (perhaps even the threIõstandard ones).cbsecondéPdup(føc6try®ˆµretries = 0Dcwhile N1!= HJ + 1?+1os.x lcI+= 1d4if N> 10^%`# XXX ˆ� skippedH'@!BŸ("couldn'´ 6ds"Cë,üSuR7kfinallW .!# ,Ñ a fd that is^A, anÎ5n'tæOÛ¡F + 2ŒBáRaises(OSError¾›,Ëc, b"a"@@¼Ácpython_only} re' V}1 Ÿ9I ol‰ðsys.getrefcount(4² FType´x , 6r]0newz]ãEqual(old, newøÞ,adÜøVr, "w+b"ü:obj³Cfobjkb"spama fflush(-f,[ilenoéos.lseek(fd, 0 >Áqos.read"4] ïtype(s), bytes- s-Ì€0b# Skip²ñ est on 32-bit platforms:’number of‚]�fit in aeÐ# Py_ssize_t °@'é0Unl–ñINT_MAX < PY_SSIZE_,3ð  ñ "needs INT_MAX < PY_SSIZE_0") &ô @support.bigmemtest(size=8ò+ 10, memuse=1, dry_run=FalseD@def 9ð_large_read(self, J!):imÄ.addCleanup(|„unlink, bTESTFN]8µcreate_file4$@, b'{5') fñ# Issue #21932: Make sure that os.¢÷) does not raise anCñOverflowError forÌ ârInZ5�with open¤¶"rb") as fp Ùedata =“0fp.äCno()<Ö1Theg¸ptry to Ï2 moá€n 2 GiB ê nce becausüeª#§òrating system is freeOòturn less bytesï¥requested.HаssertEqual(Ð “Qwrite#ýƒ) acceptvð- and buffer-like objec!ut·ustrings�"fdL„Àos.O_CREAT |t†O_WRONLYfÎRas(Type,2¦Ã, fd, "beansCÉ1os.(Ÿb"bacon\n!ðytearray(b"eggs*ˆ Lýmemoryview(b"spam,†close(fdA‰:obj‹þÌCfobj*å.splitlines(),pù[ñ2", Ð ­#"]˜!à_windows_consoÐ)W*argsð retcode = subprocess.call() ƒ # àca new VÇÙtflood t9ioutputÀ[—ionflags=m+ßE_NEW_CONSOLEvPshellp1hidf„ê– (SW_HIDE 47C=TruDWelf.aO3, 0GP@unitðp.skipUn¤ú (sys.platform == 'win32'¯`3� specific½#WšÀ'±ºr_¿¸|a11395:{ X0 re`as an e^A(12:Ñeenough r# space&P) on „µäinto stdout if m2‘is binary?(thö`lengthìgRÉc66,000ì1(orû€, dependowon heap™fusage) ­ð"print('x' * 10%)"7cÃeðys.executable, "-c", V†»? À.executable,ñ( "-u", "-c", code) def fdopen_helper(self, *args):$(€fd = os.*ð(support.TESTFN,–O_RDONLY)21]4(fdT!w.close(ŠStest_2ˆ��CREAT|os.Œ&WRŠ#osj#fdlÒ`.lû3?'r' S, 100cYÏqreplaceXÐ<J2 = Nu + ".2"&Š¥addCleanup|{unlink,> ¢8€®µcreate_filef&f, b"1"\*"2#'2"N5os.ú /3PäñssertRaises(FileNotFoundErroreOstatòQwith  a , ´V as fÉêpñEqual(f.read(), è}ÁSœ_keywordsÇfæ$q(path=_A£__, flags=�Ñ, mode=0o777,d�¶dir_fd=None·W’0symý• \óget_attribute(os, "%×;try(hú(src='target', dst=´ ÍÑ-ÿ_is_directory=False, ìôexcept (NotImplementeú!OS=cÔpass # No OSõ or unprivileged user # Test ðs on return values fromÊ*fÀ* family. clhTStatA@K`s(unitá.CCase ¦\setUp+vWfname™« $¶ D(Ž ‘4ABC“@¯àskipUnless(has'÷P'), 'Õ` needs#()ûÜ`check_R", šEbresult#2(!{Ű# Make sureûect access works"²Z[UÆ.ST_SIZE], 3 a2�.st_size,_‡xall the,0are%re1�members =¶(�|Afor è!in ¦õ!if"Ö[:3] == 'ST_'8"ž! =*v.lower(e JP.endsð("TIME"):  ó def trunc(x): return int(x) #]else:Fx+òself.assertEqual(zðgetattr(result, =)),?j 2[AÎstat, name)]¿~0In(eµ, members) mõ# Make sure that the st_?time and ÷ _ns fields roughly agreeKò(they should always$ö up to around tens-of-microsecondsÀ1forÔ‘ in 'st_aŠDst_m c š'.split()£�floaty =Õ)8+P * 10sf3nanŒ>: + "_ns") //CûApSAlmosô‘|`—, delta=2ˆ:tryÉ´^[200]gö fail("No exception raised"Õº IndexError`Opass°assignment ms„©.¡uode = 1,C°ŸAttribute´ŠOrdevŠ.(‹R, Typ– t K—oparrot–. •Ô UsÕÐ2at_Qõ constructor with a too-short tuple.ÀËp2 = os.Vf((10,)|ù!^ÔÈOlongÇ(÷0,1,2,3,4,5,6,7,8,9,10,11,12,13,14æb¹/Aest_2Šá s(3Lo.check*!.fëµT]_byteZ ÉK1 = s ñ .encode(sys.getfilesystemNing(ú0Uni4E:°^ñskipTest("cannot QPe %a ëpm7" %”QJ¾J À_result_pick³le(self): ñresult = os.stat u.fname)%÷for proto in range(pickle.HIGHEST_PROTOCOL + 1^eCp = .bdumps(s,Re,�À.assertIn(b'’_0J', p-"ifCF < 4ÑG KWcos\nP.\nR"un©d³kloads(z\UEqualÓA!) =ñ@unittest.skipUnless(hasattr(os, â€vfs'), ')d needsŽbvfs()'÷@def "_Å@vfs_Eaibutesµw2ÕG´Øœ%õ# Make sure direct access works(=˜ñ¢.f_bfree, r3[3]ù ]†all the ´@ are5re.gômembers = ('bsize', 'fr `blocksv Pavail ufiles',L‚ 'f¦&00lagsnamemaxe2îrvalue, ‘ö¢enumerate(so5 "0getíc'f_' +R)2i6I€True(isi·3nceKÙ.f_fsid, int)o€Test tha e 60 ofdð tuple doesn't chÃ*rÝ3lenlY), 10d0iöassignment really fail9:try›)9E = 1ˆGCÐ("No exceptiouRised" )Q AttrZErrorkBpass‡1ŠPparro‰UA# Usúò constructor with a too-short³¿2å+f((10,),ÿåYOTypeTËOlongÊ+÷0,1,2,3,4,5,6,7,8,9,10,11,12,13,14é¼— ŸJ"« ª  ªõ_]­&˜† À p = pi÷ ckle.dumps(result, proto) ò self.assertIn(b'statvfs_3J', p0"ifFY < 4:JU NZcos\nS.\nU@unpi¯Bd = {.loads(}_UEqualÙA!) ”ð!@unittest.skipUnless(sys.platform == "win32", "W   specific 9"s"ø1def�_1686475(„)úð# Verify that an open file can be ÿ1'ed˜$6try?0os.$ (r"c:\page>4.syƒ$ú except FileNotFoundErrorJœò{Test(r'Pò does not exist'â_!OSU_ as eZ±fail("CouldF¶ ±ç7Jðhasattr(os, "pipe"), "requires os.-()ÃO5261Á Óö'ing a closed fd7±cause crashè;fr, w =uè)8E# shPpraise eØFnfinall2ž&(rÃP2os.wQwith æRe#s(ë)ì:ctxî’GB{Bctx.– ion.errno,¼ƒno.EBADFŠ@`check_Ö_¸aibutesˆ", hQiTTrue(í)\, 'stK/')¨?0isi�3nce-.@_, intDC0 <=©>30xF÷¸�íÄ "­J is ° çia#У_ò (FILE_ATTRIBUTE_DIRECTORYó&etl“ý9Óf.fname%Ð@ +¦d .�&d.¹,G0¢h ¯directory s 0dirøõ = support.TESTFN + "dir"„“os.mkdir(2 ÿõddCleanup(os.rmdir, +F {#Àe) sóelf.check_file_attributes(result) s+ÅassertEqual(!.<.stHù & stat.FILE_ATTRIBUTE_DIRECTORY,G+ !) ,ð!@unittest.skipUnless(sys.platform == "win32", "W   specific 9"s"×1defð_access_denied(ê!):lÛò!# Default to FindFirstFile WIN32_FIND_DATA when M7 isBZ÷. See issue 28075.#÷&os.environ['TEMP'] should be located on a volume that@�supports ÉV ACLs^þfname = os.path.join(q , û.."³addCleanup(i›.unlink, /acreate(†, b'ABC'RR±ny the righYÐ[S]YNCHRONIZEèË'toæqforce Cdƒöto fail with ERROR_ACCESS_DENIEDÀDETACHED_PRO!E = 8Z`subpro;calãõ+# bpo-30584: Use security identifier *S-1-5-32-545 insteadfOA# ofÐÐlized "Users"\‘not depenè÷&leÃ@Ó['icacls.exe'~É, '/deny', '‚j:(S)']d¡œionflags=¬¯Ü?¡× !#No4õ size, 0) class UtimeTests(ÊCCasew™\setUpŒkBdirnЋeTESTFN»&|µô@c, "f1"UZécrmtree=þ�os.mkdir«.na˜v踒_subsecon€,Çç¡�# HeuristÈ!o ¸1 ifI+ssystem  s iQstamp%# lÆ resolution:PÖfloat and intFæs are differen|"stg1ile·o�return ((²0t_a–– != st[7]Há3or *m*8* c*79])^_ð _u ¡Æ t_bD=Nonz‚0if ‹RÊ ' =-™|Î( (J$if¼@ ~f# TimeÔ' aÂYr1 microJŠ (10^-6)AÐ# ñ # The resolution of the C internal func÷used by os.utime() Á# depends onDðplatform: 1 sec, 1 usûns. Writing a portableM»test with a û 1 ns requires more work:A1see‡Ùissue #15745.$aÆò_ns = 1002003000 # 1.¸Ionds7m7t40050067"4. 7Lelse ?useÛisecondp§™5 * 10**9!‘8!"@set_²Ä(filename, (S$, <)Í@st =åEstat5%) Q`if sup·B_sub± Ýñself.assertAlmostEqual(st.st_|!, }ö* 1e-9, delta=1e-6‹_M ¿ÆþM…[¢–;�;r 6_ns3j3 £@def =_¥r)Ÿ'ns$v#DAõns keyword parameter ,b[ns=nsÄ_–•´@lricmethoý¨©ns_to_sec(Ÿð# Convert a number¶BnanoŒ™ (int) to –s (float) ð # Round towards infinityë0add¥G0.5 `Z`void r95ing!# n,?)%s_Fminue‡£return (nsÅ¢) + 0.5e-9{BË_by_indexed(ãp# pass ôQs as ñÇTpointœê Lâx2ÑŽ:= n;$0 = ².ß_1WØ- -°uQnsat(ÿapec), s4val(6buf¦uB# or10*_tëMöGôX г Î':À = self.ns_t÷o_sec(atime_ns) m = self.ns_t- -°# test the 7ùs keyword parameter\@os.u(¢(filename,7=Œ!, f)‘…_d_9@set_B!) YP@unitÄ.skipUnless(fñ in os.supports_follow_symlinks,Bú "+ DQ for ‰¿ required "G ar this&"."Ø1defÒ;_nom(õ%):W0÷9'ns$»k# use M‘=False tos¼Pnsat(EBspec”@a# or lâs#:val"] ŠO=ns,z=Ö.Ë6d¾ d± Ä• /fd†%—with open!æ'wb', 0) as fpÚrº a µ descriptor¶f‘n’µC2or (' ¹&½ p.m˜no(), ns=©:_dir_f­ "±-Fµ%2dirŽ =6¥path.splitÉÌLRdirfd,ïDºos.O_RDONLY2?tryüRpass Àòñ¨šáã Ë,X=­ êÇofinall™‘os.close(<Ê ¯’ߟdirectoryœ%cpcalling›p() on aá`0Öéiæ,‡>=ëØqÞÅ�_currentÝ$, §šB# Ge!Åsystem clock­@! = .–(kÈh# Callõ tofrAtamp74he MjÀset_time(sel³f.fname) ñif not self.support_subsecond(3:3:µdelta = 1.0Jelse&ð# On Windows, the usual resolution of time.å() is 15.6 ms.Xpô# bpo-30649: Tolerate 50 ms for slowjœ buildbotD Rð!x86 Gentoo Refleaks 3.x once failed with dt=20.2•{ So useJCalso�ÓÌther platforÉ9F0.05;Èst = os.statuh°msg = ("st_*Á=%r, current d"/3Ð % (st.st_m52', $ -I%))@øÿassertAlmostEqualM5u ò=“, msg=msg� def test_u _Ñ)J&"seùQ(fileà q�# Set toeHY1 inynew way­1os.yqN_ž‹Ä 2_ol>È=Àold explicitÑ 'Òk, NoneÛØ@get_qq_system(g, path×tif sys.ðº == 'win32'£3rooæAñ.splitdrive(os.0abs(É))[0] + '\\'µ im¤y ctypes£kernel32 =„.windll. .6buf)öcreate_unicode_buffer("", 100<Tok = RÀ.GetVolumeIníaÔ W(ëxI, 0,wC ±? BÇbuf, len(buf×yZif okšöreturn buf.valuâ## Š1 ifN²runknownU®6Qlarge®82v# Many EÔs are limitedÆòyear 2038. At leastD^b# pass¨GNTFSV£áÐA.dirQP != "C" ñskipTest("requires +BðT = 50Ð # some day‰E2128º¬(F!, º…‘‹-é?‘Àdef test_utióme_invalid_arguments(self): ô# seconds and nanoõparameters are mutually exclusiveDPwith X÷ .assertRaises(ValueErrorpw�os.utimeŒò.fname, (5, 5), ns= ð) from test import mapping_ùs class EnvironTests("`.BasicM9ƒProtocol’ò"""check that os.eKô object conform toz# pB1"""Ptype2�� = None ‘def setUpänü'æ__save = dict(w)<' ifŽ0supöƒs_bytes_�½*QbRbS for key, v˜2 in³÷_reference().items(¯b r[key] =BéŒtearDownì9v.clear(�Supdat 'Qbm Å.b.r&b)Î\ ð return {"KEY1":"VALUE1", 22373"}^cempty_¦2}èTÑ# Bug 1110478?P@unit‘ñ.skipUnless(unix_shellè°os.path.exi4!),D2 Á'requires a K'©ìp_X2ÕΕÒHELLO="World"`‰c¶ñopen("%s -c 'echo $3W'" % ÈP as p- .ü=×.read().strip�qûÏaEqual(:%, š(lg1os_ß\_iterr.�\"line1\n2B3\"'Íú UQit = ˆ“¶K I¤next(it), ‹è2?2\n232 ®ðStopIteration, ¦C, it“# Verify „J3"s ªQhe OS/Rof th#`# corrO@str 0.=81keyF_ ¢¸¶4¯À self.asser÷ tEqual(type(key), str) ¨self.asser-4val-.ðdef test_items(5!):Kðfor key, value in !â._reference().959'}ãos.environ.get´V!) oÁ# Issue 7310šŒ__repr__�ð"""Check that the (f() of oà looks like ‚±({...})."""j±Wenv =7 Êeuenv), 'Qõ {{}}})'.format(', '.join(Hep'{!r}: +_ ¿{4envm#))6%Üget_exec_path*0defR_listæ .split(os. 6sep„° = ['/monty×p/python õ/flying/circus']ð@V€{'PATH':_R2sep$")}%csaved_Z® \&ry¤4ïq= dict([¦5(P# Tes,ðat defaulting to›fy works.8@Sequú�;Â,B …)M|D"‡env=NoneLofinall BYP# No ŠÕment variableð¨4Fï'{}¥# Emptyo)_('',)hN*''q�Suppliedt)6ÏR{Ôijäsupports_bytes» ¢#uò cannot contain Êc and b Ekeys‹ctì # ignore Br@WarnÇw ?.Swith „s.catch_Ë(record=TrueÄ;2mix‘5 = ËD'1',µy: b'2'}xiexcept  Z&# \±be created ·nI -bb_>:pas+NelseeЀRaises(VÍ^Error_,“èo!# ß²2/or ˜m ) osø£{ò=yabc'}),Js [']HÀ self.û*assertSequenceEqual(os.get_exec_path({b'PATH': 'abc'}), [)])_self.babHb cð@unittest.skipUnless¹þsupports_bytes_environ°¿C"os.&ñb required for this c"×1defV b(á!):‘Q&# M7 ->b$õvalue = 'euro\u20ac'6tryNR.Ì1 = ¡.encode(sy§¡filesystemOing(ŸLò'surrogateescape'é* except UninEtZError¡ñmsg = "U+20AC character is not ”õable to %s" % (îgÊ ‘*Qñ†Test(msgz2['uµ$']4s±’ìþ7,j]76b[bp9±%) wb$Ý– = b'\xffÙk×Ù7 ÙuD_str*0.deð^  7*#['½†w$ò# On OS X < 10.6, unsetenv() doesn't return a�Ñ (bpo-13415).E@ü.Æòs_mac_ver(10, 6õÄa _eÒ Ç0if “úplatform == "win32"üS# an >‘ment varií is limitedøf32,767s¯Ð0key©x' * 50000P€Raises(VAŠ,aò.__delitem__, keyïaLelse¹4"="£’allowed i[ÂIname‰§Fkey=œ_¢/OSŸ^�Œkey_typeŒ`missind' 6key�}cNotIn(%d¬Wwith 4S1Key²z) as cm-€[]]»PKbIs(cm.6Óion.args[0], 5�5JTrue7 __Æïress_context__Á,7del)ð[missing] ó" self.assertIs(cm.exception.args[0], missing) 5JTrue7ñ__suppress_context__) <ðdef _test_environ_iteran(T€, collec!):3r%Por = (%$Ónew_key = "__ 2__"xEPnext(?áator) # startR‚“ over os.œf.itemsAÀ# add a new j'in-… mapping�H[Ž]œý§6tryù¸\force¸�modified‰D\åoEqual(ž?, "�økfinall¡7del î9òWzô_error_when_changing_os ÷¶/Â\jw/msp$/()x!_valuey&>zð class WalkTests(unitÿ.CCaseI0"""As foÝ“walk().""tñ# Wrapper to hide minor differences betweeï?@ andòf ñ#=~¡s both funÄñ s with the same code base6Cˆ°, top, **kwx¾½ò if 'follow_symlinks' in ) -[0,xS.pop(LßUreturç(‘ÐQsetUpµ¦`join =Ppath.åÂɰaddCleanup( Äort.rmtree, cTESTFNX9v# Buildä# (/` !1/#¡a file kid·Ðtwo directorysFo tmp1;SUB^ ]a[C\2^_/noŸJSUB2æˆ,EpOtmp3_ ‰’t readabl¸\s Õ5L‚«$a —!to¯?FN.pbroken_AZ A èÀ TEST2/  #e tmp4  Áa lone file ð self.walk_path = join(support.TESTFN, " :1")7Jsub17 Mo, "SUB67M7 8?ub2i2Ÿ;ub2dC_2_;tmp- È"_?tmp�Â" 13Á�Jtmp3,5, ;, "-¿åc¯A'ç2', ‹o, True9'j4', F)GvHPSUB21IZtmp5'G²Gg´2_tree = (sT0, [Y 21u9"],Þ '["7¼/3"N †]AJelseÉÀ ]Äa'"]å�os.chmodëã0f:trye§os.listdir30úexcept PermissionErrorC¨´addCleanup(„ , p…Çstat.S_IRWXU` ö>�/, =¡Pos.unÂ(Î/rmßÐ del self.ñ#sub2_tree[1][:1] def test_walk_topdown(self):!%°# Walk top-.¡all = list3.E r_path))iHWõ .assertEqual(len(all), 4)Uð# We can't know which order SUB1 and ö2 will appear in—ð# Not flipped: TESTFN,512t 22212,� = all[0]Vp0] != "¥")f.sort(èt3 - 2 *¬_][-1](' ]`K0], ‘2, [¢,ª02"]vtmp1"])žO51 +«YAsub1êGû1R2R2RSž˜ G!, ¿ó„ íQprune , ¹ÅW=Noneû&if@ is 5;" =v0# Pl¶ the search¬C%[]-ö for root, dirs, files in](b©‹@all.Mnd((CÜ,@# DocÁdescend into!›'@if 'Õ'‚‘ ý#nñ e that this also mutatesô81 we«pnded to6!ôG)‚.remove(wºÓ>2¸  ÿ“>1�1ð © ¡D� áQ_like�‘ØU¢µ�FakePath-v<l è‘bottom_up.[× 6-upú•Ø ,d=False{© 4,ù®ì?­Þ#2,ÿÚ#¤Ç : õä212 ì3ü[ì  2ì (ì53],äãà (sð elf.walk_path, ["SUB1", 02"]£tmp1"])) s5õ assertEqual(all[flipped],'.(9Tsub11oa[O + 1_^Å%11Æ2Æ�2 - 2 * ÎÍ�2_tree) ø‘def test_Tqsymlinkø!):!ôif not support.can_*&*dãkipTest("need +?"z/ô# Walk, following-%s.}™Qit = ] @•fs=Trueÿð for root, dirs, files in L6_ité”!if-# =q  '+‘X`&[]|' +…®/4"2UbreakJelse�RÃfail("Didn'tFCS withÄ~ øqbad_dirXÒŸ– top-down”µerrors = []¢M¨ !on:=†s.append-¥s= next(\*ýzR(, |€dir1 = '"'¨80os. e.join(z1d1new = ,– + '.new'5¡os.rename(?!, 6new#:tryÊ}M!r «g, d, f¡e Kè(û` $TNotInŽk+Anew,s.¡@dir2žî Ê{ ifg@2 !=1!%À?In(_-2)‚kfinall? sºv�) @unitáð .skipUnless(hasattr(os, 'f]P'), "´ ³sñÀ()") class F(# s(µ ,!""<s¿3os.;F."""f?a,Q£, **kwargsD]¢ ©0_fds8_?topEIfyield Öõ{ýEP0, *ˆMfreturn *ß±_compare_toLëö_é!, t÷'¶F½=ð() results. € """ çwalk_kwargs = u.copy())f8 =  +ðzbase = ‘:\Bpath· `.join(2‚, 'dir1'2&3'>–r s(<)Oß# Should workn&~4v x`# Try ‹s²Aa '.nEthem„]!.a)ðRaises(OSError,±Es fcurdiró\-¿/5'U Hªo¤b§54',M" ã–6eÀs.makedirs(pñath) def test_mode(self):÷with support.temp_umask(0o002(,ebase =.eTESTFNJ"ðparent = os.path.join(8›, 'dir1')0,th.D020Àos.makedirs(`z, 0o555UâÄ.assertTrue(ŒRexist8)2Qisdiri 1 ifâÆname != 'nt'R‡ðEqual(stat.S_IMODE•].�)ÐM)O<775 A_ok_ Üing_directorye ¡.©Ùg… = 0o777î@old_YMd&22ŠÝJ QðRaises(OSError,� , ´/, <-!, –_ok=Falseˆ¨ë61w0 œ=4 $8Ä ð# Issue #25583: A drive root could r ± Permission'¶ on Windows—Q(0absC]('/')¡:R#�_s_isgidI;pS_ISGIDs;‚Ah!:try®Æ&!fn(u°vzAos.lÆ � 6 xGšos.chmod(Cx •#| ^Elexceptð å(@unitêô.SkipTest('Cannot seta› for dir.‚0if ¼÷ % &F$!= L� $Noe‡ô�× ”±# The os shþTapplyx¢ from the YFÝyus, but£a# this.` need `depend>ù that behavior. Be explicit.H#­¿ð # http://bugs.python.org/ièY14992^2# Séžð fail when the bit is alr·eady set. ùos.makedirs(path, mode, exist_ok=True)3þ# remove the biQSchmodNðstat.S_IMODE(os.lP).st_mÌ) & ~S_ISGIDjôMay work even whenv´ is not alrÚ �demandedè3 | yò‰finally:Ðos.umask(old_ !) ”def test_? öing_regular_file(self)Sñbase = support.TESTFNQª—` = os. j.join(+†, 'dir1'>f11penjH, 'w¹.write('abcfclose(E¦ð.assertRaises(OSError,�7 , —6#vGFalsi|F ®2os.« ¤larDown‰Ê:ks"2'53',¯³ Ÿ4,56|A# IfÙ=‘s failed,úbottom-most directory ('../dirE1mayðhave been creatKáso we look forZZouterXÅb# thatsJQwhilecŽé;Q) and , !Íì gxdirname¥&¾��) @unit'ñ.skipUnless(hasattr(os, 'chown'), "Test needs  ") class C#@File"%s(SbCase):Ð@/amethodá`setUpCHG(clsÇLKkdirž x1st_‹ü_uid_gid_arguments_must_be_indexš7š b00uidIu std¶g"giÐòvalue in (-1.0, -1j, decimal.Dó(-1), fractions.F w(-2, 2) VÁFType?,ô!, ‰V, gidRO(3uidTOš`IsNone˜� W!, ?Œ>" -1I)¹ðlen(groups) > 1, "Û´0moreqan one '"‰‡)L ,W1DÀ_2 = groups[S:2] õuid = os.stat(support.TESTFN).st_uid-‹os.chown(Õ, uid, gid_1)-gZ gZÿself.assertEqual(gR2>12) Òñ+@unittest.skipUnless(root_in_posix and len(all_users) > 1,?n "Pp needs K¡ privilegeLàmore than one R"ß@def ;_�`_with_@(F%):qu‘�U_2 = ˜[§‚ !_1£é[» SÂR 2C 1notº4@non-É� accountïout_permissionO{ »…Raises(PƒWError“Æ E1÷ö²@classmetho¶+parDownCG(cls�‹os.rmdirÒA) Kõ RemoveDirsTests(CCaseMi\setUpu¾os.makedirseÞ:"te£ =�ormtree@ Ast_r«L_allGBdiraæŽpath.joiÃ'%'l mkLdirbK" , AbAbAr©OJ‘False(os.²0exi}.//a)/mýùŸ_opartiacЦcreate_filBÀjoin(dira, 'Ófile.txt')) öos.removedirs(dirbóself.assertFalse(os.path.exist./?Tru.ay].ñsupport.TESTFN)) ²’def test_´�_nothing(M!):#Øtdira = ¯Zjoin(Q0, '%'¾€os.mkdira K:AbAEpcreate_|@‘Z0, ' •Pwith Ô~çRaises(OSErroréíÂeƒ“÷. pÁð class DevNullTeC@unitÑ.CCaseÝé|devnullâ"@openT$ö, 'wb', 0) as f&÷f.write(b'hello¸fclose(øa?rb'^¬óEqual(f.read(), b'') üpURandomí/s(ü!ur.|_length tl6@(0)) 0 1010a/1023450êl_valueRdata1º(?(16¬±IsInstance(5v, bytes,2K2Not301, 2·Cget_ޱ_subprocess»s, count•Ácode = '\n'.2(Ì0'im"ª os, sys',{ ´b%s)' %g -ósys.stdout.buffer.E)Z-yflush()XRut = =ð_python_ok('-c'ê&de_y¬Uut[1]Ç�-)D.-rreturn  -rkè-s¥>00( #% @pskipUnl€hasattr(åB'get�'), 'needã�h3GetjÀests(unittesñt.TestCase): @classmethod def setUpCC(cls*.2try7 ños.getrandom(1)Búexcept OSError as exc; if¡.errno == z.ENOSYS*Qõ!# Python compiled on a more recent Linux versionŠ=ö# than the curr1mkernel0ðraise unittest.Skip;&("ðò) syscall fails with Á" }NelseÔc zvh_^§_type(self€zdata = v6l/ð.assertIsInstance(6, bytes+‘Equal(len*o), 16)—0“\empty”0h1_, b''e_QÏþÞóTrue(hasattr(os, 'GRND_RANDOM')Z{€# Don't ^ 9,8ñ) to not consume-Arare£Mâresource /dev/¨,œ_nonblock40# T‡:AmusttCÀ. Check also¯t‚µflag exists‰‰ Ú†NONBLOCK‘›B™QingIO£ ž¢# System uâ1 is¥õinitialized yet�Opass OvaluÎ1;|O¹2! 2NotÈ501, `2) #æÈp() doesðuse a file descriptor when itð²implementedÚñ the # getentropy() function,©¼= or6R OS_U²ñ_DONT_USE_FD = (Y'Ponfigc!_c ð_var('HAVE_GETENTROPY')@15!or•-8u7$ƒ_SYSCALL?E) @&skipIf(Ù,¢ÙB"os.c›gœ1") ¬1 URo FD�%s(}Ú–tUnless(¿1, "�requires¤s moduleÄ›D_ª-urÎ#½'hailingU^@ablejHopenG.�# We spawã°new process62mak™À obF0(ifžvrlimit(ñÀ# failed to ñrestore the file descriptor limit after this,&swhole ñ # test suite would crash;2ñ actually happened onF§OS X TigerK¥buildbot).õcode = """if 1:Ïimport errno/os™resource Qsoft_ñb, hard 4 = /Q.getr!(éRLIMIT_NOFILE)P$s7 H, (1s)H:tryõùÚos.urandom(160þexcept OSError as e@@asse9.;2 ==D0.EMÉ2, e Ñ?elsJqraise AP1ionu$("~Anot "*d"¦5"""]�ð_python_ok('-c', ù)¤1deff_õö_fd_closed(self)áó# Issue #21207: 1Q() shœóreopen its fd to /dev/'5 if–"# bŠq/syˆ8@.supÄw Þ47Awith 8 .SuppressCt ReL(O1os.Ï»range(3, 258÷ sys.stdout.buffer.write(k4›Å€rc, out,I? = ÔSÕž× odetect×]@# chù something Úb, and €6 itöaÃ.addCleanup(±”.unlink, fTESTFN¯pcreate_S4$‚, b"x" *„�ðé _†0forO9in a˜„Ò©6(fdL àb(:pasvî7q# Found£ÿfd (XXX hopefullyš]UbreakÓÕ  &Ùš"({% !r}, 'rb')Ãf±°new_fd = f.d>no(–ð 6935: posix allows new_fd û and fd to be equal but ÿ.# some libc implementations have dup2 return an error in thisN]case.ýif new_fd != fd:!–0os.m(*], fd)(ÿsys.stdout.buffer.write(os.urandom(4)72ò """.format(TESTFN=support.e€rc, out,ö = assert_python_ok('-Sc', code5Rself.+E�Ï(len(out), 8&2Not)�out[0:4]uV[4:8]0‹2Œ2�.2Ž2Šó) @contextlib. òmanager def _execvpe_mockup(defpath=None)1"""ôPStubsV 4 Î be func Ówhen used as p q„qRecordsEÀ calls. The �vZñalways raise an“PexcepynÀthey would n%“lly never+Îò# A list of tuple¯„aining (Òð name, first arg,sÞ#<ÂÓ 2 orÄbe that¯ƒbeen mad…2Q= [] Ňý‹(qS*args�‰5¡.append(('m#',ž,”,#€RuntimeE!("1oOed")yeze{ "OSvòerrno.ENOTDIR, …e†2tryh»Boriga = os.·& ee Â! "S! =pk ^’`3if Q€ is not '¾¤$s.$=.aQyield¨hfinall  ?  ®ÀþK‹ð class ExecTests(unittest.4Casî@õ skipIf(USING_LINUXTHREADS,‘ñà"avoid triggerFòa linuxthreads bug: see issue #4970"·Ž‘ðpe_with_bad_program(�¬R#s(u,7ÿpe, 'no such app-'¹Â[+!],Ü*Ÿ�0argD� Àaises(ValueEórror, os.execv, 'notepad', ()) ÿ self.assertRaises(ValueE?/[]?*O('',�,Q'']) Ñdef test_æðpe_with_bad_arglist(á!):-óð)pe1�[], NoneøG/{}E-P''], GÔP@unitô .skipUnless(hasattr(os, '1'),2 À"No internal55Á function toi"."Ày_x_73r,-W_type}àprogram_path =hÐsep + 'absolu 5th'¦iÜF– is bytesËÅRP = b'futableC$Ffullr ó.join(os.fsencode(Hš3), ëDwnative_O ²'ðarguments = [b'KÃname', 'arg152']6Oelse×Ö gfœ±} ¥™þ if°ÊŠ != "nt"³_"d} VýJ>6ònv = {'spam': 'beans'}D#„¶› ) D an r T.û_mockup() as call|KcRuntim=UŒ4os.[$, Ï%, É ^¡Equal(len(†O), 1, (a[0], (A(v'r(s3,))I¡1A relÿ0ú#_"ge€>ï() returns def^%=ƒr"OSªm \lŸ, env=envI u‚Sequence©} •�  +', •œ™"Àh: #ó os.get_exec_path() reads the 'PATH' variable Qwith 4õvpe_mockup() as calls:)01envZÙ = env.copy()"ûif test_type is byteEI"[b˜±] = programa TJelseˆ CBù self.assertRaises(OSError,iW4os.,“À, arguments,ù= üf¡Equal(len(FO), 1,‚Sequence40>[0]š ('Úðve', native_fullé:, (¡DA))) ß#de•„internaláP_str(¶)_!._Ä /F(strÆ ifqÆname != "nt"EII  žÞÌ_invalid_envœÀargs = [sys.. utËò, '-c', 'pass']ô‚ñ# null character in penvironÐ É.:€newenv =â. í#ð["FRUIT\0VEGETABLE"Ë•"cabbage"Rg ‡QValueŠƒ‚oâ veÚs„2s, x<*ævp•LçÜgorangeó=îZe[ÕQc=ORANGÑ_lemonÏI` @unitxÀ.skipUnless(êðplatform == "win32", "W ‘ specificu¡s") class WeTests([CCasen\setUpj:tryÎöos.stat(support.TESTFNñexcept FileNotFound€ FPexistÃFFals„=”|?exc:6Tru9Uñfail("file %s must not p;ƽ &1ed Œ&%sÎG+% æg, exc)ì �„L" % ;‡‚õ0_re‚ ˆY 2%,Õàrename, supporôt.TESTFN, supporñ+".bak") def test_remove(self):ò .assertRaises(OSError, os.4 a Z_chdirY3X /mkX¤ddCleanup(üounlinkSê•with open3?–"x") as f1 �otOutims3 Xn, Nonex?modx>mod^ð0) class TestInvalidFD(unit>.CCase;Ñsingles = ["fÍp", "dup fdg qatasync estat",{dP "f2vfs$-�tcgetpgrQ‘ttyname"]<#}ò.append("close")�We omit ð because it doesn't rçñ an exception on some platformsKÆBget_o(6]helpe÷Õøif hasattr(os, : ]—check(get+Ç#rreturn h’’for f in “s° locals()["®‰_"+f] = ¾w‚£, f, *argsØx6tryYf2Ômake_bad_fd():›(Q AReIsmñEqual(e.errno, f.EBADF?elsAÉfail("%r didÑyêõa bad file descriptor"¬°3% f]@ò¸skipUnless(Í 'iÙ`y'), 'l` needs-2()'Â$!_ýf 4os.*Ï nt), Fals¨_range¬°¥´Efd =m žXø# Make sure none of th„ós we are about to«7areF¡currently ‹å (issue 6542).(iè7(10­ÞË›cR(fd+iœ ² ­ 2pas  “Ubreak•Šif i < 2Ow^@SkipT(7Ip"UnablePacqui* àð of invalid filóe descriptors") ñ%self.assertEqual(os.closerange(fd, fd + i-1), None) =ð@unittest.skipUnless(hasattr(os, 'dup2'), '&  needs os.2()'ƒ@def _�!):_Ÿ`.check–"O, 20€ofchmod‚„w†$/, ‡?own‡?own‡‡ pown, -1�pathconf�’• &ì, "PC_NAME_MAXmÑf0aŸftruncateÎÎÎ &ì�2“�$¶_lseek²®x”#?, 0†?rea„ƒ "?, 1‰0v�+v(‚òbuf = bytearray(10T¨V, [buf]£Ÿtcsetpgrp§«t°¿<(¶?wriîŒx<#o, b" "4¾ˆ À˜<¥T'abc'¨!¿inheritableY Gget_-s'_, TruÜe±blocking'),ûx 'ø3`() and‡I9,ÄZïÀlf.check(os.ð set_blocking, True) class LinkTests(unittest.ó Case): def setUp(selfñ.file1 = support.TESTFN9 $ú2 = os.path.join(1� + "2") 9rŒtearDownu@for tA in ‚%, Ž2£ƒ%ify0exiê@ %)¡os.unlink(!Œ__f,�1npcreate_>C1Ð]2tryO 1os.R.Lÿú except PermissionError as eG‘P.skip¶$('Vµ): %s' % e)T’with open�`, "r")S6f1,22l`assertE(Ð@sameXË1(f1’…no(), f2 ) Ý&stP‹Î oB1ᛚa_bytesP%V`ys.get»õsystemencoding()),;“ HO2, sH úÌunicode_name²(!fs•†e("\xf1"Ò&UP# ²eraise ÚS(²"Unable to [ Xäthis platform.Žø˜$R1 += ‡ä 1Ó &Û@¯×0If([–ð == "win32", "Posix specific 3s")Ú`UidGidá qðUnless(hasattr(os, 'setuid'), 'd` needsV2()'”Ü ŽŠgMz() != 0¯0.aRºAs(OSÖ,m2, 0m˜ 1~verflow7S1<<32‹ógó?gidóÃó ÿ and not HAVE_WHEEL_GROUP ?gid !7 eöV÷ÀlowError, osð).seteuid, 1<<32) @unittest.skipUnless(hasattr(os, '7€gid'), ')‘ needs osQqgid()')L@def "_3q(self):l if6@getu5ö != 0 and not HAVE_WHEEL_GROUP6:Ið.assertRaises(OSError,Ro2, 0ˆ2verflow8rIË ûW?, 0ÿ!<@(0T {C"\_neg1\1# N—ðto accept -1. We run this in a subprocess +Evoid á# altering theË>dner's 6õstate (issue8045).@\Õ.check_call([ ˜ýsys.executable, '-c',&ò'import os,sys;p6‚(-1,-1);Hit(0)']Ð/reÑ¿ì¿Ó5ŠØ&géØ#@Ø#\%Øë]Ø ¤0If(ùñplatform == "win32", "Posix specificÃõs") class Pep383Tests(÷CCase”Ä\setUpa`if sup’ÿ.TESTFN_UNENCODABLE³_dir =3ð.el[�NONASCIIX0Uðse: só elf.dir = support.TESTFN s"b#Áos.fsencode(Udir) +Åbytesfn = []õdef add_filename(fn):e:tryGp9fn)6 except Uni�E•^ErrorLireturn>«p.append” ­ †_UNICODEŠ+if8Ê_UNENCODABLEŠX 5\ �NONASCIIY2 VCnot  JÔôskipTest("couldn't create any non-ascii Ñ"Au“ÂFset(|‡os.mkdir=ì Ÿfor fn in«4�Ÿa_emptyhÒ(os.path.joinmÂV, fn)ŽC©k deL !#ifŽ ã @)±raise Value“€("duplicE7+ [:.ad™ò rÈshutil.rmtre”Wަ�rtearDow‹K9tst_listÂ=€expectedH1>ŽBfountŸH�˜ÁassertEqual(;$, dÂs# test Lõ without arguments}÷current_directory = os.getcwd¡ †Pos.chðfos.sep{Ó ©î3os.�[()), Gîkfinallw ¹m�=opeÊ;¢Œ ;f>-1dir,j, 'rb'õƒf.close(‰P@unit†.8õUnless(hasattr(os, 'statvfs'),�= P"need•02()"yëÕ{Õ# issue #9645c@# shå AfailDÛµeWZ¹@fullÍC k> 2ù (=B à­ÝÇ]X ÷Œ6) ªÀskipUnless(sð ys.platform == "win32", "W ñ specific tests") class PKillTP(unit!.óCase): def _kill(self, sigñ0# Start sys.executable as a subprocess and communicate from thebH. to° parent tha÷e interpreter is ready. When itJcbecome!ð, send *sig* via os.Î ew¥GheckL}°return code}PequalDY.2Õimport ctypesï ":win$umsvcrt ;ñ# Since we can't acRòthe contents of1nà' stdout untilN’ðhas exited, use PeekNamedPipeÙósee what's insideVL@withhÐwaiting. Thissdone soµ@ tel‡ÇL@is sJ!ed-ðrunning at a point where it could handj‘6nalƒ Ê=Œù.windll.kernel32.'‰ @.res¥4 = ¯_.BOOL.0arg.Us = (0¡HANDLE, # Y¶Aû.“.POINTER(pc_char)Oä?bufN�PDWORD?¿Buffer size@Ž O�3bytsO8_availP.B) # Ÿ6lef)smsg = "j"g"' =¾Š.Popen([äu, "-c",7ÇC "ÚFsys;f/gÝÏ.write('{}');oflush(7�input()".B�at(msg)]Ú¥=B_.PIPE8?err8",in7)�ŸÀ.addCleanup(È.¤o.close+?err+$in*�õcount, max = 0, 100@whil±Qunt <#n£`poll()7BNoneu€# CreateN trb¸Ðto store the ÷result of stdout from the pipe ùbuf = ctypes.create_string_buffer(len(msg))8�# ObtainVòtext currently in proc.} 7ò Bytes read/avail/left are ùs NULL and unused@÷rslt = PeekNamedPipe(msvcrt.get_osfhandle(‚¹.fileno()),M Dbuf,øsizeof(buf), None ðself.assertNotEqual(­i, 0, "°Š failed"AÝif buf.value:§_\Fmsg,1‹.decode(¥ÖYbreakPêtime.sleep(0.1†¥count += 13;els‘�Åö("Did not receive communicationw0sub�eess") Zros.kill«†pid, sig�gSôCs.wait()+K�def test_M�_sigterm(>)Ið# SIGTERM doesn't mean anything specialTñt make sure it worksiOW.jƒ(signal.XØ �>int‰÷ð on Windows can tuñ an int which gets set asgPexit èŽ7100ƒ¢“_with_eve†!, g, name0tagA = "Hàos_%s" % uuid.&1(—�m = mmap.ƒ(-1, 1, C&u[0] = 0«Ô# Run a scripâ has consol;antrol À“…enabled.C6 = Mð.Popen([sys.execut2åÔos.path.join( 0dirù0(__"/__ S"win_³_«uer.py")]€[—ionflags=Ãö CREATE_NEW_PROCESS_GROUPKQ# Letðinterpreter startup before we sendBönals. See #3137@ÝP, maxšF, 10Ÿ1whi„ÿ<#‚r¡.poll() isSAif mê:= 1|@Ð# Forcefully ñ¨`ess if @wereâ 3 to6 it žˆ Ò6INT�-øôSÍ@ didiñfinish initializþàj‰b#10endÁBnal("ö could also be done hereÊð# Allow time for theð signal to be passed and the processsexit. õtime.sleep(0.5)aif not8….poll():;ù# Forcefully killgðif we weren't ablez¡K0os.A(¤S.pid,Êv.SIGINT”-àself.fail("sub3×1did¯ñ stop on {}".format(name)) ½è@unittest.skipBBes a­ðinheriting Ctrl+Cbperty"Š@def Dà_CTRL_C_EVENT(˜#ñfrom ctypes import winŠË&¡ñ # Make a NULL value by crea–÷ a pointer with no argumenÖ;=�’.POINTER(j‚.c_int)(Îr SetConsoleò…Handler ?ÿwindll.kernel32./ÖA.argý4 = ‡–,H™ Q_.BOOLÎ @.res�% =ˆ7w@Call÷Bthis\GCÁFALSE causeséc,�%to¹1# hB?ð , rather than ignore it. Tg1pro\C is z'edK6by ç&es¸g(±3, 0ï?˜ ._`_/r_event(Š.Â8, ""D î_BREAKòi=mq ¡ðUnless(sys.platÑð == "win32", "W ‘ specific–¡s") class ÕListdirTests(þCCase±0"""" l-A²Windows."""#\setUpêø�Õed_paths = []Äófor i in range(2tœ@dir_£å = 'SUB%d' % i>#Y` = os. �.join(supY”.TESTFN, K >EfilebOFILEc%Zd )° eÀos.makedirs(‡K "}a open(C!º, 'w') as f\·á.write("I'm %sÉ�proud of?QBlameó¥_os.\n" % [ |£�.extend([­Ï,< ]=9Ysort(marDownËhutil.rmtree« ?3st_xB_no_˜J T¨Awhen†Ðpath is not aón "extended" path.""" •# unicodeõself.assertEqual(3þ sorted(os.listdir(support.TESTFN)),4V€created_†5s) %u# bytesƒ!pos.fsenË ��[0�Q) for A in ‚ ¯]°“def test_ü_]Ö(9%):Êò"""Test when theaûstarts with '\\\\?\\'—ðHSee: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxëžý& =•` + os.@.abs ]Mú8Q..EE = bJµÁ )ÂB`"` @unit^ð.skipUnless(sys.platform == "win32", "W ‘ specific—Ts") @�E!_uFñ_symlink class :S¡%s(zCCaseÆ@file9 ¢'7�_target =/ __$"__g4dirM LK€dirname(I>"R€missing_¤ 'c³\setUpžæ³aexists%.�k3Ÿ4?notk d0h1# ÆaarDownñî¯/if§wÞ.‘os.removeG.&!Oax-NmR0$Ll® â  *†¡_directory*П3os.D ",3 ²@True5°.¾5Ñ6-is5ÀTrue(os.pathð.islink(self.dir C)) ©check_stat'!, 5‘_target) <àdef test_file_U;!):]eos.sym.)H] ’ñ assertTrue(os.path.existsfL É7 isc7 ¬7 7i6 Ûñ9ÿ_create_missing_dirC!'C(ð a "directory" c¡ to a non-Bent Ÿ'€'bname =Çm%4if `lJ s( 8ËÏfremove!F{“ = r'c:\\‘does not Y–.29r3c740¢®#…+"s(B0_is+0 = ~i(,#Ä,:ƒ¼ÑT\…5_to™PĶð# For compatibility with Unix,y�a will NE theÙ5# ÷ žÑus and call R�D0 if< sDBwas qdÖ ==M.12os.–ö.6?P@unit@ò".skip("currently fails; consider for improvement"; isù/on�H‹qhaving sÁ return true¤fýs é¦%‹F !=/rm!WPallow#u`ƒ ) #ÕZš– SjPEqualkòm),»÷5Not<l.±=¤ÓQbytesô =Žrfsencodâ¬'`_@e¢C®3Q12084r=blevel1Ä+Àabspath(suppÓort.TESTFN) ñlevel2 = os.path.join(A1, " +2"0302030ðself.addCleanup(suppˆ�rmtree, a51) ‘ƒos.mkdir„z 23LWfile1¬0absä(ì.&")Ypcreate_( §rrig_dir^vgetcwd(;Etry:ÓkUos.ch×¾BlinkIŸƒS7inkQ0`os.sym6Ë0rel<¨Š7Œ�ssertIn("@ ",ù@listœ4os.Ê)Gsp# Check.ð stat calls from the same !as\ |PEqual¹I±Ô3tat—ax_below{ {1¥Ø˜ Å1 µQ†ÿ)Ä_aboveÄ3ÄYñfinally×o7ð@unittest.skipUnlessó¤ñ .lexists(r'C:\Users\All 'Û}0andƒGFïProgramData'),µ P'Test4óectories not found}@def ¼p_29248(#)÷#�) C+òSymbolicLink, which Es“#áñ reparse data buffer withpprint nSgstored=‘first, so*þoffset is always 0. ‹?P£ "Pg Name" DOS Tâ (e.g. "C:\") l>¢3an wñof 0, followed by”±"Substitute]@)NTfA\??\ju. The " " AG, on=góother hand, seems to have beenl`d manu¬>»õinverted order."btarget…@read�¡ !.aPETrueà 0(U!, é £'jž_overflowtòOlder versions wouldú@=ð when detecting #ò0 whether a link source was a directory. This test ensures we ð# no longer crash, but does not obõ wise validate the behaviorHõsegment = 'X' * 27 path = os. ƒ.join(*[1u] * 10)-¨¥_cases = [­ù # overflow with absolute src)€('\\' + o#, i)),$MdRrelativRE,TKPwhen á>ing—�b[:180]H N]£0for@!, �!inÀ:%:try`os.symB(srcEc"þ except FileNotFoundErrorLIpassrNelse'ˆj os.remove(Ë † Š/OS€$ „a# Also °bytes, sinc¡@at iPsepar´Acode¼.̶>pos.fsen>J ),ÆÑ ÒÎX™` @unitxð.skipUnless(sys.platform == "win32", "W ‘ specific„¡s") class åJunctionTests(^RCase)>j&3 †'¢`_targeX@„dirname(0absYÁ(__file__)) Bãdef setUp(selfuN`assertÊ8@.exi§%.vÜ4È8{ŒtearDown~/ifz ¨¬#-ðrmdir delegates tohqdows' R\DîWæbwhich ‚$s àê points safely±q¹ Ú¤st_create_Q-¼‘_winapi.C'&SÛ¢%lft’y6Truñy7Zisdir‚+j¦Qs areýÑrecognized ases,ŸFFals "iszeÖ @ un%_™HÀnction(self.ôjunction_target, self.3) ñ assertTrue(os.path.exists(6%) 8›os.unlink#!:YOFalsZð @support.skip_unless_symfò class NonLocalS Te¤�unittest.bCase):¨‘def setUp¤%):œEr""" óCreate this structureB%Ebase-å \___ some_dirPÐos.makedirs('=//'@˜ŒtearDown›Òshutil.rmtree@ 7 stzpectory_P_nonl K•CThe K ð should resolve relative to the [U, notî"²current dir�.w5QThen,D S7 ->Ðdir and ensur„"at]+p$is¦od as ar÷In issue13772, it was discovered tha¬Q dete"¥ failed ifq .M €specifie9 1Eq, which�±a defect inf implementa­.=¼dsrc = ™Cjoin1, '[-'Ó3os.½( –dir', src$™Uaisdir("" k FSEncodingW/s(fêÍ]st_nohPEqual^0fseX÷e(b'abc\xff'), >qdecode(=Pu0141?…—Œidentity## #fsSš…x)) == xŠ`for fn´P('uni�\|0, '÷n\xe9', 'ascii'k#6try|rbytesfnÚ{&fn¤&‚except Uu’neErrorQwcontinu¬" öé‚ñƒ0), w úaDevicelþ hnbad_fdf`Returnºñe when an fd doesn't actually qýQIsNon@dš_A³ing(123456)W@£AU@r‘isatty(0)kö(sys.platform.startswith('win') oÖ�0(ha?!r(còe, 'nl_langinfo'S #ÁCODESET'))),&J'¨€ requireÊ1tty–÷either Windows or g(P)åt À(self): ô encoding = os.device_@(0) %ôself.assertIsNotNone()'öTrue(codecs.lookup0ð ) class PidTests(unittest.aCase):}@ðskipUnless(hasattr(os, 'getppid'), "B` needsÐ" @def _(Ôfãñp = subprocess.Popen([sys.executable, '-c',š4ô'import os; print(os.vO))']A xstdout=�2IPEÆr ö, _ = p.communicate($÷ # We are the parent of ouråÈ ß`Equal(µg$),Kaid()) 4L|waitpidLargs = >� 'pass']JÐñ# Add an implicit¨  for PyUniFõ_FSConverter().<2pid½`spawnvjðP_NOWAIT, FakePath(�`[0]), &Pstatuª4os.Ë_pid, û53, (*ÎS„ÁÐ:pcreate_‹9ò, *, with_env=False, use_bytes©­@exitR = 17•K�filenameÌp†u.TESTFN1>ÒaddCleanup(su'„unlink, BêUeif not¢™…ôRsys; 5¡it(%s)' % t²ŠJelseL(�nv = dic7venviron³t"# C4¥unique keyY#K0key €tr(uuid.4Ä!)Aenv[ @key]3ï Sa# readQ@variP from §ù to check that it exists›2(3dr; magicÎPK[%r]O KÅ!% IZ.key,n²*c ×åÊ, "w") as fp‹rfp.writà µÚRÖ&ifÄ \DQos.fsEAe(a)ðAa in¤Hºœe{60k):~Fv(;N@k, vaO–.items()}ARreturƒñ@requires_os_func('k"l'lÑWˆ­ìrµø=�ùFRos.P_ÅB`[0], * 8S“˜I ÈÀires_os_funcó ('spawnle') def test_q(self): pargs = €.create_â(with_env=TrueK/äexitcode = os.T°os.P_WAIT, =`[0], * ,Y6envCkÄassertEqual(T-c!) ¥ô@requires_os_funcâpâpâ’�Õ/p(Õ9Ë6®/peͯ/peÛƒ°@v¯váu®vÒ�7¬4v«vª@v©×¨IXvX3vXÔ«?p¬WAvWÚ®I VonowaitV7pidÿQ+NOÕΨbresult7v¦pid(pid, 0$ w5#7pid)@tatu‹!!1]ÿu÷ if hasattr(os, 'WIFEXITED'É)m·,!(sa)r 2�@os.W]dSTATUS5›<FelseM„Rx B_ << 8â kf_bytesäÀ # Testó bytes handling in parse_arglist and1env£(#28114) ñargs = self.creat>ñs(with_env=True, use_n?ðexitcode = os.spawnve(os.P_WAIT, `2[0] ,h6envBzÄassertEqual(S-b!) ´ñ@requires_os_func('v"l'S’def test_0_no‚(f!):BùöD"1.—õRaises(ValueError,ìl IP_NOîG4O, ''÷ eøeùMeúO, {}þL"''P¸úvvLv/()K/[]K6O('',™8?'']™ v™v™MvM"()MÞâP/[]P;£S;3[''¥B_pinvalidá!, /"ò[sys.executable, '-c', 'pass']“Mð# null characterŒðthe environment variEQ name‘:bnewenv@.f.copy(ü#õ["FRUIT\0VEGETABLE"] = "cabbage"R6tryêcRò¢ k{vexcept ü ZxJelsec Ü3127B¢?Àle value  ð newenv = os.environ.copy() #õ["FRUIT"] = "orange\0VEGETABLE=cabbage"6Etry: Gòexitcode = spawn(os.P_WAIT, args[0] ", r‚úexcept ValueErrorZEpasskJelseôself.assertEqual(Šu, 127) ;0# e ó character in the õment variable name;²Gr=ORANGEN_lemon:ØvÈ;@fileLÕupport.TESTFN"Á³ddCleanup(s'„unlink, B1¤with open(Ê, "w") as fpÀfp.write('im~µ sys, os\n'‚À0'if.sgetenv(5) !=Ñ:BLqraise A˜1ionØ'Ãà = [sys.executví]�|uëL�¥¦Ï g0eñ@requires_os_func(' #veù“def test_�_invalid_ja)¼!._.&3os.=u pv/pew)ð:pe) # The introduction of this TestCase caused at least two different eèð s on # *nix buildbots. Teª¢arily skipYato let±,ð move along. @unit1.50("S;ødue to platform/ìdŽ ce‰V *NIX‡+")QðUnless(hasattr(os, 'getlogin'), "{c needs@ ") class L)%s(©-ø X(USuser_N5os.'X1#NoElen(:0), °Ýùpriority') and ü6set,c§".KÈA%ƒProgramPx /1"""!B forsÀtpriority() õ and os.setpriority().""" def test_set_get_%bself):&*`base =KgKôos.PRIO_PROCESS, Qid())b< €5 !, i6+ 1?Etry:LP1new©�%D"ifj`>= 19 &V< r2 raise unit2ñ.SkipTest("unable to reliablyT t) "ÁOñ"at current nice level of %s" %¶FNelse¯ÁÔ.assertEqual(àckfinallg xmÌ ¬þxcept OSError as err½ if�.errno != žno.EACCES.˜žð class Sendfile¡ñServer(asyncore.dispatcher, threading.T òFTHandl;Ahat.DT_chat){E�__init__(wz, conn)©< E.6 )Nþ.in_buffer = [] îclosed = False °push(b"220 îvy\r\n")ÛÀhë_ à ½qdata = �šrecv(4096Ú«€.append(9 kghñreturn b''.join# I´ÿ* µ’«6OTrue e£Ylüwaddress� f øœ# £+ÜÒreate_socket(£.AF_INET, ¶SOCK_STREAMj?Tbind(®7‹listen(52Rhost,Dportj0get –name()[:2«T¯�r_instancN6Non°%`_activ Íw_lock =½SLock(ò# --- public APIÛ‘@propertyèò|runningà‚pB4\start2dB notYi#KY_flagµfEvent(b &nM@.wai@ž!op�À): aóssert self.running ú_active = Falseqjoin() �def wait(7!):I#ð for handler connection to be closed, then stop u serverIñwhile not getattrj.UÂ_instance, "O"",³Œ�õtime.sleep(0.001)a¹.~Óö# --- internalsè1run}[=-;Tru,¶__flag.set(sÔ <öand asyncore.socket_mapQÅ2×_lock.acquire\(IPloop(ûAout=ø‡, count=2ZhreleasZViD_all2‘m_accepû‚, addr =v(‚ErÖ.HC(Hy/_-ecuR¬/cread =—=æŒwritableë†return 0*PBerro–ñraise @unittest.skipUnless(hasÊðos, 'sendfile'), "*¤ needs os.ó()") class TestS2(\bCase):žð DATA = b"12345abcde" * 16á024 # 160 KiBñ SUPPORT_HEADERS_TRAILERS =zðsys.platform.startswith("linux") ¾\JMÄJsolarisL3Runos"[!re!õs_headers_trailers = ?› ,Þ'W W[ƒsupport'«@»amethodG0`setUpCÔG(cls:pcls.keyûG0.th³“ing_setupÎfpcreate_?(u�.TESTFN, H… �tearDownˆP~�cleanup(*[2keybˆ,kunlink‹�õ Y¨ö4 = ÝÓS (P‡HOST, 0)yÂ<™X`clientMT[&.I¢.WRhost,µÜ „hèo(b # Ú¡hronize by1ingP"220 áœy" responp\œrecv(1024ÿPocknoã -)noèÀlf.file = opó en(support.TESTFN, 'rb') åself.fileno = 1() *Ðdef tearDown(%!):E/{.close(\mclient"ifmæserver.runningVZ!Lstop[v = None©@sendÒ�_wrapper±€, sock, ò, offset, nbytes, headers=[], trail æó"""A higher level ^ö representing how an application is+‹´sed to use ª5().$5""" zwhile 1:try+Oþ SUPPORT_HEADERS_TRAILERS26¥return os.Š&, DJ-Oelse“0 Yþexcept OSError as errf if@.erró= Þno.ECONNRESET2¶ï# disconnected]raise)elqAin ({„.EAGAIN,€GBUSYpt�# we have8Qretry:] datap5 coŽu�x½Ní0st_p_whole_7H£�# normal�:|Ptotal;Ut = 0r }u = 4096)ôF0< lƨGDATA�oy¹°© ù.Ò2no,o � HL~nt == 0 Ubreak®ƒL +?)ntÇ;±assertTrue(Í#<=— –,bEqual(w&, d­” .&,Pg5°Qshutdîÿocket.SHUT_RDWR/û W.wait»¶²þðhandler_instance.get_(7�,$)Ñ 40 L5$teñ²at_certain_cøQstart÷ôaUc at a :a ~ `+ =’U // 2<#muš(-hSÀs = 4096  ðwhile total_sent < must 0d: "ò = self.sendfile_wrapper(bockno,# ùoffset, nbytes)S2if V:= 0muYbreak0L +†)ntt ±assertTrue(w%<=–L)öclient.shutdown(socket.SHUT_RDWRÆ/kclose(·server.waitPdata ÆL"ðhandler_instance.get_(7„expected;‚DATA[lenŠ) // 2:]ÐùfEqual() , ;T)¹4(‹)3/%, ] ‘’def test_É‘_overflowÀ)Ò# specify an ,0 > RQ sizeL"=É‹e+ 4096'6try\8þE= osÉ‚.è´Ko e,S$úexcept OSError as edõ# Solaris can raise EINVAL ifÕ=Öõlength, ignore.º­áif e.errno != .I q,g>;els•ÙÚ 6, 0Ø"…�¿fKb'')asinvalidiÞ`Bwith¦MRž#s(Í)Î*cm^,,-1( ³2cm.<2ion×,Õ ÊŒkeywordsÄ2# Kõ arguments should be supported ÁAout=™ñä =0, count=?,;Z‚**{'in':7}7Êÿ lf.SUPPORT_HEADERS_TRAILERSM!•™ôheaders=(), trail sflags=0Pc# --- -% /+�s>£@requires_(_Q ¾ ’ZA = 03¡c m0@ |F€Ö=[b"x" * 512]‹‡ àoffset = 4096  ãnbytes = 4096 • while 1:òsent = self.sendfile_wrapper(bockno,#9no,CG‚offset, ž)D2if Š:= 0¡ZYbreak0atotal_3+¾)ntk ò expected_data = b"x" * 512 +áEDATA/ÆassertEqual(wi, len(P)Ó9Ûclient.close(·server.wait–>"ñhandler_instance.get¾70§Phash(M1), ¨âñ @requires_headers_trailers…def test)žpTESTFN2>rupport.a + "2"D½3²p…abcdef" ½³ddCleanup(sL‚unlink, T2@pcreate_W( , e)Z–with open'¦'rb') as fǤ%osýæ#.sõ f.Zrno(), 0ôkI¦=[b"1234"]Àpõ   $ÛwµJ(;z,LB, b"™­D  P@unit!ÿ.skipUnless(hasattr(os, 'SF_NODISKIO')- 'F© needs os.7(‹Qflags¢ˆ?tryÎýÀÐ!0,˜m=‘Çàexcept OSErrorT:errˆñif err.errno not in (p.EBUSY,—no.EAGAINÒ©€raise °s_extended_isibutes(<!ifg…P"setx*"$X�eturn Fal_ D9uÙ’, "xb", 0Cpî CTY�7(fpMpb"user.ú""Z8 ^ i rÂgfinall »HW2âF0TrufÑGw="ð”n-broken ² ˆ² Wð") # Kernels < 2.6.39 don't res­ Á �3. @<.¿Àes_linux_verð&sion(2, 6, 39) class ExtendedAttributeTests(unittest.ñCase): def _check_xattrs_str(self, s, get5, s cremove4lis"¡**kwargs):Z^õfn = support.TESTFNdÄ.addCleanup('µunlink, fn),Àcreate_file(Rwith Jö ssertRaises(OSError) as cm�”ÓÐ(fn, s("user.E"), Äb]ñ Equal(cm.exception.errno, ’.ENODATA)ZlBinitX5 = +Ã`¶IsInstance(9,8T‰À?b""Å­‹'et[` � Iset(Ï1), DSØ8 xbw±X, b""D\ë÷ hello", os.XATTR_REPLACEQÃ�e€s ³ 8byeÆ_CREATÅŒ_EXIST·D2++b"¸~¹ E>‡)fo?¢ æ2oAlf.aH³ç ¦Q‹A ­´L&ØUÓÖ7áa"*1024„à ƒV† ,ø å@manyƒWortedYö{}".format(i) for i in range(100)uàfor thing in mgany: õsetxattr(fn, thing, b"x", **kwargs)0õ self.assertEqual(set(lisB@)), Qinit_W1) |qmany)) K¢def _check$ s(Y0, *nx© .3Ž_str(str6cáôsupport.unlink(cTESTFN‹(Ö]¿os.fsencodee,ð±test_simpleî)Ý S(os.g˜T, os.¥ aremove^,íÉ 5os.œïŠ_lpath‰aÀ, follow_sym—|s=False "fd'¼(¿–#“with open$¶"rb") as fps)`returnbZ´fp.fileno()aeƒ‹_´ƒ owb", 0†á( ý‚;Y… Wƒˆ[… (Á� Ô%, Z�) @unit”ñ.skipUnless(has óos, 'get_terminal_size'), "requires3 "Ð") class Term3eTests(kCCase/Nƒí_does_not_cras–@"""C,M if •2() Äòs a meaningful value.oéðThere's no easy ñable way to actually —P the Á0 of £, so let's1Uif it‹AsomeK` sensih…instead.K5""" ,tr•_ize =e(�àexcept OSErroräeãñif sys.platform == "win32" or e.errno in ( “.EINVAL, SNOTTY­E�# Under K¥ a generic‰Ðcan be thrown·5theìEÐhandle cannot1�retrieved-ðªC€("failed¸dquery —´"!lðraise óself.assertGreaterEqual(size.columns, 0) 1 Bline/0ðdef test_stty_match(@!):RÀ"""Check if &õ returns the same results 3'�actually`ð s stdin, so get_terminal_Æç is invoked onFódin explicitly. I‚ succeeded,…nR(õhould work too._5""" 6tryñõ—à= subprocess.c _output(['ã@', ')÷']).decode().split€ø except (FileNotFoundError,^rCalledPl��P4Qssion!£¶°.skipTest(" Uæcation failed"ñexpected = (intOe[1]), Ð0])) # reversœFrderæ 5òm = os.åq(sys.__¸__.fileno()‘)!OSÞZ as e”€ñys.platform == "win32" or e.errno in ( “.EINVAL, [NOTTY59�# Under K´ a generic ‰Ðcan be thrown=theœð# handle cannot1�retrieved- «›€ to quer0W size²­Frais~IÕ", Œ”) classÎ`s(unitö.CCase\setUpDsStr(str-�8pasû®abytes_ã•ames = []µ0uni0$ëð upport.TESTFN_UNENCODABLE/dJNone"…Ós>ˆ?els?3»ƒ.append(~Ò/ N34ú/DEú enOú>Çú?Ros.fs(E¤Ø ä;d-Ddarray(78§memoryview9ߟ}l”!+  ‰à "@_ose­© Afuncá&ä,�chdir,),)Ðmod, 0o777),  ÷(self.filenames, os.lstat,), ( )Aopen2�O_RDONLY4_rmdir]…hunlinkR]¹õ if sys.platform == "win32":$åéfuncs.extend((üjbytes_+r7‹, b"dst"ÿ; _place<unicodeyx <z=!@list í%))7Oelse` Zh gT /‰Ó 4Ðÿif hasattr(os, "chown")ã1appCV6o, 0, 0\l']7^�truncate`9½ chflags^8] l&^9_ ochroot]7,Ò µ #ª>tryàif isinstance(Jë, (str, bytes)_3Ž2§²')Qwith ð assertWarnsRegex(Deprecationÿing, 'should be'žY¢ÿexcept OSError as err/¦tIs(err.³", =@str(x +�hUd DejslEpass@J›’fail("No lðion thrown by {}".$at¢ð class CPUCountTests(unittest.CCasef@def `_cpu_c04�`cpus =Ç#1if !«is not Non=Â4IsI”4V, intJl-‚Greater(*0(-6@skipÜ1("CIŽðdetermine the number ofSs") *�FDInheri/D/“get_set_i:ð class PathTConvertðerTests(unittest.õ8Case): # tuples of (function name, allows fd arguments, additional 3 toMB¤, cleanup )"Qs = […÷ ('stat', True, (), None),"l#OFals$”access', %�os.F_OK,Qhchflag.0(l)Gopen|Nógetattr(os, 'close'ÜÝ!] ä@def Ÿó_path_t_converter(self¬+€str_file¢ñ = support.TESTFNK&bif os.$b= 'nt'î€bytes_fsn3 = W~MOelse?0 ‡ò.encode('ascii'úwl{“FakePath(T4@fd =Í^(. ), öO_WRONLY|os.O_CREATEER.addC•(°{unlink,G81os.ÅR, fd)ºÔ6intM¤#° ôòq8for‚õ_fd, extra_args[q_fn in ÜX ©Bwith!0subú(=T¡:try?Xfn = ËA°#ÿexcept AttributeErrorR†continueDAý—Hin (!,§!, U)C \+ø02if vs{¶)º p,`=eƒMÀresult = fn(+6, *ú˜+$ifp_s notÈ ?¤B_fn(yÔ ÓýassertRaisesRegex(12TypþÀ, 'should be°3ingÈ'6fn(O ÿ p"if¥?_fd²×PGNý�/MfailaÍ] YJVr"=vÀr,  þ'os.PathLike'): "ÿ8fn(fd, *extra_args) @unittest.skipUnless(hasattr(os, 'get_blocking'),`¨'needs os./`() andsEÃ()') class BXeTests(‹CCaseÎ@def £‡S(selfÝ@fd =fàopen(__file__,•O_RDONLY)·;ü .addCleanup(os.close, fd& ssertEqual' Úµfd), True) [9os.èo_FalseX5Y |þÖ° ~pExportsn}los_all{y@In('‚'z_./__û*Kwalk*˜‘Scandirðcheck_no_resource_warning = supÙ.$³W_setUpÔBpathV P.real (]kTESTFNß`bytes_(;�fsencodeb. 1‰Y�rmtree, Z 3Pos.mk%Ëacreateýo€, name="W.txt"1W)Gelf.´àif isinstance(?!, f) else“ux](ïW`.join( �ñ¡8¶, b'python')treturn $®‚wentriesãsÙ� = dict(( y.¢!, f¿2for"0 in:s�k;anasortedn²ies.keys())s8Ù‰6iesØKq_stat_eob , 102, ¡h_fieldò(if ÿÔÉÓ7Gtat1.ÿpif not +ø.startswith("st_6/…continue !ifHsA`dev", K3ino _nlinkZ.+”0get³('  š7!2,®7gn7Û  } ¯9Î6¸ÊyÕ =ð, is_dir, is_filóe, is_symlink): ðself.assertIsInstance(entry, os.DirE )2REqual-p.name, +Apath] a.join(‡CD…inode(),—Ðsos.statŸ\dfollowõs=False).st_ino) M_? = Iž_s_dirŸ S‚.S_ISDIR[pŒ_mode)d?fil e?REGe%4Í 0os.a0.is_j)Ul”V/, Ÿ–%¬zim=!‰ ‚�ƒ{'˜ {ö"'_evÄš Ð+!osËø == 'nt' and not>›…°±qñdef test_attributeseû«` = has$`(os, ''{0ä = support.can?(k³0dirûØ  ×V"dir"ZPos.mk$:ÕLñpcreate_ ("G.txtJ0if ¶Ó�:try0os.*(Eb„"(smžHþ except PermissionError as euĤskipTest('„¦): %s' % e\3if m Gʉ(.ºB€"rtarget_;§ectory=Tru�éy4z+7+pÔs = ['dir', '&%']$Ê9�.append( ˜©;À names.extõend(('symlink_dir', Ófile.txt')) óentries = self.get_‰(names) +Cy = ['_]@QcheckB y((1y, 'Ä, True, Fals[ «`,_le0if :²¥Õ#_S-ã 5ˆ¡‹ &lj3 tÐ ý? 8 |Ddef f y(R , j) Dpath‘abytes_Ñif isinstancež!, b) elseÁ*áàÝðlist(os.scandir('‡ñ.assertEqual(lenÀwies), 18T0š F,.ÞäšareturnKybacreate~DS<%='•+`/B"=îwVëyP.base0(V)øœÀtest_current’RectorÁ�‡0oldCP = osˆFcwd(6try §Pos.ch¶¸«˜t# call Ýð) without parameter: it must Å the content“I"oféB diré 'ØXQdict(*yèby) forÞ0 inæœèqÒyasortedRÉies.keys()),9 @[os.Â]pofinall\”ZòArepr¦åãr´r ÞN?æ), ""‚ fsÛŸ_protocol�72os.\n0y),¨lQ.joinhV,Ÿ Bž_‘<1×_÷¡fsencode('sœëTmðname=bytes_filesname) Âfspath = os. Æ(bytes_entry(òself.assertIsInstance(2!, 3-TEqual(v}0os.ˆa.join(‹qencode(x!),eQ_fileÃ!) Oñdef test_removed_dir6!): d@ã eYs, 'dir'O/Pos.mkG.Ö1 = :2get#(>9Vos.rm=„á# On POSIX, is¦ð ) result depends if scan>õ) filled d_type or notN if±† == 'nt'¯QTrue(¼.xÔ(GFals)h/()*xsymlink-Ÿó Raises(FileNotFoundError, ´7nod°ÝÅ# don't fail2Vstat(¹ sfollow_µ!s=÷.OelseKtGreaterNšV(), 0?mTÝ «=*/, Ð Õ 5×câeߟQos.unê3±6W"T&ìH t áÿ¶dbrokenÖ  if=¶ support.ca* ¼breturnãòskipTest('cannot   symbolic 8R“A0M ("V.txt" 3os.‡(;,¸Š g™3, ">WXŸ4iesÔðget_entries(['fñile.txt', 'symlinkC]) €entry = Jies[('Pos.un@µ(filename) ðself.assertGreater(OÆy.inode(), 0q-TFalse+s_dir())ƒã()) # broken Ý‘ returns Z  ssfollow_C!s=#ˆ?7Truïqóñ Raises(FileNotFoundError,ªfy.stat,Å# don't fail÷„)(¥Âðdef test_bytes( %):E!.cÖ_x"F"Bpath@° = os.fsencü?¬—ðies = list(os.scaný(F‘Equal(lenÁries), 1 ´bÔ"0]êó‘¬O-.ÒD, b'Ý'°2­,s[ 0os..Q.join`', n)M �Q_like2’°for cls in Øöarray, memoryviewâ·Ÿz =7–Ä5Wwith ðWarns(Deprecation7ing¼7u3i¹7j  W1 6G:6®dIs(typPÀ!),ës¦3­3ÊP@unit °.skipUnless ©0dirM¯¯upports_fdíR'fd s* �D�requiredAthis}.q/fdøº In–7,qj”ÿû¼qðW�expected_C–[&]&$ifÍD.can-(Ûg(E mQ'ì�’.append('+È"fdj9opeTàos.O_RDONLY)  Rtry: ú with os.scandir(fd) as it'-ùentries = list(it)J1nam[( y.Q for 1 in Iies]6ð self.assertEqual(sorted(?Òs), expected_< $,Ï¢Ï ¦’ë –Åa.path,Èà [$ 9Pos.fs8(CÒ?ntr?5É.is_symlink(AP == ''Š if@stat|âîupports_dir_fdõÀ4t =8²É", 5>=fdj8 ǹ³s,3so„, follows=False†G(, ›kfinall"€os.close €ñdef test_empty_Þù)T×ñ Raises(FileNotFoundError¨w[, '')]ðconsume_iterator_twice(Z iÐcreate_file("V.txt"$CÜëJÓz‘· ä|K5°1len) ie¯1 ÏUÒ# check than ×…ing the šÝ  doesn't r4¡ exceptionvJŸ2„ U2), 0¡2÷Î1badÌM_typh80objLö[1.234, {}, []]õ¢ ùOTypeñg'F…À-unicode-escãape'), 314), ñ$(chr(0x200), ValueError), ] class TestFailingBool:<òdef __bool__(self)WÂraise RuntimOKBIter3KOiterK00fil0ƒchar(arg}¡return ord! > `"d") 6Omap_374+1)°pBuiltin (unittest.CCaseuõ# Helper to check picklability-_æ e6ó, it, seq, protoTF¡itorg = itD2d =]€e.dumps(=8$&it%…loads(d)©ñ.assertEqual(type(j3), )0�list(it)´%) Y#P the âø ator after dropping one fromЬ 2try ú1nex|u°except StopNZation31@? C[1:]nq_importìÜ_†__('sys'r?ostring_name=W\–, level=0€"RÇ1s(IÂ&, Ÿp, 'spam‡?2Typ =¯1, 2, 3, 4| ‘ >'s!",  vð# embedded null %Uacter;ÙïModuleNotFound ¥\\x00' †o# floaº .¼.8â 3.ž ¾ $,+O# stµ Žwabs, 'aJ # Ðw _¶\zFalse),(?othR �b” *f, None0·ðAbsClass(object):' ùdef __abs__(self):*•return -5)ñ.assertEqual(abs(AbsClass()), -5) /`Œtest_allaGñll([2, 4, 6]), True)Gˆ/CNone2OFals3ð Raises(RuntimeError, all, rñTestFailingBool()P{HDoIter()»@9Typ…010)äï# Non-iterable‹ K GRK_ argsFˆA, []U¯# Too manyLÇÀ� �# Empty ß?tor™M70, ^¢aïõ# Short-circuitLÅS = [50, 60]Fýx > 42 for x in S}L4P%¬ /nyBny([äþÚ9 4,Ne6Uš "Cny, ~ ƒ%KD%=%4!nyÐ •%‘;%%�� �%M1%ñ % Õ?, 3) ?ny()o10, 20P$ )Oscii+&¿''), '\'\''ƒY,0+0(Ö?'()*[Õ?'[]* {}}'{}*a³­¯a.append(aÉaLh[[...]{Qð{} a[0]c = a õself.assertEqual(ascii(a), '{0: {...}}')1õ# Advanced checks for unicode strings.Qdef _(…_uni(s):�~¶s), repr(s)yG?"'"''"©0O'"\'/\0wr\n\t .ö# Unprintable non-ASCII characterø}G\x85F _u1fffjU00012!ÿ# Lone surrogatesOud80Ú,udTÇIssue #9804:\ñ should be joined evenñÐg# wide õ (UCS-2 builds).*ö!'\ñ·d121'), "'\ñæ# All togetherV =4à0\"\n\r\t abcd|"éHJb\uD800–D121xxx."C 5s),#¶¼r"""'\'\x00lB\xe9^n‡×na'""") P�test_neg(ñx = -sys.maxsize-13*³°True(isinst“w(x, int5,ßG-x, W,+1Œ@callà ‘Jv(?lenqeFalse((?"a"( O0,ÿlambda x, y: x + y6 Š __“gtins__1Ædef f(): pasWø#f);”Šclass C1ßRCmethLY'C1•vc = C1(ï� c.k;* c»@# __uñ__ is looked up on the ÚQ, notkŽ%c.?e= None€ 6 @Ñ:?: 0JFdel N='è§ C2(object‹¦ÊèÎ c2©2©2¥/c2@ # AzL3(C2» c3”ð3() self.ñ"assertTrue(callable(c3)) def test_chr(self):.?`Equal($Ÿ32), ' ')' 65'A' 97'a' @0xff)O\xff,ÿRaises(ValueError, chr, 1<<24¬ õsys.maxunicode),Ú ðstr('\\U0010ffff'.en4€("ascii"¤GŸ-escape')}¯7Typ®*zà0x0000FFFF), "…"81<881818§E88à8F8Ñ0p8à8à1ˆàpÓ¨8" Ñ/-1ï/51Ø7 “(Overflow;v)H]2**324/mp4sþ not hasattr(builtins, "cmp"ƒlompileScð'print(1)\n', 'Gexecõbom = b'\xef\xbb\xbf'ÎH&?+ bO1ûsource='pass', filename='?', mode='‰:èdont_inherit=0;dtmp', Z0I7valÒI|s V1ƒ ðmemoryview(b"text¥"À@", "¸€ ¢ˆH 8#, »#, i#42¹€Á0badAòuÔ„U ‘single', 7ZåJ 'f¡!ž !�*®UCú j/y[(Zc"\xe5"^µÀxec') ñ2 self.assertRaises(ValueError, compile, chr(0), 'f', 'exec') Dµstr('a = 1'Jebad') Jö # test the optimize argument&õcodestr = '''def f():D•"""doc"""õdebug_enabled = FalseRif __#_FÙ86Tru7:try.E ]�except Aa1ionX 8€return (^Ù, f.__doc__, ,¥yOelseMãN5'''V Nv ‡s = [(-1— nR!%),_^B(0, úT'doc' 0"1,c#, 1ë323ENone 2]•0forvòval, *expected in ò iª³both direct-™ation anduvia ASTlýÇ1objK†ƒ.append(‡(2pstr, "<(P>", "Œ ",¹/†=optval)%Qôtree = ast.parseJ &_‘ w>tORBZ Dšnÿ){}צJ, ns§Þrv = ns['f'](’ôEqual(rv, tuple(Ù)wêM�_delattr(<O€sys.spam¸¦,Pys, ' 4TypR: }iy#Xõ(wrong number of± Ãp`ir, 42t?\æ) - local scopÛ0_vab1ôgEIn('%!',©P_fmodule� ACexit<?sys?ö_with_invalid__dict__Tñclass Foo(types.MtÓ;E = 8Óf †oo("foo"U©Q»ì=, fLB¡In("strip"<G(str�k0Not,y__mro__.±¸6objkkobjectøß‚__init__ÛÀ:  ±self.x = 7 _y = 8Uz = 9•f = Foo()@õassertIn("y", dir(f)) $#æobj_no__dict__BQclassV…object):9¨å__slots__ = []Š�__repr__‘�n__withžó# (an ugly trick to cause getattr(f, "__E ")!Ofailá#JW-"øÐdef __init__(� 3$Ï.bar = "wow"9!NoÆ<TXð?bara `using Xrõâ?diráðreturn ["kan", "ga7roo-% RTrue(¬S == [BOIÄ_—_tupleäÐ0("bÈc&a"aQres =H€‘ÿsInstance(res, list)ûRø9v]ó¿not_sequencúAœ· ñRaises(TypeErrorp=, f¹–traceback:try]rMa IndexM&jexcept-j‘Equal(lenAùsys.exc_info()[2])), 4‘¢test that åd has aPe£sorted([].E(^¸$[]e_b|_divmod ¹'æ12, 7), (1, 5)'0-1_-2, 221-c2-3e4@1, -˜–™‚€maxsize-61ÖT+1, 0.Çðfor num, denom, exp_result in [ (3.25, 1.0, ¥0, 0.25)),ŒF ((-C -4J?0.7DC-‡D-EÀ ð (-3.25, -1.0, (3·-0.25))]: ù result = divmod(num, denom)(òself.assertAlmostEqual(?•[0], exp_=1=E1]) {wóRaises(TypeError,³.àdef test_eval(8)꾸%–'1+1'), 2®)k 1+1\n,õ globals = {'a': 1, 'b': 2}¿4loc"Æ00, 'c': 300&uCa', d_) , 1¦1", {)8bi8?200rc:3:Â&/õbom = b'\xef\xbb\xbf'jD4O+ b'%f"\xe5"å2), ¢g+O, ()/ cSyntaxþ\¢, bom[:2] æ àvclass X%±__getitem__'W, key,(rpR Valupkò%", —À"foo", {}, XÔ=~£general«Ó# Tests that )ó mappings can be used for theê– argument=M"_Qñ interface versus possible calls fromÓA()."ÅÍK ifd@ == ) GK�return 12ˆ1Keyø „AkeysÈÃU§list('xyz' M&M(n4g =nWP0, m_>2Nam>'m;ÊdPdir(){-', ŵ;t?g514iÚˆó3~A~CNon-Î PEpass�A‡À, 'a', g, m)3 õ# Verify that dict subclasses work as well30 D(-%):Qû def __getitem__(self, key(, ifz == 'a'G™return 12eƒ.q 3˜Akeys‘Œi¶list('xyz')"ud = D()PÔ.ÿ rtEqual(eval('a', g, d), 12.ðRaises(NameError, :D, 'b;d Tdir()-', ¯qŸxglobals?g5;loc4d;'ñ stores (used byŸf compsiò2('[2ô() for i in (2,3)]Ü 0÷collections.UserDict()ª²ºSpreadSheetoð"Sample applicaIõ showing nested, calculated lookups."¦’¹_cells = {}{>__s,ýOmula�dRt[key] =-\oãQ _%,  , <sÔ; `s['a1'ž5'5'šs2Ka1*6372*79elfUE‡3'], 210�u°ðr() catches a non- îˆó�õ# SF bug #1004669%C¾ bÞ¶ráA Keyß(&_$N‡A1 # EPto beA but¢ð's no longer an eId»Fm;TypmD5, C-¡œtest_exec-gÝ#`'z = 1·äðif '__builtins__'àgXJl g[']ÈÄ·g, {'z': 1} ‚+„X&2}ì l#Éûwith check_warnings(9t.filterÂ("ignore", "�Å statement",aVömodule=""§ð exec('globaló a; a = 1; b = 2', g, l) õif '__builtins__' in g: 'jdel g[']"BlBlBñself.assertEqual((¤ñ , ({'a': 1}, {'b': 2})) zðdef test_exec_globals(J){ðcode = compile("print('Hello World!')", "I"S# no ‘ function{i³ñRaisesRegex(NameError, "name 'sõ' is not defined",IM� , Àû ¡X: {}}¨õ must be a mapping typeo ¸C(Typ³%�� C123}–:9”žd_class__AÛ›)€ A: pass�w“ ½u xuOfouns2!­Àfrozendict_eô`(Excep'ƒÓ¶ =(B 2Þ±__setitem__ØË, key, value/Wr‡ ”"…™readonly"±-ñsëâif isinstance(_*,Z€s.ModuleG –z\' =ž J0.__&__ÖFelseÈàNE d¾r['super9a']=2; «(eŒ(¡Éä ÙßI8 \«»ªp@spacòCŒ'({, 0x=1ÛãN›vßu½¡redirectedèFòsavestdout = sys. �ñ = None # Whatever that canVlush(:try^¢# Used to HaSystemË!('ÏÀ return with‘eíV set'[¬ß7('a.  ~!9kfinall  êVOðfilter(self): ð$ self.assertEqual(list(filter(lambda c: 'a' <= cñ'z', 'Hello World')), 8' _c ÀNone, [1, 'h=ò', [], [3], '', P9, 0]f )%?9])jÍ‚x: x > 0u@-3, ]5, 2`9 UŸ´Squares(10)¥4Xÿ16, 25, 36, 49, 64, 81² O%2, f«5[ Wõdef identity(item):Г…return 1ñ4m/5)_òRaises(TypeError, B-ûclass BadSeq(object…¥P__get¡0__(({, index*³"if*<4ËÓ%42Ôr¬R Valu¬!qüÐ%Ñ× =,Õ)Ì‹badfunc(½OpasssCCrN�, range(5nGò# test bltinmodule.c::ƒftuple(‰æâÀU(1, 2»2  Q>=3, Gb, 3, 4M Mpý#42Nöaô_åq_pickle4pÃfor proto in9)÷.HIGHEST_PROTOCOL + 19(Cf1 =ÇÑ_char, "abcde"X323�¤check_iterÉ"f1rR(f2),Ä!) ðú|getattrôQÂUTrue('òys, 'stdout') is sys.Æ>”K,:?, 16#g, "foo9sk ‚AttributÎ*, ¦@chr(é§maxunicode§## ó surrogates are not encodable to the defaulŸing (utf8›"ü1, "\uDAD1\uD51E"Ý?hasÝ' Ý“ cðhasattr, sys, 1)# ÿself.assertRaises(TypeError, hasattr).µEqual(False)�(sys, chr õ.maxunicode))) DÄ# Check thatb÷ propagates all exceptions outside ofB‚Attribut©.…class A:æ�def __getÌ0__(óz, what))-rµ SystemExitJ6 )%¦, A(), "b"4”Bk” BValuð”%”B”:|‘test_hashFNoneÁúõ$!1)bOh(1)+'.0-Go'spam'B &rb6K‡(0,1,2,3cë‘f(): passýäÑôVh, []]/&{}/ð# Bug 1536021: Allowèöh to return long object—)X)ຬÌUo2**100æ·Ptype(J¶(X())), int·~ Z(ƒ&+�|@Z(42} ª•,ex”V{Êïhex(16), '0x10> Bex(-+-,@ex, ÖÎ�,idœ:id(.Fid(1V).0½Y¾?id(ºCid([ЋBid({@ó : 1, 'eggs': 2, 'ham': 3}jñ&# Test input() later, alphabetized as if it were raw_. �Literõ‘;1ñ+@, 423ôlists = [("1", "2"), [ …], "12"]@‘for l in 8 »@i = �&(l_t–R`next(iR1O+ 2+ðStopIteration, f3, i£Vœsinstancei•CÕ Ì";D(C%ÀE: “ pass uc = C()Wd = DWe = Eöself.assertTrue(isinstance(c, C)J*d* Gnot Xe.Oc, D† \�'foo', E2÷Raises(TypeError,—Q, E, ?ó; !) oðdef test_issubclass(5!):¡& C À7G D(C6%EG .ÃD¯ íC* «XCÙl7¤ãVeÄ; âv â×1'(xÐWöreturn pow(x, 0.5‡ónð, x)), [[16, 4], [81ð] �[4.0, 2.0%9 O3.0]’ñ, y: x+y, [1,3,2`N,1,4„!10�6vaA{plus(*vB…accu = 0+SÃfor i in v: !9+ i({âŽÖ_ 3, 7Ï,XÖ b0, [®?, 2mÈ+4, 3+9, 7+2A Õ#sëO1, 0~!+1€_7+2+0„(þint, Squares(10·30, º , ÚP25, 3âŸ9, 64, 81~B‹Max(a, bCÊif a is None¸;$bÉOif b3a3Hm„œ6Max&3) 2#k•?map¤*', hF, 42;Êclass BadSeqO„Œ__iter__ÞVr-R Valu-'Qyield¬×@ , +, ,¡6())º }badfuncª˜kRuntimš'�]–5}Æzø|_pickle!ÔPprotoØÖ)û.HIGHEST_PROTOCOL + 1ãAm1 =ðmap_char, "Is thiÖe real life?"n,m29À "Is this th÷e real life?") ñself.check_iter_pickle(m1, list(m2), proto) 9Ðdef test_max(>!):TÐ.assertEqual($æ'123123'), '3'~-€1, 2, 3)W (+#, )5[,5]5k 5 .0-/.0à .0ÁZ )ñ-ÿRaises(TypeError, maxƒ*O, 42. GValuYF, ()/Æclass BadSeqæê±__getitem__ w, index*rÄ kè%é,~–6Õfor stmt in (i"q key=int)", ž# no args6þdefault=None)",! '^ð# require container ¥-Lm&, ±*1n€# singleÑP not ÁOableF2IYstonep# wrong…Oword<7P, abc ^¤# two many?Y8ä15¿@ #7qfunc isÂMcall Q:tryŒQPexec(�, globals2uexcept HD:pas¿Nelse'¸Afailpf þA(1,)z�=neg), 1)+¾ # one elem¶HŠGI‚HŽG Hs禉8), ¿1), 31o# zero×P$, ž2ráqìé†39 dÖ3`ðdata = [random.¡range(200)AiãU100)]yÐkeys = dict((ÿ , ?FÀe(50)) for eãlem in data) õf = keys.__getitem__ðself.assertEqual(max(@,4E=f),+Oñsorted(reversed7)8a[-1]) =Ðdef test_min(q!):J €öin('123123'), '1'Ê-¿1, 2, 3), 1* (+#, )5[,5]5 5".0-êÁ/.0Ã1)ï#.0a [ÿRaises(TypeError, min*O, 42. GValuYF, ()/Æclass BadSeqæ¡‚ w, index*rÄ ko¾%é,~–6€for stmt(i"• key=int)", ž# no args6êdefault=None)")W '^ð# require container ¥-m d±*1n€# singleÑß not iterableF2IYstonep# wrong!Oword<7P, abc ^¤# two many?Y8•15¿@ #7qfunc isÂMcall Q:tryŒQPexec(�, globals2uexcept HD:pas¿Nelse'÷Afailpµ~cin((1,F1neg@‘q# one eã ¶a ÆH2I 2)I‚HŽ�G Hsç]‰3), Ø,!, 31o# zero×P1Û $% žNá'ìé†3šÖ =21šð = [random.randrange(200) fóor i in range(100)] ðkeys = dict((elem,'‚dom.rand2�50)) for IUdata)C@f = GÅ.__getitem__ðself.assertEqual(min(@,4E=f),+’isorted.Q[0]) 2àdef test_next(g!):@¢it = iter(Â&2)¯+ ’Aoit), 0&1&ðRaises(StopIteration, \O, it35DV�(it, 42)ú`class ‚w(object 7 __,__6 preturn )R<}< �—¡•ÞŠ—Àt 4ºKgen( uyield 1'åý ´<'‚ �?), 6 Y˜Ïü-ocû �$ôŸ, '0o144'Œp,---.y÷TypeError, oct, ()�`write_§Lfilelñ# NB the first 4 lines are also used toãÕ input, below†ýfp = open(TESTFN, 'wÜòddCleanup(unlink, -vwith fp<1fp.¿w('1+1\nW ñThe quick brown fox jumps overà�lazy dogD.`ŸDear John$PXXX'*´ ¤3YYY !<;.ú¹+rr×JRpfp.readï_(4), b6 5y`^ ”xÚQ5 ?, '«:@(300ÌÁ6"107 ؤð# embedded null bytes aónd characters ÿself.assertRaises(ValueError, open, 'a\x00b')6b78ð@unittest.skipIf(sys.flags.utf8_mode, "utf-8  is enabled"{@def Bð_open_default_encoding(Ì!):mÞóold_environ = dict(os.Q'6try4ô# try to get a user preferred nð different than the cur‚Nflocale9€to check8tc ()fsD 6 K}`and no{e;¡ ;ñ for key in ('LC_ALL', 'LANG‡C_CTYPE'?½$if:> 1&Fdel $i[key] †¡p.write_ÇVfile(‰CB_þÛ# =E.getŒj(FalseIBfp =\§TESTFN, 'wÁl~with fp̧”Equal(fp.l,å £kfinallUk.clearøwupdate(¾)F þ°non_inherit# ý\4obj __&__¦þjileobjÿY69getnN@obj.]no())¤,rd“XWÆord(' '), 32™'A'/65' a'/97' @\x80*?128+ ff+3255ä<¥bÍ/b'Î/b'Ï/b'Ð,Ñ1chr¦àmaxunicode)), ¸âK5TypJord, 42C r€0x10FFFFl fFa"\U0006d"), 0xÞ 81.881818ÝE88F8F8 À"\U00100000"�), 0x00103) ó self.assertEqual(ord("\U*(1"818FFFFE88F81F) ©Ðdef test_pow(²!):Ä Á$o0,0), ¯ &1Þ�&1L 1,L1±™2M12,1À?024� 42,2*/*1/3/4M -µ!-2/-2³ -2,2), Ú Ÿ-2,3), -8SSAlmos³¦"0.Z.~.¯0.1\!1./1.¹2]&2.½&2.#.ð8,8>/ b-Ø/’/-2ž0F/N–öfor x in 2, 2.0T¿yl10, 10#z#0%0'+õ if isinstance(x, float) or \O)1y1z1 Õ^ 9öRaises(TypeError, pow, x, y, zR?Oelse] Vo, 24.0%p-1, 0.5Ôj� e1 1/óÿ 0.5 + 0.8660254037844386jz IValu Q_-2, 36 1,\å5 v–ò_inputô`write_Vfile(˜ðfp = open(TESTFN, 'r')# ñsavestdin = sys. 6out õ# Eats the echo0Etry: bS_ = fpOÚ= BitBucket()%ÿelf.assertEqual(input(), "1+1"-ñ'The quick brown fox jumps overɯlazy dog.'Vù 'testing\n'), 'Dear John') Âú# SF 1535165: don't segfault on closed x;#�"ùmust be a regular file for triggeringxz=#= æ?out$1in.†|ñRaises(ValueError, ‰ ì tÓf€ = io.St»¯IO("NULL\0Ô…9Typ„@, 42 ¶f[Ï'whitespace'p q: r ˜ÑÐ?EOFS7del ¾ KkRuntim{'promptÖX/inW3ofinall† p8© %fp¢¬ # ~µ_int(): see2.pyñ ests of built-in function 6.¦2def;¦repr(self)Á }%'ðG\'\'S+00' ()(/()) [])/[]) {})'{})aa = []>ɦa.append(a ÅaKh[[...]yP&{}Pu[0] = aM�{0: {...} 1‡Ooundˆ& 0.`DÖ uetype(r/)¸tò +1ZZU1!, ,0_ 0C< e2í1ºï•-º!, YÀlf.assertEquòal(round(-10.0), # èself.assertEqu.06F>"e2l / o0.1), Y1*O1.0)T 1Uõ,܉1’= -”-•|bÃ-‰6š™ o0.9), —9*ï 93‘-’*”)•5—08.0DtypeO6Ÿ), float)ç 8&0)7r 616þñ# Check even / odd ñÕing behaviour.×5.5), 6V6(-Q-R-S*¥Ó¿•r on ints!ÆsW_8), 8ê-'-( ŸÏ?intV.!-8o ),Õ3e0—:ÿ# test new kwargT�number=-ï“ndigits=-�‡òRaises(TypeError,“#ˆrgeneric²ödelegation for real£°class TestRÓ:ÖCadef __û0__(")!%–return 23­U/NoWFpass-W.“w()), 23é2Ÿ, 1, 2, 3 5t²'()qðt = TestNoRoundC() ð t.__round__ = lambda *args: )ñself.assertRaises(TypeError, B6, tX/Q, 0) bó+# Some versions of glibc for alpha have a bug that affects?òfloat -> integer“€ing (flo¤£ceil, rint°)]?ð values in the range [2**52, ’3). See:0ò+ http://sources.redhat.com/bugzilla/show_bug.cgi?id=5350@ò We skip this test on Linux/úñif it would fail.9l"_"ñ= (platform.system().startswith('Oa') and=þ={machine>e"')Þ`5Ž=lÂ(5e15+1) != jP@unitÖ.å8If(¸Land P,7š"DQ will!; ÿ ure is probably due to a "FSbuggyt¸¢ function"à1def†â`large(Ï)ý’â# Issue #1869:tAral †As sh¬°remain unchQzNLaEqual(@AA-1),?"-1�o0.,+\+\#+2^/+2`303×Lžbug_27936JbVerifyÔñndigits=None means�Àsame as passÓPin noŸUumentê,xÄ_[1234H?.56’decimal.D#(',/').1fra43s.F (0–56, 100)]+À0x, é)�#(xb3 ÷Ctype,<8), ,))z|setattrxÏys, 'spam',  @sys.'&c,n4, 1gK>Ï#“¢str(): see unicode.pyÚPbytes1"s.j“>sumä˜$1[])¨’ –%Qlist(7¿(2,8))), 27êY]iter(9:¡Squares(10i/85jÀ(Squares(10)£)), 285) ðself.assertEqual(sum([[1], [2 3]ÿ]), [1, 2, 3]) ?ÿRaises(TypeError, sumi*O, 42.€['a', 'b?c'];(O, ''?b{ˆb'c'], b=ðvalues = [bytearray(.8), Ob')]C", V C/')³ Ñ;_{2:3}`3A*2, 0Õclass BadSeq:Œðdef __getitem__(™Š, index)*.rm VomK7Ðg%’,~'()—Pempty·—ð um(([x] for x in range(10D1GF 4, [,Þ‘test_typeÜÕ´>%b''), ?123ñ#No¸)4 $()àð# We don't want nÏòvars(), so these are static methodsè@iÎ@get_CG_f0(Ìpreturn (a@ 2@ÉBuiltinTest.cyûUa = 1Ub = 2~rCZ°w(object³ÎLDictšpTu{'a':2}kð __dict__ = property(fget=getKý]ù|z­ùAset()d 1dirʉ28sys5¡I aO, {}12;! 1‡?: 2?‡âïr3/<VÀ.í¦�¼‘1zip/�[(æjc†(4, 5, 6t/-�4), (2, 53$E ^Plist(z@a, b�tRh[hC(«2, 7\À self.assóertEqual(list(zip(a, b)), t) …class I:ú def __getitem__(self, i)&*ùif i < 0 or i > 2: raise IndexErrorZ4Åreturn i + 4cO.assµ;I()·/)&[]á*?*[]-RÇas(TypeǶ, zip, None]>GOpassØRfa, G()T±2iRuntim‡ða, TestFailingIterCv°# Make sure·÷$ doesn't try to allocate a billion elements for theKpresult Fò when one of its argu8c÷say how long it is.L�A MemoryS0 isk@ mos_�kely fail¶Fmode9húSequenceWithoutALength}»J== 5A¢ÇOelse;áøÓ’jYŸàð(), range(2**30 ?¢enumerate(+'5)R%) 1IjBadSeq½9avariouLomatter ¢³3, ''), '3'Äò1# RLqs some ¾ esÃ!us¥ kä¦s. There'pú# an old-style version, and a newÜ9p[_new(§› A(object»@e__initAx'+ØUx = x~F$Hw RÀ retur÷n str(self.x) + format_spec ùclass DerivedFromA(A):#.Ypass 9ñSimple(object): (1'`2jÁdef __init__À?, x'`ÞI = xšFõHR_retur;&Ô-2(îk)A,} P2‹édo_test(O# XÂassertEqual(9€(A(3), '@' 3 }<0A(4>=B, '4 G (5L1abc’5 J#C2(10Lidef'),GU a'10abc*ŽŠ* –es_new())$²bempty_W”k(valueˆ # ÔZ that’## С(x, '') ==ï)x)´'#¯�a, ""),Z)_< 8˜#ºð builtin types,0matÍ/""ª/f17**13�"/.0 ¯3.1415e104& -'&-N( N4ÝGNoneSñ# TypeError because ž_d"_ p±s the wrong}d®Q BadF)[Resulv¹QœÄ ¾.uE 1.0i˜]uRaises(¼ ,ˆ!()‹DñŠð is not unicode orŃ…z"½: «Ôsó .T° really bel¡åelsewhere, but¿ # Å0re'åð good place to put them  ó x = object().__format__('') #ò self.assertTrue(x.startswith('�áT)edª?z y�s.append( �0Che0#heLw1gotê°correspondsîaeuser's° °sç!enezs) != 2ìð # Something went wrong, tryasavEderrUÚñ# Beware of Linux&G@EIO "tslave i9 C5û_output = bytearray®öÀ  Ptry: ý chunk = os.read(fd, 3000).ýexcept OSError: # Assume EIO.h]breakqif not y”8ñchild_output.extend(E «ºos.close(fd@8 = ú .decode("ascii", "ignore"Bò self.fail("got %d lines in pipe but expected 2,c ²­ was:\n%s"+‘ % (len(R)<î)‡ ÞJó# Wait until thezõprocess completes1õos.waitpid(pid, 0) breturnÛðdef check_input_tty( ò, prompt, terminal!ö, stdio_encoding=None)ì@sys.)Pn.isaTA) or5out>/~±.skipTest("F@ andy÷out must be ttysÅÉPild(w±“U0# CåAeäð handlers are accounÛ5for.9 ifxñ ­#Òõin = io.TextIOWrapper(©.detach(),`A i xFôös='surrogateescape'~…±jϾÐ$ Ñ3 Æœs='replacÊóprint("tty =", Õi�R¦Î§r, file=D ªSF(,("/))4î1 = ÐArun_–( V— + b"\r\nѳñwe did exerciseÃ@GNU ÓdU pathªnsassertIrq[0], {' ƒ True', vFalse'}"ifd[0] !='5 ùh¦�andard IO3ðshould have been a¯ÝAâ_result = evalP[1]) €iB) ->µ) roundtripí� °=Å S Jelse^^4in.ó)ÙPwhat O?ÈMµREqual`,xÉÀ def test_inóput_tty(self): ÷0# Test input() functionality when wired to a tty (the code pathHõ%is different and invokes GNU readline if available).?–q.check_‹«ñ"prompt", b"quux") 1†def test+®_non_asciiàCVò stdin/stdout encoding is usedé°±q,¢ %é¤ß\xe9", "utf-8±@_uniO_errorsÀ+� handlerÅHRÅ2no_N~_fileno¹òIssue #24402: If„¯CÑoriginal term 0but#Cout.S)~ð# fails, do not¶ FŒ 9µ descriptor@3·child(wpipeÜqprint("$@.isa(š):", sys.,c=F_E,`ñ= io.StringIO() # DoesºqsupportG6no(ãDü(ø ¥€capturedŸ (yÏ.getvalue())©„As = ÎBrun_g6\r"zÉexpected = (ï .z True",$­" 'Ì'"eŽñassertSequenceEqual(¯$, …�) class´°Sorted(unit .È0CasÜ…ól_basicŸödata = list(range(100)“pcopy = '1[:]Q¡ðrandom.shuffle(&4Ç¿>2, s©,-8Not0)êsE‡.reverse/Š,÷, key=lambda x: -xýÉœ—„.×/=1}ŒÝ¯d_argument=„ô9327: The first 3ŽQpositôW-only•¹&[]¶Bwith=¯ÀRaises(TypeE• Yû@iterñ=Ku# Other‹Ps are–AwordŠêhG"[]¶ONone“ÀError):  ðsorted([], None) ñ def test_inputtypes(self):#Às = 'abracad'/õ = [list, tuple, str]#‘for T in ,UYóelf.assertEqual(£Cs), ST(s))«3Œ '.join(setõ # unique letters only‚y¥ñstr, set, frozen ºßdict.fromkeysÄBoÌbaddecoratorq@dataèðThe quick Brown fox Jumped over õlazy Dog'.split()øÆ^ðRaises(TypeErro  , kð, lambda x,y: 0) class ShutdownTest(unit/.kCase):H|cleanupÔó"# Issue #19255: builtins are still available at svÏêcode = """if 1IeimportT422sys©ÝCI£|__del__Åæprint("before"w ¶# Check thažîYexistª2olen(()Rvgafter"8Wc = Cõ# Make this module survive until4r and sy�Ä)edž±@.her‰Qsys.mR¦s[__name__3|"-ò # Create a reference loop so@Ĺneeds to go¥ù# through a GC phase."‘5"""9½ñ 20599: Force ASCII encodingŽPet a ªÐc implementedÿ'C,N€otherwis™e0Pmay b–rloaded Y4 C.ŒÀ) is called,®P3so 6é") fails becaugacannotj0sedµÁeNÔÄqstdout.(@ing.ÿ@ exaáÈ, on Windowsâ8¿qthe OEMóP pageÉR thes„� JePython òrc, out, err = O!_p%‘_ok("-c",q ž ÷PYTHONIOENCODING="asciiæ]»[62, "ž]˜.æBde() PlinesÝ^H˜Z¤�rP_new_Ì •1A =]ð ('A', (), {}) seólf.assertEqual(A.__name__, 'A') /se*3.QmodulZd_ PbasesŠŸ(object,)1!Is·.-,*fx = A(ÊßIs(type(x), A"�x.__clasŠ5A) 5 B:+€def ham(f)ðreturn 'ham%d' % (AAC = ‘ñ'C', (B, int), {'spam': lambda5!: $%sF}Á×C×C× * ×.×_©Má¹4Is(-Ö (5·1In(0', /odict__Q0Not-?ham,)OC(42>H?x, KCB9Is(K&h.D!),)/42± x.(, - óto_bytes(2, 'little'), b'\x2a\x00'âÉPtest_‘œ_nokwargsØAwith��ûRaises(TypeErrorL0('aÝ×f}, x=5.N*û?={}¿%) :öA = type('C', (), {}XWwith UõRaises(ValueError):J‹$A.cµ = 'A\x00B'"IÔ/ Ðx-_udcdcz9?Typñ?b'Aí�def test_…á(+\¦A¦'‡': 'B.C'»B A mA=* k[0eÎT /('é?b'Bè¾nŽ ¨?D.E¸8Y8 ¨ùÆ…×2, '}1 e!ðE2ÄÌM4_dict=Ð []›—Àaises(TypeErwror): àtype('A', (), ðs.MappingProxyT E{}))6ðwith self.assertRaises()/Era ¯None,), {}N1OboolN7ƒint, strŸîðdef test_bad_slots(øB 'h"'_VŸ__': b'x'2Ê ^]5Yµ3X/42ZEox\x00y^_ValueÔ ¹¯x', 'x': 0Ï2 a ('__dict__i )nGtweakrefqt*Qzclass B_Epass".'Bé 0ù2bëP}) Pload_ s( 1er,$£s, pattern€from doc+ñ import DocTestSuitePs.add(“(builtinszbreturnkò if __name__ == "__main__"~@unit[.ñ() """This is aC± module forð_pydoc""" __authorZò "Benjamin Peterson" __credits"`Nobodyrversionp1.2.3.42xyzÒX, Y and Z" /A±�"""HellopgoodbyeŽXu“__init__(]ô """Wow, I have no function!;'‚nƒB(objectF°NO_MEANING:û‘ = "eggs"›8C8’lsay_no¦2"noE*¬get_answer.R""" RØO() »Nt.!œW¯is_it_trueW ðelf.get_answer(s) """ ñreturn self.get_answer() def doc_func():2:PThis òtion solves all of the world's problems>ahungerI@lack-aPython"wad},noðpass """Basic testDqò frozen module (source is in d/#A.c).b\# The 9ó code contains a marshalled2j` # andóðrefore depends on8ð format as wellµ@bytej# #!@. IA3oseñs have been changen$n Îò needs to be # updated. # á%ñ_importlib also90s tÄm1àbut because th8sß�re much mßpcomplicc�, it migh:À unclear whyùô y are failing. # InvalidI@dataŸÊ�could ca„ñe interpreter to # crash when __hello__ãÞõ éD sys @unitÌQ fromú@.sup -òcaptured_stdout)2 ñ util class TestFr(`.CCase*>x_ß(az…name = 'É'1if  inÈ.¢B 8del[1]B[with × ()v2out‹EÞ‡D°ð.assertEqual(out!°value(), 'H‚êÐ!\n') if __ŒA__ =Þrmain__'u,ñ() # Mailcap filò¡"_mp; basedLðRFC 1524 # ReferrIo by1C.py ùú¹pcomment2 ap¼ñion/frame; show ù %s; print="cat %s | lp"5ð postscript; ps-to-terminal?\<�> ?aÉose=idraw %sB¾x-dvi; xdviqmovie; `player• Q3maknR deÒ`ion="MD#";Œð x11-bitmap="/usr/lib/Z /!s/YJ.xbm,‘*; echo "+ is \"%t\" j}àis 50 \% GreekÅrme" \; ƒð ; copiousoutput audio/bþ¼ èõ\edit=)\ ø1An "P frag0"kB* ; ø�ocal/bin/3-ð%t image/rgb; disxš#9gifÙx-xwindowdump ³xAinua\@char§°uldn't \ # ư a differenè0n aê»p. mess—ðexternal-body; showextñernal %s %{access-type} %{namðsite} \ %{directory#2mod#ðerver}; needsterminal; composeRsd = extC %s;Sðdescription="A reference to data stored in anC²@loca4À" text/rich ô; shownonascii iso-8859-8 -e %1 -p‚Ptest=s "`echo“÷%{charset} | tr '[A-Z]' '[a-z]'`" =Zèópiousoutput video/*; animate %s`mpeg; À_play %s# # ‚ð_codecmaps_jp.py # C� mapping'ñs for Japanese encodings # from%ñ import multibyte\@_sup @unitzÿ class TestCP932Map(;.$bBase_M”,Y.aCase):'­¡ = 'cp932' mapfileurlðhttp://www.python£€.net/uniÈ/¤B.TXT?0sup6A = [O‰ö(b'\x80', '\u0080')ªa>f8f"fd:Mf8f1:%fe2f3]—·iÅórange(0xa1, 0xe0·Ë�.append((»ø s([i]), chr(i+0xfec0))) ¶¿EUCJPCOMPAT¼-‡/ Âbeuc_jp„Ã2ÄfEUC-JP£â@èOSJISç8æŸshift_jisé�SHIFTJISë'B€pass_encøÕ!1_b\^5/de5\24xa54åA(b'~[u203e>\x8h'qISX0213q\0isxvŽ7—’'F ƒø6�øD/_JúÀpythontest.nð:et/unicode/SHIFT_JISX0213.TXT' if __name__ == "__main__": unittest.÷() """This is a test""" import __future__ from "ònested_scopes def f(x)k3g(y}Áreturn x + yŽôg result = f(2)(4)„Tqueue Tsched •threading%im*uç¹Ø³0supÝö TIMEOUT = 10 class TimerÀ×__init__(selfÊ•._cond = ŠÁ.Condition()àõ+‹time = 0Astop2) nRwith HsŸ\D> Lð# increase the À but not beyºñestablished limit=‰QsleepŠ7, tû¨assert t >Ï£ Ct +=Àˆc»Swhile:< tá&Þ J- J(%W.wait‡ƒ¶(cadvanc#  for user ie)3ÒÅw¤ÆÆnotify_all()¥„estCase(ç#.T"):Ö¯öa_enter²Ãal = []Øo÷ fun = lambda x: l.append(xÆ{@uler€ .�(Q.,g.:;Màx in [0.5, 0.432*1]ðzc].Áöx, 1, fun, (x,)]†=.ruv«€Equal(l,€1qv€Š?5])5?abs8w090°0»0Æ0=É@50A|ˆ”E#|currentMAq = Þ .Qä«�Fq.pu_| ,5 ˜r™rš=f1f1f�3)3)ÂT£†(target=n6runÂht.star«ì.nà1) selóf.assertEqual(q.get(timeout=TIMEOUT), 1) 4sel4æTrue(q.empty()#õfor x in [4, 5, 2]:?Fð z = scheduler.enter(x - 1,‡fun, (x,Q‘¶r.advance(2j�Á 4!3hõ ¤1¤ 4p\5p)7000?ðupport.join_thread(t, H·O#6M r.q(), 5) Nðdef test_priority(9)pal = [],{÷ fun = lambda x: l.append(xΛ§.­…Þf.sleep;úŠ�1, 2, 3, ¤abs(0.01, F", —V.run(† ×Jl, [Š ?cZl=kQnow =5bÑdevent1�6/6"+ 51.*A2A 2H0.02‚A3A 3A3A4A 4A4A5A 5A5A.íÔ©ø.!&!pB˜ 3,/4]s¼_concurrent~°q = queue.QÆUq.putÚ—r = Timer,÷; ÎTÏrÐ]“'X>U”Ï1Š;Ž ‹ˆG DAÀcheduler.entóerabs(now + 5, 1, fun, (5,)) øevent3 = scheduler.ent;3;3;ñt = threading.T †(target=N6runn‡t.start(æimer.advance(1ÿself.assertEqual(q.get(timeout=TIMEOUT), 4×True(q.empty(ð™cr!l(2x!5!‚² ~<î 3‰"pG4p)7000?Âupport.join_8@(t, Ñšß#6M r.q(), 4) N’def test_6!):el = []÷ fun = lambda x: l.append(xË$8.W¡‚Ûg.sleep;×µ9«ñfor x in [0.05, 0.0432&1]ÊÎz“ ËxÅxÅ goFalse(‘7runÄDÔ_ˆ`queue(7ˆf=}­Î/e5C2+…LÖ/e14 1€424 2444 44Þ 50.0áœ!# £à property is sÀñsed to return an order list of憱# upcoming `sõp³Usü, [e1, e2, e3, e4, e5]Épargs_kw G:seqÑv·fun(*a, **brª4seqác(a, b)kò$µ�< h·c(ô, argument=(1, 2âÀ scheduleró.enterabs(now, 1, fun, argument=('a', 'b')) Ÿscheduler=ÿ 1, 2), kwargs={"foo": 3}LGrun(õ elf.assertCountEqual(seq, [‰�›((), {}),{Ò8 Z'foo'¬1]) eñdef test_run_non_blocking(self):%œel = []÷ fun = lambda x: l.append(xø\1 = h.n`(time. , f.sleep;ö for x in [10, 9, 8, 7, 6]‘•P¾&(xö?(x,ç›äf=Falsevó©¤@l, [*ò if __name__ == "__main__"�@unitF.@() -ðBEGIN DH PARAMETERSñ®- MIGHAoGBAIbzw1s9CT8SV5yv6L7esdAdZYZjPi3qWFs61CYTFFQnf2s/d09NYaJt rrvJhIzWavqnue71qXCf83/J3nz3FEwUU/L0mGyheVbsSHiI64wUo3u50wK5Igo0 RNs/LD0irs7m0icZ//hijafTU+JOBiuA8zMI+oZfU7BGuc9XrUprAgEC Á?END×ð# Generated with: openssl dhparam -out dh1024.pem Ñ """This is a‹ð""" from __futuru import * ²3f(x›3g(yÁreturn x + y¯óg print(f(2)(4)) T½É_ó_multiprocessing— =0sup™ " B.PGOdraise `².SkipTest("Bàs not helpful ópPGO") .‚�.installps_in_mo¿Ð_dict(globalsF�'spawn')™»'»'¤ž»Øôcollections.abc$io $os Eerrntpathlibdpickleesocket%ta ftempfi*–uOmockŒ<D’8òTESTFN, FakePath try÷ñgrp, pwd except IwRError(Pgrp ="ñ = None class _BaseFlavourå†object):hÀ_check_parse!tse¢§, expectedËf9=fX.;Ûð se’»'5sep?alt"%@ctuaâñf([x.replace('/', sep)œ�Oarg]0aHÌb2if tG¹1> = y/|>ðself.assertEquaðl(actual, expected) def test_parseñts_common(self):'+€check = !._06(4sep&µflavour.sepõ# Unanchored partsT@([],o P('', L[]))2>'a'525/65‡b9 5X, 'b'¤¾# Expansion¸/K? N $M'a/b¿: /cdÉ:4, '";ð# Collapsing and strippÝexcess slasheÔ 'ao)b/wvôD c/»D # Eliminat­Þstandalone do‚#'.…jÞœ.”Ò2 55 M:«oa‚‘The firstrD is ƒ “./a”Zasep, [Î eš/¶Æ@ßFz€p# IgnorÞV¥ before anìý ñ° /bÀc÷ ± ñ@/A @c,â class PosixF§Test(_Base`, unit™. CCaseŠSÐ = pathlib._pN_×Ð% ô3of é@leadmñZ°cept for thXQuble-tõ# special case.L/> '/[ƒ G–'Eð»a///EDñ # Paths which look like NTµôs aren't treated-ly/c:Ú $#—Ðc:\\a'],  P('', Ä['c:\\a'])) �check([',=#1)) <ñ def test_splitroot(self):@@f = •.flavour.*#õassertEqual(f(''), u'''«.a/a0+/b2d=/b/5/j /›/�œ /aŒþ4ž 6Ÿ7  `# The ¥õ is collapsed when there are redundant slashes©Œ# except2ôexactly two leading<w, whichCõ is a special case in POSIX.&€/Ká~ 5€/Lêj ‚r# PathsÜñ look like NT päaren't treatedï/lyâ *c:z¯þ .\\:: ;a\\ "\\Ò) class NTF¾§Test(_Base`, unit. CCaseô! =Ólib._windows_ G¼parse_partsI£M_)/Z€# First Eè…anchored!;(/']ëP ('c:{2', %}</=<#\\>/\\h> ó><?c:a| zÃåTB½?, 'E/…  AQ# UNCYW{–C('\\–5, ''LhL'c5L I, 'c�# Secondž�, so that‰) fÂ?ignÁaã0Z:bœÀ ('Z:', '', �['Z:', 'bsc'])) �check(['a4Z:/#, (;P\\', H J¿# UNC paths^P//b/cg3d']_‘('\\\\b\\[[)'d¯ð# Collapsing and strippßexcess slasheƒ Z:…1/c/‡/ˆá -, �æ/a`? æ �ExtendedPa//?/c:À¨jA?\\cðBQ)\\MüNa¯K¸:0NO, 'aS V, '/bY¡§¢%# {ý (format is "\\?\UNC\server\share")„æ1UNC…€ë“DŒ!?\_B\/ÞúAIw` oPSeconý rt has a root but not driveìÎ Ì� € ñ?Z:/I3 ¼bN| °!Z:léàdef test_splitq(self):Ó@f = •.flavour.*#ðassertEqual(f(''), ('.a//a'0 ;\\b3ªf'\\hj1\\aZÎ7n &c::C : v<x´# Redundant­r in theÚRare cå/ed° <!8/�©æ’ åþ c:v0\\ae™ >z# ValidP"zf°À, '\\', ''))# öself.assertEqual(f('\\\\a\\b\\'), `', '\\?'))BOc\\dFJð# These are non-UNC paths (according to ntÒ.py and test_KóHowever, command.com says suchXjõinvalid, so it'sÙ°# difficultvðknow what the right semantics´9TVFLjP 96ñ # # Tests forœppure clÖQs # à _BasePurePath1¡(object): ºQ# keyÉ¢ canonical'r, valueàlist of tuples ‚argument: # supposed5�produce e\Nmñequivalences = {“…'a/b': [0('a0b(a/  / @Q/b/',ÎGa//b / /p# empty:0ponÚÉ get removed+ ('€ ž® i, ''),<]'/b/c/dùGJoq///b//cñ/%b" |ãpÃ0, '¨I€¼®/«î}m def setUp(-%):+@p = @.cls÷ÓÓflavour = p._ <"%seC J.sep$?alt' YÀconstructor_J,on²P²g„PÀ”örtIsInstance(p, Pä3@, 'bH)c'Òar - 1Fakû!("0"à !P(ŠC)), ÚeÇ1,·1 /bœ»30P('+g65"c'¥Þ)Êá_check_str_subÆw, *argsð# Issue #21127: it should be possibleÙ4 a U Q+Ô# from a str y# iû,¾ it³na‘s convert;F!a ÒFb.ÌU StrSØ'trÐ1pas›À P = selsf.cls õp = P(*(StrSubclass(x) for x in args))/ðself.assertEqual(p,? &>@partA p. %s:CyG€Is(type(&�), str) ,ãdef test_str_sœ€_common(A)Ty._check/;(''¼%.&a&o/b.txt,%/a- óOjoinëAP = ïÆG'a/bxpÜ p.Lwpath('cC ÉÊC?/c'ò«Bp), µ)oO, 'dt(/dv MP¾ Ì¿ I'Þm ˆÏ% ‡?div“õ # Basically the same as z¸¾o / 'c'°2a/b³Õß¶g//di«B'F( 'cBpFc?Œ08/ / '>s'­[Ÿ², expected,F¯™¢Qcls(*=F º“@str(qNÒ.replace('/', Lsep)¯6-p# Canon±Pized µs roundtripŠÆPthstrÉ`('a', ! /c …'Š ‰ëÓqTtr, ( Gá# Special case‰TQempty« BW™'.', ('',NQOtherIsMOP) areÔ`Üequivalences(G�as_posixûÐ9;æP2$).™1(),9n*# ÷Àr as_posix()ò are in test_equivalences() defñas_bytes_common(self):$(ñsep = os.fsencode!U.sep)$@P = 7E.clsÁassertEqual(fð(P('a/b')), b'a' + bo+ b'b'›?uri™uBwith‹z÷Raises(ValueErrorÚÞŽ¦').as_uri(ÒHE`Oreprðfor pathstr¬a('a',  /c/5«, '/a/b/c'Ç£pCcls(RÍéð clsname = p.__class__.__!__²'@r = µ(âR# The@) is² the form CQñName("forward-slashesá"�«¡ÐTrue(r.startsv(ªŸ+ '('), r< 2end:/')0AinneÒD[len]¹) + 1 : -1]û™´Qeval(C@), p(zposix()• –roundtrip ?Aq = O!r,Êlib.__dict__N†FIs(q°ƒ½4º;q, ÀW#åqc´/eq²u YVä$, ­- ì�70#NoJV`'�.@1\R‹/Z))"7Ù_), {}\,l), int\_matchæ$ VÕAa').VO, ''•8.9p# Simpls`lative7OternHtP('b.pyˆŒ1/a/3ògQFalseõ2/b/ËdÀ'/a.py').matÓch('b.py')) òself.assertFalse(P$�/c').mat4ÿ # Wilcard relative patternW5TruVT*ˆ1"a/­‡3/4 ïîg3/Gš3(pyU gÏ# Multi-partXAab/cMŽãŸ# Absolut� [1  Ž3 �5 Å 6 ,a÷ ‘a],û+/aý7/¼º/:-ð def test_ordering_common(‡!):$«3# O!õ is tuple-alike"JÉ—Less(a, b@DSì#@ "ÆGreater(b, a/AP = G5cls:–a = P('a'(b'/bc'bcd( Æi¨¼co 2d?b, 27c, 2â /ã®Ïä//aå  ´b´a´a´KæBwithÉ<ûRaises(TypeError:‘P() < {} ‹j´¬s±`²` returns a·CmpN5sep�*c B`Q = p. B¡ØÐEqual(parts, Ó('a', 'b')) õ # The object gets reused!ñself.assertIs(parts, p. Gñ When the path is absolute,aanchor€ separat+%rtiÆp = P('/a/b'Yh$ =r.—TEqualšg(sep, é2°def test_fsŸ€_common(E!):"@P = E.cls— –&ä_check_str(p._[p_(), ('0,h 22os.Œ)(p0x¯Ìequivalences®òfor k, tuples in»2w.items(âæòcanon = k.replace('/',>6sep{-Yposix-Ée/¨-2if ]1!= 9[®=·1+ [ò(Ô¦ ÿútµI#t $i]{¡s.append((É', Ë_pé0( ˆ €\P_cls(*Æ}æ", {û, "failed with args {}".format(t°´ MAhash  Ã8ò"),í0Qp.as_H !) xéoparent˜¡# Relative5”« '/c› ø¾@ent,p©--ò4B2 9h6ª=1# AO§K>ýmÃÌ ˆ?'/aÿ$/'/9 @ 9s:C4par{6ent '0len­O), 3M Qar[0]DvCar[1+5 Bar[2).)ÀertEqual(lisðt(par), [P('a/b'), s.')]) õwith self.assertRaises(IndexError):,3upar[-1]@!3?OType~e0] = p�¥# Anchored0p =ñv/a/b/c'ì0par;….parents0ÿ“Equal(lenC3> & !0]\k/'), 1,*2*) 8lis郎ë/ë.13] 'ðdef test_drive_common( 2P =K/cl]‹•.K7, '¢Q‰Š2P('Ù.(')* ¼Oroot»J”&ser.¥0').^Î�,/V?sep]%„. ûa$ýG`ÿ.,Õ‚ƒ( 0 ?nam».0').Gê.*æT=,b8./´^ fa/b.pyäp¡ 45aosuffixª¾�I©,"-Ø,Ú.ë/À selfó.assertEqual(P('/a/b/.').suffix, '') Lself1ha/b.py14 e&f5 xa/.hgrcj› /32.f› i(ÒF7 ;htar.gzÕ8 ?9!ÿa/Some name. Ending with a dotö/KÏ’def test_[ es_common(W!):$i@P = E.cls ¬6oes, []¨ Þ./\?a/b0Á1–Â]˜3'f( œ'9;ô9m Õ5im5'o) Þ?rc'; O swptar', '·D [E-yž‘M�È?temÄ1?temhÀ*+/..$ ˆWå,bW /~01q 6™Àtar.gz').steÓm, 'b.tar') õ,self.assertEqual(P('a/Some name. Ending with a dot.').stem,DK'@  ;�def test_\_n€_common(•!):%U@P = E.cls ¹Eb').O±('d.xml'), Öý ?/a/E?/a/Foa/b.py�2H �QDot eÌÁ$.Ož ñRaises(ValueError¨5$, Ãø@ ßA!/‚- B?, 'qÀ>//c@+/c/@-?d')´osuffix¶8QU('.gz¶b µDÓE ´G ˜‹³GŽ€# Strippi1ï ]1&('1/')£ä >�?ð # Path doesn't have a "file±¿" component²á {", î@á¼AáA¢# Invalid !›¼;0, '3B+¿%ðsuffix, '.')  ð-self.assertRaises(ValueError, P('a/b').with_suffix, '/.gz') @D"?c/dC-O.c/.E/D1ad/.') ð def test_relative_to_common()!):'8@P = E.cls5p =w& ¦4Typ¥'p.k– 4_, b'a�iEqual(bV(P())q7/''6!‚'p?b')nao5/6 £%ߢ5I4ö# With several arg`ba', 'bÁ S!Un!ed pathQü õ§/'c€=Oa/b/A,?*(/a¾f/ÞgbDP('/Œ9ŽX7q·~Éî6!¨m¦Ì~§¯Bo+�B.²)úl'Ê9À(ValueError,ñ- p.relative_to, P('a')) def test_pickling_common(self):$(@P = E.cls0p =Ne/a/b')ñfor proto in range(0, `÷e.HIGHEST_PROTOCOL + 1gk„dumped =3Bs(p,Uh,pƒ[`loads(.*ed&¹÷assertIs(pp.__class__, 5pEqual(pƒ$ ¢hash(pp), )0 2str/ • šñ PurePosixPathTest(_Base`, unit½.!CCaseJ0cls?qathlib.4K öOrootëC2P('ø.DG, '/./0ð# POSIX special case Hötwo leading slashe~eŒ”•™è/eqð5Notó^CAôÞ�1a'),1///r²-]%0/ ¹oas_uri½ºC/').C°), 'file:// ’–6_a/b.c;¦@ /%#AŒ%25%23c'Žª�_non_asci÷€from urlàðparse import quote_G_byt.Á6tryãÄ÷os.fsencode('\xe9Õ except UniE%ZErrorCG@skip•0("\F² cannot be ]�d to the ˆbsystemOing"V /bT•„Ä éº- + (ò‡E4_matchzòFalse(P('A.py').E^'a.PY~¿is_absoluteh%().Ey‘þ”/a'/ /b@a1Truô.�]a�À.assertTrue(ó P('//a').is_absolute()) òself.assertTrue(0./b23ðdef test_is_reserved(D!): V@P = E.clshÒIs(False, P('hKš 2/3 foo/bar: þdev/con/PRN/NULBâOjoin0p =ÿœC:p p.E�path('b'ª�Equal(ppB0//a¯)FÈ÷L?//cN'c'…LDMLKÞ!
"('6.eôK cëL@Uc:/')+±, 'file:///¢;_a/b.c@E/%#F |%25%23cý][EO\xe9’ o%C3%A9K eN” â Lq;f Šj>4– o<%#c@ p t:@Ïmatch_commonÿ# Absolute pattern3BTrue2�/b.py').jA('/*$5/c:6#m AFals£+d:£$c:8ñ # wrong drive;j´Gç3å ðFalse(P('b.py').ómatch('c:/*.py')) ðself.assertFalse(P'b&.75"l/k/c:¡ 5 ¢ï# UNC patternsî1Truíï//some/share/aø?Z×o/otherŒMØ 2 õ ›ÿ# Case-insensitivityB B5Ob.PYa4´c:/a/B.Py')c@C:/AÅ; 0//S®S® CÔE=EK¸ð def test_ordering_common(ý!):$ù E(OFÇedEqual(a, bCGVSGLess(j 'rGreater*Fb, a AP = Q&clÇAp = ¨FA/b',qWC:a/B¶Fp, q8`&?p < > ��"e/œš¾@HARE¥Qt½\partsød adAQ = p. ^ ÎÇ , NP', 'ab6 Æ9b \\_d—//a/b/c/dqg‚\\\\a\\bmcrdÑb›Orootš+B?, 'Í c�?')..ø,/\\\º^2[Ž0“À '\\') ð< self.assertEqual(P('//a/b/c/d').root, '\\') def test_anchor(self): 2P =T1cls0eRc:').D0, '/ ?a/b2/0Ä�“ù6.4�\\\\a\\bp: ¥;£E >N­Oname«+BQ, '')YC?').,Ó.b[0fa/b.py�À 6 ö//My.py/Share.phptÕ :‚>°ÉosuffixË+DÍ.Ÿ0ì1›3à"’7#¥a/.hgrc').nÍ ?c:/5!4.jØ1.hg*£9 htar.gzÝ: ².;#pa/Some íø. Ending with a dot.ŠgM5 �‰ < @Q ¾/esÀ1oes, []�À0À selóf.assertEqual(P('c:a/b').suffixes, []) ?sel2/3ja/b.pyh'm) £;za/.hgrcvq7!m.n's+ æ?rc'=[jtar.gzé�'.tar', 'FÔ1- …Gú//My.py/Share.php’… >”BÍÿSome name. Ending with a dot.N?/a/O9àdef test_stem(C!):U@P = E.cls ™­tem, ''’ Ù,-/..[/‡‰b[º2›3J œ8ŸY8b$:7O¶ '@  ;iâ_ôn(¼J£'d.xml'), &‹ µI?/a/Jqa/Dot eÅ´SR/S¦ óRaises(ValueError&5').¦$, C­àèBoC*F��Àname, 'd.xmlC') ÿ(self.assertRaises(ValueError, P('c:a/b').with_name, 'd:B/eC//D.�//My/SharJ‘def test_ðpsuffix(%!): 7@P = E.clsIlEqual(<Lf'.gz')[�G/„H Ida/b.pyÏK"¢“K –ð # Path doesn't have a "file\¿" componentY¢ Î", b@.A-/A.‡iš Ì¢# Invalid !å Ç=0, 'éD-/É&‡/\\D/c”'ˆ/D-/\\G2/c:G3//d]0/\\F0/.cŒ1".c�§¯¿relative_to¯0p =ÞŸC:Foo/Bar$ƒ(p.^Ø"')Ã>/ ?'©ÿ<{4foO~¸zÀo('c:foO'), ³P('Bar')) ÿself.assertEqual(p.relative_to('c:foO/'), <P>QbaR')By;|:A# Un¤�ed pathsÍùRaises(ValueError, Ú T:/''@9_P('d:~>/=)?Foo?)/@,/C:B/¿Foo/Bar/BazË)"C:I E0p =ä§fæ&êã'æ?&@3'c:b=;str§�±), '\\Foo\\è�D…A N(�žX'^he=}4foOƒü~/=¼<"¼=¸/ç"·<»#A?'C:m/ÕJ6 ¸»1P('ý>)Ã+ d:'™DÀive_to, P('/ƒFoo')) û%self.assertRaises(ValueError, p.relative_to, P('//C/Cµ# UNC pathsW2p =.ÀServer/Share9_/Bar'iEqual(r(q!sEC�sHare'))‡2FooJK:'//IH3//'‘% Üà&Ü%IàH.àIܱ˜� ·ÛH GA# Un¬+ed‹â ³/)?c:/O96//zK˜)/—zRJ»ðdef test_is_absolute(A!): 5@P = 6.clðÂder NT, only„ô with both a drive and a root are e^Z�¨False(P().Ž;,?'a'/?/b/2/‘//a’/c:Â/c:”/c:•0Tru³?'c:(0•1* – jï by definitionxc/Œ[ 2ùe//cg >c/d6ÐÆðjoin(self): ãP = self.cls öp = P('C:/a/b')÷p.joinpath('x/yHöassertEqual(pp,H/-M!mN Jð# Joining with a different drive => the first ºõ is ignored, evenvA# if-esecond.•relative.*p !D:˜!Á( /D: )LÏ//host/shareV3` lWOsamei åappended to if#g$cg¾óÀ ¶clC)!) ÃÐdef test_div(ë!):C²# Basicallyå"5as 9�€g.a1 / …h5';/y'9Q6ñÍk+/xl 6 S¿T¬œß )Þ !D:ÞÔ7IÆ�k9 Ѫ ì ”çOòì®Ï7$·¼is_reserved¿”j�Is(False˜8').KD2/3 foo/bar:2Truž>con4À selfó.assertIs(True, P('NUL').is_reserved()) Oself4O.txt8Ocom15!_9.bar9BFalsÛ�bar.com9:?lpt¨?lpt¨(>¨ÿ# Only the last component matters² ïc:/NUL/con/bazj ôUNC paths are never gá//my/share/nulo>auxoø class PurePathTest(_Base°, unittest.!aCase):ƒQcls =¦Dlib.4 @def 4¡_concrete_l(Ì?Þ@p = �.cls('a'õ�type(p),\9 zpWindowsÇú if os.name == 'nt' elseª@osix.)°ÿ different_flavours_unequal¼ƒPS Éq$ª )ANotEsOp, q¢ordered¤MBwith±©÷Raises(TypeErrorÛ¢E < q´==>)>=*{` # # öQs forúÐ Ðñes # # Make sure any symbolic links in:Abase‰Øðresolved BASE =·RP.real õ (TESTFN) join = lambda *x:+(? , *x) rel_-T/¦ only_nt =ætskipIf(C!C {Ý'êà requires a ä-"òatible system')rp,u¸u = x_POSIXv! @êx÷„ As¼ç( ÈÑ ë: W#ntTùVÀeWindowsPathñTest): cls = pathlib.WindowsPath ódef test_owner(self9=@P = A.cls/Bwith÷assertRaises(NotImplementedErrorJ9’P('c:/').l)‚_group‚Tlð) class _Base:d(objecA0"""ñs for the FS-accessing functionalities of$K [bes."""ë�# (BASE)KE# | ø-- brokenLink -> non-existing&EdirAÀ `-- linkC5u../dirB 9-- ¶ |-- file%EDECUEIdirDH] ¢B—òE # No permissionc¥êæA¡M^BípÝMsetUV‹cleanup(¥ò os.chmod(join('dirE'), 0o777¹Ëçsupport.rmtreeÚƒelf.addCfnB‹os.mkdir8?A')6B C , äD' ECopen#�$¢'wb') as f{ñf.write(b"this is‚V A\n"Ú VÌ@', '^B^ B^ C^C^ C^$fDf DfšD4if •pcan_sym â³# Relative "y«3os.(~BA', oN � /¶6ÙF;[0dirXkB5 Û 00os.Ö.› ..i5)¯,L L0# T�ðone goes upwards, creavq a loopä1 ±�Ò'�bMöif os.name == 'nt'/Á# Workaroundqñhttp://bugs.python.org/issue13772Sð def dirlink(÷self, src, dest): µos.symlink(#ñ , target_is_directory=True)<FelseFrdef dirCl!) SE²assertSame(´�path_a, b¹./–@(os.$à.samefile(str(U_a), Ab)),n ð"%r and %r don't point to the Z [?" %Cs± ÜÃFileNotFoundäðfunc, *args, **kw ëWwith ðxRaises(JÆError) as cm—Ù](\¿Vñ Equal(cm.exception.errno, w.ENOENTЄ_test_cwÇp³2q =²0cls›0get))=˜ zOp, qÂÊqHÁIs(type(p), (0÷p.is_absolute()Ø ×ÔpÔ.Î GpN&hoÒS '°ÿ.expanduser('~'ë­3{äá 4! ã6„qp'U A_,4 = øÁjoin(BASE, '!'jB1 SdirB'9B9¿(FwZp" ãC‰C ™ø/r0/pp.vFalse(pYˆY 1Ja# TestÁnon-existentU caseEnon_«'ooprc(>¦&, ë?, r<(ƒ(rn?, pƒ<ƒ&À, r.samefilec, r) ñ0self.assertRaises(FileNotFoundError, r.samefile, non_existent) Hðdef test_empty_path(X!):ja# The  å points to '.''@p = :.cls(''§òEqual(p.stat(), os M'.')‘üxpanduser_common˜Pq †OP('~€ e\†PP(os.Ú.C)ÅÞoP('fooZpA/š@/..B,Pœö .absolute().anchor) / '~ÎÊ\µN), p°Oists¥FBASE q±Is(True, p.®'s(‰( (p¾odirA')34rFalse, h5r?bahq÷if support.can_symlink(TXÊ.—8B’8ÒÜB ³C ï =V¹3™P('/xyzzyéÍOopen6É‹§ ƒIwithä ).I¦('r') as f Pö Instance(f, io.TextIOBaseâ 4W`f.read†�"this is „V A\n";šb›�BufferedŸ`.strip§b¨¦1, bx_ing=0N?Raw®7 *~½_write_byteÀ/().DŸb'abcdefg, ?ˆ‚9), AÀ # cheðck that trying to write str does noóuncate the file ðself.assertRaises(TypeError, (p / '0AA').Xÿ_bytes, 'somestr')KjEqual(?Bread>ñ(), b'abcdefg') B‘def test_(lPtext(¢!):$´@p = –.cls(BASE� pC3'ämÿ, encoding='latin-1Â”Ž’R�utf-8', e?ãs='ignore'), '€­_# che½e¿B¿~¿fÿ!òD&, e Ò|iterdirÊPÊQßPØtit = p.GDQpathsFFt(itðexpected = ['dirA', BCEß]‚÷if support.can_symlink(ƒõc+d"e f¶brokenLink'[¸m"ÁB, { óå, q) for q in Æ}Q@˜´skip_unless ¿D+ z@# __#ƒ__ on a ä=±a directorySì© 2, '÷�Ø™¹!Ü=ýG [€TfUD'] }šQ_9 /no� !!thS_iI³‰’,4©Bwith·ÿl!OSjv) as cmåvný=ð# ENOENT or EINVAL under Windows, ÖTDIR otherwisðö# (see issue #12802–Æ¡ñ In(cm.exception.errno, (@.ENO`,à± :1ENT#2no.¾)§¼glob_common»Ë_:(&,&  Ëk1set2)oËú :£“!("R"ŒðIsInstance(it, collecaæs.abc.Iterator<ì-[Yà]) _chó eck(p.glob("fileB"), []) 8_ch$Pdir*/)*)Q"dirB@B", C'C"Cõif not support.can_symlink():ip m!*Ae�'dirA', 'x'A'ZOelseB 0, '~ K¥'"B/ § ¤A", O¨9D',&*Õ‚ä"B/B5ê'Û"ž‘BíD¯Só def test_r£Ç_common(self:%:&§, expected$07ð.assertEqual(set(2õ ), { P(BASE, q) for q inI& }AP = J1cls¤[3p =A)qit = p.º]&A"C�öIsInstance(it, collections.abc.Iterator<í-[¶Ao zµ  1 á|8+üQ„ ÊE wè^0¹"KA3ÈB( «û…@Ni’jC@AdirDÈD}bfCLò™?dir` D*Ö¢ ”Ù@дskip_unlessØ!—¼ó\_loopÂó# Don't get fooled by 2 2ös (Issue #26012 �Qgiven¼$t(F'*')K7ÿ = {'brokenLink|þ’š/(Bº'yÚ^C( C/{ †C~EÀ 'fileA',  œ'linkA', ! B}/ñ"self.assertEqual(given, {p / x for x in expect}) :ðdef test_glob_dotdot(K!): �ð# ".." is not specialK4s'@P = :6.clµp = P(BASE))%ª`set(p.N(jS)), {6,|?) }?ëdirA/../file*"J/A"U�../xyzzyP­6)) ?á_check_resolve=C, p,i÷ed, strict=TrueWeq = p.7$æqR¼ñ# this can be used to Žñ both relative and absolute rRution§ À_5+= B  ð @support.skip_unless_symØül‚‘ve_common2H v, 'foo'*BwithyTöRaises(OSError) as cmÎÒ w›¥ ¡€cm.excep5�.errno, v.ENOENT�b# Non-ñPMstr(„False))•ñ os.path.joinT €p×, 'in', 'spam6 ä”< x¢ ..›Ð 0<F0absD(LR ‚)³ö# These are allXÞH¥ AdirBßLileB{ \vV(p, pz PIAHxWileA'Ñ W§_C <°h ñÇ&pDpC†õ- oo•5º VÀ 'in',  ô'spam'), False) 4ð p = P(BASE, 'dirA', 'linkC ..0foo inH@õif os.name == 'nt':dð# In Windows, if \óY points to dirB{\K\..'Cqresolve0¥’ without 3ingYifirst.@Âself._check_/Þe_relative(p,ÿð IÐ fOelse_Posix //B$ w beforeÁto parent oft$$ îð # Now create absolute symÊsSðd = support._longpath(tempfile.mkd ö(suffix='-dirD')»Ø´addCleanup(L–rmtree, d+3os.@(os.h¡.join(d), VûXf;*BI I;Y;\XI Y î&B'­Ø °F °BAB�…n-strictoŽíšJšM,‘K § K°ÔOd, '‰wÓQ@þÃskip_unless_ô!…def test@dot(Ñ)™ð# See https://bitbucket.org/pitrou/<±lib/issue/9Uó-fails-on-complex-€ó„tA.clsu´0dir ('xo0R%Àink(os.path.òjoin('0', '0'), c1')) ôself.dirlink(os.path.(F, '1828ºq = p / '2'LöassertEqual(q.resolve(strict=True), p€Pr = qH 3'4Nô Raises(FileNotFoundError, rb(, c“b# Non-ô¨F¨AFals©”š!) Bàdef test_with(L!):R@p = –.cls(BASEê it3˜.iterdir(2†next(it2,t& ppt5ass�ð # I/O operation on closed Ú'¤]SValueVxF, itx0©1 op.open_på1�absolute2œ__enter__ç_chmodè*VfileAÂAmodeÚ stat().st_…õ# Clear writable bit1new.0 = 5• & ~0o222!"p.š)ëˆ*p.‚., 5_# Set‹/| ŠBÚñ# XXX also need ala for lð …Ùm… �s�@;`'�# Change ò ±by flippingF έ$st" ^FUÆ@.addCnup(4z5 -l#Nooç2Æð @support.skip_unless_symïpÎl „J 0/ '<æI bst, p.i)¡ €3_no�q"‹ˆP@unit×*U)à(pwd, "the pwdçaule isš!ed•Athis£"œÐ_ownerÆ";uid61uid­î:tryÿ1namfðwd.getpwuid(uid).pws_name õexcept KeyError: éself.skipTest(õ."user %d doesn't have an entry in the system database" % uid)NeÀassertEqual( Ñ, p.owner()) +‘@unittest‘ÐUnless(grp, "fðgrp module is needed for this 8"s1defp_group(~)ö@p = ñ.cls(BASE) / 'fileA'‡øõgid = p.stat().st_gid6tryP/Ðÿ = grp.getgrgid(gid).grŒ8Ï�!‹½ü�_�EounlinkF"#p.=˜*~ÒFileNotFound(k(S3¦_rmdir¥7dirêAqÉ`p.iterF-³qÆ"p.p°C(Øe\ ÙPÄßßPÒKsizeÓ80# Rkõing to another path#Aq = [BdM0p.rE?e(qòýqVƒ , 1# ²ú str of a relative¾0r =b_join(ð6AA'wq¼r®¼"os½r¸¾ö ·oeplaceàTlá°a non-existå JæWn©–(»)ã bdirB',ÛBéR/e(êYÏtouch_commonï!;new¤�ðFalse(p.exists(C)) †p.touch(÷ self.assertTrue(p.exists(6·st = p.stat:òold_mtime = st.stl :_ns#5_ns&Ò# Rewind the Oñsufficiently far in÷past to work aroundGõfilesystem-specific timestamp granularity.5@os.u#¥(str(p), (´z - 10, `# The tµóhould be refreshed by calling we again��k¥×GreaterEqual(w7_ns¯?_nsã>;8±# Now with –_ok=FalseÀ° = P / 'new %B'³4Y»mode=0o700,kŽQ©ÍóRaises(OSError, k`²‘def test_¨ _nochange(u!):#BPÈd†cls(BASEŸp Ax8Qöp.open('rb') as feix–êò f.read().strip(), b"this is†AA") ¨Ë_mkdirÂ!gnewdirÄŽÌ q7²$0is_¸l1M Û?*cm@/p.�Rñcm.exception.errno, .EEXISTOŒ_parentsW0# C˜êöa chain of directorieð(ÌC,>UdirB' /C'F}#^VNOENT¥p=Ìðd W $ :™ž#0 `»Q` arg}(Ätat.S_IMODE(=&ðode) # default 0=DEzt0o555, èÀTrue) ó self.assertTrue(p.exists()) $his_dir$õif os.name != 'nt':@Gñ# the directory's permissions follow#Ùmode argumentC‡ðEqual(stat.S_IMODE(p.`().st_DÁ), 0o7555 & L‹oparentˆõ default process settingsG� a–�G`def te±Qkdir_z@_ok([)@2p =¨÷cls(BASE, 'dirB'£øt_ctime_first = qŠ]ò1Bwith—?ÁRaises(FileECÆError) as cm̓0p.mñ(À‡Üñcm.exception.errno, v.EEXIST;M>=Èï~ >9, sb!) PÁ__ÍCÍ Ì”b~rlÁ / 'newdirC'ås— OE*±0¨Œ™Y/, §yLroot ð # Issue #25803: A drive ,€ could rê% PÀé« on Window#µã'/').resolve()þ  5M |€@only_nt„ð# XXX: not sure heotP thisµQPOSIX: ÎT‘_unknown_ ,ûfor d in 'ZYXWVUTSRQPONMLKJIHGFEDCBA ̇d + ':\\ü¶!if²$p.g >#QbreakµJelse$öÐskipTest("canðfind a drive tható doesn't exist") õwith self.assertRaises(OSError):)0À(p / 'child' ñ path').mkdir(parents=True) 8‘def test_"_l_>`_file(wb2p =Šðcls(BASE, 'dirB', '0&B'·;²p1(p.Ù6s()$ð# An exception is rÝðd when the last Å  component'a7aistingÇû # regular ‹, ardless ofRBther^0_okFÅtrue or not.Gå oPFileEšswj as cm}phœ•Equal(cm.ü�.errno, v.EEXIST(”<, Ÿ£ 8 F3no_kF³A>ó÷� Æ20¯?_ok$C`concur�,P_crea u0for÷tern_num in range(32›õŸˆCPC%d' %Fe9iYFalse­â&ê"my.(˜Ë, mode=0o777�0#5t~*thw!Ñ# Emulate ano¢@procµ±that would e™directory—Jôjust before we try to=ÿit ourselves. We do itGôin all possible7‚1bin¤Ás, assuming ¨OthisK@funcÔnðcalled at most 5 times (dirCPC/dir1/2,H$", 41 &2)Ò$ifË_.pop(®&%osÆ"thÞ)Œ # from¨ ®-Þ"lyÙaed.add3À os.mõkdir(path, mode) õ# our real call ð pattern = [boolBù_num & (1 << n)) for n in range(5)]Gù concurrently_created = set())óp12 = p / 'dir1' )2'&Itry:³ðwith mock.patch("îðlib._normal_accessor.m a", my_ )MQ2p12+0(pa»ús=True, exist_ok=FalseÀÀexcept FileE'nsError`ÿ self.assertIn(str(p12), ) b?lseP /NoS�â1(p.ãBs())ñ @support.skip_unless_symlinkˆ„def test@_to(VZPð¶lf.cls(BASE× target = PïVfileAð2# SiPing a‘"h 1z©‡>AdirA6AH.´ŸD…¯’bEqual(1ctat(),r!.s57Not8l*9 Ö3strcÕÖJÚ¦£¢ Û9!I0is_‚)– åto a directoryËÜB öø™_˜wà¡É7[…ß.žˆè•'#stb2terc¶•F;‘* e(™[)” ò0É1Anon-zOing'8i<?bah94if Ã4can¦( \ÈŠAW 5,4B4iÙ/ 'brokenLink9 Ìï^À self.að ssertTrue((P / 'fileA').is_ S()) aself.a1DFals2?dir1Ïnon-existingj‘ A'¦?bah:õ if support.can_symlink():ÆÍÊû*Ê 5ÿ6B�6Ú/ 'brokenLink:¦±@only_posixðdef test_is_mount(ÀÓ@P = –.cls(BASE´Rñ'/') # TODO: Work out windowsl³t~†2:Ÿ©; øRç &D EYZÆ—µÈ*|õ”T–4˜<¥ š=vµ„uZ Ô 8¼8¾< ëafifo_f/Äî5Wœ/fo1èjå:P@unitÆð .skipUnless(hasattr(os, "mk1‚"), "os.Â() required"ÕG0 _t¼[ P, 'my/'F:tryvWstr(PIú except PermissionError as eCˆáfTest('R¦): %s' % e�-P”PŽ¥¨ &osocket(–&ƒ;Àis_socket_faÃlse(self): @P = ¥.cls(BASE)€assertFa;ÿ (P / 'fileA').is_socket()4?dir3Ïnon-existingn¢¬ 2>'3]ôñ_check_complex_symlinks÷ , ‡0_targetð # Test solving a non-loop”chain of Læ (issue #19887ºKV(BASE0dir€ð(os.path.join('C0', 6), ?1')D1D)1'D2D2D2D3D¾Qº02@# Re]°e absolute  qE(P /".r1(Gý?, PŠstr(p), ŠÛj?1')jT2jV3j@Ê|relativÊ@old_ÜÇ = os.getcwdÅ‹os.chdir 6try“—§54cls$«,(#+z%,zM5zQEz;kfinallù!IÜô@support.skip_unlessÞžñ û_tö¾06Z{(%{Àsymlinks('.'ñ) @support.skip_unless_symlink!ôdef test_complexàs_relative_dotq(self):6[}._check=ô$(os.path.join('dirA', '..')) class PathTest(_Base`, unit“.CCaseu`cls = W@lib.0äÃqncrete_` °Ap = ´Šcls('a')ÊõassertIs(type(p),ívpWindows}ö if os.name == 'nt' else¢@osix*Œ¨#un–¬ed_flavour­\y�ɳ°Raises(NotIÂÏmentedError,‹>«T*  áüglob_empty_patternà �ŠBwith¥ܳRegex(ValueØÁ'Unacceptablqd'(Þplist(p.�"('yp@only_p™… ¥mŠ$C�iQ_loopô, *args, strict=TruÞ²f¦- r(Runtim `print(W’.resolve(z‡r”‘open_mode¨G old_mask =îu &(0”‰�ddCleanupù$$, 9, õFBASEùð(p / 'new_file').•L('wbÚEpassŸ"st›Rstat(pCb©å`Equal(0á.S_IMODE(st.st†), 0o666:1os.Óf(0o022´fother_wº& InÀ,44”Qtouchââc Ý‘(áÈeš z.  4ÍBelf.Än®ŽŽg(edR�¢X=0o75ƒ9Àtat(join('maósked_new_file')) ñ#self.assertEqual(stat.S_IMODE(st.st_mode), 0o750) ;ñ @support.skip_unless_symlink!ðdef test_resolve_loop(n!):!€ó# Loops with relative Gs'3os. ('aóX/inside', join Öd_check–�bBASE, F' bY[Y[Y[PZ/../ÆZdZdZdÅ# Non-strict6l. „r'foo', >f=False ¢absolut¢ ’U§)¨UéUé¨h)V'aVaVa W³WjWjWj´&OW', ´úxLglobpAP = &cl^`p = P(÷Qgiven-At(p.Kw"FILEa";cexpect&”) if not ðfs_is_case_insensiÝha else eµ ˜‰", f› (+se¤`*")), )®d�ËC† †, "dirC"ƒšø1p.rT/d"…¥ P@unit®ÏUÎõ (hasattr(pwd, 'getpwall'),³· ñ'pwd module does@expoîA#()d•¯expanduser°a im��@ule({Y“E pwd®Ppwden¯Apwd.Ï`uid(os »Œ`name =Bpent.pw_M"+ho"Pdir.rHÕp('/') or '/'4ð# find arbitrary differ•O¶ (if existsk3forƒ0 in ®‰(ÂòPother¤µÀ.pw_name  ôotherhome = pwdent.pw_dir.rstrip('/') .1if 5Áname != user 2andO:48UbreakJelse$UT/A!\ !  "÷p1 = P('~/Documents¹#p26' +²?+ '.3.wá/4/O../~`51/6/Ð7P~fake‚ Èðwith support.EnvironúVarGuard() as env‹öenv.pop('HOME', None)k�ð self.assertEqual(p1.expandŽ`(), P( ¥_) / '–I2I53IÌ“ 4J*p45252 6262÷Raises(RuntimeError, p7A ®Benv[Í¥] = '/tmp'%†Ï7h Éÿ5ô @only_nt class WindowsPathTest(_Base°, unittest.RCase)Ý0clsäwathlib.EÙ@def 7`_glob(Ñ8@P = E.cls8pƒFBASE %aset(p.Tð"FILEa")), { P(9Ã, "fileA") }³ˆr5Q‰�, "dirC"‘]’d’B`/dirD/œDœê¡‡:�©pUSERPROb°%ðenv.pop('HOMEPAT·H', None) ÿenv.pop('HOMEDRIVE'ù['USERNAME'] = 'alice' N # test thaù e path returns unchanged3úp1 = P('~/My Documents'¦#p2%u* 3*?bob( 4(/x 5&/d:' 6' ¶úself.assertRaises(RuntimeError, p1.expanduserñ;2;'3;‡Equal(p4,o(), p4¨25252 62*6)VÉdef check():<ÈÁžç*T¬€=(),\6 ÏP('C:/Users/‹ ë;u4KeyÅ;?envteÚZÚOuYu°M s  &¤ 6¨þùe first lookup key in the env varské€YAC:\\c!\\d'-  "z0at Iú PATH is available instea{;3÷Qž&à`>å Ù&l Ðl  'm&~cPROFILõ·–ò if __name__ == "__main__"Á@unit*.ô() import contextlib4sys o >R fromrA0supI3Ðtime resourcàe = support.imôD_module('resource') # This test is checking a few specific problem spots with the J [£. class Rb�Test(unit`.ñCase): defyÁ_args(self):ô .assertRaises(TypeError, x¿.getrlimit)9%@, 42Asz%9v)¼fsize_ismax6try&*Ï(cur, max) =(-ÆRLIMIT_FSIZEïòexcept Attributc bEpass`Jelse(# Z¡ should beð_INFINITY, which willÅa really big]Ðò# number on a platformu¥large fileÝ¥ On these,+s,Q¡we need toqP that4U get/‘  functionsðÛperly convertPü¥²to a C long6and`?àsion doesn't rÎ P@an eÚ.ZEqualÊYü :óÜ <&, =ƒ�enforced†‘C½äPsee wã±happens whe$’ýðÉsmall. SomeBP# ver¸ü's of Python were terminated by an uncaught SIGXFSZ, bu1pAòrun.c has been fix”@ignoZ³�Àion. If so,© œtwrite()kÆreturn EFBIGìåSReded.edÖ# At least on= ×A*ed5ßvattemptO³to change içR ValuRŠ insteadã ÍJ×B1024êCܪ_set = Truý%5'ptÁ ô#HNFalsI”f = open(ŽÎTESTFN, "wb"�ý"f.öpb"X" * á >À try:  ïf.write(b"Y") $¯ f.flush("ÿ# On some systems (e.g., Ubuntu on hppa) the Mñdoesn't always cause;áexception, but_close› Nò eventually. Try†ÿing several times inò# an attempt to ensur˜ file is reb¿ synced andM Ð� raised.0ÿfor i in range(5):+ÇÍŸ.sleep(.1¸+Þ ¢� OSErroruÿif not limit_set*tîÁ/ifD0# C÷X will“[ßbyte we wrotejˆ’# RestoreuQ firsÜ avoid gett#Àa spurious ePÑresource.setr (þ RLIMIT_FSIZE, (cur, max)ž0finGC/f.ò3P¡´*ôsupport.unlink(�TESTFN) 2÷ def test_fsize_toobig(selfÎS# Be Y5at •_Pcheck‘lÁlarge valuesfØötoo_big = 10**50*ryWˆ5 = g¿ ³ŸAttribute&6pas™Jelse�t’À‰ÿHëL�‘(Overflow�0, V, wv ® -Smax, ¥ ì &ÏN­\usageKZ€.assertR_Rs(Typ£,ì?Ö9@, 42APF UÌ«USAGE_SELF=�childrenA†CHILDRENEð# May not be avó ailable on all systems. Etry: ñ usageboth = resource.getr(ÅRUSAGE_BOTH)Aò except (ValueError, Attribut)nEpass>Œ_thread�oTHREAD‘-’ñ# Issue 6083: Reference counting bug)¤def test_s&A_ref'W(selfó âllimitsÜk�LIMIT_CPUÙ ]\JelseÐclass BadSequÚ  Ú|__len__Ê�return 2@sgetitemDW, key( ifŸ in (0, 1&.sñlen(tuple(range(10&))).±raise Index� ²Ûȃ,32())DêŒpagesize0 ë(±3ô.assertIsInstance()_, int-ÇGreaterEqual/0¢P@unit£ð.skipUnless(sys.platform == 'linux', '*± requires Lwë,1_co£,tsò€for attrÏ ['MSGQUEUE\1NIC`RTPRIOQRTTIMÊSIGPENDING']‘ðwith contextlib.supprÅ 5R0getŸgB, 'Ri1' +º)m&÷pfreebsdù?tanø @SWAPâQSBSIZâONPTSÜ|´R¶Rs(TypC,˜=SæPif os¯ºeuid() != 0GY`Permis¤_,à_13C&AS”rÏrocessLookupu -r À limit = resòource.getrlimit(resÃRLIMIT_AS) öself.assertEqual-p>?0, A!, \I.H,’™i!ñ# Issue 20191: Reference counting bug*õ @unittest.skipUnless(hasattrå3, 'ç…'), 'no Eòsupport.requires_linux_version(2, 6, 36@def r_EA_ref˜(f!):SØÆclass BadSeqC|__len__5…return 2N8sgetitem<W, keyv(AWôs[key] - 1 # new rS a*& =\J,?()) Ps) üwómain(verbose=NoneýÅ4un_#(Rð Test) if __name__ == "__N2__" `‘) """Unitëðs for collections.defaultdict.""" imB4 os Dcopy dpickleftempfi­h fromg Vn sfoobar(úëBst vðD¤TDict(d.0Cas5úW\basicŽWd1 = ~(`í S$d1¡_factory, Ÿh3"w = list"ï[12].append(42o Æ, {12: [42]})(d1C&24²CL, 24G)3]™4KÀ, 13: [], 14¢=RTrue(²€ is not (3]&4]Ä+d2‘?ß, foo=1, bar=4 2£A`œ)ÿd2, {"foo": 1, "bar": 2Ï3[1üZ [N?], ´ á7, [¦1In(m?, dF!.keys()•(ÝI !I /42F C ~NotIn(1FÀf.assertNotIón(12, d2.keys()) õ d2.default_factory = None"þself.assertEqual(3,2UEtry:@ied2[15]úexcept KeyError as err3 wçerr.args, (15,ÃOelse<bfail("zÕ didn't raisex"²nR$as(Typež#, !‘dict, 1) Èðdef test_missing(C)ˆHd1 =:(m  d, d1._Sf__, 428/d1¬Alist‘h„ ¬ OŒ(42), []ÃOreprÀ# ™  ™sgd1), "_(z_, {})œoTeval(A)4$Ÿ[11] = 41<}i11: 41ƒ+d2Í6intt Ý" 2–2¦2¦ ² #ú, {12: 42¯õef foo(): return 43h+d3Ì?fooÌ}True(d3t is]3Vd3[13Ý n3ë %s½±3: 43})" % (� Ÿ_print › ÿg Ë0foo‰F: 2}ÔÐ# NOTE: We ca:õuse tempfile.[Named]TemporaryFile since thiskð# code must exerc~qthe tp_Õ! C"ø, which only getBðinvoked for *real* „%s.fVtfn =� mk¨o Ž÷f = open(tfn, "w+mF 1°A(d1,&=f,"2"Žf.seek(0< 5Òf.readline(),›d1) + "\n¯|@2@kfinall²Uwf.closeK+�os.removeP ¼Ocopy»i!1.7' ß`type(d> 0ÀassertEqual(ó d2.default_factory, None) öself.assertEqual(d2, {}!,d1Cu = listCÖd3 = d1.copy(9 Z£type(d3), ”Odict0,d3z,y3 ½F[42]ª4ª4ª4ª¨4, {42: []m74[1° Cd64, 1>àô# Issue 6637: Copy fails for empty{ |8d(ŵd['a'] = 42.e.îe:a, 42) ;ñdef test_shallow_0ã!):!’ d1]‹Øfoobar, {1: 1*@2 = B‰/d1 X5 (, V“,U‘,MOdeepJ)[1v¹NU(ú£ #ïPVöTrue(d1[1] is not d2[1] |Ã'€"õkeyerror_withouh(àÙ Þ6tryV[(1,)¸°except KeyElz as err5p ¦Ðerr.args[0], PrOelse>,¥("expectedo"Áìrecursive_reprê…ô 2045: stack overflow whenƒ’ôáa bound methodâ ¨class sub(2 º Œ__init__‹DCw!= u1U2U†return [§G­ib^aRegex(19d),nˆr"sub\(<0 .*.Ÿ+ "3 of@\(\.ð, \{\}\)>, \{\}\)")  ñ2# NOTE: printing a subclass of a builtin type does not call its Fq # tp_Eõ+ slot. So this part is essentially the same test as above.Mðtfn = tempfile.mk &() 5ry: �öf = open(tfn, "w+"- t1®@(d, e*=f20fin« g6wf.closeŽ+�os.remove“!) ®1defò_>æable_arg(self)hü.assertRaises(TypeError, defaultdict, {}X}picklinT8d =;F(intîAd[1]ŸÞñor proto in range(U÷e.HIGHEST_PROTOCOL + 1·=Cs = .Pdumps\Mm'o'zloads(s PEqualGòo) if __name__ == "__main__"=@unitP.¤() import " ÕCEmpt>�Œ__repr__‡‘return '<0$>'?2Cmpo=Cinit=G,argƆrg = argq´Cmp %s>' % D>$eqpg others´6%#¼ˆAnythingÁOHTrue�/ne� TFalseuôComparisonTest(�.CCaseÀðset1 = [2, 2.0, Ò+0j, Cmp(2.0)¤@set2'ñ[1], (3,), None, §(&�candidate’Z + :Ç)%_c›sÿPfor aMP;Æ&b&*Vif ((Q”v) and (@") z:s blF‘ Ja, bA'OelseA8NotDØ/id! „# EnsureX M qes id()F1rgs]šLÀÎDiDn#10@L.in ¥(len(L)//2íöE^Lôa YI1 b,¶ a) eid(b),¹5°'a=%r, b=%r¶(’ œ3ne_¾¼s_to_not_eqw1a =ñ1Ûbc2&Í@Is(a¾0b, » $Àf.assertIs(aó != b, False) ðself.assertIs(a%‘c, True) %ð def test_ne_high_priority(;!):%M°"""object._,õ _() should allow reflected åto be tried"""J¦calls = []–lass Leftqu»# Inherits };'ÅÇ__eq__(*args·u�.append('j.2'-(õreturn NotImplementedqc¬KRigh­†D‡%©r/neør3ù5 ()CG(9+fáSequenceEqual(v9, [q1, 'AI/']‹?lowŠ ©not invoke�)ƒOBaseƒSjü%ƒ€Derived(J‘): # Sub°ing forces Ô4er ÖÆ?7r·%t€«t5µµI·4ª0, 'P ¹ÿother_delegationD¶No default (Ñ between oper:…s exceptM¾ op?(Ì#('Ïý, lambda a, b: a == b),-]lt__'-<,e,YgY>YgY>Yhðfor name, func i1s¯Qwith �€subTest(1<Qunexpµ�´Oufail('U2¬ or method ì/ed¡“* C¨X-6 = Œ «$÷[9, _õÀ ð if other != name: ¢setattr(C,2Ý, unexpected)6!ifOÏ == '__eq__'[þself.assertIs(func(C(), object()), Falsec?els¯TðRaises(TypeError, c*, d Àðdef test_issue_1393(K)ºñx = lambda: None8.(ÇöEqual(x, Anything()½ (%6, x(5y =eye  y) if __ð#__£Emain¥@unit .q() from° import sup.!`bigmemDs, _4G 9Z:$io0ô BytesIO, DEFAULT_BUFFER_SIZE<$os dpickleDglob epathlidrandomeshutil…ubprocesW’threadingž¾ ØdunlinkCÄ_compressionÁsys # Skip4seðthe bz2 module doesn't exist. =U.+!_m+c('bz2'ƒ(� BZ2File, C†ßTBZ2De—ò or has_cmdline_bunzip2 =½ òUext_d2S(datañX?al A’/if1 is]4@‚ = bool(‘ƒ.which('ž'/`X…return sÇõ.check_output([P‘], input=ܼ <JLbz2. ô class BaseTest(Á.CCase-""B forúrcases."^áTEXT_LINES = [†9Ñb'root:x:0:0: /Çbin/bash\n',. bin:x:1:1: / "Pdaemo%C2:2: //s) adm:x:3:4: P/var/ OÁlp:x:4:7:lp:$«spool/lpd:*±sync:x:5:0: u£/ .`hutdow©626±/ $ ;0hal2A7:0: 3 /Ámail:x:8:12: Ç 0Ánews:x:9:13: 0 00uuc$a10:14: 1 1€operatorÉE1:0:û .@game�r12:100:R/usr/ /Aophe[b3:30:g0ðlib/gopher-datas:\n', ð b'ftp:x:14:50:FTP User:/var/›/bin/bash6ãnobody:x:65534N\/homegppostfixkt00:101:ldspool/ mÑiemeyer:x:500:e$/n¨RAgresxô1:102:PostgreSQL Servî¯lib/pgsql:L myxE`103:MyDsD&D1www‹b3:104:h0Yfalseü]©ðTEXT = b''.join(q_LINES) ADATA ðBZh91AY&SY.\xc8N\x18\x00\x01>_\x8 ð0\x10@\x02\xff\xf`1\x07n,R?\xe7e:€\x99\xaa0\xc/ð3F\x86\x8c#&\x89 Ò3\x06\xa6\xd0ð93M\x0fQ\xa7\xa�9ð04hh\x12$\x11\xa4i4\xf14S\xd2\x88\xe5Jó9gd6\x0b\n\xe9\x9bdaõfð08.KD@v\xfw27xw�5@1\x9I1¡‚|/";\xa2ø"9fMÀb1#A\xb6\xf6ªoˆ¢c5y\\\xebOr@85\xE bc-Þ5p5\xd7"%ŽP>V,\x”2a6z8da!fHÐ11"\xd6E)I\xaö²3^\xca\xf3rf003U³´Q26\xen°\xed\x8b\xc1ôAd\xc4É� a^9P\xacDÿ#7m0\x1pe°\xb8\xbd\x1 a¢b80ankRe}Bd83]¤cƒP8\x82Ž#P9"6l$K"j@”8GP0l1..[ks"lsÔ/Pf4\xcËP3\xbeüE>@\x9d u 9d6G`3n\xfaÇM01%yÉ€v\xb4\x0�0z\x1b\x1¶Š4!c/9%!“en7.G\xfc[1&01B@ A!8`'žiEMPTY_¤ŠprE8P\x9N 56BAD3ñthis is not a valid bzip2 file' gö2# Some tests need more than one block of uncompressed data. Since&Pðis at least 100,000 bytes, we gather suFô dynamically and fC it.R1Not’!t Ópassumes¤t/ðion works correctly, sosccannotL�simply usR�e biggerÿÕ� for allÀs. test_ñsize = 0 BIG_TEXT = bytearray(128*1024)#ðfor fname in glob.Õ(os.path.join 0dir*ñ(__file__), '*.py')):Mt¡with open(WÖ, 'rb') as fh&*Qtest_°ô += fh.readinto(memoryview(Â%)[.":]ºC5if 4 > Û hQbreak N@DATAµz2.compressf$, ‘level=1) 8çdef setUp(selfí. ö = support.TESTFN=|LDown@4if j isH!Rjî›os.unlink&ñ class BZ2FileTest(Bas D"D the% 3&."¥ createTempEdó, streams=1, suffix=b""T”ï b, "wb"÷ Žqf.write_.�*eØZ)wŠòqBadArgsFŽ„ôassertRaises(TypeError,ù–, 123.456o7MValu8ÿos.devnull, "z"@+/rxA-/btB+ ì0Ï* L+10¯ORead¬ t„XÐ:LJbz2fXÄû/`–, float()jl=eEqual(1A(), HÖ5Bad. ‰ ÝK0KY@BAD_’ü0#OSõɼaMultiSácÀ5ª:¦?O * 5î_onkeyô!# $u/�() on a m*-Áó archive where a¾)Lñ# boundary coincides Ó~aend of‰@raw ô… buffer.B4= _\õion.BUFFER_SIZE/Ð_compression.óBUFFER_SIZE = len(self.DATA) Etry: $ö createTempFile(streams=58+‚with BZ2$\úfilename) as bz2f\5`ñassertRaises(TypeError,3ê.read, float()r A`Equal(h5A(), _wTEXT * ¯kfinallëÚ_compression..Ábuffer_size ñ def testReadTrailingJunkT)ç€ ?auffix=JBAD_‚FHB )¹aMultiSÍÄ6os=5, sÏbÐ Œ0�Em)¯ª0), b""¥oChunk1ØM¡text = b''SY¦while TrueÓ0str22z2fn&10X ®if not str@ Ybreakr� +=7  @)ä>ê!á*œ Rªf/10�M ëÖ 10-!Ùk[:100]û?Pee‹²àPpdataáppMÅ¡—2Notšu8;), ./o¦.àp.starts (<he*à), self.TEXT) ñ def testReadInto(self): õ.createTempFile()�with BZ2+öfilename) as bz2fKOun = 128Aöb = bytearray(n^UÀassertEqual(T`.readi®Ob), 2!, FŠTEXT[:n]a’1lenø.#_) - n¡ - Mh®,£²a-n:]) ‘­ALineµ­GÎñRaises(TypeError,܈ªline, None @for 6 in€j_LINESç C1(),K¿MultiStreams*6s=5°ÈFO * 5<s Rs(K âûsü#œ?sŠü4  �IteratorçW¨‘list(iter”'))µ¨¨§k¼hdClosedÆŒDeadlockvò# Issue #3309: /¡ion on a cD3ð should release the T.î $ =NŠ.�D&.yà() selóf.assertRaises(ValueError, next, bz2f) ò# This call will deadlock if the above ñfailed to release!-.P?sel‚| .rbaines) 7àdef testWrite(A!):£²with BZ2Filñ.filename, "w") asÒ26E 4Typ…wm5…V.TEXT"‰Bopen†A'rb'‡f„ñEqual(ext_decompress(f Q()), ¯où �Chunks10x.Qn = 0eóªwhile TrueÀVstr =Ÿù[n*10:(n+1)*10]G/®if not strK ]break6x&trr2en += 17‰f³NonDefaultCÄ\Level˜ expected =™.ðå$, l@&=5óÜî:ÿR�[LeÊ2"rbQÊ »$, íËLä }âI¿ A< ØÐlrNíL.í�Úf_LINES-÷ # Issue #1535500: Calling >Ô) on a closed—š # should r|ß an exception!qv, ["a"]¦?¼†MõMethodsOnReadOnly‘“.£s(b"abc"M¿ð/r®@/ #OS-f, b"a"[oh9I0, [?]¬²aAppendf.�õð) bóz2f.write(self.TEXT) ³with BZ2Fil õfilename, "a") as bz2f:29IñassertRaises(TypeError,/qg5G‰Bopen†A'rb'‡„ñEqual(ext_decompress(f.read()), ¯øa * 2) Ëñdef testSeekForwardz)ê7¡createTemp#Ó:®îKO5 Fseeka4F.J(150O,ôóo[150:]õßAcrossStreamss+&=2� \l%ÓO) + >@Back(³+50ßúv-150, 1gþ0500@æbª^to = Ï!00£ècwhile 0:> 0W"-M;(:to);Z/1Z& +ahfoFromEnfM Þ§*8 •CÝJbó@000,äìô ô_[-1002OPostÁYL1500Ìvtell(),KÀTEXT))  ðself.assertEqual(bz2f.read(), b"") *ðdef testSeekPostEndMultiStream(G!):*.ñ.createTempFile(s*Es=5)'‚with BZ2 ŠÐfilename) as ‹TXÆ.seek(150000Kv Ì@tellÌ1len§—.TEXT) * ‰> QTwice] °û<7£1$~)7B4reStart>V?-157-&‚`6ê$2™<(þSK * 28ã/noæ $op¸a, 'rb'"Nrawf"% =U!9Ò:try2¸ :qo<G. PofinallTjfclose(2iñRaises(ValueError,ñg ?w abF7elfeeïqBytesIOgf.DATA){ ùŒBTrueú]i:"i¿E(V$ ¦&‰K c), "w"À try:  óself.assertFalse(bz2f.seekable()) )• finally:.fclose(*TñRaises(ValueError, 3a%) Oásrc = BytesIO(DGDATAW%rc™± = lambda: ·F^G¦Z2File(srcA+tr¾eýnÁdef testReadu—)h Ó"â3TruÞriÞÍÌ�$E #:‰# o), "w".åaåFaÂè@WritÙäè?âwjéF ê:§(sê0«`éFaÁé|OpenDelèO¡createTemp¨½÷for i in range(10000%oáÀ†filenameF'Rdel o`’¿Nonexistentš¹#OS¶BQ„, "/non/B"óÄ linesNoNew dð# Issue #1191043: '*ðs() fails on a Õò containing no nS.î÷data = b'BZh91AY&SY\xd9b\x89]\x00@3\x842c õ!\x9ah3M\x13<]\xc9\x14\xe1BCe\x8a%t'{‘with opená.®ƒ‹†b") as fÃ� f.' e(´©G] JD G*ô¨;™_ÅaEqual(2ð, [b'Test'])  ðwith BZ2File(self.filename) as bz2f: )àxlines = list( Q.read5()),LÂassertEqual(9Ñ, [b'Test']) -ñdef testContextProtocol�)|�f = None4�ºa, "wb"À ½æf.write(b"xxx"­]X, "rb)v.close(;6try¥˜ xEpass½úexcept ValueErrorD ,:lse\ñfail("__enter__ on a ž d Äò didn't raise an t7ionо VÞ<1/0ÝÏZeroDivisionä*?1/0Í yG Th�4GiB input"éÐ ËÂQ"x" *::try€x ed2’zÛl edy† Àkfinalle‘ðNone # Release@5oryœ&Gbz2.˜tŒ Æð 62lenÀeÇ.ö.strip(b"x")), 0r× �aPickleÿùñfor proto in range(p)ð.HIGHEST_PROTOCOLa9´ ¹ûRaises(TypeError/3]kdumps(ü,Š�) classŽD  or¢P(Base \áÌ_Constructorä¢,dC, 42f[ƒ Y0bz2¢6BZ2$ Åz >UØBtextùd }.iJ`™;0Ê•Ò aœ‰ ª—Ä—7’— /™ <&¡UnusedData“‰�ÒÓu;_U’"this is  QÙ’ Ø�C+6N=× ÀT) s÷elf.assertEqual(bz2d.unused_data, ñ) def testEOFError(self): Dõ = BZ2Decompressor()!ptext = (%.d#GV.DATA*Z tRaises(u,?ß, b"anything"B&"äp@bigmemçò (size=_4G + 100, memuse=3.3gî!4GÍ , ;|# "Testõ) with >4GiB input"8PblockSà = 10 * 1024 %Ð = random.get Vbits(@Ç* 8).to_byte¢, 'little'ÚÎ6tryÛ¾�1 * F // ^6+ 1@3 ed94z2.(M ,> Q6SdE_*ed\OZTrue(G*= ŽofinallþENones’s= =  i ?<aPickle60Àfor proto inÑAge(p)ð.HIGHEST_PROTOCOLœ9’HòAAType· /3]mdumps(À,Œ"ºö°orChunksMax¥ Í bzþ V}¡max_lengthß0 ou."[]~+²# Feed some$,¡len_ = lenQ.BIG_SU - 64'Ùout.append(bz;16 [:P%],8}¾= )XjQFalsexaneeds_æ*”ͧout[-1]), ^ÑRetrieve moreÉI<’providingoÒ 8b''n×w@hile‹Õ!‡ßÞ:ß=OLess¹!`remain§'unN”®wü@not ·:eof›ÍÀgth=max_lenggth)) õ self.assertLessEqual(len(out[-1]), max_length) <Ñout = b"".joi.XTPQout, �BIG_TEXT-ðbzd.unused_data,eyðdef test_decompressor_inputbuf_1(d%):¥ñ# Test reusing )ð buffer after mov‡existing:øcontents to beginn §bzd = BZ2DŠ(Ö&[]1‹# Create†¥nd fill it|Å“?òåÅ.DATA[:100],9× Éƒ=0), b''X.ð# Retrieve some results, free$¿capacity atI# ofÛ–»out.append(Éyb'', 2)…�Add more üù that fits into`Áf#ËA½’{[Ê100:105], 15¢ò$tø¬Š^75:]Šx†ó&''Y<8h  2$ 2by ŸåÊá1theiåend right away9_empty$2.ç¼- ©F¶L�with newtMïgŽ200:280]2‹À, not enough˜arequir¬&iz±y@80:38 �ß1?300ßI3ßè`extendâ&it”Á(�almost fu¼�Xþ:º aHevenbo it, ðÆ?resòÀf.DATA[200:3³00], 5)) õ # Decompress rest of data"õout.append(bzd.d/õ(self.DATA[300:]))4ñ assertEqual(b''.join(out), CTEXTŠñdef test_failure[%):P–bzd = BZ2­?or(púRaises(Exception, ¶}@BAD_»V * 30Iõ6# Previously, a second call could crash due to internal inconsistency·ç—#Jð@support.refcount_+8ürefleaks_in___init__E„gettotalG4 = Züget_attribute(sys, '/'&� ìrefs_before = I¸÷for i in range(100õ¢¼Ð�YSAlmosfj7 - �ó , 0, delta=10) class C]�Test(Base “l. _5t = bz2.Q#.èλGext_UG"~±EmptyStringf¥bLtext‰'b'¿ ƒ2QEMPTY ›pÈeb¶ûx% Õríw?b""q$k!TomZ ê8…ÿðŒ In< le†7elfÖML ValueErrorä2šÌ~o[:-10]Ì|BadData\m/OSj Nh¼MultiStreaml¯ UÁO * 5Ò°C.]ÏTrailingJunk†+´éá{å’™)O* 5 � À.assertEqualð(text, self.TEXT * 5) class OpenTest(Base €): " ñ the open function." 1def(WÐ, *args, **kw DH°return bz2.I(*Oñtest_binary_modes\K@for ÷ in ("wb", "xb""q"if%!==Îaunlink]¡.filename)Õ"Bwith0³ã*,^n) as f\rf.write]mYTO"rb"Túile_data = ext_decompress(f.read()fÇ´ÀassertEqual(êF  7ö ¢ m˜l%abš[ * 2)ãimpliciì !# €, |ðs (no "b" or "t"…string).Ì 10/ "Ò.ÿ&Ï-?kŽ›,» " =¦i.¦de("ascii"Û)à_native_eol = ö .replace("\n", os.linesep9 >t?t@ tAdÒ¹ð with open(sû elf.filename, "rb") as f: &ð_data = ext_decompress(f.read()).½de("ascii")EspÅassertEqual(V0, tVªnative_eol=Qwith >Qopen( <¸t¸+ s®rgag€f.write(ÆT¶nwa * 2) °ñdef test_x_model)@for Ñ in ("x", "xb't"'>aunlinkAe¢!g�Apass¯i"íûRaises(FileExistsError¢ 9„>ˆ‰8˜1objøp¡hqBytesIO&`.DATA)€Ç!Ö6ÃFTEXTXhzNië" =–ƒþ’[’ ³¡bad_paramsX~ñ# Test invalid % eter combiwAons.É×xIQValueD,&* 8à, ¤7wbt)ka5xaMrèÿencoding="utf-8ÓKr¹Ÿs="ignoreqPÌnewline="\n"bÿ`Änon-default +V³2)_• ! =�.replace(™P, os.§?sepýf„ðt", encoding="ut÷f-16-le") as f: Õf.write(text)ÿ with open(self.filename, "rbGðile_data = ext_decompress(f.read()).ede("ut’r“lÀassertEqual(xV ,  »_native_eol«:°Øt", encoding={ G �¼€!) ¯”def test_Wá_error_handler3)fq# Test Sµnon-default• > >.c1’Ùw‰Ðßb"foo\xffbar".%Pascii@à€s="ignorH\¦ªZ»Mœ˜HQnewlineB “explicit ,µ (universalæmode disabled)RD1 = ™ETEXT‘è&wT€O="\n‰uZrZrZÀY:`s(), [sU]) YSmain(”ðsupport.run_unitË(ˆÈpBZ2File³,CÏ-orDì 5" =FOpen&Ÿðeap_children() if __†�__ == '__Ö2__'kÇP() imâÏ collectionsD.abcg dpickledrandomestringyVGÁweakref from+ ’ÝÐ class Dictʼn.kCase):mü invalid_keyword_arguments.Z³Custom(dictøÞEpassÚCfor ZÓ in {1 : 2}, ? Bš†ÀRaises(TypeE* /uˆ3(**kêO ˜{}.updateTÕó¯constructo’ñcalling built-in types¤Dout \ñ must return emptydµ …âV), {}Þ%QIsNot�£%K¯�literal_· Sheck + + Èð different sized dicts  ð# (to exercise the BUILD_MAP oparg). )õfor n in (0, 1, 6, 256, 400):&*ù.items = [(''.join(random.sample(string.ascii_letters, 8)), i)JN}i}™range(n)](`qhuffle(� J¡formatted_ò = ('{!r}: {:d}'. p(k, v) n q/ Lódictliteral = '{' + ', ìJj))}'¯÷self.assertEqual(eval(W0), É!) >àdef test_bool(DxSöIs(not {}, True¼$({1: 2} 1Is(fŸ{}), FalsG'Jq ¯Lkeys¯ad = {}(àšaset(d.:)©>@'a':ˆ0'b'ÇLDk = ;apk), {'a»/b'!n(!k}K�In('b', ]d< óRaises(TypeError,Ó_, NonŒ9AreprJV(a=1)B"P_Q|['a'])"V_value©$<«?1:2ìC{•76(°/[1Á#;g‘ÃC{(1, 2)©;5[/1) contain;0Not;rs‚"Â@'a' ì7in &\ ¿„¢ÝY<Ã0c',z×"’$__-,__€?lene3Vd), 0bü À self.assertñEqual(len(d), 2) def test_getitem(self): õ = {'a': 1, 'b': 2},r.assert^¯d['a'], 1)$ b$2$¥d['c'] = 37JE = 4ncJ3J$’4$¯del d['b'][,ö£4, 'c': 3}1fôRaises(TypeError, d._M'__5÷class BadEq(objectgV‹a__eq__…{, other%)rtV Exc(ÕAChashC<‚eturn 24ÿ7ãÕ"d[¤)‘/42$õ?KeyôM, 23ø®öException): passƒOHashÅfail = False”¿_ef __ö 1if ´EÜ>T Oelse6N&42Ë0x =åÉŸ;d[xO x.�f = TruѦRe;ExcT3, x_ñ½Qclear6ódØ×1:1, 2:2, 3:3å.3¢zÌ?, {õPl, NonežoupdateŸ’'v{1:100}š$d.?2:2 æ;Õ -NiA%o¾‚Attribut))ÖÙ 6qêSimpleUserDict�úo__initëŽ kILkeysžrâL.*!AñH7, iˆ& K&[i~d�Š &()|’*°ÛR… ‡6Failing‰�õ¬f)5%ã  põ=’Àf):  óclass BogonIter:  ÿdef __init__(self)(5o.i = 1K ?terKpreturn RL?nex—!ifH/.iº ¾0r#š?'a''�raise Exc"=t)()#msgetitem%_, keyuK5keyC.€.assertRƒõs(Exc, d.update, FailingUserDict()) = " 2ŸOkeysCÝ =<EQzord('a'.NRXgA <= ¢/z'©£‘rtn = chrC/.iÑ.Ð?i +Q( 5rtnΓ@StopëNatio,GÀ�) Ìœ+Ûbadseq(objectiàŠ (<L @GExc(3Jp%{}q³h5ÇValueError, <³[(1, 2, 3)]t©Ÿtest_from‰\µEqual(dict..õ'abc'), {'a':None, 'b c }”ed = {},^~IsNot(d[d>/�/ŠL p(4,5),0؇4:0, 5:0Ä: []5-a+g([WyieldÓR 0g()S1^Y4š7Typô£îpOÃAlikeÌu): pass#Xd0ict.kð'), {'a':None})  ó(self.assertEqual(dictlike().fromkeys('a'), {'a':None}) > ?¥IsInstanceD B\@„B€class myy%):ž¦ûdef __new__(cls"ö return collections.UserDict(ªCud =g×&b'# L'ud6O, 'b@8�kðRaises(TypeError, ¤%) +�Exc(Excepë|): pass$0badE1Qpinit__(óS” j,k´TExc, l²W, [1]8·ÛBadSeq(objectsäOiter“æ…þ<?nexÏ48Ë·)Ð÷2cssetitemÓË, key, valueÿÇrr2§ rñ# test fast path forVÕionary inputsG÷ô(zip(range(6), )·"7‡b(d, 0)À Lo[0]*6)F3FúdÊa{i : ióCi inÇE10)}'Çres = d.copy#Ðres.update(a=)3, bc 3 €{"a", "b0c"}Q#esGµ£_‚Ô�ö{1: 1, 2: 2, 3: 3½.‡dIsNot(È?, d¡&‚¼®·B…d[4] = 4j­#No¢=¬&W#{}œ?, {®‚63 , ¹« g\_fuzzñP_size.r[10, 10+0]›2ict9=f‚dom.rand8Ý0+. //Ö+œÆ8Bwith¨ÀsubTest(dict¡_size=dict K): md = {}ÿfor i in range(B Q�d[i] = i IÝd2 = d.copy()ÿself.assertIsNot(d2, d( ¾Equal(d, d2(€d2['key'�'value't ?NotO Ÿ(‘len(d2), b) + 1)ô�def test_êð_maintains_tracking(L€zclass A‘BpassOUƒkey = A(b—d—À({}, {'a': 1 Pkey: ò''}e3�’}ÞCgc.i²{ed(d), #2)Œ î¬noncompactæã# Dicts don't %õ themselves on del/pop operations.´÷&# Copy will use a slow merging strategy that produces>at0ed ™ð when roughly 33% of Ýç is a non-usedBøkeys-space (to optimize memory footprint)µqIn thisð we want to hitýÅ/7ingodbranch–7ö and make sure it works OKuÈPk: k $k$»V1000)á <9500uel d[k]•A =º7-ge©�HPIs(d.2¦'c'), Noneâ(­+@, 3)zòÓ�, 'b': 2pJ›aÆ1à a'¿,K¿SñRaises(TypeError, úW,L Ç�setdefaul¯#.!zË 4•0 ÕdX$F, []bS 'RŸ.append(3\R<0[0]‘P ¦ S4S'W7), ²Ú¶é«4�Exc(Excep,:): 5àclass BadHash(§object): Éfail = Falseûdef __hash__(self9D0if .E W¹raise Exc()^Oelse6•eturn 42 5·x = BadHashK`d[x] =)Qx�f = TruѦpassertR’ò s(Exc, d.setdefault, x, [])sþVtest_!|_atomic ö# Issue #13521: 1…() callsGõ and __eq__ only once.ã`class â?ed(­–o__init”ë·•count = 0b!$?eq_"fCúB#DM+= 1grÇu_K, other^d¦b !idK‚) == id(Q�§Ted1 =\‹Sy = { K: 5}4245(<2:â¹nSEqual& 1..u6, 1†020&1.- k5ed2q߀ÛCitemØ¢_at_resizeLš˜ÿa@# 5 œs²X ªÿ , 0: 0, 1: 1, 2: 2, 3: 3ÂQ# 6th`¢ forces a ûo[A_%[]«Û}0pop? Êt# dict.‚öfor copymode in -1, +1‚p# -1: bZõ same structure as a#,+,Pis a.Y´ p@log2op�range(12”ize = 2**1 jNaÆúðb = {}  òfor i in range(size):  ïa[repr(i)] = i#ÿif copymode < 0HVbL H>H`b = a.p-()Ž× ka, va = tŸa.popitemT¹þ self.assertEqual(va, int(ka)†2Pkb, v¬tb`b`b`’`False(‚@ andÙ^!= tb  <a$5b) oed = {}PôRaises(KeyError, dú?Ðdef test_pop(9w€# Tests Æõpop with specified keys ‚ök, v = 'abc', 'def'+ [k»vvͯs, 'ghi'²Î3×f(k), v< &Ÿlen(d), 0K~k/ zyÖdç :1·;¸“HTypeÁ‘ö class Exc(Exception): pass $çBadHash(objectèRqfail = ¼‰!Œ__hash__! 1if ´Enrˆ¦Ÿ:Oelse6†eturn 42ËDx = ÉK0d[xT%42» x.�u = True¦8Z3Exc3, xWóàmutating_itera[ ð# changing dict ¹@ dur5 &0d[1¶1 aܤbRuntim ·8dBCd[i+ab×_looku÷ ÔÏ"a /æ (issue #14417„eŠNastyKey�I!e_#f= NoneÒ›c__inite /luÃ�value = K° # ± collision! ‰rz1\%eq¥[other“C4if .üÀ ð mydict, key = NastyKey.mutate_/ )@?one03delk][key]$ò return self.value == other 2@key1jª8(1)22Pd = {;E: 1}1Æ!(dZd¶e2] = 2=¬°assertEqual6cb2: 2})±àdef test_repr(2%):A”�.P4‡d), '{}'Ë/[1‰ 91�=tdLd”… €1: {...}�1ò class Exc(Exception): pass<$@BadRgobject#)_&,__( Qraisek^E41: ^)ÝÌR;s£ , 3, dDy¢\_deepbVüfor i in range(sys.getrecursionlimit() + 100å}F1: dN¤RJ_Error¯,eq¨K�f{}, {}9!1, {U±ÕOCmp(Ô#eqÒ,Ð oÙœc__hashC<91nd@{Bad™)ðdî&1}0Bwithy}, oYB= d2;�9ïkeys_contained–{helper_*Àlambda x: x.+()¬7Pitems8�“4ûG, fnÒð# Test rich comparisons against û�views, wh*öshould behave thîñ# same as sets.‘É@empt[0fn(S­“ðsmaller = fn({1:1, 2:X9Mlarg W, 3:3ó%cF&3l4l&ÊE¡TTrue(£2< h ¿O +=+KC > `V+=+­FFals®À>= larger)  òself.assertFalse(smaller > larger) *- ,!S <= 7- -[P$ <‡3[-=´- µ3á8Z-âµõ# Inequality strictness 0RTrue(M42 >§y +<+ ²WýV +<+­ $ =�2W­G$ !,%) Wõ%# There is an optimization on the zero-element case.= APempty“ ’é!‘ *=àïçKTð æAWithÏ same size,ñØÿwise compare happen' iÚÍ,>ðdef test_errors_in_view_containlp_check(d!):5ùvclass CNa__eq__/w, other6% raé€RuntimeE{ Õd1 = {1: C()}p/d2wNš›RX(s(Y ~ d1.items() $d2iS*?!= S=Sú&d3c;, 2� ]_ < d3j1E( >iÃ}ËAdictÅ�set_operG‘s_on_keys›kp1ô12}.$Åky^, 3:3$:54:4’ê�Eö(k1 - k2, set()h)�3, {1,2}) 2R_1, {3' 3'4' ð1 & k2, {1,2})  óself.assertEqual(k1 & k3, set()) ( )ß| k2, {1,2,3}+ ^+'3RA4}) ~ðdef test_dictview_set_operations_on_items(¤!):5·òk1 = {1:1, 2:2}.%¨(k2 _, 3:3%3%64:4ap =-é=-fß{(1,1), (2,2)D ß2 - k1, {(3,3+ 3+?4,4+ îň2 [/, ¿#1 .+2 døª@[mixedF =ö# Just a few for .keys(>ýPTrue(i}% =yÏ-}$$:14Z” [Q| {2}$/ 2b5A2} |ÿb5X# Andä #å&Âyˆê!,1î=ï(ÄðH,ô@1c. ~missingû Make sure tó doesn't have a __9‘__ methodWs0àFalse(hasattr(H7, ";"] 7/{}5ö# Test several casesýÿ# (D) subclass defines¼õ returning a valueÎO# (ED aiJØ RuntimeErrorGFG:setˆö instance variable (no effect'G# (GF”Ù Øeat allDƒ¯8def: [, key(,'5 42YPd = Dø 2= ²* �vd[1], 2Ð"_3], 4"¯NotIn(2, d �&ÀEqual(d[2], c42) åclass E(dict):û def __missing__(self, key(,ðraise RuntimeError()Pue = E()Pwith Q€.assertR@(s(Aj) as c“Ue[42]E@ýEqual(c.exception.args, (42,)ïFïCinitìçø# An instance variable&õ should have no effect³,»]� = lambda`e: None4_f = F<1Keyy8f83G8Epass¬_g = G¬+g¬)´ñtest_tuple_keye�pÐÕ# SF #1576657½ed = {}¤h od[(1,)¢2¤À0bad¾u ¹0Dicà´ary lookupss`fail i´qeq__() •Vs an ÞùtCustomE6( t°å <0Bad�:Key¥Äo__hashIpreturn %ã1.__‘'__­yMÑÄ{, otherž)Tif is›(&,b[ ¨6' ì"²Y? 3Vx1 =  /x2•d[x1] = 1sðfor stmt in ['d[x2 52',"‘Q'z = &" x2Ld Ÿd.get(x2)"�setdefaul)?, 4- ?popO úupdate({x2: 2})']�} ¦Pexec(>”, locals(Kqresize1yB # Ï ð ing bug, found by Jack Janseõ 2.2 CVS development.Ÿð# This version got…ê §1ure‘0ebuh€ild, inf}e×Gp inNðrelease build. Unfortunately, provok³twðkind of stuff requires #ñ: a mix of inserts and deletes hitting exactly the right hash codes in #*aorder,WÐI can't thinkt÷a randomized approachNð that would be *likely* tošp a fail õ case in reasonable time. Led = {}Qfor i2…ange(5):É…d[i] = i0 0el 40ñ, 9): # i==8 wasKuproblem6 {÷def test_resize2(self­ñ# Another dict &€bug (SF ¡#1456209).Seð# This caused Segmentation faults or Illegal@trucsRçclass X(object”a¸ __%,__´ …return 5–9#eq7!, Þ ^)%ifî ¼™d.clear()`yUFalse !J+= (@[X()1;234ò# now trigger a䦗6Tru0d[9”6ñE6qempty_p60ed_$Ì_in_freelistšñ# Bug #3537: if an BT but Fjpwith a •u largerÖ�# than 7ç!inêrD, itÞó@n aswzFilurÔcð.$û Raises(ZeroDivisionErrorÉö 'a': 1 // 0, 'b': None, 'c d e Å($'f6 'g h Sx}�ÿcontainer_iteratortñ680: tp_traverse>�not imple 0ed ‡ÅMR¯#–Rview �sí©C©EpassF@Ps = (dq.items,Yd.value FkeysV”vK> Œ{obj = C„ðref = weakref.ref›Qw8·fobj: 1j!¥obj.v = v(+ B!xÄ0ter`*.v 0del+%, @`«gc.collect½‘0Is(½#),]V"Cycl¹@Fed")@_notäAcked (, <†# Nested–¦ón take several Y@ions uuntrack¿»À selõf.assertFalse(gc.is_tracked(t), t) def @self:J?TruI)Ågc.collect()BWCñ@support.cpython_onlyºBtest¾ _literals(\)Âô# Test GC-optimization of dict 7SÅòx, y, z, w = 1.5, "a", (1, None), [];.mC._no†Ved({}üïx:(), y:x, z:1, "1:|o"b": 2,@2, (£ , «!, û¯, ()): int@1obj»}àó# Dicts with mutable elements are always \õ, even if thoseV#54not2µ right now..8S}({1: []¿_([],)" /{} @set(Aƒtdynamics1Áally-created‡sxq’class MyO�”Ï$6pas1°=, o³@!()·,Xã1d =„´€ÖdÕ`d[1] =šµ0 y02.z.3.yx.copy()°4RwR?ÚNJd M+Q UBŸ# dd isn'Á, but it may÷te and therefore dHáwhich contains7dust belbõdìdfÓB…6 Imd’³.fromkeys([æ]R‰Ì�d.update(± ¢‰=, oŒÌˆ&B0(x==ž&=zd Àtracked(d)  òd = dict(x=x, y=y, z=z, w=w) #ö self._tracked(d>z.updateQ L?notP= ™€ [(¾¯), (z, 1)]pþ @w@ü O�ÿ @�  ñ@support.cpython_onlysdef tesn _subtypes(‡!):#æt# Dict à are always û+€class My1(;GKEpass-g:51)) !œðmake_shared_key_Q�7, nYuC±jJ:es = []øfor i in range(Q2fa = C(+p.x, a.yµz = 1, 2, 3S$j±.append(a._µ#__Ö"areturnYsì¢ñsplittable_setdefault  1"""( )÷ must be combined when ?Þõ breaks insertion order"""Üba, b =î˜2ã`a['a']"@Psize_Upsys.getFof(a„Aa['b525'b.®f'b', 20B_” Rb"b‡Su asè‚Greater(I!, ‘+ðEqual(list(a), ['x', 'yza,b'[h=b=Ø0A?del"�del d[k]ä&Porig_3 ‚aÉíg¨a['y'] # ž%is™�Bwithc:÷Raises(KeyErrorë \G´ß �%, »+8¯ìzÝ!] R# Twoöü have differentw.:6= 4ª›ŒÀ'z']) @ñ(support.cpython_only def test_splittable_pop(self):#'1"""! "ð must be combined when d.:Uk)"""9pa, b = Oõ .make_shared_key_dict(2) -�orig_size2`ys.getGof(a&agˆ'y') # —%is’TBwith÷assertRaises(KeyErroräè\–¼=›Greater(s�%, »)z8ÿ Equal(list(a), ['x', 'z']. b.y3b`# Two Gðs have different iní¥ion order.4µa['y'] = 42ª , 7¯'@‚�_pendingŠcpop a ’ key in a 3ted¤ÿshould not crash–&Ba['a21Ub±#a'Å Oitemû’>•Me1 = @ (� y;¦, ('z', 3)oq`del a[`ÆPyÆ) ßsetattr_after§$"()¥ÿeonvert!Binto5."Õ# Issue 28147ø imF _2Fcapi_vclass C2NEpass<ca = C( a.1! UTrue(f.âA_hasñ‚A(a._@7__)S# o3) c÷[it toýuH6'¥�‘OFals’$hBut C Ž˜{ Ü‰g again³)˜ Àttable(a.__d£ict__)) õ# Same for popitem()Xa = C.2 ð self.assertTrue(_testcapi.diñhassplittable(a.__€~ ._OFals`#²3²SD@def åð_iterator_pickling(®!):&ÞRároto in range(+÷e.HIGHEST_PROTOCOL + 19=0dat¸õ{1:"a", 2:"b", 3:"c"}b)Pit = Œ(3ºCd = s°dumps(it, p“ (D)zloads(d!ÚçóEqual(sorted(it), X�Y6try12°drop = nextb ïÁexcept StopI�>ionB‰continue;6@del î[©]d)NmÆRp # ¥Âviews aren'tEÄÁ, only theirv°sXitorg”.T:s()SŽ?orgŸ#°# note that›� type of "unÙd¯ ®@# is>¢ necessariß s!asDúoriginal. It iðñ# merely an object supporting?Ø{Ûcol, yieldingŒ2theyI+s �[ one.4 sþ(†!), E }4¡IsInstanceòcollections.abc.e/or@2g,Hñ(%# ¶?[0]¹ Ò¯dvaluesÙ0ÿ%#q.�_() is°À its iterato7r ù it = iter(data.values())%ú d = pickle.dumps(it, proto(M)zloads(d!øself.assertEqual(sorted(list(it)),  “9)) –n¡drop = nex] =Ó624 = Ä@ + [z]pú?øðdef test_instance_dict_getattr_s€ubclass(o%):‚F FooR�__init__3W, msg8%O`.msg =!W0f =Uf('123'ên‘K(strOEpassAXff#, ÔA(f, Gg'msg')–92f._'_[9]:ðBöobject_set_item_singleY0non?A_keyÄÝK Ë Œe1] = 1÷•f.a = 'a'ÐÉp, {1:1,/W:'a'}Ìácheck_reentranaertionµ‡, mutate½r# This ÿÒ will trigger,°ion of the \å when replaced­Ñ# by another Á�. Note t^€relies o:¡fcounting:U}Gð won't achieve its purpose=ð fully-GCed Python implementaä%s.J”Mîk»ôS__delã'¬:D{k: Tõ() for k in 'abcdefghijklmnopqr'}:'do0d[k kÊœÃ>4# Rè0 inB­`shouldFöcrash (see issue #22653�mê @['b'˜5Ç‘`I‹D^ q.update• ™?v.clear(�8zwhile dôv0popx$õÀ¢merge_and_뽡X‚>o__hash›‚return 00´:#eq87, ol!ŸWÀ)  áreturn False õ l = [(i,0) for i in range(1, 1337)],úother = dict(l)•[X()] = 0õd = {X(): 0, 1: 1}ñself.assertRaises(RuntimeError, d.update, t)°ðdef test_free_after_iterating(T&):cÏupport.check2 , B,ÔÒs=‘lambda d:G¯(d.keys())Q7_valueS;HitemR4]€equal_opXÂor_modifying,ndi#”A fixBÀseg fault re� edSñissue 27945 part 3.v‡`class )‘|__del__s‰“_b.clear(%?#eq>J!%EaE77Tru6!aChashc} ="13Áob6X()Ý1Š(,2a =�#_bý”" om‹µtÈ<àÍ5.4aÎ;int�/__15_ef __ÍÞif len(d) > 1ìLë "Çõ-} # this is required to exist so that d can be constructed!ÖJöX(1): 1, X(2): 2ä:try²©2.frÊÔõ # shouldn't crash\xexcept G:´õimplementation defined7Bpass ¢?2setV>6b>ÿ;8 À.fromkeys(d)ó # shouldn't crash ðexcept RuntimeError:0õimplementation defined7>Qpass ñ"def test_dictitems_contains_use_after_free(self):6Dvclass XOa__eq__/w, other6%•d.clear()P´return NotIÉ"ed­åd = {0: set()}>á(0, X()) in d.É"()6”ãOinitÕ'Chash×ÐÅpair[:] = []•°Ó"13‘0-†X(), 1235‰ ([ ]ÁÄoob_indexing±‘r_iternex¾vŸ¥G(int�___delÔ¤Ò~Ði: X(i) for iq–range(8)}à_™Ë_and_mutate(‚?`resultDµ Q«2if (Ž[0] == 2#'0d[2€pNone # ³ “--> X(2).ï˜ was callWÝè.assertRaises(X+, ÌB) \ÐCAPITest(unitg.bCase): # ó _PyDict_GetItem_KnownHashñ@support.cpython_onlyyLZ1_geå _k;� ï`from _,pcapi imQ R<�9Sö'x': 1, 'y': 2, 'z': 3a!oEqual(V‘(d, 'x', Ÿ@'x')àæGyGyG2G#zGzG3Wûq# not a#l¤ aSystemc,,OP, [],Aù&1)¬¡# key doesm_existl?Keyi *{}iM’QExc(Eaion): íØ#ZBadEqFeºrE ExcwX?üP7z‘k1, k2 = ‘  \q_k1: 1‹"a•?(k1‰å?ExcÝd©Ö0k2)mlh@mappšs ‚GeneralM )s()`.Basic$ÀProtocol): ð type2test = dict class Dict(´): pass1Sub%âMappingTests(m _Lps.Basic$ƒProtocolNvjò if __name__ == "__main__"€@unit[.`() """_ð) cases for traceback module""" from collections import ibdtuple#$io“StringIO *”linecache4sys •rN©P0suprg.!þ%TESTFN, Error, captured_output, unlink, cpython_onlyNä.script_helper\tassert_:k©•textwrap =0 ¥w_code =( ('À', ['co_fileD0',  "]);Lfram<=f[8’f_globals 0loc F+tb!tb@4tb_M@'tb_Ÿ noB´tb_next']) ©TÖC&(¯.:Žð# For now, a very minimal set of ñ s. I want to be sure that #„pmatting3aSyntaxÔós works based on chang¶Q2.1. BÐdef get_excep­ó_format(self, func, excµ•2try %!()OK5š as value0freturn;.s„nR(exc,?\,lsM`aise Vføñ("call did not r“Vion")÷s- _e¢_with_careúï�compile("+Ãfact(x):\n\tÇ�x!\n", "?Oexecd!_2`f?1 +P°bad_indentaºS¹Pspam(¸Ã print(1)\n 2)»ÀŸnon_asciiu!'P8ð = "\u1e54\xfd\u0163ï25\xf2\xf1" +'> îBÖZí`err = ü..9, §Ûu;ÿEqual(len(err), 4&@True!±[1].strip()Ę"7ð In("^", err[2]) # third ÔQ has Ì —8Ä1].find("!")J0^")Tð in the right place ñ err = self.get_exception_format(ÿ syntax_error_with_caret_2, SCEB)5]ÐassertIn("^",�ñ[2]) # third line has r:ðEqual(err[2].count('\n'), 1) # and no addiÚ`al newXN Ä1].find("+")˜@^"))Zõin the right place TY*Ÿnon_asciiaÿ±def test_no§&):}Wxc = t!("½ò ", ("x.py", 23, None, "bad ä&")žÂ¢traceback.#Wonly(eV, exc@Þ¤0len¨O), 3&Ê«1].strip()ž`dÿ°bad_indentaÛ Ý QI†å 4Ÿprint(2)"5 @  …_Û)ÛeÙD A"B£pB§&se8 ¦°# Test thatA€ôs derived from BaseEœR are Ž2tedñöe = KeyboardInterrupt(4olst = Ö æe.__class__, e> ²Ímst, ['rR\n'])I³ _A_2l_str__�5 X(ùâžY_;61/0àtraceback.formó at_exception_only(X, X()) ÷ self.assertEqual(len(err), 1&õ"tr_value = '' % X.__name__a!ifõmodule__ in ('__main__', 'builtins'):5�1strL! =A� [Oelse4 '.'.join([•,L]ä ôerr[0], "%s: %s\n" % (— , 1)) ºðdef test_encoded_file(bÛñ# Test that tracebacks are correctly `sed for M€ source Tsö4# -8ö line number (Issue2384â,qrespectG[3ing.F3975.°import temptò, sys, subprocess, osø®×# The spawned&ð has its stdout rediåðed to a PIPE, and%FNö›ñmay be different from the cur÷interpreter, on WindowsM•at least.Ä' =«ñ.Popen([sys.execuâu, "-c",:Ÿ"4Bsys;Ä(Mû.Ó?)"]O7=r.-Šhstderr;fSTDOUTÞ]Å*3 = Ö.communicate(/SoutpuÙ–=þ(Eà'ascii').split‡fs()[0]0do_R(firs%ñ, message, charset,Å'no1mq# Raise÷3Ia¾EQcatch'² -6try9WQwith ùÅTESTFN, "w",=™R) as TDHÿ.write("""{0}if 1-1,;¬"rüöRuntimeError('{1}'Ÿ*¯""".formatn°.ÿ)Å{¶“ ‡B›37Áj0.de…(˜“:ing¤ sofinall#runlink(÷ìrøœúËì1ed ^­'çùlashreplace' handler„8_å=">eÏIÀ  ø'backslashreplace') #ð# and we just decoded them with ù output_encoding.Añmessage_ascii = &3ed_.S(D)) Eóerr_line = "raise RuntimeError('{0}')".format([s ÏI0msgHB_: {0}@ Šñself.assertIn(("–`%s" % ùno), stdout[1],;W�"Invalid-p number}ö!r} instead of {1Ž DHcJ:no)è§STrue(0p2].endsº( ³)¦Ptrace"f©/!r«E2], s­Q3] ==4?msg¥e õ¤*3¤Gmsg)‚ðdo_test("", "fooÏF", 3Ëôfor charset in ("$°"iso-8859-1;Putf-8 iGBK"):à%ifC3== B #ÿ@textÄ� @+elBd@Û\u4E02\u5100"I/se8Šh\xe9 ho4("# �5}\nYrÕ,ÿ6, 4Z]¯!shebang\nh25h_ \t\fd?ó# Issue #18960:*õ spec should have no effect—8x=0˜PGBK\nP–1, 'eC', 5Èñ@support.requires_type_collectingg@def ëu_print_ÿ�_at_exit(X³Íð22599: Ensure that it is possible to us%e Wq module{ä#&ðdisplay an exception at PythoiŽ0 =  wrap.deden© ™ imûE sysko� tpclass P Eˆ0AtEgobjectN@Œ__init__, >try]™x = 1 / 0­ “H¬ð.exc_info = sys.e¿xc_info() ƒ# self.e*ÿ[1] (traceback) contains frames:Hñexplicitly clear the reference toj1 incurrentPr7wbreak aL_cycle;Ñ� = None %Àdef __del__())Óð.print_exception(*60)bi# Keep¬ð€module nF"paAcall ©destructor°R# whe/m?¹is unloaded*pobj = P«EªgAtExitû6"""¡rc, stdoutöerr = assert_python_ok('-c', code:ôexpected = [b'T,á (most recent Û‰last):',«ˆð b' File "", line 8,%�__init__?óZeroDivisionError: d¥ by zero']{¶àðEqual(stderr.splitwTs(), Ü×-\test_N:¡output = SÊ'IOvJœ·%, p("proje1"),Ñr, file=qA�™.ç*�.getvalueå"a%: aÕ\n") class ÕðFormatTests(unit .bCase):ý&Gsome%‡ ‘raise Key¨s('blah'd$@co1nlyÒPecheck_<!_f‰²,_�nup_func=çk`from _¨Æcapi import IÊgv:try¹.Í^É ;qtype_, g¥, tb = sys*z)ifÇq is notä W-5# CRSinner�,4Pthis í+‡(¶(tb.tb_nextÐ- fmÃÒu\n' + \FG v''.joinL.Ãz_tb(tb)„Ô_?X£¾2(tb_FHÇ! =(_ø ®0# C|€_tb and ¾ Ræs.âwith captured_R"("A‚") as tb»¼Iÿ _ tbÿC=< À with capturò ed_output("stderr") as exc;: ùtraceback.print_exc()&–excfmt = +_forma,ëile = StringIOMDoPfile=f6ile{Jelse¯öraise Error("unable to create test£! s€5") Ì÷# Make sure that Python and the<rmodule æ0sam55ingOõself.assertEqual(Ûq_fmt, p^ ÔÁ# Now verifyX’_tb func ¶]bÁð.getvalue(), tb;j ?exck-Y,Cm Í7ileI� …õis properly indented.!§tb_lines =ia.splitw žDlen(@F), 56`bannerë_5[0]sñlocation, source�,6-2:.vRTrue([ä.startswith('T{&')ƒ 8v :o File7 £ :! H=Û1def<_Àß(‹)ƒn.check+×L_òü_cleared_frames`0# C]œ�†ðting also works P1 a RQ()ed TÑ቗nup_tb(tbÈ Rtb.tbˆ.(r0è,T òbstack_3ÚVó_&‡Jás. Note we havÍ�use _getÏe(1) toÕq# compa¿!em‚out thisÿ` appeax1 in` W6Pcaptu‡ *"sth÷/ª%ÇX(sys.¬Åt,ÚL , B!=sIY u°c", 6­Ë/stÍÔñ|�"".join(h)y� _õk7elf—$Gprn(°/àwith captured_òoutput("stderr") as 7: Uprn()òlineno = prn.__code__.co_first-òself.assertEqual(`ñ.getvalue().spli7µs()[-4:], [@†à' File "%s", aò %d, in test_print_stack' % (__file__+lno+3),P ½=()'i?prn\1\§traceback.œ n1]) “õ# issue 26823 - Shrink recursive Ks0µdef _check_$_$�_display(vÖ, render_exc)Ðñ# Always show full diffs when thisVR failtƒð# Note that rearranging0ñ ngs may require adjusting±=�the relatÓÁqnumbersżhe expectedð?Íò.maxDiff = None=0# C@ hitt j>…on limitˆ='f( A#f(‹ ïwith captured_&_fQ8:tryZ‚except RÜponErrors>exc>½{KNelse/%´D("no@Çon occurred"æ�0no_MfÁaresult-(Jˆ$'TæP (mosùcent call last):\n'3fÊ{¥}Ò{–1+5}Üç _'—V±ð# XXX: The follow¼qð changes depend on AtherMcb€# are ru.Qrough(qinteracâ ¡preter or V)-m ì# It also vari�Æ¡platform (ÛV size…‰ðFortunately, we don'‚‡ðbout exactness here, so' us�9gex“âr' \[PrevioushPrepea˜ý(\d+) more times\]' '+ Ü—: maximum�`depth HededA¡$=  &·ƒactual =¶/_fX1À# Check the óoutput text matches expectations ð# 2nd last line contains the repeti1e count6óself.assertEqual(actual[:-2],i!ed)5TRegex5 46-2]3#š±an have add”"alà�appendedi2In(÷ƒed[-1], ©U-1]) 1s# CheckôrcursionóÔ is roughly aDlórec_limit = sys.getreB(Î6öIn(int(re.search(r"\d+" õ2]).group()), range(lU-60, )Ê‘a known („Ðed) number of9â‹ve invocadef g(ïU=10):%1"if dreturn:&-1ööaise ValueError{âwith captured_· ("stderr")s *_gt:tryggmgexceptxP>exc:rB\r_excC>lse/Ê fail("no vØ eÙ` was rî'd"—[ò no_g = g.__code__.co_firstiaresult-(Ïòf' File "{__file__}",¸{Eé_g+2}, in g\n'>'C § &dµÂ' [Previous"Íÿated 6 more times]#3d ÿu c'20tb_Î: = ð'Traceback (mostÊ�ent call)():QðÏ7Ï _c_ÀDve_tpŒ_display_T8g()ÈzÉÔ$+ ßa).spliýsu¡N _gSb(2��ˆ‰ê€2 differ?æyve secth&: §›h‡À h()  ò except ValueError as exc: Érender_exc()Nelse/ðself.fail("no v`! eaÕwas raised") Jòlineno_h = h.__code__.co_first-aresult-(«ù'Traceback (most recent call last):\n'3ðf' File "{__file__}", r {–ô +7}, in _check_recursive_tpŒ_display_'—Vÿreturn h(count-1dÆÂ' [Previous™ürepeated 6 more times]&d3d gºúPexpec‚5= (�#+ qg).spli¸s0ñactual = stderr_h.get(2HÂassertEqual(C$, �D�def testœppython(L)«.Ò(ä`.printu"@cZQ_onlyV‡ .Œinternal‘`from _ưcapi importŽqeption_gUk•Ù€exc_type)!c_c tb0ys."GinfoŸ9o('?ü9ž0³ßÜ_format_stack%Gfmt(ª˜î� D�‚1 = D.Ê`áuU…[-2:], [U˜?$%s7!%d- ê  ÆÌ™mD % (Šˆono+2),v?fmth.@?\n'y1y]Ç÷¬unhashable×Ýåuclass UOE©Eion( !8a__eq__{x, other%À retur“n True ÷ex1 = UnhashableException('ex1'))2)2)Etry:6fõraise ex2 from ex1en C TXOS,â_type, exc_val �tb = sys.finfo()1òwith captured_output("stderr") as *_fØ ion_print(\7valZwIð_f.getvalue().strip¦plitlines(˜ÿ self.assertEqual(11, len(tb)&ôcontext_messaged, tb[5]9OIn('):Û'93919Ä10]) cause“A = ()°"\nThe abovG ñ was the direct <" "2!of�followingà×›:\n\n") n0Dur4Phandl N �,mvanotherd• occurredmòboundaries = re.compileàñ'(%s|%s)' % (re.escape(Ñ  ),7 ¼!))<†lass BasÃòReportingTests:Ä…def get_�(Bù"€_or_call)ÄÐif isinstance¾.%, >9ifreturn"d²% å£/û u}e²Tyü�zero_div÷§”1/0 # In !3dcheck_9W, msg>– =/.s§ �(1°[-3].startsWŸ(' File'¹€ ¦3', K2}n1nõZeroDivisionError')N1‘B0±test_simpleþù µ¢eMarkerÛª q²_²Ue = _9ÜŽæ·rÔ?(e)g EO), 4×!0 ŸTraceback‘: ZÈ&à/ P©<¶ðcause(self):  ðdef inner_raise(): :tryùself.zero_div()1þexcept ZeroDivisionError as eKuB Key%efrom eQ�?out� ¸• # Marker>ñ blocks = boundaries.split(Á·get_report(d)Ï&òassertEqual(len(UO), 3)%û[1], cause_message3echeck_I6+0]'ƒOIn('ñ3', ;A2]) ÿ9²test_contexòÛ M šö6 W< ñ­‘† ‡ ¬ê…kìn€_suppres{êø Ù �¤EÊ5ion¥àØ÷Ò6NonÕB"_YUe = _@lineϘ¾"e)× �(=À%O), 4eQTrue(#ÿ [0].startswith('Traceback'":1:o File7Ö52', ŽÚØv3v U�Kk›?and&Ò# When both aÊ@ and ìó are set, only the&†should bö±# displayedD,F.q muted.§ê« û ½TæP{ ž€ÄCtUxyzzy¶'jANameÚ ¹"eú]Àself.get_repóort(outer_raise)) ÿself.assertEqual(len(blocks), 3)%û[1], cause_message3ãcheck_zero_div[;[0]'ƒtIn('inn¨ã() # Marker', qA2]) ¿’def test_ recursive(Ô!):$æ( U:try\.ÎÅþexcept ZeroDivisionError as eh3Uz = e®­B KeyCKfrom*o#fH+z A(4‚ 4‰©�ñ = boundaries.split€�.get_repzc²# The first7v is theLd ±èòŸ9HSžÙ0NotÜ?1/0+±csecond²f(apart¢g$y)̳Q# re-©â$Ùï¯xÚ'c^Ÿ€syntax_eá_offset_at_eol*vÑ# See #10186.EmIe�Þ! S[Q('', ×0, 5, 'hello'ëamsg = »�"e)¶flines(Ñ(÷ msg[-2], "•&^"/¥÷exec("x = 5 | 4 |1Ž5'Š,^'—M_nonC# A õ( that looks like "None" should not be treated specially¦?err^E@ion(N�_( : )†\n', err`_ '7îa=¼¶ ²Wá class PyExcR]ÕingTests(BaseFðReportingTests, ò unittest.TestCase): #ñ2 This checks reporting through the 'traceback' module, with both Lù format_exception() and prin.v ‚def get_wt(self,  X@e = .&\!e)?"Ås = ''.join(´.›õtype(e), e, e.__+6__)Zâòcaptured_output("stderr") as sioKpI.øs ·êðassertEqual(sioú¦value(), sžôreturn s class CExcR¿ëts(BaseE‘ /, ‡built-in !by¹interpreterÚÑ@cpython_onlyáì`from _ªpcapi im‹ õ_SKkÀ ¾ k(fnŽyRLimitqT²A''' #( l2’ argument8ÔrIt's enx o ° extact_tb, r Qstack^ ÚF '''ZÁlast_raises1\ùk q('Last ?d')D2D¯ e939 /2(949 3959 49P~s_frame/‘ sys._get%C .CBelf.5Tr  CN QN XN fN mN {ã0_ex8!t_Ø ºk8&5(bL—(**kwargsó÷¹ pÐ.0|m%, =¼8[™8p(actual™Øpected, ignorÁ=(>8"[:.]AÕA @8+1:CÀe+1:])  ðself.assertEqual(len(actual), Âexpected)) 4õ' with support.swap_attr(sys, 'tracebacklimit', 1000):=E nolim = ex.9t()•qGreater—5O), 5.ÃU€Q=2), :Z[-2:];ùzExcept(<6100>º100:], -5-1F¯�-‚/:2�-‚R:100]•Ñ)‹Î[ƒ€del sys.‰· �' UI = 2Y:X´4ï3;3ï; -<+:3&"O = 0Í uO/-1P-“def test_¹@_tb(çp:try} ×.last_raises5e :ion: exc_type, ±value, tb =BGinfoOŸš—(**kwargs› ureturn .0ÊEtb, 7aÐrO, 5+þýˆ\ }Ëo%ñs -1"ë_¡8 6 ãXVùQ1 ƒ… P <º(:O-‹ÌPMÀlf.assertEquñ(al(extract(), []) def test_format_exception(self):%)6try  õ.last_raises5()-F$ EM : exc_type, ðvalue, tb = sys.GinfoO°# [1:-1] to3õlude "Traceback (...)" header andˆ#/Ð r q#‡**kwargs÷êpreturn =q.,´` Ò%, RÁtTõwith support.swap_attr(sys, 'jËlimit', 1000•„nolim = ¼}_�ñassertEqual(len(3o), 5+1. U€Q=2), <O[:2]:$10;7-r?-2:s-t$ª>1del“ �;' i;ù:ys.NO = 2R†3Œ?[:3M;--3‰Ì0Ì mü /-1PÅ class Misc  Cases(unitéP.TestP#að # Check non-printing func 7s iþr module7ÑD\l_clear:couter(s8gmiddleè* 30inn@u;* ): = 421/0¦8 Æ™Yº TÚ"_,8©?¢# Initial }ñion: there's one localP1he Âu frame.C_ß = tb.tb_next&: ŒõO1.f_Ss), 10# C¸á“sY—.á�Is(tbELÛövariable dict should now be emptyê°0kùkho_stacksðextract():  ðreturn traceback.ex £t_stack() (£ result = !flinenoò.__code__.co_first"Lòself.assertEqual(]…[-2:], [(|²(__file__, F£+2, 'test_Š«B', 'G‰_()'),N C1, 'IC Qð ]) class TestFrame(unit¢.qCase): ‡@def €_basics( !):ìá±cache.clear hQ.lazy ö("f", globals()¯7f =Õ—rSummary3¦1, "dummy"4Ž —f=m:`, '"""ä¦ cases foru· module"""'˜ d|tuple(f¨kA&f,ž.   ³&r# Sinceø .__eq__ doesn't support rp, the eý5ityð# operator fall‘Is to;_.5S& f£&ûIsNone(f.locals)œ]_‹ t�, lookupgo=Falseª®A, f..(£þT>xÇ  f.� =�explicit¬ à!Pine="c¢ !* ŒSÂŒBwalkD °¯wdeeper(¦27Plist(0<J´÷O1 = .D2 = yª Ä¡len(s2) - V1), 1 /@s2[1`,s1µ¸,tbÿ6tryœö51/0Ž�except E:ion*÷_, _, tb = sys.exc_infoÍsXtb(tb: ,ìë�¥TÆËðs = traceback.StðackSummary.extract(ó eback.walk_stack(None)) ö self.assertIsInstance(s, =S8\!) :“def test_k\p_limit(S!):(e?s =M©!, T/=5²ÿEqual(len(s), 5� ¼ookup_lines¤±cache.clear (sbupdate ÷'/foo.py', globals(Yc÷#Wcode(,†'method'_f+�frame(c, ¥&H÷iter([(f, 6)]), lóV=TrueNÓòÄePs[0].5ï, "import sys"s Èup_deferred_‹~J~GFalsK , {}·n'.-yL bŽ�from_lis”45[('áÀ1, 'fred', '6')]Ó Ÿü¢[' File "N"p 1, in U \n(WY\n'],>€s.format[{©r_edited„ \6A(êg[0] = 2¦Ñ s2Ø2rac„G.|sH-2H2Ial_smoke?á# For detailedô¢s see the šaâ, which consum%Esame # .ž<̵h�ˆE0locûöÎú.çéÀst_frame(c, óglobals(), {'something': 1}) ðs = traceback.StackSummary.ex÷t(iter([(f, 6)]), capture_locals=TruePòelf.assertEqual(s[0].+ ˆa'1'}) ‹³def test_noXq(self):¬òlinecache.updat Å('/foo.py', ï�cÝVHcode,' 6od'+f+wframe(cP ·?*rà*LNoneoformat Bå·_inner(k, v>BUa = 1PYb = 2oreturn 3I)B`walk_sG(Ã/—, limit=17 = ¿G3, 4 U �Ð[' File "%s"[—ne %d, inR9\n'5/ '¸*Obk_k = 3÷v = 4\n' % (__file__,Ö0.__Û°__.co_first'Hno +?êR], s.Aô()) class TestTþàException(unitŽ. kCase):§\smoke£6try°u51/0ue^ e *€exc_info4ys.(P!exÒ±.»*; :bpected›ìEô·w â4tb(iF[2])m ÖP, exc¬oause__.oontext0 TFalse_¯suppress_c:(exC¸žó"0]1?typ &tr+1@s†Z¹mb_from_'…JÂð# Check all the pa©°ters are ac½5ed.ºXGfoo(Do” ±0BŒ³_ as e¸!Ë.qƒ>ùàmit=1, lookup_ëlines=False, ùcapture_locals=True)%ôself.exc = traceback.T ôException.from_e(Dtøe, limit=1, lookup_™ ‰ óexpected_stack = –r­"cöassertEqual(None, exc.__cause__û. oontext0 p_¯suppress_c: í¢øž²exc_info[0]17typÍ Ò@str('8S1]), 1)) 6‚def test(A!):Ñ6try 51/02kfinall:Š#å yszÙ(ý.2P� (*,è^N5 = Ò!(""+Xraise)€uh oh")  6ô- 3—í Ñ~ á ® K &SJ Summary.ex^t¶óvwalk_tb262])mÉù d'(_,) , ‡Ie.¦ZØ«3i5² ü0±­ï³Ìˆ}Ý 4àNone, exc.__caƒuse__) ôself.assertEqual(exc_context, exc._7 TFalse1�suppress:âexpected_stackC ¥ rinfo[0]1¶Otype41strÝ8S1]), 1)) ðdef test_unhashable(!):1uclass U ¥Exception( .2Ua__eq__L{, other%)²return True�_ex1 =pV'ex1'î?ex2)2)6tryÏc`raise @…from ex1îeÞ C TXOS,_­p = sys.ã(öôc = traceback.T Ž$(*76ðformatted = list.&()'ûOIn('õ:7R\n', >oted[2]B1B,6]�Qlimit?8Y—recurse(n:Jif n£.&-1¤Nelse/51/0  âL&10KÜ| SˆÎ‹xÒ!, &=5ƒCP Sb Summary.ex9%t(å=Ppwalk_tb!ŠÞv*Dƒ¢Ón¼jÌlookup_linesá±cache.clear ü5 = k†("uh oh" GÍ÷code('/foo.py', 'methodf$+Òframe(c, NoneQ$tb'|tb(f, 6!e»°˜, e, tb, =Dr W {}}!ne ../Rupdat%ùglobalsã¹!c.©@[0].R�, "importƒ"™ ocR©‚8�.ŠeÎHàglobals(), {'sð omething': 1, 'other': 'strC}) ötb = test_tb(f, 6, None!0exc"¤raceback.T ¥Exception(MT÷ , e, tb, capture_locals=Tru_úself.assertEqualMÒexc.stack[0].@W, {'sà7'1'â"ãA"}) ˜2defà#no‚(t!):²òlinecache.updat ÷('/foo.py', globals()5 = ê†("uh oh"3UHcodeK'™6od'+f^+wframe(co ë1¸<Á«•" –‰)Hft|_headermõ# do not print a 1 1† if exc_!is“h°õ# see issue #24695­õ œ("haven")ý Plist( Õformat()), ["I!: Ið \n"]) class MiscTest(unitk.kCase):¤ ôwarnings _DUMMY_SYMLINK = os.path.join(H@.get ç)),‹Z `ð TESTFN + '-dummy-symlinký¼P¿É/er¿ \setUp¼ñ# create empty ðŠ fpËJpen(ŽX, 'w+ wp.closeú¾�teardown_Vðs = [ support.TEƒSTFN ] õself._warnings_manager = support.check!/(): §.__enter__+_t.filterõ('ignore', '.* potential security risk .*',v· ‚RuntimeWÉ!) 1Ðdef tearDown(ê!):>1forÐdown_file in $.2s26yunlink(+Æxit__(None,  ¯üstNoArgFunctions¹ä# test posix f&õ which take no arguments and haveù# Ãside-effects;öwe need to cleanup (e.g., fork, wait, abortê÷NO_ARG_FUNCTIONS = [ "ctermid", "getcw bouname"Õ "Ðs/¯getloadavg4Ugetegz%eu ogroupsJp>CpgrpŠp^OsyncO ]�Awþn = ká_á± = getattr( , BA‹^"if7ais noth [+J(©÷assertRaises(TypeError,b3, 1»P@unit˜ø.skipUnless(hasµÏ'getresuid')ü'G‹sk.82()'ðÙ6st_³ß®user_ids =E 4.ç¤Equal(len(:B), 3n¸0val·! TLrGreaterSoval, 0'g'$?gid'§' (+ý5 (;)"*EsQ$8*õ*„current_þY Isè¹.^*P)oÿ# -1 means don't change that value.Ãjð-1, -1, -1)) ÿ' @unittest.skipUnless(hasattr(posix, 'setresuid'), 'Gq needs :.8A()')9@def '_ñ_exception(self):(dñ# Don't do this8õ if someone is silly enough to run us as root.Kócurrent_user_ids =¢gÚ( xÌif 0 not in 9ž*8newS(.�[0]+1, -a;ìó.assertRaises(OSError,š!8, *h!) Ö¸g¸$?gid¸Â®ü_groupd3=ÿbIsNonel2,*Q)?Á# -1 means d$öchange that valueük ¨)^uZ³:5 = /3gidU½Ainit9sÔ "­Ô6os.62()"�Òsò# It takes a string and an integer; checkÀAit rq a Typeõ9ÿ # for other argument listsó]H_®Ç[·•7 , ·=&s3, "fooE~ >Ä, 3, object(¼Lð# If a non-privileged þP invoŠó it, it should fail with ‡pVEPERM] if os.getu Z != 0þ:try’@namev wd; pw=p_ `)).pw_'{8A KeyYT# the¨� UID may¿òhave a pwd entryXÀ r÷aise unittest.SkipTest("need a pwd entry") Itry:ú posix.initgroups(name, 13<þexcept OSError as eLñ self.assertEqual(e.errno, k.EPERMX/lsIåfail("Expected{pto be rVd by »1") ß@ñskipUnless(hasattr(ðÑ, 'statvfs'),4  '` V!s 8.62()'Ç@def %_)BTrue~F¯os.curdir)ºfl»7¼®½ò fp = open(support.TESTFNû. RBðaÆfp.fileno())FJ9ê(8kfinallÔŸfp.close(S�truncateT8UÛVS, 'w+W \A# we�ð to have some datap Ï‘fp.write(Ë^bVZlush(‹êfP}6, 0,7kP'), "Oçt#()Ðu cOwith¹c ')½&fp¤ ($€ &‡Š1getŠó os, 'execve', None) in os.oJs_fd. ()ð%ó the fd parameter%{{Lforkr0os.kFwaitpidIL·fÇ ¶o"s.r0ys.'putable,†O_RDONLY‚ #0pid³Å„ß1if := 0üŠùhdir(os.path.split(s†F)[0]}7 ¬Šve(fp, [6ñ, '-c', 'pass']ËzenvironMe ðassertEqual(os.ôwaitpid(pid, 0), 3) …finally:áos.close(fp) ð@unittest.skipUnless(hasattr(posix, 'ppid'), "+q needs .2()"|P œos, 'forkK0os.F@def j_^Vself)Ìepid = 5Éà1if 6= 0-ùòhdir(os.path.split(sys.executable)[0]Å3â"+ve-:, [>ð, '-c', 'pass'],ŸvenvironUJelsešZres =Kv`P_PID,Ð,vWEXITEDN£Â.assertEqual ¿res.si_pid)ç—Áregister_at_¹‡¡Pwith ›÷$Raises(TypeError, msg="Positional args not allowed"Nè=os.uÆlambda: None|AqÀmust be callv�before=2rW afkóin_child="threepòM€Ïparent=b"Fiv�*é!be¹sè,uöv}ds~"pInvalid\O was[ð# Ensure a combina”C of ?Cnd iKpis an eÄ.w„ *¼%, OÒ½3H×tÁ ß.&''×A# We΂ actual Érgò s in their own process so a"tohÀ # polluteó) this one. There is no way to unregister for cleanup. õcode = """if 1:©import os ùr, w = os.pipe()pfin_r,  % &4os.—ð_at_fork(before=lambda:_êwrite(w, b'A')hBÿafter_in_parentKCK_childJEJ× IB'),w ×DK× F× –2pidñ© ‰1if := 0>ÇB# At¡qpoint, Ì-Gùers have already been executedJªos.close(wa# Waitàúùptell us OexitQx(ªNr, 1W@os._;*(0Nelseë>tryžº ÿwith open(r, "rb") as fM1‘data = f.À œ °assert len(3€) == 6, 4‚# Check ¶©¯ callbacks6jZ@[:2]i_b'BA'mlasortedÙA[2:]Ýßlist(b'CDEF')| ³`.index9A') < Vü6EI’ofinall=§ *!'ò5"""œÕð_python_ok('-c', ä)Äð@unittest.skipUnless(hasattr(posix, 'lockfB"*q needs .2()"„@def #_Vself)¸f5Ü0supM€.TESTFN,ߢO_WRONLY |RCREATY� Q3os. dy áos.lseek(fd, 0ewSEEK_SEX\Í,–F_LOCK, 4…-�# sectionZê Ÿ=fy=F_UNë /fd¥Àx, 'pread'),ð "test needs posix.pread()") def #_aself):ð fd = os.open(support.TESTFN,‚O_RDWR | RCREATW=6tryJðos.write(fd, b'w'/"Qlseek"0cwSEEK_SEX)¨ù.assertEqual(b'es',ãfZ2, 1)dÂ# the first õó) shouldn't disturb$•le offset}%te}_|ynfinall@clos!) bP@unitñ.skipUnless(hasattr(¿1, 'µOv'),ÝvÞ v(7ßYë1tt2t3t5t6t6t8íñbuf = [bytearray(i) for i in [5, 3, 2]]wÁ øÔv6ºbuf, 3), 10ø ;@[b't¡'�!3tï5t'], list(bufÂDŸRWF_HIPRIŤv_flagsÌ×Ú‹páל4Ð^ Ž?os.{rµèPb'xx'hª Pb'txxeA'4eDo(¿).*T3"xxéâŒnŸëà[b'test1', b't÷t2', b't3'], 2) ù self.assertEqual(n, 10) %ÿ os.lseek(fd, 0, os.SEEK_SETN ñ b'xxtest1tt2t3', posix.readMF100)CŒfinally:}ƒclose(fd—P@unitVñ.skipUnless(hasattr(að, 'os.RWF_SYNC'), "0` needs¿"}@def !ð_pwritev_flags()Ž@fd ==ñopen(support.TESTFN€O_RDWR |$gO_CREA.trØmCb"xx‹œtn•ºN@ [b'Î1÷ ÿªÿþsï T YÕ_fallocate'),`'.-#()—"Á!5$oWRONLY&� –ˆ©½öexcept OSError as inst½(ó# issue10812, ZFS doesn't appear to Ø©è4I0so }ð Solaris-based since they are likelyV@haveq.{G�ó33655: Also ignore EINVAL on *BSDX±{is alsoGpoften uƒZthereg!if ¡.errno == .dù and sys.platform.startswith(g²ð('sunos', 'freebsd 3net  Dgnuk$)"Geraise Ë’SkipTest(”€may failø³filesystems’DJelseç^¿Y |31106 -!()/€ not setFPor in "nos›Ô[‘;_Ý » ~„ X1-42áY b!bOBADFœ�0Odvis¿Ðdvise()") ó def test_posix_fadvise(self): ð fd = os.open(support.TESTFN,•O_RDONLY)26try?F`.fQfd, 0ö.POSIX_FADV_WILLNEEDRkfinallVÑos.close(fd) }P@unitÒñ.skipUnless(hasattr(g1, '‡1'),:¦":q needs % ²")"‘7l_errno= 1-42 #0,x  úexcept OSError as instq!if.”A != j.EBADF*ù_raiseB°os.utime inñ s_Ã53fd *6 6Œ_with_fd0`now = m.(r¥‡6€4Wñf, None}&€.assertR1as(Type…¸? , (AGH*?nowG1�Jnow)Ž øP(int('$, 2 ¢3 Z0OValu1GP, ns=„/, V4"0)T Ô¬C–Z½0V\ ã& -g * 1e9)E š¤HÛ@)þùollow_symlinks,  :nof;"oˆ¨± [W=Falsæâ _î/, gGgÌ)f$ÀError, posixó..utime, support.TESTFN, (None, now), follow_symlinks=False) RposixI(HBint(F Q,?now˜0ÓÔñ@unittest.skipUnless(hasattr(íà, 'writev'), "+q needs .2()"$@def $_aself):kBÍfd = os.open@°os.O_RDWR |$rO_CREATX=6tryJnMkpfd, (b'~’1', b'tt263')F9–õ.assertEqual(n, 10) ¨%�os.lseek(Y 0,“wSEEK_SE”) N…stt2t3',)AreadK;10)jù'# Issue #20113: empty list of buffers should not crash­ ™Size =€&*[]êexcept OSErrordH*# =t raises1ó(22, "Invalid argument@ù# on OpenIndianaÂ%IpassNelse� qvsize, 0Ökfinall/³os.close(fd�þ¹ýü¦ûF"oszR pRÅùbuf = [bytearray(i) for i in [5, 3, 2]]žâ Gÿ6Bbuf)ZŒ 7[Á'¶"],‘s�Cbuf]ÀRAR×@ <?Ûidup'),8·± Sbdup()'ÈP9RpJ:]àtry: ÷ fd = posix.dup(fp.fileno()) úself.assertIsInstance(fd, int+pos.clos‰finally:U#fp*!) ñ@unittest.skipUnless(hasattr(¥Ñ, 'confstr'),4¤ 'Ec needsÝ62()'”@def %_á)ŸðúRaises(ValueError,Tâ, "CS_garbage"_‹C’Equal(lenÆ.u9ÿPATH")) > 0, True Odup2 3²ö fp1 = open(support.TESTFNä?fp2# +tröÉnU2(fp1pU, fp2c:1;lC}Fòos, 'O_CLOEXEC'), "45os.Ò@òrequires_linux_version(2, 6, 23¹_¬oscloexec(]y?os._!, €qRDONLY| £]íNÄ.addCleanup(uL, fd&¶PFalse'áget_inheritabl¦,¶/oEXLOCKv$O_7¶ oexlockB (&WR4q@OREATÞ#OSÛ“$, ðóm®z@NONB0}«(ªÌ;if êP"O_SH;"”ó´¨ š§ ] fb<$0R ‚¢(3Ï,$:¥ $Oossh¥!ÅÚÈ r†!fd]_Œ `ÀT) oãs.close(fd2) o51) õif hasattr(posix, "O_EXLOCK"):'Eù fd = os.open(support.TESTFN,)-Áos.O_WRONLY| SH] VCREAT¤5ô self.assertRaises(OSError,|/, }Q7FO_RD‚ß‚@NONB� …-,û@unittest.skipUnless(:�'fstat')'Cq needs p.42()'�@def #_ † fp‚<í:tryµBOBTrueåuÆfp.fileno())CG6Þ(5 ø6»¢Regex(Type .hñ 'should be string, bytesðÿ PathLike or integer, not'dS¨{, float¯pkfinall+#fp8ólò3ñBð½* €¿4»os.fsencodeÀ�BRWarnsưDeprecation¨2SË5Ç oarray(¿ €¾…¶AFNoneS”sMlistøÄ¤xé ²�òmkfifo'), "don't have 2()" rƒhlunlink?Œv xÃTE- Â¥.S_IRUSR |BWUSR•Sñexcept PermissionD_ as eãÀskipTest('poó six.mkfifo(): %s' % e) ðself.assertTrue(stat.S_ISFIFO(po?ñ (support.TESTFN).st_mode)) Lò @unittest.skipUnless(hasattrGô, 'mknod') and ]`, 'S_Ir1'),Ož Á"don't have K3()/8"Ò@def …_Ý%):QÄ# Test usingAÐ to create a ‚÷ (the only use specifiedF¥by POSIX).lunlink-'20 = ôep|VRUSR EWUSR:6tryÉ›è œ , g2, 0-úexcept OSError as eNò# Some old systems mðallow unprivileged rs85use f#UB, orCcwÆdevice nodes?>­ŠÑIn(e.errno, (ƒ.EPERM, UINVALgACCES)î+lsß\æ*¨ó# Keyword arguments are also ð/. à Tpath=I�å=êU.=0<§dir_fd=Nonô/‹$ P'), '¸r needs Ü2()'ØLmakedevOR,6(ö.Hst =Š €–1devÓ1devúOÐösInstance(dev, int@(G‰brEqual*0_QUmajor”%JIr)t,:ž—œ)~!, †±Raises(Typey,P2q, floatE>2 T(Valur�Overflow�)‚(-1`(in`�Ò m)`,`)~!, að `Àminor, floatƒ(dev)) ÿself.assertRaises(TypeError, posix.minor2 T(Valu4�OverflowC)De, -1) {ð# FIXME: reenable these tests on FreeBSD withµ kernel fixEðif sys.platform.starts2ñ('freebsd') and dev >= 0x1_0000:H øskipTest("bpo-31044:�‘CURRENT, é() truncates "NRq"64-bit†Pto 32"}‰cEqual(} akedev(maj’u ),G’ ÄGr, floatN)ÄI#‘P#I(;!=Pdef _4ð_all_chown_common(T", ð func, first_param, stat_)A"""C=’ code for@1, fHKl uFs.""øŒ`check_\—(uid, gid`´{Æ is not None†&F& =©(À3*ïÌC?A.st_ˆ?uid3g»Ôöuid = os.getuid(Mgg#ÍÒ a successfulOU call[OŠá!, ¸@*]üÑ G"-1†)F �ÁkéÞ if¿Z == 0Øð # Try an amusingly large//Kõto make sure we handle½{#3�nsigned v‚Qs. (Lû lets you use any>1uidk"Ðlike, even ifgpy aren'¬ffined.ê| Lü This problem keeps coming upúû http://bugs.python.org/issue1747858`4 O45911L15302�Hopefullyÿ_@ in Z Qes it Zgood!m  Qart oKÿàonly runs when › as root.@O*Áscary people-QtheirKs9 :Abig_z = 2**3áÐchown_func(fi÷rst_param, big_value 7) ¿check_stat(-·own_func(figo-1, -1Y@�uid, gid[!ùelif platform.system() in ('HP-UX', 'SunOS'): !# ð" and Solaris can allow a non-root user to chown()  MÊ(issue #5113Àð raise unittest.SkipTest(" ñping because ofv…standardr"lÏ ¦"behavior"€Lelse÷ÙbcannotfÖ!, ¯™s OSErrorzÀself.assertRÕ#s(&,E,), -F0, 0�±„Ð!g$“hPif 0 ûin os.getgroups(*”%( üK # %å illegal types„Pfor tܪstr, floatÝ:ATypeÉ£ot(uid)zËp#Ž t(éþ@?ñ skipUnless(hasattr(posix, '¡Q'), "DPneedsÙ#()1defd_Ãð#4 anñ if the file does3Qexist›ö os.unlink(support.TESTFNßg;¿.Ž*, @h%) kµ# re-create—> p_empty_¹˜ _0B_allr_commonX™sÿ9get¡xƒ', None)ÓÙfÚÛuܦÎ^ &N{ = openUV, 'w'ò:try�Bfd =zD.6no(1F².� ÛÀn, fd,  ôgetattr(posix, 'fstat', None)) A…finally:ñtest_file.close() P@unitù.skipUnless(hash°lchown'), "+¢ needs os.2()"}@def !_Vself)‡ò os.unlink(support.TESTFN=¥à# create a sym+¥3os.ÿ(_DUMMY_SYMLINK, N!._‘Aall_År_commonCÀ B,uy �l�D^Pchdir]'«]ã.2()'"_ß^2’os.curdir9Ã.÷.assertRaises(OSError, : &z€listdir(N|]+InÞ`;œ]Œ_defaultes# When Hö is called without argumentÀô# it's the same as?(‡.« $Ç)¾_bytes¼1 a 5i objec¿ºò returned strings are of type9»os.fsencode•)–Ob'.'Ó \_likeØ¡for cls inŠöarray, memoryviewý`© ,ðWarns(Deprecation7ingZ7snames =¬S(cls(º%c InêX&BÔÕsÅ#a s(‰(*!),sþmÁcÙFs_fd¼h |$fdö ¯ U�¶=_fdÀS4opeugetcwd($†O_RDONLY'“ddCleanupNY<, f(ueEqual(kÚcsorted=(ˆ (fñMuÁ# Check thatûðfd offset was re Ö(issue #13739<Ù±Tà @unittestñ#.skipUnless(hasattr(posix, 'access'), 'test needs .Ð()') def $_aself):².assertTruebDñ support.TESTFN, os.R_OK)) @P@unit\« _umaskª©™¨@old_J# =ç&0å Ê´IsInstance(8V, int-+D#Ö±strerror'), � œ7õ ø .0ŒOpipe‹•‚‰åreader, writer�+`’os.close(/@tPos, '`2¼"qñ1os.2()"b@²òrequires_linux_version(2, 6, 27.E ézÀRaises(TypeEö 5³, 'DEADBEEFp;C0, 06ð# try calling with flags = 0, like�w(À5Š$ ='2(„/wyEmÎ YÑos.O_CLOEXEC| †NONBLOCK^ø¤ddCleanup(n?, r%w%—PFalseKÿget_inheritable(r)0w0�blocking]-ZÆ÷Æàfrom an empty ¼ñ : this should fail, not M~J}&OS{^f, r, 1xa˜ÿ big enough to fill-up the„eeither{#•ò or perform a partial]°6tryT˜1os.â´(w, b'x' * œÖPIPE_MAX_SIZEÁsexcept è NCpasstFÁcpython_only¼Ž DT _c_limits(Á6Ñ# Issue 15989¯% im_ _Óðcapi selfñ2.assertRaises(OverflowError, os.pipe2, _testcapi.INT_MAX + 1) OselfJUKLP@unitkð.skipUnless(hasattr(posix, 'utime'), '*q needs .2()'š@def #_¥!):hµ`now = L.(4Lösupport.TESTFN, None*S øCType>G,, H(IOP2?nowO9ŸFnow)žÑ(Ð@int(/$, :º;!) �·pð_chflags_regular_file(t$, Áfunc, target §, **kwargsì@st =ÎWstat(-ÜVÊETrueu�st, 'st_‰#')£&ð!# ZFS returns EOPNOTSUPP when attempting to set Bá UF_IMMUTABLE.îKts = st.k0 | ­.106tryÈAà,vsD‘except OS®z as errV if�.errno != 6no.ê .ˆrGcrmsg = '¡ ÿD notÐed by underly49fs'GŸ‡Test(msg‰ Onew_òžWoEqual(‚ ", \§AO Š fd|:pen™3'w+§%’b ²e ,žFPERM–kfinall.È“s–b“L •3os.”ѪJþ ¼ W³l�´µ’ÃKÄ . %ñ, follow_symlinks=False"À @unittest.ô'skipUnless(hasattr(posix, 'lchflags'), 'test needs os.Ð()') def #_ñ_symlink(self):%)%pfn_st =Iõstat(support.TESTFN) -<µ.assertTrue¢Ec, 'st_¦95os.€ ]ò, _DUMMY_SYMLINK¾™lÿteardown_files.append(3TdummyéÓlÔ 4Ô*Yñ_nofollow(path, È,—qreturn ”.8/", C‡ws=False ¢for fn in Ú½#, Pˆ |b# ZFS ‚ñs EOPNOTSUPP when attempting to setÀå UF_IMMUTABLE.öËß< = 7.Ã0 | <.C B6tryJS+fn¡I ;þexcept OSError as errM if�.errno != 6no.û2ƒYraiseormsg = 'e S not öÐed by underlyM=fs'K�«†Test(msg¸jEnew_)nA8 £?Ú E­¶eEqual(†ê , f ×Q M ›T>,JT ‰T �ofinallƒS”Œ_environ( ifÊname == "nt"{ñitem_type = strTØOelse*Ubytes,@k, va�.^+s( ‹P(k), /� 01v1ŽP@unit.å �ños, "putenv"), "require‰2()"zV‚ÆPwith UR¸qs(Value,M3os.IÁ'FRUIT\0VEGEÛ³', 'cabbage1a'bbbc:bð', 'orange\0VEGóETABLE=cabbage') õwith self.assertRaises(ValueError):,3ÿos.putenv(b'FRUIT', b'orange\0VEGj@iÿ=ORANGE', 'lemonÅ9\b]÷ð!@unittest.skipUnless(hasattr(posix, 'getcwd'), '+q needs .#()®@def $_ð_long_pathnames(‰q0dir$ =d-<÷ -directory-0123456789abcdef0'Ǻµcurdir = os–Abaseˆ ’@.absó(support.TESTFN) + 'A%' A=try)emkdir([u�_os.ch jexceptPð# Just returning nothò instead of the SkipTest FÅion, because®�!# /RÁ results in õ ñthat case. Is /dev/null') as idg37³0s =â.read().strip(y$3ret%rclose()ä:tryTEidg_Xòset(int(g) for g in(–s.split()iÿexcept ValueErrorX :0if ¢áis not None or � Meraise £ SkipTest("„’ working H''"ïö(# Issues 16698: OS X ABIs prior to 10.6 have limits on ¹ ¶ú sys.platform == 'darwin'­õimport sysconfigö€dš;_&ð_var('MACOSX_DEPLOYMENT_TARGET')#i'10.0'P�if tuple·n·n·#dt³÷'.')[0:2]) < (10, 6Š”b Ê2) is broken? r‡b and 'a ()' shouldÅurn the sameÓ#op, ignorÖ0ord¯±duplicates,Z;çeffective gid.Eð#10822/#26944 - It»÷implementation defined whether? 4Ás() includes²wrsymdiffzT°.symmetric_}erence(`f)ÄPTrue("Y4or E== {F}}÷#|sÁ%'� *at funcúBllowú�os.accessK`os.supÕŠs_dir_fd $y@XI >±. „getcwd()͆O_RDONLY6 Ö GI{(©€.TESTFN,‰bR_OK, É'=fækfinall4N\fwG_chmodF in˜>DC1os. çÃstat.S_IRUSRµús5ï{ 4 | ŠGWUSRv�”èT/ SûÐ self.asseö rtEqual(s[0] & stat.S_IRWXU,UUSR |sWUSR) …finally:ñposix.close(f) ð'@unittest.skipUnless(os.chown in os.supports_dir_fd, "1r needs  $2>2()"‘@def 2_Ff(self)¡A„.unlink(bTESTFNHÄýcreate_empty_file2ß3Bf = ûRopen( “getcwd(),†O_RDONLYj/tr? m,&QgetuiRros.getg  &=fYœ.i›=š™+Qwith a”.»Ð, 'w') as out©ó�q.write(Ysline\n"¡%Â5%s1 ñ Æ¢t/s2, ,øØ6…elf.asseÃ_1, s2["KNone9^%ðRaisesRegex(TypeError, 'should be integer or ou, not',;Ó88,îãå#[¼—]�float(f)‘ ’(Overflow'%f10**20lï.@utimªe\ð>ñòo5`now = ¾.(T-ˆ ‰,ŒV;8 2j•{ ‡Ø?nowêU(j)^À) öF self.assertRaises(TypeError, posix.utime, support.TESTFN, (now, None), dir_fd=f) ](¯None, now)]@º?"x"\ù(ø0intü4), H#†â † e (�š¥& -¥ * 1e9)­"à,yƒ)/s=‡)) Lb# try hù and follow_symlinks together6Rif os¢0 in ¯+s_@:8²>tryx –o=False£M²except ValuWtõ# whoops! using bothôD not�ýed on this platform.ÜzFpassdkfinallòêsclose(f‘ð @unittest.skipUnless(os.† d¯0, "0d needsÈ2=2()"@def 1__D(,)3f =Ropen(©„getcwd()š‚O_RDONLYWô Ô9i É¢Ñ@ + ''c', src–u=f, dstiסPermission3V as eÅ’ØJgTest('�§): %s' % eW+ls@ù # should have same inodesôfÇSEqual1KstatøN)[1]Æ—/8¨Nþl und “d¯‚SmkdirQQs›ƒ>„F…KjûOdir'B˜ 9%) !$rÄ �5ion$°À poçsix.close(f) ôsupport.rmtree(ñTESTFN + 'dir') 4ó@unittest.skipUnless((os.mknod in os.Bñs_dir_fd) and hasattr(stat, 'S_IFIFO'),X� "ið requires both ?.=Xd t@ forƒ�2()"ê@def L_—u(self):Ñ# Test using )ðat() to create a ²÷ (the only use specifiedH¥by POSIX).Ÿ{.unlinkd¥øjmode =å|VRUSR EWUSRa`f = poäRopen( “getcwd(),†O_RDONLYq6try‚9ÿ ¦ , žR, 0, t=Húexcept OSError as eXð# Some old systems don't allow unprivilegedX rsy5useá�#˜Ñç„Y¤ºÆdevice nodes€>ðñ.assertIn(e.errno, (ƒ.EPERM, UINVALfACCES)6;elsß\ATrueæ§S3Ž» TP).st_W]ofinall—¿Œ0os.Š", SSneedsÆ:¼=87�Ú Pwith G `, 'w')1koutfilXq.write(¾cline\nÚØaû#b7È÷ 2ôa <¥†÷read(b, 9).decode(encoding="utf-8ÁÅAYEqualìV, resy"¥\Ô=bÉ 0os.¸£A&AEI9 ym| # œ“'' Ìñþ †Jº ™‰Å9Wf A‰ôàposix.close(f)ð. @unittest.skipUnless(os.rename in os.supports_dir_fd, "2r needs  $2?A()")f@def 3_Hq(self):"ŒC„.unlink(bTESTFNI'ûcreate_empty_file2† + 'ren':òf = posix.open( “getcwd(),†O_RDONLY76try¥‚9Ìu,.¿S, srcøu=f, dstjoexceptm.Q®UraiseeOelseaKstatÌñ) # should not H £5ionRofinall#�close(f)l 0symñ;÷m@ni o;l C ”ì#',8*=f­Ã.assertEqual¥@read8 _O)iVŸ'€†qÓ ÃÒ&?ÑÐ;ðO7delO9&+A`íò[@› ÝÞM -èÞ0£R[”s(OSErrorB �Á?™‡¤omkfifoe&?eeP H\5 ¡x§ ,1%Àstat.S_IRUSR÷ | stat.S_IWUSR, dir_fd=f) ù except PermissionError as e:)4úself.skipTest('posix.mkfifo(): %s' % ea4´assertTrue(•bSFIFO(Cö (support.TESTFN).st_mode)Ozfinally˜B‘close(f) ´ñ requires_sched_h = unittest¿âUnless(hasattr…2, '.�yield'),JöÁ"don't have Fculing Ó"à –�affinity�4set8£Æ ª P®û@°h@def H[-(ä)—ñ# This has no eQñconditions (at least on Linux).\£ÏD_]Ô�@Øÿget_priority_max@ "ýÏ_=#()Õ aðRound-robin usuÉ"€interest0>8iesBl = …SCHED_RR.%lo3 ¨bin(pol~]/hi/ *ax/×.»öIsInstance(lo, intV'/hi'ÐGreaterEqual()&loOð# OSX evidently just returns 15 without check6Æthe argument8ö if sys.platform != "darwin"ª¿‘Raises(OS,vZV, -23¶J&#axJÕÐ1setš°uler'), "ca„Uchang†,er¨"rand_setÄ@_\param¹†possible,Qs = [z¢ for name,&3 in3ú__dict__.items('+ !ifHp.startsâ"("í1")]1NmineÁ‹Å&(0hÕ0In(9Î Ë1,trX_arento ·os.getppid(¥QDI if e.errno” j.EPERM—ñr�ÿ;els” æàparent, possibóle_schedulers) ñself.assertRaises(OSError, posix.5A_get >O, -1A!Zparam=, =k/(0e±IsInstance('¡õpriority, int) àñ # POSIX states that calling ÒA_setIV() orïnPòa process with a3uRÀpolicy otherlÀn SCHED_FIFO^'RROðis implementation-defined: NetBSD and Free õcan return EINVAL.Kð if not sys.platform.starts¨ð(('freebsd', 'net 5)):?:trys¡(0, mine, ?­5 9&5 /sexcept {^ as e‰áif e.errno != n.EPERM+rÏ ßì«ÝIEBI,NOType�z%, {FNoneKN†J&43B ‘(j1Jmõlarge = 214748364700h,Š7Fõ�OverflowGYù IrÊ_c/=-‚=õñ@unittest.skipUnless(hasattr(L2, "Š rr‘ð_interval"), "no funcB"Ô@def Pø_5(8 ü^  G¦Æó# This likely mean’×ñ is only valid for(Ü#ˆeŠ3theo$RR•Æer in effect+?NSOK¨aTest("§@work²…)#es’xwqËmr, floatÁ/ö# Reasonable constraints, I thinkÖZðGreaterEqual(interv“al, 0.) ðself.assertLess(interv&A1.) 'ñ @requires_sched_affinityƒdef test4get([!):&mÒmask = posix.J.0”°IsInstance(@_, set)ñGreaterEqual(len/O), 1.ÿRaises(OSError,•7, -@°for cpu in ŒÚÞíH´wcpu, in³ , ·. , $1 << 32  s 15if bJ > 1 q# Empty$õs are forbidden ÚDV.pop(¢ª!0,N)nò: V; , 0, []~C_ValueL F?-10I �OverflowLo1<<128O á •$-1!�Ïqrtld_co},tsÌõ# check presence of major RTLD_* :Vï¢OLAZY?NOWoGLOBALSLOCAL¥@unit‰€.skipUnlÍõ hasattr(os, 'SEEK_HOLE'),Mš "Dò needs an OS that reports file holes"11fs_+±Even if the@Ôsystem doesn'[U™#2bOS sup~!itEÊdò# will be defined andahave a˜eistent¶# behaviourÉQ# os.háDATA = current*6tioË*\` = end*õ .£with open(Õö.TESTFN, 'r+b') as fpˆœófp.write(b"helloz‡fp.flushHësize = fp.tell2fno¦+noJtry ƒQÿiý`range(`Þ" ž i,O²lseek(fno, `)L@HüêxO… OÀ self.asseñrtRaises(OSError, os.lseek, fno, sizeËSEEK_DATA) Ÿself.asseNJHOLENsexcept �- :kñ # Some OSs claim to support ¢T/ ¬@ÿbut it is not true.&ÏFor instance†óhttp://lists.freebsd.org/pipermail/ý-amd64/2012-January/014332.html|r�ô unittest.SkipTest("!Qd!") <@def *p_path_eÅ 2(’)¸1""",¸Mø functions that call @ò), providing two filenames in their ¬EAi@for 321("r?°", "replace Wlink"¨ ›á = getattr(os,Jj, None2%ifÍÔ!øP‚continue2¡2dst ”noodly2",O{.TESTFNž8>tryc»ä('doesnotexist;j', dst¾6Hô?as r)ÕgOIn("eð -> '{}'".format(tŽ, str(e)}XUbreak ?els„€êfail("No valid5ˆ Waos." +µ§üwith_null_character´Kfn =Œ¤1fn_BõNUL = fn + '\0' ª³addCleanup("0.unrÚ  6(fnAfd =sY û‡ oQValueQ@W‡os.open(Ëg O_WRONLY |бO_CREAT) # ÷sŠkfinall‰ dÛ ¶os.close(fdéÁ�False(os..Ás-<îÃPmkdire¥=j!s, 'wb')¸L‰Kstatˆ@ 3ÃŒObyte‡µos.fsencodeLQ4É”b•ƒÀor):  ð fd = os.open(fn_with_NUL,¢O_WRONLY |õCREAT) # raises Euinally:úif fd is not None#Åos.close(fd)<ÿself.assertFalse(os.path.exists(fn)-R”±(ValueErrorÃwmkdir, Ú=j!s, 'wb')¸L‰Kstatˆð class PosixGroupsTester(unittest.qCase):  def setUp(&)R@if pGæ.getuid() != 0 nµ \@Skip` ("¡öenough privileges"Ü!ifÄ�hasattr(iq, 'getg¶'‰i 6eed¨= hÿ sys.platform == 'darwin'Ê“0(2){×broken on OSXj>r.saved_†, =˜&()s�tearDownv s6.K ƒp\elif Y?inio@nameÀ wdþ pwn P).pw_'E£$X("-, 3[0] @=¿skipUnless(© ,qu"ác needs{Š)¬ð(_ qñ# find missing Ϻk~g = maxn@ or ÙE + 1¥JFgϱÑSIn(g,ï¬)_B/')^8(]«\2forQú s in [[0], list(range(16))]šQ�s ”e¢ListEqual()Smain( 'trpÄsupport.run_¤(Xâ>er,e”fºJÀeap_children Aif _D!__™ __Ž#__›¦°() """Unit  s Eó contextlib.py, and other ð managers.""" im΄ asyncio 4sys…tempfile„hreadingà from contextlôib import * # Tests __all__ from test$0sup, 3ñweakref class>ð AbstractContextManager(unitJ.bñCase): defcÑ_enter(self):X�DefaultE"a48V�__exit__T{, *args'+…super()./)ž!mÃ9 = ˆ)¥´£.assertIs(/P°c__(), )Vž ¡Cis_a5«¤ÿÏMissingExit(þBpassjÀWwith ¤÷Raises(TypeErrorp/n °ástructural_subž?ing¶7¶FromScratch×h_ö¤ ‰%areturn¾o=à exc_type, pvalue, ‹_eback\FNone-(tTrue(isé(ËÑ/, �8ª% :5â™ 'cÂÕÓÏ"NoŒ há? = iIFalsj_��QŽ?xit� ÿ óéûc,%l_plainU¥state = [] @8{woohoo(�E–.append(1ÂF…yield 42G 169993VfZ as x™taEqual(KV, [1]Ec3elf>)[x, 42$ý¸xeDc, 999]Œt 5�_finallyo^:try1 „¢.R�óðZeroDivisionError):' ùwith woohoo() as x: +ÿ self.assertEqual(state, [1])-_x, 42(Dž.append(x ö raise ZeroDivisionError(*—r�, 999]) ¡ñdef test_contextmanager_no_rej(N)ü@*F JWwhee(,Uyield&bctx = (§.__enter__Èõ%# Calling __exit__ should not result in an exceptionU·œ�False(ctxfHQ(Type7%, ï("foo"), None)! Qtrap_Ü0_af¹_throw-ZY-:tryfØî* lg? l/Ra%s(3rdRuntim3EKA LJT × DTU = []H„ ³ EU1+Üu5 42t*¡|eq/ u�e.args[09G°R™ Ê• )‘Š8 � F(999a eR ÜfBŒvž_stopiter ðop_exc = StopItera v('spam'‹6 z (ŠáñWarnsRegex(DeprecˆAing,äÁ "Æ"O=x›w#œ3{K$ E.¹ ÙÑtIs(ex, GK;elsð6ifail('Àÿ was suppressed'|_pep479êðcode = """\ from __future__ import genÿ!or/&±4lib&ðmanager @contextñmanager def woohoo(): yield """µlocals = {}²exec(code, )#W# =!"['5'] #östop_exc = StopIteration('spam'L2tryž�Kwith¹draise _p�except Ešion as exZõself.assertIs(ex,G�Oelse6ifail('Êò was suppressed')ýwÃtest_context�ð_do_not_unchain_non_Åi- ep# s(©´÷@Kôk¤issue29692ë7 ^ >c -~æRuntimeError('~ :CÜ • from exc­ Šè*A ¿sÁZeroDivisionxY¼ »Qú¨type(ex), Év2ÿEqual(ex.args[0], ó‘ ?�IsInstanctÍ.__cause__, ÓB@., © ¢U€¤±B) jC$”„ZIsNonA.|_createsmattribO2G**kwjvÛdecorate(func $ÿfor k,v in kw.items»+0setmJJ,k,v$"preturn k“Œ@hð‡foo='barfÕ@baz(} Ј"""Whee!“?bazÕ rªW`baz = .› .�q�baz.__nam-G'bazÏ-Sfoo, ø-@žñort.requires_docstrings!‚ a'_Û ‹Ú80doc}γiU­Ðstring_given_ócm_docstring(self): `baz = õ._create_contextmanager_attribs()(None):4ðassertEqual(baz._jÑ__, "Whee!") 0üdef test_keywords‡Ã# Ensure no $ñ arguments are inhibitedQ¾@©mawoohoofp, func,Ows, kwdsÿHoyield ,WWwith X2=11[2=22^2=33aæ=44) as targetmn 7%0, (PKF<44);‘nokeeprefªÄzclass AgBpass|u+Ga, bU6Àa = weakref.xaýbbé Is;O(a()# b#�É…«A(), b=A()¸ü x½param_error|* œöÀRaises(TypeEy ¦KÜ@O3, 5D-Ò:‘_instance! íò# Issue 19330: e¤x " CÅs have good qoà‡B = cÌ3–'6objt 4objA(, aÏçn á@statn%[]€j ÉHC ²I–.append(1‘fx = C( å9F, []$ n°xJy� FFx, yAðself.assertEquañ!l(state, [1]) def test_closing_error(self):"&7U = []vclass C$(NIeAI¥.append(1)Nfx = C(€¶.assertEqua¹]$Wwith )ðRaises(ZeroDivisionEÍȃ7¥ºing(x) as yÆ&X�Fx, y|#U1 / 0Æ 5ïo 3ð NullcontextTestCase(unit†.´P&_n5 [V ‰Epass—c]RcJc_in Ð0Is( c, c) Ê_FileCʉˌWithOpenÇðtfn = tempfile.mk +tr¦�f = None^ŒÛo_�tfn, "w"ÛfØ*Ü€False(f..edåúf.write("Booh\n""I?TruH®@¿ éré.dí /ý¯f.read(), 5 zkfinallÝôsupport.unlink(tfn)vOLockv¢boilerPlat—b, lock#edj ¬&(Fed()ñw Q æ" 9"\ (“ Ñ}—& ¹… ­nÌ� ÌhÍh6Aing.%F`—1‘. … iRE;³. j&k_is_ownn�Conditio¨ r*v!) *areturn‚.€çà.¨‚SemaphorÛÀhreading.Sem£aphore() Õdef locked():ië.acquire(False$(>x.releasYqreturn > `Jelser/ETrue.ðself.boilerPlate(s,·!) (ÈótestWithBoundedSemïAº?Ý = threading.1 »ò class mycontext(C“DecoratorÂ"""Example dóion-compatible @Ð manager for uaing"""ˆ—started =ò’exc = NonÓUcatch!6¾«__enter__(¯.X ^#c__exitIc, *excâb,.“1excJ.¢# 8LTest2P(unitû.aL±@support.re8Ás_docstrings!ì:‘_instance! õþ# Issue 19330: ensur�CËs have good oÜ!cmd…& =  ._!__˜)8obj (6ôassertEqual(obj?(, a ‘_5R,orê xEwithxšas result8œ2Is(",5Ëá+H(}_¼ *ñ+`exc, (Î,Ô6)) �ß0ø_˯_exceptionš= ¾÷ RaisesRegex(NameError, 'foo'íÊ;Ž 9rI C(BxsPIsNotø6Y*#F[0],ac”ú�0 = °mÔÐ`–×ñâ@ñNšR ™ “(nemïÀassertTrue(cóontext.started) Vtest(óself.assertEqual(c9Æexc, (None, A)) K@def Kð _decorator_with_exception(Z!):-{XS = my "()L@0a(D)W± Is™²Ø +ETrue) -÷raise NameError('foo'¡Þ }R0usRegex(6", 7÷[(sÂtÅo%Is¿vexc[0],¬”¯ing_method�pclass T*†object):ªÒ ®²o , a, b, c=á Æ0ÞE = aõ_b = bVc = c“q# these‘õs are for argument passing when used as a ºd©" =ùK.ÙF1, 2§=+Oa, 1$ bHcy„_  p'a', 'b/c'… _a, 'a&bQL @c, 'rLa=1, b=P8ˆ*½_typo_enterá‰CõDÌ ®R0__uJ,__L°fþ6Cexit5k, *exc\*;<j’(Attribut  F4Ð de™!h±xV'Rfthing' ‚[', 1g, 999]Òó # Issue #11647: Ensure the ‚õ ed function is 'reusable'k  ©_ else®6³ ZòTestBaseExitStack›³s! =k¶ñ @support.requires_docstringsÁ­‘_instance! u'‚19330: e&¶ ‹ CËs have good oÞ!cmd…! =….¿ ._!__ž/>obj&(û4objE(, møóÌno_resourcesòLwith› Z¯SŒcallbackO€expected'ÚÞ›((), {}),/1,2ÿ), dict(example=1)T%a&û`resultÒ ?ë(*args, **kwds 0"""Çð metadata propagae9""" f (VT­A as "nFfor FÔ in reversed(¦ ¯6!if5P and ~ T"fª…. *,  â9#elaX" Làelif kwds:  üf = stack.callback(_exit, **kwds) 2]else:&LDñself.assertIs(f, t (ãfor wrapper in¥(_«sˆ Z@b[1].__ ?d__oÁ=’NotEqual(6rCEname@2.__ ¸ IjIsNoneG8docFE†ƒñresult, expected) àdef test_push(6)ñexc_raised = ZeroDivisionError@©D_XP_exc(7@typemc7_tbW4j½ 2sÌ`�suppressb*1{detailsY¿return True¡/ok }sÖ˜ È(# ûclass ExitCM(objectÖq_init__¦p, check +–!& =-t'VSenterWLðfail("Should not be AJed!"îTxª®† ­(.¯Qwith *Y_nR() asÔ´RŒÒ˜*ok§K=O.q[-1][1]é4_DDcm =¶h‹/cmƒ%0.__°ï E`_#k%/, Gñ;excl’ ­ ²u òu „iÞÉ Þ$i1;1/0�“qcontextð™.?Tes. E/?!.Jnd(1A ÆÀ, *exc_detaikls): õresult.append(3) "U = []Õcm = TestCM()ñ with self.exit_stack() as u@õ!.callback # Registered first => cleaned up lastl¿Pdef _k(Ñ4¦:¥ñassertIsNotNone(K (Ãû.enter_context(cm$ñL(ÖK_ܰs[-1][1].__yL__, Ee2b1.^bEqual(*ã, [1, 2, 3, 4]®°test_close(;9 Ȳ)‹%1Ý‹Ú BÙ< 6pop_all8…3öÞà 2newŠ" =‡.è P F¥ ›Z.–œµ |ÆN_rai·£R%÷s(ZeroDivisionErrorêW7[—Œ1"ú .push(lambda *exc: False+/21/0#uh|uppressE�‹;TruІý exception_chaining_referencð# Sanity check to make sure that ExitS M… matchesò# actual nested î†tatement(aclass Â:ExcH�__init__>[, excÖz]Pexc =!„D¯E@areturn¨=º<,o_detai4‹IB.exc‡ çRWithC<ò¼outer, inneÑYû$1 =  Â#@" =H#À def û__enter__(self): preturn  £def __exit<ï, *exc_detailsJ>try_nQraisebi.innerh!oexcept=eouter >úclass SuppressExcAÁþV2ypedd.saved)7 = 7½÷FTrueÚ J`with RGïExc(IndexError† +ñWithContext(Key4±, AttributeD™H]((,ŸOValu[ 3U1 / 0 Ý0 as; Ö¨ò .assertIsInstance(exc.__cêD__, í)_q= I , O0# IÏ¥ãeptions were s“)ed/ ~=Non·z ÅOelseçfail("ExpectedC†, but no£Q was ‘&d"XÁ# Check the £1sÄh_exc =v ï5[1]1 ñ¬G', *5â, ZeroDivisionÍEüBtestÀZÂion_chaining©J†# Ensure÷ +� matchesöreference behaviouÍtY#’ 1a£� ) PJS™nonlocal {Kl•‘à"pstack()² Z{`.callb+ Ö,®�26á4 Ì :Xpush(y—Ò[ïVÀ selfø.assertIsInstance(exc.__context__ ÷, AttributeError) ù# Inner exceptions were suppressed/Eself~?Nonz †v^else:Uñfail("Expected Index°†, but no£Æ was raised"XÛ# Check the iÔoõ_exc = saved_details[1]% åc;l, ValuM5  á, ZeroDivisionå!) ~Àdef test_exi”T_non_’@ing(m)Eñ# http://bugs.python.org/issue19092_øc<8H l’3~6D*exc9 ?¦eturn TrueA6try­RPwith Å.é±stack() as -1`.callb+€lambda: ‚) -Ò¸,V6ú$ E†:exc„¬vTä<¾J>3KeyŒEQXpush(D-)§]Ð6z-±\8Z vý“Ä_correcty˜Q20317d?@½umanager€„gets_theho_right½ ZJyielÆkfinall”+± ýfexc1 =)(1Á223344„j# The á already fixesã!Ð, so prior to9#-p, ExitS`  would try*÷fix it *again* and get into anE�infinite¯õ-referential loop) z 4ãTenterè(ùÀntext_right(‹exc4)) ô stack.enter_context(gets_the¿_right(exc3B.2B¥raise exc1Ÿ�except E`ion as!:!ÇÐself.assertIsŸ,$4å %%._Ø_131 =2=$ I1IYNone(ûÿ8excM !) MÀdef test_exis€ion_withTsting-(I)�ò# Addresses a lack oOÑ coverage dis ñed after checking in a„Åð# fix for issue 20317 that still ™Àained debuggBUcode.CËGð_nested(inner_exc, ouÝ7exc¾w6tryÏE >aofinall5h5Ó& =Æ(åIexc2Jj £È ðIexc55U îæ Õ.ÿ  ()i ¡.callback(*oH4s49 29ä5cÔ2 šû>:’ZŽ1 = Ï= I†k í›H °€j Ý …@body±0ept…@supp_ xê/Û(*exc_detailsâµreturn True)5Xpush(‰k@51/0wÑ IndexErrori:excgvðfail("Expected nof, got E"EËlðion_chaining_suóppress(self): Pwith ñ.exit_stack() as )0õ .push(lambda *exc: True)S* ?1/0)q{}[1]) Uü def test_excessive_nestingÎñ# The original implementation would die öñRecursionError hereoÀ!÷for i in range(10000cP>Pcallbe Belf.Z1Is(Š.«+‚s[-1][1]O“€dont_rer”r_Runtim‘ñhttps://bugs.python.org/issue27122[«j°UniqueExcep@( u™/ „ 5e@&umanagerÜ{second(F:try‘¬uyield 1?)5pt ±Ðª %)8 º.b("new D ion") from�9½ _first¼U6exc–Ï|1 shüÔbe caught by d 'sÛä!ñ# handler which chaápised a !g6.<=×1 0ezerr_ctxÖ@²”.es.Ž }(à‚+/¶.$Uó ("please no infinite loop."ÙlSxc = è.U-Y3IsI\(exc,—š4$._{$__@³C@Nones? 7oause__5h%,{ k" ~‘TestExitS“EBase`, unit.CCase.5Ð = ExitStack ó class TestRedirectStream: r!_sq = NoneKorigñ @support.requires_docstrings!ñdef test_instance!q(self):"zô# Issue 19330: ensure context manager CËs have good oM!cmd…0 = k.Û ._#%__�?obj+())NôassertEqual(objN(, {)U5no_†|in_initfòdout = getattr(sys,Æ ³ ’Z»µ?Is(X #, f† Äg toling_ioÆ�f = io.S�6IO(«ò"msg = "Consider an API like help(), which prints ¥€ly to st’"Ч-BwithLË2�F‚¿(msg, file=6 ä!lwðs = f.getvalue().QpHd…ls, msg®ýenter_result_is_targeu¯- H as `ÌÂBelf.&8Is((<, f§ cm��reusableN�write_to_ÂÔ.0g ä!ÿ"Hello", end=" ".cb oWorld!Zƒ¾ ô ˆM\€  ­?\n"æoentran†ç°Në !QBï4Àys, self.oriàg_stream), orisdout) ÷s = f.getvalue(ð,elf.assertEqual(s, "Hello World!\n") class TestRedirectStc(„°, unittest.qCase): ‹r<®7 = O&ÂLQ = "si"…?err…9?err…:err…ŸSuppress(ðñ @support.requires_docstringsf@def *‘_instance!q(self):"Áô# Issue 19330: ensure context manager CËs have good oM!cmd…0 = ¢Å ._%__u7obj3 4obj>(, _)öåüno_result_from_enterìEwith• (V¯¡Error) as 2DÖ2ÈxIsNone(,‰Ÿexception�q9Üpow(2, 5), 32qoexact_tBTypeô s^len(5Zȯ_hierarchyÒ oLookup`'ø['[50]¹_other¿ JÿRaises(ZeroDivisionp ëöÞ;1/0’no_argsëŠ,z}�†multiple‘) /, ÷rz )E2ücm_is_reentrantCWignor×;%$(E6B� 5 º2pasðÎ1 ¹/d$õ # Check nested usageå] p`outer_eºinued = Tru:¤�((?ò ) if __name__ == "__main__",E±() """Basic ñs for os.popen(ÀParticularlyð2 useful for platforms that fake popen. """ import unittest from  0sup")òos, sys # TestVðcommand-lines get down as we expect.1ƒo do thiôecute: # python -c "yóys;print(sys.argv)" {rest_of_sr}[UÂresults in POñbeing spawned and R0theÉYA lis¢ðWe can then eval()  Y1 of½,IPsee wSPeach Ÿc was. É=] exä°able if ' 'œ"': ÷t= '"' ++ ð# quote embeddedÌ!ceÚ0cmdþ� class PÕ“(Ì.qCase): m€def _do_ßAs(self, Q,²2ed)¤ˆœcmd = '%s¢Q£1%s'n7=2% (øh)&�with os.˜P(cmd);p~Kædata = p.read(=Rgot =­#ñ)[1:] # strip off›5[0]ní÷.assertEqual(gotô+'”4CõRaises(TypeError,É£/y•â©"foo bar",[@", "Ç_'_Q"spamÀÿeggs" "silly walk"'x 3,4�.Qa \\"ä@d\\"­"Œ3'a -+' ¸/Ëp_children()ß±return_codeå(¢ö"exit 0").close(), None’ ifÊname == 'nt'̃ [(42\&42ZOelseL+\ << 8ìcontextmanager   Á"echo hello"©f‘ f„d&"6<\n"€Ÿiterating{<Øe(f), [{]|�keywords{ Dcmd=ø÷ , mode="w", buffering=-1=ÐPpass ø __  __ ¢"__main__"6­ ()ËAestsâPextenõðunpacking, starred¤ð ressions. doctests = """õ Unpack tuple >>> t = (1, 2, 3)Æa, *b, c = t° == 1 and b 1[2] c 3'ETruejFlistiÑl = [4, 5, 6]-iF = lN4Yf1 ^|impliedÐÚ*a, = 7, 8, 9U[~ Mæstring... fun!µŸZ'one'N7'o'¥�'n', 'e'\Çlong sequency0a, bö , *d, e, f, g = range(10Œ(*))%B(0, ºD[3, [,ýB çOhortŒï ; iôç2ôìgenericc¡class Seq:Gkƒú def __getitem__(self, i)&*‘if i >= 0‚ùi < 3: return iT.ôraise IndexError!Ùâ =’(ïb}`è÷in for statemenç6>úin [(1,2,3), (4,5,6,7)]ÝTprintå‹1...© 1 d[14 [ % 7a:in d[z]J5RóÌ Ý7, 3Æ4w4ûMultiple targetsà=½m%Êd–[ËŽeŽ`Assignl! uÉ9ing’@b, *°A÷iÚ3[îF, 4]8�2 = p!*c29B«0], vñ) Set display el¤Ps\°sorted({1, ƒR0, 4}–ih]í,11, ,I`TracebÞó(most recent call lastO$ YATypeð : 'int' object is not iterab'?DicÝÀkwds = {'z':™�'w': 12}ŸDè 'x`, 'y':u **; }.3s()û€('w', 127 'x  By', gz', 0)`2**{c}d˜.3}h]3]Ô]û'º° ¼3¼T4°4œR{**{}h&{}%ða = {} >>> {ñ**a}[0] = 1 >>> a 1{} Q{**1}ñTraceback (most recent call last):'1...ùTypeError: 'int' object is not a mappingk/[]l.?lismñ%len(eval("{" + ", ".join("**{{{}: {}}}".format(i, i)Ø0....ðfor i in range(1000))_2}")?óð0:1, **{0:2}, 0:34ð{0: 4} List comprehension elem}iunpackFñ a, b, c = [0, 1, 2], 3, 4¾Ó#[*$]'&]�lD@a, (>û), {5}, {6: None}, (i ðr7, 10))XkBitem' Bin lNcSyntaxP•iterable ÿ@ canVpbe used‚ 1Õ![*ð]”)«·™g?'a'–€[+wñGenerator expres €in funct@argusð@(*x ªxï(ð!5)­#3)£ f 7^‹ æ�nvalid sûÒhdict(*Ór[{1:2}]a¾ R ¦ «I¡‘ªÈáprint(*[1], *[¦Âð1 2 3 Make sure that they don' Arrup° passed-in Æ&s.`¦def f(x, yšÁyv²±�original_N“ = {'x': !If(**%U, y=2¹Q( $KA Now}Úsome failuresñPe raiÊeC±s are right9Žkeyword _ú¡from colleðs.abc import MutaöbleMapping >>> class CrazyDict(Muta'!):)0...0û def __init__(self %t.d = {}<D?terD’for x in MB.__i0pUºif x == 'c'±L©['z'] = 10–%tyield xþsgetitem½?, k”Tretur¾4[k]GO3lenKH1lenn4.d)BJs™?, vTkvGO?delè3del£ å[Y»õchr(ord('a') + x): x ú‚range(5)E7eT2**döTraceback (most recent call lastúÜð RuntimeError: dictionary chiàd size during ma! <}d´#3óf(**kwargs): print(^#ÜØTöOverridden parametersïòf(x=5, **{'x': 3}, y=2âQ ...â4Typyñf() got multiple values÷Ðkeyword argumÌ8'x'’�ž’zž5+q’½ /2}Än1O**{1: 5�4<Às must be stÊ�s UnpackÖÆnon-sequenceX’a, *b = 7«VÜ�cannot uq nHèble int object‘�« too short—€, c, d, úOSeq(¼"À ValueErrorñ.: not enough values to unpack (expected at least 4, got 3) U%ð@ing sequence too short and target appears last >>> a, b, c, d, *e = Seq() aTraceb�ñmost recent callE!):FQ ... V¹_ErrorÐ3aÒñwhere the test foråðlong raises a differ¤�kind of e�í¡class Bozo¦£(ExceptionË0...ùQ passÒÚ*=RadSeqú/ûdef __getitem__(self, iUZ‘if i >= 0™Zi < 3K%„return i†!elD/==:äA/set:QIndex;ò Trigger code while°—z6an 8# (¸ �«r, wrong—)˜Ea, *†…Bf(ˆ$#._‰E_ex.õð Now some general starred expressions (æofail).¨@*d, ©ðrange(10) # docu¡:+ELLIPSISAFRSynta‚_: twoŸÇin assignmenÎ[Go*c] = š|/*a”PÉý€must be 8` list BFupleÞ/*aÅDŸcan't useË Ù„1„oOx = iSœ÷size constraint‘.9ñs = ", ".join("a%d" % i iíp<<8)) +, *rA ‘<<8 + 1)"­è°ompile(s, 'П', 'exec'ä/OãÀxError: too úfmany expressions in star-unpacking assignment >>> s = ", ".join("a%d" % i for i in range(1<<8 + 1)) + ", *rest =52)"Xðcompile(s, 'test', 'exec') # doc¡:+ELLIPSIS7ñTraceback (most recent call last):'A ... ÿSyntaxError: too ù (there is an additional limit, on the number of]Pafter 0 '* ð', but it's 1<<24 and åy‚it takes¦ðuch memory.) """ __+s__ = {'Ds' :*qs} defQó_main(verbose=FalseAfrom#° import sup. r1_ex$0S.run_†('#, yÀ) if __name¸A= "_š2__"¨9 ¬pTrue) -ðBEGIN CERTIFICATEðÆ- MIIDWTCCAkGgAwIBAgIJAPm6B21bar2bMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODAx MTkxOTA5MDZaFw0yDMTcx¯® ¯I®/ Y¯ÿÿ£CCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAKvvsX2gEti4shve3iYMc+jE4Se7WHs1Bol2f21H8qNboDOFdeb1 RKHjmq3exHpajywOUEgne9nKHJY/3f2phR4Y5klqG6liLgiSpVyRlcBGbeT2qEAj 9oLiLFUXLGfGDds2mTwivQDLJBWi51j7ff5k2Pr58fN5ugYMn24T9FNyn0moT+qj SFoBNm58l9jrdkJSlgWfqPlbiMa+mqDn/SFtrwLF2Trbfzu42Sd9UdIzMaSSrzbN sGm53pNhCh8KndWUQ8GPP2IsLPoUU4qAtmZuTxCx2S1cXrN9EkmT69tlOH84YfSn 96Ih9bWRc7M5y5bfVdEVM+fKQl3hBRf05qMCAwEAAaMYMBYwFAYDVR0RBA0wC4IJ bG9jYWxob3N0øñÿTA4IBAQAtQ8f37cCEk7/rAcbYR53ce3iK Vpihb0U2ni1QjG9Tg9UIExkIGkwTiCm7kwQL+GEStBu9AG/QVrOjeTriRiddhWkk ze8kRaI3AC/63t6Vh9Q1x6PESgeE4OtAO9JpJCf4GILglA789Y/b/GF8zJZQxR13 qpB4ZwWw7gCBhdEW59u6CFeBmfDa58hM8lWvuVoRrTi7bjUeC6PAn5HVMzZSykhu 4HaUfBp6bKFjuym2+h/VvM1n8C3chjVSmutsLb6ELdD8IK0vPV/yf5+LN256zSsS dyUZYd8XwQaioEMKdbhLvnehyzHiWfQIUR3BdhONxoIJhHv/EAo8eCkHHYIF ”>END¨S# regjr0ñSAX 2.0 # $Id$ stxml.sax“ð make_parser, ContentHandl\†›€SAXExcepŸð , SAXReaderNotAvailable, SõAXParseException import unittest from ðmock try: make_pGQr() eKò SAXReaderNotAvailable0ð# don't try to gò this module if we cannot create a aqUraise•ó.SkipTest("no XML+4s ax"")Èpxml.saxTutilsÐô XMLGenerator, escape, un Áquoteattr, \‚÷úXMLFilterBase, prepare_input_source‹aexpatr*ŽóR .thandler*úfeature_namespaces/:xml[IˆS‡ø, AttributesImpl NSL$ion By+´O, StringIO-dcodecs$gc tos.path shuVõN0supt.yäfindfile, run_› , TESTFN _zdILE = / ("fð.xml", subdir="xmlidata"):O_OUT>O.outB…0.en‘("utf-8")4!l %:0Uni=ECRError7ö@ is 3}o^0utf� S´s_nonascii_7±s = True if?¶…sq‘1�ú _.å¤FN_UNICODEã ‚ENCODING÷(øòa, Typeý)neÐ# Either the ¿� system ò0ingwNone, o%‚DY"be7_ed inR.9ÄAßFalse require$¹Ï.skipUnless(_,%#'RaQ non-Çâ#s ¢ð') ns_uri = "http://www.python.org/xml-ns/sax Ð/" class XmlJ½(¯CCaseŠðdef verify_empty_�s(self, )o€.assertR¶Qs(KeyØ,À.getValue, "=-<oByQNamC%;B+~ ByIÇ!¿__getitem__? `Equal(&s7²Length(), 0J 5 /žðs(), []) óself.assertEqual(attrs.getQNames(), [])  02len4O), 0(pNotIn("Y0", s(€BlistQ.keys()� Q±cŸs"), Noned 3Q, 25)é™OitemšË@valuMÍfñdef verify_empty_ns™(d):+}ªóRaises(KeyError,Vh², (ns_uri, v) F !By`, "ns:™"F@E.„ ByL×+P__get¹/__I�ú`Lengthç /²>^è0n #¹­x m� <…ù «ÑŠ:‘ _wˆ�, "1i/"¦f 5(6.“™-„ºŸžO"valM Q3/, 7 ÂD?e A°98 ã~q)± 8+? I>^fÀEqual(attrs[ó"attr"], "val") ðself.assertEqual((Às.getQNameBy(>3), ñ def xml_str(doc, encoding=None):b%if@ is ~¡return doc,õ'\n%s' % (t,F)•Zbytes—t, decl_2F=...¥ ª6...© =Ž·  1!).te­ó'xmlcharrefreplace'½Pmake_LOfileÁS÷with open(TESTFN, 'w'ϾÏing, errors=¾V as f2€f.write(Ê! ð) class ParseTest(unittest.4CasGÿdata = '!' µ½�tearDown( —ãsupport.unlink)8pcheck_pµ;7, f>@fromp.sax imJ ,x`öresult = StringIO(Ž*ò(f, XMLGenerator(2¦, 'utf-8')0» ¾+¿%0(),�¥,JI–"stÕQ_textÚ×ð s = ('us-ascii', 'iso-8859-1¢,Wí À$16(F16le b/5forf5 in sc+Ó�Sy"õÃ)@E s1 Î/r/)ka´fÏ Ô:ÌÁ,y gÇA( MŠ»Np# UTF-8i@defaž , US-ASCII±compatible ±7^H 16+Áautodetected‰MV·©T”JBŒ!IO .Éf•,`.UËÀN) û with open(TESTFN, 'rb') as f: ùself.check_parse(f)$ ÐBytesIO(xml_b (#údata, encoding, None))LPmake_8Ofile7� Ö Zô7â# accept UTF-8M5BOM“í0 Ò'utf-8-sig', ', 9…  Ð ì ÿé6æ]òÃñ…declaredД ¯iso-8859-1÷1uïCâ# fail on non-Õincompatible !Oout $}<ðassertRaises(SAXEx[Jion)‰-U%ij7b³0”'}Ä 41f) Ђdef testв_InputSourcs{ú Ù2butÿexplicitly specifiy'­iÈ8 = Ð "@.set”lStreamÎ#E©'(' O a=eclose_sf€builtin_æ! =š¨Å Qobj =0ÀÄAmock5g(*args¸"ðnonlocal fileobj  ñfileobj = builtin_open(*args) #sreturn 1 ð with mock.patch('xml.sax`utils.Rð', side_effect=0j%):Ih�make_xml_gú(self.data, 'iso-8859-1', Nonež†0û assertRaises(SAXExceptionko1úcheck_parse(TESTFN[%VPTrue(›²obj.closed) Gdef IaStringÁ7, szSfrom "� import {2 ’result = 6IO(•0ò(s, XMLGenerator(8¦, 'utf-8')6ÇSEqual+À.getvalue(),™A_str¸yIœèBtest0�Q_text4éüencodings = ('us-ascii'ʨ,]“  166‡F16le 6be'ÞDfor s5 in s`¨r øM B=T¦  #\bytes$ð# UTF-8 is defañw , US-ASCII±compatible é74H 16+ÅautodetectedUV�W8T jH dŸlYp­C@# ack?5BOMe�T8-sig(b° KϳUñ…declaredØÀ#Elá# fail on non-\7 intˆOout ‹\P.„-2½æÀ class MakePÁ rTest(unit‚.CCase˜½gG.r2•‚Creating™ðrs several times^õa row should succeed.“ # xAñ this because there have beenu�ures of )6kin³†# beforeW;ÉGp = 9Ðfrom xml.sax óimport make_parser 8p =%()ßfrom xml.sax Bà_ # =7ñ # # saxutils testsd7£= class Sf�Test(unitn.aCase):åßq escape1def™_³_basic(self46Ò.assertEqual(-ú("Donald Duck & Co"), Aamp; o?allm"),V¤ Y"<3Œo>")�_extra’ÿHei pÃ¥ deg", {"Ã¥" : "å"}Ÿ =+B“¥"unfâ§©/ « ¯«D_­-( ¹ é ¯g_±/!("v³=ž?amp›&–Afoo;L& €: "splatL" " (‚quoteattâ‹*0 +®'ð'¦�vsingle_gUd *ñ'Includes "double" /s'a /'\8-\'ŸYŸ""Ÿ'å'ŸŸ \8-\"ŸY_¦ À self.asseñ%rtEqual(quoteattr("Includes 'single' and \"double\" ,os"), /"\G&=;K OQ\"") Q0# =Á make_parser—def test_q(self): ŒÒ# Creating a <ô should succeed - it—fall backAóto the expatread~^8p =–r(['xml.g“s.no_such³ð']) class PrepareInputSourceTest(unitÑ.bCase):ê\setUpßîõ.file = support.TESTFNÁ‘with open<-Ö, "w") as tmp,Òðtmp.write("This was õ€ from a l.™—rtearDow^yŽfunlink|Ô;·`byte_sYm%Còreturn BytesIO(b’Pis a 6 6 ŽSŸcharacterX ƒStringIOêX;]ÁcheckContent¬,&2, c½šòassertIsNotNone(²)œ%v!.r&()W1)p.close(P´L7_¾ùA# IfÌst ó'n † -%a Iávuse it.‰Hrc =;^ßtrc.setC�S¾*ª)=0pre_Pare_i,_¹F(src)Ej0ne(4@.get:tY0 Ì0 ©Ñ  Ž / “š°•&÷that does not have £“#­3 bu/+} , ÉÏÖ#]RÑVèsa0 = Ì% œ Ñ¤Ì [È‘system_idÅï[Æ¿has neitherÄ no!OºÄ¾…? ID¹†Àce(src) ð" self.assertIsNone(prep.getCharacterStream()) 15ÅcheckContent5DByte0,04 ñb"This was read from a file.") :ðdef test_string(v!):Mò# If the source is a +¡, use it aõystem ID and open it.Hð0 = ¢are_input_Ts.• ü1Œpbinary_¹Ã6 0~Ê-like objectGEbyte5#j?eamGPmake_EÐQUf:šÕ ‚OtextO.M c]R.JW¨ ÜØ Ý ÜVž[@ # =ò XMLGenerator class XmlgenTestëxl_basicÖ‚result =Ï!ioK(ÙYgen =o(3 #°.startDocumÔ1Eleš"doc", {}$9end" \ùׂSEqualšƒ‚value(),×Àxml("?cÔ™:1d"ì?gene.Sšs("huhei"�… ÀendDocument(C) ñself.assertEqual(result.getvalue(), $ðxml("huheiÝØ_scapexaF¾<¿&Œh]-B<�Oamp;i oattr_ef{‹"a": '"', ’eN*;"'"*ve’F/\"H2o\n\r\tK¯'å? —^û a='\"'>"*o"$ Ô +} Œencodingàõ s = ('iso-8859-15', 'utf-8 i-sig',¶{+$16,F16be /le7 $32+&327V32le'ŸDfor ¬1 in Àdings:  ò result = self.ioclass() ògen = XMLGenerator(7´, encoding= ,) ;î.startDocument[ 1Eleý"doc", {"a": '\u20ac'}�Ò.characters("&"%9endX"š »³assertEqualôÉ.getvalue(),0,4Äxml('¤'89ñdef test_xmlgen_unZPable(^%):u„»·s'ascii'}Ã2gen’ V®1ª !¦Šý .ž0 š“€"> œ ›_ignor™:i kýU ‡($¡×Whitespace(" (%~EQr" "> `#")ådé­o_emptyí8RshortV"_egcs=TrueŠ SoÕVœing_bytesnõ s = ('iso-8859-15', 'utf-8 ^-sig' U+$16,F16be /le7 $32+&327V32le'Ç5forƒ5 in s&‰rå·.›!e(Fing) êÒJ ÷ð.encode(encodinWg)) ÿgen.endElement("doc""ADocu#)) Aùself.assertEqual(result.getvalue(),0|4òxml('ô ', encoding= )ðdef test_xmlgen_ns(V%):mˆ0 = –.ioclass(Üógen = XMLGenerator»b©Wstartþù PrefixMapping("ns1", ns_urin.JjBNS(($", u , ;:�F, {};°# add an una¥ified nameë‹]€None, "uP2), W5ú�$ 3†/¿ 5" $bغ\ ÞL6€ '<3>' %?ßø‰o_empty�6r, shortV"_e©os=TrueªÿÏO/>P?ý''ðLšR6ð8mÀNS((None, 'aó'), 'a', {(None, 'b'):'c'}) ôgen.endElementNS(+a> +@Docu,5() Fñself.assertEqual(result.getvalue(), $óxml('')Eðdef test_1463026_2(0%):cR" =H‰ioclass(žó = XMLGenerator…bðíWstartÄÔPrefixMappingIqux'l.H7'#pvg 0 ^>endˆ #Ç(7‹ÿxmlns="qux">'$ãa:g1 xmlns:a="Kûexample.com/ns"5p 'Hello') }Ú¢er = make_+()Ò.setFeature(f_{vs, True4÷result = self.ioclassTYgen =(3CˆwýContentHandler(gen&-(‡Ü€³assertEqualgÅ.getvalue(),é© =:xmlÌ #µC <åÏôAdef p5027_2(Ã%):ãP# The-à prefix (as in?p below)Kðreserved and bouyI`definiUC to ­øÀñdirect manipulañ of ÐÓ"\£gen.startDv FPÍãMapping('a', '’ ?':Y0EleÎONS((5r, 'g1')F, {}Ft@_att?{@ �7ž'): 'en'}ì“2“@2', P‡šàÁcharacters(' ?endk `@> @ » "ù*×.×uÀ  ð 'Hello' , '#a1>')) &ñdef test_no_close_file(self):"C�result = ¥.ioclass() F‡func(out7;ñgen = XMLGenerator%;$ç.startDocument[ 1Ele–"doc", {}ƒ¨¯ÂassertFalse(!.êd±xmlgen_fragf>Î<ê3hÊÿ# Don't call gen÷ó0fooó§"a": "1.0"ý.Ácharacters("" 9endL  1barlbl2lL,L á7endÖ÷\.šTEqualšµgetvalue(),,90Áxml('\n%s' % (TcY§_½!un"´able = NoneîVBytesâí>ì/(í 0 ý!).ëe@'xmlµrefreplace'îgWriterÓ™æH(lisÑwD0 = u.append¦T1 = j¶@seek“‹iJTrue5Otell1## 3Q0 at ¹ò and not 0 after›g;¡w¿¡rb''.joiOVmStream\WJxh waraw = ¡'IO €âr = codecs.getÿ('ascii')(raw, ì2<je = raw5e.š²ä#ø#À (encoðŽding, doc)).encode('ascii', 'xmlcharrefreplace') class StreamReaderWriterXmlgenTest(XmlgenTest, unittest.TestCase): fname = support.TESTFN + '-codecs' (adef ioub(self)?wx0 = ·qcs.open$.]q, 'w', ÖDing=Ø <errors=ü€, bufferL%0)F¡‡cleanup(�a¡v.close(2÷gunlink¶'îS.addC]e!zŒgetvalue{ð# Windows will not let use re)ð without first ¤5ingÖ¤¿= G(%öname, 'rb') as f¦J×return f.readAÉ4 = �;*1xml9Àé·iso-8859-1'’Fö('\n%s' %‚Á(Nt4Ÿstart = b| ¹„$' oÐXMLFilterBaseY(Xp!_f0a_basic' 0sul‘wBytesIO�ðgen = XMLGenerator(re.xZ&–D!ò.setContentHandler(gen)ÀM'�DocumentF1Eleœ"doc", {}Ž.©’acters("cv"%þignorableWhitespace(" (9endr I7end²'³£ssertEqual;.ÒB(), “+ b"¬0 = ,xó /S@]C?=Y'(fZˆ Àue(), xml_teñst_out) def test_expat_text_file(self):$(òparser = create_%()!÷result = BytesIOòxmlgen = XMLGenerator(1‡cò.setContentHandler(@kö*with open(TEST_XMLFILE, 'rt', encoding='iso-8859-1') as fÏpÊ'(f‰ûÃ.assertEqual«ñ.getvalue(), xml_8Kñ@requires_nonasciiJQnames' labinary$2 wf>° = support.ñ¡FN_UNICODEVËÀshutil.copyf½'E?ߤddCleanup(\ƒunlink, /]!ûtŒ.(®ü?b')Ä/£bØ_�¥Qos.fseš{¸KtFC(Pd?intb8ƒ f?'rbgh.� no@.ò, closefd=False¤2¥Þþõ/f2æ/0# =C DTDda¦class Test":�ÁŒ__init__  aõ_notations = []N!’entities !"_=ADeclc , z÷, publicId, systemId¥\@¯s.append((?Oz!uno dEžy€, ndata‡ã†E�‰^–Cdtdh \k¬Q 8À = self.TestãDTDHandler() §parser.seth',) 'ý feed('F €NOTATION+ö PUBLIC "-//CompuServe//$ÿraphics Interchange Format 89a//EN"p]p")%<rreturn ?«‘def test_·_:¸r³ŸO¢ = create_pô>I.0(¡”result = ɼhðtContentêÒXMLGenerator(A)¢8¯Ø!Ù�whatever^*&S;d'åù.getvalue(), start +Eî"b"ÙÝ5>„íp.µ¹ÈÝ�bverifyÇL(_Zfüwü~ o='val'À.close()  ðself.verify_attrs_w‚(gather.0) -ðdef test_expat_ns*€s_empty(I!):(,òparser = create_5(1)"b0 = :a.AttrGt6er(%7ó.setContentHandler ™qí.feed(""Hgclose(6|ÿÈÖa2Kzð xmlns:ns='%s' ns:°ÿ='val'/>" % ns_uri&8Bs = ³{úÑ.assertEqual(0ç.getLength(), ù/PNames."[(›0, "L6")]¥?VTrue(nQ@• == [] orl¦ Vs¢ 4"$?"])pÞ2lent×o|±‚Axml_ì3out;_sysid–ø !ç("$õ@requires_nonascii4sŒC 6 Lfv*§.Ø¡FN_UNICODEZ¶ hutil.copy« Þð, fname) sóelf.addCleanup(support.unlink, fname) òparser = create_%()!÷result = BytesIOòxmlgen = XMLGenerator(1 cò.setContentHandler(@k|.Ò(InputSource(µSsæ£ssertEqualuó .getvalue(), xml_test_out;Adef ¡expat_inpsaÐ_byte_stream(\%):Ž!t±Xrc = @öwith open(TEST_XMLFILE, 'rb') as f×ÿO™ÜSÿfP$ÿ”1M,/.aˆ7Ÿcharacter�Éÿ t', encoding='iso-8859-1¤ C©X0# =Ò IncrementalP1XI X. NN n�°!Õn ÚÖ.feed(""üG/oclose(’start + bt<\˜Jo_resetP³Wtext"74õ;×L‚ïî¼M 9Ì(1x ,�àLocator supporñt def test_expat_locator_noinfo(self):)-õresult = BytesIO()ðxmlgen = XMLGenerG(1&òparser = create_Gò.setContentHandler(`)µŒ*Ìfeed(""h./gclose(SîÓ.assertEqual(dögetSystemId(), Nonek5oPublic5 LineNumberl1Ÿ§Owith©„¤DÓ(TEST_XMLFILEÚ$Dy >9=�°ñ @requires_nonascii_filenames!n 7 fC° = support.±¡FN_UNICODE[² hutil.copyx !, E `¤ddCleanup(\eunlink/]s¤jäô!r.(ר·ô7O6íO # =7ð # # error reâ1inge7 = class EgRf�Test(unit¬.CCase› ¯’inpsourceÎ")) #ill-formedhp0"a I "fQ![6tryÜ^±?.!Gfailͱexcept SAXE Šion as e[:\+e.Wœ¾ Ñ�completeÉ,ÀentHandler(CóontentHandler()) # do nothing ðself.assertRaises(SAXParseException, p!r.ÿ, StringIO(""))NaEqual(3ðr.getColumnNumbŽ?, 56FLine411) kÑdef test_sax_c$_e®P_str(Ö!):,èÐ# pass variouý lues from a locator to the ÿ7 toIámake sure that2_s÷__() doesn't fall apart when None isG�ñed instead of an integer line and c4! n5> ò use "normal" vaØÍ$heÙ ß±("message",¨,^:[r.DummyL9g(1, 1)#–ôf‹ÒÇ�Ny’ [”N1\&Oboth‡NŠé clІg�__init__S,›0no,š'nob(_½Cno =+e"1col!Ñn±getPublicIdq bíreturn "pubid";oSystem; ?sys;h¥x.á } à*D û?# =7ñ # # xmlreader"se72= 2AXmlRg€Test(XmlbBase):Üñ AttributesImpl꿼attrs_emptyïBr.verify!_-(OL({})( _wU s' U"ž" : "val"c ns!º/¼ NS _({}, Â0� Lz' =XMð(ns_uri, "attr"ß) : "val"},  ñ{(ns_uri, "attr"=1ns: 5}) Bðself.assertEqual("ÿs.getLength(), 1)/PNames.[{]?Q@"¨9 2len« 0C3p4645776¢€41677958‹à3070097648 I25Ñ"48p1688656a€81011634»p2495074 32669034802B7123 €10019165;@0871?I`650630í�382127517„p1650528‚€12824652¾€36015706¾�31324132´€78057045r2221429M2ƒ 69 @6115­€1 I94703òð I2991908938 I75090Fp6325751â�163201446î@8464–p3472617Š�29039594²@3973r�6 I19045Ø  I77464957p1645985€24295876 p7382445ˆ�156330497¬€39931741@p0213162Ü�31879332}�126780757æq1190784 p9516921Öp3580100ˆ€27299782$ñ3736811646 I300965641jQ93043p0402’ôw6ƒP48880—Åð74866844 I44287637_q8536872½P78592„ì`513785£P11805Š€28031469h 98Í7×�21929194×€08702618‘p4808380 p7384529®q6879861“0049ÓYo@4929�346831129q3796211Fð88988633 I16432106}€29839981þ�24927308p5860487Éð604073029 I41210828¿q1496476‹�29723571_q6631169SP64262§ö 03Ha871862d­0803/€397476660730Æ �3842528855p9290936Ž04462b899088ß 95v2p6754793é`305178µ° I151487661p2540365R�242045064Wq0343773!€33299059€53517512 S85834V 07a0#a707278©01282_ 33€"42 `856724öp8831706 ð2005666473 I34031ñ0122$ñ04641h‘370257611 0055‚»qî`944353_`757710߀20124842B€30586497–@09708 53ƒ25pP37864ð947790 I2582724774 ðI4291336243 I25681898 ð61923072690 I1121589611 I837696302 I3284631720 I3865021324 I3576453165Sð59531629 I145923176<ðœ506550036 I3754420159 I2622000757 I124228596 I1084328605 I1692830753 I547273558 I674282621 I655259103 I3188629610 I490502174 I2081001293 I3191330704 I4109943593 I185994850Óð163806460 I508833168¢p5637103=p70925371�206895657ê€09284281Gp9139265€20396387öa981982p5360941Fð368855295 I5199397þð 597480732 I4058175522 I215£7™@196231:à 89ê�952353788¥ð 45548108 I2370669647 I220¸3€57639299H�732303374`531362¥€53764195›p7386917G 3232854186êY° I282976027ƒ¿@8785m€202425792�7623619700p6394934ã�64063586746=4Ža8576793€33079808>q45740053ð135610046 I60640071±8�@6026Ö`981133mT29772R92732hq9038200Ép5990887ß�612335971¯q3405222�`344759 3684202717¶p1501134kp8256785öp6899695Gq3934753o€30349606…p2085732%€40041137€39929048  2587153719äp2917907}p5654249p7791306„€10485829ø€32135916O’360779343í`125493À047811901 I7 5¥Q48544�q4210090P23314&ð4 I70057213 I7764749þP52888¬ÂP03612âq6495526¸F0311¤424d�41415644Ä2Ð6139 I8688436Ÿ€23376030m�191813144RP84343 Ê`255190ÿñ673340118 I421408—�152045490†€80472263ñ 621ž�232996800P94646ùp4305831Bp2940265Ü0539ð5,a922761¡P41886K0 I3þ@5445v€39159579ó€54498179¡p1917808ùC 2320297>8¯p5713050E0423a8u�36119164!R04516Ì‚29823497Ì8®!41 P53380i0839ƒ�18191517[q4123474 p3867703Ô€39145894º�378310497Ù9oOQ05462È6Ýp1060132œp5454834Æp3006005]p51664118�36930210iP85291zŸ0400²0`674079m€14795579 �36211888Ól 09=€35784411‚ 1227055556¼P68983õ3H@5498ü0583&!2™ûq4097682#�210672801Çæ3f[0676#�138172643p7986701¶ 13¾@4961Ñ 52£ 5¬'5P57875‹ 16À0430‚P10126®ð I1950513752 I1121355862 ñI3586816903 I438529984 I2473182121 I12299972#ð05445940 I1695535315 I427014336 I3916768430 ð2298359 I1884642868Q`447308]ð741058080 I567479957 I35276211.ð3191971011 I3267069104 I4108668146 I1520795587˜ð6581006 I47379447à562126550 I929 Ð10 I889533294–ð66556608 I8745186-ð3520162092 I3013765049óð20231414 I5472464ð3998093769 I37371937¢ñ3872944207 I793651876 I260638431uò5991012 I139483633èñ2011644 I85438042:ð18666767 I256830200—ð995512132 I229491093ip7350028£€36455073¤€83692341S`436569E�394438898q0649496G4÷0637Çr70324440 90798829 IP42578±9² 22&HP01550ó174247824 I624 tp2 Ntp3 b.import ast Ttypes tdecimalóunittest a_global = ' ðfvariable' # You could argue that I'm too strict in looking for specific error # values with assertRaisesRegex, but Pout ia's wayc0eas ñ # make a syntax ]{@the ÌŽpngs. Es‚Pally W° all of theGôtriple quotes, raw:°, backslashðetc. I think it's a@ðworthwhile tradeoff. When I switched to8ðs method, I found manyEñexamples where I wasn'tÉHwg‚ thought ô. class TestCase(Ç.£): defh@AllRkð(self, exception_2, r�L_Î3ngsDHÎ trf #f"d`@.subЇ(str=strJ(,a(�DH@evalg%) ñ __format__‘!up÷C0# MEVsure ,1 isÁ€ed up on* !1not‘instance.o‚‹X yX~,„=�return 'I'Ècx = X(Ù‘# Add a bB_]lde 'y' §T5not¯!# È&'x%Ìysn'y.f= 1s.MËÀType(lambda ôß4: '{G', y½$.ìÐEqual(f'{y}',*umat(y))¤,$* ÷9(x)YZ#î×@callª!hin3Rstillj%iBÀ # returns ðwhat we expect (soócan make sure we're bypassing u# it).ÿself.assertEqual(x.__format__(''), 'class')4y4µinstance') 8æ# This is how gÿactually called¡xtype(x)s?x, ª=y=y=°Ðdef test_ast(%!):Gõ # Inspired by http://bugs.python.org/issue249758H& XIMiP__inip i .… = FalseU D!,__­  D:TruC#…return 4\fx = X(ùðexpr = """ a = 10 f'{a * x()}'Gàt = ast.parse(8FÐc = compile(t}z, 'exec+MËŸx was not #(x& uA[Ærun the codea{)(c2 |Z”I w�<Ü_line_numbersœP/ÚÃå1t),‚fModule~ .ælen(t.body), 2)’# check `ë` BpC3[0]xfAssignO61.#/no}of'...'}1}OExpr{ Cô“[1].value·�JoinedSt? 2>D_s), 1x:9F}AtedV—wA%1]A3| .ï4":?s[0r0båbinop locationÃ+= { 04¹F¯_BinOpö 1D.lef?Nam Ðf3.opiOMulthDrighiOCall6dÿ¾ Ðbinop.left.li£neno, 3) ÿself.assertEqual(binop.right.li0¯col_offset^_left.3‘417) ÆÐdef test_ast_²ð_numbers_multiple_formattedvalues(õ!):>õexpr = """ f'no / 0ð' f'eggs {a * x()} spam {b + y()}';Jàt = ast.parse(\n�type(t),2oModule.ælen(t.body), 2)Ÿ# check `¿%'`éø íR3[0]‡FExpr\4 .#:�JoinedSt? n^É?...º1º /1]º~[>D_s), 42 :v6 (; CÿFçVç‘$2M‘'3C‘ÚÁ£ …4!·Es[0]‡ r>1>*2>*3> ¡the first Е location O1 = Ûå1Gÿ_BinOpw 2D.lef÷?Namõ ¤6#opkOMultj:7OCall7fP+Ê0�saò8»� 4À selfó.assertEqual(binop1.right.col_offset, 12) ñ# check the second 8• location*ò2 = t.body[1].value3s[31Iself‘Btype–Ö2), ast.BinOp�2 S.left7OName6#op4?Add316OCall7¯.lineno, 3+?eft0�1é2‘5– 617) úÐdef test_ast_ð_numbers_nested(å!):,„ðexpr = """ a = 10 f'{a * f"-{x()}-"}'-1t =<`parse(?vs7_Modul9 Blen(Þ?), %`¢`½ÌãC3[0]EoAssign¦ R%0]é}of'...'}1}OExpr{ ”±Ò·�JoinedSt? 2 O), 1xJ9 FormattedViN A1Aú ïu4û's[³>U#NM0M¯LK".JOMultŒ Rö{ŸN65NȾY¶_àÞ õ^  g3‘g7YE;] callKÀ self.assertóEqual(len(binop.right.values), 3) ²self.assert5Otype6ß[0]), ast.Str? 1? FormattedVŽJ 2J‰ ù¯[0].lineno :1:&2:call = j§¡ A�OCallG*÷)ñcol_offset, 11) ‡Ðdef test_ast_Bð_numbers_duplicate_expression(S!)::eD"""D' '[!õ2NOTE: this is currently broken, always sets location of the firstk^.5""" 0 = ÿa = 10 f'{a * x()} ' ,¥1t =`parse(MxHt¤oModule.«¦t.body), 2)’# check `°`Ëe¸C¬fAssignO6t}of'...'}ê?Exp*±"1]�/oJoinedà 2[>Dá5ó á x:9¦N Ê *‰ Ë[í‘23;‘ 4C‘Ú;} K4!AsÕñ  8 ó °D/s[÷ ö35> Àe.values[4].Ãlineno, 3) õ# check the first binop location)ò= t.body[1].value3s[00ñself.assertEqual(type(FÆ), ast.BinOpŠ1S.left6OName5#op3OMult3DrighiOCall6Ê.R È*?eft/Š0©col_offsetß� 3‘47FosecondG$2Gÿ{ÿ # FIXME: this is wrongåì+/3)K%wL�OthirŽ%4Žÿÿ,&Ðdef test_ast_.á_numbers_multi€fstring(­!):7ž|T|Eð1 demonstrates invalid behavior due to JoinedStr's # immeò0diate child nodes containing the wrong lineno. The enclosed ñ # expressions have valid7÷ information and column offsets.FÑSee bpo-16806,÷30465 for detail3wò = """ a = 10 f''' {aW*ñ x()} non-importanté@ent 2BÌð t = ast.parse(c)Fñ self.assertEqual(type(t),2oModule.ælen(t.body), 2)’# check `Æ`p C3[0]xfAssignO¦1.É}of'...'}1}OExpr{ !€ƒ1].value·�JoinedSt? 2[>D_s), 3x:9| Ü »CÿFÜAtedVÚº Ë$[2M ‘q# NOTE:‡`follow•"in\ö behavior is described inB[-Œñnumber should be\r*first*"‚(3), not la&(8i:# -ÂM4_be -1L‡Yµ,4!oEs[0]ùr>1>*2>Bcol_F, -1z!9&è?0].C-1C/2CgG"pcorrectG  ·zwithin Ðl‚binop = À Ž^¯ F_BinOpà 1D.lefe?Namc µf3.opiGMulthÀelf.assertEqóual(type(binop.right), ast.Call) Ðself.assertEq61Ÿlineno, 4*Oeft./Š06_ßcol_offset, 3.l�3‘417) ðdef test_docstring(.!):@"'f(¥f'''Not a 85'''4Cq IsNone(f._c&__ßYgYX% \Z}jgj&gâÌliteral_evalåWwith LòRaisesRegex(ValueError, 'malformed node or 6'!… ql"f'x'"vüast_compile_time_concatŸ‚x = ['']´ñexpr = """x[0] = 'foo' f'{3}'"""û)1t =`parse(7‚Cc = ~æ(t, '', 'exec'#&(c$K,~,3'Þ\Ú _eIsáW1All~r(SyntaxyÏÓ ð'cannot mix bytes an n ‡?s',F °[r"""f'' b'A-  - b'q-]“]f“�("a¶a$  $  Òunterminated_È“™B 'f-:(: OG t?{"xFsQf'{"xáY  Of'{(Z([ Îÿmismatched_parenÞEM° "àO(}'"  °Ïdouble_brace¬ b {{?{c a&a' 1{{bMbN(+a{)Àf.assertEquaól(f'}}', '}') ðself.assertEqua%a&a' 1}}bMbN(/a}) "{{x{x a)a* 3{{bSbT ScÎ?{}cÏ U/a{V ªWaXW,/{b„-…²Ð Q{{{10ù?{10Þ $}}+}+X6Y a‡"}a‰µ P10}{{“?10{\ ³èçÛ +X}Y@a{{'4b, '10}uºõ'# Inside of strings, don't interpret doubled brackets.?~ {"�"°/) /õAllRaise(TypeError, 'unhashable type',:î `["f'{ n° }'", # dic¸o a set< # ]—ðdef test_compile_time_concat(ß%):I•x = 'def'! ~ð'abc' f'## {x}ghi�abc## defà=`{x}' '- , :ƒQi{x:4‡2abcCíŒ 'zf , î² {xk70/}0}19{x}35f/{x1 d/x}— " '8, (1� »/ '.‡Ý „2W2- &'1‡1O1def2iå Œ3f'-;Odef-4ÀassertEqual(Ó'' f'', '') òself.assertEqual(% (Tv?f''s%p Èñõ!AllRaise(SyntaxError, "f-string: expecting '}'",D< `["f'{3b+ô # can't concat to get a valid dS A ]) !ðdef test_comments(·!):†²# These aret'ò, since they're in Û%s.;õd = {'#': 'hash'}d pf'{"#"}B#C ‘f'{d["#"]+VɬW� €Àression partRïnot include '#•"1#’@ # eãq becauscåbecomes "(1#)"´ í0(#)Z*�')( <ÀWhen wrapped·pÚps, thisÀ©Q ³ð# '()#)'. Make sursat does4Fpile A ’ƒmany_exp¨šƒCreate a{` with 7|särit. Not˜Ý # ð°awe havK1pacÏðhere as a literal, weëˆactuallyH goË1to ý1wic;‹ôast nodes: one for eachVFJplus%ÿ>³÷build_fstr(n, extra=''·Vò return "f'" + ('{x} ' * n) +4b + "'" 2ux = 'X'”–width = 1#ö# Test around 256™Ûioërange(250, 260–¥Weval(Ñçi)), (x+' ')*iß{÷1ena?€2 largs 7ingi‡255)*256oA(255wGs = Ÿ¡253, '{x:{?}} ± Ýsb7254\Óylots of·0andâpstants, 0catö&edsœ1õ1}' 'x' 'y'" * 1024Å”@'1xy/•]þformat_specifierŠÀ: wi£dth = 10 Õprecision = 4òvalue = decimal.DÅ('12.34567'),ñ self.assertEqual(f'result: {H¥:{width}.{mU}}', '‹Z5W /!rYD(:0Y/:1´3O1}{0ZCR 1}{ \ i·%¡{10:#{1}0xª¢_ 0xa¢ 7Ò{"#"}1{0}{"x"5?U-10:-A|-|=Q{"-"}¹ ~Aôò3 != {4:5} and »Šõ!AllRaise(SyntaxError, "f-string: expecting '}'",D! ð["""f'{"s"!r{":10M_""", 7 ÿ # This looks like a nested format spec.E &])fáá‘invalid s÷Ø 9# I0g insid§ o4:{/5}H Ì ­0ressA¯too deeplyåQCan't9xoifiers~ "CM:{0}•Š ÿ'ÿÕ`conver¿ character'» @# Noí!an8áJ or„ ñ# the : or ! itˆ3 35{"r0 W �def test_Œà_effect_order(y%):zvclass XS?Œ__init__1 HV.i = ;œ=,¤t(CE+= 1�’return st²#.iÄÀ x = X()  ðself.assertEqual(f'{x} {x}', '1 2') ,ð def test_missing_expression(E!):'+TöAllRaise(SyntaxError, 'f-string: empty Lå not allowed',SW �["f'{}'"&  &O }'"L &O {} N/!rv)o10:{ }U2 { ¦Ï ð# The Python parser ignores also the foh?ingL ñwhitespace characters in additional to a $.O ð"f'''{\t\f\r\n}''t3 q# Catchµ 1`beforeE ð invalid conver»¬?{!x™O{ !x?!x:SO!x:a*}U+W1 9!{O �# We find«øÇ‚@ cloŠo braceÊj F ó/s:(&xM]bŠÐ# Different e-Ð message is rJÏd for other ˜ ˆÖÕ¯identifier�Ë3xa0ÇÃ_"\xa0®  o—parens_inqsrÆ!3,ÃD(3,)Ä›A# Adƒøse because when an‡Ðis evaluated,B5ensà`# areþðed around it. But we shouldn't go from\kDö>�Pone. ¾Sadded{pHjust@�supposed|Ëð(including newlines). sñelf.assertAllRaise(SyntaxError, 'invalid sO', Ÿ["f'{,}'"'  'ð # this is (,), which@an eƒp E ]) !sÌ ÿ"f-string: expecting '®Õ_3)+(4+�@'EOLñ€le scann�¡� literalo/\n—ò def test_backslashes_in_v`_part(G/):VÐEqual(f'\t', )&r &?\t'' N( Rf'{2}x2*0{3}¥O2\t3€ +*Ò€f'\u0394W Ù ./ ^0�22ñ5  e3g2( U0, 2\c 'f')l8<+3, ' * ‚69@S1 7Hñ N{GREEK CAPITAL LETTER DELTAßH·IÈJ,• Ká_ /2\K ±àH 3I’ ‘ IÚK 0x20w š 3r'\'\ 4 Ðx20', '\\x20'3) ÿself.assertEqual(f'{2}\x20', '2 '+2{3}.3/ W, +† 2-VU )3*UÙ ÚS* ~Hwith/ðWarns(Deprecationõing): # invalid escape sequenceÌ€ÿ value = eval(r"f'\{6*7}'"N4, '\\42ò \N-r{-ªõAMPERSAND = 'spam'ö0# Get the right unicode character (&), or pick up local variablá# depending onRõnumber of backslashes.{¸%N{¬j&! 11\\Ná€Ofr'\7!?'\\8¢Óódef test_misformed_M_M`_name(ù!):5Dq# These=õ are needed because“<s!gparsedAÿ differently inside f-stringqó AllRaise(SyntaxError, r"\(´ eC\) ' '  c can't deà bytes in posiG‚ .*: malG \\NPI%",¿ [L/N''  '{(ð GREEK CAPITAL LETTER DELTAB’ q # Here€/Dnon-dŸ versionsÕ ñ # which should give*Bsamer¯ Or"'\ãÔ5M{ <1]) 5ü7no_ì _in_expres\_partý —”'eJ J„Önot include af'ˆ ]{\'a\'}$of'{\t3*(rS-€+Ð}'",  ÿr"""rf'{"\N{LEFT CURLY BRACKET}"}'""", ;Ÿr"f'{\n}') 1]) Jñdef test_no_escapes_for_braces(self):*d5""" òOnly literal curly 5õ begin an expression.7CÖ# \x7b is '{'#uð.assertEqual(f'( 1+1}}', '{ %')S0.- �u007b1+1/Ÿ¬1+1\N{RIGH¹V-}'t¶ewlines_in_, và!{0 0Ù Ðrf'''{3+ 4}''…7�llambdaæ_x = 5^ "{(9à y:x*y)("8")!r’0"'8/'"ž @!:1ÕC? FD…8²DË## ¸÷doesn't work without parens, because the colon@a makesõparser think it's a format_spec5¾ðAllRaise(SyntaxError, 'unexpected EOF whileŽ_sing'ñ [ðÕ?x:xø \yieldñ # Not terribly useful, butB sur >e turnsñ # õ unction into a generator'zGfn(y_±Rf'y:{WRy*2}'§�g = fn(4[¬next(g), 8kRM_senìˆxˆ1D f'xŽôŸi: x * i)œ&10�Cthe_š#= ™ýã.g(4), 4I ,!g.È@'str"d), 'x: 0Õ×W_éò_triple_quoted_6r°"{'''x'''}"ox f,ceric's1""–Îñ# Test concatena-¢ ;4,Qx" ""_�"s""" "y"ˆ 'xr?"sy© ;'{"@<; wvÀrtEqual(f'{"ñ""x""" """eric"s ‚y"}', 'xSy') ÿself.assertEqual(f'{"D_""y""HrI’ðdef test_multiple_vars(¥!):"·ex = 98•y = 'abc'0 ÕAx}{y 98,/) . %X{/X0z]X^X_+/@{y}X’]/X'ŽY`OX98Ya¿YbÀYó x}Á1 98Â1" ”Zd•ZÈÇ|closureÁ wouter(x×.kinner(æreturn f'x:{x}ï<Ûv€'987')(): ë27.7ä�argument§˜2YÚ«f(x, widthÞÚq={x*y:{%?}}'˱f('foo', 10Ép=foofoo í,F'bar.‘6(10F@-20ê]localçµvalue = 123ídA'v:{*„]v:123`pmissingôMiabl7Wwith [ûRaises(NameErrorUftH„_j¼format_spec¤vclass OvA#__6_3 , > {,aif not Eõ&'*œZºú«QO():xSxõ*(*(:)Ñ "{3(ÈŸy63!s)QF‡aglobalGAERg:{a_.œ"g: A var+Õ ? !rAL"g:'B"…!a_ìY hÁëg0} l³=5}',6: 'Ë1 l:7ÜÀ_global!r}',/ õ"g:'global variable'")0ò self.assertEqual(f'g:{a_30} l ¥local!r}',8 o2"g:4gA l:':yBzôIn("module 'unittest' from", f'{A}') @@def %“_shadowed°(U!):$¢ÈÑ = 'really a ”'$3k', 'g:=@4 ƒ A"É¥’¤ ¨¤¦¤ É; l:sÚ Ç ó#s ÏAg Yt4Lcall)Wfoo(x=®÷return 'x=' + str(xºÈ{F@10)}8Mx=10³ünested_fstringsŠUy = 5òbq"{0}"*3c 00b«/y/=555‘‚invalid_‘�_prefixe™\ðAllRaise(SyntaxError,»ÿ expected EOF while parsing; ¯ ["fu''"`ß?"uf%FJ/fUJUo/uFJ?ufr&rq/fuL/frrwrx/URäF¾bK/fB%FJFJb�bBJBJ À ]) dðef test_leading_trail óspaces(self): ÿ .assertEqual(f'{ 3}', '3')' (/3 O&3 (x õexpr={ {x: y for x, y in [(1, 2), ]}}',Cé'B_1: 2}ã )k µl)d£Qnot_eu†•ñ# There's a specialÕïìthis because t(bìp# caseñ the f-string parser to lookRÀ!= as not en48 anGñession. Normally it would, whileM_‘¥!s or !r. Gá gA3!=4OTrue‰ {,:-/!s.":.õRTru')¸¨`conver?¡3.14:10.10ƒ� ä W.14!s:4>:r:&a:¿ 1"a"àa� P"a"!r*_"'a'"S ,a,�†# Not a ‹.\A"a!rŸ ÑLIð , but show that ! is allowed>a$1matŠv ±6:!<ü!U„±ôAllRaise(SyntaxError, '®—: invalidù¯ characterå ï ["f'{3!g}'"‘)A)3)G)!):) s*q # no û| beforeJG  ];·"·`expect'ˆe ¨ox!s{y}, «sÞVÀ  ä"f'{3!ss:}'", +s,1]) Mñ def test_assignment(self):hñ.assertAllRaise(SyntaxError, 'invalid s'§ Ÿ["f'' = 3Ï 0}+x+x+ ù?delòNodel f'Á(/''+ Çÿmismatched_bracesÕÿ"f-string: single '}' is not allowed‰ Ü/{{~ª?{}})%x&x„¡r"f'\u007bS  ÿ# Can't have { or } in a format spec.C a3:}>10p c,-"AÃü�expectingÿðO3:{{¿�å!':'/!s(Q/:3S/x{&—&/3:î{œO{{}})ê‘ð# But these are just n5"l …s8¾õEqual(f'{"{"}', '{')`(}(}( b3:{"}"ZD, '}38 !2:‹�{,2'aÝif_conditionasð# There's speciaól logic in compile.c to test if the ð# conditional for an%ð(and while) are&ùstants. ExercisEµthat code. \1deftõ_fstring(x, expected):'Љflag = 0šif f'{x}',010Oelse+2+ðself.assertEqual(�žÅÏconcat_emptyÊ /''Í€?nonÑ' ÒqÔ`e'', 2)é f ', 1)Ù Õ? !D LH1‡H%L*^ð_format_specifier(¯2Px = 'À'ì" Ñ:,(Ž)?:}'*/!s,r,"«"|ì4strê¼differencesì²d = {'a': 'F%',õ Ì 0: 'integer}*a]Ad[0]L3 Rd["a"1—0 a._@'{d[..e(d=d),ÿh9Æ 9s�ýinvalid_expression~*ðAllRaise(SyntaxError,{E! s ‚¢Û[r"f'{a[4)}'"È& +?(4]+]Zeœ Ìñ# see issue 26287mæDTypeä¿unsupportedáß(lambda: 0):x¿ ê?(0,-]ÐAllRaise(ValuÿeError, 'Unknown format code', ÿ[r"f'{1000:j}'"-  -1]) zñdef test_loop(self):–ðfor i in range(ˆ"1ü.assertEqual(f'i:{i}', 'i:' + str(i)nLdictnýd = {'"': 'dquot"'": 's@'foo:/statm: we don't pass.$ #{P' PID�Àavoid a raceÂ`ditionˆ1cas»Á- unlikely -6ðrecycling. # IfYW‘ crashes, �ing from" @ ent>ôill fail with ESRCH. import os %sy ¢time tryœô#page_size = os.sysconf('SC_PAGESIZE') except (Valu?‚AttributˆX´\ _]+a-Xò4096 while TrueÖAsys.ír.seek(0ÓÐ6 = i(±data = int((².split()[5]!6õout.write(" ...³@I0: { •:.1f}G\n"û.u(+=6 * Øí/ (1024 ** 3))€Sflush¸Ñ”.sleep(1)ñdbase64 TemailËurllib.parsetrequest´http.server th<4ingå’hashlib »Cest ˜0sup …$sljIéÒãsl = None her¯€path.dir|°(__file__) -ð lf-signed cert file for 'lôocalhost' CERT_lð$ = os.path.join(here, 'keycert.pem') # Self-signed ð file for 'fakeZCname^a 2bõ # Loopback http server infrastructure class+QHttpS)(5.5R.HTTP ): """Uðw/ a few modifications that make it usefulãBl�ñtesting purposes.A""" ódef __init__(self,uð _address, RequestHandlerCѧ«È.Tk. |8¤árð t the timeout of our listenõsocket really low so~#k±we can stopM­r easilyXnF.PC.setsR(0.1)“tRget_rYwRýõ method, overridden.½nE„, client;8 = ˆsaccept(�8•# It's a *`connec[Q, so »!ngêÄ)ñhouldn't affect anything, but s¨@ödeadlocks less likely to occurMßIG10.0Ƀreturn (* )„�Thread(tBing.‹Ò"""Stoppable $9run85›ä  ¡"_hIgŒ^‚ >)7Ò_€_|z= False"Ö3y =µW@Evenþm ‹ñ.protocol_version = �Z/1.0"]î?d =Óõ("127.0.0.1", 0),:t � òDportÐ8_SLÅ,Se web7@if iþÐcurrently runÁ¯pBTruet"‰ ´ ¨Tclose}©`Digest+ïc“¶a€ perform8d1) a]Fí ö°¤ð_num = 0 ó self._nonces = [] @user+{}ðrealm_name = "Test R"(0qop!aauth" Àdef set_qop(eq, qop):|. = 5�7 9ñassert isinstance("{, dict)`1 =  dÛd d�ý B’_generateVHAåquest_num += 1�Šñ = hashlib.md5(strFE._re7ü).encode("ascii")).hexdigest(íV‘s.append(#qreturn Ç0creŹ_Aƒ!, 7strÓõfirst_space_index ='–.find(" "pB&[CB+1:]�@part†;¶.split(",")%ª7 = ¯@for @1 insj[Â`, valuÉ)]=´*0 = 1g.stripg "ifGã[0] == '"' and$-1 9}V[1:-1† Oelse6 ‘[´2] =Œlù'KŸd_validÿú`ù, password, method, uri1nal6 Œi0.up`(} f%$["i"¾ Á*‰( &1uri#5uri pHA1_str¦%2.Q)s:%(Ú {f)s" % xE ¶W§6HA2„ÀxWs2sFsÅQ["HA1&HAŠ 2 2ò†response¸1HA1µJ uc)s:" \5ÏF"%(c.w?HA2hv ú�ÿ ‹þ:³�$[""†3_'“challenge›hhandle d.send_`÷(407, "Proxy Authentication RequiredˆLúheader("Content-Type", "text/htmlAÀuest_handler÷.send_header( ú'Proxy-Authenticate', 'Digest realm="%s", '82qop Rnoncei ' % \7q(self._Xr_name, 4qop ‘generate_KE()))Cò$# XXX: Not sure if we're supposed to add this next õ7 orEFnot.ùrequest_handler,°'Connectionfclose'� ;f/s(&áwfile.write(b"� �èion Required."G±turn False ¿Bdef ¶_Š`#, Ó!):/÷Ò"""Performs dåaü{ôon the given HTTPNDs`r. Re“Qs Tru� Kówas successful,»‡¢otherwise.Îð If no users have been set,•n³p is eff�Evelyž³disabled anñmethod will always r¹¸ 6"""Šaif lenP!._‘f) == 0K°H ;ÖWPorizaA„" not inPž.£sZg__¼_challenge(æJelseN:cdict =q0cred Ü §[Ü]};¹5if k ["Pþ "]ä 9…password¹([N ‡RM Z@i¤t�a.get("­&")ÐÑr'ÕDt‡.remove(q6"])¥Ê!€validateb\ `# MSIE“Às short_pathçCits =ùion, but Python's“# urllib.±MePfull PC, soËPgoingÈ seT J ei60 of¸m works herE·1forY©[xqr Þ]=P#if²òe3c,¨2Ð1 §command@À pathO): ùauth_validated = True +zif not *NÒreturn self._ _4ù challenge(request_handler)g3€ò class BasicAuthH2ò(http.server.BaseHTTPRV#è3"""ð for performing bTÎáentication."""�1# S]Á side valuesñUSER = 'testUser'dPASSWDBPassPREALMBTestA_0°"%s:%s" % (", àENCODED_AUTH =±Ñe64.b64encode2K.Á'ascii')).de$ËÐdef __init__(¢Ð, *args, **kw 7"d.L u³log_messagex‡#at€vó# Suppress console log =n�Fpass_qdo_HEAD[Lâò.send_response(200]E ûheader("Content-type", "text/html"6U59s()‰®�;401W­X`("WWW-õ ‘ Ð realm=\"%s\"=ÉmP Ý0" %ð ,I�"ascii")v ò "Our apologies, but our Ýÿ is down due to "{ ð-b"a sudden zombie invasion.") # Test cases class BasicAuth°s(unittest.CCase€`USER =nbstUser‰dPASSWDBPass¦INCORRECT_"’Incorrect#PREALM:i"û\setUp4jsuper(«,‘").1gb# WithØ Ù¥entication=@def ð_fp_with_b  o(5 öbreturnjiz 6w2sñ = LoopbackHttpSËThread(šïT’addCleanu:S.stopÜ *~€_url = 'jô://127.0.0.1:%s'ê*_.portÁg.startU‰5ÇPy.wai!>r– á4elfÐ'Xv = None-�tearDownO04ò|successW&ahWÞ.z™upah.add_ßAwordR.üÀõ‘j =MÒ{ûinstall_opener(Tbuild'ah‰:tryÉ»¬assertTrueJ0urlc¼â°RdexceptrQerrorE lafail("7 à ðed for the url:ð+ %s", self.server_url) def test_basic_auth_httperror(4!):)-ð ah = urllib.request.HTTPB<×AuthHandler()3Ñ.add_passwordRm.REALM’CUSER öINCORRECT_PASSWDW …ûinstall_opener(Tbuild6ah)GàÔ.assertRaises;ÿÜE ,ö0urll¨ VÀ class Proxy Tests(unith.CCaseWpURL = "sÒ://localhost"ž :1er"V 2123TaSRealmDâQsetUp|wÎjsuper(¨Ñ").1) # Ignore p×0 byÑñ settings in the environment.¬g€ƒrestore_!D(old ‘.3os.%X.cleaK iupdateKtØ«ddCleanup(€(, gGopy(õ['NO_PROXY'] = ''`$1no_$%…0dig^XA = D27”�_users({$:×}°!|ErŠ7c# WithŸ  ªenticationÒ²create_fakeÿ"_hÞÀ(*args, **kw à±return Fakez±,, P 4|ñ = LoopbackHttpSçThread(«øJa0Rstop__ *g.startì6{.zXy.wai!(}¨óò127.0.0.1:%d" %ÐaEportO`‚ H{K2" :ªm †V ¨.er” sõqi.Œšƒ°Mm'ˆr = None4ŠJ±vwith_ba�!_rt³ä IURL,  lã*ãk+"bad"�ËdÐ.set_qop("autSh") ðself.assertRaises(urllib.error.HTTPE ,29Dpopener.,QURL) Qñdef test_proxy_with_no_password_r”Q_http‘(l!):<‚@.digCðauth_handler.set_qop("ð†@qop_¡o_worksÝãÞ5add$6�.REALM, ?URLƒ 8 93SERDkPASSWD(†²‹i‚result =“°†bwhile 2g.read(ã%ô(oclose(HX2int\ï_or_throws_urlLošG-intÜ6try7*„yexcept þ1URLý Vð# It's okay if we don't support šP, but•certainlyÃ�€# should;òreceive any kind of ‘ûion here other thanF$a §.ýENone#ifh Ô‚² †c.Š Ï²GetRequestHŒÂ(responses):ö class Fake` .ì¿.server.Bas#Gƒ)P_vers+@= "TzUTTP/"õr�es = []ƒheaders_}dËB= 80³lÞado_GETÄ ¤DbodykPsend_`(BBg* Sdone /Àwfile.write(. F.0 = [:-:]¨?POS©äcontent_lengths®bers["C!-L"0w”post_data7rª´Jint(\)¸dA¦….append(l䀃]Q †Uà.headers_recei÷ved = self.headers ñrequests.append(Ypath),óresponse_code, O”, body = ™s.pop(0) =TTsend_(( P /Rfor (b´, value) int:[Ï_5 <± % {'port':) }Ý!ifÈZú "Content-type", "text/plain"T™÷˜.s(#areturn Ø« ; ñdef log_message³Š, *args)ÄRpass Œi’FakeHTTPR÷ðHandler class TestUrlopen(unittest.CCase]0"""“s urllib.B".u8ò using the network.‚`These Rò s are not exhaustive. Assum<!at) OÁfiles does a ð good job overall of some|óbasic interface features. ThereƒL”eexerci½ðoptional 'data' and 'proxies' argumentP!No­]½ðtransparent redirecLÐ have been wr\!n.2""""ÙQsetUpÓoIPuper(v�,Ö")..@“# Ignore ª �‚localhosUsvXqôrestore_environ(old ‚.3os.%k.clearÏiupdateKêFÚ addCleanup €', Hfcopy()6õ['NO_PROXY'] = '*'a%0no_ y%&÷®j,Ë , è»=None, **kwPal = []@Ç0f =6B(urlMH8:try¤2# Eyòe various methodPlPl.ext¡÷f.readlines(200'È'A#_(1024F BkfinallÄwf.closeo£b"".join(l¤{±stop_serverg.'R0 = §5HtartS,’Òc&if1 isJ ’œsòdö, [], b"we don't care") hGj = Get[à:sƒ ÌÑLoopbackHttpS Thä(W8<(üð) self.óserver.start() Sself.˜ready.wai!xport = (A€handler.0 = sreturn # Adef …r_https_|(`ñ , responses=None, **kwargs):<´òif not hasattr(urllib.request, 'HTTPSH•'8<eð.skipTest('ssl sup³ AVired'Ófrom test.ssl¨As im0Imake¡Ç@ is Ê¿‡õ= [(200, [], b"we care a bit")]TBr = GetRìä(NºT= = ¦hPs_class=o yÞY#å:Á_redirection{‘”expected_Á� = b"We gßwere..."fE = [NÐ(302, [("Locai@", "\ð://localhost:%(·ù)s/somewhere_else")],NJ "")¡ ²r]Ý�N4q>¬Ddata,�urlopen(¿Ts/" %J�}×ÀassertEqual(T/, ¯ 2µH`s, ["/I 0"])êÇâchunkedÞ¶hello worldÛB_J = (‘T�b'a\r\n'!b* 1! d! 0! ¡âðð("Transfer-Encodingo —  Ç7 a| `V™?404RBad b õ–¿ êR[(4049é¦8:try6k oweebleqsexcept | error.URLE Z as fqƒ f.a|žwf.close— @±ôfail("404 should raise w"˜T0ðassertEqual(dataó, expected_response) ñ!self.assertEqual(handler.requests, ["/weeble"]) 9Ðdef test_200(B!):T lõ = b"pycon 2008..."-m0 = Fÿ.start_server([(200, []À]ÂDdataAóurlopen("http://localhost:%s/bizarre" % xV.portJ„ [~À 2Y >y?ÿ_with_parametersO®, ab"get=õ�feeling"�W/,  –< ˆÙiª*°Çpcontext,ósl.create_default_Õ(cafile=CERT_§D{AŸ Ös×#, j=\ ¶mìwe care a bit"í ¬$Ocert÷ ^@ sup™ò.check_warnings(('', DeprecationW)}op# Good k ‹åR+ Ok Ô/|-O# BaÒ-"µð Raises(urllib.error.URLE v) as cm¨\‘b#  @fake‡7nam|ƒ®ô, but mismatching 3 if|@¥„ —fÐ(self): ñ2 handler = self.start_https_server(certfile=CERT_localhost) à# Self-signed /ñ should fail verification with system*ue storeR&òupport.check_warnings(('', DepreSW5)):?–CÓðassertRaises(urllib.error.URLE z) as cmAE‘urlopen("5://ä:%s/bizarre" %K.¶,�L ñcadefault=True) .udef tes0ni(�Ùêif ssl is None°+°.skipTest("(ömodule required"³`if notM�.HAS_SNIM RSNI s�N· in OpenSSLY¡sni_name =£ØúÜ@cb_sÔ’sl_sock, a0÷, initial_contextö@1nonw aZƵT#Srsl.SSLCdö (ssl.PROTOCOL_TLS_SERVER(:C.setÝ¢_callback(Ó0N{=Z,_ *¾screate_?.?(caD É Á xªåMVdEqual(1, "¥"Õüsending_headersÛ:!({creq = ÅØ�est.Requô¡   Ø9¦ö ={"Range": "bytes=20-39"}“i ’j;reqÈEpass‚ I.~£_received[†*],‡ d_basicZ#ãN_url_Í _ ^€for attr'ð("read", "close @info{geturl"& @(hasL(¥,[À), "object rG~efrom "b à"ÎÑ lacks the %sNAibutÇjÈ?tryþœ”.ä(”Ping '' }kfinallWG#(Ú0Ù3Àb.request.ur‡lopen( õ"http://localhost:%s" % handler.port)2Pwith EU_url:P¥info_obj =!.(>ðself.assertIsInstance(%9ò, email.message.M,fj ð"object returned by 'Tß' is not an "E iŽ? of‡"ÇUEqualÂñ.get_content_subtype(), "plain") † def test_g² l()Lñ# Make sure same URL asU edÔêD.Y·0 = W×.start_server‰Âò = urllib.request.ur$68url°‹§M_url, öOœiterationRöexpected_response = b"pycon 2008... A ½[(200, [], T&)]!Odata[5Àfor line in X)ï >+ž {'_1ós = [b"We\n", b"got 4herñ verylong " * 8192 + b"\n"]›¢ )}q".join(i8|�eindex,ƒ@enumg e(�·ìŽæ[I]Î ‚"Fetchedpõnumber %s doesn't match}6:\n¹� "Eñ length was %s, got í­. (º,>±Ë)&))Å ?F + 10ð s)) threads_key = None ÎÃsetUpModule(b # Store th7�ing_setup a Daand en9pthat it.@clea!upç#0GqearDownwglobal ’R up.�"()·tQ º(ifV¾sM©Bup(*`ò ) if __name__ == "__main__"L@unitN.q() from_.bÀ import verbøDose, import_module, reap_children # Skip these tests if termios is not available iM#('(3') d errno 4pty $os &sy UelectUignalEocke@io #»Tdline#@unit³ð TEST_STRING_1 = b"I wish to buy a f¹license.\n"323¡For my pet.a, Eric,ò if verbose: def debug(msg)Qprint? el-@ass ‚ñNote that os.read() z1ndebñnistic so we needØe”°y careful #0makKËy suite Eð. A normal call5vðmay # give us less˜ð n expected. # # Beware, on0ÐLinux system,=òI put 'foo\n' into aRònal fd, I get # back)r+ atˆð other end. The behavior dependsx th㥣 # setting00new&  translati¨ðay be OS-specific-$o 0>?est2@ and9"in€Aent,¨@func]0s _µt! #.`pize_out 0can usC > #S(dataJÀ# Some operaØ]ñs do conversionìñ . We could possibly fix­#Ä¡t by doing¼�appropriazíò.tcsetattr()s. IP n'…gure outQÐe right combo’óTru64. So, juste"iz� L0doc„KÐproblem O/Ses¥Pallow¨qcertainc!inÈps for sÅplatforms, b˜eavoid BJðdifferences (like extra whitespace,, iluƒgarbage,žcetc.) 1ThiBabou«b40we àpdo withg�©@feedéEAfromðone more knowledga.lqOSF/1 (Vò) apparently turns \nYq\r\r\n.\0if E.$Š2(b''X¢ reA)vreplace(`, b'\nÎ+PnN*n'Lw 33(fdŸ€"""Read M@. M·@lockø@ever`3no ÷&{A.""" ðer = io.FileIO(pó mode='rb', closefd=False)5<€~1() �PMargi¹j"bof pty*€. Cannotš`extens;Á'do or fail'T0ingîaecause>@code¾<@too £ð# XXX(nnorwitz): ,œÐleak fds whenrG anyðor. class PtyTestó(unittest.TestCase): def setUp(selfð2# isatty() and close() can hang on some platforms. Set an alarm Eð# before running the ‹ò to make sure we don't^1Aver.¤FAold_X¢ = signal.( .SIGALRM, ÈÅ.handle_sig)C¤addCleanup9@,VHrB˜7, 0)¢Q(10) …l™qwd, fram’î«bfail("†g hung"HAa_basicH¹2tryÛI°debug("Callæmaster_open()"´+ófd, slave_name = pty.8Ð2aCGot %yfd '%d'Fy'%s'" %:>5 (61)›eÆŸ�‚%r)" % (²,<#fdÊ< 4nÓ#Òi2êexcept OSError~ð# " An optional featðùcould not be imported " ... ?%eraise Á@SkipÅñ("Pseudo-terminals (seemingly)ZBfuncw.<r^âassertTrue(os.fCdfd), 'ç1 isMca tty'ƒGð# Solaris require addã$fdùPanyth+fturnedÚ # My guessj‘that sinc¤:—5 fd#D# inx00(),M@needbAread9BEOF.ˆ½!Enx«åqn-block«`n case:1re'Ã0to R¿2”= os.get_×* �Oos.s4v, False;¶ ?1s1 |˜tj, 1024?.Belf.ý€Equal(b'¨1* ÒZ as e×Káif e.errno != ~.EAGAIN,0ɸf´l¬`# Rest.˜@orig&f flagstM9�¬>@WritÞ#toà'fd…os.writeç, TEST_STRING_#s_qFlineuEdg`I wish”pbuy a fÅlicense.\n',à ÿnormalize_output(s1)Þðchunked output")  ños.write(slave_fd, TEST_STRING_2[:5]) +? .'5:.ö s2 = _readline(master_fdP÷6self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2)) �FclosËh2os.„9àdef test_fork(�%):ïñdebug("calling pty.'&)"[Upid, W' =&H‚if pid =VCHILDe¿õ# stdout should be connected to a tty.P3`if not’‡isatty(1¹!ÁñChild's fd 1 is9S'?!Ê1²os._exit(3)$w# Afterâp, the c_» alñyÃúa session leaderÁò# (on those systems that have †concept.n‡Õ"Iny$,  ¨os.setsid(¡3:tryq/ Z exuŽ OSError8´# Good, we íKwereí So·<:]Ï was raised.ŠIpassH›ŸAttribute¢HD�pty, butð?Q™4No $¿ available?–)ðWe don't want this eUÔðpropagate, escapbNmall to§#ì™ ) and caus50ver0òculiar behavior in�½O@regrû_.py ! qNote: c‘ðadd traceback print{JhereÖQ‚An unexpÆøð z1òNelse_QÇü succeeded! (bad!že2e4yu1Wai2for†P (%d)× finish." %ôK{�# In verbôAmodeEðoò0sumû!e g çP fromÌ ¤#x or  will blockvèžChang Nàparent's waitpDXE. TãZ1s aaAðlatform-dependent amount of datazl0ten‹ it‘[. OnJÀLinux 2.6, i’¡4000 bytesø%sw\–é[on OSN@X evrðhe small writes ÷in the child above will block it. Also ±# on Linux,=bread()8ðraise an OSError (input/output e)Nðwhen it tries to QQ past_aend of ’buffer bu¶+'sO al@û+y exited, so catch and discard those exceptions. It's notOùworth checking for EIO.&¹while True:5>try data = os.°ê(master_fd, 80#.«WR]break� ifÖ o7ðsys.stdout.write(str(Eý .replace(b'\r\n', b'\n'),z¸ ùencoding='ascii')) 9o##line,@s = 4™˜—q.split( iaif Fal°dB’s != ['In`, callöÊos.setsid()'è)##âd'Good:§Q was Šd.', '']‚=!ó TestFailed("Unexpected 9Bfrom•q: %r" %° ;0(piðbtatus)Brwaitpid W re:s/Y >> 8�debug("CC(%d)Qc with 60%d .‘dCres,)Æ1if r:= 1A”self.failrdJu `ion in9”"j&ell2l °pty.fork() } ed5makP sessqleader.j3j H·spawned by {1did£âhave a tty as }qO!= 4q `Û»punknowncs÷"C###ø0Rea¦ yœ‘ now that�€C has ¬-##üñ"s1� øJ1024Ê"##óQ òN;pasK#elsŠ+U jç ä�.�8ion+†os.close¶H#Üžðed. class SmallPtyï°s(unittest.RCase)â�"""These �s don't =òren or hang."""B def setUp(NJ]ðorig_stdin_fileno = ptóy.STDIN_FILENO ñ self.orig_stdout_fileno = pt3?OUT4£pty_select1 ^ðfds = [] # A list of hû descriptors to close.>2ile@ jÏ_rfds_length& cresult&MÐdef tearDown( !):ÿ20 = ",#in+ 21 3_ 4Ê -X*2for4"in‰As°´:try(.Z%()Nîexcept OSError9Epass1%d }d{#osy/fd{ |£]_pipe Bipe_[1os."dª°fds.extend(-"treturn  m¬socketpairs­'.^¹�' ƒ…CmockZ† , éÇ, wfds, xfds«ñ# This will raise Index×û when no more expected calls existp±assertEqualz.Ÿ iÐ.pop(0), len(™)ÖX;~;f[], []óñtest__copy_to_eachçñ-"""Test the normal data case on both master_fd and stdin."""ßõ•read_fromð2d, ndݾwÚ à :f%€d, write×��Mcu Ka5®Šô s. Pno() ÍsÌÅìŠ#a# Feed\ò. Smaller than PIPEBUF. TheseÙz–not blockQ1os.û(‡p[1], b'©'_-3.4?"')5«EÒ@ two‰Û,& lal"ne9cauMÙ«MvÚ'Ö( 0appe2Ì +þ+[`ž _f�¶_s[0]]Eç.E2 @with"f.ÀRÐs(IndexError)7: õpty._copy(masters[0]) # # Test thaôe right data went to thuplaces.=ârfds = select.ô([read_from_stdout_fd, }c1]], [U0)[0]Nÿself.assertEqualJ‚)B0os.Ž( “p20), b'ªŸ'KÉ(, Bcstdin'Z‘def test_zÀ_eof_on_all(å)¢3"""€€e empty «ó EOF case on both �_fd and lE."""ú6 áFmock„©†f._pipe(ê!úSTDOUT_FILENO = :f!inÔ€write_todc .INb8a¥socketpairK´…ö = [s.fileno() for s in 4]êˆ[1].clos#os ÕÓSÃ# Expect twoöq calls,%õlast one will cause IndexErroråq,åYG'*T_çö_lengths.append(2à +eresult+[`¢¹?F[0]]Ec# We eàyâÑwere removed /plist asþy¹#³ encountereµÓ`before.P secoÊôEW Ï ú0“@with‹:vRaises(wmÃ}•  ²ÓarDownModule(:òreap_children() if __name__ == "__main__"×@unitü.ñ() # Sample script¦"by#qgdb.py ‚³foo(a, b, c~5bar$r=baz$sz(*argsF€id(42) `ñ1, 2, 3) """PyUnitˆðing against strptimeb„ import ×  dlocaler $osBsys :nS0sup[@dateT [_  P_£ð class getlang_N$s(­.CCaseo_/áþŒst_basic¥�™~.IB(), .[(”LC_TIME))¬LOTime¯s4u@.ßàAll values areñL lower-cased when stored in LocaleTime, so make sure to compare values after running ``ZÁ`` on them. 52""" ñdef setUp(self):Wñ"""Create time tuple b¡¡on current.M3F.2_2=#lÅ%()b+àLT_ins = _strp".ñ&()¥ç�_against_+´ò, testing, directive,°¥_position,u¤ šerror_msgñHelper method thatks^Œx!5thet Œ1 of!…. Uses ƒ# a ƒ message²µ i0trfƒ_output is( i,Š!).Š\@isonGN[6[<Æ%]]ß)”assertIn(�˜ž0ÊÑ"%s: not founñi6" % 4lfEqual(»,, {r1 ur within3` incorGß; %s != %s" %K(º,‹H �)˰�_weekdayÃw6# Márðfull and abbreviat#=³ names are µ5 in«`# both¬9nd òð.ÆNee.¨$.f¸Ÿ, '%A', 6[ é""TTûÐýÀ‹ failed"å‹a‹a‹!R’#³^month±Ý × §1å/s;�d'#‰hp�q›_B', 1›ÌÉH¹ £Œ!a_DŒbŒ&¡O “ Ÿ^am_pmŸPðAM/PM representaá done properlyQåGÆDime.bq("%p", Y !¯ Àt, self.LT_i¿ns.am_pm, õ"AM/PM representation not in tuple");Ñif self.time_á[3] < 12: posi<5= 01Ielse1IÁassertEqual(DLT_i³[Sq], strfvooutputÎ? Ñ͆he wrong«CwithÎ1")  �def test_sAzone�!):GÄ# Make sure $µ is correct(='.Çl("%Z",M‰).lower(qC}�->TTrue(&¶Ie[0] or˜C +C/1]wzB!%sBPfoundO_%s" %} Á ¿)™AdatežšåCheck that LC_),P, and ¯M are¶À# the magic @ÚÑused so as toÞÀhave issues Iõ %c when day ofï"# O@onthJáa single digit�ð has a leading space. This1�(anPvG cepÊôstill parses itÖ!lyKÈe problem isKçu@thes“¿„ives forCàness by compar.ÈJš.@€ö = (1999, 3, 17, 22, 44, 55, 2, 76, 0õ]_R <2c",Ÿ_:�Tu ¬)ä ™8, "F3 inÿ2 3ÌxÌ6 Ç!Â$XÂ2«Â*A‘LT = _str(·.LocaleTimei"LT'«o'', ''VlQLT.LC}N…'s LC diB0can»…handle " y`"emptyÕMings�NlangòŒ à is set to whaót _getlang() returns ó@# Assuming locale has not changed between now and when self.LT_ins was created V ÇassertEqual(1.‹Æ, _strptime.Ÿð) class TimeRETests(unittest.aCase):À0"""Ss for1Q.""" ‘def setUp{2Ÿó"""Construct generic>q objectE+¹§W_re =¶¢!()n*E_1 .L]4&()¡ÖŒ_pattern¨ # Ýš.%mE¼=rw4_re.Ë(r"%a %A %d"¨œZTrue(KQ.findŒ.Ìõ.a_weekday[2]) != -1,�þA"didDLÓ abbreviated EC in w@ strÂ'%s'" %T0òÏ,fÏ4ÏOfullÈjåO['d'¼Ô'd' directiveR‚&¬hÇ‘_escapingDxð# Make sure any`practers0theÇ4mat�øthat might be taken a¹ñregex syntax is y1ed.—�b2 $?\d+ÄIn(r"\\d\+",.Nýr"%s doeCxhave re륟 properlyó ¾ 5~compileeaCheck =$"d *`is corý"\found7=‘A").matchh B/6]�a7 Ó.group('A') =�fUbS "reª3¸ '%A' faileæÆÞ Ga %bù¢4 = :úÒn%s" % /4]°Œ" ¢î¿a_month[4])B \ "M“ó` with >çmÐ'%s' string" 8% ú-(compiled.pattern, "%s %s" % (self.locale_time.a_weekday[4],JV Jµmonth[4])))J'ñassertTrue(found.group('a') == $•E andN ‡ ObOšâó"re object couldn't find the abbreviated / S_ in "žÀ"'%s' using !; ùa 'a' =,b[%s'" Ðó>‚string, ý&reêe^ð >,(b'µÐfor directiveäMÿ!,'A','b','B','c','d','G','H','I','j','m','M','p'| ù"'S','u','U','V','w','W','x','X','y','Y','Z','%'):dâ ;ÉC_re.f("%" +Á�L#3 = -€d.match(DP.strf B C° Ô@, "MJì fa�1 onäo regexä ¤• a Bé1)) Nãdef test_blank!oð# Make sure when tuple or somethîÁhas no value å� is gener6.rŽõ# Fixes bug #661354Ž€ = _strpŽ!.L°VTime(‰-.&÷zone = (frozenset(), :¿fEqual(jd7RE(\)]Ÿ("%Z"), 'Ù f"with �³= ('',''), [PÌ'%Z') != ''"“”@ing_P�_escapesœ ña format that requires :¤õof characters worksw! _rAÂR–r"\w+ %m"F H/·(-'10-U20r"EÛ¡3fÉ'r.10!�_data_w_lV_metaà)RCheck2if B B’ containsš IýUy are,#S¸ed properlyÛÒDiscovered byã†1039270 '~~æ-æÀ(frozenset((ÿ"utc", "gmt", ÿ "Tokyo (standard time)"))G¤frozenset(E…daylightE‹V°_re = _strpð.TimeRE(locale_)0ðself.assertTrue(õ_re.compile("%Z").match~ ÃÂ"tõ! data that contains regex metacharacters is not"ž `ñ" properly escaped") .ðdef test_whitespace_substitution(é!):,Væ# When pattern—?à, make sure it›÷taken into accountO€so as toÁ£ allow sub`°end up next(çeach other andJ‡"steal" Vfrom 1..`0 = à.¾�('%j %H'ïƒFalse(reÝ3�, "180")3"2 3“ class Sz Tests(unit›.CCase‡0"""Ws for®·6"""Ü\setUpÅ‘"""Createû1ingp tuple.?ê! =)0.gm1(C¬ValueErrorq5# M&€raised wU.� fails orß!maA&baè“yR<&s(Q,ǹ,King="%d† ¶format="%A"ÐnBbad_p in ("%Ô!% #e" 96try8ƒ^ ¡–("2005", c{9vexcept í\$Einueæ8E?0ionn>err>Y}s("'%s' š1%s,›y9" %bf(Ã�, err.__ß·__.__name__':Oelse‘1didŠ™ 9" %6�¡# AmbiguouP in�Ðlete cases usûÑISO year/weekçday directivesO01. .)P (%V)Áñspecified, but theN ‡ with %YK in®ud of %G(‰â cD. ‘("1999 50•GY %VÄ2# 2ÃñP (%G)D ÕKare Öòh¯Àror):  ¥_strptime. ñ("1999 51", "%G %V") -ñ% # 3. ISO year (%G) and weekday are specified, but-Å (%V) is notOðfor w in ('A', 'awEu'):'~ûwith self.assertRaises(ValueError04ÔÞÝØ{}".format(w)è4è&isÖÑ alone (e.g. :C`('2015½7%G'Lº¶[‘ Žð5. Julian/ordinal ‡1(%jk‹ „"%G“enot %Y^Z 42256¤q %j") c…def test7ð_exception_context(~Àõ# check that this doesn't chain Aö s needlessly (see #17572ÉÝZ as el«8_ë!('Þ&D'`º’UIs(e.›´.__suppressç†__, True>`# addi #alôQIndexÕÐ branch (issuÞF9545@ÞfN—6p][çB] ==w�,ß7"† of '%s'Þ‚ failed;ï-> %s != %s" %O' (ƒ Þ˜ Í+))±äìP# Tes•šeõis handled properlyÊм0('yfYáŽv16, 0°ð # Must also make sure %y vs~0cor« wðbounds set by Open Group ò& for century, bounds in ((1900, ('69', '99')), (20 00€68'))): IQHG s!)ðstrp_output = _Utime. _(?y, '%y')eDàexpected_resulHÈb + int=7ðself.assertTrue(|‹{[0] == Y,z~ð"'y' test failed; pado'%s' "CÐand returned 5B" % Ä*, ¤1)) P1defvp_month(ÙŒ1# T’1or ± directives>Á¬®0('BØb'm'N.a….helper(6<, 1�?day�?day‹]l'd', 2WOhourXUVH', 3Cstrfø0 = o. ¡("%I %p", –i_tuple>ÁRe#, VE‹3‹ €?[3]Ž"‚�ing of '%Â6%p'œ]õ -> %s != %s" %ç ' ˆ-3]>[3]œ_inute¸m¤šùll'M', 4osecondYY\S', 5Y�fraction[Rmicro`¯°import date.P5d =.p(2012, "20Ö34, 56, 78987!Ptup, �?, _( @(d),Èö mat="%Y-%m-%d %H:%M:%S.%f"RX�‚rtEqual(^'d.× OweekÔl_AZawud6“_julia¢‘þV\j', 7YloffsetûAone_d•= 60 * 60âDhalf3ä6= 35R(*_, k5), _�{ìp"+0130"JzÔ Z%, ·%+ §À) seólf.assertEqual(offset_fraction, 0) R(*_, !5), -Õ = _strptime. æ("-0100", "%z"N/se{¿, -one_hour,z§5?303©(ªq + half¶ minute)Åc .01uÌ=&-1ú9%O+01::�ze9>:8/*`?:30¹0ñnÇó·–?.00¿úŒ? ‰Ç?100÷0Z~nž10) ÌÒdef test_bad_—(>!):µPwith ä÷Raises(ValueError,0µ ¿b Ñ`5ò^F¾ð1234567", "%z") ÷ with self.assertRaises(ValueError): ¥_strptime. €("-01:30å123456", "%z"):f as errm-30eÆòEqual("Inconsistent use of : in ±Dñstr(err.exception)) ¸�def test_îPzone(at# Test Á directives.A6�# When gm&P() isˆdwð%Z, entire result Fstrf-XemptyO°Check for eä~²names deals^ðbad locale info w‰Gthis�ðoccurs; first found¶FreeBSD 4.4|ù¥_output = þ)Q("UTC›Z:a›MÆ.tm_isdst, 02!n ?GMTn0q�_tuple =S.:(”f.®ñ "%Z") #UTC does not have aQAyÝ]pQQŸer LñGTime¸!ifƒ0.tz%S[0] !æQ1] or²ÕŠdaylight�ÄWTrue(ÅR[8] =SFE[8],î "i" cÑðailed; '%s' -> %s¤_%s" %H  ‡•*, ”,÷’)ÊOelseÞ/-1Ó |.àðhas duplicate vXs and "Ù ".‹7 bujF°¬set to -1"¶1badeº Ex’AitlyäÀ possibility…<Â;¨#Dþ:0ù^!1]Þ>¾B0tz_ƒeE!«$`.upper3%n Uî‚V—@skip�ñ('need non-UTC/GMT'!4�ðupport.swap_attr(´2, '–C', (¯#, U)), \¬J/ sFºO', 17ûtzset', lambda: Noneò§n/ =¥ ¡-Œð = 1 õtz_value = _strptime. _÷(tz_name, "%Z")[8] ðself.assertEqual/SY, -1,+6à"%s lead to a dQzone 6° of %s inst"Ïof -1 when "L?Ð.daylight setVÿ%s and passing in %s" %B(B"tzä,˜Y#, 1)) FÒdef test_date( !):êõ# Test %c directiveÀfor positionžwrange(6>BQÅ.helper('c',3„(.Ax70,3@ �x�C�X�/3, X�~percent„õMake sure % signs are handled properly™Òstrf_output =àÀ"%m %% %Y", m.x_tuple)ApAJ TU'XYHWPTrue(�1l[0] ==ƒ5and‰À B1B/1]°G"3M3of nQŒ failed"”�caseinsenæ.vešcShould‹ ~ s 5-65ly.Ñ3›B• M—0.upx)Ÿ?B")Y ” does notÔƒALL-CAPSÝm"æ™olower(™)Blš<¯capitalizeŸ*~capword� z~efaults[Ds returnYsp±be (1900, 150, F1, 0�dF?s =2 &-13 ¦R —'1', '%m': £ J$= Œ‡õG s cEš!()öðincorrect;"  ð" %s != %s" % (strp_output, defaults)) 8ñ def test_escaping(self):!ñ-# Make sure all characters that have regex significance are T7ed.M±Parentheses#ð in a purposeful order; wik÷ause an error ofHPunbali7d pStwhen th’àis compiled ifyv7notL§öTest instigated by bug #796149 ÒEneed<õ = r".^$*+?{}\[]|)("hXÐ.assertTrue(_˜Utime. _(S),  ·ñ feb29_on_leap_year_without Îa.yü("Feb 29", "%b %d"òmar1_comes_after_oPeven_kß_omitting_theqöULess(\’ ,2 WMar 1ÃÐ) class Strp^`12AMPMÒ`s(unitï.CCaseê0"""5 a �Õûression in '%I %p' at 12 noon (12 PM)"""Lptwelve_%œ_midnightŠWeq = UEqualì0eq(»«'l$',ˆŸ)[3], 12)3 ,AM302î …p> {œ`Julians”&~’jL� (1-366)àŽaccepted›Ball_1__days–Pfor i Ãrange(1, 367BÌ # µ€2004, si €it is a ¢ ¢B, we8@366 ‡ÅB/eq@'%d \P' % i Åj %Y')[7], iú¯CalculatiocLp) fillséùmissing info correctlyW\setUpHÙÂ�_tuple = 0.gm(g‘c· P†­~ F^¨qN%ed^`format¶Ôö = "%Y %m %d %H %M %S %w %Zµ†result = )ѧf (b,à)Íñ  E¯TAÀrue(result.tò m_yday == self.time_tuple.t?, ó"Calculation of 1ÿ failed; %s != %s" %D… (resultn‡1)) Eödef test_gregorian_c‡(Å!):*¶Ô# Test that G1° date can bÄõed from Julian dayEõformat_string = "%Y %H %M %S %w %j %Z"/Ñ0 = 2pQ. _(P.strf (_,)€á E)Œ¸.assertTruem?earö5andFeã´?monFE‚Omday ‚ ㉛Á A"%s-ª °Year,  »  éNyRµ‰?monK9 4¿day_of_week60the à0he ;D is t¶ed as neede0 �1Am %d7S1£w¥Ÿ ¥H.N¦ 8" %1xHýøif support.is_android"åIssue #26929: —b) on A/Ò incorrectly Þ s %V or %G+ # 1@last QfirstATmpletC@n a ï.;ð_ymd_excluded = ((1905, 1, 1), �6, 12, 3B2008/29&R(1917(631)_È s‚'%G %V','Felse*  %KL±P@unit²ð.skipIf(sys.plat€ÿ.startswith('aix'Éñ'bpo-29972: broken¤2IX'‹¦éaó_ùÀlculation(seclf): ñ&# Should be able to infer date if given year, week of· (%U or %W)Npand day%1the1ò def test_helper(ymd_tuple,greason�¤1foro_|ñ_format in ('%Y %W', U [G %V'AE@if ( ESself.Uås_excluded andµ?µ…@<}>mreturnUÝØ3day†VA('%wÏuaAØ[ž_string =-q+ ' ' +Œi ŒLQwith Õ�subTest(°™,37 9=Ü6Ç=ÎMo0dt_h! =¨Atime%(*y–0 strp_input?IP.strfG(‚¾E2outF±p?. _('l?ª ™ msÿ"%r: %s != %s" % Š*Æí?[7]Ê®._()[7]¢˜²assertEqual½�U:3], çV, msgJ°`ð(1901, 1, 3), "i? 0", 8,¿common case11^õ�n Sunday44f4/Mo4 5Å13Jan 1 oi65j57jSfirstЖaZ` startj?on O¹A2, 3»_Dec 3¼8p À2008, 12, 29Á.»ŠAlast›¨K2K­second-to-U"0Ë"| 0197ÇA0, 2Yñrandomly chosenð¸41Ç<Àchosen date"3) ð#test_helper((1978, 10, 23), "year starting and end õon Monday while "PWñ"date not on SuD#orN"˜¯17, 12, 17˜?ith—aƒ›Ñat the beginnðrúP!ofCBÖ 31Ö`Dec 31\ÄB „m ¯‹0200a!, _UFirst� f : 14ÄoSecond<6×,Law6w;2xOto lE Adef ðÑweek_0(self):°÷check(value, format, *expected-1@õ.assertEqual(_strptime. _ Q…)[:-1], V‚~ò '2015 0 0', '%Y %U %w', 2014/T28, 0f6, 362:EWEt5, 1, 4@0, 6, 4A11 1†zG %V %u†9C0†3E0EËE ËE?1 2Ï3R0!/360EÏE! ÏE?1 3Ï1ž2ž5žEÏE ÏE>1 4Ï®CO3, 1ËA ËA$ÇA?1 5Ã2�?4, ²AÃA ÃÀ, 2, 0, 0, 0“, 4, 2) ðcheck('2015 1 6', '%G %V %u', ”, 1, 3, 0O5, 3A0AY %U %wA*WA"?1 7Ã4Àž0, 6, 4) a09 0 0BĪ08, 12, 28D/36  EÈ!09J‡Š ‹a09 1 1†‹†9†o0, 364�†EËE ËE?1 2Ï3Y0!?365ÏEÏE! ÏE?1 3Ï1ž2ž6ÏEÏE ÏE>1 4Ï®CO3, 1ËA ËA$ÇA?1 5Ã2�ü,AÃA ÃA~4~ÿÃA ÃA~Ã÷ð class CacheTests(unittest.aCase):¤0"""ò that caching works properly."""Ñ@def Ep_time_rÓcreation(selfTv±# Make sureWqe is re/ñed when current locale does not match what£Oœåed object was LEith.*P_strp . ¯¶("10", "%d"j# -A2005/Y/ðTimeRE_cache.localeó_time.lang = "Ni" �original"±_re = _strp1Õ_TimeRE_cache3 *>Å("10", "%d")-üself.assertIsNot(q,pD§Equal(len(†Rregex¥a), 1) ~“def test_pleanup(‘!):"Á# Make sure ç!d 0òes are discarded when"õ becomes "full".L6tryY]8delÞY¨e['%d']:úexcept KeyErrorFEpass*Õbogus_key = 0owhile ) <ØêCACHE_MAX_SIZEoY[yv] = NonêU += 1˜L+ç! new_locale¼èqA new L"Øô instance should be creatía1+•RE objectÙD# is. ?_idK.)S,t*,Â8d�Š?_id�† `®!re>3ion‡ƒBThe .}Aòed upon changing the § jdinfo =2get((†.LC_TIMEJ ¢)s:ö, ('en_US', 'UTF8')MµC¹k°.skipTest('�q needs T.Q¼'W ¤á0'10˜'%d>�ó# Get id of currentºÆG.Rfirst´ÿ4 ¤0# C³e±Ó and force a à0ion™Öq ŽIR• Pde_DEýD•@559š+žù^'s idªosecond=jDTheyz0not~eÝe C ²*, …IÀ # Possiðble test locale is not supported whifnitial&7. �# If this@Âthe case jusJPress û exception and fall-throughO!to0£resetting eorigin‰ †^¤y.Error:X²ñself.skipTest('üóneeds de_DE.UTF8C%')>ñ# Make sure we don't trample on­B²1onc,Pleave!Mv¼fÒ*ly¬NB.set (“.LC_TIME,¤q_info) \@¶ó.run_with_tz('STD-1DSTÎ1defñà_TimeRE_recrea” _timezone($)�b# The 0` instaÛ£should be CÑed upon chang´4he Tî±oldtzname =.¡ tm = _strp<. Ÿ(2ƒ[0], '%ZÙ<¹ö .assertEqual(tm.tm_isdst, 0Ðe1e1eö# Get id of current cache objectQfirstá _rõ.§8$0# CeWE·Tdorce a”ko›“6chesõos.environ['TZ'] = 'EST+05EDT,M3.2.0,M11.1.0'yFset(èM²“ª9new¬V's id>osecond²SThey 5c@be e¤U#lf¾iIsNot(*, u€�@old ]Ç  longer acve¿ -ÁRaises(Value8þX�™ü(Í�e@�p if __ëò__ == '__main__'¹AunitgP() imÑp collecïTs.abc.Q from  1T * xmlrpc.cliÏ2as tlib @Hbò('XXX: buildbot.python.org/all/9/3ágone') class P'B61ers§WbCase):óÎ\_l>ersËÙðlist of builderós from the XMLRPC buildbot interface at Õ# python.org.ñserver = xmlrpclib.SäProxy("http://[.DR/all/65/")QEtry: {;bers = m€.getAllB®Fers(<úexcept OSError as eLð self.skipTest("network e/–: %s" % eP/óaddCleanup(lambda:ˆÕ('close')()) ³ñ# Perform a minimal sanity check ont÷result, just to be sureHšórequest means what we think i�ôlf.assertIsInstance(Að, collections.abc.S^-ncòBòTrue([x for x in‰€if "3.x"5x],ò) def test_main()€support.ÎEireszø pun_unitA!(Pnæ±ñ) if __name__ == "_h2__"i9Â() # Used by�0docò.py. class TwoNames<À'''f() and gpre two ms�âsame method'''öó f(,ﶤ>>> print(r@().f6f÷8“return 'fiòg = f # define an alia�`f # # &a suite²âOptik. Suppli ö*Johannes Gijsbers # (taradino@softhome.net) -- translated/‘original `! #aw tož°s PyUnit-ba„�version.¤ $Id$ # imD sys o $reDcopy ! º3io D‚StringIOçZ o‚optparse+/pmake_op",ÞRon, \�ôTitledHelpFormatter$PRUGroup7äSUPPRESS_USAGE2¡ ƒConflictp0Bad`#on SValue sÊß_match_abbrev# D_numIøC!edc!(EQ3ionÚë�__init__ò,ÄMß_message=None%¯xit_status# G„hm.i" =Æy˜+o)'s(ëS__strÿ“­oPŠB or wO"go½"‰2ingøc( }”Bexit� Ua0, msg\(ð raise IntercòeptedError(exit_status=!, ñmessage=msg) def e5`self, :Èraise Interc`1_Mð class BaseTest(unittest.RCase)WqâassertParseOK(y@args¦¨pected_opt°positional_)L£A"""AOp the op&òs are what we exTò when parsing arguments. LóOtherwise, fail with a nicely formatted ú:vKeywordVíU°Ö -- A list of%1 to�ejO½%r.„¿ITè/ 3:ˆGwzReturnsV:nd @s@ fur: ð6ing�6"""^(�,DÎ0 = .œ"er(=)”äoptdict = varsPÊlF^PEqual#2 YR5 ²ˆE%Cô)s. Should be %(3—€Args wer·ÿs.""" % locals()¨ Vø° » P(Þ +%(I³Ð(Û  Ür9 8NionsîResÞ_func,j/kw¿ exÚ?ionF)õ {•„!at37 `A is Pd‰Acall‰Dç¿p, and t¿ÔRright¥zL�included<D6t¢Aðš rg ~•œS Ks'?/`<`1{3k0._º< Ös~Gp@¥>÷GP(or pË'rnE÷ if a compiled regex object¼[“mk1xis None•p6= (ú3if T 1À kwar£gs = {} Etry: ðfunc(*args, **kw )"òexcept expected_ªion as errLö actual_message = str(errPråif isinstance([6Ú, re.Pattern)_=îself.assertTru?Š.search(‹%),ÒE T"""\ Š å”" p�r: /%s/ \'ý: '''%s''' """ % Ý.I", D+)"Oelseû [Equaläã ôâw3 óÒ! ¯`returno"„fail("""éŽ%�àð)s not raised called %(€)r with 0 %(r)r and #2 %( #)rí²locals ()) oa# -- A«ÿions used in more than one class -FBdef ð`ParseFâì , cmdline_œ,£goutput;5"""8�` the pO r 3!s ì:û@. CrC’must ensuÆ t Ž.N°is an Inter9‘ingOption¼%r.E” “QXã(ð0ÍsedError YMBPerr.e/ H³sOfFalse(x\\ure")ËO¤(�„í#«_ò& �status=0( Z=NoneD;aprintsMŒ Œ¸ on stdout.êRsave_2ys. d  Çs9Æ = StringIO($_ArH 1kfinall!Ö&= {Ÿ.getvaluey¡õQ¶$ó.INðoutput, str),  ù$"expected output to be an ordinary string, not %r" @¢ % type(@9)) !$ifY4!= l_,:*W¥self.fail(˜Ì: \n'''\n" +A- +BF"6xbut gotE}0 + ")")C�ö assertEqual(err.exit_status,ƒ?wmessage@Verror?JelseŒVFalseb parse™3()"sBdef »PTypeE_(Dg, funczŒf*args)vA"""Aüe that Gñ is raised when executingZ6.""q.†R2"s(}jv, None,X” ËCHelpÆõ4Ghelp¾pactual_$ =#aformat(m8if .›?Kú Ù›ÙureException(=-'@c text -;3_:\n"'´<P+ '";´/º-ò\n') # -- Test make_o q) aka O / -JAIt'sï0nec¸ ryt]‚correct `ðs here. All the $@s in $ #…º_`() sec;ð deal with those, because;Ðy're needed #¡re. classäѰChecks(Baseù BsetU7›Â‹3r =PI (uœý=SUPPRESS_USAGE‹uX¹Räq=[], kw ,{}� « , 19,Yˆ ƒ¶Œ_Áa_emptyL”ï(—‰ó "at least one1P mustLˆsupplied¨ œŸtoo_short ø x‹"invalid€E'b':…¨útwo characters long"n_["b"]H¨_t°*J ¶'--·Yü0"of  Õñ -x, (x any non-dashÙ)Ïà--"]) defó test_opt_string_long_invalid(self): õ.assertOptionError( '"< I! o' \š '---': "1ùmust start with --, followed by non-dash",8‘["---"]) 2defËOattrÀ*³D-b: Ëðkeyword arguments: bar¦o•ób"], {'foo': None, 'bar }°cI²=aV!: ‡¤&'' ›Otype™=^[wž$œ]…gÅVŸ: 'tuple'| & 0no_FR_for_C)"‘¤Ðnot supply a aR for a 'count±'/)0, 'COint'ÄÏchoices_listÁ+�/--bad: ÇÃX< ofïwÝ£" 'Ü1, "\T/@1"ÕBbad_Ö@aname =`p('').__!__F`ûw_be a ÿ rs ('%s'ðqied)" %”� è'b"©­{æ"�$",O‚s':"bad s-%no,É+Ç|ëŒu '% ÈÀOonst‡8 'cQ'ÅÈ%be¢Åfo 'stor>'|)ÍZ=: 1µ�no_nargsÈ9QÈÀr action 'co‡unt'", ð["-b"], {'action': 'co)ñ, 'nargs': 2}) 6òdef test_callback_no ±able(self):*c�.assertOp]eError( $!"oT -b: UA not Uo: 'foo·”'âf'`äTÖ\dummyÁOpassù_no_tupú7_Vú, if supplied, "0¡must be a z:-#A¾P ¶U + kwÞ4Ldictlo- _W5{4r·6&nodBfor_ž55_! (;¤) for non-$ ˜._storet"é î? óëMoÙ_ò@ZôXqö ¿single_dashÇ"Ãinvalid longžÿ string '-debug':-ñ start with --, followed byò‘çQ#"]ø@¡?d: °Î¡ ì°B", " ¶Àelf.assertOpÇtionError( ð"invalid long op'ú string '-debug': "4ùmust start with --, followed by non-dash",8"["QS", "- ñ]) class TestO€°Parser(Base!):Fãdef setUp(selfÊ!.p49 = C): %R.add_êB("-vŽqverbose nk-noisyÃK ac/°="store_tru@ddest="P‚qoRquiet osilent{1fal¼ |ÿ9Vtest_øB_no_)M¢assertType2b= Ý s"not an‘à instance: Non(/) ¢˜¯_argumentsªHl l!",¦ ¥4get?Špopt1 = ‘.-l i3IsI(B,3,QEqual'a._shor‹@s, [^X?n"]9ìÃ8-¬?öDû(, üx ž',  ý+ _eæ ò_Oopt2, õµOopt33 )n",4, G1ïATrueÂ0 isr234q0has®?ion Vf .6)Œ6%“Åremoved•ä{)ó 6=d]M�E(/n"ƒ*#CÒËTÇF� È›7 ÿÙ>À(self.parseró.has_option("-n")) ñself.assertFalse(jparser7`-noisy<=?Tru<q7r bs6 p-silent<sðdef test_remove_shortص!):%fbÄ,þ (Š+Ad() " oOlongnŸ-verbose"rÿu ¿nonexistentæ¾aRaises!.øñ, ('foo',), None,á+òValueError, "no such ? E" ð+@support.impl_detail('Relies on sys.getrefcount', cpython=ødQfleakÃÊ‘# If an O½P—õ is carrying around a reference to a largeæð# object, various cycleHðn prevent it from beYwGC'd inCôa timely fashion. destroy() breaks the[÷to ensure stuffIõcan be cleaned up.`big_th€e= [42]F, =X(4SÒ) =8( @.addÑça", "--aaarggh±M.g5 = *s.º#ލdEqual(Ì,ˬBdel ƒSR$ class TestQì`s(Basey•\setUpŽBpassò#‹Rbasicz> vDCs = aÎ »Rvars(0_), {}+ Olues%2Not`Nÿ, {"foo": "bar"Y 4"ÞÇjdict =H,Ouz": 42}‘rð�defaults=BÒ ý-ÿ' Í!‚ \)$Õ (H[]) y€TypeAlia°x`Ô…�ðstr_aliases_string(seclf): úself.parser.add_option("-s", type="str")1ÈassertEqual(B8getB ).B , Caing") G�def test_q_objectG˜?str–5  Ë x ?intu!%x" 0int‘ # CustomeA for°ing process ðof default values. _time_units = { 's' : 1, 'm b60, 'h * d p*24 } ±_check_durað÷b, opt,kŒ6try-"ifÓ[-1].isdigit()D±return int(³/FelseL0 ,—[:-1]) * å[Fr]=�except (VÁError, Index �qraise OÐ-(E}'øÔ %s: invalid —: %r' % (£) class D9_(}sTYPES ={.D+ ('Z"',ð_CHECKER = copy.O: 2[PK] = Ò©RTestDC`s(Base®_setUp‚ÍP)(�A2ôv", "--verbose",È_=True@q@Qquiet>Cst='N'@n²"q/37=m=1-©\="foo0aCGuüL=Non:‚expected  : e,êf'n': 37# @m': s% As': ñ& tKu%£ª™&cbasic__s§� 9_HBs(),ç; ”UmixednO_posœ 5set-Û(n=42, m=-1006o‘.update({ƒ/'i2}3Õ9Àixed_defaultãs_pre(self): ÿ.parser.set_defaults(x="barf", y="blah")5óadd_option("-x", Bo="frob5Jy") [òexpected.update({'x': Q@, 'y “}”±assertEqualéÚgÚ±_values(), ül „fremoveâ­;@( yKNone¦sßÒ)Ð?ôdef test_processáÏÐ_class = DuraàOæ ªþ³d", type="d:;300CeC ?"6mW Á\n="42){°d': 300, 'e 6 on': 42�?9uô° ˜ŸOFals8 ½0, '¾ûÀ; ðTestProgName(BaseH1"""ñ* that %prog expands to the right thing in usage, version,Bñand help strings.` ÕëU=Ì", U,o>_Zœ{8#2.,-()>šqV§sÆu. w&) zÀWÈ gn}Ih²# Make sure|{@ram -ô taken from sys.argv[0] by¯b&@ave_!& =,!:]y 6try?Qð= os.path.join("foo", J8z.pB?…2 = `PŒ"(";E..."=(1.ØD×óA = "@: barb ...\n�/?. ,(ˆ-5 7"k�5DHelpiQ] Ñ�+ "\n" +4 "A's:ëÀ  ô" --version show program's ônumber and exit\n" AU“h, --helpUQthis xmessageN)O…finally:`ðsys.argv[:] = save_ %ðdef test_custom_¾¦name(self)Iñparser = OptionP(.¡="thingy",Qr0="%7O 0.13uë1†arg arg"ï•‘.remove_ošO("-h#µ*‘expected_uP = "U~": ß{¾$q.assert,(‘*, L±1V63F1EHelp. að + "\n") class TestExpandDefaults(BaseÔø\setUpé£Èî7est70šp_prefix9A""\ :\" [›Bs] ?sY-å2Dï6 "">|Pfile_�zòread from FILE [dÿ3: % ]>IB_L$Aelf.Ô9+ \Ý£fc¨6=p €�foo.txt]? �Onone�CZ~Éÿ÷š_ F.addcpf", "--úÅ ]#="2|=Þ(²!, T¥)î/÷/_1ùCLjD.setŒ ('°5', .úJ2úw s(ú&ø;%nob$x.‰åÀ  ðhelp=self.file_$) (±assertHelp(�parser, �expected9q_none) ?ñdef test_default!_1C!):#fERð.add_option("-f", "--•%",/3d_=None-ãòW2òCÅU%seƒ s(N%ã;Efloafð Ó2"-pïKprobïêà"blow up with &ãability PROB [3: % +]"ãHV=0.43, Ð" =僺_prefix + \»A -p†A, --R“ ²€E]\n"Vu   k¯alt_expand…g$‹"foo.txtª™:÷="read from FILE®Ÿ*DEFAULT*¯£formatter.Ø…_tag = ":8U =_  B/noAŒà ¾ä5f éfÁé=Î Þ �Ó&³ # -- Test µŸ_args() -q classKÐStandard(Base\„§BsetUÜɉ–s = [make™ÿa", type="string")r 5bß5boo>ÿint", dest='boo'G!-fA ac%²="append")]s·è0ðr = InterceptingOptÿionParser(usage=SUPPRESS_USAGE, Âoption_list= 1s) Eñdef test_required_value(self):#kq.assert˜òFail(["-a"], "-a V FÜs 1 argument"jÿinvalid_integerkŸb", "5x"]þ "‹C-b: k k Üm: '5x'—‚no_such_?–a-boo130no A 3: - Slong_šS?=x51.x5_emptyÿ öOK([], {'a': None, 'boo f \}, []‘shortopt_n_oappend}{0, "¦--foo=blah! ¸>¶$["M?"]}n ÙÊC_ÎÄ¿0barÔ  =ú ÔŒ·» ò) Ä#["”‹xP_o_joineä/bcÊ?bc"‚ è Ä ²_split•/34µ/34µHg`Ð?"-bºeñR34, '+1mŸ_negativeÀ£- )Ä/-5Ä* õ÷è¦Ð=13"],  ñ {'a': None, 'boo': 13, 'f ?}, 9A[]) ñdef test_long_option_argument_split(self):/?ÿ.assertParseOK(["--boo", "111"]| ¼/11½6SshortÊ»pfoo=bar¿_-axyzÁU'xyz'~sà ["N]ƒhabbrevŠÀ¾qŒdefaults´(U±s, args) = Ap;!r.q s(”`M .Cget_Ÿ_values()˜³Equal(vars(/As), Ž)Ÿambiguous; ®Tr.add&°"--foz", ac;�="store" á@type-ÿring", dest="foo"ÐhAFailjfïe 5 "Ò ôp: --f (± o, {oz?)") @8and‰ aHF!,  V?ÐÇ Ùlappendµ£ä)bç0123T /ba=/º2»;1, "JBì€one_posiž aljìÆ‘ŒrÁñÎ 5 ˜ Óÿconsumes_separatorÍ --¢Ó6cÅå Ò mÙAqnà"--foo", "bar"O], ñ {'a': "--", 'boo': None, 'f �["bar"]}E A[]) eñ"def test_short_option_joined_and_separator(self):6žó.assertParseOK(["-ab",�`"--foo‘� Õ=ÔáÑ n+),àðhyphen_becomes_posiëoal_argÜÒÛ7¯="-"²óno_append_versusÌ!b3Çq!"5 ­=ªÀº/z"�¡�5Œo, "baz“�Pconsu´¯like_strin·ß/b3É!"-…$ ¤AcombKãsingle_invalidh«pMEr.ad&€"-t", ac°ï="store_true")�@Fail�Ûø ² "no such a0: -[ð class TestBool(Base 9\setUpÅE”s = [makeëO"-v" T¯"--verbose,`odest="c¿default='')[ àq´�"--quiet* Þ?fal ß*)]YA = Oåµ"r(¯s_list =sSbool_ ð3 ‚_': ''Ø SŒ ŠÌ¿s, args) = œ?"-qŒ&{'²0± 7 l  ‘DTrue²à.verbose is Fañlse) def test_bool_true(self):"ð(options, args) = !õ.assertParseOK(["-v"],59ï{'verbose': 1}=5[])n‘T²._@ is óüflicker_on_and_off^ï‚qvq", "-ý ëÙð class TestChoice(Base™·_setUp­p–ñr = InterceptingOÇÂûr(usage=SUPPRESS_USAGEPER.add_P�("-c", acñ="store", type="c§"ÅFdest. 7`s=["onM@"twoW|three"]²bvalid_5ú –²\?xyz¤ "{'\�': 'one'• !["R ¥/in§@Fail?©@fourÿ?abcª 2 "–S -c: sO0: 'I5' ""ŒÒ"(choose fromñp, 'two'‚<')"Þ% —g.=dÚŸ--default+fÎ=1fiv%0sixn4opt–x4getžK"-d"Ú%PEqualÝ.Â$, Ã- ÿ#, () ¬Oount«`víp = make @ion(‘­cš2",  =â\c.^ +4"--W?intsR_-quie&��^_consu!, ,=0ÍQemptyæ Á$.ß8], ÃqNone}, «‚�Fh=_onF U£ Y1V­@"-vv‘ ³Ð3}, []) ódef test_count_three_apart(self): ö.assertParseOK(["-v", ñ], {'verbose': 3}, []) D j°override_amznvp-d;=2"s2sOquieàrñqx0x?ingæ&tAv"],P— €1•ÿinterspersed_argsœ-<õ3-�º O["3"-?no_°pšŸr.disable5)‚Ðà)/0}š àÂïno_such_option� @Fail‚q‰P "no C C_: -3"l!Ÿ_no_valuem=sO ˆ""-1�ñ does not take a |¢¿with_defaul¬ì5set'|?, 0ê 7¾g; Ž*?"-vh2Z ôðclass TestMultipleAæ@BaseÀ–_setUpÕ@ = I.�ceptingOŸûr(usage=SUPPRESS_USAGEzED.addÚ1"-p=-point"Ü H ac°="store", n°ò =3, type="float", dest="T ö3_T@posiP/alø1foo²¸1 02.51-4. ?xyz™šà': (1.0, 2.5, ?)7 }cØ@long]Å ´À-point", "-1p", "2.5 -0�xyz"], ÿ {'point': (-1.0, 2.5, -0.0)}9 !["]!) ^ñdef test_nargs_invalid_float_value(self):.�ð.assertParseFail(["-p¸!1.¿ 2x ?3.5Å õ "option -p: "dh "� �Aing- ¦: '2x'"Ö‚requiredÑsÒ`Ê×Ñ-7 Ù|Ðs 3 arguments§ðclass TestMultipleArgsAppend(Basew¥_setUpºp†ñr = InterceptingOW¡õr(usage=SUPPRESS_USAGE)mÑER.add_¹(ÒÏP", acª¡="store", 2/=3m Åatype="µ‘", dest="º"„fW--foo‚a&ƒ2ƒ5int�Qz>zer€_const"}òq!, 3=(0, 0)¬Üéu OKs4£3@blah0 "1O666"LÿNone, 'foo': [(4, -3), (1, 666)][ ‚]Ú _�Of4,3Ç ] "-fx2x’Põso_simplïz‘=t4• ¨\o[(3, 4PJ M*-Â"½O, "-k ÃÆ", Ë", Ö# ÓüVersionñ¡v ¤ Á.³ø¯`ƒ¸="%prog 0.1¸ðave_argv = sys. 5[:]\6try:V%Ð0] = os.path.÷join(os.curdir, "foo", "bar") òself.assertOutput(["--version"]4g 0.1\n:Šfinally:Kðys.argv[:] = save_ %Ãdef test_no_^(|)Dñ.parser = InterceptingOptionPö(usage=SUPPRESS_USAGEÔEÐ0KFailÓ� ¡"no such ou&: ð) # -- Test conflicŸò default values and ÈÏVs() -q classKCJDI`s(Baseg7"""& pñ: the last one should win."""í}_setUps gÿq_list=[F(Rmake_�("-v", ac ò ="store_true", dest="verbos%[=1)])L_I§F.add}q}3faln ~ ÁÉy/=0J“OK([], {'Ó�': 0}, [Î__noneÓgONoneÖ1Ù¦\Groupž_!ƧO+d _gtý_create_instancP%8 = § ‰w, "SpamÃTm(N5&P("--sOûÆ] `help=";  ™Âxp€:D': 1¤_4¯i z`‘TypeError$­rè,Ð{x"not anz ¦ : M!", ö«pinvalid(auments�üd­´9rB argr¤ª bwrong_T ¥nƒ1v8¶&r(}üRRaise7­À_group, (großup,), None, ñ#ValueError, "invalid OptionGroup (wrong parser)") M def test_g%ñ_manipulate(self):%u 0 = .Ea.add_oc?"("k/2"ª N adescriJÂ="Some more \:s")†ý.set_title("Bacon!™Q("--b$·, type="int0Ï’assertTruöß;getßL1), ó ) # -- Test extending andhKŸ_args() -q classKEJÐAddTypes(Baseb޳\setUp£Ì›ò = InterceptingPûÿ(usage=SUPPRESS_USAGE° ›_´=y"Myf­�+S("-a"Гüstring", dest="a DÄf", "--file"Û F ælarDown6óif os.path.isdir(support.TESTFNu±_os.rm&¢)elQ†Rlunlink'¡b ]# (e™acheck_l4,¡0, v Âeif notôexists(*ôSraiseHc`("%s: pQ doesQI3" %uFv is=v"G‘a regular„ubreturn�L‹sTYPES =Ó.@+ ("‘&",¾ð_CHECKER = copy.‚: 6[T]>¡еwv˜<_ok™ˆÂcreate_emptyä¢kqÍìFOK([$ 6>oafoo"]ü {'¢<': >¿'a': 'foo'}A )[]„!stÃó!no4 øGelf.ÆOFailÈ./ ³A!  úÎt+ Î_os.mk1 µïÀ["--file", sÿ upport.TESTFN, "-afoo"],  ÿ "%s: not a regular file" %8 soð) class TestExtendAddActions(Base!):Uãdef setUp(self¥!op0@ = [A.MyOP("-a"Ó¡-apple", aZ1="ek"å \òtype="string", dest="O!)]—&w’parser = ~P(�b_list= 1s) 9ú­" (7ØuACTIONSR.5+ (Ã)L…dSTORE_$‡.;^TYPED;  ;w—Rtake_]�j1Ã, opt, value2s, /ïÄ#if¤D == äÿlL" =T¦.split("," *)‘s.ensure_(Åb, []).(O =Nelsey¤.ðáñk ÎXBest_¥H_addc9~aassertuBOK([ÈG,bar_=blahÜ !{'ÞP': [" 3, "E=}Ê #[]ݾq_normal(ž‡#-a‰-ÐO=x,yÍ&xY?y"]ÏA# --¡ã callbacks andÁ.çŸ_args() -ìCJä!mmKO("-xÆONone¶ -¾$="äW*=€Ïprocess_opt)m ·f`1"--TN³»8l ‹ j ="Æ_name"2-UhC]1ionmœ_` if†WÐ-x": ð" self.assertEqual(option._short_opts, ["-x"]) 19Dlong84òTrue(parser_ isˆh4Pvalue2ONone+ÌDvarse.9ðs), {'filename': F9}) Û‡_2u.x = 42"ðelif opt == "--L%": TfT"t\;1¯lue, "foo"\3œ, 'x': 42e{setattrŸ,Z€adest, ´‰OelsekÓfail("UnknownAà %r in process�@." %íðdef test_callback(·)_P¨1OK(,ö=&)],ûÿ kV9 /[]§\_help¬a# ThisÐ@ was÷õmpted by SF bug #960515 -- the point is¾ñ# not to inspect&l¡ text, jusçmake sure that?bformatŸõ) doesn't crash.'[A = OgYör(usage=SUPPRESS_USAGEö4p.removeÊwion("-h¢#6add !t"ªäP", ac×$="î" %r=lambda&ï, type="string@ 7=ïÆ exW!ed"R = ("Us:\n"!* à" -t TEST, --Î= w foo\n°H#), xó) class TestCûàExtraArgs(Base%MsetUq&Ps = [vpv_wø|ÐÀ_tuple³ <ï_args=(3, int)¹F{!="Âõs", default=[])]§�rÍb_list= sN ÑÇóó", ¾b_, lenÁ“£~µ%33!5º4àint) ÷if opt == "-p": õself.assertEqual(value, "1,2,3")-(elGo-pointL…4,5,6") Meñ = tuple(map(type, Æ.split(","))€ñgetattr(parser_.+ s,Úòion.dest).appendÄoðdef test_callback_extra_args(þ) PgrOK(["-p C, "-÷2, "Ó%],ÓT !{'&as': [(EA), (:?)]}; ó[]) class TestC¼pMeddleA»@Base¿ç\setUpÔòoptions = [make_°(str(x), ac$=""— Ú*=.°process_n, ƒ–='things'¹4õ for x in range(-1, -6, -1)]HV~Qr = O¾�"r(»b_list= så$# "q that m(sk`rgs, lðe*¶.E…#, i`Â#mñ is -3, -5, etc.W!ne` = int­F[1:]rX.;qif len(A) < Kš^ð fail("Expected %d arguments _#%s¥a." % (GØK©$ =áJ�.ensure_X¾V , ��<g¾³1[0:k]gé{4&Jdel A%¥ ¶Ó·€1", "foo -32barzOqux"À ÍÀKÁ"HÏ@1, 3ÓC ’Ü¡_separator›~ÿª�2Ëæ-Ñ¿'foo', '--'¿2¼�?any�10"-aÇ�--apple"–/=2Ÿ$`many, e¯="string")K$2"-b— bo +•3Jë4•N-5ÚÀmany(self, oóption, opt, value, parser_):  if!† == "-a"óself.assertEqual(Fõ("foo", "bar"))L(elNo-appleS@dingTOdongUbP1, 2, 3ž/boLá-666, 42, 0)) ïðdef test_many_args(.Y=Pv@OK([c(, >C, "-)9, ",iˆ0"-b.123 --×U0666?42"H ?0"]" #{"ÈP Noneõ9 }9 ð[]) class TestCallbackCheckAbbrev(Base7U_setUpL¼A = OÙU&r(~q%a.add_o'€("--foo-«@, ac3="c� 4 *=_c½!_a¾ ¼v~íÕTa¬²dnz_•¡_expansionvZ)~ �"], {}, Ÿ@VarAΛf–s = [makevða", type="int", n%ß=2, dest="a")> Eä´´store_true"EbEc $--5"/�variableù�Ec")]³Ú�ù = Intercepting¾ÿusage=SUPPRESS_USAGE.ƒb_list= s8 ¬'�BTrueý1 isûwÿýrë# =n.awhile  nRarg =&[0MöÂif ((arg[:2]« -" and len•) > 2) orf63[:16 51FZ@1] !'")FBYbreak\Jelse¿( p.appendz&>delã‚setattr(0.Fs¦.0Á×ÜÀ): sñelf.assertParseOK(["-a3", "-5�-callback0foo�bar"], ø{'a': (3, -5), 'b': None, 'c': ["J}K A[]) kñ!def test_consume_separator_stop_at_option(self):5£æcÊ 37 --0xxx -b_helloå×lp þOTrueè  “] "« &@posiðal_arg_and_variables&\/¶/ '5c':9ƒ$3&bæFÚ ù´invalidï@Fail×ÂÛâa"], "no such <ð: -5") # -- Test conflict handling and p0!r.P?) -“ class CFPBase(\¥Ú\setUp”””s = [makeñ0"-v¤à--verbose", acì�="count"i – dest="?òhelp="increment eity")]ÜHññr = InterceptingOxCÿr(usage=SUPPRESS_USAGE‘ 4úb_list= sá”show_versî,¿ƒ, value,¤eb½.(s.FD = 1«š¯( ³J÷"""Use the defaul$`resoluŒP for ñk 1.2: error."""Póyc_%c, funcr¼ erv„9qRaises(O!48, (!$b"), {'$V' : "Õ ?C'4A‡@á'lD"@j¢ Ç9$on}E< c"A -v/E:¬¦!ðstring(s): -v") selfó,.assertEqual(err.msg, "conflicting option string(s): -v") MselfF4ñ_id, "-v/--version") 9”def test_ip_error(M!):#_\OTrue-Â.parser.add_ub l_grouphA = OëG#^1, "/ 1øœR–vno_suchohandle uRaises(!'seOOù, ('foo',), None,>`ValueEyµ, "invalid earesoluüv) JÂà class TestC)R-4ve(CBaseÉìMsetUv,."¤ÿÞ!("¤,ve—4P("-v"Œ‰@, acܺ="callback"_ *=™Sshow_Ø€, help=" *A ì¶ †vÂ1 = ^Ã0get1ionÃwpverbose3 ð("Ÿ:³Ëš2ô(²$isóT£.0not2˜2’a`._long*Vs, ["M]l:q6a._shorHA/v":z#Ú zv 6v¶R_† W‡òOutput(["-h"], """\ ôsuZjì¤ incremen­Àity -h, --i&òAthisð message and exit1v1v! 1? ""&½ÙP OKÚ?v"]É #{';"': '“Ê_': 1}A /[]cÙ°²¤¹£*Àolve_long_op³ts(self): ò.assertParseOK(["--verbose", usion"],7>#{'5ð': 1, 'show_ver;}> ð[]) class TestConflictOverride(Base»Ÿdef setUpÐpÊñr = InterceptingOptionåõr(usage=SUPPRESS_USAGE)ÞEc.set_cŽÿ_handler("resolve"4Qadd_ooB("-nE�dry-run" P ac¨°="store_tru†¯dest="dry_Dÿhelp="don't do anything¯-© ¼œ ¯�const", _=42, º# ry run modd„ó7tesŽol Ùhopt = Ê0get*eion("-ç  ñEqual(opt._shor8@s, []2 @longi1iá@È·Ñ–`Output ¢h"], """\ ÖsÑ`-h, --Dg €a this 0mesôà and exit -n1ð7 duo """) x =argxr°lQ=Ü_': 42+°# -- Other oing. - À _expected_(‚_basic =^U3¢: bar.py [Ô9s] wqa APPLEuRthrow¡s at baskerPb NUMv€boo=NUM §�ut "boo!"à times (in ordßño frighten away all the�pñevil spirits that cause troubleÿ`mayhemÇ–--foo=FOOBw  ingð foo list for later0ingB sFw ="""t2P_firs¸Ü~>-v1, -‰~­í@, -hy~Àage and exitð$ """ _expected_help_title_formatter = """\ Usage =ò bar.py [options] O "Æ== -a APPLE Rthrowñs at basket --boo=NUM, -b NUM shout "boo!"ötimes (in order to frighten away all the n õ&evil spirits that cause trouble and mayhem) --foo=FOO>p store  incð foo list for la$�fooing --BE, -h? show this @ mesHtOexit‚¹short_lines~:wO: r i%, |t^ ‰ v8‹ / �#m¢@ -hö�¥¤Bvery+©,ª /«" &*. 2 6 1the± + ¤37¬48< @ ¢ž¹ JNðclass TestHelp(Base )$ó def setUp(self Q.parsôRmake_Q(80) iA*—, columnsPA = [8d<ù("-a", type="string", dest='a',7;‘metavar="3!",\!="K `*")I €Qb", "‰5int†?booˆJNUM"f«´=Í"Ë! \È\ï"O Ð÷# P", acë…="append. ·f1  " R ™]ƒU�# We need ±set COLUMNS–БPÑðconstructor, but ñ4 # we must restore its original value -- otherwise, this test €# screws¢ngs up for4*÷s when it's part of the PythonHWu suite.õwith support.EnvironmentVarGuard() as env:3–ùenv['COLUMNS'] = str(columns)*ñreturn InterceptingOptionParser(o b_list= 1s) Bödef assertHelpEquals(self, expected_output)��save_argv”0ys. 1[:]Q¹6try-°# Make optp‘ö believe bar.py is being executed;>sc0òos.path.join("foo", "I"Ç.ÝOÃ~(["-h"]Ûºf4l¾€:€ýAôQ_help:)3elf‚__Z4g_basic�N¯_old_usageXKSr.set% "U,“: %prog [é]�!ÿlong_opts_first– òformatter.short1E = 0kŒ r&etitle_q –}("}•"] = "80"½—Ý…~@ = T�d`F(™'v  × ûSwrap_  óà# Ensure that *p^0resÒ3s $ØsŒ‡ variabl·ñ# Need to reconstructööb, sincf';µe only time*Ÿulook atyàOMSRmake_6(60:+Ï6nGline#:RedAveryê_iîK¼ounicodº / =±öû=SUPPRESS_USAGE Ð@.add“Àion("-a", acù!=" €_true", i·="ol\u00E9!ŒàB""\ 6s¾`-h, --9` showsI@ mesjà and exit -ag6 ""3… ¿ Ýv_Bq_descriÂéÀ): sñelf.parser = InterceptingOptionPÿ (usage=SUPPRESS_USAGE, adescriWÕ="ol\u00E9!")Håexpect = """\ "" Œñ s: -h, --help show this 0mes§Õ and exit """\séòassertHelpEquals(r!) '�def test_N_®€_groups(D)…ø<H.set2(Q'@ "T¤÷is the program `` for %". V has ½IQ"an o= �€ as wellcsingle3s."Ñ7,"= CGÉ �ÆÃ, "Dangerous1*s"ç@"Cau€: use ofÓ ™üs is at your own risk. É It(ôbelieved that somO`m biteÅÀÄR.add_�("-g", acŠá="store_true", !="èJíPà(g;�U\¢: bar.py [ŠOs] Ý6$. ?ßÐ Ð pa APPLERthrow€`basket-Pb NUM1qboo=NUM4�ut "boo!"ð times (in order to frighten away allæ ÒyÐ evil spiritßPat caqtroubleŒ`mayhemç•--foo=FOO@ ½  ing‘ foo listPlater0ingÐýC = ÔÃÊ! »¿S#-g§ ™¡Eœ¢ '²p.epilog¢ðPlease report bugsɦ/dev/null.Lg o + "\nL \nað class TestMatchAbbrev(Base(Tm$"_a%„!Óú˜)(_.K"--f‡6{/šoz": None¾37o7"/ie7"5/})¥–n£Lm_error›7^ð wordmap = {"--foz": Noneò, "--foo": None#ie3} õself.assertRaises("ò _match_abbrev, (s, wordmap),Y /ñ BadOptionError, "ambiguous oÐ: --f (--fie, "ooðz?)") class TestParseNumber(Base!):o def setUp(¿¯ .p9òr = Intercepting—T1r()F 1R.add_¦ÿ("-n", type=int/l/_¥Qtest_�Ÿ_num_fail³�>p, ("", �Q, {},eÄRValueu ðre.compile(r"invalid literal forOË().*: '?'?")ë˜0xOoopsŸHCs?'?f¨çKdef d/okbfEqual(’5("0´0ü2&x15/166%XAj1kj8i5b11j353:0) [snumerics^^BOK([?@"42"xz"0x20"]µ¹ð{ "n": 42, "l": 3o }, []Æ nP0b010û_"-l01m5l8i F»Ù?008È 2 "GT -n: u�integer vª�: '008'"Ùpl×/23sls_b0123v¹_0x12xy3Jxà@MiscÐ�Case(unitÅ.ÑÝl_all__yôblacklist = {'check_builtin', 'Azú·NO_DEFAULT'rupport.Fp,¸ƒ%, q= ²§Smain(¼sQDrun_àô(__name__) if p == '__>2__'áq() fromå0 im¥ \t gdbm =ð.import_module(ð"dbm.gnu") #skip if not supported im ” unittest€os from .. ,‚TESTFN, ó_NONASCII, unlink filename =%ô class TestGdbm(p.ó Case): def setUp(self¥.g = None ,ŒtearDown/iGqlf.g isò7cNR�.close()RÅ(Ã)lìst_key_methodstQ@ = gvEopenFV, 'c'd*±assertEqualJÛ.g.keys(), [],Åg['a'] = 'b'ªFâg['12345678910$ý 019237410982340912840198242>qb'bytes9fb'data#ìPset =“ ¤  Ì6,5t[b'a', f ¯)I1In(7â#[$\[ƒ]„èX1keyå1—.firstkeyŸwhile keyBûpIn(key,$F_set[Sp.remove) 1nex~6key&°# get() andW`defaulúwork as in the dict interface*©.UF)b¡ Is;þ2Oxxx'º_-`Afoo'i œQwith Å¡÷Raises(KeyErrorK)0g['U]D? �4set+b3ˆD[96¹v¨ _e¥­_condition�# Try to ð a non-existent ‡Qbase.Tà ~Ÿ"f,r$, ¹G, 'rÒˆ‘access a ùd„kkb¸È gCA�¬rlambda:ôÙéPtry p,¢an invalid<Eflag(cÁDrx')³ ÞdÃ1est` ¡ parameter˜ö() by trying all\ .Vmodesá"P�_(s‘ standardGös (presumably "crwn")Ve! =€À- set('fsu')# ðfor mode in sorted(âs): # put "c""Ufirst9@ñ self.g = gdbm.open(filename,4)/•.close() õ# Test additional flags (presumably "fsu").4"ö= all - set('crwn'rÚÓ:=¼Eùs#ß! +ªt6: êðdef test_reorganize(()yP''cÝðsize0 = os.path.get^Uõ['x'] = 'x' * 10000:1M ÔL°assertTrue(:@0 < 1tAdel ,gxj0# '+ö*' is supposed to be the same even after deleting an entry^ŠoEqual( ,ž<'g.ˆÂŸ2 &11 >nA2 >= 0ýücontext_managerOwithNþf as db/’@db["~ Y Y"í"ti?r')i5qÿlist(db.keys()), [bНwKpRaises(Âa.error|,cmåfICÿõstr(cm.exception),,x ñ"GDBM object has already been Ÿ#d"µ¹_bytes¯1!b'K‘ key \xbd—RvalueÀ4" b'«( …,`é µ7/db5•=db[94], í nmunicod! c¶Rdb['ULq‚U0001f40w‹~JwOu1.enö/)]YŽ@žÀelf.assertTr÷ue('Unicode key \U0001f40d' in db) ÿself.assertEqual(db[@0.enWI()],DO AXvalueƒC†'}2Àÿ@unittest.skipUnless(TESTFN_NONASCIIêñ 'requires OS support of non-< 0Rings'ï@def pð_nonascii_filename(ˆ!):—D; = ‘#2ô.addCleanup(unlink, ;sMôwith gdbm.open(!Æ, 'c') as dbz1ñdb[b'key'] = b'Æ'y3õTrue(os.path.exists_)�r�Üc–ôlist(db.keys()), ¡e¹8›Æø.%],ó�) if __£ò__ == '__main__'3C„() from 1 imBmockþ3.Ä_httpservers*òNoLogRequestHandler6 i‚TestCaseÄwsgiref.utilK`setup_iÊing_defaults0Ghead~H $‡£CBase› , 5CGITSimpl H—£ ”.validate"oúÜs[_1,QWSGISC , ;A CmakeT–•t.clienteâHTTPConnection'$ioñStringIO, Bytes �ufferedRP1jsocket¾>¾$„platform[qpython_ùQmenta€ l$os $re esignaly#”threadingQÒ class Mock�(J ©r"""Non-Ä  ÊA""" /ñ�__init__ã,"ª_address, œCu_Ñ .H „Gœv_bind() (~ahost, à = .-¾`,0 = < O ›penviron¢ƒK„ 2ð): """Non-soñcket HTTP handler""" def setup(self):á.connection = zrequest'brfile,!w .@ 2nlfinishoppass !óhello_app(environ,start_response¥ Á("200 OK", [kÄ÷('Content-Type','text/plain'),'0DatñMon, 05 Jun 2006 18:49:54 GMT')1]°return [b"H¯¥, world!"]ÅIaderÆ ²Ç' È / 'É –';'.join(? ['9õ_X_TEST_HEADER'], æQUERY_STRING']X!³PATH_INFO']Dô.encode('iso-8859-1')<årun_amock(app=á, data=b"GET /Δ/1.0\n\n"Máerver = make_sñ("", 80, app, MockS HÕðinp = BufferedReÃ�(BytesIO(})(0out(@lder{`sys.st ì Ò = StringIO()8tryxÃ.&_oó((inp, out), ("127.0.0.1",8888–hfinallKŠA = o q½÷out.getvalue(), err�ñcompare_generic_iter(^ƒit,match{ã"""Utility to 73 a 9  2.1/2.2+ BÂator with an2bleœð If running under Python <ò, this tests the;L us1[ƒ()/next(àó as well as __getitem__. 'Åò' must be a funí!Sqa freshË_º to0‡’ed (sinceš1mayž �ptwice).sH¢2it(>`00for×Qm in `àif not it[n]==ÊÐ: raise Asser§QErrorHAn+=1 b@Áexcept Index:l�DFelseo¡("Too many¹hs fromnO",itëP°, StopIteraÀ—OName–S# OnlzUS mode?8VÍi¸ùzYÏer(it) is it\ ¨S‹S!==U ¨G@³ 5Ÿ3ºÀ else:  ðn8ðb"GET /p%61th/?query=I ñ è@b"X-ÏP-HeadðPŽ 5-2. š80\n% *h’c_app, ñ2=å 2outÉlines()[-1],"'b"é, 6 2;7v;/path/ þ˜ã §×Rdata=©MÐ(b"x" * 65537õ'b"­'\n{ ô ç0æböR414 RDP-URI \Long"àŸvalidatedâ41or(Á)¹ó# the middleware doesn't support len(), so cM@! i'UthereË D u\FalseÖsl_©Qion_eNf†0badÁ(‰Ñ,start_respon_: "("]T", (' 6',''Lšreturn ["–]óUË3or(±VÖƒ¥.endswith(W|Qb"A sø·ñor occurred. Please”1actÅçadministrator.%î|Œ p;err§2Á"º": §0!) ;ñdef test_status_validation_errors(self):-k1òcreate_bad_app(;$(!ûenviron, start_response26 !Zõ#, [("Content-Type", "text/plain; charset=utf-8")])®Tù return [b"Hello, world!"]*&·!>!Ys = [.à('200', 'Asser3E21: SK ‘¡at least 4©�acters'),MOX OKP dessageXÿgin w/3-digit codeT0Sýhave a space afterV]0forÏ£tus, exc_mž!inPs2BPwith Jƒ.subTestÛ=<2ÿout, err = run_amock(yïja—ÐTrue(out.ends‡(xk b"A serveruðor occurred. P¿ö e contact the administrator.VK)” ù Equal(err.splitlines()[-2]L £¯wsgi_input•¶K(e,sY0e[";.;Š"].read(¡¯s("200 OK"m,Cw[b"data`Ðn3or(¾8ļ4|¬ 4¹" ÇHbyteiÍWUif inKÿ.wait(timeout=float(1))y?]break³ýnonlocal received"z = len(b)«Ù0clo© JÃbackground =tQing.T~à(target=run_cl_S9v.start(äserver.handle_L ;Ijoin:ôlf.assertEqual(áñ , support.SOCK_MAX_SIZE - Hð class UtilityTests(bCase):ïñ def checkShift(self,sn_in,pi0art0out7out²òenv = {'SCRIPT_NAME':>Á'PATH_INFO':J}^öutil.setup_testing_defaults(env� ù:©¡_path_info3_,part9Genv[’]Ë” k2Ø]f«return envKDÎMð key, value, alt=Non~â0# C -wLUempty jE …£sinstance(ˆ‡StringIOÌŒ4IsI4 ekey], 7˜l`_Bytes^5\s—  ›Ù)‰ËW1exic‚\ºkey:altW ‹I·[#3alt†ZYCross±W,**kw…á&kw{~ "kw€V �bAppURI�?uriuÀefaults(kw)  ð!self.assertEqual(util.application_uri(kw),uri) 7ðdef checkReqURI(Dñ,query=1,**kw):,0Sðsetup_testing_defaultsZ(HŒsrequestˆdŽ"FWŠòtext,size,match):¶Šº€make_it('=,=1´.qreturn ¿ñFileWrapper(StringIOC)?6ócompare_generic_iter(u’‘Sit = /() ÷ False(it.filelike.closedræfor item in itxŽFpassobX"itl™?Tru˜jíÁSimpleShiftsŸdŽI  ('','/', '  -x*/'00/',YcNone, h/ aŽ6x/ycae//yg 8Q', '•/8'´¡Normalized @/a/b�2/..˜!..a— " 75 pn  ª!/yÉ ;/<å <;x'0//.bQ/y/./F g½:d1a/bGº,¤9xrsb­u4', d ­D²¶Å} key, valueƒ[Ç�ÿ ('SERVER_NAME','127.0.0.1'),)@PORT8/80#ÿROTOCOL','HTTP/1.,__HOSTv ÿREQUEST_METHOD','GETyTCRIPTÅ �PATH_INFO6ýwsgi.version', (1,0)%Ïrun_once', 0"¿multithread% tprocess&À (÷ 'wsgi.input', BytesIO()), ('ÿerrors', String)÷url_scheme','http'Q)]:\ñself.checkDefault(key,value) *Ódef testCross% s(8)KG'õ('HTTP_HOST',"foo.bar",SERVER_NAME=)möL,Ü"Ü0s",eoS="on"E/1D0?yesF&Î?fooEK0PORb/80?*5443@M“aGuessSWþðassertEqual(util.g1‰a({}), ± Ö8 C0S':)"E.&onD ¥ŠàŠF&1Š loAppURIf!(QÜ://127.0.0.1/^Û.Óspam", SCRIPT‘/JG?%E4I_\xe4m“tú.example.com:2071/"èM/="0Ê[ ="D}! xe° zaŸÒ$Æq$s , 8 Öf:8000/ŽT—¤Ÿ¯setdefaultr<y[à/],Ø[Ô] ×ðdef testRequireList(Ý)�ŒRps(TypeE,N!, †�UlExtrasP…f\Óstr(h),'\r\n'Yõqh.add_hÆ <Ïr',baz="spamÞ è,·&; 5} Œˆfoo: bar8 ¤”¤¿cheese=Noneƒ ìxù ‚'Í^ Ë R\عyò'j÷ J ‘) class .óHandler(BaseCGIj²"""Simple h'B sub=S¤@ing <92"""Ä#ð records the OS environment at import time, but AvarsÆñ# might have been changed later by other2ós, which trips upCž`Tests.·E‚1()."3os_”³ = dict(os.t.items(tH�__init__FS,**kw1’`setup_eCing_Fs(kw]1m.OŒD}¹, BytesIO() bString9kw,8Àmultithread=¨!, qprocess0 %(Ø A, w/Ÿ• passthruÐdef handle_erÃror(self): ñHraise # for testing, we want to see what's happening class HandlerTests(TestCase): `ñdef checkEnvironAttrs�A, ha9ŠTenv =".e3H«ž•attr in [ô'version','multithreadð process','run_once','file_wrÎ%r'M]X0if q*==/E and¦Xwsgi_NŠ is NoneKO…continueo�ð.assertEqual(getu(!,'b '+a),env[.1]) Oi#OSkfFeómpty = {}; setup_ó°_defaults(e#)X£— ïrom os import ¶0k,vµw.items(“e�if k not)€@ + Fk],v«$nElIPIn(k,µHEªƒh = Testõf(X="Y""h.Re»(s h"à (h!a["X"],ˆ³ Ã?CGIÆtBaseCGIɲ,&{}™Õn ey³”Òurl_scheme', Uinputzerrors'ÜÛ…In(key, Ý —S]Û–=”ßHTTPS="on"); ½vytaÍ—],'https' tj='øâAbstractMethodB0 = ÑΧ£@name¤ 5ð_flush','get_stdi@ ÿerr','add_cgi_vars%HRJðs(NotImplementedEó%, ×,�)¢@°h._write, "Ý"!ÜContentLength ð # Demo one reason iterati ás better than dƒ()... ;dŸU÷rivial_app1(e,s�#Ös('200 OK',[]àŸreturn [e[ò.encode('iso-8859-1')]Ö< z2z(fÀme'].encode(÷'iso-8859-1')) ¥return [] õdef trivial_app3(e,s):=ßs('200 OK',[]Qp'\u0442 35!41ÿ2'.encode("utf-8"){4{ÿ# Simulate a response to a HEAD request¯ÿ ('Content-Length', '12345')Ê öh = TestHandler(ûgh.run(71ùself.assertEqual(h.stdout.getvalue(),±¢("Status: gY\r\n"""Æ?: 4$ehttp")ƒ6"))è2èLÄQ3Ä).b'¬'¬bs0: 8Ö %òxd1\x82\xd0\xb5\1/2'µ#4ñ]bá4r\nÅdyðestBasicErrorOutput(A&):Ÿ)Pnon_e$¤(£ÙRN qraise AÄ1ion�ò ("This should be caught by h "ž7< Ñ )= 0› a*šÛ8errÛ"‡3!%sÉ ‘=ÿType: text/plain+.O: %d%b % (h.¿s¿E,lenebody))Q ” ž$+ F3÷mJIn("Ž1", W|Àalue()) ó def testErrorAfterOutput(self): áMSG = b"Some o#õ has been sent"+SeO‡_app(e,sGNõs("200 OK",[])(MSG)< ñraise Assertionšõ("This should be caught by handler") FAh = 7H(aeh.run(Ÿð!.auõ Equal(h.stdout.getvalue(),b¨¢("Status: ÏF\r\n""ð.encode("iso-8859-1")+÷~JIn("ý1", �7err�ðnÁÔHeaderFormats¾°&Enon_ù˜'É'˜;É–return []dªstdpat = (*�"HTTP/%sò r"Date: \w{3}, [ 0123]\dÅ \d{4} \d\d:A GMTK kñ%s" r"Content-Length: 0+" r~3mOhort½Ñ ` _ç0öfor ssw in "FooBar/1.0", NonehnAsw =,òand "Server: %sØ%Vor ""^7bqversionf_Z"1.1"`-Qproto+´b0.9", À<AH>iDTesthñSERVER_PROTOCOL=by7¡h.origin_sà� = Falsegd.http_Ý#= -R’_softwareM, ® sD,š 'šæ-:?Tru,…1if ø"==LX� ZQO,b""˜;els=X\0 ª!¢re.match((Û#%(f_,sw))Þ M Í F*NÐ  0) ñ def testBytesData(self):!‡app(e, sÕs("200 OK", [1ý("Content-Type", "text/plain; charset=utf-8"),?)])òreturn [b"data"]¾höh = TestHandler(8–h.run(appÝò.assertEqual(b"Status: ËY\r\n"zbÈ/: Æ; ŸLength: 4%æ ûh.stdout.getvalue()ÅÌCloseOnErrorÈðside_effects = {'c-õ_called': False}úöMSG = b"Some output has been sent%Ces_('v[])(MSG�Áû class CrashyIterable(objectq.nŒ__iter__ä ¦while TrueÌÕyield b'blah'ûqraise A5#io^ "This shouBÒe caught by hˆ"åM»v¸ ¨[¥]ê9rueª ?v !¼² '– ,fräPÌPartialWriteïpwritten`“ytearray(?±ArÃdDY?, b'p€dI[:7]3e@³ten.extend(/$_6len$ M�\flushæ>Fpass®`enviroüö{"SERVER_PROTOCOL": "HTTP/1.0"ŠÀdSimpleÁ¬iIO(), &0sys'Serr, lÕsmsg = "¶snot do û &es×Wwith ðWarnsRegex(Deprecation‹ing, msg‡Phello‡U…ø† >ðDate: Mon, 05 JunXï6 18:49:54 GMT7±®/13&Hæš, world!"¸Yòten) if __name__ == "__main__"á un0st.ñ() """ Fodder for module finaliz¼As in !_m".9ð import shutil impoò)rt test.final_b x = 'a' class C: def __del__(self)ñ# Inspect module globals and builtinsE.üprint("x =", x)‡. š.-Ñshutil.rmtreeQ‰getattr(ý, '__name__', None)x9lenA?len7ó c = C() _underscored@impoOcimeit @unitÇ4sys óio from textwrap 3tdedent ast.sup[!ÿcaptured_stdout)�err # tž 'sÒñault number of iterations. DEFAULT_NUMBER = 10C krepetiD REPEAT = 5>‘XXX: somexðs are commented out that wouldprove th%€verage b$Áake a # longÕá to run becaus3yc=;defîðloops, which isK”arge. Thœc…Ðbe enabled ifNÀre was a waywqoverridtX' #ZlP duri­resting,È3hisìPrequi Ahang)€he signaí #£8Afuncc*íy šð@argu[.Ð’FakeTimerÁñBASE_TIME = 42.0�íRinit_îð, seconds_per_increUG=1.0 ’.count = Jò¿setup_calls]s VÈp._fake_ @r = k #Ãpèareturn-.+À* ƒaHpassypst_reinHl_empty„øÀassertEqual(?4it.6¶("", 0), "",545¿‡þŽosingle�â“ —1!, ›ðpass") defó test_reindent_multi_empty(self): ô.assertEqual(timeit.<Ò("\n\n", 0), )=4=t \n1") F?def¬¦MYò"print()\npass\nbreakÃ(ßN_, 4),(¬¢ ¦ �ïr_invalid_stmtðRaises(ValueError, @ it.Timer, @_=Noneå?oSyntax@�'return'D*_yieldC0� from ()K+|C+�continueF+δ¯ import *' Oetup*A*A-E+D.L+D.G `fake_s(C = ":H"\n!._% !r.+1()"š<0inc:;À?scallabl…�( Dç'C†Aiç!, ä�, numberà‘, globals ]q = Fake5(ç9t =P(4=m=s�!r=[U ò�i±kwargs = {}f-#ifÊ@ is ÃÄànumber = DEFAU³LT_NUMBER Uelse:òkwargs['number'] = &ðdelta_time = t. Rit(**:)(ñself.assertEqual(Afake=ÿr.setup_calls, 19ccount,˜8ª-Ÿò# Takes too long to run in debug build.,�def test¶ñit_default_itersÕ)C#@å ñgstmt, û!) a `Nzero]\ñ/=0f?fewe73eÜPable_+Î 3 3×rbs�jƒDs�tmt_and_Ù|l"2)•Ò*ˆfunction³ÍAëEimeiðš ?þ,ËEÌÒr=FakeTimer()º$N,zu, DEFAU¼kÄ_?TÎl"=0ØÓ×Ö ™€globals_‡‘Q" _‘ri 7 = j$tú…½)=';’.inc()', Ú ³nÜõRaises(NameError,<5VG?tmt€S" #s=/()zRlocal5 ãœ6 ˜ +s—•ýarepeatì , ‘�Rtup, U=NoneÑ qüˆdYrÙÀ t = tiðmeit.Timer(stmt=�, setup=0, t±=self.fake_3) µkwargs = {}õif repeat is None:6õ= DEFAULT_REPEAT$;els2e"[':C'] =a4Ÿif numbersseNUMBER?s:s 4Qdeltaÿ"t.�2(**®#<ÁassertEqual(M .sps_calls,Ù>Tcount8# *A¹7r[float(åA)]) éò# Takes too long to run in debug build.,’def test_ �_defaultð)#$Y|i‡ Z@zerofs@\[ü/=0e Oiterf+Rf1fewÊ__and_n/W3=3,/=5ÞoPable_xG 3' «,…Œ �·„�D�21tmt–Š–†?tmtŸ2‚*ˆfunction½ƒ! =äiŸŸ d [FéR=FakeL)~$Nþ{,3 * ‡¨� à_néŒ"=0óîòñ [ZË  Ì*‡Ð,  °timer=FakeT @()) ðself.assertEqual(delta_2ñ s, DEFAULT_REPEAT * [0.0]) ?Bdef :À_exc_string(Q&,  apected&aname):@(wlines =4a.split(«ÅGreater(len(CO), 2.FTrue'ÿ [0].startswith('Traceback' >)-1?,exÝ test_printüüôAio.S8'IOê@t = ‚2it.±V"1/0"Ü6tryCG"t./Dlexcept'�O³¨Êó.getvalue(), 'ZeroDivisionError'êTMAIN_*ñOUTPUT = "1 loop, best of 5: 1 sec per6\n"I�run_main%,(ð onds_per_increment=1.0, ·¡ches=None,(r ["if@ is ' 6 = ?seco7%ifŒh0argä&[]ï:lseŒ$Õ&[:-q.append¦.fake_stmt„#è1it.<õ) modifies sys.path, so save and restore it.”�orig_sys_/% =:‹*ú captured_stdout() as sχŽÀ=q, _wrapU r=#&r.Í´i[:] = ˜�‡return sŸHs R_bad_W>•ôu1witT‚['--bad-9'']� )ås, dedent("""\O�xoption Kù not recognized/ðuse -h/--help for comm°  0C""")|Fdef ó±ðð?5.5ð Ô05.5®Öœ_milli¡,_0.005¤ !50^sz¦m}§?cro§0W00025­['-n100R ?"10¿_2.5 u¿ðfixed_iters(self)3: ö0s = self.run_main(seconds_per_increment=2.0, switches=['-n35'])HDñassertEqual(s, "35 loops, best of 5: 2 sec perQ\n") F�def test†p_setup(š)­#Tå ½ð, '-s', 'print("CustomSx/")Û.ý\n" * DEFAULT_REPEAT +€)‚multiplesSIa = -3a'}Ÿfixed_rep"&,60è/r9 1Êå_9: 60æ�negative´=-œ µ1µP@unitœñ!.skipIf(sys.flags.optimize >= 2, "need __doc__") Ù?helØjh�ñ8# Note: It's not clear that the trailing space was intended as part of A #5”ð text, but since ibñthere, check for it.ÕAž.ôstimeit.o + ' 'áverboseË v @dedeÍ5""\§«òP -> 1�sw@raw Á"s:#,>`5Fì ’O""")/y_®‹0.000_03´v@4R3e-05D;2 sf6&&«1N&10O)3v (6(À 50 loopsû -> 0.0015 secs ”100 loops)3(2(6(5(x yx (x (x )x ÿraw times: 300 msec,  M4100°, best of 5Z‘ usec per† 9R"""))Lðdef test_main_with_œÅ_unit(self):;_U = A.run7ð(seconds_per_increment=%3,>õswitches=['-u', 'sec'])([ÄassertEqual(wK"d üyEþ6\n"aPv È;SÉ&Ê3ÇäÇ;SÇ&ÇJe+03� ’0# Tº€invalid ¡e input™ö captured_stderr() as error_stringio­oQ!*I ´?par· ™¾.getvalue()7cÂ"Unrecognize€. PleasemQect n)y@, oræ.L+ ΜexceptionÉN#s0Ë?1/05C_exc (ð 'ZeroDivisionEÕ'£Õ¿_fixed_repsàP0-n1¬çL‘autorangeÒ,ÞY÷1/1024, callback=None¨Áßr = FakeTimer¡·(1t =¨3it.FÐtmt=self.fakeñ_stmt, setup=self.fake_�, timer=3) ñreturn t.autorange(callback) &–def test_"[!):G’num_loopsd�_taken = 'Xu·ssertEqual(B?500)¾`¯, 500/1024¨€_second(o¯=ÿs_per_increment=1.Ÿ È1ÆQKid_with_� È0Ga, bä—ñ print("{} {:.3f}".format(,Ÿeö captured_stdout() as säQÞˆè”= kŠ/.aù7–ñexpected = ('1 0.001\n'W !'2 2 5 5  10!/10!2!2!5!/49B!10"/98"2"/19§5" 48D‚äs.getvalue(), Iò) if __name__ == '__main__'@unit.ô () from contextlib importƒmanager @dateD¦faulthandl$$osesignal†ubproces "ys�y0sup�.!ô cript_helper, is_androidi…tempfile„hreadingddxtwrap`²dedent try2ü_¦Ñcapi except I*RError)"ð = None TIMEOUT = 0.5 MS_WINDOWSñ0os.¦¤`nt') Ê`_traceТ(lineno1, p2, headüpmin_couàEsregex ="Iò+= ' File ""Só %s in func\n' %h1>†@2@uif 1 < ª*ÙÃs'^' + (¦¥ '\n') * (2� - 1) + "TOelseH%b + '$'P�skip_segª4_on-(Î5ò# Issue #32138: Raising SIGSEGV on Acñ may not cause a crash.–Ð].z6If( ,'ûð ðR 'raising SIGSEGV on Android is unreliable')(test) @contextmanager def temporary_filename(): a0 = %0.mk 0() !2try* `yield %D gfinall$ôsupport.unlink(-ð) class FaultHandlerTests(unit½.RCase)rºõget_output(self, code,ƒ@=Nond 8ª1"""Ÿ ñRun the specifiedEð in Python (in a new child process) and read?O�P fromò standard error ora¥A (if 1³Uset).LRReturžWõlines as a list. ,QStripròreference countpâ ‹4forãUdebugKcbuild,ßñplace "Current thòõ0x00007f8d8fbd9700" by'K/FXXX"×~±  = dedent(0).sËa¢Õpass_fds = [][:ç@not é15¢.append(fd²Twith ŠðSuppressCrashRežÿ,òñ = script_helper.spawn_p'T('-c'�}= |P€U ¶ôstdout, stderr =qÇ.communicate3@exit@1Gwait*D=ûiÀ_o(~°5 0.deeñ('ascii', 'backslashre,'<£iR ç­Ò.assertEqual(]7, '>Õ*Eopen*p, "rb")*fpV1I` = fp.ªÿ (Î elÐsÖö os.lseek(fd, os.SEEK_SET, 0=¯ÿdùÿ, closefd=Falsear–BQsplit—D(), …˜£acheck_ý ¤3â_number, fatal%E, *,ä+Ìb, all_^òs=True, other_regex$G ‚, know_c×JI'CÈ@ tha0e f¨" h© KÄæsË enzdG�“Ptrace;Ÿ ^ _IðRaise an error ñ if the output doesn't matchóexpected format. 5""" õif all_threads:+óif know_current% $(²header = 'C* OÙ 0x[0-9a-f]+'ZOelseH T�@<€VStackk˜regex = rò²ù^{fatal_error} œ{Oü } \(most recent call first\)»ðFile "", line {ùno} in j–«qdedent(.¹(5U=‰_number, Ù= %ã=0)).º5p()I‘if other_ˆ ï˜ += '|' +(?“ò, exitcode = self.get_(´, filename= v, fd=fdŠ/\’\n'.join(#[passertRñ!!, ª(”NotEqual(¢B, 0)§def check_>(d", µ{ ¾&g, **kw@ÀFr� Python yw: %s' %DBp.‡+0 {`| Âÿwindows_exceptionÈ1WU  [ÍDð @unittest.skipIf(sys.platú.startswith('aix')çë")½ð page of memory is a mapped Ò-only on AIX"<‚_ Q_nullGêúif not MS_WINDOWS2Í5w(ÿ¦õ import faulthandler$w.enable»&»Ô&>"""73ð# Issue #12700: Read NULL raises SIGILL=ÝMac OS X LionÁÀ'(?:Segmenta–ï·•R'|Bus/!ðIllegal instrucR&)'ç0�"–‹À,  ð'access violation') ñ @skip_segfault_on_androidñdef test_sigsegv(self):>õ.check_fatal_error("""#'qimport cyhandler Ÿ.enable()"Ž $I""",53�'Segment�èÆŸ_c_threadõt›rin new Ø'Ãknow_currentúc=False*$sigabrttŽ tAbortedP@unitê.û If(sys.platform == 'win323Üò"SIGFPE cannot be caught on Windows"¡F?fpeEw�£Ò? PùFloating point excep\ U_bõcapi is None, 'need 'ƒ �ôUnless(hasattr(signal, 'SIGBUS')F. à?busŽ+ÅyFü  ¼”;s`.raise3nal" RT Õ6Q'Bus ÆuÆ6?ILLÆMÆ?illÆ¿?ILLÆÀ 'Illegal inñstruction') def test_fatal_error(self): $i.check&5"""#'ùimport faulthandler .Jyb'xyz').I""",23#ÅÏ_without_gilÑdo, True×'P@unit�ð .skipIf(sys.platform.startsæº('openbsd')$–ú"Issue #12868: sigaltstack() doesn't work on Ö@ð"OpenBSD if Python is compiled ‰’ pthread"ô ÀÈnot hasattr(A, '_ŽŸ_overflowÊY'needd.;#()J [ Qrenable(=òµÉ' ý3ÙÀ'(?:SegmentaÎQ|Bus Â*)'0áother_regex='u�Á to raise a ! |@vA_seg¹±_on_android«^Ïgil_released\uigsegv( YV*û\_file# te'1ary# name() as 1w {+ $�output = 1$({tc}, 'wb7(úÌ.Ú(D Û0 ,#_sƒ(@""".Á4at(€U=repr)Æ4Ðp'«&c ø œ\« == "win32„xµ"subprocess@1sup€pass_fdsLtWindowsRi-_fOAÍ$.TJFlR'wb+'JpDÀfd = fp.filegno() ù self.check_fatal_error("""'2ÿimport faulthandler$=sys8ª.enable(%sŽg (‹_sigsegv¶(�""" % fd,j4Ò'SegmentationÃ'&qfd=fd) Q‘@skip_seg�±_on_android’def test_Éð_single_thread(U!):)ªd` ‰yA3alluzs=FalseP 3L:""" 3;…üC1dis '6|code = Š&!}#8æâðnot_expected = 'FK� Python R',Ãstderr, exitäúÀ.get_output(‘1W’\n'.join(#ƹassertTrue(�rnot in 4 ܼÑ"%r is presen/ %r_ J,D)y”NotEqual(Ù3, 0L.#is1 $Rorig_£r = sys. 76tryR´`# regr…Ç may replace;õ by io.StringIO object, butVI 'Òø() requires thatX­has a fileOr# metho%]ÎÛ_ê"__l%%wa " =¦ð:~4 Ñ õ&w6 6q r; +D'bž(8ckfinallñQ7if %   dÎ ýOelse@Üœ ãÌàNqd_by_de© -S# By ô, the module should be FÔ0+ð; print(faulthaóndler.is_enabled())" ðargs = (sys.execut$`, "-E"•c", code)2ð# don't use assert_python_ok() beca¢it always w‘s faultha�Nò output = subprocess.check_(¡}Rself.vbEqual(&ñ.rstrip(), b"False") dðdef test_sys_xoptions(G!):!r# Test Ç? -X«© = "import$ˆ; print(ãr Ífilter(None,šž œ@ if ´ÿflags.ignore_environment else "",K Xç¸-÷{“env = os.fi.copy( ð .pop("PYTHONFAULTHANDLER", è,D`–, env=env†M >TruL~env_varGPemptyiE varz9;«®s­Vdict(²ú^env['¨x'] = ''F'|DEVMODE"É— So# non-²?)1@¿ÿ »4Wádump_tracebackÃà, *, filename=ªA, fd %&""6ûExplicitly call U`) funckQ and yR its ï.a0RaiFpn errorÔ3the&P doesi`match öexpected formatHœn¯ï¶"D = { 5!r}¬$d*d};eò'B(00%if\r¤with open(wß, "wb") as fp5=¶.ƒÀ(fp, all_thrÛeads=False) ýelif fd is not None:%4ÿfaulthandler.dump_traceback(fd,48all_thrœ s� Y �¾def funcA()êIB() 2*A(<5"""$pcode = ….format(ÿ”filename= .8fd=Ahš; ª¥lineno = 9hÈ4'125 a&4&µxpected = [Øú'Stack (most recent call first):'èð' File "", pa %s in”AB' %/no<$17<Ao 193•'Ó] Ú`, exitÕð = self.get_output(%, Ð6 fd·,ÅassertEqual(OH*r3, 0„®[test_seÀl.check)H _Ã(>Máwith temporary#¿U() asô ’B€a>ý‘P@unitÚð.skipIf(sys.platBº == "win32"wò!"subprocess doesn't support pass_fds on Windows"uN?_fdÀ$.T Áb('wb+' pPd=fp.MCno()�Œtruncate†Åmaxlen = 500ž�_S£ = 'x' * ((B+ 50é$U¹('F'...ùÍ8 = Ó@i(t ù ¿{Ž}P6© [þšª½}1unc.=ªS-eåM4u %sá™‰Ö 6;°Àelf.get_outp£ut(code) ÿself.assertEqual(trace, expected*@exitMQ, 0) Qñdef check_dump_KÐback_threads(nÁ, filename):6Š5""" @Call€Šlicitly LD(allP¢=True) andwÅ the output.O÷Raise an error if&á doesn't matchùg formaH£÷8 = Æõimport faulthandler‡ Rfrom Cing /Ty, Event0!BtimeaEi(CDif {b}b¦with open(*ß, "wb") as fp7?Ü.ƒæ](fp, ž ÑBOelse`\ X YÒclass Waiter(QÑ# avoid block‚ Cmain˜ r/s0†xceptionLÀ�daemon = � ›±ef __init__ôŒ(©.+ Ø&9P.runn¶=+(œ#+Vstop ( TA?run� HsO.seto @.wai% lDer =› ³P.star:€ �} &0er.ý²Kjoin8ÈÛ.(NU=repr)Ìs51 = >Bget_vú%� = '\n'.œ^%if2 8¥lineno = 8O]%%10&˜regex = rùv^’ð 0x[0-9a-f]+ \(most recent c�kfirst\ÕÕ(?: File ".*å`.py", … SÕ]+ in [_a-z]+�{„){{1,3}}D„> 23:9run6.r ë_bootstrap_inn—E ó@Currõ="ƒ ö{:0no}üñý 5 28/ð$ c """ ñregex = dedent(ò.format(lineno=¥)).strip()<Àself.assertRG‘(output, F(ñEqual(exitcode, 0) Oðdef test_dump_traceback_threads(k!):+¹o.check1ONone\\_fileaáwith temporary# name() as 1�”8˜P@unitõû.skipIf(not hasattr(faulthandler, '…later'),�h'need B.@2()'¤}MgÔôpeat=False, cancelloops=1�˜ %*,@=¥A, fd ß¡Cæõ how many times the %` is wrKAn in"öout x 2.5 seconds›'or"3"3 ifÖPñTrue: 1, 2 or 33µs dependingxPon reD and@‚options.ÛöàRaise an errorkÂ/á doesn't matchÛrexpect ‡.mðout_str = str(date.cdelta(ý’=TIMEOUT)ï‘~) = iñt;~ b6sysô0)Œ3= { }8<2= { eB = { u j +!r$d*d}³ Sfunc(±úô¿!, v´ï1for‹orange(*.ç¥ ‡=)†=ÜÕQÎ ¥ !b Nb™d.sleep+O * 5,k %if-Èý€ = open( “j, "wb"… elGd×buM±sys.stderr.Soï4Oelse=Z ¿H 7¯0ileÐlk.close›ßÍÀt( ÷ timeout=TIMEOUT, rrepeat= rcancel= aloops= ”filename= Fd=fd)‹ðtrace, exitcode = self.get_output($, W :Ñ = '\n'.join(L%) \rif not È:�count = Ê 2if  15I*= 22Ñheader = r'Tirð \(%s\)!\nThread 0x[0-9a-f]+ \(most recen�ôll first\):\n' %·I_strhñregex = expected_ðÒback(17, 26, ‹a, min_ã=5ÇapassertRS8!, `+Jelse9TEqual9&''6 $Ú3, 0›Ödef test_dumpÅp_later(A)xo.check/T_Ñ[6_=Truefhf6f  dðwith temporary_#ŒU() as:TXDÐP@unit¾ö.skipIf(sys.platform == "win32"ìnò!"subprocess doesn't support pass_fds on Windows"Y2 ?_fdÆ$.T¢File('wb+'pPd=fp.SCno()› \twicežÓ ”#=2a qÓÿhasattr(faulthandler, "register")Xneed 6.4mп�Ñ=False, all_tÞs@ê $unK)d chain wfd=Noneô5"""LRÓ3 a èõ displaying the 8ða user signal. Raise&PQ and ç0 wrÔnK.E"If¯@ is ,8!at=ƒpreviousu§—is calledM�±an error ifBéQmatchê ]5at.Æ"Ò um9Ðignal.SIGUSR1# ¥code = """ÿimport faulthandler /ososignal9ys ÷all_threads = {}(S um#  unregister" &Pchain! pfilenam { +!r$d=:fd}Ã’def func(š)):¹Móos.kill(os.getpid(), .LoO, frameV(`.calle›ITrue| "ZFalser4if ð¹€ = open( "y, "wb")i elGßd is not NoneM±sys.stderr.S,o(Ls=Z z1if Îo`2al.M sæ.J3¦=,zÙÁ= ,¦!={­}6if ³É ž)  Kˆ ®(A and¤ >vÑ?ileÓ �output =G t/elÎ8 >Ñprint("Error:23al ºÆü1!",~=T lCexité1eŸ/0/2#k.closeÒáS(‡ ¡{0 = ‰.format(�S _ %ó2um= µ?= #¢= àú  Fd=fdättrace, ýp = self _°(ïÂW :Ñ = '\n'.join(L!!ifË –7if 1 òregex = r'Current ‹ð 0x[0-9a-f]+ \(most rec!qÉ first\):\n'yNf_StackQ;‘expected_Ñback(14, 32, #×_passertRâ6à, regex) § else: õ self.assertEqual(trace, '')(ßif unregister?#NoB¶exitcode, 0Dz 8}”def test_}(¯)ƒf.check#*) <»>.\=TrueM‰\_filePáwith temporary# name() as 1½†Á*= …P@unitñ.skipIf(sys.platform == "win32",^ ò!"subprocess doesn't support pass_fds on Windows"¼ ƒ?_fdø±$.TF#R'wb+'pûPd=fp.GCno()øƒ|threadsˆMCall_/Ñ _chainR)Lñ@contextmanager~´˜­stderr_non00 = É =·;try/2ys.$u = None+/{ÌñRaises(RuntimeError…*cmV<YyieldNIöstr(cm.exception), "µ1 is’3Tofinallà Ì ¬_ß ‹ð# Issue #21497: provide a helpful eæ7 ifOšò# instead of just an attributeD0: "‚w has no™%".-wí§òaulthandler.enable(cI%Qdump_³GbackQ if¿Ù'(fz:, '3{_later'­�¾b.`V(1e-3î�"`"‘8Tó(signal.SIGUSR1^ VôUnless(MS_WINDOWS, 'specific toæ‘ _ro_ ¼�for exc, U in (B?ð ('EXCEPTION_ACCESS_VIOLAa', 'acµPviola~&')Ð @ð INT_DIVIDE_BY_ZERO', 'int d÷ivide by zero'), ø('EXCEPTION_STACK_OVERFLOW', 'stack overflow<)):Gùself.check_windows_exception(f""".€ýimport faulthandler$Ÿ.enable()& h_raise}a~._{exc}C:"""¢3aname) ‚ð@unittest.skipUnless(MS_WINDOWS=Âpecific to W'{@def ;h_ignor®H[ñfor exc_code in ({�ð0xE06D7363, # MSC.v‚ ("Emsc"r/3b4343523€COM Call[Š RuntimeD7CCRDœO˜/= á å(é * íß-ä> ‰Àpdedent( /Àoutput, exit0 = ¢R.get_5"ÂassertEqual(*J, []^ )gqõm9‡nonfatal#ˆÙg# Thesõs are not strictly errors. Letting—#Ñð display the tracebP@whenyX;¡°d is likely9`resultüñnoise. However,A=ðmay still terminate#° process if re_'no9}° installed v³them (which8—typically<�is, e.g.3õdebug messages).(P0excÅ Á0 k¬0x3456789040=100070"7F`*´“úöòî & ê 0xì/:xé åu ê žD# On¸p older ©a 7 SP1w actual0$5hasûKö# bit 29 cleared}..4In(o˜$ A(exc"` & ~0x÷æ),Àtest.skipUnlò.ess(MS_WINDOWS, 'specific to Windows') def test_disable_wñ_exc_handler(self):04õcode = dedent("""Ãimport faultA 0.enu(Œ> "˜ #ƒ *ð_EXCEPTION_ACCESS_VIOLA�`_raiseîpeption(Z�6""" Àoutput, exit'0 = R.get_ >ÂassertEqual(&F, []V %_a, 0xC0ò5) if __name__ == "__main__"š@unitÊ.3() ˆa fromñ 0sup°5 AVá# used by regrD£6T.run_b( .'‚.suite()é0âeap_children()uPload_4Cs(*_hxVÄtreturn  j"c4.« ñ(verbose, refcount«(, û,�óstrip_python_stderr, cÿonly, start_threadsL €temp_dir�þquires_type_collecting)Êä.script_helperØ—˜’ok, make_, >4sys Dtime $gc tweakrefÄ‚ing tryCs5Dcapi€ñwith_tp_del except I:RError:’(C(clsgçclass C(object;p__new__7Ð, *args, **kw /3 Q TypeƒB('red ½.ŽA:–‚C ### SR ##8ñ # Bug 1055820 has severalÖðs of longstanding bugs involv°ðs and # cyclic gc.ZPAn in: ceHCfaìô-loop, so becomesBðtrash when # unreachÛ#. §L ®¦ainit__f7, išUi = i`…} `ºGC_Detectorc§# Create aݰI. Then gcCðn't happened againâG1 as{P# I.g%¡is false.  È Å<0= F;:?>4it_‚‡(ignoredD&ú HDTrueGÀ # Create aó( piece of cyclic trash that triggers it_happened when À# gc collect'.øself.wr = weakref.ref(C1055820(666),Xó ) @with_tp_del class Un]Ñable(object):eñ"""Create a referenceÅ e I° multiple _QÁ__ methods. @2An P? inCöll never have zeroh!s,Dôand so must be garbageóed. If one or moresst1theExee ªP, thebö refuses to guess an order‡@leav"hu;aed."""kÐdef __init__(¢ã, partner=NoneZÜ$if@ is v=.<+ =¨=%)y3OelseE 71ª ¬žðpass ### Tests #8 ~!GC_ (unittest.4Cas)¥Q_listP¤al = []Íþ!l.A6d(l3gc.ß(Udel l7CØ.assertEqual(4B, 1)ÍŠ=dicŠed = {}S…d[1] = dS‡#‡\tuple@# si¤°s are immutÜ‘ we closeóBloopÅ a \– Uvt = (l,=ftßtWít2t« í* Añ¸uA.a = A…¨#‡/No0��newstyle�¥ Yœ ­�C}instanc*­= ;6aMaM#Mó@requires_type_´1ingo|?newÑ iÙQÀ 0) ÷class B(list): Epass(oC(B, A( ua = C()8 a.a§gc.collect%Fdel #øself.assertNotEqual(76, 0`;EB, Ca>AžA‹AM#zµXðdef test_method(7R # Tricky: ò.__init__ is a bound 9ñ, it references the instance.j̸AÚƒY €5~|* =Š[Ù;¤% Û<Ñ@cpython_onlyµ8ülegacy_finalizerÂP# A()0#unkpable if1ðis part of a cycle, make sure!�shows upt ç# in gc.garbag[Å@with_tp_del.p*#__° `B¨ " o Z0id_#Fid(aWb = Bß b.b¯´Â1�zfor objA ã– d(obj) == Ä ‚‚Fobj.HUbreakÍJelse>®õfail("didn't find”Ò% (K&)";óaremove¦ nžA_new÷@¼§qÓ,ecùj_Ù¯ @·ÿ‡Ùðtest_function(sself): ð# Tricky: f -> d÷ f, code should call d.clear() after the exec toLQbreakecycle.ed = {}:õ("def f(): pass\n", d)#¶gc.collect(Udel d#øself.assertEqual(4Q, 2) +á@refcount_testz p_frame(I˜+( *± = sys._get›|9f!e®1®}›|saveall�à# Verify that gàic garbage lik0sts½´w up in gc.! ifž ò # SAVEALL option is enabled.=ÿð # First make sure we don't ¥ð away other stufcûat just happens&ãe waiting for ç6ion0N!# ¿õis fails, someone else created immortal trashëC, []~ïeL = []9!L.Ä6d(Lˆ0id_&i*qdebug =p1et_Egc.s |,cDEBUG_‰dìL\RÇ ñ0len"õF), 1m3obj¹JG.pop» L�id(obj), uº/de¶ø __del__ methods can trigge,e0thi4?£thresholds­5et_¯2gc.Æ ~/qóvclass Aж …2dir£Wa = AwÆaK`gc.disa$Ç›* s\A_new±{µ## ¯eŠ97ectpJ$ef¾ ×mVÀ# The follow¥@two “Ps are Bgilew+Áy precisely idð number of alloca`!s,)p# whichnñhighly implement'¢-dependent�# For exa&ò, disposed tuple–ðnot freed, but reusÄ8ð# To minimize vð:ariations, though, we first store the get_count() results # and check(@m atQ end.!A@ref9Q_test@def _Uaself):VÅgc.collect()Öa, b, c = gc.;!ex = []0d, e, f0uà.assertEqual((`–), (0, 0)Y)Y)ð# This is less fragilA2an iÀing that a et2s 0(÷h–Less(a, 5†‘# BetweenaÈtwo calls tož,‚òleast one object wa¯f°# created (Ú_list)„G'�r(d, a) XÎ ²b_generS(ÒØ 5ªñill "trickle" inßRÁ N + 1 after‘ÑAeach ˆ&(N; _0%0# xºÅnow in gen 1c|S1S 2SŸS2S 3Sg, h, iò£# We don't³Àa, d, g sinc¨õ eir exact values depends onf#•ñernal implementï± details of£¿interpreter` u1u1ž žºuŒtrashcanœ¦class Ouchˆ^Qn = 0CK|__del__EG.: +L !ifnÊ.n % 17 == 0z% ‡#&Ë"¸@a ha…€o preven¾õ overflow when deallocatingÕð# very deeply nesðtuples etc. It worksÂpart by abusÏeJqtype poü� fields,Pcan yˆ horriblH‚problems·qgc trieíqtravers¯¶ structuresc0# I�!isf! f”¡(as it doeÅ�2.0, 2.1ŽP2.2),GwillÌòmost likely die via segfault.ŠÑNote: In 2.3üðpossibility for compil/ wig»t cyclic gc�`removet"nd+€in turn º!ws_Å  mechanismú£¿¯amuch s¨ðr means (e.g., it neveró abuses the type pointer or ÷4# refcount fields anymore). Since it's much less likely to cause aLÁproblem now,w÷$various constants in this expensive (we force a lotOñof full collections) test are cut back fromnÅ2.2 version.Gµgc.enable()uN = 150Bfor Åin range(2):,it = []6iÑ2N26št, Ouch()?uR"6uRov = {}¤6ƒ1: v, 2:ªEcgc.dis@[1def…÷_trashcan_threads(selfô# Issue #13992: 0ò mechanism should be DQ-safef>¶NESTING = 6¬åN_THREADS = 2 ,–Çsleeper_gen(ˆKô """A generator that relea!õGIL when closed or dealloc'ed."""jO:tryyA 'ofinall+Qtime.¯@(0.0&1)ÌËclass C(listȰ# Appendingƒ a $ò is atomic, which avoidúause of\&ck±^inits†?del@f __3!__ê0, a} ¡XR[:] ="  C.G1s.aËV(Noneœ!ÍS__delkd0# TG&Ðcalled by subð_Á*()÷b C.æ‚$¤# `g` will+f*ƒgarbage-ŸAed. • ðì# helps assertŸÂ's behaviourƒ sH`switchtÕQmiddlÞ.itãAg = c Pjnext(g{ù2Now$`œfinished,Á#}proceede#¨œ«”©Flso ¦R".¿make_nestedâPCreatGÒsufficiently /ƒ@tainÿ‚bject soã&thrþ§i¸Rvoked¡Y at‡-itŠx = C([][ 0ÞÜ?k[C([x]3Zdel x3run€À "÷""Exercise make_nested() in a loop.""" ùwhile not exit:' H ú old_switchinterval = sys.get%()5 s F1e-5$:try…—U = []G—~threadsPfor iðúrange(N_THREADS)VD2 = HQing.TRÂ(target=run_›4ªs.append(t"£with startA#s(1‘, lambda:k?/1)›Öime.sleep(1.0akfinall"W¢G¨gc.collectžòelf.assertEqual(len(C.inits), bdels))÷def test_boom(selfʪclass Boomy5±__getattr__7`, someWibuteFo@del a.%  raòAAttr@RError£1a =ˆëba[E = b_baM:Ágarbagelen =(3gc.tÃ'a,_°# a<->b are°±a trash cyc‘Rw. C¥õion will invoke¡#Ø.Oð (to see whether a and b have __del__ methodÕ7andNI deletes thž€ternal " " j÷s as a side effect.O“That causGà÷to get reclaimed via refcounts falling toPÑ0, thus mutat#he5]graph�÷ of merely askingM!ñexists. This used to (before 2.3b1) c¢hPythonêHNow =@isn'ûFlled(ÁaM6, 4, *}U#, _?len�2WHŽ2�äŒ5=ŽVx = 0Ë#NE+= 1�N"ifæZx > 1©GC… A 2  a—Much likeS°), except tKb1doedàbreak the ð8 # cycle until the second time gc checks for __del__. As of 2.3b1, G#?¨re isn't aIð , so this simply cleans up4b trash‰ . Kö# We expect a, b, a.__dict__ and b÷(4 objects) to getG’reclaimed‚6wayeõself.assertEqual(gc.collect(), 4)H *0len.£garbage), Qlen) 7ðdef test_boom_new(E!):ãÒBoom2rü°actly like )$Ç, except useNÀnew-style clÕ"s.‰l BŠBNew(/Œ$±±__getattr__¯» me[ibute26 l Ù.%Ž¡raise Attr@VError–6a =”mbacE = bgbaUÄ)ž; = ¼%1dellØ Qørcµ/2_¶ Cinit³A‚ÈVx = 0'ò#NE+= 1*N"if Vx > 1ëfC1(2 3ÅÜget_referents7õalist = [1, 3, 5]¦ go:gc.@1M–got.sort(° Cot, 8_‘atuple = (ø}-k~'a = {1:÷E: 7}›J'ed?, 7Tœ o ÿ¥ð2], {3: 4}, (0, )v [9@] + §(range(5))…Àself.assertEð8qual(gc.get_referents(1, 'a', 4j), []) def test_is_tracked(self): ó# Atomic built-in types are not 7ñ , user-defined objects andiJñmutable containerG."SNOTE:bñwith special optimizations (e.g. tuple) haveÆsI¨�heir ownæ files insteadtðself.assertFalse;eNone))Y. 1+/.0- + 5.0j4?Truºü]Ob"a".-¢bytearray(e}˜”?int-Ï03())hÿ°class UserC bBpass“+@Int(ª. r# Base 5#is|ö; no extra fieldsó*ŠZSlotsa0__sg__ = (Ä kÿfixed size larger than‚QFloat‚ (f )‰#Avari[Œû#Inw_þý] */gc +{2T$‘ f@†.2 /[]‘?set‹K Œ÷ë“:%:æ8Ædó¾bug1055820bôò Corresponds to temp2b.py XÆ bug report.·‘ouch = []iomûcallback(ignoredâ50[:]8°wr() for wrhFWRs]] Cs#C³"(i*i)àrange(2)] ð" WRs = [weakref.ref(c, callback) for c in Cs] 1•c = None Ågc.collect()öself.assertEqual(len(ouch), 0'ó# Make the two instances trash, and ]õ again. The bug was thatt#HÀõ materialized a strong reference to ans‡, but gcNqclearedVšõ's dict anyway..CK%’2) # elsÈq…dn't runo›x›S:xA# If³Añ resurrected one o �se guys,,ß Jðwould be damaged, with7€empty __ &__‚ ü!x,3)4ðdef test_bug21435(1)Æñ# This is a poor.ð - its only virtue!  it happen¬oÃò# segfault on Tim's Windows box beforlQpatchð‘[Gqapplied{0at'—Qnasty†prelyingcÀspecific pieĈof cycliTØ ® ar7¡in exactlyˆ°right orderÞ1finÀÇ_garbage()'s™¦input list�P# ButLðre's no reliable way toæý$hah÷from Python code,bòso over time chœpare goo"is�!wo¢Peally0àßGmuchO of9 thðanymore. Still, ifÊ bl !up˜Äg_some_F¦problem ;-I n,vclass A[ŸBpassŠ#B#£�__init__ž7, x¡8¸f.x = xP?3del>;MattrO=‹do_work(9Wa = Ael“b = B(A()^#a.^bba³n*N W4is ™ð (bad C pointer) whenºCfailY1@cpP_¯VÖÊÁ_at_shutdownbëöimport subprocesóŸª = """if 1´6Âð_|Acapi�@.Øy_tp_del#Xk<Ñ #GnameÇ&* 0 =  d%OOrepr4(õreturn "" %% ]V×à__(self):  hpass êx = X('first').xy1ksecond2Jdel 0ögc.set_debug(%sa5"""Yõdef run_command(code):¯ðp = subprocess.Popen([sys.executable, "-Wd"@c", F)],FJxstdout=M?IPE(1õ*# With DEBUG_UNCOLLECTABLE, the garbage list gets printed] ?gc.[+Zõ&UTrue(ÌkG(b"[4 , óc>]" inôO) or:-;_ :¹ ˆð SAVEALL, no additional messŒ`shouldŽ �ä# (because gc.½ðalso contains normally reclaim@u cyclicÏø# references, and its elements{°õruntime anyway).GïÇ-è€ó@requires_type_k1ingxôtest_gc_main_module_at_Q('Œ¦# Create a8‘e through2_P"_ R=Qcheckxb3# iL• edFW„rpreter „Kðª = """if 1"zclass Cjæ|__del__ÎÓ#('*l calleà•l = [C()]Ç>¦l.append(l„ã’rc, out, (Ílrok('-c'³D{ ÷Aout.¥Æ«–Ð@requires_typñ0e_collecting def test_gc_ordinary_module_at_shutdown(self):37ò# Same as above, but with a non-__main__ K.9$ temp_dir()B`script:'d;ª = """if 1"~class CÚ|__del__¾sprint('.™ called')Ž0žl = [C()]ž.append(l69"""0OcodeÖ ©import sys7�þsys.path.insert(0, %rrB gcÚ Ev""" % (w,BRmake_%" 'P#',Õ 6ðrc, out, err = as¡ð_python_ok('-c', ü 8Y..þEqual(out.strip(), b•ÐÝݬ_get_statsäf = gc.${ wAlen(4F), 3(¡for st in  kEöIsInstance(st, dictE»9elfè�set(st),Ð"#{"±Ted", @ions#unoable"}rrGreatera4st[Hed"], 08€: « <Ó# Check that Òõion counts are incremented correctly; ifè@isen 'd(ªV¨ÒddCleanup(gc.* ù`gc.disB(?oldF3gc.¯(E?new3Œ�enew[0]“[>oldF + 1›K1K G 2G G 2 Ùž• lfreeze�3gc.*ί¨¼+_kRgc.un ´KðEqual(gc.get_frð#eeze_count(), 0) class GCCallbackTests(unittest.ó Case): def setUp(selfñ# Save gc state and disable it.=(70.en“d = gc.is%()&3gc.=;Rdebug9Aget_$Egc.s0Qcá�s.appendÂO.cb1&2&ˆñothergarbage = [] ½ �tearDowna #fRestor&3Adel WUvisit6gc.¶aremoveU¶ &¶ l<×iÚ$lf�ð�#gclð# destroy any uncollectÛsÃ: for obj inF qøif isinstance(obj, UbX õobj.partner = None†`3gc.j9[:]Ñ�¾áprecleaá¤ñ" all fluff from the system. Invoke this functionZÃÐ# manually rabÒ than through# ) Ewmaximum@ksafetypV¦f Ú ,–3[:]nì@[:],î/ <^L`*еO1cb1Ö×, phase, infoà9\%(1,Qdict(1&))ƒ?cb2S2Sä"ifž¡ == "stop"ãshasattrm"7up"¾=0# C0 Â' + uc¬eâe% eÙI óT |7 hif not�u ˜¶*ucÓWe¢}n_CODvSÅÀ# Algorithmi>�y verify‡£contents oî‘…Ÿ€# becaus´� is longè’tortuous.d,CIW`numberUP s to each �Vbn‡Av[0]ÞvÞÞ8¾ n1(i%i%nú~1&2&2&À self.assertóEqual(n1, [1]*2) ³self.assert$Q2, [2$%ð# Count that we go õe right number of start and stop callbacks.Jñn = [v[1] for v in ‚fvisit]'1(i%i%±n if i == "e",2, 'op+k íR"×"Oheck‘info dictË6allí :§EV= v[2öÏðTrue("generation"58ê2Ÿcollected1#un3Gable5±“def test_$_‘(­)ئ.preclean(¦3gc.=(¦#1ß[)a], 2) ¿Ñ@cpython_onlyÑoarbageÎ`# Eachòthese cause four objects to be gXQ: Twoz®0# Un0ectmsYátheir instance[_0Ñ1VÏC1055820(666„ƒ!f Ù!¤6op"íÍ…continueâ’ Þ »2ed"ºCUà\*["´C], 8ñ8ò # We should now have the|LsP3gc.¨Á rFlen((J), 4CeI $N3IsIä:(e,Œ ½�Now, let Tqo handlÇ9s†0up=G ™a{ß=[:] }:‚0—zm :4} WsFÏ&onå \ $ð0) class GCTogglingTests(unitS.CCaseDš\setUp‹Qgc.enÿÀ) def tóearDown(self): Ñgc.disable() üdef test_bug1055820c6ñ.# Corresponds to temp2c.py in the bug report. This is prettyfÂ# elaborate.|cc0 = Cz7(0)/õ Move c0 into generation 2.%¤gc.collectÐT1T1Tõc1.keep_c0_alive = c0Mð del c0.loop # now only c1 5s‹6½2i2iñ2wr = weakref.ref(c2)V¦ callback!H—ouch = []Œf)‡(ignoredÈæ50[:]8vc2wr()]QU# TheAð gets associated with a wr on an objectÍg.c0Ï%0,`K•Ïc€cHNone–ðWhat we've set up: cJð1, and c2 are all trash†.#P%in#te®Qthing±1it ³?t|€c1 pointÇN0it.èƒ(inc0Ÿœ0in U-'sîwere's aOdglobalÿ2@c2 (¦q), but Œu has noNÞÆ]olso a X00 (ž)¡X™does have”w)° references‚@via ¬'()‹Þè!c0ÁNXVz, which]/wrI^|ˆG0 ab7Fdots6). | Io| Š0 below &Ïj€^->c1 2nI8<1| ¦"@<--v�" S So tÓìúnightmare: whe(k”Ped, wêeN£cÇ-T-free1£0c1 ÊŽn't evenÒ@B. CòÁ0@!seIal^70 i"Æï §ša–6³÷. gc clears c1ãG˜–!c1·?€side effq€of dropp#¨refcount oë c0BP0, so„gßÒaway (despiteOÐit's in an olóder generation) ÷8# and c0's wr callback triggers. That in turn materializes a referencePðto c2 via c2wr(), but÷ gets cleared anyway by gc. ?ðWe want to let gc happen "naturally",ðpreserve the distincÜLwbetweenù%s.•junk = []Ui = 0ódetector = GC_D(;¤while not +B.gc_®5ed:Ijji += 1ºf i > 10000-1ôself.fail("gc didn't Rafter93 itÓ&s"šAú assertEqual(len(ouch), 0+ .eð d([]) # this will eventuw6 gc±¨g1K2els¤]0wasÎuinvokedPfor xj¦ A# IfèDñresurrected c2,õ instance would be damaged,dö # with an empty __dict__& Ù‚x, None)üðdef test_bug1055820d(4)ºÐ# Corresponds³�temp2d.pyæ·¡bug reportiõis is very much like»#pcZ!us‹ð__del__ method ÷ead of a weakrefKH€to sneak’ÐV0ion;Çcyclic trash¦¡ ;“class D(C M.¡ %T0[:]W8]iwd0 = D(·¡# Move allú abGintoì& 2Ò³gc.collect(ÁXTc1 = ³&(1øc1.keep_d0_alive = dð l d0.loop # now only c1 5Qs d0 6Á(c2i2i 2wa¡�.ref(c2)V�!H ¶R�0# W«òwe've set up: d0, c1,çC2 ar6Ó¼.#w'in +! 2›eäQthingç"ité?t|€c1 pointîNiß(c1„i–" 0 �0in G-^Were'sN„a global×Z@c2 (7n�Uu has noOP# TherÇd otherU)#|6!d0]aC}rs E^|„GÐ2 2 6dot+À#. . . . . .` . .|.# #| ÿGeneration 0 below dots6€^->c1 ÿ 2 has a wr but no callbackV1| ¦"@<--vÈ" ø So this is the nightmare: when g÷gets collected, we seeNdthat cǽ÷-free weakref, and c1 doesn't even have aJ.B. Cp:ing�@ø see d0 at all. gc clear¤"c1v2PN!c1o÷ðside effect of dropp#‡refcount� onr€to 0, so ñgoes away (despite ÷it's in an olderEZ)�ð d0's __del__ triggers. TTøin turn materializeààa reference to‚±via c2wr(),L2c2 ¾þ`ed any®wby gc. —pWe wantG0letNðhappen "naturally",ppreservé�e distinc(LYbetweE%s.ódetector = GC_D%()!•junk = []Ui = 0¤while not KB.gc_®5ed:(ji += 1ºf i > 10000-1ðself.fail("gc did«\b after93 it&s"ºAú assertEqual(len(ouch), 0+é.e‚d([]) #”Awill tuw6 gc±¨g1KEelseX!watuinvokedPfor x¨¡ E# If?aresurrþA c2,3Pinstayáwould be damag eith angp# emptySVict__ Ïò x, None) def test_main()¦�enabled =Ç#isE`gc.dis!(3ð missing = (set(l1) ^Âq(l2)) - KÖ$if7‡Mñprint("l1=%r\nl2=‹=%r" % (Çö, file=sys.stderreQû”.fail("%rtH¶|.pop())9sHasattr:Pobj, =h:43A) or<‡Ê(. ?+if�: returnÌÄåZ33): 0B???"¢þú^True(?,bf3'exé6€%r, %r)'‚Û�/) 98key8?key70key!0obj0/ .!oin objbQ***",›?A1In(,=obj+‘EqualsOrI dûOa, b÷a]bóaÿñb .ó#inÉj and b óÉ­(�ÈRcheck‹¾Ò0Nam9Þ=ÅÑ?=()?�R.readHB_ex( €ð ) corresponds ó to the actual module object,÷. Any identifiers in ²ignore are £d. If noDÒ is provided,r©ppropriateLmƒõis loaded with __import__.''' 2or = set( 1) |"['Ç7'])0f‘UNone:KÐ1# IgK it. (''Ìðto work around an API !@ines!³)Ká=!(õName, globals(), {}, [xÈòdict = pyclbr.readC7_exMùðdef ismethod(oclass,èz, name)c,0.__)__ËiTñinstance(obj, Mb1def’€_nested(J!):gCmb =È # Set argués×ñ descriptor creation and _0_tr6all½ñm, p, f, t, i = ²@', '¾µ', {}, None~õsource = dedent("""\Î&f0¿Ãw1(a,b,cÚõ2(a=1, b=2, c=3): passW(‚return fR)d)%‹class c1@C™ "T )."G”?F1(®{"Method0œ˜''Pd/ CR25R!"CÒƒ within :Š8ÂR3(): �B 1+1q6"""8Âactual = mb./e0("ó*·F0# Ck&e }ñs, linked together,‡Çexpected dicA"f0w@Func³sA'f0'˜1£"f1(%$_f.·f0, 'f1', 2,2,1,V2', 3,cXP(UcU5)C©Ž¦C¦¬6+FT¬C¬FW8,C,€)C)1CÖ*ÓCÓ1/F3ÆC2, 'F3', 14�˜0= {y:þvC0':C0}0N€compare(ònt1, children1, ¼2;B"""R¸Áequality of –fpairs.lZCEachU,g )p defineÆ“ree. The)Fs ar¦F�assumed sA. CÂuing the¿“ùionaries as such¾Adoes°work due toÀparison by i ÖtZdoubl‹ ag±¡We separat«D`ng str˜>únumber attributeDfrom| É1of ëÛí*""åj€.assertE•(j†1.keys()ã29QO obi:ovalues:obIs(ob.5=ì\)2.\À ò self.assertIs(ob.parent, G2) ù for key in children1.keys():)4†o1, o2 =+e[key],2 8ñt1 = type(o1), o1.name 2fil Cmodu nlinenoFzF2F2F#2.F%2.F/2.F»Equal(t1, tí%if³Î is mb.Class- V o1.methods3 |9Ð# Skip superc`0es ” now as not¸Ít of example0comÛ(ž$1.Çx%) ;3âNone, actual, ƒexpected/ðdef test_others(êBcm =sacheckMÆiò# These were once about the 10 longest ·s óm('random', ignore=('RÂ)) # from _&‚ import "9ÙCoreGeneratorX8cgiUPlog',RŽ set with =˜ ?hpickleBppartialF*ð # TODO(briancurtin): openfpM deprecated¬wof 3.7.=²Update this6öit has been removed0ˆcm('aifc•lP', '_€_params'é/# å0sre2sè@dumpQ`groups !poRŒ5”constants’µ*; propertyà°Fpdb'9ydoÃPinputg1out D)) #N9iesf2est9³ús inside package[Pemail;ser†ë.`_pyclb¸¼issue_14798 #)! IŒPErrorì±raised when÷FfirsÕPa dot& i¨#üaÁ…£€ßRZ's(p", ¶R.read ð _ex, 'asyncore.foo') if __tò__ == "__main__"àAunit€() """ Tªascript£ÄpUnicodeîðlementation. WrAòn by Marc-Andre Lemburg (mal@l ð.com). (c) Copyright CNRI, All Rps Reser÷à NO WARRANTY. š þt_string™$cs…itertool•>dstruct/%sy) ‘warnings ‚&ÿ0sup‡", ‰_Rs # ðhandling (bad de¡ r return) b°search_funcH“(encodingq#7!1(ð, errors="strict"):# ñreturn 42 # not a tuple ñdef encode1(input, errors="strict"):)LI2I�(42, 42)˜@ uniˆn— deN1iä³ing=="test.m-1"Þ(", �r1, None)ž/elR2R2R2LR-seŠw ñcs.register(search_function) ,�uplicate_¶sng(textº1"""¶�Try to geðfresh clone of the specified =Žðnew object with a reference count=21. añ his is a best-effort: latin1 single letters andvQempty?º“ ('') are12ton-0can½"be¶!d.5Ý›º.Á2().Áñ() class StrSub C(str Dpass"U„@Test"@ing_/€s.Common,x±!ƒMixinStrB¯UserString4 *@unit|.bCase):gPtype2b = strócheckequalnofix(self, result,Çó, methodname, *argsÒ =%Rattr(ü5°-Breal]# =V(Q"°elf.assertE˜(4™P¯-PTrue(è1)[Ò"))ú‹2# iÄ€original,õed make sure that�0# t±âdoesn't happençs&%es.6if ½_'„[P usub>Y§�__repr__ $(¼! 'K`%r)' %ì.<�3�" =]"Þ1ñâ'¹æ 1ê­Uâvâ5ðœ_literals: �ö'\xff', '\u00ff'+3uff-0U00/1àRaises(SyntaxE&`, evalh@'\\UHofffe\'q@f@%ð%08x\'' % 0x110c000) õ# raw strings should not have unicode escapes6ñself.assertNotEqual(r"\u0020", " ") -ðdef test_ascii(8!):€!ifk÷sys.platform.startswith('java'04ö # Test basic sanity of repr(×*m¥¢„‘'abc'), " "4%\\6 \\ :o9'8c¦5c6l54n4n3r3r3t3t3b3?x085P"'\""8¯""'\\'"'""q9(p ''l?'''P"Ú ""5 ¡`latin1ÑE = (-ÓØ€x00\\x01234567p8\\t\\n b^c\\r"TePf\\x1]1]1]1]1]1]1]1] 18-9aT1t 1c"dcÿ 1f !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIYðJKLMNOPQRSTUVWXYZ[ïÿ]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7fP@\\x8ó8ó8ó8ó8ó8ó8ó8ó8ó8ó 8a7à8à/8dYó8V9c9c9c9c9c9c9c9c9c9c9c/9bY9v9V9c9cacacacacacacacacac/a9YavaÙacacacacbcbcbcbcbcbcbc/b7YbvbÙbcbcbcbcbcbccccccccccc/c5YcvcÙccccccccccccccccdcdcdc/d3YdvdÙdcdcdcdcdcdcdcdcdcdcec/e1YeveÙecececececececececececeÈfvfÙfcfcðf4\\xf5\\xf6\\xf`7\\xf89abcKd" "eIf'")útestrepr = ascii(''.join(map(chr, range(256)))<ôself.assertEqual(M€, latin1Y 3b# Testkù! works on wide unicode escapes without overflow.¸ |¾ð "\U00010000" * 39 + "\uffffi4096),I + œ(I)) Jùclass WrongRepr:g`def __0__(Á)$(àreturn b'byte-0'L;xòRaises(TypeError,¿,‡#()§~¡� ð if not sys.platform.starts‡{('java'¯Ìðbasic sanity of °(ö±)$‘'abc'), " ˜3%\\5 \\ 9m8 pa£4c5j43n3n2r2r2t2t2b2?x084P"'\""2¯""'\\'"'""¡8'n ''j?'''x"Ö ""4 ž¹I = (w›Õ€x00\\x0123456¤€08\\t\\n _0c\\rž0ž`0f\\x1]1]1]1]1]1]1]1]11/1aT1t1 1dYcÿ 1f !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIYðJKLMNOPQRSTUVWXYZ[çÿ]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7fP@\\x8ó8ó8ó8ó8ó8ó8ó8ó8ó8ó8ô8à8à8ô8ó8V9c9c9c9c9c9c9c9c9c9c9c/9b²9v9V9c9cÿa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9P xaa\xab\xaWðad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5»\xb6\xb7" ÿ*"\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5Kÿ'c6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3Kÿ'd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1Kÿ'e2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xefKÿ'f0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfdK‰e\xff'")”°testrepr = ú(''.join(map(chr, range(256)));ôself.assertEqual(L€, latin1Q 3a# Testjù! works on wide unicode escapes without overflow.¶ {kð ("\U00010000" * 39 + "\uffffi4096),H � šH)) Iùclass WrongRepr:f`def __§0__(¿)$(àreturn b'byte-0'L;uðRaises(TypeErro¬Fepr,†#()¦}�¬_iteratorsƒ¦# Make sur‹ñobjects have an _?•__ method—@it =hô1111\u2222\u3333".2(À5”next(it),C¡- j-‘‡GQStopIPion, —L, itB\count>pstring_c€s.Commonè._23õ # check mixed argument types%þ(e_ñnofix(3, 'aaa', 'Z +a'Ú 606b6 -3,k/ 'l ¡/ 'l0l616/-1 Ü_, -10; 2u0>= è²={ # >"Okind (1U�\u0102' +£1 * "?U:?304C%À'\U00100304'õ + '\u0102' * 10, 'count',3) ðself.checkequal(.a88¯U00100304't ±AäB^+ 'a_Â/a_‚AkCE2•� Ša:ÍÃ&a\àv b= GHàdef test_find(R!):dpstring_ Ðs.CommonTest.10#Kõ implementation details of the memchr fast path>}Ï'100×Ý0, '®S-1, '‹D?201•D?120D.2D -Õ6L2 L)20L!# ° mixed argu:o typesPnofixïà 'abcdefghiabcý@?9, @ ?, 1C ùƒšdef', 4) ÇðassertRaises(TypeError, 'hello'. w3F, 427ŠUOkindL(V[8(aNÚ@>D;™“ í 9–GCRÎK9 Ý= c´BÀeckequal(100ð, '\u0102' * 100 + 'a_', 'findca_') ðself.checkequal(100BŸU00100304F>� ‘–c-1, 'aŒË;Ð:ãx dO}\HW def test_rr(b!):tpstring_!Ðs.CommonTest.21#Mõ! implementation details of the memrchr fast path?áß!UA , '°"ÚV &aF?201F0?120F02F ËÕ #6 *M ?204ßM)20M!# Û° mixed arguBo types"ð nofix(9, 'abcdefghiabc"B?12,B ó?€' '?!äOkindÛ(æ a'�½$âaZ<?‘C|7+ '>`e(h(Ý:1Ùx ž·CŠ_LŽ H_Œ AqŽEÉ� _) § �Ï ËÝ?Àl(-1, '\u010ñ22' * 100, 'rfind', '\U00100304\u0102') def test_index(self):pstring_!Ðs.CommonTest.21ðelf.checkequalnofix(‰Àabcdefghiabc�o', '')> O3, '>?defA  �‚ 9‚ A;, 1DüassertRaises(ValueErrorJ.l, 'hibÈC'B%'‰"Dghi', 8Í D-#cÏ mixed kindsó(·¤ÇX + 'a4,'a+rAï E6›1, '»˜53('a•)½'C1óŠxi�LjOBf_/a_­$G3á L'±aE Ü´õa•Hyq³ˆ Reár“â3Mã,12Ú}råÁ $@ç9M )C¨ òÍ©† CP, 0, Ý ù ¼.‘«òBñÀ self.asðsertRaises(ValueError, 'defghiabc'.rindex, '£, 0, -1) self.asI2abcLIAghi'I8H4‘ú# test mixed kinds¬ðcheckequal(0, 'a' + '\u0102' * 10õ' ¤@ŸU00100304D!~‰I ) ’~(ÞÓ)ÇëD+¦H½d‘M k_¬ ;_a'�BrŽ6, 'òFʰ_* –±! ÛEóI¿%³"!) e1def~±_maketrans_Plate(*!):(<ö # these work with plain 1 6̱nofix('bbbc£2babœ'=%',im @{ord�): None}l ?iiil5!, |Bb'): ?i')€xì4€c”?'x'� A'w1xyy!xzîzÞ yyh‡•is needs ·( rt ‘�'b': '�ž`tbl = (`.type2É.”B{'a'¯/, @: '2µÀababc', 'traónslate', tbl) ö# test alternative way of calling maketrans(6ðtbl = self.type2D.)°'abc', 'xyz&d':4ðcheckequalnofix() zy+°abdcdcbddddx·¸qvariousÀ€s switch°÷from ASCII to latin1 or the opposite;Hðsame length, remove a letter,9Àreplace withÕonger string.IÙpassertEÚu("[a]".ÂI(str#àUX')),C“["[X]"<c¯{'a': 'X'}eNONonef Ê0XÌX30O\xe96%Ô _'axb'ž9@, 'b©?123u Ox123 sÄt%5") §3Bnon-g±(don't takefŸfast-path»-<{>¡ ['Œ "[K� {'!‡apak4ý6,µÖ]O[123Ú aps<\u20acº)W dõ invalid Unicode characters‰#_Õ = 0x10ffff+1"ñfor before in "¿œB\U00/%":/z@mappG=â±{H(: v}â<ótext = "[%s]" %{ _'ðRaises(ValueError, A2#, � e+Q4TypPÀself.type2teóst.maketrans) ñself.assertRaises(ValueError, xtype2te@ÿ, 'abc', 'defg'O ?TypN2JI/—2’.Ià?', P 1Ÿ{'xy': 2}›.R{(1,)JÇx�'hello'.ûOlateƒ0'abc:ùaxyz') �@def p_split(5!):epstring_!�s.CommonTM2L2#NÅ mixed kindsMðfor left, right in ('baŠa\u01010¤U00010301\ '0'˜jKU *= 9a[ |Rdelimvÿo2o2eSÑ.checkequal([z+Æ)],0 /1, 'i1', �Î6n3m] ¤u$?v} n( *ƒçA4* 2¬}2ér�ê3ïêÿ7ë]v"@ì oí8À leôft + delim * 2 + right, 'rsplit',ñ2) def test_partition(self):"pstring_%ñs.MixinStrUnicodeUserS PTest.$ IH#hÅ mixed kindsrñ .checkequal(('ABCDEFGH', '9), ¯…\u4200')Q’for left,‚ in ('ba,¡0101\u0100¤U00010301\ '0'ÿKU *= 9a[|‚vceo2 e2eS zÆB9'),‡8  7-›*:z.Fxd}€%Cú5þ2$ ƒ Z ‡r&ˆ- J5‰x| ‰g+ŠÇ‡,W˜,‡ß‹�‰$B ¯¨�üEƒ‹ 2$ �[ Ž?joi.Drçöclass MyWrapperm“�__init__‘, sval):  ! =ÓÀ def _ð_str__(self): return ƒ.sval õ# mixed arguments-ðcheckequalnofix('a b c d', '  join', ['abcOd'])K !bcH/G(G)G pw x y zF’ÿ string_tests.Sequence('wxyz'Tæ91Æýraises(TypeError1”ÿ2', MyWrapper('foo')O¿'3', bytes(K#1, 2, 3‡,@ãP@unitiñ .skipIf(sys.maxsize > 2**32,*uò'needs too much memory on a 64-bit platform'ü@def __&“_overflowÜXnX= int€¦**0.5) + 1)Àeq = ('A' * 6#,) #¢lf.assertRæOvê '.�b, seq)N¦}replace ‘±CommonTest.Ú 4P,ð# method call forwarded from str imple¸õ ation because of unicodeÙ Ü Øàone@two!three!¹Jone!¥"R@', 1£­1 5=. –, "r", 42A#æ‘Fkind�ñfor left, right in ('bta\u01010›¥\U00010301 E0'):«KY *= 9[ |RdelimvßoÛ'e2ei<ñ;ï;Â;3;?S¬(¸+R* 2 'Œaace', Ò , ‚F|Oepl ƒ!q:¯Àf.checkequalÿ(left + right,  2ð 'replace', delim * 2, )Nõself.checkequal€?epl‡"u>· ¸ñ@support.cpython_only�def test_åpace_id(Ö!):Bõpattern = 'abc'CtextF def@ .assertIs('.^(L#, 0), !) V�übytes_comparison“Uwith Ô€§_warnings(º¾ð.simplefilter('ignorèBkW= åÇEÞÿQ == b , False5!5?Tru4i’ytearray(s)t@ oi5# C…s,!'w(7Od' >(1' <'#d'ÍFif 0†Á# Move theseÉòs to a Unicode collation modul$1...Añ# Testing UTF-16 ;Æpoint order "s= >úNo surrogates, no fixup requiredn a\u0061ñv\u20ac'CŸ6Nonbg below_valuew ¦v ¨d800\udc02o} abpï } ñ zÖ»lecmp(s, s2¥i ¡0s <)!Lp/(sH2•%\uÓ1šCò� ±"sF9F+aF2bF2ë/d0Ò+F-F)À'\udb00\udd0K1' ýtest_lecmp(s, s2)"ÿs2 = '\ud800\ude0F+9F2aF2bF2?fff^*F-F-F 1Sîfixup('\ue000'V %uff61') Kñ# Surrogates on both sides, no ]• required6ðself.assertTrue~µbc02' <Æ„4d\udc56pAdef Ž€islower(G&):Vyuper().$Ñ.ð.checkequalnofix(False,pƒ1FFc', '] 9®/¯c2167'.,+()f-Û?217,ö# non-BMP, uppercaseÎ$vŸU00010401z 12PÈ~/29~ 0/4E0ü|  ËOF40DN£¯IF46F1_IxI $ã÷if not sys.platform.startswith('java'˜É¡}m}Xu|+|7u} -�‚¯ ÆO|1z¦0{ 0}{ ÇN| N]® 1} 1} N}1_}Utitle}À superó().test_istitle() óself.checkequalnofix(True, '\u1FFc', '8'8bGreek >ošcases ...K„ð# non-BMP, upper0b + low )­`assert£Ä('\U00010401 C29'.®+()¯:$27:/4E:ñ # apparently there are no K¬dd (Lt)Åõ chars in Unicode 6Á`for ch[¼ 29†zØFF40DuF46F']:LÁ†False(chþâ, '{!a} is not¯á'.format(ch)) LCdef `space(U)hVsuperA$ ZA@2000Ã!is8Ao\u200a8ý8_u20149É~ £sÀ 01pÀ)27 Üs» ï%·+()ï.ð _alnumð $ðÃ6FD7F6@7106104AKjOF107 À?pha$8KWalpha ÿN#Qµ 01«Hå0E`; 0ÙcݾÍ=.isN 1)6Fß@Ö_asciiÌ $ Ì{m"”0ac"š,- U—Iffff1 š}decimalœ”‡0, '#is:FˆÀfix(False, 'óa', 'isdecimal') ÿself.checkequalnofix(True, '05@Fals6\\u246;ÿ # CIRCLED DIGIT ONE„ O;xbcˆð # VULGAR FRACTIONO� QUARTERW ÛO\u06¥ÃARABIC-INDICªOZEROT«0123456789°> é? ­Aüraises(TypeError, 'a)e, 42) =ðfor ch in ['\U00010401¬)27ÈE4E',K=KFF40D=FF46FF1065yF107']:L†aassertE(ch.®ó(), '{!a} is not ÆÖ.'.format(ch)ÒçFD7F6€7106O04A0Ž/�‰Úðdef test_isdigit(ã)ö‰super().$Å.— a\Ï SF, '\K7ü6+8ãþmTYF´ D!a —D7*Uà VR ™•mP}numericRÊûÿ#is:0ˆ6Ù55Ó:Ô8Ö:¨U"? _éVþRèe"abc".ÍåÀ'\U00010401'è, '\U00010427'9n4E', =FF40D/yF46F']:0óself.assertFalse(ch.isnumeric(), '{!a} is not å.'.format(ch))P³for ch in [€F1065€FD7F6O1066½ F04A0/OF107½?Tru¼ Ð ¸¹ðdef test_isidentifier()*&iI"a".0 ,Z,_,/b0-c-‡/µZþ ð�”˜ð�”«ð�”¦ð�” ð�”¬ð�”¡ð�”¢G¡ÝT¦." .)-[-/©.„¶WŸprintableVy.T ÿ+abcdefg\\2/\n4ñ# some defined Unicode character Œ9o\u0374Y$unVN «O8Oÿsingle surrogat¤ V1d80Ú cÖî`9.is5 –5lE0020'5jC½sBrsqð('a\uD800b\uDFFF80FFF?800k 6a7'a' ÈÒ§s.islower(° )W*?upp*XtitleTìAìBì0FFFì$0800$@FFFAì7AìÃí ì )ëÀ foôr meth_name in ('islower', 'isupp §title'): <ö = getattr(str,P)+Rfor sc`\uD800bc\uDFFF <800 v�ðself.assertFalse(‹ñ(s), '%a.%s() is h' % (s™%) ›—; Palpha–risalnum Rdigit uspace',F’ ¢'isdecimal2numeric4 „identifivprintabzfã"'a«b¢!, 0FFFÞ(0800(1FFFgM;afZð-Ž‘def test_ã(T[pstring_!Ðs.CommonTest.2K ”òEqual('\U00010427'.d‘64F'}Á =1Gvz v$4F9j&4F±j9X’427x l0 B 6ï¬�Ç 'q Xu01302Ç\u0069\u0307jð# Special case 4õGREEK CAPITAL LETTER SIGMA U+03A3Fé[u03a3x73c3r5 45›;A A<* Ba/c2„ CaÁD/3aEDˆ"a3¸ C#c2ü 3B C<c[ É ÐY8fffe@€ :217&uœ«rMfold®@uhello'.1{ ‰ÀassertEqual(ó'hELlo'.casefold(), 'hello') ûself.assertEqual('ß3/ss0 ;ï¬�1/fi1 k\u03a34/c38 A$ 45 ?a b9F o\u00b5~Qbc') ðdef test_upper(#!):5pstring_!Ðs.CommonTest.21 cÂ\U0001044F'.d›/27 '&4F Gv« '/&27 j1±j9X’x l; Ø ²x/FI. f\u0130b# 'E ‰¥f5 z1/SS— K1fd2—!39 08n/00A …Y8fffeE« i\u21779@u216ºC¯capitalizeH 7UÏ� °07R. L€„ W/4Fy:104WoN0 27ÿ˜/),Þ9… Ëà@(4F@� h‘.d0 'Hì6š¸Qexp =Ç 0 0su|v?exp¬ ‹ï¬�nnish‚B 'FI= Äð 'A\u0345\u03c2') ñ def test_title(self):‡super().")òelf.assertEqual('\U0001044F'.P5), ?27'=Gv— `9j < ÆN'27N”1FZ”V$4FÅ%27”(XX‹x ?4F ˜;/4FR  †ï¬�NNISHwŸ 'Finnish8 øA\u03a3 \u1fa1xy@"c2?9xyIAAQ3a') 1ñ~swapcasô`tring_óÂs.CommonTest 5Q�7 5 O27'.@/4F   J¼À Q»½m P* 1$ÚG '27Ü3I¸ 9ï¬�^O 'FI1 k\u01304`\u0069W0u # Special ùõ for GREEK CAPITAL LETTER SIGMA U+03A3Nä·{?3c3³ 0345ž/a3>9¹D Ea[F2ŠÀf.assertEqua l('A\u0345ða3a'.swapcase(), 'a 99sc3A') üself.assertEquaHG2F a3q/45F c2/99F #E Fca?99 F?8 +ß4/SS0 k\u1fd24§y 08 Q00') ðdef test_center(‹!):�pstring_"Ðs.CommonTest. 32 Ì3x'.]õ2, '\U0010FFFF'),6l ('x)(Ÿ *^3^]h4h-}†P@unitTñ0.skipUnless(sys.maxsize == 2**31 - 1, "requires 32-bit system")(ñ@support.cpython_onlyí°ase_operati!|verflowþá# Issue #22643C¥’‘•2//12 + 16try?.  = "ü" * 9)ûexcept MemoryError8IqÑ('no enough m2³ (%.0f MiB pd)' % (e /ž620)d˜`uƒRaises(O�–, s.upperCkfinallß\del sL~ontainsPÌÓing Unicode c*u methodè`In('a'??bdbû#?bda#aGb#7NotmlHEÛg1,None¬þ(%O,'a') --) %RìŸ('x',1,'y}+Ò,2bcdÖ_cxxxx’b'd$# FbÊ™pL!À self.assóertIn('', 'abc') Ñself.assertNo$/\0& G#/\0K%_abc\0p%alI @asdf'º !â/sdrâ(?') öRaises(TypeError, "abc".__contains__‡õ# test mixed kindsTâfor fill in ('ëAu010aÕ\U00010300'):3–3J*= 9‚or delimNc\N2 N2NR åI,�Ê*.7In(+" +‚3 d6O * 2e/i¤1defiÀ_issue18183(©<'S0000 10†'.lower(´'�casefold*?uppQ�pitalizeSOtitl'@swap¨ Që§center(3, å -_ljust,r,¡šlformat–¥a“Equal(''.*G), 'ž*a+a, b-b. *{{/{/ *}}/}/ *{{�{� *}}/}/ a_a`�Àö# examples from the PEPeõimport datetime9 �ô"My name is {0}"¹˜'Fred'), !"gM [X]SPdict(=]%),˜Õ w'v} :-{{}xnmB#}"——5d =L.UÏ(2007, 8, 18 ‚The year_. ™d ;n�ð# classes we'll use Ófor testing …class C:ú def __init__(self, x=100)'+._x = xCVformaEOspecDpreturn  E™Dr™Q•”3!tr6.x)›"# �ôwith __str__, but no __õ ËEË?z Vs'E(' + _+ ')'Ê?repË4 oré ÖFÖ?†× Fבð that forwards to string,P some ±‹+'sëGë?Á"¥U is "É›„æ9ÓÊ(ifëz == 'd'àZHGq+vobject. “„L°I(datetime. ³â Œø@strf[($ßЂ_J(intx6-inJ * 2˜ M‚ö ‡ ¡~ãîMMÜ ä| = None¶N¶eN¶ ï_¹3òassertEqual(''.-u(), '')`*9abc-0 5{0}0'-", e?{0:6#õœJ{ 0 8À'), 'abc')  ñself.assertEqual('X{0}'.format('abc'), 'X  5. 7N{0}X7oabcX')7nY8oY9 &{1¦51, ©¨ X9sr â så &1}å;uè Ž0-15Œ?-15© (0}å7-15 ?-15# ËA ¶‚ {Ó±{- }É-}- +{{/{0 x1x2 7{0}40123—O{1239: Ï{Ó :}}{/}0 x1x2fõ# weird field names ¹ä"{0[foo-bar]}"ø#{'€':'baz'} ÌJ JJ ŽA ':3„O3') ͆'{foo._xƒ�foo=C(20)Á/20‰ 8{1}ü†D(10), D>1@ W0._x.}3C(DBx6[0]»[Ô€, 'def']ÀA1A JÂo'{0[1]…[†‡F Í1[D(J')]KÑ�# string°v'{0:.3s'& 9Û/ab pU¾ \¬0¬<u 3æ&2:Àc') ó#self.assertEqual('{0:2.2s}'.format('abc'), 'ab') 939 : 8x<0saresultv z ?x<5@,6@,7@ x8A B/ <ƒ „@->€ Ä> A^A�/^9„� B1ÈÅDX10000€ÿa' + ' ' * 9999Š DC=> … AU000) “õ# issue 12546: use \x00 as a fill character4A6<Š1foo{0fooO O\x01I 1!I/0^’‹–I EA foo3�3‚ ‡ ô/<6J"J,0^J� œJ �e'b.Ì1.144.14‰| ê € DD D„3ŒD J@ =s'12P+2.0j `(3+2j)ˆÀ0\x00\x00')  ð!self.assertEqual('{0:\x01<12}'.format(3+2.0j), ' j)!3') X Y/0^YD\x00eY U2 Le ') �"# Ù° specifiersõ user defined type2Ï6abc$0C()!:abcjÿ!r, !s and !a coercionsZ &!sXp'Hello'\ ; :<)/15>ÛL _!s:15Ã<IrŽ""n /!r >{#F(râ!F(ˆ)” !¼`\u0378Å3"'\ ÿ") # nonprintablm O4O[�4'") # L1F('�#4'ÝÞa/, \=p+ O\a5*Š5# AÀš›ò # test fallback to object.__ä%__-¬Ç {}d/{}Ø 1 []1/[]11213– &:dgrG('data  G( EÕ@ ? string is G©GðRaises(TypeError, 5^10”5, E•ÈBC#>X&, ÜÜÉÒð"{0:date: %Y-%m-%d}".ÿformat(I(year=2007, #month=8@&�day=27))Ap"date: §•-08-27") ¯ð # test deriving from a builtin type and overrid#"__%__Fòself.assertEqual("{0}".(À(J(10)), "20{6P# strR(µ specifiers# Yd'{0:}'Z`'a'), ÒŸcomputed X†"{0:.{1}¶ð'hello world', 5i/')ŸGsH2¯precision}P$=¢•{width}.{=a,U=10, .kö p H'10'r!'5ê�t‡ÅÏvarious erroDÐRaises(ValueE&D, '{N×2€2aeaf/{aË3UIndex00š 414¯/bc2m3KeymU '{x;o4"}{|3uabc{0:{·9/{0lO"{0.h!5?, 0 [m!5O, []n ®O"{0]n!&.[7ÝU..foos<[¤9ÀueError, "{0ó[0:foo}".format, 0) õself.assertRaises(KeyError, "{c]85 SValue7•"{{ {{{0}:r =8 ª ã_bar=3²70!x®98X æ?!rs:#!7ß UIndex‘:4! ihÿ%big = "23098475029384702983476098230754973209482573"ŸGp("{" + bc+ "}")â° @[A]Bu, [0]) ˆÅ# issue 6089<]h"{0[0]Wo[None]�@E(10)U$, C„õ%# can't have a replacement on the field name portion=Á4TypÇ£'{0[{1}]}'Vé, 'abcdefg', 4ÿexceed maximum recursion depthp 1x:{1:{2}:tP', 's'=LÒ:{3:{4:{5:{6}˜ ù0, 1, 2, 3, 4, 5, 6, 7ôrstring Tp spec e8sW_ ï-d?, 'ÞtŸ, "", "-"=r®³# AlternateÕtà is not sup>%ed0Þ £'·#Ú7920'sŸNon-ASCII…öEqual("{0:s}{1:èP("ABC*a\u04101E2"),Kþ A'ABC' 3Ë}+.3zCvd0dÀ"),  T'') ÿ"self.assertEqual("{[{}]}".format({"{}": 5}), "5"):a : "a"=a= v"; ±};[v[;!;!;õ Raises(ValueError, "{a{}bpO, 42d;:%×¥0x{:0{:d}X4p(0x0,16;0x0"_õ# Blocking fallbackjÏm = M('data'ó‘&!rypm), 'M(5)6)6Typc%!sB?, mm75_n = N¸n¸N¸ î¬(6· nŒ’def test_ÖP_map(û%):� #''.{Ä;:/'a1Û ?'ab3bÙ!O'a{{5{5 /}}5}5 /{{Ÿ{Ÿ /}}5}5 akal¢@# usJ…mappingsrclass MW(dictذÿP__mis@!__û[, key(,`return`j{helloT€)ë ^ Ÿa} {worldG3a='EP /¿úƒInternal‚ÔÐüCinitùôáW“ = {'a': }NsgetitemQJ ]U[key]Q}:'{a  Ú(\ÆCùÀ def __iûnit__(self, x=100): y._x = x¶def __formaEOspecDpreturn DXóassertEqual('{foo._x}'.Võ map({'foo': C(20)}), '20') Gõ# test various errorseÀRaises(TypeE%8, 'i)4a56EValuk{7O, {}p : :au'av'{"±};aö## issue #12579: can't supply positional params to FE l{÷'a' : 2® B?'a'êL{a} @@{"a"‚@, "b '1}üúclass BadMapping½¡ugetitemç?key¡?1/0+4Key:{!u ;/[]" ÏZeroDivision~#() þ¢‘huge_precJô+óstring = ".{}f"ˆö(sys.maxsize + 1¯_with T cWƒresult =›c(2.34, _}¿ _width»º�ƒonumberÀŸ{{}:.6f}}�Ntè�€Rauto_Á4> ua{}b{}c@0, 16�a0b1c') Oua{:{}}b;p'x', '^å@, 'aYx/ b‚ G:{}xHa20, '#žPa0x14?‡ñ# can't mix and match numberingUauto-;õ Raises(ValueError, '{}{1~ , ~ã<?1}{<&O:{1}=&0„ƒ¶ó. , 1Unamed5(9fß±(4, f='test¤ d E{}{fá ?4@! ˆ{:{f}}{g„°1, 3, g='g'Ž2³O 1g3I f-{K2A(2, Ð1NI$4gû@def ¢_7Pting(!&):0tz_&ñs.MixinStrUnicodeUserS PTest.$ JI # %Æ> u! sFEs...0ˆ âñ"%s, %s" % ("abc", Õpabc, abÔ•? @ý, %i, %f, %5.2fOg8, 3X!.0o, 3.0Ž ¬l/-2m/-2n@A-1, o*.5Þr5à3Yo, 3.57s7á Ss?100v$xðif not sys.plat¤÷.startswith('java' okQr, %r\b¥¬0"b'©E(bci JÀqual("%r" % ò("\u1234",), "' W'") ü self.assertEqual("%a" % =>:°(x)s, %(y)sDö{'x':"abc", 'y':"def"}, 'abc, def'ŒNO\xfcQTá U�'%c' % 0x$, ‡2P214833AU000 ¾ÿ Raises(OverflowError, "%c".__mod__, (0x110000,){&'\r€OType|7"aa"¹FValu:˜.1\u1032f¾_1.0/3ºE ~i<~¡ð# formatting jobs delegated from the strõimplementation:DÃÂà'...%(foo)s...ðS{'foo‹€`...abc Gß ,'•€:123}, H'- RQº%Éq(1,2,3,T!),¢Ÿ1...2...3Õ%Ú ^h5’q 7W¸·Y0%*s50(5,1'Æo' abcyý6-7_abc 7 .o2q? ab:3:«Di %*wh10, 5,A?10 ï;i%sF3I ¬�7?103L0'a'£ôÖclass WrapperyFÀdef __str__(‰)#ereturnl¸%ðh(àv%) 6Å# issue 3382ðNAN = float('nan')  ðINF = float('inf') ÿself.assertEqual('%f' % NAN, 'nan, F,?NAN, X_INF, „X,eINF') ±•# PEP 393Ã0.1s™ÿ"a\xe9\u20ac", 'a¡ /.26E ƒµissue 19995†õclass PseudoInt:fÐdef __init__(°Š, value)'+.q = int( ±$ONGvreturn N�3dex‘CìFV ÇŸî¡ð*1ô6Cpi =�±v(3.1415!…letter_m'vInt(109"W *xeo42, '2[ X*P15, 'ÍÄSo)o9, '11­ c) 10+m* ¦à_, '6d0 ¬0D0 ³0?1551 »1ÀðRaisesRegex(TypeError, '%x format: an#òeger is required, notïñ', operator.mod>0', þ%),ˆuXu*�X', 2.11uou*�o', 1.79u_êMe/piy Ó £Ac', >¢ORtest_öáting_with_enumN½!# �Q18780>hpimport 0ÄÀ(y, W.EnumP?API =3[15926B(YO.Int<ŒIDES = 1)Str(struµABC = 'abc'rP# Tesƒ Unicodeðstrings... selóf.assertEqual("%s, %s" % (Str.ABC, O), '$-%')-?seleõ , %d, %i, %u, %f, %5.2f" %; o ”“¯Int.IDES, b¥ Float.PI, øF, 15°3.141593, 5') yð# formatting jobs delegated from the strõimplementation:D Zó '...%(foo)s...' % {'foo':Ÿ}0<'<À*fig (hi*Î@h 158Êd*bJub„, 'def':xÔ8frb,q?123l ´¿H»–def test_¾ð_huge_precision(–)¥)_Ë¢= "%.{}f".ö(sys.maxsize + 1­Pwith L¡÷Raises(ValueErrord(ƒresult =Xqb% 2.34x½ issue28598'Ìsubclass_rhs¾D# A 0 of’ šõan __rmod__ method should be able to hook®a# intoØ¥% operator‚# S‹ŒedStr(ståÂw«l, othe'âturn 'Success,L=ô{!r}) was called'‘P˜‚# 'lhs %% %r` ±_'rhs'0 "ŽU•"vñ@support.cpython_only£� �_c_limitÛf_=pcapi imb� INT_MAX]G§'Š ¿/»W�6xQwidth %µ sÀys.maxsize +S 1) õwith self.assertRaises(ValueError):,3ñresult = format_string % 2.34 +pdef tes@artsbC_end T s(rZôfor meth in ('foo'.st=", D8’`Â3TypÁj as cmÇ9qf(['f']úexc = str(cm.exception$À2ßIn('str', exc& Ttuple(+Ð@support.run_Éð _locale('LC_ALL', 'de_DE bfr_FR'bd‡\floatVÃ# should not° eò a comma, but always"C €� è Equal('1.0�Ë%.1f' % 1.0)÷¾constructor’Áunicode(obj)&ó s (this maps to PyObject_U*Ã) at C levelkš´Ctr('l“ remains 9'),,(&wªBtextªPasciiA\xe9Qu20ac «U0010FFFF'±ósubclass = StrS(VÝÁ }”>?), 2Glen(26 ii±rxt == 'Ó.�¹1.enÒ:D), b AÎEiutf-8'EF >\ó�ðs are convertedWü1d¿SûjCompat0ž�__init__;, x²wUx = xe>3str=:breturnöx:!´0('_¿ __‘patible o}AÌrecognized')4;ÜA#Œ(isƒ!to}&):Ùo,2ingoÜ@ +JDo), üHT G1objF±123, 123.45 ð Õ¼Abj),')_ð, encoding, error)ó tests (this maps to ð# PyUnicode_FromEn õdObject() at C level) 5õif not sys.platform.startswith('java'):0lùself.assertRaises(#­TypeError,/st²'decoding uÂ2 is™župported'Jo'utf-8ystrict'|õÁZEqualÀ`str(b'C�ngs are �Ted toŸ4', ~ +Jct')¢B�™Ž,Í�Ñnÿmemoryview(b'character bufferû èMj  ’:MŠ kGà¡T� €C 42,71def]ð _constructor_keyword_args(U ó"""Pass various ,ð argument combination§W the ]E."""Àq# The oªBpan be pkdd as af.:–ŒþíI’='foo'), 3b,0, e<Cing=ÖF³eä*õ55out@` triggM"Eo" modeÀ †^==…1 #")H ,", ³Udefault\CheckÜÃ:î+fŸ'' or b'') /')Ú ð3`utf8_c°q= '¢'.ú$e(ø\ðâ·�³ qŠ'¢œsq¥/ctrùD_’ˆÕŽ='ascii'œdecs_utf7AutfT“5= [+Øð('A\u2262\u0391.', b'A+ImIDkQ.–&÷# RFC2152 exampleLÀ ('Hi Mom -ð\u263a-!', b'Hi Mom -+Jjo--!'), ð# RFC2152 example ñ('\u65E5\u672C\u8A9EN¤+ZeVnLIqe-I? L ñItem 3 is \u00a31.Lp+AKM-1.SL +;+ ²#+-?J?'),83r'\>AFw#'+-7r'\<?AXA# $/Bc&4++-¿?+--¢\U000abcdeÊ`2m/c3g)´ú# surrogate pairsò!'/C/ %] $õfor (x, y) in utfTests: hðself.assertEqual(x.encode('utf-7Ê&y)T@# UnŠ&ed›@s ar Åssed throughe aŽ'\uD801'hŸb'+2AE-')=x>x? C|3|?C01|>| Þ;.de`ø=/x'>|  >| =|"ñøûPHab9z�( k™ö"# Issue #2242: crash on some Windows/MSVC versionn Ô|b'+\xc1Q�, 'ignore7)''}rDirect ^§d characteÔñset_d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ8õfghijklmnopqrstuvwxyz0123456789'(),-./:?"HÂ# Optional d‡õ o = '!"#$%&*;<=>@[]^_`{|}'LVcQ¯N cëMvascii')z� 0öRB œoœŠZ÷�def test_¹€cs_utf8()c I'¤8bç2ð\u20ac'.encode('uó tf-8'), b'\xe2\x82\xac') øself.assertEqual('\U00010002'.encode('uH�f0\x90\x82L_23456L¯a3\x91\x96L \ud800Hõ, 'surrogatepassí@d\xa¡0U cUbU CM*10)G~…¨ `B1 ¯Dð '\u6b63\u78ba\u306b\u8a00 46q68\u7ff!33,f'E@3055 8c69 44 7e 5b9?�02\u4e00E@90e8' 6f c9aE c4–9K 675-4cE@3001! 42½"30Q9]8?8*/67E`«‘5b9f\u969à Që0cWenn ist dasEü Nunstuck git undˆ)),EÈPe6\xa‡ò3\xe7\xa2\xba\xe3\x81\xab\xe8\xa8L yH'8648LWbf\xb@bdXf0Hd5#8c Œd&84.beH¨0\x9€tD2\x9€„2\xe4\xbØ^9\x83HøLa´(C\x89€¬Œh 8HSa\x9e4Ì7 9L51\xð¤1HŒ$ ¤ dH9Ìp€ 1˜a¤H`¡\xe5\xae\xX@9\x9ð|Œ Í@Ìô áÒÁ%) õ# UTF-8 specific decoding tests( ˜@str(}Íá&, Lj ’KxKµK  Gyu20ac' ñOther possible ÿu cases:ª# * strict'/çfor all of the3 br8_ERRORQ� in PyUni| _DqReUTF8–1def}a_utf8_�ð e_valid_sequences(self):  ásequences = [ Ù# single byte¢(b'\x00', p), (b'a"a' @\x7f)),?1# 2TsUSc2\x8Y%80LRdf\xbPmu07ff'R3Ree0\xa0VFu080XWed\x9\d\˜ eeBÕ8uE0FB¢/ff¢4¢QF0\x9¢`bU00010d%Zf4\x8tU0eFFFF')0] ðfor seq, res in ô:#ôðself.assertEqual(seq.decode('utf-8‘ares) 9âdef test_utf8_*•_invalid_Y(X)kâ# continuation–a˜Ü of 2, 3, or 8=_›º `([x]) îxQörange(0x80, 0xC0)s# start}pof a 2-D„àequivalent to á points < 0x7F7ñ 2Bô_Y™C™2™ 4™`> 0x10 �4� F56'F8�ê ã(mŸ$+ 9#+>)¯0+ [¡så F7¯(10æ)§—?eÇž-±  Raises(UniD aError,<$,  r(sbpþ w¤c2E *¥(sb+cb)¨} ~¨1Û©J[:3]/­3337‰ A6  1+¼80'+cb3 �w \;A0)õº1zE«¶²îvÀror,  À(b'\xE0'+cb+ ôBF').decode, 'utf-8') <Å# surrogatesðfor cb in [bytes([x]) xõrange(0xA0, 0xC0)]:;Xðself.assertRaises(Uni€D†iError,26 ÆDÆ/80Æ <vA< '8'9'GFíO80\x+XzOBF\x/29/VH'F4V/[z/ðdef test_issue8271(à)i0# I #Ñ: during the ì ðof an invalid UTF-8 Ж sequence…a# only?Rstart(1andÁcontinuationñ(s) are now consideredº‹#uÁ, instead ofJ`number‰Üs specified b~.OòSee http://www.uOã.org/versions/dø5.2.0/ch03.pdf (page 95ëòtable 3-8, Row 2Û²more informéQabout¶æalgorithm used™õFFFD = '\ufffd'±`Us = [  gx"ùP80', ^@), #b  S1É5!*2729kckWEc0\x!W#1«@cD cg# with-;@a 2-?Èy2– Ü34\xc7‰G # 2z<23n!*3z374óA+'A'5¨ m«À # with starát byte of a 3- §sequence ò(b'\xe1', FFFD), # only the starH37!*2922s373737;4;4;-80Üá1 continuation)®4A+'A'qinvalidA%\x�E+fJãb followed by _b‘(\x•–%2 N Ùˆ*80IÞú1„ K“J'e1N *2é.K1andQTother¬O 41æ61> T7 Rg# with  4  fô  Ef1\x7 37 7;  ;?5ê5+5?Ê1K=ÕA2KAü³c!cb  å©3+'ADIú‘2?‘ïW8!Ë3 cvÜæÚIcM‘Oš5+Q âžZÁB ~Sñ!A'TPƒJÔÌMÓ ¬Ê$4b2ß/•c¡ºm©¯ (rfc2279)y5ÀD), # only t÷he start byte p(b'\xf5÷', FFFD*2), # 22s3*803ÿonly 1 continuationqF80\xB3uB2BF4F3AÂE\x41ÆA+'A'Bñ 1 valid cb and 1 in G DK+O/),4 41¹ƒ6 *2 <d# with‹ € of a 5-Þÿ sequence (rfc2279)�8ôîvt$ D8\xf7$8ßj3l>one£¦@[D4 + ¤£ˆL v5Ü! 5®sBj š… 6…c×……Dc\xf7R© cùn*k *CKO6¿6Ñ J#¸ YŠeW ûx%Ë Dp# other ƒEx€ð42\x43', '\ufffdk#\x‚=%ff'=CU? lc2\x81|9S61\xF|ÂE PC2\x6MP0\x63š\xBF\x64'w€ '\x61\u’ ?A EŒ]iðfor n, (seq, res) in enumerate|%):3qð self.assertRaises(UnicodeDe`Error,º!.dp, 'utf-sŠ'strict'ÊQPEqualz<(;preplaceج“BCo+b'b')I +%M >seqFPignorŽ <  Cres.º"('±§A')) 9Bdef LÀCorrectUTF8D8@ing(Ð, seq, res, ecrr): 5""" ð(Check that an invalid UTF-8 sequence raises a UnicodeDe¥Error whenNñ'strict' is used, returns res+— 'replace$2and‚udoesn'tO=“ anythingAVignor@./Øñwith self.assertRÃ(Áv) as cm%Qseq.då•('utf-8')fõexc = cm.exception qöIn(err, str(exc)A%nEqual(n,')Ds> (b'aaaa' +±» + b'bbbb') T²î M²#+ L0=Î.ÈÇ('\ufffd', '&åËä9S³ ß ä2“def test_ À_start_byte(ÕHBTestÅCan '< < <1' e/"isNdÍ‘the first%�¢ is not in !àASCII range or\"a ¬dõ of a 2-, 3-, orO 4-ƒs ÑU. TheíAžŸ!d B…a singleKbU+FFFD½Ò%s=ÒŠ�E.g. <80>­ a continua-é ó÷can appear only after a5QÛ�$= x›2for]üin b'\x80\xA0\x9F\xBF\xC0\xC1\xF5\xFF'ò+ÀCorrectUTF8DAing(@ ([5]),|,}¶ )<uÿunexpected_end_of_datay@@ end@}±%ngÇOends‰IZ R.‰out haviPNough3s. „…complete�3\…Ÿ� …CËà, F3lbDßx ò, but it's followed by¿2� ísî&thEOlastŽ0misåúQNote:Y mu:Re all~ð , if one of them is ð invalid another error will be raised. *5""" Õsequences = [&º'C2', 'DF',PE0 A0QE0 BF 21 81CC BD2D 9BEE0D 'EFF BAF0 9rF„3 œ!BNÀFÀF6 N!N3!3º0 'F8´!N4!14 8,FN!ê7] õFFFD = '\ufffd' for seq in:õ#self.assertCorrectUTF8Decoding(bytes.fromhex(seq),f DMñ 'unexpected end of data') �“def test_÷‘_cb_for_2�P_seq(ª)½òãTest that an 'Cà continuation H'E#is@‘ when the„¾ 4©@a 2-@sE4 is¡Á. The startfLgñeplaced by a single U+¯0and{` secon" teWuhandledF¢separately®Bs='r['@E.g.êt�À , C2^« Ýr@€, but 418bnot a ’$Àbecause it'sÔK÷ASCII letter 'A­¿¾Px2 = E * 2Xã`('C2 0H5¡+'\x00'), 7mJ7f')Ã$C<$x27F7„/O('DFn?DF n, E1Ä8the¡pof a 3-­sKs?,<®is a validžq, but 4Y6not)bLÁbecause it'sœöASCII letter 'A'“Note: wheÅG¡ E0 or ED,E�¡ranges forUfirsty KJñlimited to A0..BFóö80..9F respectively—²Python 2 us9Áconsider ally>|‘ N#BF4ϘÐwas ED. This�PfixedIt3†5"""C«©= '\ufffd'Qx2 = !5* 2ÒUs = [å‘('E0 00',5¡+'\x00'), '7F%7f80Nx2),O97JC2F&EA—>A0 šBw?A0 z /BF/BFz?BF z*BFz1k Ê1t< e1bJ8V(V'w8V /1 VzV= ÐCVCVC»CV C'CÜ' V Ü ÐCVzV= zVDVDV ¶, E1a3aKs?,<Bis a!©q, but 4Y6not)bLÁbecause it'süöASCII letter 'A'ÂUNote:¶Áis E0 or ED,E±€ ranges n×fVy ÆJñ limited to A0..BF¸`80..9F®ipectivY�However,š°D, Python 2#esidersf "in¶ s"BFYp. ThisŸPfixedÇR3à""" FFóFD = '\ufffd' �FFFDx2 = E * 2Õsequences = [7‘('F0 00',5¡+'\x00'), '7F%7f80Nx2),O87JC2F&E9—>90 šBw?90 z /BF/BFz?BF z/BFz O90 8÷ 8ú/80ƒa ?90 € C† /BF  †*�8   BF*† C  1�1Œ[1ú 1†2w:€B e= è8_=zBz z88n}*èHƒ C8n†H† &†* † %  † H† 3n 3z3z3nJz: nÀ\x7f'),  ô('F3 80 C0', FFFDx2), 'FF 3"DBF 08t+'\x00'=DBF 7=_7f'),Bz?BF z 80µ}€*ƒ†?80 *† /BF   *†  BFî’†/BF�C† 4�4Œä44 9¿÷ Ÿ44 BÃ2 4¬ 4�'w/80z ?4 8 'z  ²/80Ž]ú�a X”C * ㆠ b/80 �8H††¬† è† ¬Ã] ðfor seq, res in uuences:#_ñ"self.assertCorrectUTF8Decoding(bytes.fromhex(seq)Q `Hð'invalid continuation Z1') �ðdef test_codecs_idna(š)­ñ# Test whether trailing dot is preservedQŽ@Úð Equal("www.python.org.".enq ("p]"), b#¡nerrors£Eð handling (encosding) ð self.assertRaises(UnicodeError, 'Andr\202 x'.enŸ, 'ascii'F3�,'strictOoEqual(†(…à,'ignore'), b"®? x"šKgreplacL?M'& 'NovÚ e„&s=IØ$ $ŠñDing=m“u%) R!# 4ÿ handling (decoohstr, bn E/, nOstr(„,J mJ fuFFFD x  Q�,l6 '\I�ÿunknown character namescáb"\\N{foo}xx".ÝBe("u0²-escape", "`"), "xŒ…¢truncated ?Ÿ sequence‡¢–Ž,, � ë4Typèwb"helloIStest.Ý1R�G{L8, "E2E?o F‹F Œ—ïwrong argumentý rB42, †&÷lone surrogate in™3_Py�ÿ_TransformDecimalAndSpaceToASCII()3 DValuëÏint, "\ud800“ 5f5Ofloal 7ncomplexÜÀself.assertRð2aises(ValueError, complex, "\udf00") def test_codecs(self): ¡# Encoding."ð.assertEqual('hello'.e*Óe('ascii'), b)<_utf-7<(8<dS16-le|P\000elo 'C16-bT?h XTslatin-1¦´×¡# Default Èping is �8¿e\u2603üõÙ\xe2\x98\x83'bö$Roundtrip safety for BMP (just the first 1024 chars4,°c in range(#)©Öu = chr(c59Ô@n ('ÖA7', 8 &16 Î,øF =¤ , 'raw_uniF�_escape'@ /$ 'A›internal'á„ôwith warnings.catch_(04## Z-Zÿ has been deprecatedï[0.siAófilter("ignore", D?BionW•ò| 7Tstr(u5 &), ' uK/# =?256< ;256*;E,AçãW?128ã ;128¢ãÀáWFnon-\a fewÝõí å.\p'\U0001 Q20002 Q30003 Q40004 i50005's¨Ÿ¿‚à  û'raw_unicode_escape', % '/ ½internal'):Dð self.assertEqual(str(u.en{(Ving), E u) Gð# UTF-8 must be roundtrip safe for all Mw points;ñ (except surrogates, which ar<…bidden).4õu = ''.join(map(chr, list(range(0, 0xd800)) +6 )6Axe00;@1100=%))=ÃýÛ in ('utf-8',MI(�def test_'pcs_charÞSfu# 0-127š“s = bytesý?128¸ 8ò'cp037', 'cp1026 ;273gD'cp4(2500'$72 2775>850B4852'86K48612B$63B6´L11251‘iso8859_1]D4RD»' B A—'6‘r&9&`koi8_r— t u Az1047|latin_1?Àmac_cyrillic1+Q þ 12ªÿ#25{$12©1125ëQcp125è %‰!25ß8�Ccp85)8(#86[0869±vcp874',^ªÇPgreek#  iceland','Troman~turkish}1100~|  ú### These have undefined mappings;#2­Fsfail th-BJ875'îïý ž4s, ‘)©) sŸu128-255ì5_, 256:ÿNê~HÀ 'õiso8859_9', 'koi8_r u ·latin_1', Ð'mac_cyrillic'+I2', +ú### These have undefined mappings:/p'cp1250U 1 2 3 4 5£#I6!7 8+#42K#853#852$866']cp874CJœ K Odt‹^kz104‹JPgreek$ ‘iceland',uTromanturkishsÿfail the round-tripo!00¨Ø5[±� �)=ñself.assertEqual(str(s, encoding). !e(B, s)ðdef test_concatenation(Sf bð("abc" "def"),  §2nW "ghiœŸ;</Œprinting*úclass BitBucket©>Qwrite6g, textfÙBpassžVout =R!()‰„@('abû�file=out'def', &U\m !oend=' — *1def*u!I”Aucs4˜’°x = '\U0010'2{Ty = xWð "raw-unicode-escape").de(H 'Cx, y›h/brƒœyf   ƒ ~ê‚‚L¢:tryH�1' E‚except U§D�ªError as e` –¦e.start, 0_)gend, 1(?els_àfail("Should hðave raised UnicodeDeñError") def test_conversion(self):#õ# Make sure __str__() works properly-öclass ObjectToStrHLoD gÂreturn "foo"¤XaStrSub ]G(strª)b<ojûnew__(cls, content=""”˜×gstr.__5#2*7)D/ÇG(À.assertEqual¸(�B()),\p4 k_"bar">| = str(1:Ê)o ’ñ&ÏIs(type(s), f9( =&˜_ Zu}\_repr\Ë? s1&0,__2PV'\\n'ÿP2P5 •1(s1G|y9elf{,2,äÜtŸprintable|À'\U00010000'˱'%c'" % (0xe,)) # Zq0N 4N\_ ")9f # nonQRa# This:ò& only affects 32-bit platforms because expandtabs can5CtakeOñan int as the max value, not a 64W¸C long. IfQ£is changedN0to \975, t´öshould apply to all´.FP@unit§ð.skipIf(sys.maxsize > (1 << 32) or€uct.calc±('P') != 4,KG'4`pplies€ 7'W*>ü_overflows_gracefully%íR3s(O6ý¶, 't\tt\t'.Y', áÄð@support.cpython_¸Óš�ptimizatE‘s = 'abc'> ¤GIs(sŠS(), s‚hÊ1MemÁ ð#ifƒÀ.calcsize('P§') == 8: ù# 64 bits pointersùascii_struct_size = 48#Pcompa %%72%Lelseu/32u%24P¾u536 &ñfor char in ('a', '\xe9Qu20ac ºU0010ffff')£0codì@ord(F)X~1if z< 0x100:!3/P1 # ;ªof(Py_UCS1N1 b v ~+el€‚ 2‚2‚ ` „ ÔÆ÷4u4u-ð# Note: sys.maxTù! is half of the actual max allocation because ofÅ#3 signednessE@Py_sY¡_t. Stringðmaxlen-1 shouldU›principleT$be{ù able, given enough memory.3\X = ((Ú'- A) //ÏV Ié¡ = lambda:' *9lenjñself.assertRaises(M�bError,· \2eð def test_format_subclass(D^g S(str?B_m,__5ƒreturn ''Á overridden'…$¶s = S('xxx'Í…ûÿEqual("%s" % s,M9 B{}".ä?(s)?ŽÑ L_addÛ Badd_;, o2ï1"3"t íöS("4") + S("5"), "3"ã‚ iƒ!…'"1gs += "4§s™É=�getnewargK¶text = 'abcÿ)0 = 6.__=6__(ó"`IsNot(6A[0],8(7(1lenTR), 1)–Ñ reb ±`length^ûrange(1, 100, 7øð# generate a fresh-áing (refcount=fÀ te÷ xt = 'a' * length + 'b' ð with support.check_warnings(('unicode_internal Éc has been 'LW ó'deprecated', D BionWo=)):MÅ# fill wstr ƒ]field+Ðabc = text.en¦½-')6ÿself.assertEqual(abc.de@,a)Bë�# resize !: ±¨þ must be cleared and then recomputeÌÆn += 'c`oabcdefë+&Noî", R?def¦Ptest_ç@are(läå# Issue #17615šeN = 10UasciiÇN2zàPlatinO\x804J\xff1bmp5Ku01072bmp5"A#E0stroE = (àUü!, )2,æ!,  Pbmp, ´ 2ˆN²2ï1for¶1Ýó 2 in itertools.combinations(©7, 2Ȫe<ÀºA1 isRe% l-=¶12, F™4!44not8 !"ifT‡RTrue(†0 w1#ýp: dupliú B€ to skip � "str1 ==/2"Oqoptimiz…ž•YQ_eq()Xsreally Jåcharacter per  *vcopy1 =¹_¹-$0ãé0 #„`IsNot(A01, 2_0„(3 ` RFalse`? !=b<1¶’52 >0S )Î# <ÖK(ã'1bmp%À self.asó sertTrue(ascii < astral) pself.as(DFals)1>= 22*_latin)?bmp'¤¥rÎ?ciiSõ'Ë (  %žA B(A�j–A >= Ÿ *¡ '£A?bmp? Q&ŸÈð%?bmpÂ$—:J8 L5–¼?>= ˜ &š1"4)7{)£ï' e!Q»SE )¤ ̽`12) Kð def test_free_after_iter1 g(:!):)ßsupport.check2 , BW, strã<ƒreversed@ð class CAPITest(unit².bCase):Ë # ò PyUnicode_FromFormat(ˆíBom_fä imëò_module('ctypes'H Rfrom  ,% ()!ùpythonapi, py_object, sizeof,*Ôc_int, c_long s2,_t2u3u(  4‡ c_void_Ô�name = "&"–_· = getattr(ÜQ9@.res?& = ³(•o( w, *args†5cŠ = tuplexqð(arg) if isinstance\• else argø<0for0 insàreturn ëµ¢e6ç8Ðormat(expecte÷d, format, *args): ñtext = PyUnicode_FromF1(8 7ð self.assertEqual(expected, R%) .u# ascii…Bnon-…argument+bcheck_v!('%b\x7f=u›e\xe9',.Å7 b/h%U', '5 ��j,¡�ß: ensure that5V()†õ# raises an error#R#ÀRegex(ValueE* Ë?r'^…bV\(\) ^e€ASCII-en­dV% 'vð'string, got a ñ6Ë byte: 0xe9$I{8, bF0=%sX—'R•test "%c"† Êk\uabcdr©ðb'%c', c_int(0x+)` JŸU0010ffffN-P]with ›‘(Overflow™ #(¶g110000hï# Issue #18183 U0ÐA000\ÙDÙ )r9ƒm## š™%m'„5 %6sl/%s8?[%]9O[%%]:O%abc;!%%Ï b'& Î’runcated GO ‹8 ÂÎPb'%.3-^?def¤Ÿabc[\ufff .5L©¢[\u20ac]'.w('utf8'w ¤2"'\1_ABC'"­AØ*ùNH*.5J?DEFú&"'pRRšAJ*.3Lœ›>9.3S›O.´O,À.3V', '\u20aócABCDEF', None) õ check_format('abc[\ufffd',#*cb'%.5VG#, 2õ20ac]'.encode('utf8')) C÷# following tests comes from #7330+!ö width modifier and precisionuwith %S= ÎÏ"repr= abc"Î$B%5S'Ì'L/abI /.2J —M 5Nå#C"R="Ç'� /8R%'&3K ™— (5.Né& A=&)A&7K&Né& s=&nPs', b;o/KpOè% U=%&UHm2J#Nå" V="&‡FN?123N/R2V?123õTÊû Àat("repr=12"?, õ b'repr=%.2V', None, b'123')1ácheck_format("0o 12"T 5UVò# test integer _ßs (%i, %d, %u‚_'010'{ÿ%03i', c_int(10)EF /.4G-+�D)�ÓlGPlong(+H&IM.z•tssize_t˜ß 5'¶ád²)ß&GÚ.&llIM.zL'M u&uÙ/23&E lFÙ1G'HL,z“I”H'cu output@min_ð = -(2 ** (8 * LEof(c W) - 135max< L5- 1e ÈHstr(*)ú E 8–`š`8`éu"? = $)&û6ax_-ü Ò,(†‡òPyUnicode_FromFcAb'%pë€void_p(-¹–öpadding (width and/or precision ÁÚP.rjus_, '0'd2010åsV0R/10R"© .XÀ check_fó ormat('123'.rjust(80, '0')100), õ b'%100.80i', c_int(123)) /~check_fe1eZA010uWuX…W­ S"«?.10¬ h ¾i4xih"0xÂj/T#kZ l fm•# test %A ‘ÿr"%A:'abc\xe9\uabcd\U0010ffff'"H�%A:%A', <Z„V„¯'repr=abc'o"#%Vp™', b'xyz'dTèðstring decode from parameter of %s us"eutf-8.‘Â# b'\xe4\xbañe6\xb0\x91' is 00 enX÷d byte sequence ofHå'\u4eba\u6c11' vò )û@Noneú¨öreplace error handlerõ” _ufffdŒ‘5:xff�ò not supported: copy the raw e ­.!se¨`s are ÛU here>Q# to ¯<ð crashes and should oõbe considered as specificationsNIê/%sì %1 bæ/')A1¼ %=/+i®/0)D.¦ž1b'%Ä'!# PPyUniÒÂ_AsWideChar(f@¼Ñ.cpython_only<1def¬€_aswidec4aself):vx_ypcapi im# ul81m*ð _module('ctypes') ó from ctypes import c_wchar, sizeof ð = unicode_aswide2Õ('abcdef', 2)6ðself.assertEqual(W" i_'ab')O', 3|" |c}!4}5/\0!/10€h#\0ý…7§‚R önonbmp = chr(0x10ffffN#if·(Çu) == 2:�Ì©buflen = 3nÅE = 2else: #S4% R<R1-ÝDà", ¤ÙGb&pVF + 'N£# Test PyUÊòAsWideCharString(X@@supÑ.cpython_onlyчdef tests:®)uf_+DcapiiB>\?y™’_module('¯'ž(_\þŃËbÐÅIt®“‚‡Nkƒ7#; Р`&‹NOUCS4Pucs4(š 4 for s in [ZÁ', '\xa1\xa2 °u4f60\u597dÕa\U0001f600',Drð'a\ud800b\udfffc', ÷'\ud834\udd1e']: ©l = len(s)ÿ!self.assertEqual(unicode_asucs4(s, l, 1), s+'\0'>!0>_uffffB '+1‚\F)Š0F úRaises(SystemError,  , -›RFK2, 0Z0 = pË.join([s, s]"ºð=} C:~ó£# Test PyU5’FindChar(«ñ@support.cpython_only:àdef test_findc2‰)³`from _#pcapi imHƒ6 Mæð for str in "\xa1", "\u8000"80 d8Adc02£U0001f100\ 6f1"ƒWPi, chY×enumerate(str¬)ÃL¯8Ò, ord(ch), 0,’2tr)¤i7LT*-¸&i)&"•= "!>_=¶+lÆb®øf0iN¯# negative^'-b а O^0Ç t@Copytoactersz@copyz8¥Ô€ < `…ings = [MÊ 'abcde', 'œú\xa2\xa3\xa4\xa5',-ð \u4f60\u597d\u4e16\u754cµ*01.À '\U0001f600¥\U0001f601 2 3 C4' %] õfor idx, from_ in enumerate(strings):.@ù# wide -> narrow: exceed maxchar limitation8j tobXj[:idx]]aùself.assertRaises(H#ÏSystemError,!Àunicode_copy™Óacters, to, 0ñ 5?)¹# same kindÒ7PstartÚ{range(52®Õ_EqualÔ³(e« vO, 5)ÿ6[+: ÿ+5].ljust(5, '\0'D6 5-5 Õ 1to_— OjÉ ): r3 ú #'/ 8ó# Tests omitted since this creates invalid +.±4s =5[0]X`5RIndex Xa, s, 60HM//-1N90M6›3M¡5½6V7 éN�_0, -1�1a0, b''1"0);ñ@support.cpython_onlyñ±def test_en/€decimal(É _)pcapi imN"<;WCÊõˆ /_('123‚Hb"Xq\u0663.14h _3.14'ƒÁ Ð"\N{EM SPACE}CN"\Ú 0 tÊUÉE ÒÀ   unicode_enôdecimal, "123\u20ac", "strict") <õself.assertRaisesRegex( (¹ValueError,3"^'g ' t‚c can't ‚º character"7©¡replace") sñ@support.cpython_onlyódef test_transform_•(Ü!):&Ç`from _,pcapi imQ Ž?>µtoascii as ZSb>mEqual(+z('123')Ž!Sq\u0663.14c _3.14'õ·Ð"\N{EM SPACE}?N"Ð : é¼ß '/üpep393_utf8_caching_bug5ð# Issue #25709: Problem with Nð ng concatenation and utf-8 Weðægetargs_s_hash-ñor k in 0x24, 0xaÇV1f40dÚLes = ''APfor iEwrange(5 ±# Due to CPXò specific optimizÔuthe 's'ñFan bÚIÑ# resized in-¿.�$¦s += chr(k�’# Parsing^uP"s#" Õ!atcó calls indirect=S# PyU ðAsUTF8AndSize() which creates `]UTF-8¥#Ãdñ!ch×5_ objectäT_ åC(s),.+Ï() * (i + 1)¡Check that€asecond r returnÍ@sameƒ=ultÓ ª”ð class StringModuleTest(unitR.CCased–¼¬ter_parser`)(*@Îrßr list(_o.)S)+;bter = ^ÿ$"prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10}&Òa9, [l#('iP', '2sÀP('xxx0Š{', None] ('#¤Àr', '', 's')7, °(' ', 'z[0] 106s')&5]) 2õformatter = parse("prefix {} suffix").õself.assertEqual(?5, [&�#('G~GNone‡'e0', +² ?str¥$?strz*wÁ ?{0}J f[âÇ5¹õ Raises(TypeError, _string.Í_ Cr, 1*–def test_#ðfield_name_split(c%):Ÿ3$÷Þitems = list( \C‡C4[1]FS:[1]&qreturn ›ª ƨ‘"obj"), [ G, []M4I.arg8ß(True, 'arg')EZ[key]F@FalsG?keyGŒK 1]2Rù8Ý [±(/' (‡1F 2û� ‹R if _tò_ == "__main__"x@unit§.ð () # -*- coding: latin1ñ8 # IMPORTANT: this file has the utf-8 BOM signature '\xef\xbb\xbf' # at,ðstart of it. Make s0Vó&is preserved if any changes # are made! Also note thY·ñ cookie above conflicts with #‚b0nce…a¼"--åóis intended. # Arbitrary encoded>òtext (stolen from0docað 2.py). x = 'ЉЊЈÐ�Ђ' õ#y(í1"""gðAnd again in a commen*:(00pasATestÝôrunpy module import ê&os T.path%syr>@tempî%UUlib, ¨.machineryDutil6†py_compi–•warnings 1A.sup±X! (êðforget, make_legacy_pyc, unload, verboý¢no_tracing—ðcreate_empty_file, teðmp_dir) from test.support.script_helper imò ( make_pkg, * 7zipC) ERrunpyr ]±_run_code, cmodule , òpath # Note: This Ñ can't safelyÒ Mðas_main as it #K s*ð s in the current process, which would mess with+CQeal _W$__†c(usual‚P.regr]q) # Seem¢_cmd_line_!a for aâ that executes õ E@t up�1ñ*and expected results example_source = """\ # Check basic >oBion ;ñ = ['Top level assignment'] def f():/ã.append('Lower5õreference') f() del f}j$sy¹@sys áÀargv0 = sys. 1[0]Âname_in_sys_óas = ___Â2 0(c3 K1andÖè Áglobals() is™_$s[ ].__dict__ëd0nes‘”operationéü =Š') """UQlicit1spaå{Ä"—„": None,lfile__ncachedopackag1>doc.6spe4 } �mŸ  Psys":Iš"": É_": ["ŽO", "s$"]A0un_A0kM› #t": Fals3è$ Ê0": K(imp—q TEx=1,½!="Ú"�loader__=¹/),I.updateká) class CodeEH‚ionMixin´ñ# Issue #15230 ]Ð not handling‡Vð correctly) highlighÓaP#'Eblem� way argu/�s were beRqpassed nJ*CAPIsN—down to lI¢.çÆy¹p easier0³ensure fullJsvðoccurs at those upÓ@laye¡1ll,ûBjust(“e utilityL. QFigurZuT"e ®q detailGpadvance)@hard¡ãdo, so we skipKcˆK¼E$ofWÙba_state;ðCHECKED_SPEC_ATTRIBUTES·"Ñ paÇ `origin àcached",  õ"has_location", "submodule_searchPs"] Hñ*def assertNamespaceMatches(self, result_ns, expected_ns):>Bä"""Check two nE0s mG.f(ò Ignores any unspecified interpreter createdJe õ# Avoid side effects¯& =»u.copy()%É( =× )ð# Impls are permit›Âto add extra¨€, so filÁ…them outnåfor k in list(¡C÷if k.startswith("__") and k.end{8<@ noteÜ)-�f.pop(kN¯["nested"]X ) bñ# Spec equality includes the loaderJqwe take&O0 ofV#ß�¸-c‹åhat separately5üT  0"__w0M +4&ifR7zis None6].y Is3”;els9u# If and8ò is set, we just `we got9V righ•éò# type, rather than7@ing ¶Efull®; å.¾†ˆÑ ð5ôE(øF)),l; ; Ÿ==5Ç@attr€þCHECKED_SPEC_ATTRIBUTES®Ek = P." + H šðactual = (k, get%Ô,7)–š½ ;�=Ë?K‡¤p@# FoÝe1!ðstill don't use direct dict comparison on9ò#k2, aµBdiffðtoo hard to debug i¨0ythNVbreak¦ ¿(se,Ë( 'ns?ÑNÌ*ns» U$6[k]~l + ­cl$Kv°_code_execu‰IÙ_"@Wðhat an interfaceð runs the example cod¦rrectly ñFirst argument is a callable acceptingNøinitial globals andJ#us)±m to create8øactual namespace5iSecond€¹Õpected result25""" õsentinel = object()"ex@f_ns = ƒW.copy0@run_  -As["_E__"][ðsaved_argv0 = sys. ,[0"3mod Ämodules.get(i$, ¿µû# Check without p‚Ûg¦s\V(NoneSÄself.assertNü‘Matches(r[G_ns,!s<7Is(é', 0 ù H6modFP# And7n${"N%":Y}1&s[*]ŸD+# =Ã\t°bXIsNotW0 ’Œô class ExecutionLayerTestCase(unittest.e, Code.qMixin):Z€"""Unit 0Ps for£@py._�8and:_óE1defA5(|bÑçÈü¿ ô/‘.update({iLà"__loader__": Y, }˜‡ s(ô_"œPvreturn ÀŸÁ_source, {},ð@oê .c$_e”(z Æ;›tsT :1mod(æ = "k f Ó"Some other n+ *5LðNow you're just be#Zsilly3ðpackage = '' # T= aŒ¢top level ÀØN”ñ spec = importlib.machinery.MuPSpec(*½¾@porigin=CD!D <„³+À "__na÷me__": mod_name, f"__fil"f#eloaderG IfpackagL (EspecL "“run_argv0¶”$«ü_in_sys_modules": Truä+ %})õ def create_ns(init_globals):%F€return _�fûcode(example_sourc�8g .Ó.nç°self.check_¶µ_execution(ýñ , expected_ns) # TODO: Use ?ðaddCleanup to get rid of a lot ñtry-finally blocks class RunM·ôTestCase(unittest.t, CodeE˜SMixinƒ€"""Unit 0Æs for runpy.‹A""" ®ÏÇà_import_error(Á,X;;tryè#unc(GzG�except I[EZ =Apassˆ[Jelse†ƒ.fail("El § §Ü6" +©Öýr_invaliÞsÕË�# Builtin?5ule‰wV"sys"Þã# Non-existentFÐG —.imp.ericP1Ïos.path.half1Wa.bee*°# Relative ¢ßs not allowedøw.howardQ¬ ..n,¦ž0.2# P^ÿ without __main__.pyÜûmultiprocessing")DtlibraryåùEÖ.assertEqual(e#("Ù1["_`d__"], g´_add_pkg_diz,®§pace=FalsezPos.mk2,˜&if7 Q•6Nonî?H4 = hPjoin(�dir, "__‚Qy Qempty+2KŒrLö@make÷˜#, b depth|Rbase=0_*"ý*(�, parentxs@sAÀ: # ó+Enforce a couple of internal sanity checks on test cases õ if (namespace or parent_õs) and not depth:;Bù'raise RuntimeError("Can't mark top level module as a "CG "~¥ package")41pkgžÀ = "__runpy__Wè _fE =zö_base+os.extsep+"py-<¢dir = sub_ Àos.path.real Ð(tempfile.mkd &()‘ò if verbose > 1: print(" P¼´ tree in:",c=#syk£insert(0, ‘$a„Updated EbQ9[0]B½!ø­_flags = [þ2] *ø€¬ :u[-1] =  ,6forj; insVc�Sjoin(&qå6@ý‘self._add#6dirA=þGvCNextÖÕ†C0Cre¹°®‚5mod¾Š ýá 6µile = open(FG, "w@ËÎwrite(sourceGv.close(Í\Y7@ = (ì a+".")*’% +¡63ðspec = importlib.util.`_from_�‚_locatioìY,Dv7¼dreturn‘,ª# r˜ |€def _delp(~,)àPentryPlist(¾ms(½1if +Ë.startswith(ô 261delT[C]žÈSRemovN<7ies?^/[0W5TyRÀroot, dirs, Ûs±os.walk(topF«down=FalseöB�5>oò>tryAos.rù(k‘Uê0‘except OSòÕ/ex^màex) # Persist ×Å cleaning upªkÛð: ð fullname = os.path.join(root, ;) Mtry:$”os.rmdir(V<ÿexcept OSError as exMõ%if verbose > 1: print(ex) # Persist with cleaning up– £›:top–hö " Removed package tree"<ÊZ Ãö def _fix_ns_for_legacy_pyc(self, ns, alter_sys)Añchar_to_add = "c"Oœ÷ns["__file__"] += , &acached(*= 9*Tspec  /@new_ð = importlib.util.R_fromŒ�location(.p,E· ¬¬c¦· l&ifPO~<žrun_argv0: C±Ãcheck_module¨Wdepth«o=Falseã*uSspace-€ parent_s÷àpkg_dir, mod_f)  üA = (®×Oò ._make_pkg(example_source, À 5<f™= â6Ó )¿pforget(Ýbäexpected_ns = ½$�o.copy(/™.update({Ü!"_fA__":KJ ËD"m EA%}. N^ sq.rparti}".")[0]8T5 "}ò×; ¨"ùÊï(-0_in’s": Truð"&/Îføcreate_ns(init_global�preturn ¾i<(, 7šOÎ FÒA"Run�× ;&:"‚�œr+¡code_execuëÛ', ž >N`invaliÅ_[séh"__,%__ýð) os÷.remove(mod_fname) ùif not sys.dont_write_bytecode:,7ÿmake_legacy_pycW+aunload"xÀ # In case ýer caches pathskòimportlib.invalidate_2(Ånð!if verbose > 1: print("Running from compiled:", — xøself._fix_ns_forïþexpected_ns, alter_sysŽD`check_Hà_execution(creÈ@MBzfinallyzOö_del_pkg(pkg_dir4ürModule |ñed successfully") ùRdef _©€package(mw, depthäq=False,5p0*, QSspace.… parent_s)ßÍ‘¡ 3 Œspec = ({¨!._‘åexample_sourceÁ¯"__main__"¼ Îr½ 3 ß )§ë[% =~q.rpartiu".")[0]çfforget@84 = øZ¿W.copy"/0.upF%({Lù!"_¡E__":™ úu"__file"¨ Eœd%¼Qutil._„ŸÖF)jˆH3 %"È "}r&if¥sô%£"run_argv0²j$(€0_in!_mzs": Tru5"!/ά?×(init_globalsP�preturn ¾i3¡(, 7ßÍ+tr‡h db¼�œ¶q>X "__,!__lý ‰/os¨í Àfrom compileûd:", pkg_name) þ importlib.invalidate_caches(.ÿ#self._fix_ns_for_legacy_pyc(expected_ns, alter_sysDð check_code_execution(cre~@MB‰finally:Å“€del_pkg(é6dir4òif verbose > 1: print("Package }ñed successfully") cð def _add_relative_modules(uö , base_dir, source, depth)¡"ifV <= 1„óraise ValueError("Rf f³ test needsEF> 1"ÚëÔ° = "__runpy1__"½dI£% =®üfor i in range(¼AcparentANC$ö = os.path.join(‚Ó# Add siblingôY#_fâX"* .p·�J³empty_file('QE œ žJHÍlnephewÌAuncl( ^1, "&ßc.~éAdir("Œ¿2" pì¾ C`cousin Ÿ-2, "&Ÿ #I 3¡ EVº ¤02, ")  &Oª5ÚJF¸/Ù1_1cQ, runŽW=None.òcontents = r"""\ from __future__ N¢ absolute_'.¢.Æ.(#½6 ""+e,ãÖ € �spec = (ìe©@make(Å  cú@ is ý õQame =‹€rOelse3 a3/tr0Ö ÄNó&–¡q.rpartiÅy'.')[0]3f@RunnüçC[1mod:w d1#un„]&OýÐ) # Read from— source ñself.assertEqual(d1["__name__"], expected)<cpackag??pkg: ÿIn("sibling", d1c)onephew(ù(del d1 # Ensure __loader__ entry doesn't keep file openÏú importlib.invalidate_caches(–"__,___(mo‘os.remove fN Bùif not sys.dont_write_bytecode:˜®ÿmake_legacy_pycW+ unû"xð # In case the 2er Ùm pathsoÿ!if verbose > 1: print("Running from compiled:", Ž)U.âd2 = run_modul>Å, = ‚) # Read�: Êà2à’@ä >¿è2-ì,ð2ð'zfinallyiì�_del_pkg(º6dir¨M«ñ executed successfully") ’�def test_¾Ün)�÷for depth in range(4!�@Test–”F–OÀCut._checkd&¨1_inÁcspace_d(Hž½?1, ÀX , ¤Ö=True, parent»s�ÔyŒ•!ü_init_exceptions‘ð# These were previously wrappeddAan IòñError; see Issue 142853�result = ô!._Š ö"", 1, "__main__"j;6, _0, _ÜM\8% =Cµ.replace(".Z7, "^ˆ¡addCleanupû.·#, }ŽÀ init = osð.path.join(pkg_dir, "__runpy_!_"ãinit__.py") óexceptions = (ImportError, Attribute4Typ BValu )JEfor N6 in %s:%vfname =0.__)__&ðwith self.subTest(%)KOPsourcQð"raise {0}('{0}ƒ%__õ£.')".formaJ nIrPopen(5þ, "wt", encoding="ascii") as mod_fileŽIr.write(¡)#?try@°run_module(Kø ®kF—?errRHðassertNotIn("finÖƒ spec", Nerr)©?elsêXáfail("Nothing …êd; expected {}x` @ + " "M¨äÂdef test_subå!_i–°ed_warning(w äö!_,š1R, _ =@P_make f("", 13 x_k/__y#~.MðWarnsRegex(RuntimeAing,Ìæpr"foundšRsys\.à's"Ì/ kfinall>—A_delëêUspackageè_ed_noV3bgmain__•”¡addCleanup¹.¤%, ¥öŸ% =ÈÓ.replace(".__`7, "dS# No ô should occur if we only Cà the parent mªþ+ÉA3In(T, sysÅ,%‘ts.catchd+s(ë'ðsimplefilter("e‚:", Uc0"� Q# Butìa ] w�í þØŒÅðrun_package_in_ó namespace_package(self): ÷for depth in range(1, 4")óif verbose > 1: print("Testing \I2:", )eCxu._checkŒy•, parent_¬�s=True) @Ædef test_run#CW­ÏqÈÇ/_iÜ¢»ÿmodule_alter_sys‰†L’(…™¶æÃL^Ç ÿ explicit_relative_import�G2, 5iÓ d dBs at"< s¦ OmainËRi ”Ð7P, "__\<__"Üï ›¯A = 1‡*À = "And now `someth ðcompletely diffeo"@àpkg_dir, mod_f¾  …spec = (3w0 }à._make_pkg(exaht_sourcepforget(g\äexpected_ns = G$¼o.copy(/™.update({›!"_*T__": ,"Afile"�÷ #acached%Ä‘lib.util.S_fromîÖF)j9�mÙý.rpartition(".")[0]8w}5 "}!ð create_ns(init_globals):  ñreturn run_module(mod_name, init_globals,#$) ?Etry: ö!self.check_code_execution(create_ns, expected_nsKofinallOñ_del_pkg(pkg_dir) s€def testðutil_walk_packages(Š)�ò# This is a dodgy hack to use theLðrunpy infrastructure%ivåö# issue #15343. IÃ8 declares tpjindeedw;ø import pkgÅdÕmax_depth = 4Abase›a = "__®5__"$ò_suffixes = ["uncle", •.cousin"]5ú4+¦.nephew", ƒ·+ ".siblingJe݈€Fset(ò"u!Bfor üÅin range(1, ÖŽ–•.".join([¦2] *L€5„¦A.addaK ,�C in /)aVZ  5@" + Qgf*s¿e)cÏ Â(‘­I"7”Pdir, tf  …spec = (’e0 à`._make8("""a'¡addCleanup.R,wSV í |2Z++1~`Ó_add_relativeFsNÜœT—g*AinfoZ.Æ[!]wñassertIsInstanc¹0uleRÚQ!.MÔFInfo~í¹B.Ÿ _fÀ,r,C Êñlib.machinery.FileFB ~ ifò­o.ispkgKXremovè.) [OelseL×/s.K  ¥Equal(len(æWs), 0Ñ/G � Fð class RunPathTestCase(unitH.t, CodeElSMixin1ð"""Unit tests for runpò y.run_path""" def _make_test_script(self, E_dir ‘basename,=Aõsource=None, omit_suffix=False):;2if ,@ is /V¢= example_?qreturn ½«(²‡ ®) _check « expected_?fil*  :’argv0, moE>ë uÂ_spec=True, §aloaderlr# First$p€without ·l÷create_ns(init_globalsO�€AS}M), 8\´)&s Ø2Åspace.copy()/%if³#1pecuN…CKelseW4o/#if“X 9-nð = importlib.util.`_from_ò¡_location(Þ/ K 8` 7–�cached =.u.×)Sif no_% à%NA!! =˜HN1}x78!¥s.update({x!"_ÇC__":�% i""_b ' a2"__‰P£ &qpackage'-"" C "û¹¶)ñ_in_sys_modules": º + }®.ý¡code_execu�È,Vs:ƒ# SecondKes sureõ works in all cases®ÿÖõ = "prove.issue15230.is.fixed"/Y?,§Ó ÂA and¨gÜ×ø åÇÖ­1�àexpected_ns["_ñ_spec__"] = mod# óexpected_ns["__name+1run+lpackag.õ.rpartition(".")[0]Añself.check_code_execu*·create_ns, ‘!) ;Rdef _7Ðimport_error(O�, scriptªq, msg):5ßðmsg = re.escape(>ñ.assertRaisesRegex(IbEaO , Ipathk›²test_basic_Œ™‡ôwith temp_dir() asµ6dir®²!odÊB = 'M'± #Ãa_make_…(m,ðÔ)G‰S.5,D, "<õ)>"÷,G’ N¡Ëpo=False6 ¯_no_suffix@�ù s omitÒ_=Trueƒƒ±�compiled|� 9ªdc = py_. Ì0dor߃˜os.remove1 mb|*(e¨ + - .ú/Ÿdirectory¦4�__main__d\", U,ƒM P_I1modè= !) C€def test&Ðectory_error(™)ê�with temp)f() as _'‚bÑ = 'not_main'm:x0 = j!._6Š S ¦ñmsg = "can't find '_n÷__' module in %r" %® ‹€dimport=,sg/zipfile'4· œƒ'-1zipû3, fKlk'„Tzip',46 z³ ¶O) ´t%,  â  ë©", hÏloader=FalseŽŸ_compiled—‘¬œT = py¿.W»doraise=Tru®\ጠ›—I“Ì–Ä&¥€ ç .5, m±@no_tracingEZ¤_recursion_?elf_,yPdummyˆxQÀ source = (ÿ"import runpy\n" " ù.run_path(%r)\n") % dummy_dir:òscript_name = self._make_test_(<Q, mod.™, source)O3zipfSME L'ebzip', = Súmsg = "recursion depth exceeded ÁôassertRaisesRegex(R=°Error, msg,J$ , Ÿ¯!) ÍAdef š�encoding(W!):v�with tempT() as¿6dir'+@file[` = os.“Z.joinüJ.py'ûhTopen(Gt, 'w', ™‘='latin1'„f{Â.write(""" #Í:3 sVúnon-ASCII: h\xe9" """……result =0� ($.{bEqual(9�['s'], "j�) if _óò__ == "__main__"Ê@unit‰.ð() '''Tests for WindowsConsoleIO# &$io $os %sy ¼SiQ fromü I0supw«òsys.platform != 'win32'¬ro IP.Skip¬ ("Áñ only relevant on ;2") rncÊz¹ý_input ConIO = io._ùm class%s(’CCaseÈå�1 = n@'//?r1outn/wbv<ýLpathüPtemp_0 = Þ@.mkd (ÐÁðddCleanup(support.rmtree, temp_path)3 ðconout_path = os. ¡.join(tempÆ, 'CONOUT$'):§with open(Dõ , 'wb', buffering=0) as f:ryúif sys.getwindowsversion()[:2] > (6, 1)59ùself.assertIsInstance(f, ConIO)eOelseB /NoEFð def test_write_empty_data(„›(''ù<À�Equal(f.`ƒ(b''), 0`}æáStdinRoundTrip|g, text‚s$¾�„–IN$', 'r'Dold_({ éW:try*#: = +/³u_input(D/.].raw,"(Àð + '\r\n').encode('utf-16-le½×surrogatepassÉc×’actual = ‘ofinallÚ£  ]sý�p3�# ASCIIR Ìw'abc123Üo# Non-@ÉϼўТλФЙFÿCombining characters‘éAÍ�B ﬖ̳AAÌ�S™?BMPF`\U0010 Effff dCFÑpartial_readsá N Test that !Ô@less†n 1 fullå» works when¶÷# contains multibyte UTF-8 sequence"˜ource = 'b­¬p�expected:8\1forÛ÷_count in range(1, 16 ëltçbq† ÔA͹71, sîy$ûe = b''ø¢while not 'P.endsŸ0(b'Õ{:bO.Í(÷E'[R += b{x K.$, ‡1, 'l¸{})'.formatxø Ž˜VrQ pairâPt candPbe de%Cd to¸m5outš#F!†an extrað. sourceã = '\U00101FFF ó001\r\n'.encode('utf-16-le') �expectedB8>õfor read_count in range(1, 16):fmú with open('CONIN$', 'rb', buffering=0) as stdin=A±rite_input(#©, source) i,Íactual = b''¢while not 'P.endsŸk(b'\n'¸O2b =š.ò(÷M'[^ += bŸòself.assertEqual(.$, �1, 'ãl¸{})'.formatxøðdef test_ctrl_z(]ÄÙx&axC4\x1ASÈ: …C.wÚ;a, …71),”Jall(�  h˜�[0:1], a/ò1:], b) if __name__ == "__main__"°@unitŒ.0() œÀ__getattr__(:œ0if ƒ != 'del$'Hóñraise AttributeErrorÌ÷del globals()['`!']!:rimport ’lib.util 4 os ¤py_compile(sh*Estaty7Wtempf5 a from {@ supŠÂ class PyCqdTests(:.bCase):AL\setUpâæÄdirectory = �@.mkd ,Ö°_path = os. Q.join[.LA, '_Ï'pyöD4pycATF+ 'cwTcache1u„.(_F† 4§M‡wd_drive¾Qsplitò(os.getcwd())[0Q¡# In these�Ps we ì�ute relatR ðs. When using Windows,<`MÀcurrent work'6 D@ and1! '³ͧ' might beMPon diRÇ…�Therefore«€need to « ch Athe , w)OúSorary'  u lives.+?G ¸ L"ifz¯‘os.chdir(W¶„ UQ, 'w'öž N.�('x = 123ŸÀef tearDown(ƒself): àshutil.rmtree(µ.directory)&1if –cwd_driveAH‚os.chdir@%!) Añdef test_absolute_path,‰³py_compile."b.sourc3,…1pycBŸœàassertTrue(os.cr.existsH67OFals8Bcach)Ðò do_not_overwrite_symlinkrÜó# In the face of a cfile argument being a B±, bail out.Ceå# Issue #17222=try�F ùÏ + '.actual'Jðexcept (NotImple�±edError, OS Ù˜}ð skipTest('need to be able fcreateÞp for a 'Ž;elsWÒ Î is] Õ?‹Bwith$;ÁRaises(FileE À9}!‚P@unitÝ.eIf(not±åos.devnull) or is¬,S� �'requires;,A andG itbmÈ non-regular\ ¯3non0_‹·( {À´"°x ‰ÔNÑYsújwk ?Ö  P ~ðhasattr(os, 'geteuid') and os.geteuÏid() == 0, ñ 'non-root user required')/ð @unittest.skipIf(os.nameRO'nt'Uó cannot control directory permissions on Windowsn@def mp_except%ñ_propagate(self):—Éö# Make sure that 5p raised÷ nks to issues with writingI—bytecode.ñhttp://bugs.python.org/IU17244,ámode = os.stat§.ñG°‹os.chmod! , 6†.S_IREAD/6tryì@¼€.assertRä—s(IOError-³py_compile.{Ñsource_path, Q1pyc~kfinall‚Â@.st_!) Ë¡bad_coding~¨>‘P.joine 0dirmÖ(__file__), '6C2.py9ï ÷upport.captured_stderr(w,öGIsNone(-jA, doSv=False)(I»qexists( r imœòlib.util.cache_from_“(r,))H#¼_date_epochO9 ti›¥ 123456789 ðEnvironmentVarGuar$jas envtôenv["SOURCE_DATE_EPOCH"] = str(sçK'ÂÚx)™LTrueO®w7‡ pÁAopenO.\Ú, 'rb') as fp†flags = Îú_bootstrap_external._classify_pyc$€fp.read(ÒF_', {}ÐaEqual(uc, 0b11 šAsys.'ð.optimize > 0, '`` does “Bwork#-O>¬ñdouble_dot_no_clobber@/#  U22966w&# ð foo.bar.py -> _ _/ce0-34…BQweird� %Ôh0, 'F`Øiõ ³�nŒ6 = e + 'c'¦§head, tail¦fsplit(�SpenultimÌ 5AbaseôS2íá{å0os.×=ðpenultimate_tai·l, tail), Ùos.path.join(%Ú'__pycache__'9òfoo.bar.{}.pyc'.format(sys.implementation.Eetag)))gðwith open(weird_Šõ, 'w') as file:,pö.write('x = 123\n'P³py_compile.Y'ôself.assertTrue(rexists(«Œ«4MFals51pyc¿1)) ³ñdef test_optimiz"(K)ÙÓ# Specifying .ðed bytecode should lead to a š€ reflect4Qthat.u$^ÝÏIn('opt-2', *asource™,~-=2ÇrinvalidÇLmodeÇa”˜n  _=PGPycIöMode.CHECKED_HASH™ä[çÔS, 'rbap†£ð flags = importlib._bootstrap_external._classify3Àfp.read(), 'V', {}˜Ž|aEqual(uf, 0b11&ýÉ /FM7/UNOÀò) if __name__ == "__main__"ù@unit¤.2() ù ! ë” PowTest(.fCase):í0powKP, typV!if’ != floatðfor i in range(-1000, ')ûA@pow(o—(i), 0), H15 "1)±'(iñ7;l;0;r¸1mo“3), i*i*i•]@pow2? T v_0, 31r02, ~XÅj@if iúP30 : #! ="*2>$�Pother_(int,ƒ)0Ulist(5þG) + À1, 10)):  Üii = type(i) ÿfor j in range(1, 11):+/±jj = -otherVjV+Åpow(ii, jj) Po>wªint, floatu)i!˜/00™Dzeroã0�:exp±_i/10.)1if ,:= 0‰Ë…continueËðself.assertRaises(ZeroDivisionError, pow, ¬,g`il, ih¤e20, 20_Qjl, je5, 5Qkl, kV10, 12„Gq = ‘UEqual:!if ? ==reil = 1-ÛRjAlmostX'elZ+inÊjX¦- öÛô 5+©&ÌB &Ù*k^S*.oif k !#[ W= 0 and k != 0R*ýself.assertEqual(|&ßpow(i,j) % k,*?,k)'¿N_nt(i)Ä/É äðdef test_bug643260(^§êclass TestRpow•>�__rpow__8w, other?†±return Noney 5 **]ô() # Won't fail when `ò invoked. SF bug #±!. QŒÊa705231’‹ö0# -1.0 raised to an integer should never blow up. It did if th¸°# platform ]P) was’1gy,À`Python:Ëw(¡around it.­þPeq = mË1a =¯á# The next twoµ²s can still1¨žffloor(´€# functi�0oesžô treat all large inputs ass‚`Dmath0Galso{õat is happening:0eq()Àa, 1.23e167) 0š"-#PbP/10QHñfloat(b)), b & 1šWor 1.|Y Ï71008­’fiveto = W5·n¿#€# For smL3n, 2w�Pbe odºõ Eventually we run out of*Iòmantissa bits, though\_\eaferaFeven]H€expected¶¿B% 2.c  |@34), G î)-ê*4eq(?ñ� # else0didƒDpushÎ0to Éòness if __name__ == "__main__"†@unit’.@() -ðBEGIN CERTIFICATEñÿ - MIIClTCCAf6gAwIBAgIJAKGU95wKR8pTMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG A1UEBhMCWFkxFzAVBrñ cMDkNhc3RsZSBBbnRocmF4MSMwIQçðKDBpQeXRo b24gUõÿi29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0 aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjNzA1MCUGA1UdEQQeMByCGnNl bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MAwGA1UdEwQFMAMBAf8wDQY$a AQEFB%ð·EAIuzAhgMouJpNdf3URCHIineyoSt6WK/9+eyUcjlKOrDoXNZaD72h TXMeKYoWvJyVcSLKL8ckPtDobgP2OTt0UkyAaj0n+ZHaqq1lH2yVfGUA1ILJv515 C8BqbvVZuqm3i7ygmw3bqE/lYMgOrYtXXnqOrz6nvsE6Yc9V9rFflOM= -----END CERTIFICATE-¤ import re Ttypes „unittestàweakref from  A0supIô class ClearTest(D.áCase): """Ðs for frame.c:1().% ódef inner(self, x=5, **kwargsRVE1/0 15out1,2try‹9[.f/Múexcept ZeroDivisionError as eHuexc = e;¦return excœç±_traceback_ýsÞ'tbÓ�WB all-us in a F5)5ûwhile tb is not Non±Rtb.tbƒ€½NRtb = %FnextÆ_ËRlocalÁ½ Epass`+5C()Swr = if.ref(cY§Ü'c=Udel cH’·.gc_collecteð# A reference to cóheld through theeSðelf.assertIsNot(Jf, wr()¤ž˜[ws(exc._õ_7A¯7The±ýwas released by µ…ª §ÍN»‚generato]¾Æendly = FalsÏ>'g('#1non 4f hYyield'}kfinall«jf = Tru�wgen = gì²F(genVÚ(J #¿6ingq closes0Àbgen.giç� «n=LŠ‘executing Ð): # ñ Attempting to clear an execuóframe is forbidden. Etry: 51/0úexcept ZeroDivisionError as e7ñf = e.__traceback__.tb_{Pñwith self.assertRaises(Runtime[)W.Ð/()D* f_’KL‘def test_a_.°_generator(ª�/# j< ùtÑendly = False�y‘'g(p‘nonlocal 4, º¾Â/Æ)Î6f‹T) æW yyield fDkfinall-of = Tru¢wgen = g�0†next(gen£8âã(N 0# C¥±#he+µcloses the F¬1d¤c2ñ@support.cpython_onlydõžrefcyclesë¢ô doesn't leave any 6q behindY4¼{¬disable_gcÓzclass Cè@EpassMWc = Cnöwr = weakref.ref(cX ex6‹outer(c="Ydel ch.’úIsNot(None, wr()])0èêZs(excÿ;d a" F¦Lí sTest(unit¬.CCase1"""¾Ó41.f_)²s attributeå/0üBmake” ó2hNQx = 5B¼6=\innerí/™z = x + 23 ®Yt = 9*sreturn ` ¾!ü.tb¿H–åY = []Žwhile tbÎ2¥.append(tb ]~"MaùJ iðtest_locals(selfC): õf, outer, inner = self.make_frames()-*’_locals =9#.f&AøassertIsInstance(<a.pop('qö'), types.FunctionTypesMYEqualHö, {'x': 5, 'y': 6}9^›" =Þ¬ _7_�z': 7}) æãdef test_cleare(«Zt# Test q after 2ö() (issue #21897¶�.R™Õ �.•é�7, {< -TË-q ¬before andÿto exercise caching#*¹³$ Qf° class Repr;P(unitg.CCase^1"""ʱs for repr(¯!).# ¡#ÙEô(Qx = 5@Yy = 6= =/™z = x + 23=1/0Yt = 9breturn¶(v>Poffse/·õ .__code__.co_firstlinenoK6tryë@ìÒúexcept ZeroDivisionError as e;õtb = e.__traceback__i\€)[]Šwhile tbO2Ò.append(tb.tbuî'~"Enexta;els¨ä÷ .fail("should have raised"L¡f_this, f_M Ð2 = ËePfile_AÐ = re.escape(1(__&_)³�kRRegex)n%),UÖ Ar"^$ R 0% (@Ã#, DO+ 23¶·=U³!7²Å ²À rÿ."^$" 0% (<ñ!_repr, offset + 5)) if __name__ == "__main__":Q�unittest.Ä() import gc dpprint4sys :ð class TestGetProŽ( .RCase)rãdef setUp(selfÛƒsys.setp@aNone) ¥3�tearDown6�st_empty8Àelf.assertIsl(€g€>—}œst_setgetH‡fn(*argsÍ:BpassÁ_ß1fn)ÜŒ ˆ , ,e¶HookWatcherOŒ__init__œa.pjs = []qSeventË�callbackK!, =!, +W, argãAif (X9 ¤"or8oreturn!§exception"c1dd_lr™a!õ²À=ßV“"""Add an Öto the log.""£"ifÿ@ is Bp“Z0 = ×A_get#(1“"?try3 no5ñ2�s.index( £ ValueErroíW.J"leçB' t.appendhð#Zs#$%noERident)2get•s. bpRemove Vs to ¡)f disallowed£k¸1Â.__func__), )ÏϬwy± [item for 1in eú1 if¶[2] not in —]áPš§Simulator(�ýC Ž , ^cÿu% =# –Pstackéq.gwrÂ3# Cïñ registered with×® )/è–settrace(gF@disp”[O],=™;_Ÿ !$L÷ ('+'H9&±ú iùk-m Mpop(e¨"io…¬ ÓÀ.testcase.faWil( ñ'"the profiler should never receive exception events") Cñ def trace_pass(self, frame):!g/µispatch = {s'call':H ,y!&ereturn# c_W ‘ 1 t#ô} class TestCaseBase(unittest.6bcheck_N8¤ãable, expected0E*¤ = capture;5}`.new_wcUer())H#if¹5 !=^¢a?sfail("E4‚:\n%s\nR d"bCõ% (pprint.pformat(Ó,, R5)))EPŒDHook:( YGðÂŠÕ FW‡¶¡est_simple9X7f(pO5î¡f_ident = &(fk†.Þ‚f, [(1, é#, =)ƒ`4Æ'6]›å½è?1/0ç¢caught_îXtry: ó‡D/: ó¦ onestedó #·ôKÿ# This isn't what I°© r# (0, '¾Pion',Öðtect_ident),  ÿ # I expected this again: 1ÿ(1, 'return', f_ident),6 1]) "ódef test_exception_in Ö_clause(self)‡37f(p‰11/0Q "g"6tryE'I8ˆ)> .2U passK1 = 5(f)g#gêñ.check_events(g, [bscall', =`S(2, '4Œ4Ê/(3j 4j j jppropagave9'âfinally: p.addÜö("falling through"²#>ÈÔ ç?I&¯raise_twicns Êífí=¹ 6 !re H÷—Ô ƒå$ E¾(Åñ]À € ]) ñdef test_distant_exception(self):&*'f(91/0!g!9f()!h!g!i!h!;j(p…i"¡f_ident = &(fgghhiijj<ó.check_events(j, [(1, 'call', =%),P&(24Œ434Û444*454y4Ÿreturn', 6ž6 6 r6tÜ6Þ ‡Ÿgeneratorûfor i in range(2Nuyield ifñgCI âDEpassA³bgÕ # Br the it,£ twice to ?ve valueµÆ\×À 6¸ôj"Ò# once more; �’s end-of-0…ion withÒõ# actually raising an > [X yF yUstop_!~¾Àlf.check_eveÿnts(g, [(1, 'call', g_ident),  # 1ð the iterator twice to gen�e valuesK &(2f4Ÿreturn', 6¸4j¡# once mor1hit+oraise:wùÜûð]) class ProfileSimul”TestCase( RBase)ñódef new_watcher(selfj‡ R' 3B²test_simple]B7f(pT6pas�)1 = æ1(f)Y(� .check_evef=OÏhVˆÆåÿbasic_exceptionî51/0Ò°í’ocaughtîXtry: óA2/: ù¦odistan  èD+g(!&f(í!h!g!i!h!jmi"jšgšhhiijjØjØ=بŒ43ÜÛ444*454y4À (ÿ 5, 'return', f_ident),  ((46g636h626i616j6‘]) def ±(function):¥if hasattr£, "f_code"$74 = >."CBelseM)_K!__+• Mõ.co_firstlineno,Cname²Ãprotect(f, pŒ‘try: f(p)Pãexcept: pass /# =ñócapture_events(callable, p=Noneg€if p is Üòp = HookWatcher(…P# DisDò the garbage collector. This prrñ __del__s from showing up inÔ‘# traces.ðold_gc = gc.isenhdyBgc.dz6‰ðsys.setprofile(p.ëBback¶# @ vfinally2if §^2gc.°žýTp.gets)[1:-1]ð ®í‘Ámport pprintä .(×)÷Pif __Wò__ == "__main__"°�unittest.Ð() """Bigmem 3s -1forâó32-bit boundary in containers. These4Ðtry to exerciƒvery low<p limits�make sureFKòthemselves don't suffer`bitrotÔoi7 m †Û,õy a highml@regr­,Ó™P-M opú.â! $" i\0supd.!b3�, _1G, _2C4G CK„operator`sys #¤ ðests all use onerªhQ decoBB indicate h`Tuch #út÷H5and @need0be Š bIhe #n­�two argum+Ó: a 'memuse' Š or4ðlaring # (approximate) bytes per size-ë3 wiøð(at peak usage), Á€a # 'min9mð a minimum *useful* size. A tðest that # allocates a bytestring to ðN various operations near the end will have a # minsize of at least 2Gb (or it wouldn't reach Dð32-bit limit, soY" #|w/ñ be very useful) and a memusla1 (one¿P per „ç-unit, # if itçQonly /3ig îòat a time.) # # When run withk2ory¦ñ set, both decorators skip¶sYP need0ore©>àthan availablebbñaningful. The precisionbigmem…e«•ways passj!asî`, evenì÷there is much m€{1. #kbÊÑQscaleYp upward®fëEÖ.0B¬=±houserules:  - Try notHrð too many large objects. It's okay.!re¯à # refcounte¡semantics, doYRforgeÜÑ 's = create_bí2()'M@does4 re©ez¢ old 's' (6€exists) s°l well afteÍwIãvalue has beensðd. Use 'del s' bef‹ó“R callJú - Do *not* compare0 usþÒassertEqual, @In oüPmilarä" K–a lengthyÆ3�Âerrormessageü‘be utterlpBlessæ!du´"itr¯¿°ke sure whe{‘ a resultbàright contents’P becàÃ'�pÁá’ methods,$me,w slices3Éý»3for;0ind/‘, offsetsþ§ Csuchšpin addiëŸ9 €s. Anyth~<` probeï#e Æ…boundary˜HAepea³#anåÀ (say, a subù!ngéÐa small list)~+€aÍ'R, mak´2subwì†!isu¢a power ofK�2. That w…�int-wrappÙÔPlems x=õeasily detectedÛbDespit‚I,ssX±actually beð % c¯ÿ�er number!A, inšanormalQšà(5Kb currently¸!@ThisýI.¢€mselves �frequent3ing+BConsl›lle“£»qbased ožW™ped-in '‚'™ÇË0 bep×dc. Also…ÛQ-per-- sh à remain sane (šæ�n a few tvPand);Byour–Bðuses more, adjuñPst 'size' upward, instead. # BEWARE: it seems that one failing test can yield other subsequent as to #3ð as well. I do not know whet:ó it is due to memory fragmentation # issues, or oð(pecifics of the platform malloc() routine. ascii_char_ø™ = 1 ucs224ð(4 class BaseStrTest: def _test_capitalize(self, d!):&*@_ = Å.from_latin1oSUBSTR"a(' abcgUghi')2Ás = _('-') *k2 + F#0cap&'s.›Aðelf.assertEqual(/b[-len(HE):],L $ [\ ‚.lstrip(¶#),¯)Ip@bigmemK(: =_2G + 10, Ruse=1`r&_centermžP6.Y2izesù»/)#s)ç(@lpad¿F = r (-0 - gu)) // 2:!iffs) % 27|U+³ ’$s[)$:-}]g48.™“›–2#–Oount•_ó .óÜc‘m_('.')¯1s +G.Z /s.DœûT4 x3-i-ëZ j-0§!�endswithªJ� ªuTrue(s.“ ,'s)X2 ..#?+ sA2n BûIFals–e_('a')fx 6Á cŒå O¯expandtabsª þn$Ð tabs“ize = 8 õself.assertTrue(s.expandtabs() == s)-Udel sðslen, remainder = divmod(size, B6ize>ss = _('yp\t') * ER9 = �D¯àEqual(len(s), t& -Žw3p.strip(�‘'))), 0) ˆ±@bigmemtestÉâ=_2G, memuse=2W@def !`_find(C�!):Câ_Ëzµfrom_latin1cSUBSTR@abc QBghi'_@�sublen = á0;’').join([ ,^-V‚]8‘í>!s.Â}Ö ,U1(,X", ͦÖ+¯˜l,EP_('i'âNòƒ>ÃÄø å Ü? + o+:,mOj/-1ý!öxþ«Ã§Ó-×-Z> %~ nA(À$),�W�*�“q&#oñRaises(ValueError, s.7A  isalnum,h123456êaÖY‰}ÂŒ)àÀ s += _('.C') ñself.assertFalse(s.isalnum()) 'ò@bigmemtest(size=_2G, memuse=2K@def !_=@pha(X , /!):Fp@_ = Å.from_latin1ÒSUBSTR = _('z¨Qa') *W2 + 2AZË4TruÊ�)¥ƒ1s +b.\:`_digit,h123456§9Œz\:!_lower Rcharsêq'.join(~¼òchr(c) for c in range(255) if not "§.isupper()ú`repeat^™� // len(rU) + 2j#3 * 5+gíjgAd :`g_spaced Qwhite=i· \f\n\r\t\v°ù´4ize.<38„iÛ8jˆØ£:8!Otitl8!q4Ÿ"')¶€[_('A'),϶,µ]’P¡P‰9aŠ;R!lªõe’î,IYÀr»¶íža¶ :d aÊŠÀ) * size  ðx = s.join([_('a€'), _('bP')]) )ð self.assertEqual(x.count(:o')), 5-b-ñTrue(x.startswith^˜OA'))`35end1A½g!) ¿ò@bigmemtest(size=_2G + 10, memuse=1[@def &@_lju,Pelf, 2!):I_5 µfrom_latin1€SUBSTR =CP abc RBghi'`@Bs = '.f7ize[gÚs 8! +_ Ÿclen(s)¿¡ Æ`drip(),–!st<2½ê<Power(i}<�_('A') *uµs!.lXmI*ò ¸á*&/ïÌ+*r�*l´ó]Ydel s�°´ Š õ # Type-specific optimizationk÷if isinstance(s, (str, bytes)‡ª2pedÕJ"$N2Ois sâ&Preplaž :Bment%aO_(' = §M¹‰ §UÀR¢#s."(3”LO - 4‘EY rs[-10:]�þ 9/')è Å_rfindÅ &Ü€ublen = š0.;#')— Ó-«ž "s.ÃQÐublen + size ó + SUBSTR.rfind(_(' '))) óself.assertEqual(s*7ÿ), sublen + size9cB, 0,2,‚+I „?, 0ˆ ->:?#ÿ.count(_('.')), 0l -!-.O * 27z713) Ló@bigmemtest(size=_2G + 5, memuse=`@def %Ð_upper(self, 1!):HÓ@_ = Å.from_latin1í`_('a')›9ize"s.XÍáu= s+Aô01í%20î1�î_zfillî ×ò= _('-568324723598234'd2+.j7izeÝðTrue(s.endswith7S0') +¹_[1:])9 Ustart;O-0')/ M<ªÜtlQ0 - «×)ga# ThisBð is meaningful even ÓNà < 2G, as long"th*@# doC€d stringGÁ> 2G (but it\ñs more if both are $:1í2ÿ3(ÿoconcat ÙÚ îÔl L7 + 9  mÙ4Ÿ1“e Zt g*ΠH¹¦¹ §ÿslice_and_getitem% à Ũ0123456789¿‘8n =ñPð s = SUBSTR ó* (size // sublen) Astep€= len(s)%?100!,5- ( %Sôfor i in range(0,Z$- 6, %):j’öself.assertEqual(s[i], SUBSTR[0]¹.C:i +“96%:28K[::2sŠif i > 0·�‹a - 1:iI-3],ô= ò¯G::-3ˆð# Make sure we do some slicing and index ðnear the end of }å# string, too.„6- 1'-1“4-,`0aî`0d–:], _('')\,¯`?-1:ò ^º.dÈ;š -.bD[:])‚Z,V) - 56::5:-3O10) S€Raises(I¡ÿ Error, operator.getitem, s² CO + 1¿GC<<31Ö±@bigmemtest\â=_2G, memuse=2p@def ! _contains(k , pø@_ = Å.from_latin1:N =µ²0123456789'a6BedgeG-') ê…$s!�').join([4U , Ù1delƒœ”STrue(“Fin s‡%EFals&0* 2 *O0_('ºO l_('a')K! +a‰_9Ô»%0À_mpare¿ "s1{â*ùƒ•2ÄF7= sÒ¥*s2L@s1 +'À self.aóssertFalse(s1 == s2) edel s2ös2 = _('.') * size_elf.aM$À@bigmemtest(9ò=_2G + 10, memuse=1w@def &±_hash(self,j!):H™ñ# Not sure if we can do any meaningfulFòs here... Even0Iñstart relying on the exact algorithm used,Öresult will bý÷# different dependNî1 of@ÄC 'long int'“Gthis’üÀ is dodgy (tÀñ's no *guarantee* thatR÷two things shouldKghave aœS3, e rthey, iô0cur¿>ðimplementation, almos0wayŸ.°‘@_ = ªÅ.from_latin1Js4N\x007Ph1 = —&(sOv@?;1|}ÄNotEqual(h1,Yà) class StrT‚@uniti.£Case, Base1): ~‹Ò�Іreturn s0Ðbasic_encode_c6ð ize, enc, c='.', expected W=NoneX)if"vA��:try-†cµF<9blen(s.Âj(enc))¬wofinalli¬QsetUpâà# HACK: adjust0oryj+ðests inherited …¡ž½q# accoroÁto character2.'ä_kued = {}€for name Jdir(eaif not-.8pswith('æ'_'Ü1vcontinu(òmeth = getattr(type,Z^- Ç00 = K.Ï!úexcept AttributeError'ŸT� = ascii_W_§ *©*usÒ ^[M]ž×‚tearDownî�� ‰ S{.items(bB¿�sY=ucs4ç3ˆß’capitaliz­ “± +Bize)+Otitlz&uÀmuse=ucs4_chðar_size * 3) def test_swapcase(self, &!):#'+._)Qize) #ð6# Many codecs convert to the legacy representation first, explaining hó# why we add 'ucs4_chµ'Qò'memuse' below.ƒp@bigmem£(½¢=_2G + 2, .f=asciiNK + 1 enÁqreturn bbasic_.q“, 'utf-8'‘4G // 6– õ§€_raw_uni³o_escap»6tryÈdË^'.Búexcept MemoryErrorb�pass # ac'ïable on 32-bit­o5 + 70³Outf7É#PQ_4 + 54–Ç–_utf32<132'°Qectedc14 *)3 + ˆDo2G - 1Ë_ô@t', c='AØû# str % (...) uses a Py_UCS4 intermediateòú§1õj* 2 + ù õoformatèss = '-'ª®¥ sf0%s'Ê"s,Qöelf.assertTrue(s == sf!kdel sfIo..%s..M ñEqual(len(sf), )9]{öf.startswith('..-')ˆ.3end,8-..,´,·¸U//= 2@edge.€'.join(['P, '%sFdge]”hS~–s % '...'d)v ñ  “/Ôs.count('.'),Ê*Àunt('-'), sið+ze * 2) @bigmemtest(size=_2G + 10, memuse=ascii_char_!<;@def 8ð_repr_small(self, (!):`)‘s = '-' * ;6(s)òelf.assertEqual(len(s)S +·Rk +Ÿs[0], "'"OOs[-1%£.count('-'zRUdel s¯!# Áð) will create a string four times as large Çthis 'binaryJ5ð', but we don't want to alloc^ømuch more than twiceFðize in total. (WJa extra®™ 2est¹˜&()ã¾! =¬P // 5òbÌO\x00Ï0?* 4Ó^.\\ÔJ0-2(5^ 2y}ß 2fê!# xñ() calls encode('ð', 'backslashreplaceª€which itT²#” s ýñmporary Py_UNICODE¿ esentation9Aaddi Rto th[À# original (=tCS2) onóThere's also some over²W when resiz~ thPcii()3ult¬pthat is÷@take�úcŽ e.*´ª5+ 1¸Gucs2·+;9Hucs4;Œ;* 6Ò0uni¡Sò# Use an assignedêànot printable Db pointë¬0# I�;€range ofžö low surrogates \uDC00-\uDFFFB½@ = "5BA" Í š6try¾ƒPfor f�(ð,°$Xr = fÐ’ ­Ø�r), 2 + å f(Šs)) - 2)+d@HõTrue(r.endswith(r"\udcba'"), r[-10:]AÀ r =s None …finally:rr = s =*ð!@bigmemtest(size=_2G // 5 + 1, memuse=ucs4_char_$É * 2 + ascii110)U@def Rð _unicode_repr_wide(self, F)›Zñ = "\U0001DCBA"H³¯ *6+trÜ for f in (n,ŸeM2f(sª›ñ.assertEqual(len(r),í f(Š‚)) - 2) ‘H óTrue(r.endswith(rãþdcba'"), r[-12:]E¦Ð! # The orig†òtranslate is overridden here, so as to get thB‘# correctuõ estimate: str.Pð() uses an intermedigqPy_UCS4¬ # �Áesentation. xoZp …3j”Ç b_ùñelf.from_latin1ˆýòSUBSTR = _('aZz.z.Aaz.'b!]E = {3Àord(_('.')):;O-'),!a!!!Z!$!}L�sublen = ‘­œ`repeat&U»/6+ 2B2 = 9 *�2 sÕîaP s¼z"* r32s[:$#],ˆ p> ->:?#d.count¬#, ¦Ä Ýs-9!')æ2£ 7z7ð3) class BytesTk@unit".ÐCase, BaseStr"):%Þ±=Õ°return s.eni!("ÛB-1")BgE + 2k1Éç|¢1_deZ* Ww Wd% \#s.\a'utf-88ż¸�¦Ÿcapitalizc¿!._Ñ+?izen!Otitli&d$swapcasg Àest_swapcaseð(size) class BytearrayTest(unittest.ÐCase, BaseStrñ): def from_latin1(self, s):"„return b]±(s.encode("4R-1"))Mp@bigmemv›ò=_2G + 2, memuse=1 + ascii_char_¿e@def 71_de[‡ßŠ@s = .±p'.') * K³%óassertEqual(len(s.\¡'utf-8')),6¼¸!2)\¦¤capitalize1 ªQelf._Ñ+%*nOtitli&d$swapcasg)jé±hash = None-´split_large­PTupleŠ©œ!# %ðs have a small, fixed-ñ�d head an ûñ of pointers toŠñ# data. Since we'renòing 64-bit addressing, we can assume that thÕ#]Qare 8!s,ƒ)%us3 tå”s take up/•1per�.@# Aså ide-effectÌF§ClongO,ŽsÂqppen toÒ[0hav5 moéðhan 2<<31 referenceð any given object. H^G0use„1dif8pt types2÷s as contents in *CestsÚ6`_ompar��t1 = ('',ø/t2PTrue(D3= tØ‚Al t2ù KÍB + 1§ QOFalsR1¶K� # 'hPcaten¨ag into.Bngle˜òG‘slength,H)7conGa; ä separately, sP2theŽ!erwð still gets run eV ifK€re isn'tpory for’D@(but|L!lev_per know8 2#isG€skipped,óÒverbose mode.±¸bbasic_þšºtB/()¦ TtD@Qt + tšß9O * 2�Y // 2BÐ24) def tóest_concat_small(self, size): preturn d.basic4Qtest(- -u@bigmemñ=_2G + 2, memuse=24))@def &I_large}A•// 5 + 10ƒ^8 * 5†_tains‚pt = (1,Ç¡3, 4, 5) *$Ì%òassertEqual(len(t)Jq +²True(5 in t‘ lFalse({/ 0Pœ‘z‘Ohash1-0,ýh8"t1NÈadel t1†&t2>3–.AöU"= V?2))` Ïïindex_and_sliccáNNoneܘٿ'pt[-1], U& 5%b? - Q €Raises(Iðò Error, operator.getitem, t‘’ :“(¹+à �t[-5:], .O20:2^o25:-20b*–4 l 6:8I - 2<é8384)� ++; h# LikeEq, splitÿ1wo.zײnorepeatß !''õt@¿Ü»E_t * 29*Ö O// 2; ͸ åX ¸}¸} 1Gî²"12fÍD_}/_2Ï´;Àeat(size) ð @bigmemtest(size=_1G - 1, memuse=9) def %ð _from_2G_generator(self, =!):,0`.skipTZ";ð needs much morebòory than advertised, see issue5438"€T6tryaá = tuple(rangeÁ)0úexcept MemoryError?�pass # ac'åable on 32-bitÈJelse6•count = 0$‹Úfor item in t1ÀassertEqual(,!, L±*Y += 1d E({ +Ï/25Ð oalmost×”"…œ{§, expected…Ób# Like}Ñconcat, splitk1wo.& `basic_kO_rep™»a(0,) *³=²As = 6t�Q# TheR of al Ð0's is exactlÂÓree times the(blengthŸbHelf.blen(s)ÀF * 3y êïs[:5], '(0, 0') 0-5:*))* .?C('0'„)Dµ2G // 3 + 2Hñ8 + 3 * ascii_char_QŽˆo_small'qreturn ð ¿?ize“ Ž$0lar+µŽ cl5AListÙ@unité.bCase):E¶žñs, lists have a €, fixed-5�d head an‘ array ofJñ# pointers to data, so 8 bytes perÇ�. Also l*tPwe ma:#heK†Àold referenc²ño various objectkÖÍ ir,+FRmits.èq)2G("16®compareœl1 = ['']Ÿ/l2;VPTrue(BB= l2vxadel l2½ð l2 = [''] *Ó (size + 1) ö self.assertFalse(l1 == l2#edel l22°l2 = [2] * OJ$ð4# Test concatenating into a single list of more than 2G in length, ´[# andFa: ó separately, so�Ðthe smaller t›ðstill gets run even if there isn't memory forIDlargD‚(but we L0let(_qer know2#isG€skipped,òÒverbose mode.‹ def basic_­_H(v,‰!):H$l¢/[]£ ÃEqual(len(l)@ ?Ul + lf&9a * 2) ,p@bigmem¡là=_2G // 2 + 2,>fuse=24Ò+Ì_�Òqreturn ˆ?ize‚ }“}, £sinplaceß\«­sys.stdout³Ol +=‰,ÚòTrue(l[0] is l[-1]�'ÖC - 1. + 4ä) ì A_ô& L_ü A�@// 5x0R8 * 5†6_tains* 1,H}3, 4, 5-ó§q÷5vl‘ [{—/0P37+ 1K Ohash0û ðRaises(TypeError, N?, l/ Žÿindex_and_slice™ONoneœ —ù s'ª , T& /5]%ÀtEqual(l[sizóe - 1], None) ÿ'self.assertRaises(IndexError, operator.getitem, l, sizAàEqual(l[:5], [h_] * 5m,?-5:-O20:2\o25:-20`Ú? - “3 j 6:7H - 2;42 273]++65]) ø l[HzE = 5£_en(l)ö%-3Ê2, 5hŸ Ï.count(5), 1Ç‘ s‘?, 6DÅíõ7:] = [1, 2, 3, 4, 5]'*6= 26a\ M7[-7&#*, v ¤/:7˜U :7O ‹Ã;Edel :1'1'1ª4 u>-2:p—2p2p0nÞ1“m.:2nÜ1nKñ# Like test_concat, split in two.¼¡def basic_)prepeat(Î:'çl8ç%+VvFalse(l�2/''4 T ??l *�*×p@bigmemÓ(®°=_2G // 2 +÷ƒmemuse=2~+_þo_smallbreturnî7/‚}_large} À(size) ódef basic_test_inplace_repeat(self, size): ‡l = ['']!*=%8ó.assertEqual(len(l)K'õTrue(l[0] is l[-1])'edel l €* *uel *= 2'„ F * 2a+ˆóH - 1�Zp@bigmem-(%ò =_2G // 2 + 2, memuse=16]^+ Xo_small^qreturn “™“’�_large�4ñ¶OreprZÅ,0]ÄAs = 5lAsQ# The  of a list 00's-òexactly three times the'qlength.»LW ™s™F * 3w +ïs[:5], '[0, 0') 0-5:*)]* £.count('0'„)ÕI// 3gð8 + 3 * ascii_char_”›‹|Pr 7ã“ hŽs Ž#àðoverallocates ~1/8thQtotal#ñ (on first expansion) so#.Rsingl5ó.append call putsÖ€ at 9 byj1perZZƒ 9�^�object()lš("ZØq/+1)ë$-3å2tþ@Falsœ$-2)�<ù5§2* 5ƒ•øf ` 1,O}3, 4, 5 8 `I1G+s"1"), 0Þ™¹oextend¥ ™#l.:À‚ ‰ RÅ÷°/+ ¨Àze=_2G // 2 ñ'+ 2, memuse=16) def test_extend_small(self, size):'+preturn w.basic_9(- -p@bigmem_=_2G }_large}AI// 5‚[8 * 5_index~pl = [1,@¡3, 4, 5] * ñV *= 5òelf.assertEqual(l.cR1), 0}:(5ƒU - 5) 198? óRaises(ValueError, ­2, 1C -øæ�B "6)a# Thisoñs suffers from overallocation, just like-�_append.Z]%10Û9¡Ú inƒÙ -.0Ïÿ7Pize -2"A"ZµA+= 1• ÇCen(lz9 'ó[-3:], [1.0, "A", 1.0]4Z Œ+ŒBŒK‡_, "B"Œ_1, "C…D&:3C � X[—2 - H¼74;?pop<p"a", "bcd-e"P¢ 0X�item = l.‰H�-�1aH, "eÍ¥2¥"æA¢Ù£=a£ :27�¢‹?- 2LHc© -L7d`¤'+ Û8´Û_remov2´À0] * size  ñself.assertEqual(len(l), size) %õ l.remove(10)$V -= 1Oö # Because of the earlierhõ), this append doesn't triggerq`# a re‰."l.5+(5«+«ù!æ[-2:], [10, 5]c# w"w310]œÀ@bigmemtest(ó =_2G // 5 + 2, memuse=8 * –@def .�_reverse(áï:C` = [1,C@3, 4é! *#.BLN„å+1[-5X5q3}1`2 :5‰ 1£'Osort(?4….count(1�:  10 Y1] * ¥ “B[-10j, bmain() ðsupport.run_unit7ö(StrTest, Bytes Qarray¥QTupleP List ð) if __name__ == '__t2__'u0if ƒÒsys.argv) > 1S“Ôset_memlimit(,[.©V(pmÅ Áð class Exception—TCase(".Qtry_e7Ñ_else_finally,,¤3hit'… = False?lseO66trybVraise†('nyaa!'u¦ 5|¾f = Tru–Í,¨ *£-Z»¨I(…­$P%SJ$ls¤¥ 3_no•?ion²_EpassžgÀ True ó self.assertFalse(hit_except) %2Tru$finally% aelse) HÃdef test_trya_D(`!):'rƒ1 = – 66tryEIqraise Eζion('yarr!'´é 5 ~ï`y/1 = 01Ø]\J:3_noLßoGAApassŠT3Wú47fåJOahoyJa«%õíH³ ÎÑ Mº¡&» �®„?lseä!?foo™u¨àÝ  ñJ, + Ø)­”{‹1Hb%*‘†'I%k!(A 7Þ ã, ùonested1­eSinnerå! C:D ùÀ try:  ô raise Exception('inner e5') ,# : Ahit_:_:y = True(finally= # > :s0o°self.assert‡(,ŸÕ*\+ %{ðdef test_nested_else(b)»‹v = Fals#OY7Û<!5lse±»+tr“ &Epass3�ØÇoDœ: ©» u ®?out® œ –’,ˆ¼£ ¿-Z¸Œº�" ŠS#Gu¢H% ò ) if __name__ == '__main__'û@unitì.ñ() """This is að""" from __futurIsimport ƒscopes; `site E3f(x33g(y…Áreturn x + yeòg result = f(2)(4)¦c up�  # Skip t³!pf _tkinPòdoes not exist. s6.¨”_module('0#')é@.QëPruntksÛ J(Ô]Drun_U(Ùî*DP.get_Cas(gui=þÐ, packages=['_ttk'])Ä-À܉ pickle _toolsLäK.= $err‘AbstractPYTTests^î÷ class Optimized,(@"):Qdumpsdó, arg, proto=None`B# Ï#.om(.IC?;eDloade¿buf, **kwdsa.0*± # ð relies on prec€¢output of ‡£I_Ÿ�_to_2x = ÙMðwriting by chunks into a file object. tôest_framed_write_sizes_with_delayðr = None def t<ñ optimize_long_binget(self):)-ùata = [str(i) for i in range(257)],õ.append(data[-1]);Vproto?÷ pickle.HIGHEST_PROTOCOL + 1ƒ‡*Bd = a.dumpsf!, Vi0"un(2cloads( .ôÕ.assertEqual(? , É.&Is+î%, :R[-2])q‘|2Ædtools.‡œQ7.Ë2ž Ì2Í2Î2ÏÆ5SNotIn¿Ó.LONG_BINGET,®d¤;)PU;C¶übinput_and_memoize½qð = (b'\x80\x04\x95\x15\x0'sêÀb']\x94(\x8cI“spamq\x01@3ham!†h\x02e.'˜#B00: ƒ æ5 4g"2"‚95 FRAME")21#P11: ]ªEMPTY_LIST Cš4 MEMOIZE@3: (=JMARK4z 8c` SHORTÁ�UNICODE 'é«Q20: q.‘ BINPUT ®2ŽW;hamV7‡!94KÂQ28: hw"GEw2ÎT30: e&pAPPENDS(øj at 13›P31: ."ESTOPKàÝìØH§Ý ¦*X ¡2, [l0, 'D< {(1]z y>u Ê3 ËÍ� Ì2Í&)2[Î 2[Ïžq : ˜ð 2) class MiscTestCase(unitû.g]l_all__Hõ blacklist = {'bytes_types',/žÿ'UP_TO_NEWLINE', 'TAKEN_FROM_ARGUMENT1>-4EÀEN_FROM_ARGU¯MENT4U', ð'TAKEN_FROM_ARGU.ÿ 8U', 'ArgumentDescriptorD read_uint192Eint4 )4L81�stringnlŸ_noescapeN @/[_pairN1DÅVbytesïÕ $Ötunicode� -w  ,‡ÿdecimalnl_short‡ -ElongBWfloat 8K AÉÀ2, VQ• ÕP!Ç # „ᨠ  •B N &Q ¯Ü& 's£Â� O2‘ ˆ¯StackObjecNPpyinty pyM áinteger_or_booï&py ‰²!pyu=!stÝ"pyœ] PKBnone,Ctupl 3lis³ diÛo 'pyseä afrozen$c 'anyof 'marks2OslicÉ Op-@Info˜os ?2opÍ}÷ðsupport.check__all__(self, pickletools, blackì= ñ) def test_main():XT€run_unit!±(OptimizedPWoTests)/@Misc$NCase'1docU£Žñif __name__ == "_—2__"˜3P() im÷ Ÿdshelve‘glob fromä 4ßôcollections.abc$âMutableMapping+.D_dbm)Âdbm_iteratorOCL1(sI°return s.deÑñ("latin-1") class À0key|(uD"„ð that supports ñbytes keys" def __init__(self):x.d = {}-sgetitem0,N5rreturn <˜[L1(key)]@s@w, valueG @" ="H?delˆ?del… 3lenÁu¼1len 6.d)p@iter84tfor k iò.$ Ió yield k.encode("latin-1"_ __]P__ = Bx t¨1ist.7#()S×AcopyŽ:ckeydicBëô class TestCase(unittest."):˜÷fn = "shelftemp.dbNrtearDowC{)f)Pglob.�w.fn+"*")2÷support.unlink(f×’a_close@9"d1¬A@s = ¥@ve.S¬ö(d1, protocol=2, writeback=False)úö['key1'] = [1,2,3,4]ôelf.assertEqual(s/,.M /`G), 1$.Ò6€Raises(V#ÖError, len, s.6try¸ü“¶vexcept F 1Fpass,:lse�pfail('C|dZðf should not find a'¯°ascii_file_‘fºª$op~'fn®0ìC = (®/M ²23lfinallR£'b‹obinaryÝ* ÉÝb.2Ý*2XÝ|Ÿin_memory•O *ʱ[­¿VJ˜sƒÕ_d2 = ¤ Àve.Shelf(d2,ã protocol=1) ÷s['key1'] = (1,2,3,4õelf.assertEqual(/,./–.close() ` B˜len(d1), …%2%#No�äd1.items(), d2 õdef test_mutable_entry(self):¡÷d1 = byteskeydict(Ðö = shelve.Shelf(d1,F÷2, writeback=False:W[W]tƒW.M—.append(5 ;¢K¢/d22?Tru…7,5]1 �¤Úp½keyencodingnQ = {}/�åkey = 'Pöp'ç# the default O• is utf-8+ ŸP)[keyË/[1nqIn(key.ž1e('K'< ÿ# but a different one can be given|,©¯='latin-1'“78, d•öwith all consequencesŠ © Žfascii'QóðRaises(UnicodeE¹ðeError, s.__setc!__R\, [1]`a_also_Ís_immediateltÅ# Issue 5754Äd6key¸d6ÉLs—¬ «4p&d[q‘] # Willa a Key&@ if Vöing store not updated‘$']Â2‹‘p’ }Hïp•!2)¡�ò creates new object in�™ªV £û¤$V as sbÓ–5 = —Ö"Ú k263¸s6À self.assertó Raises(ValueError, len, s) Etry: •s['key1']vexcept F 1Fpass,:lseñ!self.fail('Closed shelf should not find a key') Kð def test_default_protocol(O)bAwithQ@ve.SX–({}) as s$Ö†åassertEqual(s.T¡, 3) fromtð import mapping_ˆÐs class TesthyveBase($`.Basic"M;Pµ°afn = "þ�temp.db"í±counter = 0ý�__init__ðÓ, *args, **kwMÕv_db = [¯”.b†Ptype2ü) =a£‘reference¥˜�return {"I@":"v€@1", B2":2 ¶3":(1,2,3)}Ucempty_Ä Y0if Š._in_memãx¨ð(byteskeydict()=<Ke±”1+=1›ndAopenŸr.fn+str 7n‚¶db.append(x‰5xp`rtearDowf^“for db in *db@db.ci(\w )!if~RjfiPglob.ægfn+"*"“0sup;¨.unlink(f)7’AsciiFile@() KN_ž4={'ð2':0ó‡ = False�oBinaryY1Y ¿2Y2Y  2Memþ &>TruW  WW W Ùƒst_main(õh`modulemÄdbm_iterator"]€run_unitœ(.R\´,! /"òD eBd!c!ECase»ñ) if __name__ == "_A2__"ü à() # CopyrightðŒ (c) 2001-2006 Twisted Matrix Laboratories. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associaˆ documentatròfiles (the # "So40"),iÄdeal in the ð without restricF‘, includiˆ!ClimifA`rightsWAuse,¬Á, modify, meÝÐpublish, # di_pbute, s0cen8°and/or sellDAies ò¢,ò`to # p[t1son|JwhomÐÀis furnishedžQdo sotQject HÀðfollowing condiø!s:Á�The above‘yèr noticeŠŽŠåpshall bx> edl1copØrúÁstantial poru ðFðdTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO sMð`IES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS¤òCOPYRIGHT HOLDERS BE # LIABLEoðNY CLAIM, DAMAG¤qR OTHER'¢1WHEàIN AN ACTION #àCONTRACT, TORTu=ðWISE, ARISING FROM, Y OF#„IN CONNEHw¼ž!OR0USE0S� DEALINGSøX-ò. """ Tests for epoll wrapper ims errno $os eselectEockeDtimeÀunittest if¾’ hasattr(A1, "{ä"): raise 5P.Skip¥ ("Dò works only on Linux 2.6") tryBX.Vò() except OSError as e(Qif e.Ý2 ==ær.ENOSYS Ž òkernel doesn't sup,FF()")Ì€ class ÆeEPoll(ÝqCase): 0�def setUpf‡Áself.serverSiA = s .(q,ÿ.bind(('127.0.0.1', 0)1 lYnTQconne—]s = [”]ÅŒtearDownÈi0skt�?StŦkt.close()V_/aed_paiA%oclient!ö.setblocking(False D„3y EÖ@.get�—name()[1]f‡gNðassertEqual(e.args[0], errno.ãEINPROGRESS) Uelse:ñraise AssertionError("Connect should have *'d X"Yòserver, addr = self.õSocket.accept() ~$ciòions.extend((client, @)ezreturn Qðdef test_create(])ê6try ÷"ep¦Æect.epoll(16i ex­1 OSO as 6Wstr(e¯„!.aZ÷True(ep.fileno() > 0, | 60not)fclosed'1ep.( :#6#Rùqs(Valueç�T if hasattrS÷ect, "EPOLL_CLOEXEC"fY6selT 1)¸ 7oflags==*0gf“än¹", ƒS12356³b?bade]4Typ\Îl–, 1, 2, 3h<_'foo':"ONone9"(ÖCæ[«]s",{}xácontext_manage�f}@withx~116)»pûkG-rš6, 0°š3AFalsÇzWê#7z m0addyé,Ç3f._Jxed_pairiì2ãq.registcÖ¶%ÑDIN |q6OUTX;&epKµK"mfinallÁH2p# ing by objÁ2w/ tÅ works, too.1-/BÀ ep = óselect.epoll(2) Etry: ð2# TypeError: argument must be an int, or have a fileno() method. Eõself.assertRaises(]ù , ep.register, object(),�Hº¨EPOLLIN | 6OUTÌ.rONonen-d# Valu. ò descriptor canno7� negative?�eger (-1º \ -/-1¹/#OSäÑ[Errno 9] BadÏÄ ŽÎE Ÿ_10000¢/ñing twice also rIŠ™exception¦WP(serv^3D!è^ ~„l²kfinall‚±ep.close() [ðdef test_fromfd(‡)µ†@ cliª= ôf._connected_pairLŸ1ep %¤ ;ep2.w0ep.áì™M2Æo',‹f 'epHËH*‘pvents =_íF1, 4jeär!90.9#`µ¢Equal(len(87), <)2*–Ô¥ z‘ ²æ ƒV as eýI ‡Àe.args[0], eÜ—.EBADF, e/lsFafail("A on ‡²d fd didn't| O"žücontrol_and_wait¨Õ”e¨'16Â> xw YEXRÆ›k4G÷now = time.monotonic(ö¿ÞFthen?Ànotonic()  öself.assertFalse(then - now > 0.1, 1) 5ö events.sort()õxpected = [(client.fileno(), select.EPOLLOUT),8V(server8]8epˆ×bEqual(°$, 2 Ëð = ep.poll(timeout=2þ2max<&=4è_6#Uýèsend(b"Hello!"Aäpworld!!!Â� = ‹¨.monotonicj€µ71, ¡´? Á1÷'01ÌÝd¤JìOIN |ý2I=Ìp.unregisterÄÁŸep.modify¯Ó‚9½q8X ðdef test_errors(8%): vÐRaises(ValueE-(e�F, -2v84().ÅO, -1kÇ š#INøÁ ~_closedÌË", ò =Pqf._conn W_pairºf s"epA(6(16ÿ%epÕw®É1xÞ0úe[#fd½k0ä+Popen_D0 = !(_y__, "rbSÊ ddCleanup(-+.XF�\ „|cufffd\_8b10"m F"\x}J VP‹Pignor• uŠ)½"PThis  ñor everybody to addŒ²@bugsGñ t aren't # fixed yet. Please3a5! cðnd appropriate bug descriptionô # When youP¡ one of th-Bs, pZ0movÆe]!to"`correc‹P€_ moduleV " ZKÆ"NoXµïpoutstanѶAs atsamomentc/µÂ_compressionñ$ioï³BytesIO, Un CedOp�ô, DEFAULT_BUFFER_SIZEé$os upathlibTickledrandom2sys‚?„y$$�.#2ÅÃ_4G, TESTFN,_‘ð, bigmemtest, run_unitðtest, unlink ) lzma = import_module("€") from  ñ LZMACompressor,;Dec4ErrÖFile class :4ÐTestCase(unitŸ. ): #  eWr cases.@def 2ñ_simple_bad_args(self):=A÷.assertRaises(Type§š_, [])9#¿format=3.45B$�check=""?$—�et="asdfD%–filters=3„ô# Can't specify FORMAT_AUTO when Oing.;OValuu<l.`…"a îâ and a custom ¾ö chain at the same timeœ^with ¡<@ ÷(z3=7,p‘s=[{"id":,€.FILTER_5B2}])«Gr ‡F, ()ÿ;×memlimit=b"qw ù‡ø”( 6RAWG"zzzh3&no4‘a memory — ˆ(?RAWš+¢  A0x10V§U onlyÝK°˜E¡"s=üvS_RAW_1‘hT ¡ H&XZ§wX_ALONEz'Qlzc =H„( ¬d, lzc.|3 €, b"foo"7bar¿vQflush87lah9qempty =š$Ë +ÌYGquuxY’ =om3lzdYÐDecompressor(3) ÿself.assertRaises(TypeError, lzd.decompress5"€, b"foo"Fbar"E ]f(empty˜?EOF—Zqquux") Öð def test_bad_filter_spec(S!):$ýúSLZMACø Hïs=[b"wobsite"]­ DValuFLÏ{"xyzzy": 3}N1¨id": 98765O^with í¢ ¯(ú!{"`Àlzma.FILTER_+12, á?: 0vT_DELTAv^:X86tIm'Por_afuVÆm# Test+ö on known-good input data.ý_þáØÏ,-ð, check, unused_AG=b"" c`False(š6eofï[out =#(J#EÿEqual(out, INPUT%j +?Tru” qLå òjÃ1uto7œ  Ylzd, ò�ãma.CHECK_CRC64ŽhQkÀHECK_NONE) ð def test_decompressor_xz(self): $·lzd = LZMAD)õ(lzma.FORMAT_XZ)/>-._Yñ(lzd, COMPRESSED_XZ, DÑCHECK_CRC64) Gš_alone� _ALONE 7 £NH¢_raw_1¢ ÿ RAW, filters=FILTERS_RAW_1·7·2·92·#2·3·93·#3·4·94·#4·ochunks¸’�out = []6Nùfor i in range(0, len(W), 10�7V°assertFalseOF.eofj&¡out.append Ù a–[i:i+10])>¨Æb"".join(out|PEqual, INPUT%™lzd.checkhç­[?TruÖ!|Wÿunused_data, b""7 ¹o_empty¿¦7b''­:ë,E ¤C ÀertEqual(lzdñ4.unused_data, b"") def test_decompressor_chunks_maxsize(self):04·lzd = LZMAD5%()!õmax_length = 100‚out = []|Lõ # Feed first half the input6õlen_ = len(COMPRESSED_XZ) // 2'öout.append(lzd.Ñ 6 [:P%],8‡È= )èÁ.assertFalsexaneeds_Â*`Equal(ͧout[-1]), ^àRetrieve more »P withF’providingoÒ 8b''n×w_hile Õ$ [Þ:ß=OLess¹!`remain§$un`!edË®wü@not ·Eeof:—Í,C¨Éi=-Ÿ.join(outÒ¯out, INPUT%âÿcheck, lzma.CHECK_CRC646 À\buf_1¼°# Test reus–)ð buffer after mov…existingŒð# contents to beginÙ N ýSCreatð‡nFll i‡â ?100 ~ƒ=0), b''%# †ðsome results, free)¿capacity atB# ofÏß0Ø )2)…2Addêéthat fits into`Æf#Ð|Â’ bÊ100:105], 15¦(tü°Žb?5:]iÿ6b''”whÒÀecompressor_óinputbuf_2(self): ñ# Test reusing )ð buffer by append·data at the=åend right awayõ lzd = LZMADecompressor()!•out = [] Š# CreateƒÅand empty it+Ãõ.assertEqual(lzd.diõ(COMPRESSED_XZ[:200],=øùmax_length=0), b''¶. s')ÍDFillH�with new D‰?outM ÀÉ200:280], 2)cAœ¡ some more_ö, not enough to require resizº}@80:3@ }Ø[At ofÞf300:])c Üób''.join(out), INPUT–def test_ü1or_Ãì3ì“after extï&itÎÎ)¹almost fullÚ)Ç+ 5vdd evenõ3it,ùºû%0û tû‡punused_g üÄõextra = b"fooblibar"¥–_l), ¯ +Eÿra, lzma.CHECK_CRC64ƒ¿=�è 2badìëÎ@pRaises(ªPError·L ÞSRAW_1”@TùŸFORMAT_XZÛw_ALONEw3¥ñ%¾îóRAW, filters=FILTERS_6ˆŒ.ö•bug_28275À # Tesó t coverage for Issue 28275 õ lzd = LZMADecompressor()!ðself.assertRaises(-ÅError, lzd.d8ö, COMPRESSED_RAW_1Gÿ6# Previously, a second call could crash due to internal inconsistency•5H±# Test thatCþ ->ã ñerves the input data. Lðdef test_roundtrip_xz(;!):!n3lzckkicPt = lzc.Š‘(INPUT) +Wflush2¼_™¦�or(lzd, pÃÿma.CHECK_CRC64)Ò_aloneÕölzma.FORMAT_ALONEvæjN�–·?rawãñRAW, filters=FILTERS4ø@\y….o_empty$]¯E@+'qmemory Ÿ �³?RAW),ªA0x10 ²W onlyòå»LŒSb&_1¦}œH &XZÈ{D •ÿY_ALONE“KIß_á T7ALZMAYÿ °COMPRESSED_)f 1eÀs(LZMAError)7: ùlzma.decompress((ñCOMPRESSED_XZ, format=;aFORMATåmemlimit=1024)Iÿwith self.assertRaises(LZMAError)‘+_ALONE” —˜p# Test „Düñor on known-good input data. 7–def test_1_*_*(åÎd:1 = (2(N(>#aEqual(@‚, INPUT)�‘W úZBÿÐøgBÁ,:jm7ÐO–ZRAW_1~ñRAW, filters=FILTERS_(“W2“2“W3“3“W4“¢zû in7OleteX õ¥', ��XZ[:128]6K7N6òN,BJ !Aå—2—;E—3—;I—À, COMPRESSEDÿ_RAW_4[:128], ðformat=lzma.FORMAT:ð, filters=FILTERSA_4) Jñdef test_decompress_bad_input(self):)vPwith ÷.assertRaises(LZMAError+/‰Xÿ(COMPRESSED_BOGUS)Y@+1YAALONE, d/XZpA/XZm‡pX?RAWs  ]1]Ä# Test that ^G()-> ) t¡erves the xk data.¡œroundtrip–c.1 = ogVINPUT)d%€='ÝaEqual(8#, N±7t,‰�L5„X 4‡eK/4€œ ZOÏ�# Unlike ÇDGor, ¤ü) *does* handle concatenated streams²?b_multi' ¿ó.WXZ +  Ñæ J * 2�brobustɰing of non-ÿyp follow’Rè?(s)êßtrailing_junkì0 *ì èÔ�_£0:* 3“§ò * 3) class TempFilegð"""Context manager -ð creates a file, and deleðit on __exit__.""" def __ina(self,=ñname, data=b""):,0#._"% =- !9! =@gqenter__hT‘with open^Æ, "wb") as f�…rf.write/l)fãw, *argslaunlinkiô) class FileTestCase(unittest.&):g7KaÍ@LZMALÿ(BytesIO(COMPRESSED_XZ)ÔEpassEE)=x=)a=¸J_¤_PathLike_1 -° = pathlib.4�(TESTFN)XñNQ TempU6*, W %4‰4{bØö assertEqual(f.read(), INPUTŒ.\?, "%3´Nª%G * 2 “ ŠÒb€`2´  o�=Þ1B�BR ª2modJ Å ‘Â+r"(,{ =b>)w=*{*a{)a{¯;?_x_¶Ä¢ddCleanup(ì", _Â@for @Í in ("x", "x„= ŠÂƒ ½Rü«opRaises(Ú¿ExistsErrorJwÀ, mode):  `pass ñdef test_init_bad_mode(self):"&Pwith ÷ .assertRaises(ValueError,0ÿLZMAFile(BytesIO(COMPRESSED_XZ), (3, "x"))cG/""]I/xt_K+_J/rx_Jw_Kr|Kr|Kw¾Kw¾KOrw"):_check;?Typ:�), "w", ]g=b"asd¼ó# CHECK_UNKNOWN and anything above!ÿ ID_MAX should be invalid.� Ëã ©Ylzma.œŽj/å6+ 3mò# Cannot specify aK ÔíO="r"ë'¹FNONE ‡[9 p_CRC32q\/64qYjSHA256rÀ self.assert÷Raises(ValueError): ñ,LZMAFile(BytesIO(COMPRESSED_XZ), check=lzma.CHECK_UNKNOWN) H÷def test_init_bad_preset(selflPwith s.assert˜?Typ—‚), "w", ^a=4.39)�Ì]Üô ]/10[F/23[�Overflowº!/-1_K7_Ñ%V"foo"^ó# Cannot specify aú ìŸmode="r". ø'i3èpfilter_¡íEcæs=[b"wobsite"]$ Só÷gÏ{"xyzzy": 3}iL¯id": 98765jAèÕpFILTER_,12, ‡?: 0•s_DELTA•}:X86“m › S_and_z( Rormat¦±FORMAT_RAW,šÿ Ú36, —=S4,_1ñ_closeº3z as srcg@f = ck6srcÆ–"f.e #2€ should 2ð the underlyingÑðe object.  òself.assertFalse(src.closed) #`# Try ðing an already-Éed LZMAFile.6fL(Lu @ÿ$# Test with a real file on disk, opened directly by†?@Temp�õ (TESTFN, COMPRESSED_XZ):tì5f =H1 ¿ªfp = f._fp8ìu# Here,R%‘ *should*TÐe the underlyaêZbjectR<rTrue(fpR¯<Ú’def test_ä(|- )ŠBytesIO(Z9:trygM z, É f.gA <kfinallt'N†ON ço), "w"ß+£3¥3/no¥FòRaises(UnsupportedOperation, f.~Ýa¯ValueErrorWÏ@ šõdEqual(â ()—3_fpò&()ô9=©IsInstanceB:int7/L³ 3 Á�seekable F?h È ?š!) ]ëÛ)\·Gdsrc = ° rÜÉ—ð = lambda: False  ñf = LZMAFile(src) u try: öself.assertFalse(f.seekable()8kfinall<†f.close('NöRaises(ValueError, [!) …Ñdef test_readsA)¢ É÷BytesIO(COMPRESSED_XZ¤Ü 0TruÛh7 f.ÉŒ?4€€ýf), "w"rõ Ñ\Ñ@[·Ñ@writÏ(EÑAÜiÒ@ Ó4›Ó2‰[Ò@[¶Òê ÎFwithi V as fÓZdEqual(€v, INPUTß. 'b" ŽALONE))‘*eðXZ), format=lzma.FORMAT«y* @¨%«wqRAW_1),0 iòRAW, filters=FILTERS_FÖ{2Ö2à2) as f:  òself.assertEqual(f.read(), INPUT) (.6b"",ùwith LZMAFile(BytesIO(COMPRESSED_RAW_3),]cðformat=lzma.FORMAT1ð, filters=FILTERS™_3) as f:K¨ÖM4Ö24ÖO1�def test_õ0_0(9)LÈ?XZ)ªO0), )_ALONEdL_XZ), t/XZÜQ{÷ÚZ×1Ø6±chunks = []h­¦while True<“result = Z&10( rif not +C#Ybreaku°¿BLessÃBlen(K?), oÇt.append+ \XT’b"".join(<7 G¿multistreamQ O * 5ñŒ9�»7 + “sòy2Ôyü? * *3"~ ,»ü_buffer_size_alignedÏò # Test the case where a ýñ boundary coincides 01end€¬A# ofE@raw Š |."Xsaved’õ = _compression.BUFFER_SIZE5 !ÀER_SIZE = león(COMPRESSED_XZ) Etry: úwith LZMAFile(BytesIO>Ê * 5)) as f=Aöself.assertEqual(f.read(), INPUT * 5€kfinall„ñ_compression.BUFFER_SIZE = saved_buffer_size ¾�def test_kð_trailing_junk(‘)¨á'+ /_BOGUSïZë )�¿multistream©/O* 5 ­4˜N`from_fð JATemp+xTESTFN,:'XZ. |2H%DZŸ�?b""�Ü_› _bïìLname: , /2 = Òö.encode("ascii"© except Uni E&VErroržÈ skipTest("b`orary … š÷ needs to be ASCIIfÊ 5—$ ÖŸj in =letŒå§ o[:128]¹ ¡Raises(EOFŠ", ¯.œtruncatedr# Drop Öñ footer: CRC (4 P�), index ´põ£# flags (21ö and magic number.6’* =ye[:-12](/>%&º`, )Alen(*)3Blç½6, 135# IF@ 12-�v headerHÿfor i in range(12¹ @?[:ii°¬ ÈŒbad_argso?f =£ ð)) f.clocse() öself.assertRaises(ValueError, f.read.õwith LZMAFile(BytesIO(), "w") as f:Za^1ïCOMPRESSED_XZ)f:Typñ, float()) ¡�def test_à _bad_data(°)Ãï‘_BOGUS”7 W‹1ƒ±blocks = []fަwhile Trueçƒresult =÷1'rif not *B#Ybreakt�‚.append(@X"|ŠòEqual(b"".join(Ì�), INPUT6 ³1•?b""ï?1_0f5 ´~O0), 1€6æ,*10S�賿multistreamò O * 5Üv2t‚ó ¼âá PLargsu>f =>OÌ~_f.clo¬1X¾­+_ Î ®|1, None½LpeekSå †Às f:  ðresult = f.peek() òself.assertGreater(len(5O), 0/ôTrue(INPUT.startswith96ñEqual(f.read(), A.Dù LZMAFile(BytesIO(COMPRESSED_XZ)) as f:ǰå1¸çi´�def test_� _bad_args(Š)Ö o), "w"?ÉóRaises(ValueError,ü*) ��iterator|}IãrQlinessÍ]ÀÊÈBList0Plist(®a(f)), l5_ALONE8nAðXZ), format=lzma.FORMAT»º‚Að…ˆTqRAW_2),uq#òRAW, filters=FILTERS_F³+ƒy°øy1forØ1 ins 3+GK âê_ãyÌsÍsÎüdecompress_limitedÂE"""D%ó ed data buffering should be @1"""cqbomb = ³hð(b'\0' * int(2e6), €Fet=6€˜ALessAMD), _Ióion.BUFFER_SIZEÚwÕ. =÷Dgÿ:KA1), ¬À) maóx_decomp = 1 + DEFAULT_BUFFER_SIZE òself.assertLessEqual(>ô._buffer.raw.tell(), ma],DKò"Excessive amount of data was Q‘ressed") :ðdef test_write(‰!):Pðwith BytesIO() D&st#ñLZMAFile(dst, "w",f*."f.heINPUT)hðexpected = lzma.;¬(,§0,°st.getvalue!McË&‘, format=–ŸFORMAT_XZâ>h %ùn_ALONEüSkÿ{:RAWrºÿfilters=FILTERS_RAW_2.Sš ¤ ¥h%8 F?_10IOó or start in range(0, len/G, 10Éÿ „[E:F+10]13G”<4lappend8�part1 = q[:1024]>ž2Z:1536!3!F536:Ü‘b"".join(ãy x)û xc(m01, 2&3)-^& p1h÷l rarI2I53I–ÀtEqual(dst.gñ(etvalue(), expected) def test_write_to_file(self):"&6try  with LZMAF.úTESTFN, "w") as f-1!f.au(INPUT)Y’ÿ = lzma.compress,xUopen(t/rbuÆú.assertEqual(f.readƒkfinallècunlinkm3 _›a_bytesC?namG /2 = Öö.encode("ascii"/ except Uni E&ZErrorqøðskipTest("Temporary Ü š÷ needs to be ASCIIfî µöäoappend0�part1 = îu[:1024]ô2Z:1536!3!F536:.šb"".join(7Ðx) for x in (m01, 2&3)Pê Žâa1YQ$a¯$L2L83LD{Œbad_argsx6f =BB\ IO¾iP†f.close(æø€Raises(Vÿ*#, gw, b"fooø ±oÿCOMPRESSED_XZ), "rÁt?bartgLgLTypeÚFNone�8W"textž:?789Mline×i`I7;2 = µä Dv8dstÀ with LZMAFûile(dst, "w") as f: Ñf.writelines()$úexpected = lzma.compress(INPUT,ðself.assertEqual}Ô.getvalue(), M!) dðdef test_seek_forward(F)© with LZMAFÏÿBytesIO(COMPRESSED_XZ)Ý f.VO(555¥ `f.readŸÓo[555:]¢ ÿ_across_streams± O * 2µ 3len`o + 123Â?123 ÿrelative_to_currentÇ ÃO:100¶�z1236, 1ó 9 ”O1336Ó/enG=-555, 2·6·Obackï;w \x+21t?211¼  JÏ +33 Û?737˜�737:] + ñëŸ_*W@?150W ?150›_past_¨? ˆ?900L@tellT:¤?b""”ÜOstar¬8$?-88�Ð ÖF É}bad_arg:?f =ê9Ćf.close(ºŒÀassertRaisesó (ValueError, f.seek, 0) õwith LZMAFile(BytesIO(), "w") as f:,3ÿself.assertRaisesa#ïCOMPRESSED_XZ)i(6, 3Í¡ñ# io.BufferedReader rªB Typ Æ instead of è (?,5)VZ9, ()�.EŽONone7 ‘b"derp") ¸àdef test_tell(x)¹å„qpos = 0a\¦while True`w�Equal(f.�j), posä0ûresult = f.read(18Í%rif not ,t#Ybreak¦¾r+= len(= �­3WINPUTÏD)0forõÁ in range(0,‹XW, 144¢°•B�f.write(Vß[pos:pos+144]í"D Kœ_bad_argsT>f =8 SO׆f.close(•éH8ð ) class OpenTestCase(unitë.+):½binary_mode¸È•lzma.openò º_, "rb ã»1), „âiQK:bioÀ#Œ0bioxyGîj±ile_data = Rðdecompress(bio.getv ¢ÐI Ñg²a²{N * 2/xt$un(Bed =Å.=¦de("ascii"j-x_raw = ö .replace("\n", os.linesepB A t‰Àed) ÷ with BytesIO() as bio: #ñlzma.open(bio, "wt".f,7ùf.write(uncompressed)RÁfile_data = Y$de+_Ð.getvalue()).ªde("ascii"Hõself.assertEqual(Y(, ~J_raw:ÔaÔ�a * 2) [�def test_Pname()žò÷TempFile(TESTFN¹#�é$ìbì_INPUTc IrIŠf.read()`²ä“á˜b�/, aaù.N¯(2÷Ÿ_pathlike@X2 = ,db.PathJ…“N h6j &l0K'&�nEt™?, "špjï¬bad_paramsññ# Test invalid %ñeter combinations.N¸~€Raises(Vˆ[ErrorÃGžN+?rbtQ=ÿ", encoding="utf-8bA-Ÿs="ignorea@Ínewline="\n"þ�ormat_andÉ?terÀest non-defaóult format and filter chain. Âoptions = {"-ò": lzma.FORMAT_RAW, "=°s": FILTERS5_1}HBwith8òopen(BytesIO(COMPRESSED1³), "rb", **zu) as f:I˜õself.assertEqual(f.read(), INPUT).wmK:bioM#Òšbio, "w„ˆ‹f.write(u¢ile_data =÷ðdecompress(bio.getvalue´ì¸CæTç0ðdef test_encoding(:)æð# Test non-defaø+é$un Bed =H.µ¦de("ascii"W-x_raw = ö .replace("\n", os.linesepBv™!Dt", ¾Á="utf-16-le"Ý (F¤ ‡"W«)x„Hz š],"5 †jseek(0) Ÿr˜2 Î Rï_error_handler`ªe > >s1ãƒñ(b"foo\xffbar")ܹ ¹,‚�s="ignor-'‘� #0newÝ “explicit ,µ (universalæmode disabled)$Otext� I-wG•=¬<EŽ Ÿ·prµˆis2[‰+])‹ x_F ŠLö ddCleanup(unlink, TESTFNÎ@for @À in ("x", "xG"xt"MæC(B‹ÌN#,Y E.ApassO ?²ßðRaises(FileExistsE‰J9xÀ pôass class MiscellaneousTestCase(unittest.À): def ñ _is_check_supported(self):'+ó# CHECK_NONE andõCRC32 should always be G,Aõ%regardless of the options liblzma was compiled with.?�À.assertTrue(0.·«/))B)Þ"))-ñThe .xz format spec cannot store Hÿ IDs above this valueÍOFalsάID_MAX + 1‘`‡Œ@be av%id‘+tUNKNOWN|:ü _encode_filter_propertiesAÏ Æ÷Raises(TypeErrorljÈ] b"æva dict"äeVf ß{"id": 0x100}fMòÿ FILTER_LZMA2, "junk": 12}~?OLZMAè'C‚VDELTA¾“ Ú"dist": 9001}41estÏ÷ parameters used by zipfile modul$JAs = • {àŸ´7Ì1Ì"pb": 2 lpö_c": 3ˆú_size": 8 << 20&}ÁaEqual(ë’, b"]\x008"Ho/deoH]NsX86, {"ôbòWbytesâ‡FL£ ‚œ´ b"too long' # æoÀÏtŒ sÙ mÍ¡CselfÎ[À"],øTAÀlf.assertEquó al(filterspec["pb"], 2) ëself.assertEqu. lp.0.c.3.�dict_size5‘8 << 20) ˜’def test_ºð_properties_roundtrip(¹!):0Ëßþ1 = lzma._decode@(040òFILTER_LZMA1, b"]\x008"Õ@reen]dmm”:26£’tM ¸^01, ò2) # Test data: INPUT = b""" LAERTESmô O, fear me not.$õI stay too long: but here my father comes.JÖEnter POLONIUaôA double blessing is adgrace,vþOccasion smiles upon a second leave. LORDh"Ye¡õ, Laertes! aboard,¤for shame!qõThe wind sits in the shoulder of your sail¤0AndA are$�'d for. T;é@withRp=ôthese few precepy„y memoryœðSee thou character. GivyÖghts no tonguE Nor any un<„ortioned2 hcêBQÁou familiar,ë byZÅmeans vulgar0ThoÀariendsW� hast, anf€eir adopwe tried;`Grapplpñem to thy soul )Phoopstdsteel;`But do�Q dull5Bpalm5eu„tainment3ðOf each new-hatch'd, unfledged¸Èrade. Beware6pntrance�“a quarrele»nÍ Bear't thañe opposed may bYÌEthee:¾€every mal4y eqUvoiceýBTakeÌÒman's censure“Sreser@judglPCostl(�y habit a¬öy purse can buyÍ!utb�express'd Áfancy; rich,Ugaudyœ0ForÝð apparel oft proclaimleåbúyYFe!of@b«ArankA0sta:•0AreGÑa most select(àgenerous chiefVŠÿ1Nei¤Àa borrower n@ lenÛbdÈAloanÁÐloses both itgmfí ÌW–ð_®•husbandry�Tv�bove all:`‘thine ownfWbe trÅ/òit must follow,Âqe night:&daÂT*àanst not then òbe false to any man. ðFarewell: my blessing season this iÔee! LAERTES <ðMost humbly do I takeHaleave, öord. LORD POLONIU@ð The time invites you; go; ár servants tenE »ð , Ophelia; and remember ׫ðWhat I have said toe¥. OPHELIAÕ"'Tôômy memory lock'd,K0And;ðrself shall keep the key of itø³ò . """ COMPRESSED_BOGUS = b"uú s not a valid lzma stream7aXZ = (›ãb"\xfd7zXZ\x00ð4\xe6\xd6\xb4F\x02�!\x01\x16 µt/\xe5\xa3"PeH@7\x8c3\xdf]/ð5\x14\x07bX\x19\xcd\xddn\x98\x15\xe4tD\x9dP€o\x1d\xc•ð#5\n\x03\xcc2h\xc7\\\x86\xff\xf8\xe2\xfc\xe7\xd9\xfÈ4b8(MP\xa8wNò2\"u.n\x1e\xc3\xf2\x8e\x8d\x8fóð17/\xa6=\xf0\xa2Êf/M\x89Oð be\xde\xa7\x1cz\x18-]\xdËPf\x13O"rZÝ"8cª¶8do\xfa\x12N@9b#zQÎ0}P1\x82bM£Àa1t\xca6 BF$}RQ\xa4BeŽPƒl\xe8\x7N@9d,b?b— d4 @\x81vRN\xc8L 15 5xt$2OM5@k1Ì�5\xd0O\x9l²co\xae\xf7z¬’cdS\xb6t<2`F9cI#O089u‰266Y«¼® ce]Úypa\x96-PfÐde:\x04\t\x1bnP0db701fpÏ�J\xba\xf4H€V\xa9\xd˜`2%G\xf2f=?Ÿ&1bNPe1(\x‹082= @I\xa(1 acR\xb7ñbr\xb1i•"95"@bd\x&faP002sPÚÏX8 2j§Lˆ4Ñ6�Àd4c-H\x93oJlg iQ¥kP8GRb\xc1‹ bcQ0\x1x8 pca?@\xf°P7\xeaÖ×x\xf1H12P\x0fOPa\xc9%buw\xe3Á0aai6W‚Ï�cd#cb5\x99 8]@d\x0}±+ cW€pdUG\xbf5 yF± P1v\xb#ö0behü`8W\x08ªÛ9e�5:\x1a?rD80\xa�þf�ã8ob\5ò@5\x8x3m‚&acë0Ú0 7i€J 6Sck,K¦ðvy\x88\x91\x9b6T\xdae\r*0]:kVlPVbh c3i°9r\xeb}r\xdŸ b*$z�8ºcpdjcN`5-\xcbŠKIc5R5\xc0™ò`86Z\xf&PbL\xefPcf\x9ú‰8Öi¹^zce!\x92ce9ð^\xa59w \x9bP\xa3PóHK\x08d" b"\xf9\xe2Z}\xa7\xbf\xed\xeb%$\x0c\x82\xb8/\xb0\x01\xa9&,\xf7qh{Q\x96)\xf2"Pqð\xc3\x80\xb4\x1A °a\xe6o\xf4!à[\xd4\x8aw\x10Rtr&b3ž`d9\xd5Qó `^\x81\x11??\\\xa4\x99\x85RIàe\x83\xc9\x1eXÌVa\xf1M"acÆeŠða\xd7\xd0\xab\x18C\xf2S1\xb7N¶8\xcbS\xe4>Nha95H\xeP\t\r%9`\xc7$.èö1\xf3R\x17\x1db\xbb\xd8U\xa5^\xccSN"16^ 875€/\x93\xdBr0v\xc0r¯Òcc\xa2Gkz\xcad`0e\xfdÊN8mp2Ix\xb3y3Â-0\xe3z^\xd608f_&¢\x9dP\x9fi d8á�90\x84\xdD²f\xcdky\x8e™°7f\xa3\xb2+|€\x04\xefò&\\›cEfaS"e9ð2e3YŒ01dYXhó cfw29VPc \x8b|l 3ej\xbe\x1z 4z\x9c`\xdða\x92A\x06\xe5\x8².qàt\x9e=\xfa\x1c'_p%v\x1bo~!ZOÒòxf4\t\xddM\x16-‚ fcI4<\"Ÿ CM#`g~b\xfuf3Xy€de|\xa0'üôd6x\xae!J\xa6F\x88\x15uP@\x00ª2c7yÛ€d8u\xac_ 0\x8¾¹ 1@üP\xecq5`3#\xadIM°935\xb5)_\r(�3]\x0fo]5MÐmy\x07\x9b\xe[°5!`\xcfK+‹™N e4Ha4Í31a @b0\x97t a1d­9¼Vd\xc8PŸ‚§ ae®"+is0b9kÎ`>f\x19£ÄPa8\xf! f$e&{pN c6N@0\xc´bÅ66?h$@bZ%'#\nÇfHV"\xbaO@6r7X=mNX[¢B19FU9 86ã�c\x90a+* ÚP_$\x0�†x@xcd_ k xde\xaf46qÅK#92¼ 3`¯C} ff žf6äx€`\x0bw\x¦§ d8õV)9[¦20bZ&8ˆ0eb#¿¸â 1dõ{æ104w*r%b‹w1¶PB:\x96P^îV“PaH\x0ׂ03\nÖ201X&9{a¬0u#%Ò0*\x:018vøëPec!\tqL`Vj?uLUKI¬½T±#0f60twP`99P\xb½A4g\x02(ó 4YZ" ) COMPRESSED_ALONE = ( N‘ 0äÊ$P05\x1Ñ07bXÜ›c[Pdn\x9ã5�ÿ 9d›?s5ºd@cc2hŽÐ\\\x86\xff\xfõ@8" b"\xe2\xfc\xe7\xd9\xfe6\xb8(\xa8wd\xc2\"u.n\x1e\xc3\xf2\x8e\x8d\x8f\x02"Mö417/\xa6=\xf0\xa2\xdf/M\x89\xbe\xde\xa7\x1cz\x18-]\xd5\xef\x13\x8frZšò15\x80\x8c\xf8\x8do\xfa\x12\x9b#z/:kñfaF\x01\x82\xa3M\£6a1tOñca6 BF$\xe5Q\xa4\x98\xe–’l\xe8\x7f¹’9d,bn\x0b— d4 F\x81N`e4N\xc–P6\x15 5x| 2O5@cP1\x00�5\xd0O\x9d¶co\xae\xf7zOòc4\xcdS\xb6t<\x16h@9cI#>u‰266Y£´¦ ce ]Ò¸N€aa\x96-PnÐde:\x04\t\x1bv \xdb7\n\x8º fpÇ�J\xba\xf4HVV\xa9Md°0\x02%G\xf9Ô =?õRPe1(\x‹°82=\xd6I\xa(¦v0cR\xb7Mòae\r\xb1i\x03\x95¶"bd Þ002sPP\x9dÇX0 2j§LˆM 84Ñ8›p€ajr\xd1=ì^ dd‹¦03!E»PvV\xd*¦f3\xd7\xb4N 0cø`P~\xecª�E\xe37\xf'€ \xbb\xddc%¨€\x0fI\x0#`0;\xafEPa»bð£Z\x99(\xe9o 0oþ€>`\xe1\x®"a8Ûpa1\xb2}JñNB834Tv- c1¢¡Æ0bcDQ`MA@\xdÖ0d\x¸¡ 93F\x1aNbñ 94Fî002S`�8\xc9\xc5hBTJE} c8g\x17#ZV¡N,9o8k2e>0Á 90Ð 8/ y_ò¿(z20br! b0|?NïÞp83@\x84o}:�@z\x9Õ6y€f5BeyX\x|1ÄG1 :\÷foØPxD\\&Ãj 5YJû v{gçBe7)AÏ004oÜ 07ËS3\xe0=7�|Pf?v\xX�edVtTf\xb>7™eŠ:�ˆ"'k w@c5\\ßÙcVp15|w\xb—clb7\x08dŸE™8}ÆbU `b\xb9 DC` ,\xb3J@0\xdaþ d1\xffv\x0Ö f}ì9„ b%* dfò€08.\xa16"19÷07fh"1c±g0f \x11Bc6Blñ019Uá"4s$p10H\xea� pBˆ8'008cZ¯0\xe¯'4Až2á#;z? 7{UP5!\xcybf\xc1AÝd@0$\xj@02qgJf\xc7/|O0afr¥@^\x9E@8\xbÛ'9Ö 7n:@6{>8å0c7:,'º.?ØMú`1d\x0e-9Û@e\x0µ f:A§!'[O@"wD$$wØq< ,1QN0d0,1 2w«!$JN mgA9cA\MÐ9d&\xca8i\x9có;KðNQ" b"\x1frh\ðjx8beL;\xb0m\xee\x07Q\x9b\xc6\xd8\x03\xb5\xdeN\xd4\xfe\x98\xd0\xdc" b"\x1a[\x04\xde\x1a\xf6\x91j\xf8EOli\x8eB^\x1d\x82j@\xb2]¦R]\xb7\xd7Nð e9\xa6\xc3.\xfb\xf0-\xb4}bŽš"88ªûc1iN\x0e\x84wbQ\xdf~Mö24\x884\x96kM\xbc)T\xf3\x89\x97\x0f\x143\xe7)\xa0\xb3B\x00\xa8\xafP`82^\xc%a7..\xd p\t\x9dHGð5\xe9#\xe6NV\x94-Ð$Kk\xe3\x7f\r tPð12\xcf'\xefR\x8î4ð-LH\xac\xe5\x1f0~?SO\xep 1Es–\x1c]\xf2Móc4<\x11\x02\x10Z0a*?\xe4r\xffL6ïÀnG\xead^\xd6†8\xb6uEIO€99\nV\xeªP3\x95È \x83\xf6i!Àð &1F\xb1DP\xf4 SO3D!w\x99_GîT+\x90Pð.\xab\xbb]\x91>\xc9#h;} 5JKC`^-[\x9Ì3a\\@a‚sD\x19N‘#a1²€4\xb8p\xa…ˆrâ\xe0\xcar.l []d@af+0;gOP01aKY=I‘p,\n\xe8|rV\x80_#¶ðf2\xa9\x06\x8c>w" W,¾N 8cê0f96,à cc2\x05=kTv0UtiÙ@_\xc­ö`a\x8dl»hŽzO0fbfPÇ0 Gòx" ) FILTERS_RAW_1 = [{"id": lzma.õ_LZMA2, "preset": 3}] COMPRESSED<$( Ô5 07øo2fd]0�4Å"bX‰pcd\xddn`2cyq… ddÂLaj 3'Ž0\xdfŸò €P1\xa4 Iób¤„dVL8\x15P_ñ=·XÀc\xa5\xcd\nWk@$=R;… k8£2b1{7 c5šdNC\x87i"efâbÍ17S3P²xcc\xd2\xed� 0eÉ5óúbM°be4*\xaa\x0®@5\x0½@0\x8xp81.\x17Õ9bÊ0ZrAG0æFs\"rNrdaG\x81øB90cuçy@a9.A]lÅH\x98\x10;\xc5\x03#\xb5\x9d4\x0%7öba%v\xa49\x97A\xe0\"Op8c\xc22qPi\xc1Aô \xab3\xdf\xbe\xfdDm7\x1bi–15o:J\x92M db\x816\x1|b2O\x999ð0e\x8d\xf3\tQ\xed\x8Ùö5S/\x16M\xb2S\x04Mò0f\xc3J\xc6\xc7\xe4\xcbÕ f4\xe7d\x1 Ð4=^B\xfb\xd3E†\x1e\xcdNð91\xa5\xd0G\x8f.\xf6\xf9\x0bb&\xdr2ñ€j\xa2\x9EP4\\\xÀ41dCPv„ð\xd2\x8a?^H\xec\xae\xeb>\xfe\xb8G�\xd4IqY\xh0d4KH`1\xf4D‹WPœmpeaO\xbf�lç^¿P4U\x1¶¾Q{\xaaÓ6x81M;àf\xa3k{\x95\xb+9Ö"f8L°a3\x08O*\xf“01B-h(íRxPP@E\x9’3W:PV\xb7 @Y\x9‚¢b]\x83\xc4Ëd20gX¦dcf\x0fP™{20]n*<¡ a3)î5*u¤*¼T20A$A§Â7WO"ef0³a #iw’C0\x8t2d9%<e¦ a=RB\xc0µ$c6P@D\x87@ 8\xd1\xbbq¡.àa0\xf5Cqp\xeeL90\xe›Äc \x84\"\xe9MLt0‡ž1‡@~\x90�9\xf0\x01ˆ2eixd 0c5)ú 6)„P@03@lzB\x7fÝ0a5yIbFD:šà96\xb4\xb3?\xb¶–9\xce\x07O R1\x00 c3Þ"%_L$&Pe2\rhp#\xd67Q¸,62hnO.Ra3_?q×`e2\xacÍO0d0_|u"caI095S.GW\x1Ofu dt 9LÞ \xf2|\xdaW€s PL\x18r_—@$\x8Ða§šF�ð�kPvB 8hhðb'cÜñ0a5Gr€\xcc\x1fëPÌ`1\xdcyˆrI\x8bcwÔ 10rIp\x02:ªpp_\xc8vyablt3Oó4@e\xa¶@3\xaÞ4Ú•`abH*m}­§@a}>lÒZ4jMP3d\xa>3 1 ÞéPc5fOgU@\xfc´P^&\t@¢è006JMO@5\x8Ö�aR°UÜ 1r zëÏõ7ho\xc9^\x9c\xb_+,c4l U7°r\\!\xea¦�94k\xb9Ud-µ7ˆ68az�e›dˆ@PG\xáa;`2\x05w#^æbÍ+• e0¿M@033SÐË,3f6@á5Nþ0\xaQR0\x9aƒ0c3s6xRDM0f4`¨9—•s‚91\rTZ-X\ê¶ðe2\xee|\x1a\xbfð@\xfb\x08" b"\x91\xe1\xfc\x9a\x18\xa3\x8b\xd6^\x89\xf5[\xef\x87\xd1\x06\x1c7#E\xa2Oðt\tQ5/@S\xc05\xd2VhAK\x03VC\r\x9b\x936ôM\xf1xO\xaaO\xed\xb9<\x0c\xdaePò*\xd0\x07Hk6\x9fG+\xa1)\xcd\x9cl\‘bà e7¥ K}ä5\xab\xa0\x19uPà\xf6*F\xb32\x0Zò" ) FILTERS_RAW_2 = [{"id": lzma.ñ_DELTA, "dist": 2},HL7_LZMA2+p "preseKfòPRESET_DEFAULT ||ÐEXTREME}] COM5SED­(ˆÐeÒ@7\x85à]ëð5\x14\x06-\xd4\xa8d?1ö\xbe\xafH\xee\x04Ïáxcb.\xb5g\x8f\<CZ\ò f\x025z\xa4\xdd\xd8\t[}W\xf8ÍG1dmH~0a\xðfcg\xba\xe5\x01Q\x0b\x83R\xb6A\x885B$öe\n\x1cv~\xde:oOð06:J\xa7\x11Cc\xea\xf25*o  83\\l\xbdE@\x1f‡˜a8\x10\xbëò0caU{\xd7\xb8w\xdc 1b8.0\xc @38\\JB\x13zf98\xfa�àc7[\x17_9\x86%o aaaÀ\x8dfs#\x1e=Q<\x92–P\t\xfk6qP@=\x9fŸ@1dft‚b=€\x95Q\xcß9Û08\xãp�7\xc3\x7fŸP¶> ï 1#É¢ArAm\xdbJ~±ra3B\x82Zø0cc(H`P€WK\xad\x.P94kajI ±> æ0HwpfS\x84%!ìiMP\x99X!0B\xõ°90;E\xfde\xf`da\xcaFT–!bg€nÀ!j\Ÿ 83/]P"ÿMÊP\x0fr™APa5j~Pu�GH\xbfN*Z À.\x81\tpE\x8@û"%bdP€"a9×8÷ �4\xf9\x0eNP9\xae¤~Pc1\xa•9°P_~Oð 01k00\xX0L69@\xfe¹ JKI]gæ@1\xdI 7FžöN1Ìù c_[[ŠŽ4Ùp946\xebõ0\xb?P3$kS{h:V,f:SjP0Ý 8z„mec6á‘Pb0Q~rZ1\xbw?È0\x9…&2&Ncê0æ"c4³€9c|x\xce}×Í�|\xcbdhh+½'–@xc33¦O314qf€5\xe3`Z#\»¨–r08\xc2IQ€02l{\xecf6P™Òÿ d5Pxç0hz%eÃÛ‚P8!\x8F0c\xâ@17RUßbP¥`f\xe4Xî<cÛ=ì`e\xc60¸Ã�090b[@7$]BñN1J03h2tæ0L`4DxµZörç0]T^î¾Àx1b\x92\r;\xð6edY" b"\x0c\xef\x8d9z\xf3o\xb6)f\xa9]$n\rp\x93\xd0\x10\xa4\x08\xbP2\x8b0O8K(ö.e;\xdcQ\xf1\xfa\x9a\x06\x8e\xa5\x0e\x8cK\x9c @\xaa:UcX\n!\xc6Pð 02\x12\xcb\x1b\"=\x16.\x1f\x176\xf2g=\xe1Wn\xe9 @\xd4w–O\xad\x15N"86%aa3T\xaåð\xd7D\xb5\xd1W3pnt\x11\xc7VOj\xb7M\xc4i\xaÈ61$3N bbã0\x8J�b0\xc5Y\rH@\xfb›�\xe7K\xe6ahwO\xfö§2^&\x07\xd�°1fV\x19\xfdF 14\xd2i=yZAo° c6o€\x92\x9dš+ b3fw\xac%Ÿpcfc\x1a "`]Ž9‚p08\xedmRQ\xb2™öe4h`[q\xae\xe0\x0fNAba0g|b"N\xc3â3cfR.p5\x18)(’�0\\\xa3\x¼0d9GÒe¾Mrc1\x96xw2c8zÐ`01\xb4Ëp\xde\xcød)ôe7H\xb3y\xa8M\n\\A\tPat"dM�g°ea\x84\x9b!þÝ1\xbÀP~\x1e4 a5Q-oM0\xd>c7\x01h.P2\xbe"qNw]R0b!WG.0a5A.9&`jM"15z›0dd?V 5BÙ"~Ellð91!\x05^\x80\xddéy¾}M0a1)ÈP)\x81p0\xfêP8\xc0Ê@D\xe° b2"xæ2\xabu\xc9\x97Nc�ìc¯€x4_6\x03Æ $t3b4\x1d=ƒ0bfvÞ"f5â&1dO€9d8jk\x9 �3)ff\xf9nJK•á84!aAPfM\x9öbP60b0IèEÆ0\xe~0035a-@T\xeØ"2pC8f«8Ä29c/&Ðd6\x8fou;\xf6³"PR¥ œBefFjl€a7$\xf7hHœ0dfKë 9c\xba7\xeO"3)¸cb2,\x8"*018.ÊP8Qi\x™Vf8`h-M~dÊdP\t\xdÎ 3^�B\x00X@d0[!/8"7.-&fbOd@2-S+TP8,\xaÊ3�0 \x"a8VÆ0ab~Ý$@5\x7·$B95P]�P19i\x\27fo6`d8g^\r˜5µ1·Ú1–aek`\xff~�0b6y³@+\xe(P1^D\xA8`8\"!\x�d´7÷¯@T\xd2Þ1`02Y\xbå 74%7L@H\x1—f>1pe9f]\xcšctòpV5\x94œfOPa7TUHñ8!y?72f8X©¿2fc w$d8P2( /úb Pc\xc1:$8ctR003J- vPB1'b”Tc24kAM@\x98ûÃ"2P–ÿ`9J\xf8–9ù@ceaO'<Fà19\xa7" b"ð\x03\xd2\xe0\x8f:\x15\xf3\x84\x9e\xeð6e\xb8\x02q\xc7AC\x1emw\xfd\t" b"\x9að u\xc1\xa9\xcaCwUP\x00\xaYö78L4w!\x91L2 \x87\xd0\xf2\x06\x81jN080; Vò7\x92\xcb\x90lv@E\x8d[ða6\xe7Z[\xdf\xd6E<'`>Ore\xa1bZßzáa9`\x05\x0e{\xsre3\xbef[Ö1d\xebk1.\xe3M3e9N+¢4(\xfa\xbb bdu\xf7\x7F`6\xae!�0L\xP b5"M¢b9\x11\xdb`93\xe4n0\xe÷¢Bjc_\xe8}d*pc3\xa0Y¬V\xc9/P9Ï‚À3,\xe6bl@\x0HPbp\xcM e\x14\x168qܰuH\x89X\xa4¼N1žd²}Ñ@OX\x9Od~à85\x83\xff\x96°e\x82O`CF=K@'$IP7ÇÀfX\x8bJ'v\xdŽòf+\xd9.v\xf8Tv\x1729f5p )9Ù&8SPÐ86\xbd\x1a\"(gxºCpd1mB\xa8dpc4pS\x1ãcb!'JžOùP84G\tJ0\xc+06§30oS0§ƒfpy\xac\xˆ$9fP,27\rš 9ešfÚB0\\Lb…"1hštef}\x98·N‚\xccW#\\n07fosz¹Dò" ) FILTERS_RAW_3 = [{"id": lzma.ñ_IA64, "start_offset": 0x100},Í BõLZMA2}] COMPRESSEDq(AS 07UŒþ]§o307bMcÔ"dnô‚ÿb‚düo<ŒBe5\nS@cc2h‘6� f8\xe2\xfcV@\xfe%$8(MYwÔ`2\"u.n² \xQ‰8½× 02‹/×@=\xfÇ2Ê /M.O"beÈða7\x1cz\x18-]\xd5\xMpB8frZ8l~8`o<&12NR9b#z/:s2faFÁ�82\xa3M\x£0a1ta¢6 BF$\xe5Q»6´$dePl6»Á@9d,b?¬ýï‰1Î@N\xc Å5Ò 5xt$2OM@k1Ì5µ@O\x9  coOýz8�cdS\xb6tNha95H\xeP\t\r%$ $.èÐ1\xf3R\x17\x17pbb\xd8U”^-SN"16^ 875@/\x9êB 0v%y�c>`Gkz\xc!”eÁÌN 8b½ð\xd2Ix\xb3\x1ey3-ÿ`3z^\xd06Â_&�\x9dP\x9f8á9*4èYbkNe`81\x7f`R\xb2+#Î efò&\\›cEfa¿R1\xe9ð2e3YŒ01dYXhó0f1w295\xeãb \x8b|:e03ej|0\x1z 4z`4mA0#½ç1qÐt\x9e=\xfa\x1w 5_ %v¾o~!ZOÒ xf4\t\xddMi-‚ fcI4<\"ï CM#0g~b„¸B\x8eæ{€de|\xa0'Ë 6xÿr!J\xa6F¯415uP0\x0MQBbc7yÛ€d8u\xac_ p\x8d\xe* 1@üP\xecq5`3#\xad_M�935\xb5)_@ec3]0o]5M`my\x0780\xe[1+!• K+‹™N e4HaÇ ax@\xe0˜té9Q5g9¼Ï8PŸ‚§cG29+is b9²`0>f\x1«8Äa#w f$e&{pNcìì´Äf6~clh$@bZ%'#\nÇ‚" O@6r7X=mNX[¢B19FU9 86ã�c\x90a+* Ú _$1�•P0cd_ ³d¥@f46qÅK× ö0e3`¯ðð}\xb4\xff\xb3" ô> b"\x83\xfb\xb6\xca\xae`\x0bw\x7f\xfc\xd8\xacVe\x19\xc8\x17\x0bZ\xad\x88" M`eb#\x9ò3\x13\xb1d\x0f{\x0c\x04w\x07\r%Pbd\xdwô1\xc3B:\x95\x08P`^\x10V“ô-aH\x02\xd9\xe3\n\\\x01X\xf6\x9c\x8a\x06u#%\xbe*\xa1\x18v\x85NÄ\xec!\t4\x00ò" ) FILTERS_RAW_4 = [{"id": lzma.ð_DELTA, "dist": 4}, ô 7ðX86, "start_offse=O0x40@²LZMA2, "pre<õ4, "lc": 2}] COMPRESSED¼(—Øeå@7\x8Q6\x0e5@5\x1À7bW\xaah\xddkR\xdc'“„90,\xc6v=0Jq 5@l\xbT03xB%Çðf=&fx\xba\n>Tn\xbf\x8:bb\x1dFU@c3v_ ?Pà\xfbV<\x92#\xd"a6Æ"ebÖP03\xc®R1\x94†9„Z”2\x98\xd1P *\xfa]c\xeŸÐe~\xaf\xb5]Egk \x;€01\"8\xb>Zô6=~\xe9\x91W\xcdM*�D\x12\xc7Y0\xe†1dR99\xb�€x901\x87uí–\x869\xffP�c1\xb0hw|g`l\xcck  6oQ€5\xee{Y_‰¹àc$\xf3=\x8d\x8Ž6e5ZP¢08@\xc4kmE„Á2f6*&•ðc5{\xdej,)\x1emB\x1f]#ðk\xd2\xc6\x08" ð) b"\xe6\xab\t\x98\xf2!\xa0\x8c^\xacqA\x99<\x1cEG\x97\xc'ò1\xb6\xb9\x82" M°8d\xf7\x08sPð a\xff\xe3\xcc\x92\x0e\xd2>€U\xd7\xdC 6\x7fa\xe5jP0TG@œ 1e;ò7*\xfc\xde\xbc]6Nnðf1\x84\x9e\x9f\xct09\x56b5'Opf4<\xdfÓàsq\xd0\x9d\xbdò \x0b\xb4%p4\xbf{\xbb\x8a°6c=MMð94H:\xf5\xa8\xdG²4\xc90\xc2D"d3ô b0S\x87 `\xa2\xeb\xf3W\xceP¢ 7\xf9N#\r“ be÷žpe7\x8110\x1^1b‚\x14\xf6tcba\xb7N@\xb1Sò\x95l\xe4\tjA\xec:Ch!feG`\=D\xešc"3]TcqP0ceZVFRa\x16­ð fddgFQ\xed\xaf\x04\xa3\xù f8î¶q\x19B\xd4ržPc5\x0Kº€4\xea\x9Û!4o²b¢9\xf4@\xd1:'e3N6~@0Q\nÁ²/\xd8\xb8S5¿€18:\xb5gÐDx0\x1¨�f4z\xdaO e6¢7¼ H!Š2fduö8ŠR—*lÍQf9Q\xŒ0Mü bfë0O\x`8c\x18kB\x9c1â1fb\xe1\tR\xb2!e1k Ï-P2IGEü°98$\x83\x15x÷jº›0u55a3tt\xa5I2sP \x² 14Aé0"93™Bb8D0p2aa%-¡c0P}JO^h\xàFdlV.NÙð88\x13\x05o\xb0\x07ÝPw\xe0ø�\xa4\xd5*æî7P7G+\xtDbei[P3dpb@_\xeféyw 12òñW\x1b.\xad\x85-Ï`e3mU6g¦$SAMR\x01(™"dbË213=L™0f9,µ84†|`c9\xc3~†nE\xe8\\Pa"2Y tc0cäPd5\xe„dˆr9a\x8b~kPa6\rE´&uVOC"c6Š0ddmt`0[\x0fyÖ`1\x1d1å0cfw)P%!\xf$ ce^ BP0; a,� %dóø04\"s g.È—@bXY+}cC qA^01d=r 0*ðP01f/Bsì 1b^0@\x¹¥R3FQ\\K"82ó 000zw&e1M0ca,Ê1d7[~M7¢B!mA}HP9d3R5ŒF$H7092)Kadgà ees n{'0IJBë4=`e8`w&`„A}@Ox]Ûœ 02; �0da|l1e\xD bg]@­Ys8ŤéGŽO0d5NƒJIÍ!08dqKÔ0q\xÄ011WÌ`k*\x02ì2a3Jz0d8m˜@q\x9zbkní06`.?=6\ð0)\xde\x80X\xd4" ò% b"\xcfQm\x01\xc2cP\x1cA\x85'\xc9\xac\x8b\xe6\xb2) 084t(Ã\x92\xe4Z" Mò1cR\xb0\x9e\x96\xd1\xfb."a6Lôcb`\x10\x12]\xf2gR\x9bFT\xe0\xc8HPS<ðac<\x04\xc7\xc1\xe8\xedP\xf4\x1f b\xc0\xd7eÇä\x17J^\x1f\xabNò\xff[\x08\x19\xb4\xf5be�e5c~']\xcT�2A\xec\x9]0vNð06,\xc5K{\x86\x03\xbFðdMx\xdeQ\x8c3\xf9\x8a\xea=\x8S`ba\xd2ê&9aO`d72\xf3¡5`dfs\xdª�d\xbb\x81�€aE\"\xd8Öd\x0cD\xf7IJ!O!e52ðG\xe9\xcam\xaa\x0f_r\x95\x91NBqÀP\xce\xa7\xa5�E94ePP|@6\xcU€fIir\xb8ã€bjP\x97qi`wS7\x1e`ehM\xe®a?FP}y~Ÿ 0f†ðI\xfc\x13\xe1r¤Pk\x88¡Oãfd\xc3v\xe2\xbrp02\x8eq§i.P6\xf1¬ssÅ@\xe3M&e3NBa5>D 296;Íî0d13­`8\xdd'mp9.\xdc;sq0f5HÒqO 4W¤’\xdb~\x98n"ebÞ0e320›U�x\n6\xa0\c@0\xbyÄ]W 18ò;\x9fj[\xd9\xd5´0hy�’d\xe5\xeekV9c-%@›u�ÍݳQR122\\y"af[Ða1Oth\xb3\x8f•N˜aã7‘ree_\xbeÜ\@1e_\„a*�17W&\xa2D“F\x94PLb–f'h‡ ;X9’,\xeb>-7Sàcw 7)ƒ@p\x7¬@aQBLàPf£"9d @b5suIˆŒå@eb*)K€4\x9a{FWflÃjOñ 00" ) def test_main():€run_unit($ÕCompressorDec �TestCase,(&ŽFunction,NFile?Ope,ÚMiscellaneous5ñ) if __name__ == "_Ò2__"ÓË`() """? Åô:iler changes for unary ops (+, -, ~) introduced in Python 2.2""" import 0� class UH Opi( .1): 3‚Ónegative(selfŠxà.assertTrue(-2áa0 - 2)B %¿Equal(-0, 0 ?-2,Af%%.0�.o)j(+j)ùOposiù ðEqual(+2, 2)  ð self.assertEqual(+0, 0)  _+2, 2!  o.0, 2.e �2j, 2j) ˆðdef test_invert(”!): £ïTrue(-2 == 0 -§ -è /--ÈfŒ§¼no_overflow¬ñnines = "9" * 329űeval("+" + 4)Ô�10**32-1~–7-7%-(9: ~:~:¬åñegation_of_exponenti ôð# Make sure '**' does the right thing;‘se form akÁ# regression!õ SourceForge bug #456756.7" Ö¿-2 ** 3, -8üO(-2)(No4, -16O04, (ž@œbad_types/ðfor op in '+', '-&~'ðáðRaises(TypeError, ,D†+ "b'a'"¤<;·8G"~2jn¦ð"~2.0") if __name__ì¢"__main__"ú@unit.Ô() import sys o óio from hashlib ,2md5wcontextrmanager&drandom=Rl0patZ ž T.mock‚tarfile _Í]0supÎ.!ñcript_helper # Check „our comp&Âmodules. try;ÿÑgzip except I>0$} = None9?bz28?bz27Olzma89 ³md5sum(dataÜ¢return md5ð .hexdigest() TEMPDIR = os.�@.abs(;ô.TESTFN) + "-tardir" tarextdir = BÀ+ '-extract-•'&‰4 = L@find¼ ("" tar.tar") 7+‡Sjoin(\(, 0Ÿ.gz") bz22�bz2") xz2xd?tmp2ÀMPDIR, "tmp.ò tar") dotlessname = os.path.join(TEMPDIR, "test/° md5_regtyp0ñ"65f477c818ad9e15f7feab0c6d37742f"1Qspars0ó+a54fbc4ca4f4399a90e1b27164012fc6" class TarTest: tar¢ ±suffix = ''ñopen = io.FileIO3tar°tarfile.Tar . ' @p'1rtyâdef mode(self)„ˆpreturn @.pre~+Œó @support.requires_gzipÔOGzipÕ#à|JÖ)gzØ&.C¾@ if ¡ else None=Ô =3 î gz¡3bz2 ?Bz2Ÿ?bz2ž9bz2Ÿtbz2.BZ2�?bz2œ?bz2�ClzmažOLzmaŸ/xzžx<GT.LZMAŸ x<‰@Read‰(¤"):Db= "r:"I\setUpJC7tarª'šÓ,„=+Ž,ãˆöencoding="iso8859-1")Š�tearDownf×bµtar.close()…UUstarï `, unit.DCaseð_|0obj,Aular w’tarinfo =C�Àgetmember("u|/l%")üFwith1pextracto(P–) as fobj¸0adata =f.read(SðassertEqual(len(4 ),L©_.size…@"regè ‰ •§ion failed¿ldmd5sumodn%.�|adlinesŠý€º ~#, 4m½!ék öU, "r"Ñ1ÒË1Ô1ÕÁg.%@2MàTextIOWrapper(ct,2‡d aŠ21, @êP8objVTÀ[ð), 114,  ñ"fileobj.readlines() failed") #ñself.assertEqual(.i2[83],)0ð "I will gladly admit that Python is no¿e fastest "Jàrunning script Ïlanguage.\n"Ú h@def w_+`_iter(é!):!Ëö.tar.extract("ustar/regtype", TEMPDIR/¥tarinfo = =œgetmember?6ówith open(os.path.join(^+, xö), "r") as fobj1²¶�21 =ÞÙp¡Þ (À\2\ð 2 = list(io.TextIOWrapper(Ž&2)Ø�g =11, ¨2 _™(__›Ç ÁOseekÁ0‹bŒ /Cdata‰ˆ1() ½j*b3¼d;ext€{I.40° ¬!0,F.tell()¬! "GP) to D0's &tLto2048, z "2}ÿabsolute position‚ �-1024, 1ý"ƒÂnegative rel Œi‹  y‹s%1˜ 0s, Ö[’_:2058 "W�() after #� O0, 2‹-_.size“#>end€ ðí¹O, b"`Ütò_1didÖ÷return empty stringQc*(-Ö ˆu_‘àend failed")  òfobj.seek(512) q s1 = ¦readlines(525 õ self.assertEqual(s1, s2,t|"xp after q� failed"Œ0 lAlen(¶WB()),áotell()‡‚=ˆ I öŠo + 512�() and ›#Ô ¯ã B>�(), data[ÊF?):]>–¡À 0/()>�close() ðdef test_fileobj_text(—!):!'Pwith À.tar.extract1ñ("ustar/regtype") asï<@Õñ = io.TextIOWrapper+N*ò/÷().encode("iso8859-1–3˜ñpmd5sum(Ks), md5_Ÿ k:try¦Mª¨'10Æþexcept AttributeErrorBñ# Issue #13815:Oõ() complained about a missingfeý# flush() method."ó£ ("œ3ingë@ in Ác mode"ãñ# Test if symbolicËø hard links are resolved by âq). The„#+5ó members each point to a regular a whoseÉ3 isE€supposed1£be exporteè‘_’¤’P, lnkh,f ¤5œAa, \†iL ×1Ïbä0o‘a.name, btÆ Å1Æ´LíV¹3", —Ùe2e"./½`¬%2/q #( ‘;1W0sym-0symèh)t%Àe") defó test_issue14160(self): !._%ðfileobj_link("symtype2", "ustar/regð") class GzipU�ReadTest( ), pDpass<9Bz2#O(Bz2:JLzma;< ³@List+(³`, unit.qCase): ñ!# Override setUp to use default encoding (UTF-8)52def.i�tar = tarlQ.open'ñ.tarname, mode=” )‰T¢Q_list1QÄò+tio = io.TextIOWrapper(io.BytesIO(), 'ascii', newline='\n'±D÷with support.swap_attr(sys, 'stdout', tiox8©Atar.™Överbose=False]0outôöio.detach().getvalue(&K²assertIn(b's@contto', out. ¡-?lnkZð' + (b'/12345' * 40) + b'67/long¼v "./Ó^Í#2/b9»ð # Make sure it puts trail¤ñslash for directory°Ç |0dir!/  ×.-K]-size8 Ÿpis ableU�print unQ¥characters¥lconv(b…± = b.decodeN.L0ingÁçurrogateescapeøý‚return s2%e(+Q'back7hreplac9 ®—³ÿumlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf')Ð PDmiscuõ-hpux-signed-chksum-'È /b'�0hdrN?setA Ÿ” s ¨ôs separated by oneG îà&anNó# 'ls -l'-like accessories if %ð flag is not be¢EusedÒW# ...e úÀ # ... ð% self.assertRegex(out, br'ustar/conttype ?\r?\n' 488reg7)8õ6# Make sure it does not print the source of link without verbose flagN¾�NotIn(b'5†to', outx*$->%Pãdef test_list_o(8!):!÷ö+tio = io.TextIOWrapper(io.BytesIO(), 'ascii', newline='\n'‹Ò÷ support.swap_attr(sys, 'stdout', tiox|‹P.tar.¡(¡V=True\*=<ö.detach().getvalue(& …|ô s files separated by oneÅ‰Õ 'ls -l'-likeù# accessories if¬ç is being used47...`?rw-r-@ tar‹/ûú 7011 2003-01-06 07:19:43 §Q6ÀP¯Š 5_(br'\È1\s+ÆD }¡\d{4}-\d\d0\s+ : E9\w+ŠO * 2  ‡ Ø �w1symw3-> LmÐ z8"./:Áˆ'2/D4..//1/Q&1lnk•K? toF,b'�uñgnu' + (b'/123' * 125) + b'/long{2to -JCOnameM ?pax‡-‡)< AmembersAAi_;tar'0forCpinfo in 0 -kƒif 'reg'.9.dö&PyieldV(øÔ;sFalse, ´=K)Àð£ÀIn(b'ustar/róegtype', out) øself.assertNotIn(b'ustar/cont1ð class GzipListTest( $, !):[Tpass 34Bz2O(Bz21ELzma2 3 CommonRead,( 1): �ðdef test_empty_tarfile(þ² # =ñ for issue6123: Allow opening A¡ archives.^<1hise³ checks if i.>Ñ() is able toP3 anP7tarJ^ù successfully. Note that7‹\wnot theJvsame as2÷!!Jwith¤�tmpname, ÷.mode.replace("r", "w")2úì 2try _tar =d �3@.getˆ&s(eexceptKãZErrorp¸kfail("}Ded otf"b?lseN‘�Equal(tar Ömembers(), []Enfinall‹.close()‘Ïnon_existent˜ô11513: prevent non-C„ gzipped'•s raisingô²# multiple R7ionÈE÷ñ RaisesRegex(FileNotFound{{, "xxx" x!O ?ullø�%¢guarantees@ ¡q) does <'re^26 GÖ@;êF<"wb / i]n.ß,ËE%, \<¢|¸O —Ïignore_zeros'0Tar8's -v optionõ# generate 512 pseudorandom bytesh�data = R0(0)e)ñbits(512*8).to_5v, 'big'ÿ¹ûchar in (b'\0', b'a' çÁif EOFHeaderÎ (3Ú) and Invalidal©S# areþ¶d correctlyü%™  ")TJfobju6q.write(Òf* 1024ë$wtarinfocð TarInfo("foo")  ò tarinfo.size = len(data) ´fobj.write(4tobuf(), M Nú(tar = tarfile.open(tmpname, mode="r", ignore_zeros=TruegItry:Vªðself.assertListEqual®@.get`Ýs(), ["foo"],>B"wÿ should have skipped the %r-blocks" %LJcharµofinall¹Átar.close() Lðdef test_premature_end_of_archive(ì)Afor Ä÷ in (512, 600, 1024, 1200,éOwith„€"w:") asa5t¼�TarInfo(R ë+V†×ô0addñ(t, io.BytesIO(b"a" *¼)5· 3B"r+b°£± .truncate($T�‡‚n°RaisesRegexpÔð.ReadError, "unexpected end of "”åÌOt in�&Bpass-–ÉÎT.next|OSéFpextract{TEMPDIRŸ‡Zº€(t).read class MiscÏôTestBase(CommonÇ´�requires_o€_attribuw3elf'м5é#no4|rgumentá…_|±!10tarŠO, "r%)6±IsInstance(7<+stÈe i8@obj=6ÆWÐG# zy<5á0°os.path.absÄGn¢ãHÓ0 = @°( =ä-¶ÔK$(A™C0getN,_0, "ñ"AT“Àself.mode)  ðself.assertIsNone(tar.name) #ðdef test_empty_°_attribute(?!):)-‘with open@.tar0ö, "rb") as fobj/3adata =u.read()N-à = io.BytesIO(- «U = ""7…�tarfile.� @obj=Qp, mode=¹. —:tar–?int ù# Issue 21044: šó) should handle ª Ä¥an integerÜ0# 'R%' ƒ.rfd = osóÁ€¶os.O_RDONLY?d qd, 'rb' % �Instance((~,¦WÕ[ éÙƒHƇb"‰ NŒrequires,Á6MrfsencodêÑ,éD6I+Æ^bK=Åí/, {4‚UEqual,k€path.abs);Aliket492 = 'ab.Path&p ?× :str~ÿBos.f “&))LÆM8tar0s ¨^`ETarFDÕhŒ1if fÊsuffix == ''ÍŠ âÕWÝ"'r  — /Is› 5F G䊀illegal_¿A_arg,Rãe"mpØð'wb'): s pass õ*with self.assertRaisesRegex(ValueError, 'mode must be '):BIRtar =Gõtaropen(tmpname, 'q')-oP/rwp[1') ßðdef test_fileobj_ì€_offset(b4ð# Skip the first member and store v|as from'csecond(pxA# ofyEtar.’0tarŽ.’„B.tar—Ð= ¢=tryÜf.next(${@t = ra. ’5 1Tpextract»Š(t) as f”L×data = f.read�ofinallÅcclose(®Bh# Open@�aeek to¦f …l¸K h½:objÀ¢fobj.seek(a•™cTest iÜÅ� starts n:ŽAþú`"r:", b@obj=�ßê.qEqual(té , ï Fd# ReadM0endJul¸è ting bac| €# beginn$Vworks~ðB.getFs °:ar.cD , U,zB"£ €did not ‰"ñ hŽail_comp �For Gzip@Bz2 þrs: failïaH‹� on an unLaressedÇðÎ(�E,gˆ ½,à pÙ<O"rb"Ú}nr¦£ , ›¶=d®v7_dirtypeeT0 ol`Cyle (Qé (bug #1336623©`Old V70qs creat<cectory>@s us™±an AREGTYPE˜Á„# headerȵ"/" appendeãf fieldÉwtarinfoZås("misc/Çw-old-v7�ˆðEqual(tarinfo.tûype, tarfile.DIRTYPE, ñ"v7 dirtype failed") &ðdef test_xstar_"q(self):Ha# The ñ format stores extra atime and c ÷fields inside theJàspace reservedO!� prefix :.ox must bHñ ignored in this case, otherwise it will mess upeUname.Œ6tryãçöð .tar.getmember("misc/reg-%")Bÿexcept KeyErrorNk ("¾ed to find T“ (mangled-?)žbcheck_—s¡0for@infoÉ‘ðassertEqual(int(tar6 .m¹þ), 0o7606136617F&q"wrong 1¿T%s" %.d"1iif not!.k�tswith("u '/"p6vcontinu÷ÝÇÃu{3, " "¿ -¿âµz Ž Eqs()[-1]", R?eof a"could.t! aÀ‰sP@unit¯ÿ.skipUnless(hasattr(os, "link")ý@à "Missing hard.ó implementationá�@supporti!_uj@_sym2 4ct_P žf# Testo0öion (e.g. bug #857297) 6Ù@open­äeoðlevel=1, encoding="iso8859-1") as= ˜~xܪ", TEMPDIR½Ï´addCleanup( unó, os.path.join(B#, Ô\)k ˜.‡0lnkc‡B\)Û`XÅ >R, "rbYfWØêdata = f.read(jEzpmd5sum(4s), md5_+)?sym)F\)#>)OÀpe) defó test_extractall(self): §# Test if $ð) correctly restores di÷ory permissionsHõ and times (see issue1735).%õ"tar = tarfile.open(tarname, encoding="iso8859-1"):öDIR = os.path.join(TEMPDIR, "º2Æos.mkdir(DIRH6tryüÖðies = [t for t in§@t.isG%)]�8Ftar.xe,"6iesr-T`arinfoZt �,á ëçtA./ _7þ if sys.platform != "win32"c00# Wâ has no supporþÈfine grainedìÈAPÀ.assertEqualÒéé.mode & 0o777,<; €os.stat(X).st_Dô0def¯Pmat_mz(ÝaÒif isinstance*, float1=ðreturn "{} ({})".\$at?pn.hex()ž@Oelse€^‹!r} (intaT8ì#1get‰7 j errmsg = "*@ {0}"O´€ {1} of ye {2!a}ë PºŠñ„)ë 1w<.‡ýjy&, W", õDkfinallüÄfclose()Þ p.rmtreeÜ!) qP_ÊyWpdirtypevcustar/"HeÒ?dirÒ@with½d0 as/§q².fcember(Ë 4ÓP,S=„++'edÌÚïf ¢ (Y ),ÚŽ³7}³t ¸,&55|Œt@all_ Plike_  {àDIR = pathlib.óPath(TEMPDIR) / "extractall" ðwith support.temp_dir(25, \&-ù$tarfile.open(tarname, encoding="iso8859-1") as tar:Að directories = [t for t in+€ if t.is~))]8Ftar.»œ', L)-T`arinfoZ( �ÒÀpath = DIR /„5.Ö R*ðself.assertEqual(os.> .getmtime(%),F!) I“def test_Å_,Plike_l(\)�ódirtype = "ustar/³°"= E/b.æ}t}=  cember(Ç ®ÛR�,Ú=‚>=%ed²R &M© H® üinit_close_fobj¨ð# Issue #7341: C)à the internal -b objecå¥he TarFile³�# constru°ðcase of an error. F%!heB· we rely onCu fact that ž1ingBBmpty‡áraises a ReadEZBe'$= ÔDjoin81, ""¸2f(R, "wbò'ɵ£.write(b"":try*Star =.€.__new__E.7„CQar.__»_  5`except›Y �JJ@TrueŒ.4Aobj.dZ?lseFefail("lQ not ‘dWkfinall™dunlinkѺVÿparallel_iteration«�16601: ReYt&4T over–atinuedkõ # from where it left off." $C)®`m1, m2ý0zipgFO…�m1.offsetA •7@get_m!();Ð) class Misc²XTest(  Base, unitÔ. CCase°_ðÄ_comp = NoneTHGzipK(A,ob DpassQ9Bz2PàBz2Test, MiscRðeadTestBase, unittest.óCase): def requires_name_attribute(self'+P.skipCð("BZ2File have no = =ó") class LzmaMiscR�(C(, §EOLZMA¨ ©eStream§dCommonBCÁprefix="r|" TlÜ_read_throughNð# Issue #11224: A poorly designed _· In.J‘() methode’ñ# caused seeking errors with sϵ tar files.70for�info in Ø2tarXdif not(w.isreg($…continue^�ðelf.tar.extract†@(tarxš) as fobju<hVNTrue ?tryQbuf =Y3I512)š%Qexcepß—.üE?])Ðfail("simple —-á0 usƒ"osA"Tar× ) [?ed"±�?buf¡[break„ßÀobj_regular_ Œ•% = ð.next() # get "regtype" (can't usefmember°÷%Idata·StðassertEqual(len(0%),œ]size,wµòþ j>iong ddmd5sumg0md5>f!™‚provoke_ž_±�s�2getn&s(pBs[0]k1: #®² the first PŸ› `Raises°2!1, f])j‚compare_XsÖ01 =µQ@open^7÷, encoding="iso8859-1 óGtar2‰ÅwAtƒ1á þAtX_!Ïif t1 is Non¢‡N\PIsNot@b(t2, " qŸ.A? | 2.islnk() Æ5sym™À ÿ" with self.assertRaises(tarfile.StreamError): Àtar2.extract7O(t2)-�continue šv1 = tar1H1H"v2*rßif v1 is None¾‘ ÚPIsNotCq(v2, "s §ž) failed"®HôEqual(v1.read(), v2 �n ]>ionkzfinallyáKòclose() class GzipÑ�ReadTest( *, íDpass>:Bz2$O(Bz2<KLzma=>¹eDetectµ2Tar:�unittest.CCase·Pdef _Qfunc_’ˆ´, name, mod*h.tr<c:g.open(9¬`exceptµ(Ÿ)K as o~.$(";els&Etar.³šÈ@obj(MËßÂP"rb")¡f/n?tar÷ , åWobj=fÃW_µsüÛï½"ifÆjsuffixÝ6ä¹OSC6tarx="r:" +v;vE|vR/ñãCm|Nñ.—/"r$§W/:*YŠY|YBÜ'!_dݦ†Éÿ.Ú)LO- RÀlf._test_modð&es(self._testfunc_fileobj) class GzipDetectReadTest( *, ´): pass>:Bz2$O(Bz2<@def ‹!_ds±_stream_bz2¨bfð# Originally, tar¹2's 2 @ðion looked for the 1ing©G£"BZh91" at aart of Tp. This ÷ncorrect becauseF[á'9' representsAö blocksize (900,000 bytes). IcG wasL0comEösed using another NFautoãefails.Bòwith open(tarname, "rb") as fobj§þadata =….read() J3# CŒ U�1Î,ì-r starts.Z;11"™óbz2.BZ2File(tmp Twb", ùlevel=1±Ãp.write(¼¯ËcEr|*"×KLzmaš›×eMember `, unitÁ.JbCase):OÚf!_m<й÷ info, chksum=None, **kwargsð#if#Š@not * Ê£°tar.extract–fQ 54óassertEqual(md5sum(f)Ÿ,7r"wrong 9mP%s" %™z.çªßõ ["mtime"] = 0o7606136617f'1uid%M1000gÀif "old-v7" -)inŠ @# V7÷ can't handle alphabetic owneraù›Ú�"…"†(g(œ‚k, v in Xw.items(L ¨tgetattrà, k), v¦¢Pvaluei€%s fieldì¬%(k�°±»ÔÑ_find_regtypeÀ 0taré1 = ¦‚3getì "u/;%")", H , 6T=7011}D=md5~šOcont›%<œE?dir›%;š0HÐ_with_size(seclf): õ(tarinfo = self.tar.getmember("ustar/dirtype-with-size")@6c_test_5R , *a=255) .Adef (€find_lnkT(@�;…Ã0, linkname=Ô0reg€"�0sym�!;�%— /bl4&;—Àdevmajor=3, oinor=02!ch#2!;›$1›3›OfifoÎ%<�…osparse!:�ò86016, chksum=md5_C˜2gnu›Bgnu/8™N?_00œ%O-0.0 P1 (1 O1@'1@Gumlauts;�;!-"WÈÿ"\xc4\xd6\xdc\xe4\xf6\xfc\xdfI7011W¬XªP_longu æ3 = ‹õ" + "12345/" * 39467/Cí2 .assertIn(K,¼:s()—Àt_find_regtyópe_oldv7(self):  tarinfo = õ.tar.getmember("misc/regtype-old-v7")<2c_test_1Nó , size=7011, chksum=md5_J!) CAdef =üfind_pax_umlauts¤hškclose(�ñtar = tarfile.open@˱name, mode=D ,|þ÷encoding="iso8859-1õã1Cpax/Æ/-"j÷"\xc4\xd6\xdc\xe4\xf6\xfc\xdfyÂn#° class Long[Test:„cread_l!A% # 3 $ting of *õ (bug #1471427).ó!YÀsubdir + "/"°123/" * 125/46try¦)y @úexcept KeyErrorLLdfail(":¬ not foundtóassertNotEqual(ˆ.,x~DIRTYPE^"60`as dir<")ƒLlinkƒ§P%AY¹‘/‘)@‘#:‘ Ž2Ü,k4, "m wrongq�truncateù5V5/5_ ^$boffsetÏ—.V¸ ì’obj.seek(%Fñfobj = io.BytesIOM.8l–(3 * 512):Bwith õ`Raisesó9Q.ReadN› }P="fooq0", @obj=– órheader_Á¦ZvÒif the start *‚@TarI½õobject includes/#:PpreceÑ¢ extended x®8˜�¢Fç În40tar7°, "rb") as . ´ðƒ1;sð.TarInfo.frombuÿf(fobj.read(512), ù"iso8859-1", "strict")Eñself.assertEqual(tarinfo.type, €longnameó) class GNUReadTest(L" $, °, unittest.qCase): ásubdir = "gnu"fò = tarfile.GNUTYPE_LONGNAME@´# Since 3.2*ñ& is supposed to accurately restore sparse members andz # produce rðs with holes. ThisZðwhat we actually wantgßc here.L�Unfortun{ñ, not all platforms/eSystem±$rtš,™veven on> t‰Pdo it—°non-trivial�âmake reliable ×Cions›RaboutÚ2 inîã€erefore,áñfirst do one basic ã¥which workNnÙ¸b after¦a:²Awill>ƒ only on“3‚prove toÖ %nPdef _Ÿ_Û_A(µ , ²!):g5Ð.tar.extract( –, TEMPDIRBó = os.path.join()XW,Topen(9°, "rb") as ¾‚†adata =×y¡³EŠpmd5sum(3c), md5å`"wrong#Òsum for %s" %1}"ifÐA_fs_*Arts_è()*sþEstatت"8ñ Less(s.st_blocks * 512, Rsize)ƒ­ ¬A_old°� Ö*/ç"R /00QO-0.0U 1U"1U 1ª!1ª@ ricmethoÊcÞ õ# Return True if the^a knowsÎe¥ attributeœv# uses ,ð@s ofb bytesh#sú¼¤%toK"# ¦’  ¿4ys.2p.starts�‡("linux"EŸL‘ evidenti¸5hasž ºU; "Š-Ñ S’ BO, "wg%ð.seek(4096)  ðfobj.truncate() ûs = os.stat(nameßupport.unlink!preturn AÅ_blocks == 0cUelse:u2ðFalse class PaxReadTest(LongŠ $, °, unittest.qCase): Zásubdir = "pax"lDòtype = tarfile.XHDTYPE7@def Pö _pax_global_headers(self)¸ ta_F€open(tar¥ö, encoding="iso8859-1"E6tryGÿrtarinfo•°.getmember(¼@/reg²A4ŽÀ.assertEqual}E".uƒG"foot3 [o, "bar3 ±ñ("VENDOR.umlauts"),twò"\xc4\xd6\xdc\xe4\xf6\xfc\xdf")Ž: 2º 0±3í×7$7EM@nfinalluP.closý¬ ü nu‚m_fieldûò# All following - -ò are read from the pax -.j˜?\4˦size, 7011±°pid, 123/g/ÿmtime, 1041808783.0i 5ype ?�), float9 $:œ0["a†?"])‰PcP ±$PWriteü€Base(Tar ¥ð # Put all write tests in ñ>here that are supposed to be tested # in all possible mode combinations. *1def9ñ _fileobj_no_close(self):%Sõfobj = io.BytesIO()�tar = tarE`.open( @obj=7,~=Q.ˆ 9@.add-(?êTarInfo("foo"),šSÀassertFalse(o.&Ðd, "external aòobjs must never &"Mò# Issue #20238: Incomplete gzip output withÑe"w:gz"qdata = ƒ‡getvalue%0del#/¾×rt.gc_collect-Ù ²&`Equal(ƒ,‚!) tdê¬eof_markeräP# MakXòre an end of archive 4ñ is written (two zero blocks).j/#ìw  insists o’digningSsºø a 20 * 512 byte recordsizeNÁSo, we creat�–ñhas exactly 10240Ks¬wout thešÉ`, and :D204820oncbî‘tmpname, ’ä0 asAt' èŸ'.ÿ,ÀRECORDSIZE -VY`.BLOCK <&arS,°�b"a" * t])oк Í�"rb") asQ É.yzlôÅobj.read()),§¼õ* 2) class WriteTest( €Base, un^0st.bCase):ÂÒprefix = "w:"Õ�100_char_ˆØ@The a field¡ñ header stores stringsõ°t most 100 Xsÿc# If a-pshorter™n11 it^�apadded‘e '\0',µð# which impliesFt_'ofÙ‹t²P7outMpa trailfh·ÿÐ= "0123456789%10<ÆØ/*ryÝu°mt lfinallR"arÍ(®§Ntœ °‡0get qs()[0], —¬R"failh*åYDGʹ@tar_î´ðest for bug #10138S82. ötar = tarfile.open(tmpname, self.mode)/5ry: C path = os. ð.join(TEMPDIR, "U">1Qwith h1ú, "wb") as fobj\/Ë.write(b"aaaN€tar.add(Lhkfinallª+fclose()âäassertGreater(ÊtgetsizeY), 0,úž"9Á is empty") %Ð# The test_*_H sò for bug #1167128Ž1def_54(Ÿ)¬s�Apassö rtarinfoYC.get §+ã.‚cEqual(+.53, 0P+>>¨43T}+îŸdirectoryóØ_<‹os.mkdirlt¹M} Dì/ð&LÍ-¦support.rm�ò# mock the followingÛ # Ïð listdir: so we know that Ÿ�s are in?±wrong orderZÛÌed_recursionÑÞ6Pº„[Ü, "1"), "a").û323 D5w@unit1.˜Nsch('os.‰'%_®"ñ.return_value = ["2"]©7 UMRsE=Ñm arï‡members(¼BJu.appendp€split(m.{V)[-1]R8 <IF, [" ߇, "2"]);æÀ finally:  Ätar.close() …finally:ð support.unlink(os.path.join( f, "1")E424QrmdirZ!) ‰ðdef test_gettarinfo_yölike_name(self)¶ðwith tarfile.open(tmp) , *�.mode) as$6¸W0 = ðlib.Path(TEMPDIR) / "R"•.ld5a, "wb"\Jfobj]/Ú.write(b"aaa"8ß =›.ðB+2,Pos.fsŽ6 bóassertIsInstance(M.%/tr5[Equal0>2?:ssize, 3ãP@unitäð .skipUnless(hasattr(os, "|9"),| Ð"Missing hard.ó implementationjM#_† >9 = 與otarget/ _%�­57 3+tr¬0os.¿ Pget, ‘°except Perm,ponError eª%ŠdTest('V¦): %s' % eT ƒ2tar“,~A DÁ# Record theÈl!inÉinodes list.N=Ý>fµ#¹°o 8+< G:, 0aMG�z!Æ �¸@È!_uS@_sym#!  GÞ:Ú3os.(³ü,T! ó75ÓÊ€ˆÓl• �@add_— ˜ # ŽÖ for #1257255ù0dst¼«ðabspath(tmpname)  ótar = tarfile.open(tmpname, self.mode) .U try: $òassertEqual(tar.?1dst 04�"archive #ö must be absolute"r-TCadd(R ‚!ge|�s(), [],ƒ”dded the �Pto itQ9") 4úwith support.change_cwd(TEMPDIR)´fykfinall«Fcclose(Ýðdef test_filter(ùÊ`tempdiÄos.path.joinó2, "7¬“os.mkdir(;© 82forûòin ("foo", "bar'z"ˆÑ*)= �i,Lo/²°reate_emptyî e(M)ÓÅOinfo…%if�@baseG.÷B) ==Éeireturn\0tarq¯.uid = 123"s1 = 4 &_ÐO Äë÷, encoding="iso8859-1ã­ 0ar.¤’0arc«"="v diÜ`= °´Z ¸â# Verify that Tù is a keyword-only argument-Ñá½ÿRaises(TypeErrorû@ â Ú³True, None,‹ _ /"rc4)0 inådÈ.×”^,] yK7Èð+oo§7lDúar.getmembers()), 3vï`-Ýfrmtreetè²# Guaranteepstored ÈÏò s are not modified. Don'&ò# remove ./ or .ö double slashes. Still mak¹|f“relative.ò For details see bug #6054!„_”C–,¸`, cmp_=h—dir=False®1# Cí a!Ö ìðan empty memberÓ named path ñ # and compare the stored,Q with•original.9�foo = os.Oõ.join(TEMPDIR, "foo")+µif not dir:ösupport.create_empty_file(foo?Jelse9‚os.mkdir(T�tar = tarD�.open(tmpõ¶, self.modeX:tryWptar.addVP, arc:=ß4fl8�close() �'"r‡Åo.next({!p `unlinkç^ež.rmjNàassertEqual(t.-`, cmp_21 orhò.replace(os.sep, "/")) '@cðskip_unless_symžHôdef test_extractall s(„)Á¦# Test if -ô works properly when £ contains rss˜`tempdiLß”6ÊeF_chive<8.ta ×�ž $asource- k=",'$'FÜ_arget9 ƒ : UYD¦,'w') as fŠgûf.write('something\nTm(U¤¦ ¿ãvŽÇ„Ó^ Qôt!ÝRt# Let'sna it to,ælocation whichh]î ¤Ô r5Ñ# this shouldZöraise OSError: [Errno 17] File existß Q6ar.=(È=N eexceptq ÎI›v.fail("P "edT>0ed ÉsE@fÏ �-ZëÆ!arš Ê(prmtree((3dirÇ à ué_Óö$(ý# W0�, ".", "b£=>À._test_pathnóame(os.path.join(".", "foo")) °self._test_*n6O, ".;)o, "barB(ÀCbz:7;< =ºú C Dÿ #˜ + os.sep À=!yÁ, dir=True) GAdef }5abs� s(–!):"¨ö if sys.platform == "win32"$(7 ÍP"C:\\»ƒûOelse@/=o*//1Åçú pax_headers={'non': 'empty'}î¡éÐFalse(f.closeð d) class GzipWriteTest( %, ´): pass45Bz2O(Bz22FLzma34 ›fStream7 ðBase, unittest.KrCase): «Árefix = "w|"òdecompressor = None+@def D!_slÓ_padding(selfùý # dñ for bug #1543303.]! taXðtarfile.open(tmpname, Lh.mode)/v.close("if*¬{a^dec =%D&Zwith ‚Ú"rb") as fobjT2adata =[.readQFdec.œ(½GèÀassertFalse(2punused_.ð, "found trailing "EJelsežÌXÑË#GŸQEqualÂô.count(b"\0"), ÁµRECORDSIZE,´ãó"incorrect zero ;"")Z@Ÿð skipUnless(sys.platform !¡ÿin32" and hasattr(os, "umask")~` "MissE+ó implementationUÞ–_ƒÙðissue #8464: Create 8!s †ì`# perm„6ons ôif os.path.existsNFåsupport.unlink%<!’original_à=W f(0o0226:try5Œm=tar�3 {Estat¦1.stN… & 0o7774 hEñ, 0o644, "wrongYA±@fölÔ2os.ý  Æ /Ì ‹ Ò %Ø > Sˆbz2.BZ2Dipif bz2 ×ssÿ U(d+, oœlzma.LZMAqrK5GNU>(šq9za# This case check5#r þ cðion of GNU Longæ#ÈÔò extended headers (cp.@‚812325).ï§q_length 3, sö–0blo†ñ= len(s) // 512 + 1u#sreturn ** Zðcalc_size(self, nameó, link=None): õ# Initial tar headerÅcount = 512 àif len(name) >7öfile.LENGTH_NAME^e # GNU long3“ extendedl% +b6{+|Âself._lengthŽA£°ink is not óA and¸¸OLINK¸3¸w£Ÿ4 ¸@)Aqreturn +q def _test(7 , CÉ•tarinfo =’TarInfo ì=.�c! =-™Å$GtypefrLNKTYPE¯(€open(tmpVV, "w"î=try†`.format1tarX¬GNU_FORMATŽ@.add#(š)„ˆPv1 = 6±._calc_size @ˆ-2´y.offsetkDøassertEqual(v1, v2, "Ù/â@÷ creation failedòofinallögclose(Á�ÊE¸ @cmemberÉVnext(-åÉPIsNot(5,ò-õ"unable to readª 5Ú._(˜.ü4 nI„ rv,¾²±_ˆQ_1023¿w,Ù#("*Ä/" * 127) + "V4V%eW 5W&_X€ "*2", =lnk ?lnk^   ^i_  _ø!=namOnam"¿ð("longlnk/" * 1ð27) + "longlnk") def test_ñnamelink_1024(self):&* ._,!((F—nam/" * 1ZB%",484=lnk4r�5�&_�!_‘ò class CreateTest(Wri  Base, unit.bCase):VÒprefix = "x:"ðfile_path = os. ð .join(TEMPDIR, "spameggs42~8ž]setUpþ�upport.un>@(tmpzÔ@¸amethod‹GCÑG(clsØ�with open.§ö, "wb") as fobj˜ .w d(b"aaa°z�tearDown}sÈ6cls‚νe!_cˆ ¿0tar¹.Ç !, ²AmodeÆtÆA.addS xè]G8tar]R…As = Z1get!()…PKñassertEqual(len(%O), 1(FIn('1', /?[0]‘_existingÕ ç(OÝÀRaises(FileE�gsErrorŽ %,¼ ?1Ž 7ùÿÊB, "xu u¯Æ_*e±¶ ®±Opass¿jÀ self.asð.sertIn("spameggs42", names[0]) def test_create_pathlike_(q(self):)-òwith tarfile.open(/ b.Path(tmp60), 8æ.mode) as tobjEI !as¡ sInstance((.Be, str)w 2XEqual-0os.ˆ@.absˆ B^:add´ŠÐú)3Œ1s =ÁA.get($=Ç•Alen(%O), 1(FIn('�'�ìg\1targZNr§[ 7©E? د-li??"x"9ÿÂÁ class GzipCnPTest( &, tcpass 76Bz2!O(Bz25GLzma673�WithXMode3( "):<Âprefix = "x"Jq = NoneÍ›existing_(p @unit+ð.skipUnless(hasattr(os, "link"), "Missing hardó implementation")<H ¾(_CCasen # Q the ôion of LNKTYPE (eò ) members in an archive.\setUp=ùdfoo = ±ûjoin(TEMPDIR, "foo"5?bar0Cbar"Ç7/kR, "wbKf„ƒ.write(b{¥K:try±0os.`ÔC.fooã'ba§°except Perm—ponError³eMŸÜp$('\§): %s' % eÕ,t yâ 4Àlf.tar.add(sñelf.foo) def tearDown(self):Æ.tar.close()Ñupport.unlink7S6s!9bartÁst_add_twiceCzÀ# The same nõwill be added as a REGTYPE everyšñ # time regardless of st_©.'¥tarinfo = ä3get� Ð5ÃassertEqual(+ó.type, tarfile.”,h P"add #¼ÿregular failed"h¾[w¸ gtÞ¸0LNKL¸ •¹Ädereference_,LÁ‘S-u = True5åD�ŒDing »çõ class PaxWriteTest(GNU &):M _tè,¼ , $W=Noneh# See D�X€TarInfo( †!if[°ò=.u/! =%]$½% =¾Ë(€open(tmpVä, "w", format=§¦PAX_FORMAT¥=try¡@.add F.ofinall2‚È?tarœN |2êlLõ.getmembers()[0]Fw-à.Ypà, l, "PAX long– creationM>Jelsen�y‰&7, n‰‰t(üst_pax_global_headerã!]s = {²Ï"foo": "bar"r0uid0mÝO1.23!| Ï\xe4\xf6\xfc( 1: "8}ú1Ò= § #+.«)>¿À # Test óif the global header was written correctly. ö"tar = tarfile.open(tmpname, encoding="iso8859-1"):5ry: Nò self.assertEqual(tar.pax_Š7s, H;ÿgetmembers()[0]KÑ# Test if allöfields are stringsÿ}ðfor key, val in lŠ.items()í9ñúIsNot(type(key), byteså3?val3 ifž™¦þPAX_NUMBER_FIELDS›lt¡ò L`[key](’ Ý8òexcept (TypeError, Valu $8,ðfail("unable to convert¯­fkfinalljY�close() ¦�def test_bƒextendedx({ša# The has from%4paxƒðhave priority over"hΖ# TarInfoFvåð = {"path": "foo", "uidR123"}°Hz È"w", format=ªuFORMAT,ŒH µtþØ(· t.ù = "\xe4\xf6\xfc" # non-ASCII�û t.uid = 8**8 # too large% 4 (`ar.add÷&(t˜f +#.˜ °l Kw,EúÔe†uid, 123)#à class Unicode6:žN÷0_1_� M‹_{uH+ 6&YFutf7)E¡.T:"öOutf8O&(-8Px”­` ÆA.Ò¿�0, eg0s="½'ctðtry: ÷ name = "\xe4\xf6\xfc" ðtar.addfile(tar�.TarInfo(>%))/…finally:G@…close() dtar = O€open(tmpO´, encoding= a+tr]ðself.assertEqual¢ò.getmembers()[0].WJ«ðdef test_unicode_þIp_error()ïÖ À"w", format=7. ,, ¡="ascii", w¦s="strict"Ð wtarinfofµ‡p)&  ·m‚Raises(UE ,Ï* €m =foon7 .uf�Aó$�argumentû arÅ_, "r"çŸiso8859-1ë€for t in��å¶‘Is(type(tíf), strC-1@linkÎ5Å2gd«4ame² ¨"†t} !t.§žÌ  _mode=+'¶ x¸(MÅ šŒvš(tpx̉,žÌ6ž6ž71if p†& !�®PAX_FORMATLTÌF/É ÃFt")¶… &±udce4\udcf6c!<àself.assertEquðal(t.gname, "\udce4!f6Sc") …finally:÷tar.close() class UstarUnicodeTest( °, unittest.qCase): Sòformat = tarfile.USTAR_FORMAT# # 5ð whether the utf-8 enmðd version of a EÙ� exceeds01100n�# bytes !ðfield limit (every occurrenceMø '\xff' will be expanded to 2O!).@def ä"_u_fv1(self)@"._(3&ö("0123456789" * 10‚1ÿ + "0", ValueErrorC9B‡ú„ A8B �&2&"qn´)@ E¶„1#55K„øprefix + '/' + 100�—X1lon¼\$5é%/" {(P//4P @S1\˜®<S ±µ Ü„º#Ø„26E^9æ3 "æˆêF?234å! 67‚Â`ò<4V*”òöÀ self._tòest_ustar_name("0123456789" * 15 + %/" 9@\xffû ", ValueError) def _tk`self, vÁ, exc=None):04òwith tarfile.open(tmp.À"w", format=F. ð, encoding="utf-8") asDVZ0t =Y€TarInfo(Y)|& if–@ is ™ B ptar.addF*(t;Nelse1ªðassertRaises(exc,ŠH3, t1a�  /r" f€for t inˆ´"¸QEqual,N, t.4/Rbreakûð# Test the same‘PaboveÀñ100 bytes link field.Š65pnicode_! 1(�(.]& È0¢1Û ÍÜC7„ A8B\ &2&"qn"´(@ EÜ µWvG"fooþ÷ t.\÷! =¹Ë° 1ï>T5² class GNUU÷@( `, unitó.0Cas7‹ß¢GNU_FORMATŽSìbad_pax_header.µÀissue #8633.•(Ð <= 1.23 creaº¢raw binaryÀsŽÙ # «ò out a hdrcharset=BINARY ~î.qÄ š(N$(àð, "pax/bad-pax-\udce4!f6Oc"),=Àiso8859-1", ÷"pax/bad-pax-\xe4\xf6\xfc"),): ôwith tarfile.open(tarname, encoding= ,:E ð errors="surrogateescape") asd z5>try =2°.getmember(”)�°except KeyE}Mðself.fail("unable to read bad GNUk÷ pax header") class PAXUnicodeTest( °, unittest.qCase): ¡bformatÂX¢PAX_FORMAT!#X… ignoresoñ in write mode.Rg"_u‰_S_pr = NoneYAdef ,rbinary_Ð(ø # ²ð a POSIX.1-2008 compati7 ò a hdrcharset=BINARY fieldš­5for¾ , ›Ä(º ¡("utf-8", ¡Xp-\udce4!f6ª@Ÿiso8859-1Dèÿ éì`AppendBBaseK+‘ö (cp. patch #1652681).\setUpr�.Y mp&áñif os.path.exists@1ºJêsupport.unlink*‡€_create_1tar',ÁW="w:"Tæ "yÍ2src ‘î7src°À"ustar/regtyí/.‰ = "foo"�Kpextractî!(tvftI. ½kñ<>tar>Brtar.addgF, f)D<!_aû_aressedK@q od1 + fsuffix¼ÀassertRaisess€Q.ReadÈ,’“2, t1@, "a�œ°( »›í>estÒ CA_add:ƒð , @obj=mþ� 6"a"<D‘ ‰‘çTarInfo("bar")›žšKàs=["bar"], filÓeobj=None): ðwith tarfile.open(self.tarname, 7@) as/AH3ðassertEqual(tar.getCQs(), !) vñdef test_non_existingv—RP_add_+}!()>o(T\emptyMß½"w:").closea~$_®acreateY7tar%A"rb"k pdata = W.readN - Ë(n÷=["foo", "bar"]ʇ3EÜpremature_eofHï$ =˜‘.TarInfo(vw).tobufõê´? pýtrailing_garbag»4s,5 + w ð|invalidê ¼0b"a¸ò512) class GzipÊPTest( ,ß  Base, unit.4Cas�DpassM7Bz2L0Bz2,K#GLzmaLM!æ`LimitsA(Èý»qustar_l3 S¡# 100 char96tarinfoå 0123456789|1ü5tîðUSTAR_FORMAT)  ð# 101 char name that cannot be stored *õ#tarinfo = tarfile.TarInfo("0123456789" * 10 + "0");ðself.assertRaises(ValueError,OYa.tobuf^åUSTAR_FORMAT) LW# 256µõwith a slash at pos 1560·@123/± 62±@long¸<š(÷™N&M›/31›S;6512S;?126¡[@link¦¥Ò0ÒGD = " Ìcl;åuid > 8 digitsel_©ÄIb= 0o10K°5ðdef test_gnu_limits(\%):k¶W= _>GNUö+æ5cŽ # |!>=‹O** 7Æ 4ÅVu@ HÏ?paxÏW?PAXÏx޵(P �ð class MiscTest(unitq.bCase):ù»­m_field‹%UEqual°ðstn("foo", 8, "asciiÿ", "strict"), tb"foo\0%")+ðself.assertEqual(tarfile.stn(6ÿbar", 3, "asciiqgLnts(žl¦kPbar\0ËÔh;ð def test_read_number_fields(S!):'�ò"# Issue 13158: Test if GNU tar specific base-256 N NGõare decoded correctly.!wÊqnti(b"0¯1\x00"), 1979"0o7A@\x80> 2º 10o1¹/00p(Fff\xp #xfp\h p -‰P/9ch BÒ0¢ ºAwã 4-0x³º. V24514 Zemptyù ïÿconverted to zeroï\æ5Ã7²æ_writeç ‹itn(1), ƒav9 nAz�ñz@  ¥±@psà/-1ø -h!/00j)ŸB@ JÀ ¿ b"\xff\x00S") ó0# Issue 32713: Test if itn() supports float values outside the Fö # non-GNU format rangð self.assertEqual(tarfile.hs-100.0,:=ÅGNU_FORMAT),¯pîòE9c")>‡ ¯8 ** 12 + Ž+8x1 �Ž:nti!?0.1 C), 0Óðdef test_number_field_limits(ÿ%):Pwith š€Raises(VæWError,p™´T, 8, TUSTAR®a2B0o10iL4-0xjf001, 6Ö‚Ô3j0jkÈl_all__»ð blacklist = {'version', 'grp0pwdásymlink_except#^Î @'NUL1�BLOCKSIZE dRECORD oMAGIC'Žs'POSIX_$Á 'LENGTH_NAMNOLINKB$bPREFIXƒAGTYP@5ARE 2LNKÎ2SYM T 'CHR #BL6E 'DIBFIFO"MBCONT!P 'GNU T_LONGÙÞ )QSPARSÔ0XHDOê4XGL …SOLARIS_™ SUPPORTED_:SFvREGULAR¶F‘PAX_FIELDAÙ UUMBERK!st„0ntsŒ0ntii±calc_chksum@copy?obj Omode!±EmptyHeader±p™Truncated²9EOF'� 'Invali=«SubsequentDÏExFileObject¼emain'}˜kw.check_ö�%, ö= ð) class CommandLðineTest(unittest.ðCase): def tarfilecmd(self, *args, **kw !):+/ó&rc, out, err = script_helper.assert_python_ok('-m', '`'YNR�@`return‘ÿ.replace(os.linesep.encode(), b'\n')ñˆ_failureùïaç AìuÃmake_simple_vptar_nam”�ðs = [support.find°('tokenize_Ð…s.txt'),A 9 þ-no-coding-cookie-'EN ò'and-utf8-bom-sig-only…]@FÄ.addCleanup(Œpunlink,qñ2@withãd.open(Æ, 'w') as tfˆ�0for3€data in ;s"& tfŠO)P, arclÐ=os.path.base")³br_bad_us" Celf.×5cmdX)ã#aEqual(H?b''#±In(b'usage'm�.lower()-_error-�required0 èÞ0'-láÃæ2Not&’err.strip¯ ­1estìr_comman¥ŠR ¶0tarÕ *0opt%0'-tº --.'70outà øO(opt¾hãm Ïn_verboa­²©×v×UÚukÜà @is aƒU�hive.\n'  D¼¿�_invalid_±Ì0zip¸{ ù§zipdir.zipp©ï^Ù Ñ{ is notÖ%6¾Ê #¨1KÞ©0sub¿ªí=ª ÀÀ with opÿ en(tar_name, 'rb') as f: ýdata = f.read()$?try9pwith opm#mplwl €f.write(xn[:511]t(òrc, out, err = self.tarfilecmd_failure('-t', t‚J;ÁassertEqual(W?b''/Š1,ofinallõsupport.unlink( _ðdef test_list_command(§)kDfor Æ1 in10taris&*‰qñcaptured_stdout(ût15P.Æ32t30tf.ºê(verbose=False!û*expected = t.getvalue().encode('ascii', 'backslashreplace•0opt0'-l1 --|'Ò>out(U(opt,H,ÿ óPYTHONIOENCODING=° äDµ.\þ!) qð_>ø¨?Tru÷Qv÷0ú5Hz€invalid_Ò !ziRÐIAfind*·'zipdir.zip,¤×. D^ÎÆàIn(b' is not a:¡ archive.'Œ6XY#¨1ocreate „iles = [ã �tokenize_Ns.txt')ä9 ñ-no-coding-cookie-'¸áò'and-utf8-bom-sig-only…]@ ÁcÊð ÉhÔ ó0, *Ðs)  ñ self.assertEqual(out, b'') ðwith tarfile.open(tmpname) as:3>útar.getmembers(X~finally:åsupport.unlinkj cðdef test_create_command_verbose(Õ)T±Ts = [U@find°('tokenize_O�s.txt'),d»9 þ-no-coding-cookie-'EN ò'and-utf8-bom-sig-only…]@ófor opt in '-v', '--é'äT/trI`out = .¼pcmd(optICc', Å0, *s W<#`In(b' ( {Žd.', out6.�€dotless_ÏÇ7,² ˆ„ '-†�ƒ¢ pZ¢žš–bš ¿dot_startedp@tar_ð = os.path.join(TEMPDIR, ".¦Ftar"o½Ü¥$›¢<WŸD_œ ¯compressed,9€@type>â(GzipTest, Bz2 @Lzma .óaif noté>î l&…continue« ýÛo† + '.' +disuffixL;< á—>à.taropen(tar_nïame) as tar: ùtar.getmembers()%~finally:ðsupport.unlink(tar_nk ?ödef test_extract_command(self)Nò .make_simple_tarfile(tmpO±ófor opt in '-e', '--]'P./tr¯Twith ´€temp_cwd¶gextdir“Caout = ¥™�cmd(opt, ¡4.ÿassertEqual(out, b''Ygrmtree£Z �_verboseb4vbUbbçh`In(b' 8C is Ÿed.', outxLÿdifferent_directory„' ¼¸´ M«, 'spamdir•¼Y´€invalid_» 5!zi€kAfind*·'zipdir.zipÁ+!rcP, errdFelf.ä’_failure(8ŒJ)}€is not ag€ archive€?err6Y#¨ð1) class ContextManagerTest(unitl.kCase):+\basic`/òP.openkt.™AFals™¢.closed, " ò inside runtime c­"objó‘Hthatý1didü¬�external IAkobject"`KËbÌJfobj# t@obj=A, mode=  F} $( ,0`False(‚n  :8wEM¹` @unit·ð.skipIf(hasattr(os, "link"), "requires os.ð to be missing") class LinkEmulaqýP(Read %, ibCase):9¸ñfor issue #8741 regression. On platforms P!doDqsupport4ð# symbolic or hard «#s š` triesºpextract|`se typÙ“f membersMaje‡Aular›¢y point to™ø_B_n_\1ion , s©Ctar.)( –, TEMPDIRŠìGSjoin((WÀe), "rb") asW f: õdata = f.read()ð self.assertEqual(md5sum(0ñ), md5_regtype) 5ð:# See issues #1578269, #8879, and #17689 for some history on these skips � @unittest.ñIf(hasattr(os.path, "islink"),~5 ó"Skip emulation - has ?.=€ but notML@def |P_hardp_extracH 1()D!._/ +°("ustar/lnk'"(Û†2Û#./Ý0inký2ç`, "sym.¾3if 3‚ exists"ª«ª+?symªÃS’,Ïð class Bz2PartialReadTest(Bz2%, rCCaseå0# IÔó5068: The _BZ2Proxy3Ð method loopsÞAeverI#ÛÒan empty or p}â bzipped file.?ÊG%a_input”T, mod�æÎÓMyBytesIO(io. µ%ñhit_eof = False–rõÃ;, n;#wGöqraise A+ñionError("infiniteé detected in "†FA"tar$copen()õ+¼.Ÿ1 = Ñtell() == lenA².getvalue()8CÕreturn super(T,L)än6:Aseek\, *args>�œ‚†~ f`'3ƒô = bz2.compress()øTarInfo("foo").tobufõ}x†`range(!O[) + 1Ã>tryñh‘›Eobj=5@[:x]"Aode=¸ ðtexcept Hˆ2kp²ð# we have no interestÀ9s”‰_?Ð): seþlf._test_partial_input("r") def !±_bz2(self):&*M@:bz2Q Nóroot_is_uid_gid_0(E6tryNñimport pwd, grpf�except IVError0Áreturn False- if=ð.getpwuid(0)[0] != '�': 0grp:?grg:…ÀTrue @unit<ñ.skipUnless(hasattr(os, 'chown'), "missing os./")?|geteuidAõ ") class NumericOwnerTest(˜CCase�ò# mock the following(%# š±: so we can  what's beÀacalled�41mod4Wðmodes are not actually changed. if~y",e$'tNe`delete,ô files/directories/ osÃ!³ðlie and say we're “ (uid = 0öÂ@staticmethoκR_make/€archive(~´name_1, dir 2[¸#°ò contents to writ³%ófobj = io.BytesIO(b".B#á# create a tarq with a 0, a�!y,ñ%bin thaXM-ñ. Assign various .uid/.gid value³Athemg>™items = [ p99, 98,ž  .REGTYPE, á%),>B(?v 77, 76>2DIR>ONone>e~–2, 88, 87>|]�D0tarO�.open(tmpX‘, 'w') asÒl¹r for % ui°Ftyp,è1in ( 8@1t =SÀile.TarInfo(L)”&t‹R = ui“t¢?= guQ ûYg! @type©yŠw.Pl.add4&(tõL$## ‘full pathu!toÆ�1�—@‘xtmanager>«Qsetup¬(Õ_�.n_ãO # +cÔf¿B= 'n` -oa-ñ ')Ù€Bdir'ËBGsíÁwant stored £eKY0Q_1 = �f 7ð2 = os.path.join( dirname, fC) ñ # create the tarfile withõcontents we're after;@tar_/Rô = NumericOwnerTest._make_test_archive(/5_1,G‰ÎF,�2Aopenýñ for reading. yield it and&þAs of UitemsÚñ# we stored into$w#jw.z(VA) as•%l:2(… 0l, P…F_1, 2íP@unit�ñ.mock.patch('os.chown')a%?mod% dgeteui'@def p�_extract_ì"_n& _o'p(self, ‘_=_chmod$BÉ)*p bq._setup‹(+m`rfH_{�‡2ƒ§.© TEMPDIR, R=True�?C?2 ,D ÔAÁ# convert to¶system path°fÏp_1 = os&uh.join(¬è1¤929o޹ú.assert_has_calls([²(j¯1, 99, 98)­O Ÿ2, 88, 87O]w¢any_order=Ø”h�S?all�I" ÕÚ“(ÛBÖ³› 6allæ’xNNì N#†Às.path.join(óTEMPDIR, filename_2) ðmock_chown.assert_has_calls([unittest.&.5(f_Gµ1, 99, 98),OVO1dir•Ÿ1, 77, 76N*�Ÿ2, 88, 87O]Åãany_order=TrueIp# this +ñ requires that uid=0 and g  really be õ‘d 'root'.-!'sGð# because the u)B !inlîC areG,'”extract()N�will look9ám up using pwd1°grp to find" ir¶Äid, which weOz@here5Qbe 0.@Þ°skipUnless(Þï_is_uid_gid_0(� '.,*Fmust("J""'Ôk˜¡patch('os.È%?mod% dgeteui'1defÝ_\ð_without_numeric_owner(self, ”_@_chmod`:EÏ!):_v e€._setup_‹(+p·) as (tarflðw1, _, _JN&.Ò(K`E_1, 2 ßT=FalsòA�# convert @²system pathË&1` = os. e.join(i>~R:Ù›‚!ed~ ‰C0, 0;$ûÔÏkeyword_onlyÃ6€;ÉtÿRaises(TypeError+ » éS®#, ¦ ïÃsetUpModule(×äsupport.unlink‘g¶os.makedirs�aglobal!ta¿ð�C = [ ]5>@open ía, "rb"³Ffobjèpdata = c.read(Úð# Create compressed Biles…òfor c in GzipTest, Bz2 @Lzma hPif c.’x #c.Ç"ì�.append(+új#C, "wþ:tar‚`�ar.write(!) ŠtearDownÅ%ifWðexists(TEMPDIR):  ð%support.rmtree(TEMPDIR) if __name__ == "__main__": 9�unittest.@() -ðBEGIN RSA PRIVATE KEYñÿÿÿ/- MIICXAIBAAKBgQC89ZNxjTgWgq7Z1g0tJ65w+k7lNAj5IgjLb155UkUrz0XsHDnH FlbsVUg2Xtk6+bo2UEYIzN7cIm5ImpmyW/2z0J1IDVDlvR2xJ659xrE0v5c2cB6T f9lnNTwpSoeK24Nd7Jwq4j9vk95fLrdqsBq0/KVlsCXeixS/CaqqduXfvwIDAQAB AoGAQFko4uyCgzfxr4Ezb4Mp5pN3Npqny5+Jey3r8EjSAX9Ogn+CNYgoBcdtFgbq 1yif/0sK7ohGBJU9FUCAwrqNBI9ZHB6rcy7dx+gULOmRBGckln1o5S1+smVdmOsW 7zUVLBVByKuNWqTYFlzfVd6s4iiXtAE2iHn3GCyYdlICwrECQQDhMQVxHd3EFbzg SFmJBTARlZ2GKA3c1g/h9/XbkEPQ9/RwI3vnjJ2RaSnjlfoLl8TOcf0uOGbOEyFe 19RvCLXjAkEA1s+UE5ziF+YVkW3WolDCQ2kQ5WG9+ccfNebfh6b67B7Ln5iG0Sbg ky9cjsO3jbMJQtlzAQnH1850oRD5Gi51dQJAIbHCDLDZU9Ok1TI+I2BhVuA6F666 lEZ7TeZaJSYq34OaUYUdrwG9OdqwZ9sy9LUav4ESzu2lhEQchCJrKMn23QJAReqs ZLHUeTjfXkVk7dHhWPWSlUZ6AhmIlA/AQ7Payg2/8wM/JkZEJEPvGVykms9iPUrv frADRr+hAGe43IewnQJBAJWKZllPgKuEBPwoEldHNS8nRu61D7HzxEzQ2xnfj+Nk 2fgf1MAzzTRsikfGENhVsVWeqOcijWb6g5gsyCmlRpc= ??ENDWw±CERTIFICATEsñXsDCCAhmgAwIBAgIJAOqYOYFJfEEoMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwñ,KExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMDgwNjI2MTgxNTUyWk¡jBF MQswCQ^òGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8ühMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfÿAQUAA4GNADCBiQKB ¬!« ¬!f«/ 2¬ ð&o4GnMIGkMB0G A1UdDgQWBBTctMtI3EO9OjLI0x9Zo2ifkwIiNjB1ô—HSMEbjBsg, -áqFJpEcwRTELMAkrÀBhMCQVUxEzARIò BAgTClNvbWUt U3RhdGUxITAföoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZI® ¯wjñÆdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAQwa7jya/DfhaDn7E usPkpgIX8WCL2B1SqnRTXEZfBPPVq/cUmFGyEVRVATySRuMwi8PXbVcOhXXuocA+ 43W+iIsD9pXapCZhhOerCq18TC1dWK98vLUsoK8PMjB6e5H/O8bqojv0EeC+fyCw eSHj5jpC8iZKjCHBn+mAi4cQ514= ±å ÅQfrom iplibregr 0 imµ | `() doc–s = """ #ð Tests mostly copied fr÷om test_listcomps.py #ñH Test simple loop with conditional >>> sum({i*i for i in range(100) if i&1 == 1})3j166650bFcaseQÁ{2*y + x + 1UxUA(0,)yA1,)}P:{3}MvnestingPçÒ(sorted({(i,jH«3jZ½Q4)}))`�[(0, 0), 1231 11, 11, 11, 2 2 2 2 ]½¶hðthe inner expression dependent on "_outerç4çiçÇ ¯3¿3¿3¿Á] Make sure�Pinducð variable is notÃFosed©ai = 20]@ 4@32834si=ñ20 Verify that syntax error's are raised7"seì u¦as lvalues˜!{y)`€2)} = 10uP# doc:ñ : +IGNORE_EXCEPTION_DETAIL™ðTraceback (most rec·±call last):'a ... S»Eº:•+–•Yô a ­ped set @Qrehen¤ˆpacts li2et(P&))hRdef sn 1...c�return {MnîÐH410)¯00, �ð%, 3, 4, 5, 6, 7, 8, 9] Same again, only as a lambda«nòinstead of a funÜQdefinÏlË$ =E?n: Á>(ÁñGenerators can Uuother g:žmg¢(m°[o¤™žuyield x›ˆc5‡*] /aat Non"ƒa valid ú”¾{'©®#10 7} º ¹sÈðvarious scoping corRlsîRwsN#usÙto�QÙ3ödefault argumentµ¢items = {(Qr i=i: i}È5ÇÔ2{x( ‘B@} ==cB5áOTrueÇpthis tiÝÑ1clo›´Ð >>> iteò!ms = {(lambda: i) for i in range(5)} >>> {x( x Ritemsð {4} Another way to test thañe iteration variable is local-Õhe list comp qc¡ei = 20?° ’d confirm¨ø a closure can jump over t�o scope£ y$Dy£¢ñ 2} We also repeat each of�QaboveŒ1inglðs inside a funcl¦1def%_1():�0...Ú fO i=i  8oreturn3u„ == set(X)…7TruN¨¤@“ÎÁ’>¤I$¥.¢’¦í¤Å�""" __ _Í@'docTs' : 5} kómain(verbose=None±¡import sys_AfromÖ  up!r@_setb@s/S.run_‡(&#, …)J#ñify reference countingt if!¶ñ and hasattr(sys, "gettotalref5"ÕiÀ!gcG#œ[U] * 5 ¢Blen(/)SEá0²gc.collect(¥gP[i] =†.Ô/Tprint˜Ð if __name__0"__å2__"‹w÷ ) =QInput—&¡profile.pyecð . IMPORTANT: This stuffoðtouchy. If you modÍPanythFT@the U` class)€'ll have©PregenËe‡Ðstats by runnD,2twoB¨ðs. *ALL* NUMBERS;&Àexpected outáäare relevant. ¤ ch† 1`formatmp{û, please don't just £h hàwithout checkiðnng very carefully that not a single number has changed. """ import sys # In order to have reproducible time, we simulate a ðr in the global # varia3á'TICKS', whichOeesentsD d CBð milliseconds. # (We can't uskñ helper function increment|Frïðce it would be #(Pludedd¦³profile and'`appearõµconsume allV1.) ÆÑ = 42000 def¶ñr(): return '0estª"�# 1 call/ô# 1000 ticks total: 27”local, 73`in subNøsCkrƒ|a += 99!. ()_# 300. l1171?Ïfactorial(14rC# 13</nAA# 23 V5# 1&D, 15&' 3 primitiv2@lls,lA, 20å24E4ðincluding 116, 17“\ g‚if n > 0øY nZwmul(n, îA-1))&OelseC1OD1OKFa, b/0/N]M/, º¨d¤Ra * bd2˜9# 2b3±VtD, 26°�}1° ¯ðË2<#6<2x 5&x3<(´x5xŸ_indirect½;# 7´J-ç4ç,C: 29æ1K“1‹þhasattr(C(), "foo","# k1Ï�lst = []@lst.´^nd(42D?2 # uÏsys.exc_info)-,Õ2Z&@D3 # &ð3œS # 2 [j9# 8� ð2: 3�Às local, 11 ñticks in subfunctions global TICKS a += 11ðhasattr(C(), "bar")8 "# ,<3<®subhelper(4AA# 10-=`5 def¬>:"‚# 8 callº9 Ùƒtotal: 8ƒlocal, 2÷2kPfor i1”range(2):°"# ¹2try¤ pC().foo b# 1 x iúexcept AttributeErrorO31 1# 3O‚ class C:BP__get¾â__(self, name)!E8# 2S18!, G )—[raiseÌñ\ # This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number Vr0ñ into # trying to importvçsame module "aatime".±ðere are no pleasµafailur;ðes -- most likelyßðthat Python # complains several _ts about random hav§0no ±0 # ƒP, and»n_“ hangs. Öp_imp aså$os $4lib%sy“Thutilty4ingäunittest from sXBmock$A.supo|! (Jƒverbose,4!_mƒd, run_Pò, TESTFN, reap_†!s,@ôforget, unlink, rmtree, start+)@Âtask(N, done_@s, eas »@# We1Q't usçóulefinder but still½0 it" or‚to stresœ #'Ö´of differenø!s El!s.æ?pif len(½·V) % 2»$ÑE¦@ E%omOelseH (BbÕw1 if° om 2not!et¥nitialized‰3x =1.{èa(1, 3)#E0ionÞ¹Åò.append(e.with_traceback(None)Igfinall¡U?eãing.get_ident(>­finished =•A== N¯(4if + brS.set(œ,ð_register_at_fork(›–ý# bpo-30599: Mock os.1g) wheniRLðom module, ðJ# since this function doesn't allow to unregister callbacks and would leak # memory. ôreturn mock.patch('os.Jð _at_fork', create=True)(†a) # Cð a circular import structure: A -> CBDñA # NOTE: `time` is already loaded»•thereforeï!thrnòPdeadl¹$ _às_modules = { èÑ'A': """if 1:. ƒ õ.sleep(%(delay)s)ux = 'a'BCA""", /'Br8brDeÅrCrƒBDAò} class FinderÁ"""A dummy fhðtect concurrent access1its*b_spec((±method.""" ¥òdef __init__(self)m½@.num³®02o ò1 = ¶ding.Lock()k¹�]ñ , name, path=None, target Šà# Simulate somo�ñ-unsafe behaviour. Ifaÿlû¹ô)# are properly serialized, `x` will end up the same as ``šKO†wise not`assertm.S_held~8Pwith þnlU += 1snxF0.01æ(… = x + 1LlushingT pwhich f,`es sys{h¼ñer_cache when it gets�$eX�‘ít`.clearMToAdedISðTests(unittest.fCase):}_setUpåÁold_random =ô£b.pop('0', £ÍŒtearDownS#‡?`:"` O6 waJs|pwe restM1theQT# old=!at“žðso that pickling ó@s douFfail�ö # See http://bugs.python.org/issue3657#msg11046p"if¥ isé ·2ys.ã$s[.]JFelf.AŠ@Ð_Æô�ãcheck_parallel,¡g,7_os,ifm Ÿ0# TŸñtriggers on, e.g., from=A@autoMAˆ raå\À.SkipTest("cóan't run when import lock is held") õ done = threading.Event()!õfor N in (20, 50) * 3:Gªif verboseòprint("Trying", N, "mös ...", end=' 'r7ò # Make sure that random and modulefinder get reå©ed freshlyŸÂpmodnameÈ"['LH', 'K.']¾>try ‚del sys.A#s[`]y)ÿexcept KeyErrorNIpass:e,Zs = [R®__taskg.clear¾ƒ t0áÛime.monotonic"³with start_œ(T€(target=},¬c �args=(N, ÁÇ", ë*,)QÇiÁžrange(N))M I±completed =|Ú.wait(10 * 60s/dt'Y - t0ïíò%.1f ms" % (dt*1e3), flush=Trueó;" "€°bg_info = ''€: %s/%s'F@len(5J), N<óself.assertFalse(V# dU/‘(&,1õ4OK.Xòdef test_parallel_'`_init(¬»o.check/¬TŒeta_pathR1= F#ì²70.in0B(0, 2$ ÷¥±.Ž‚Greater(b».numcalls, }3TEqual1x�;¦kfinall¡ ãcremoveMJEl_hooksKA# He‚eM� instanceLÑonly used to ÃÁ concurrent é;#$i5(). ¯p# In orçý@our B «O!bee£ed at eachí•, we needd~‚A theF_4àr_cache, which:÷do by registering aI`dedicaRmJg entryÒëFing_Û ’×Ô( TC.{_spec('*ðraise ImportError  õ sys.path_hooks.insert(0, #) + ,Pmeta_ö.append(flushing_finder.Etry:;C0# F,ù the cache a first time+ U.\†_spec(''bUúnumtests = self.check_parallel_module_init(9. asï€Greater(fïer.numcalls, 03TEqual1;x, ;8kfinall  IoremoveIç2v§3!) ?@def ð_import_hangers(ì)�á# In case this2ð is run again, make sur"’e helper Li“ò # gets loaded from scratchF.* 2delMž0s['µP.threL ¾%']Iöexcept KeyErrorÒ�Epass*ÛX,. oFalse(Ž .ezsqƒcircular¼sºThe goal ofwò to exercise implementations,5ort±ð# lock which usHBper- ñ, rather than a global—>thex,¤ reòa possible deady7ith�ü¾Ðorts, for exaͤB# - ã$ 1+À A (grabbingt¢?#A)àÊ7s BrI2IBIBIAI@SuchC u°should be a÷°to detect s.Csituž7andLaresolv2°m one way oƒ0e o�ø, without freezingŒ‘NOTE: ourµð constructs a slightly less trivial¸§ort cycle,‰`in ordýÁo better str:hÆöavoidance mechanism�µdelay = 0.5Zöos.mkdir(TESTFNäAý ddCleanup(shutil.rmtree, /sm #ËaR3ùTrPname,9”tents in š–‡s.items(A2con:=EA% {' 1': }3Ñr open(oGS.join! , ’ö + ".py"), "wb") as fF„f.write(…ö.encode('utf-8')n. rbforgetq›'<ðlib.invalidate_cachesC() Åresults = []õdef import_ab():5) AGö.append(getattr(A, 'x', None)u`/ba`B`B`ñt1 = threading.T ‚(target=À6_ab�/t20'ba0w1.startH.t2j1.join% óself.assertEqual(set(Mñ), {'a', 'b'}) ñ@mock_register_at_forkUòtest_side_effect_í(g!, <'osÐïcode = """if 1èGemP ¿vy random8ti fJtV G! =h5"""s°sys.path.incÖ(0, os.curdiriÅ.addCleanup(6oremove4pfilenam>ÖTESTFN + ".py|¤with open(,Ê, "wb") as fl€f.write(�0.en‡('utf-8'7 ¨„unlink, `Ò foû", «(örmtree, '__pycache__'/Øñlib.invalidate_'sæ_v<__(p@del ^‚modules[ ¢] @reap_m!s _Ì maA-óold_switchintervalòï2try' +y:getC¸ s B1e-5öexcept AttributeErrortNpassŠ€run_unitš(‰1edI\RTests[gfinallÁ?if Äais notæxð»B€) if __º�__ == "__d2__"R¨2() ï ¿ , @.supY fromã.script_helperA Ý»_python_ok,tfailurempsys, iotUtruct”ubprocess„textwrapuwarning „operator ^c$gc”sysconfigUlocalšœñ ing # count the number of ð runs, used to createB�que # stršÄAn in8_`() numDñ = 0 class SysM23(�.bCase):6QsetUpðçðself.orig_stdoutó = sys.stdout öself.orig_stderr&?err&³displayhook+ 1Ðdef tearDown(`!):r‚>| •¨�& •7ys.} Q|ø test.support.reap_children()º0st_Winal_H Ë imI• builtinsgõout = io.StringIO() ÿò dhÀHys._t"__™;ö assertRaises(TypeError, dhe´if hasattr(�W, "_"‡P5del½.hvdh(NonePÃ.yÿ Equal(out.getvalue(), ""-�True(notŽ4Vdh(42pO42\nt¡÷@._, Zf/elâ[fRuntim^Hßxst_lost­ !añD‰ñ code = compile("42", " osingleæ¥`eval, Y Îocustom« Wf badªK(obj1rv VövÍ å+ =L)�ö.�/, ôÂ`except°  _© #uÄe©[¨e¨6try’ a mz as excC@eh(*�£exc_info() `Yœ7errȶ.endswith("c": lFüŽVB kòcaptured_output("j ") ÅÁ·Ÿ1, '1', 1#Ê" ‚: print_¡�ion(): Eõion expected for " \×  "ßò, str found" in ¯6�# FIXME:úqing theŒi a ,À or replacedºà1 in†¡# Python/pàrun.c::PyErr_PÔòEx() is tricky.’,itâÐ# call with tãwo arguments ðself.assertRaises(TypeError, sys.exit, 42%) 8å# call withoutY  ]õSystemExit) as cm:2‘q%()D÷ IsNone(cm.exception.code—òrc, out, err = Ùð _python_ok('-c', 'importà;å?()'v`Equal(Y0 u/b'C Qerr, #ÝF� integerK>/42·cLçe tupleŸû§ one entryÓõ will be unpacked!,_(42,)Ò4estringÓ£5"4"¤4„z1twoz&ieÍ[-o17, 23^(6¼€test tha e ö machinery handles –s properlHqUÊtfailureÏrºO?(47Í/47¡y«–‡Î def check_ñ�_message(£ú, expected, **env_vars)þóTJ|­Z1ð$ô 'ðTrue(err.startsm(Ö)),�:Á"%s doesn't 22À%s" % (asciiN3), !'))Ð&# J0std ô buffer is flushed before thjy#uwritten�#g"o KµËr1A._Se("un‹7,")Q":")'b2$\õÕPðbackslashreplaceú$or¿À # handler t£o stderr õcheck_exit_message(#Ðr'import sys;.,ù("surrogates:\uDCFF")',:b$•\udcff") $ # test tha£e unicode ‡` is enƒd to the»7ingJ¡instead of)udefault*u (utf8)1õ%_h\xe9éó , PYTHONIOENCODING='latin-1'ø1deföC_get¥ä¥ing(self):¤ñ .assertRaises(TypeError,ˆCF, 42å�# can't íP moreln!�type, as ÿ user might have changed it�þIsInstance(sys.†s(), stròæ1ing´ settrace()ßrdone inDsys_1.py{ =oprofil?!ABq1set Œintervaloôwith warnings.catch_(—ö.simplefilter("ignore"‚,Ç ™ ?aorig =<g *Pfor nNP0, 10@20, @1: #0 lap`o restQstart›Atate0³ß ž*(nv,ã0Equ[ pC), n•_witch“XIsetsBœ<G, "a¼AHValu€ ~o, -1.0„ C0B¾þ ì(i‚# sanityëÈÃQTrue(NR< 0.5A6tryyÓMô.00001, 0.05, 3.Tf/. ¥/ iAlmost5 @6`kfinall¬yí oìrecursionlimit/o:getB p1oldX± .±ksk¬<V zÀt, -42) ð sys.setrecursionlimit(10000) !ðself.assertEqual(6g6<), 9^1oldg!) bšdef test_…`overy(!):,Ž if hasattrˆñ, 'gettrace') andÓ(8<Kñ.skipTest('fatal error if run with a Q£ function'«C¾$ =j ¸(8Úfƒf!6tryØ]ñ for depth in (10, 25, 50, 75^0 0Û? P±çj¯)„except RE  ¨'õ# Issue #25274: The  æõ is too low at theÊB—# current@ .‚continueBD’Q5392:Yp stack Mf†Æfter hittingo i#ÁNtwicµKzRaises(1>, f[5kfinall"Ê•¨@Pñ.support.cpython_onlyå˜"_u _} |^ð"SeEaß úðmust be blockedcÿó3ðalready higher than<Ñ "lower-waterÍõñ mark". Otherwise, it may noƒ÷possible anymore to>Arese›%Öed flag to 0.f`from _<pcapi ima7 ge½93ms!2_at*(i,l ÔQ+/ =kP Ⱥ7">=UÄî• ~) as cm>o�ãÿ Âegex(str(cm.rUion),–]@"canÖ³%C³�[0-9]+ "M“* B:C3the{ë"ýNelse@Oê ðsys.setrecursio÷nlimit(1000) Afor ð in (10, 25, 50, 75, 100, 1Y200)::Eð# formula extracted from _Py_RecursionL}ýLowerWaterMark()L#if‰^> 200lpsdepth =)M- 50GOelse=�* 3 // 4ATset_r»_A_at_{(,€Ãzfinallywusys.setKJA(old ‡wdef tesr÷_fatalerror(self{A# A  0 ocfÕ if a second s¨À is hit whenuoveringù#³Åa first one.õ code = textwrap.dedent("""#˜ªimport sys^ß'f(¾-+tr.fuexcept PE m;? š†&%d½76"""Awith˜@.supÛð.SuppressCrashRe ØKiG1l¥ð sub = subprocess.Popen([¨ñexecutable, '-c', Y% i],Õ³xstderr=N6IPEÇ$2erruý.communicate()[1]Wnð.assertTrue(sub.returnŒ,ºk@=In(_Ž0b"FÞr PythonÇ„: Cannot “`stack °_flow"3doe* ªò), and verifiesgH"Jòreturned make sense$¯³entered_g =sµing.Event()E_leave$ %À_info = [] ÅeVV's id&€Wf123(m�Sg456(ú(•m‚.append(¾aget_idÂÃ6í8.seßã@.waiûtTD€(target=Âb`t.star=Pp Vö# At this point, t has finished its >®â, although it'Çe # ¦ñssible to guess whether+€ still oh¡at line orqymoved oyo~ 1"ó.assertEqual(len|üG), 105_idF%7[0] / =ä„Êfor tid in dŽöIsInstance(tid, intˆ),rGreater)0p…® O’L3In(66, dr "�_˜do0# VÀy¾acaptur­2in-7 Óò_3_“t= d.pop�ŠRTrue(/�˜ “Ú² n ©…, called*p# from +î isÉða litte tricky, since various bÿ'ofDvްpy are alsoò!'s{D staöî+(_i©0ŸÌ‘.extract_J/NŒÑi, (filename,P‚no, func`sourceh)¤¡enumerate(R ó%if:P == "*"æÈUbreakJelse$pÀfail("didn'tMdx"()üÿ &"ó@ØÅ0, "Û(()0Q# And¹ðnext record must be &4Ð. filòename, lineno, func`sourceó = stack[i+1] öself.assertEqual(;"g456")+6In(Yð, ["leave_g.wait()", "entered_g.se5]) Jõ # Reap the spawned thread.#Q=st.join(Kðdef test_attributes(Ð%):1ßÿIsInstance(sys.api_version, intè 40rgves.nZðbyteorder, ("little_big")fðbuiltin_module_È�s, tuple?ïcopyright, str2¿exec_prefix4_base_9!4outablelŠ"lePÿfloat_info), 11Ò2Ø.@.radÒ22d%inb/2Tru8*ÿ .bits_per_digit % 5 == 0m>csizeof<?>= × ?typ| )ÁA? 4:hex3hsYDhash¼9ALess8+.úpus, 2**ÔVwidthG*# 9õ should be a prime; we do a quick¸`# probŽ(QalityTñ (doesn't exclude®qpossibi&'ofF÷a Carmichael numbez÷for x in range(1, 100¥‹©A]@pow( 6ys.ñ?-1, -),H1"FÁ{} is a non-F�".format(U¡E¬#ô i6O.infÞ6/naÕMKimagm@algo9Òysconfig.get_ ÷_var("Py_HASH_ALGORITHM1+if•NPrithm P{"fnv0sip„F24"}¹*  (Nð.hash_bits, {32,w 64}) ù'self.assertIn(sys.hash_info.seed_bits, {32, 64, 128}) CÙif algo == 1:ha[Equald:°rithm, "sip}:24"¤'elc2c*=fnv]/seS ³ {"Q »`,el[ù# PY_HASH_EXTERNAL0 ,k6, 0"GreaterUocutoff9KLess†18Ûk¡IsInstance8Ïmaxsize, int›0ounicod3Ç5max.�0x10FFFFfßplatform, str1_refix/obase_p4{versiondPvi = kn xÏvi[:], tupleÝA¯len(vi), 5%™_vi[0]ÃOvi[1*2* œñ[3], ("alpha", "bet�candidatefinal")Ä4p ·�vi.majorñO.min-?croZ÷ß.releaselevel8.serial~îY*î** î*?cro* ö)vi1 Ù#viß+ÿTrue(vi > (1,0,0/sûfloat_repr_style›}1÷('short', 'legacy'zaif notÞ‘ú.startswith('win')pt²­ƒabiflags¥#ñdef test_thread<(CV¾càthread_info  ñself.assertEqual(len(info), 3) $7 'I ð.name, ('nt', 'pthread ÿsolaris', None)E @lockE�semaphoreA�mutex+conODŠðdef test_43581(•!):¨÷*# Can't use sys.stdout, as this is a StringIO object whenB1thebð runs under regrv.(y 5o"__qÁ__.encoding,ˆ7err!) LÐlinternÑ global numŽ2èU += 1“òRaises(TypeError†c�¢ = "never óed before" + str(h3,PTrue(ö<0(s)_s,÷2 = s.swapcase() µ Q2R.p# Subcl­@s of¤Qing cõ%beÇ`, becaGthey?ðprovide too much opportunity fo @sane.Öngs to happenùp# We dofÀwant them inÀ dict and if‡y aren't‰…actually4:, wXpo creatŒ e …garanceD1tha€_� by allow“)ÁvsucceedÂ@g S(str;W�Œ__hash__Š ¢return 123Áz¬, S("abc")ýœsys_flagsvZ)gõattrs = ("debug","›Á"inspect", "`activeqoptimiz ÿdont_write_bytecodeN±no_user_sit8%no ñignore_environmentoverbosMj�s_warning’Aquie6ˆÐrandomizationi\?tedšQdev_m·b "utf8 ,â0±s;) n0has&æv , ) iÀ_type = boolûU == "˜A els§ <x‚H@(getA ~m ŠJ0FreprA‰sõÎè0), s­ !&InX.l·, {0, 1, 2}ä°@rt_r–€_on_new_óç³ _o’p# Users<&n4âprevented from(÷€new inst( e#†ÛÀ, sys.versioón_info, and sys.getwindowsversion. Àattr_type = P(sys_)#õwith self.assertRaises(TypeError):+U=R(C/•.__new__(U!) m�def test_¯ðflags_no_instantiation(³œ _rÃ1_on^Cû.Le:Zl4Ss ·xò # Skip if not being run on Wú?€.support"öPibute=, ""ÑM B#()è@~Êcpython_onlyßBclea m_cacheÕMys._%e%¬ioencoding@óenv = dict(os.environ?Íñ# Test character: cent sign, Uñed as 0x4A (ASCII J) in CP424,ÎI’Ðrepresentable&2.Ô'õenv["PYTHONIOENCODING"] = "cp424"Qðp = subprocess.Popen([îQexecubö , "-c", 'print(chr(0xa2))']šw kstdoutc0IPEõVv=env (÷ p.communicate()[0].stripòexpected = ("\xa2" + os.linesep).P(êbm´Equal(out, O®>ßascii:replaceF© Ob'?' [=¨EmstderrÝ �.enz‹, err = I.'^ÐIn(b'UnicodeE2á!:'g3@rb"'Ï#'"'~�ˆ8À  ýstdout=subprocess.PIPE, stderr @ …env=env)&ö out, err = p.communicate(#ñself.assertEqual(4?b''#áIn(b'UnicodeEnarror:'g3£rb"'\xa2'"'¡õenv["PYTHONIOENCODING"] = ":surrogateescape"5Hp = 1õ#open([sys.executable, "-c", 'print(chr(0xdcbd))'],K ? ”_ZŸ[0].stripeq\xbd') �ò@unittest.skipUnless(ÿupport.FS_NONASCIIÂâ'requires OS s;� of non-< e¹CingsäzOÔgetfilesystem6õ () == locale.getpreferred!oFalse)£%FSŽ“ to match\�@def 4_ioa _nonascii(½!):?½óenv = dict(os.environ_ n^"y]~a%a)' %Ç.’Í� '“=Qos.fshe|)R 70If(3Pbase_`ix != ü 'Test is not venv-compatibleÞ ù#i õ should be absolute¬4 ñ s.path.absÇK+),\þïû # Issue #7774: Ensure that4á�an empty Õng if argv[0]›à# has been seta·ð existent program name and Python_ un÷7 toNpretriev“ie realAwÈ@For lôrmal installation, itN÷work without 'cwd'l argument. L²ó runs in the build directory, se8.EpÍ0_di°o–0dirîÑž.Ç §|eðT["nonU"+ "@ 'imtÈ"; DÌ.&"ŠEóbackslashreplace"kÀ eõxecutable=sys.eó, stdout=subprocess.PIPE, cwd=python_dir) 0õ = p.communicate()[0]$`# =aö.strip().decode("ASCII"Xvp.wait(æself.assertIn(Sú, ["b''", repr(Ð2.en_ñascii", "backslashreplace"))]) «Ádef check_fs8@ing(wT, fs_ñ, expected=None):<+¢@sNot(:Ì”Ÿcs.lookup#%ifhb fXEqual?œÓôtest_getfilesystemËÝÁ¬©?ys.7É0if qúplatform == 'darwin'¶4¥ = 'utf-8'7Oelse-D*a ¢¶€c_localeá_error_handlerp, isolaÐtFalse,  àò# Force the POSIX Y ÷env = os.environ.copyÃøenv["LC_ALL"] = "C"<ò["PYTHONCOERCECLOCALE)0)<F¥\n'.join((Dp'import—*',à¼dump(name):>Ástd = getattL!, -,ñprint("%s: %s" % XB.gerro¿creturnfØ ñsurrogateescape0out^q3;get=7 ª7¨ ?outÿ' +: “&\n!„4?out5Àstderr: backóslashreplace\n') ## õ the default error handler,ñ out = self.c_locale_get_._.õ(encoding=':ignore')B<õassertEqual(out,“‚'stdin: H?\n'+ ?out,Ÿerr: back QforceÕ� Ÿiso8859-1/ostrict,�ð&:ñœâõ# have no any effect�÷%í0Ðurrogateescap®u• õs5ðmð def test_implementation(¿!):#„a# This*ú applies to all 90s eî6ly.yò levels = {'alpha': 0xA, 'bet ÑB, 'candidate‘C, 'final&F}Nš.YúTrue(hasattr(sys.ŒŸ, 'name')–=version@&?hexC-�cache_tag…ŽV¢ õ.-0‰!s[:2], (….major, Winor)>Í+ =6Š << 24 |=E16 |‰Hi0cro,B8 | *[qrelease]$4OÀ version.sÓerial << 0) ö!self.assertEqual(sys.implementation.hexversion, %) Eõ# PEP 421 requires that .name be lower case.5z@,2³¬2.o#()¢ñ @test.support.cpython_onlyZ@def "ð_debugmallocstats(¢!):%tp# Test u,RAfromQsðscript_helper imˆ t_Žkgóargs = ['-c', '/Osys;{%']=ýret, out, err =f (*_­ãÿñ In(b"free PyDictObjects"KKphe funcõ has no parameter‹[ÿRaises(TypeError,Êc, TruekP@unit˜ð.skipUnless(hasattr¥a, "get®Ïatedblocks")."º4ò unavailable on this build"(!< #6try0-¾_ÉEcapi�except I  9rwith_py�4 = ¿ (¡iJelseB_5 = �v.pymem_Ë0ors$KO gG = (NTin ('›£ 'xHõ# Some sanity checksaØ6ys.�ÈŽGöIs(type(a), intý9if ± B¨Greater(a,<õ # When WITH_PYMALLOC isn't ,p, we doÕknow anythingßðabout the underlyinga:R[mightFñreturn 0 or somej1 grÏTsïÙ ô ªó0ileÕñcould imagine a P2@ sesa where³›number of®Ðmultiple buff!K! wYû!edA@sharÚof referencesÃñ# it is unlikely to happen in a normalqO run L@azðgettotalrefcount+;ž²pt Attribut± Q.# A7 no 6pasô§gc.collectäb ÌÕFb, a]À c = sys.geótallocatedblocks() ñself.assertIn(c, range(b - 50, b + 50)) 1ñ@test.support.requires_type_collecting+@def .ð_is_finalizing(o!):"�~js(sys./†), False°ð# Don't use the atexit module becaU_Py_FvÅ is only set{ô# after callingIUbacks)æcode = """if 1¼À im B sys!Êclass AtExit2 ä =? ø|.�print =  km|__del__bnC& tã(), flush=Trueñ:ñ# Keep a reference in€„__main__‚Ðnamespace, so" Ì#ñ destructor will be‰Ðed at Python Ù >Sref =BÃ5"""'¡rc, stdoutberr = ß!_pW _ok('-c', ÙY*bEqual(Gp.rstrip b''P@unitâð.skipUnless(hasattrÊõ , 'getandroidapilevel'),«\Q'need 92()'«ëv_$Ã]r_.P~8†‘Instance(?_, int*tGreater'0 �sys_traceNQlimitu €Y¢^7f1(EY1 / 0\,2,B +y ¬Y = %r$/f2shjcheck(C«, expected¯p”ðubprocess.Popen([„Æexecutable, ¤: % Z]E‡stderr=sh6IPEÊ(!ouT€.communi!Y()[1]øàout.splitlinesèš±I = [PFÑ (most recentŠ last):'á°b' File "<�`ng>", ~ 8 1 767/f214111óZeroDivisionError: d• by zero'ÿY0610,Ú›32f[:1] +Hð[2:]) check(÷1, traceback[:1] +c3:]) ¦check(0, [1=-1]"/-1#w1<<1000{ g-#n INoneH°ñdef test_no_duplicates_in_meta_path(self):/âõ.assertEqual(len(sys.21), +et`)) @pñ.support.cpython_only class SizeofTest(unit/qCase): ‰¸_setUpžöP = struct.calcsize('P'<Ä�longdigit.Àys.int_info.01of_n÷ im° _�EcapiLpgc_head:& =%ò.SIZEOF_PYGC_HEAD¾"_-Aof =�>.ìv_e ø0# C9Ð that the gc ’0er hñ is added to objectsÀcked by2.Õv5 ›palcvobj*•!er—KCelf. *e# bool~pare not©(5kedTSc_0getO¡of(True), ¤q('') + 2Ñéÿ# but lists areb&[]`!PnbÒè)›lerrors•Ð2BadÓDQ×_5Lof__;"Àraise ValueEdÂR$&s(%), 1%, ƒ(ƒXŸoInvali£)`eturn až2Typ � �¡œÔsentinel = [" /"]e!Isk$ U$, @) Åk _Float¬( ?4.5£¦~ #lfp æ 3Ù ä‚OverflowçG(intÜ ˜ì2intºò ‹(0maxÙ5)),Eˆ (î‘;9Bwith ?uvC ð[8*Àf(sys.maxsiz“e + 1)) õwith self.assertRaises(ValueError):,3òsys.getsizeof(OverflowS-Z[$, @jk‰0max‰! -Ó¨ðdef test_default(ÜY0=#ð.support.calcvobjEé`Equal(qúpTrue), 3b('') +E–longdigitb�]IO, -1M —ܼobjecttypesàÁ# check all !Ñ defined in O8!s/Nåú = struc #  1 0v) Z¡=1 _<%ofte# bool$(r!, gr …# bufferAW# XXXõ builtin_function_or_method%t4lenäa4P')) Jcelayout2µ# bytearrayðsamples = [b'', b'u'*10]%Bfor )¤ sv6x =^(#bÊö%(x!An2Pi—Çx.__alloc__(ø®†_iterato0ý(Ô%()¢n ¿Js=ï­n‰1±#vx' * 10µ)*V# cel @get_(Ö$%42‡/\inner,‰return x25¯xô.__closure__[0]" EcodeCŠG_ðÁ(a, expected Ð8Greater?,a)Ft p ÁTode__»I6i13¿<û: êj;2(xÕ]’0Kq 4 + ìI('n'  co¥ü(6(0,›*2d:4×_descriptor ( ¦ ö”str.lower|)3Pz# class[—ù„# member™Àtor (descripÓtor object) õimport datetimedcheck(.ödelta.days, size('3PP')Lð# getset_descripp( |»collectionsÄ.defaultdict �_factory�wrapper�ô¶int.__add__Y2ésmethod-a æ V–{}.__iterV TÛ ${}ƒ nQ/r + calc~ö2nP2n') + 8 + (8*2//3)*!n3Ÿ@longdû = {1:1, 2:2, 3:3, 4:4, 5:5, 6:6, 7:7, 8:8}�B• 16–/16— # •ëionary-keyviewx”{}.keys()y ŽA_valueCEOitemDC ëKatorÊ6({}ÉJ2nPnDÍ0key1HOQ $?s()SR #QVproxy.slass C(3\: pas@C.__-R ÖBaseException[Ú Y:5PbŽ‘UnicodeEn-rrÒ!P("", @0, 0 L‹5Pb 2P2n¨C/Ded !dbe ¯TranslateEÌ $kO0, 1Ë|ellipse«Ei9 d]eingMap¦˜Pcs, e€åings.iso8859_3+Bx = (ÿ.charmap_build(5 .de–ing_table¦xaj32B2iB§Œenumerat%5([]ë+n3ålrevers<Fd(''; :Ufloatî©%(04d«Asys.#Ðinfo ûcheck(sys.float_info, vsize('') + self.P * len)C)) u# frameåimport inspectõCO_MAXBLOCKS = 204x =.�.currentR(d�ncells =ŠÀx.f_code.co_Gvars+Ofree+ +Pextra+RPstack8 + ¥nlocals +\¹3  0+ nfUs - 1&hx[Ø5P2c4P3ic' + @*'3i 'P�J*'P'luunction_õdef func(): passx , ÐI('12M`class 94ÒÙ@staticmethodkYoo():5 z@^Ebar(clsH/# �á$ooàP߆/# ‡=?bar=µ# generatorìÿpget_genm]yieldè!Xib2PPP4›K# it]�t('abc')@l:�callable-,  yr‹Upre.find0V('','\ V# lis±QsamplJ°[[], [1,2,3 p'1', '2E3']] Bfor 53 in s+‘%!Pnnet")*zÕð# sortwrapper (¨5XXX†_# cmp*HG V«?([]ŽBpreverse+I%dMnÛ&in~0%1­–longdigit--.°PyLong_BASE¥ ** "in¡.bits_per_dscGint(?)Ÿ2Ô¡ >_**2-1C. A3„|# modul:„unittestŒ:PnPd\# Non62·- tIUžmentedTyp;!E8objX}(¨ xðproperty (descriptor “object) ƒclass C(: ðdef getx(self): return M.__x,s,•, value):," = 45del`5del1 )Ðx = property(’ , l , >F, ""Ѹöcheck(x, size('4Pi')"µ# PyCapsuleeW# XXXÕrangeiteratorX(!E(1))eldfreversb<Ed('':+nP:| ton 4\8e(66000\4(#6Zµ# frozensetõPySet_MINSIZE = 8ósamples = [[], ‘j F50)]-# =|y3nP' + X"*' '2û5Bfor f3 in s‘âminused = len(-Ùû5if %Å= 0: tmp = 1f%ö# the computation o7òis actually a bit mor.{licatedLðbut this suffices Êbfof tesb€¢¬)*2T0new;* =8 $dwhile *$<=K 1n$=.<&if>= 8Db4setu:, syj&V,Oelsed$ +™P*calc(>Ïy}EÙðû)W:P3n´Lslicì("·3Œ", "eval"�· 9 + »€TODO: ad‡2eckaQforceZ 0 ce¾O F¡/# MÀces layout oóf unicodefields •# weakrefmimportccheck(-õ .ref(int), size('2Pn2P'))FXWproxy7XXXMŠcallable* moNAdef 2ñ_slots(self, obj, base, extra):-øðexpected = sys.getÆ0of(/ð) + struct.calc(A@ûif gc.is_tracked(obj) and notS{ 0+= ¬€.gc_headkdÊassertEqual(ªrÙÉ!) 8 Gtestö#%Ð all subclass{p types ðned in Objects/ that0!ow`½Ò# non-empty _i%__‡WAelf. #!v× BA(bytearray¢`T  = 'a', 'b&c'CŠeBA(), F F'3P'‚à D(dictd$ÿD(x=[]), {'x': []}, e_L(lise%L»/[]ZOS(seY%SY0set¶ŸFS(frozenc'FdFjófrom collections ^¶OrderedDictØ7OD(¹$OºLÍ w1apython ?x7!*P8/M¾Ã0 = …@.supJF0obj(v)v*E RFizeo±¥# _ast.AST_fI(+«„)('·:try¬õraise TypeErrorNfexcept 6 tb²õys.exc_info()[2]=* # =Yeback�if tb isKJNoneZ;Ê&tb}*2i|AsymtÛOentr�SFflag[!, ©1(''ÕqP * len�<)}Òasyncgen_hookŽO'olw_,¾ÿ Isï(old.firstiter)ðnalizer) ó firstiter = lambda *a: None õsys.set_asyncgen_hooks(;= )4#0 = <g<)áself.assertIs(7.P, 2 ?[0]+±.finalizer,æX $1]&Ú@2!{=Eû2�¸Á[7+<JF*old  cu�+9°F(cur;P ¡)Œñ) def test_main():±ð.support.run_unitð(SysModuleTest, Sizeof ñ) if __name__ == "_T6__"Up() """ 6ð implementation of the PEP 509: dicñary versionning.@ imŸ ›Q fromËUCort Á4 #Q0 isró ed in CPython but other  šös # don't require toKP it _ @capiÉ;£!_m2%('#'z²class DictVÛ$s(Ð.DCase”@ype2d! = ª¿`setUp(ì+½c.seen_9s˜;et(b! =RTcheck9ý1quea@, my2i_5 = ß.#_Ã(6³žûcNotIn()., ¸ ± ÔD.add<)ÀychangedÁ÷, method, *args, **kwÖƒresult ='(& Æ, ðrreturn V¨Rdont_­¬<1ƒ M1N­¶  †2†  TEqualÍ$2,ñC1, "\ )d"�Z [@new_‡Jð*args, **kw):  ñd = self.type2test(*args, **kw) %" $öcheck_version_unique(d%‘return d 7@def QÐ_constructor(l!): [ò# new empty dictionaries must all have an n }A;1Å@new_G(”!2! 3!da# non-I¥/so¦ 1non?©Vx='x'®)±)�, y='y')a,pyZÙƒa=1, b=2>dh Û÷dont_change(d, d.copy8#"()¬�create aÇ�y with aã¿.|*$(d¨Gsetitemé ©˜1ing†3key[ÝM theS”.d #__Šq__, 'x'Ã?y?Ò”!# n³Dvalu e±41¯)™a_same_´ ¤— = objectž¦ ½@sett Sa keyh–0 ke|št!tokÛ ,Õe. ,º®6¦/oupdate¡8Q,“=?Qw4key'ß# bl_equalfÐclass AlwaysE!hvIa__eq__9w, other�%ÇBTrueiêÀ`ÉNò`assertW(/B1 ==U2�*TFalse+!+Ì>¬r Zàchanged(d, d._ó_setitem__, 'key', value1) ò# setting a key to a&` equal²the current>¶with dict._oð() must change @uversion:³self.check__.hd(d, dN ½2½Boupdate¸0I,L=mQd2 = ú@new_6B(key(/2)dd €def test‚€default(g%):TdzHÕ4setQÔ/MÓ'$'�Odon'=1 ifL¨åalready existsçö WCdont\[‡2‡P0delAMÇÌD`g# dele^Y#__\/__v0N[Q@doeswQPrõassertRaises, KeyError,G ï Á‹?pop‡'=ÀWþO ¦:pop¯å'# o/noÊ y '|3X ! Ê"z. Ãrý+1popAz 2 isOmpty �c î w[4=nõ{ew }E¿záï"À # update(ó)) calling with no argument must not change the version ³self.check_b_dont_3å(d, d.update) 5"# "()d-`.d\÷, key='new value'mQd2 = §‘new_dict(-)E 3')—% Ìl#d2_ðdef test_clear(@%):Odx¡"# ? 1 if¼1 is“Uemptykz † ºaµ¹ sä ws ùw€ class D|Å%gpass ‚SubtypeVd`Tests(5<(2|! =Xò if __name__ == "__main__"“@unit1.A() #»Às common to ›� and Userx„ import ;´collections&syËPBasic¾ôMappingProtocol(H.CCaseÍÂ# This base +°can be usedš•ð that an object conforms!1the 2# mt# puvR# Fun²Ga0fulB€override Padapt Rionark±# semanticsn…ÃNone # whichÅÓeZw@ed (dÁwrite in subì#es™N¬_referenceN±"""Return a©—2 ofòsz ar]òvariant by storagû!inLDQunder A."""Õ%rjñ{"1": "2", "key1":"61±2":(1,2,3)};Â'_‡Æ!n *±’†Ýk(°kIfulljc, dataVÉ6“?ïÓ2N`tainedœFÒD�xÞ_LJŸ80for—,¡Ww.items(¤,‚x[key] =,{ˆxÅôq_init__Y×, *args, **kwR h/._7mh€ßƒ().copy(¯·@# A Näa) pair gtd3key,`_@.popá_’Ñother = {key:}"�} Àe = self.refóerence.popitem() ú self.inmapping = {key:value}%2refF�[key] = % %àdef test_read(T!):f°# Test for ó only operations on 3@p = Fƒ._empty_ ¸ñ p1 = dict(p) #workaroundgõsingleton objectsYdYEfullXlá–if d is pÎÒŸ%p1U•#IndexingìBkey,$2 inÎb.†'s(%W†ÑassertEqual(dkF–ñknownkey = listpõ.other.keys())[0]ŒVô Raises(KeyError, lambda:d[S]fO#lenE›–len(p), 01i$@d), ,)6Õ#__contains__pA8 ‡T0vIn(k, dW A==Not@E#cmpŽiÚFp, pl d‹#NoÚp"dcU#bool�Rif p:Spfail("E&Fö must compare to False"°‰if not dCOFullB8TruA"# h#, È rE ...ªÑcheck_iterand± ¯, lst, refw’(hasattr(5§'__next__'D =7@7xE#R€set(x)==3lst Á8ì$(d™,²*r 83B1kqd*J.âP·ˆ µ ¹43»Ã`%),<a  o32E#get – = JX%(d{Ì!, Ç 5y[>�4ad.get(€P)Ý8ô�) ãBÀertNotIn(knoñwnkey, d) def test_write(self):±# Test for õ operations on mapping/@p = Bƒ._empty_ %()"h#Index4\’‚value inB÷reference.items(•™‘p[key] = 6_�ÂassertEqual(,,+‹yr=keyqBdel Imò Raises(KeyError, lambda:6x%eupdatei"p.ž.S ó‹dict(p),L2U” = list(pd ¥•K:Œd6Efull5Iíµ#setdefault"AÕ= next(iter(dÙ 3kno @ 5x_other>]&d.�(‡W)t?È( gÃ7), yq>]2O#pop?Q.pop(j?keyuUNotIn0w¤› ;dg h‘ùf = 909[’ Ø!la˜QÑ5e Ç–vI²KÅ1 = ®JÓe×\!�N €ˆ!p=7À µpµ¦ [±constructorÃÌP¥ µ  hOboola‚True(notM5ƒä3‰( ÿ¦) is Falsej>k7ƒ é¡AJF|À self.aóssertEqual(list(d.keys()), []) õd = self.referenceaH"InE”inmappingRU[0], `@9NotC_other?ôRaises(TypeErrorn�, None) sðdef test_values(¬!):ìés_empty_Ä( 1.ð 8P:R0¡7£Oitem¢8O¡6 ?len@1Œen(d), 0¢0get}cŒ œ!d[Ö„‘%],¨þ :®c())[0]¯4`ä#__Ë#__5†lupdateã## x• argument§¡'d.U.D¾i÷÷;.ºïO# Noš*�"d,i € ”Y sequŠ"àbÍEd)!, '#…IteratorXŸ{öFIXME: Doesn't work with UserDicr#‘ ße‚Attributu)v�532G!'42þPouterK“`Äclass SimpleÅÙ�vŒ__init__s Z.«hô)M,2Bbreturn<ö¬!A‘?, iK 5[i]Gwd.clearžý &()sÐi1 = sorted(d³.items()) þ i2 = sorted(self.reference, õassertEqual(i1, i2) Nö class Exc(Exception): pass$dqjö_empty_mapping(”FõFailingUserDict:eº�def keys´) Praise‰6½Rs£Ë, d.update, p%=�d.clear(ë 5 ‰¥ èšBogonIter=ÆE�__init__î(äUi = 1ºK?terKpreturn RL?nex—!ifH/.iâŸl.¾0r'š?'a''þ =tv#"0get(%,ic"5keyˆÂ!dQ„vord('a'¤.6iXgA <= ¢/z'©§‘rtn = chrK/.iÑ*Ð?i +Q$“5rtn “@Stopëa ,G�2ã8´Ûbadseq(object‹&x <n b|¦J.’ ²)4 ¨ValueError1³[(1, 2, 3)]>à# no test_from 2 orð copy as both os.environ andòves don't support it3ûS1getµWKðself.assertTrueó(d.get(list(self.other.keys())[0]) is None) (¿assertEqualD@, 3)BAd = F•reference]OTrue\ B…â˜inmapping*,Å)`:Tvaluef;{"]~=ñRaises(TypeError, +,,9!) éòdef test_setdefaul~!):8#s_empty_p(€[ uqpopitemðr,5KeyW¡0O, 42¢žk, v = kïjau[k] = vzÐ Þ,\ 'ÙºH=Ÿpop(k), v&“len(d), 0  K“òk) class TestM—ïProtocol(Basicø‰¼constructorzC. 9PÊ Î^2not .MPtype2†ó (x=1, y=2), {"x": 1, "y": 2}OêOboolã2ÜÃEfullÜ»_"y"})û8Ž./MOFals¬ >{G- :y=¢ 2:Ø�djF, []O Ï1'a'2'b'­ðk = d.keys()  ñself.assertIn('a', k) ; b!No?c!@ðdef test_values(L!):_ý BasicTestMappingProtocol.432d =’r_full_m9o({1:2}´ÓEqual(list(d.‡‘)), [2]) W¥Oitem¤3Mפ+S£m(1, 2)¨}contain«xUempty®íd!�True(not o in d)(@'a' ,'V  ß'a': 1, 'b': ¸Š�ŠÜŠdå�~èôRaises(TypeError, d.__Y#__6?len½1 2ÅPen(d)lž0get6¢ 5¦8Ÿd['a'], 1.Ê@d['b$2$¦d['c'] = 3ŒJE = 4ÃJcJ3J$’4$Bdel …[1, {ª£4, 'c': 3}M`L\clear¬¼ Ø`:2, 3:€{"d.GÓ÷?, {²Pc, Noneç`lupdate³¾ 4d## ±• argument½#d.Tg{1:100ï?2:2/1:H6 -¥O# no»™� Wukeyword\ssVx=100„7y=2Àd.update(x=1Ó, y=2, z=3) õself.assertEqual(d, {"x":1, "y":2, "z":3}) 4õ# item sequenceAd = Pö_empty_mapping(nöd.update([("x", 100), ("y", 20)]*H˜#00š0”JBoth™ÿ and keyword arguments¯8Q, x=1V¹· ¶�iterator–EfullD¦{1:3, 2:4}kN-_0à2, 3:4, 5:6}).³6s()>5 b1ñ26;ùõclass SimpleUserDict:ºRÐdef __init__(b) $., {1f2sM3:3}IOkeysEbreturno!d.*ÛfŠ0getù�?, i� K5[i]ˆd.clearÀ W1½’K¢‘test_from¡ œPtype28.8õ'abc'), {'a':None, 'b c 9©j¬True(not(dq_ is dR 2£�˜L`(4,5),:@{4:0á õ: []& Wef g(tBuyield 1R 0g()S1wY4õRaises(TypeError, {}Í', �`�dictlikeû.ïf): pas¿b"8\9('aŸ =/()?³ <1.__Ò!__*Ÿ§ F „H3(“)Ч0 my5 wµ»__new__(cls:"OÄcollections.,Juq5/b'¤uœã×ðIsInstance(ud, collóections.UserDict) õself.assertRaises(TypeError, dict.fromkeys) 5ðclass Exc(Excep\|): pass$0badE!1(hµtype2test):LˆÁdef __init__* $ržt‰V ¾TExc, v¼W, [1]8ÁÏBadSeq(objec“?ter“`eturn …Ï?nexÏ4a.<ÕÁ)Ú2M; WwssetitemçË, key, value/†$2±†| Q_copy§n1d =Vÿ._full_mapping({1:1, 2:2, 3:3}Å�Equal(d.W?), 4dUemptyeVd&§IsInstance�Ad.__o/__5v½c, NoneÚ. bpa(è pqlog2sizp‡range(12EÀ sizeû = 2**log2size ý a = self._empty_mapping()*b*ðfor i in range(x-):P‰ïa[repr(i)] = i#ÿif copymode < 0HLbL H>Hä a.p×Pka, vZtŸa.popitemT¹þassertEqual(va, int(ka)‡2Pkb, v¬tb`b`b`’�True(not(…Ï and ta != tD@. aË'1b) Ðdef test_pop()B¢BasicTestM­šProtocol.1I0 # . s Âñpop with specified keyt+dæök, v = 'abc', 'def'jª.Ìd�(4F), v0d[kôvy:1:q classËKHashý(ã "):šM1get‰mQ;L 0«ˆòExc(Exception): passoH$ÇBadEq(objectp!”a__eq__ß{, other%)`raise n>AChashC<†eturn 24™á"d[·•%42÷5ÜR”ós(KeyError, d.__-c__, 23Ç© ¶ ºfail = Fals£å"ifÂECžOelse6=/42=qx = Badë°0d[xîM x.¯0 = ac=Exc^x]ó�fromkeysJØ 1ªamydictL`.type2dV6{»__new__(cls"r>`collec#ps.UserD[u�q.•F'ab'#wòud, {'a':None, 'b }3Àself.assertIñ-sInstance(ud, collections.UserDict) def test_pop(self):úTestMappingProtocol.,D,ðclass Exc(Excepl|): pass$çBadHash(objectoGÅfail = Falseˆ¨Œ__hash__¨ 0if Â.EÆQraise¦)^ Oelse6†eturn 42Ë2d =l‚_empty_m'(WDx = ë`d[x] =Ksx¯f = TruóÈpassertR´sW¬, d.pop, x½Ðmutatingitera| #°0d[1š1:tryªfor i in dÆKd[i+@eÚ RuntimeError8=~Ëð ("changing dict size durñ“ doesn't ão"'Orepr‰ŒaEqual(Gˆd), '{}'Ü2B9 I1: 2=Q¡d_P{...}c1¤R,¤‹‹†3xc(„ä…Efull40{1:*q&)}P?y3, dX�”M_deeÆv«Ùûrange(sys.getrecursionlimit() + 100°Vd0 = “ æp&o%d0žïR‚= , ãú,eqÔK² «,Â�G ½E2}),ÇÝ |5Ã.›?Cmp> C__eq˜{, other³oŸAf r1 1½ ç0Bad¬G): 1Ø/d2/1(9xalambda3]2==1³À self.assð0ertRaises(Exc, lambda: d1==d2) def test_setdefault(self): ÿTestMappingProtocol.3R3�class ExczÜeption): pass$çBadHash(objectvGÁfail = False®¶Œ__hash__¯ 0if É.EÍr¦)^ Oelse6†eturn 42Ë2d =l‚_empty_m.(WDx = ë`d[x] =Ksx¯f = TruóÈ;assÑ&d.µð, x, []) import unit¥ð#rllib.parse RFC1808_BASE = "http://a/b/c/d;p?q#f"&O2396&$5398$'J‚' SIMPLEG; = $¡' # Each �A_qsl’õ8case is a two-tuple that contains # a string with the query and a list õexpected result. p_*_qQs = [ 1(""Q,& =¤('', '')])6&=aaa1aI B&a=bLbM§=a+b&b=b+c# a b'), ('be:b c3W1&a=2/1-^2+b *b"ú  �[v][0])}V8Àse.parse_qs(÷orig, keep_blank_values=False) òself.assertEqual(result, expect_withoutH)s,<G ð"Error parsing %r" % Œ!) 8ðdef test_roundtrips(€!):DÕstr_cases = [û('file:///tmp/junk.txt'’&@', ' +/')8 )5þ('imap://mail.python.org/mbox1š.} /3¢ @ªþ"mms://wms.sys.hinet.net/cts/Drama/09006251100.asf¿0mms« DHâ c: nfðserver/path/to/VJ!nfñ0æ4Ï A­ñsvn+ssh://svn.zope\Preposrþn/ZConfig/trunk/±BºC/Gá b93gitðgit@github.com/usÀœroject.gi#(':ê ;?','> ñL'','#V/< ''å]ã—_encode(tûÓreturn (t[0].$l'ascii¥.|tuple(x-ë for x in t[1]Ï8<62])FVbytesµÅ&x)nÖðŠAurl,.�ed, split›-7 + \$¥7v.checkRLP yOhttp~�# urllib.ÃRe.url–€treats '?ð :' as an optimized special ¹Xq# so weòV both@"nd 0s:'òõall the following.á# Three cheersRðwhite box knowledge! str_ca—ses = [ ù('://www.python.org',"< (' G '',)1).�O#abc…3 Z¹ 0 1‹0?q=*á1; ''^�2 3‘//£Ä \�51 2ŽÞa/b/c/d;p?q#f¥av# pqf-;* y]�õdef _encode(t):ÑÓreturn (t[0].$m'ascii{/¬ tuple(x-ë for x in t[1]Œ;<E2]))¢ƒbytes_ca„Å&x)n2str!ðQschemºQ('htt),s'^*b+ ,T@test  6 , ¡ µ-Ã/ 1:!8ÑL(_2s, ; ÅA4K è‚'ðurl, parsed, split3Uu6:burl = Ye + urlîXB = (+C,) +m0€ /.þelf.checkRoundtrips(Ð!) >õ-ñJoin(self, base, rel6‡expectedMn�componenë(3c÷YÀ.assertEqual‘Alib. P.urljF5), zGÜ {4b®b5bŽˆœ á3\Ç“ÉbuL!un_~ fÔ!'PCî$./ b'x-newEò ://foo.com/stuff','x://yf','/',ÐPe (=àfor u in str_càases + bytes_c7: ýself.assertEqual(urllib.parse.urlunsplito)), u)S^ SSTðdef test_RFC1808(°)ñ# "normal" Ý  from RFC .(7³.checkJoin(NÃ_BASE, 'g:h'Ë3 1ÿhttp://a/b/c/g'<?./g>(.g/=/| {µ/:8>g?y°/?y±g?y/./xDu-#sCd;p?q#s‹Dg@³:, ':!#sË?g?yŠD;S/;x !;xp ̈.–ƒ. < x: w; ùHJ../.µx.-< ·µžH_# "ab„0 žfªg“.>.ã>.èã ›?/g.~€ À://a/b/g')  ò*self.checkJoin(RFC1808_BASE, './g/.', 'http://a/b/c/g/') ?/ A _g/./hAhBCA„`# RFC ¹B and ò630 disagree on these (according to)W808),Kô so we'll not actually ruCòtests (which expect{¦behavior).N Vgg#:96') sñ XXX: The followì´ðare no longer compatible with G3986Iƒ 2../Á!9../È! C IL/{­ª#‹ Ï ƒÌ]@def ü�_RFC2368('):0òIssue 11467: path that startse±a number is`õparsed correctlyN]ñ.assertEqual(urllib.1A.url ÷ ('mailto:1337@example.org'Óª-7 40, ')S ö.96ö cases fromCR 23961xÇ _ _!g:§3 ž8mŽ6< >.g/{  ë/ZW µ /:8>g?y°/?y--#s?d;p?q#sCgDì/?yBD-;xÈ?g;xÄ!;xp 8ˆFƒ.y< xÀ/b/') ó' self.checkJoin(RFC2396_BASE, '../', 'http://a/b/') ;g<g=)..>; ¶< ·µ8', ?)géob/c/g.³ ®>.³gf?¼/..€\./../C¿O./g/>¥Yg/./hh//h€gÂCAŽ;x=1/./y‡y‹0.KEn?y/./x�g0IJ/#s’Hy Ñ0c/gI%) Üð)# XXX: The following tests are no longer compatible withG3986I'.Ú#¨F8áSL /’‹ Ò”\1defG@_RFC((%):/ �&�H?y',�oc/d;p?Ý @;Ø/;x` >`g:h','° g¯ˆ; u ì=-g/yÀ self.checkóJoin(RFC3986_BASE, '/g','http://a/g') ¯self.check897(?yoŸb/c/d;p?ywgA¶/#s?q#s�Cg?/?yAÄ,;xÄ/;x¿>g?¬3Ä1g;xà ÁqÄ.?:/;' vt.u: �bŸI../.²v.³; ´²0/..X ’“÷# Abnormal Examples dThe 'a"ø!scenarios' are incompatible with RFC2986 parsingIAests6öhere for reference.r" Ñ Ða @C!/N:#;&gx.C >=.Cgó>–...}~r½o±>/g/9/9\g/./hÞðg/h') só)elf.checkJoin(RFC3986_BASE, 'g/../h','http://a/b/c/h') s@ Œ;x=1/./yCgyIJDm?y/./x‹Ô0HI/#s�Gx ¦gHI#® åg ÿg') # strict parserö H6PtrelaxedPQõ# Test for issue9721 ¶ �}de', ';×Q;x') Cðdef test_urljoins(Q!):ÇeSIMPLE:/g:õ 1þp?„<d) }¾:g:/./<',g/±/g/x w¯/86?‰/d?A \>g>îN/¬ŠŽ .ig.£: t8 s9 ‹àI../.¯t.u%²&9/g/²a>/g/ g¢ ðSIMPLE_BASE, 'g/ó ../h','http://a/b/c/h') ò self.checkJoin(SIMPLE_BASE, 6g?g? >d>-?y@/?yBgCl?y/./xŠgK@–///', '..@/Â', ®g Å~ J=./g;ðsvn://pathtorepo/dir1@@dir2!2Ösvn+sshU%Y "ws×0','©£<'ws34ó2# XXX: The following tests are no longer compatible with RFC3986 _? # b 2../½÷.®žD /.') ˸õ for issue22118 duplicate slashes0°A + 'Ìgfoo', , xòNon-RFC-defined@p, coverPõvariations of base and trailing’#¤ iß1d/e¦Y1f/g]a ó OòNL�õ;hž˜K4—äñ 1Þ+:GUÝ×�× 23703: don't˜…filename0 ¦albx1deff�_RFC2732(4&):CÅtr_cases = [¬(õñ Test.python.org:5432/fooÌJ0', /),Kº12.34.56.78GC Z[::1]= ::Šx À[dead:beef::ð1]:5432/foo/', 'dead:beef::1', G), §('http://[,FEùcafe:5417:affe:8FA3:deaf:feeda �´ C'faCŠ Ù::12.34.56.78p) 'IOffffN ¾,::.` õTest.python.org»t', None¾ìB> U[::1]8,n ,9BnBzA² + & iÖ ¦> dÅ HÇ É 1I ´)[ Z: / '[&C\9]:´Ì™ ,]B; á_ ] ¬€ ?`(lÀ  8 ¶*']8õdef _encode(t):aÃreturn t[0].#ß'ascii'), t[12\ôbytes_cases = [gòx) for x in str!6ùurl, hostname, port.7 + ] ¶ñurlparsed = urllib..Y(url)éðself.assertEqual(#5&d.†@ d.�V) , (%) WÙúV³hÀ4.56.78]/',  û'http://[::1/foo/', #: 'f#�bad]/bad+ O,õffff:12.34.56.78']…òbytes_cases = [x.encode('ascii') for x in str(=¹invalid_url&7 + \:qþñself.assertRaises(ValueError, urllib.parse.url ', i!) O€def test|pdefrag(Z)m´Ü4(š°python.org#B>', )¾E+¥Z'</‚/Cƒ, „…/?q‡/?q‰.‹�pŒp‹ptŒ �ÆRFC1808_BASEƒa/b/c/d;6f7O23967 6NÏ_tůÿreturn type(t)(§%t)è€\xÕRurl, S , wÛ�result =ÆNF(url¡Ú² bEqual(B .gò1l()32, (e³)5aë1Cmentf‹üsplit_scoped_IPv6–p5Pö[FE80::822a:a8ff:fe49:470c%tESt]:1234'° Eÿp.hostname, "feM "G Ÿnetloc, '“~æ#b'‡T(ç bè2béðdef test_urlspliót_attributes(self): õurl = "HTTP://WWW.PYTHON.ORG/doc/#frag"0õp = urllib.parse.urlsplit(url)'fÿ.assertEqual(p.scheme, "http"+ šnetloc, "�5 qpath, "µ* �query, "& øpment, " - `usernaßONoneÝ ¯password, +BhostVÿ"www.python.org� Lport^ð# geturl() won't rõn exactly the original URL in this case×q# since.Ð’ is alway*·-normalized5€We handl9áis by ignoringJñfirst 4 characters of5URLGSÓP[4:],— %) 3ÝqÚ://User:Pass@MA:0806?O=yesõj¨ ù òY   "ËZ "›- */80— LHD�# Address®ð issue1698, which suggests ê«Å can containˆW# "@"ßð . Though not RFC complianÐmany ftp site]7lowJòand request email a ,$s ‰/s. Ï@example.com•´? "P׿ 9+Àhostname, "wóww.python.org") ÿ self.assertEqual(p.port, 80% õgeturl(), url) Põ&# And check them all again, only with bytes this time>õurl = b"HTTP://WWW.PYTHON.ORG/doc/#frag"10p =�ñlib.parse.urlsplit(—å æïscheme, b"http `netloc, ’6 @path4¸+ Pquery,' ü@ment* . `usernaäONoneÎ ¯password, +BhostV?b"wV_XA[4:]\ `"µÚ://User:Pass@ŒA:080x?[O=yes:lª È H!ö[ EQ! b"Ï\ T b"¢. W+­$MÏ@example.comY—¶€ e†Ûà Åq†ð# Verify an illegal oõ raises ValueErrorâ¤a:65536éßÀurllib.parseó.urlsplit(url) õ)with self.assertRaisesRegex(ValueError, "out of range"):AHqp.port ð def test_attributes_bad_"(i<ð"""Check handlingb€invalid 1Qs."""Wg÷ for bytes in (False, TrueS(Qparse(qurllib.,,  IM1ortL°"foo", "1.5 -1L0x10:_�subTest(Á=!, u=,ñ=ö†Lñnetloc = "www.example.net:" +B./0url8phttp:///M1"ifn ìS E2 = ö.encode("ascii"i, “?url62p =5 Æ YhÑpEqual(p$Cloc,§˜² ž‡  `Bout_/ s# This Ùõ is straight from RFC 3261. It looks like itÈò# should allow the username, host "and× to be filledEðin, but doesn't. Sincj�'s a URI CckA’scheme://ë€ syntax,&†A†related 0DÊåbe left empty. 0uriÓñsip:alice@atlanta.com;maddr=239.255†1;ttl=15RO %i$O"ã'yONoneR ¯password, +Å+PR€geturl()"i)ÊÎ/ =*?(ur!òð # You guessed it, repeatÍz  ôLV inpu«Á/b"ÂDÀ) seólf.assertEqual(p.netloc, b"") -se(ïusername, None+ �password+OhostV?ortRõgeturl(), uri) Óñp = urllib.parse.url ((ù ú"Ñðdef test_noslash(%):>õ# Issue 1637: http://foo.com?query is legal4C m"NqexampleR@blah=d5"),T§ ('?G', '@GK)½£b¤,b¥b¦Sb'', ¥©Cb'')ÀžÞwithoutscheme¤@TeståØ - .CËv754016:0¡goes wrong;� IP:port >outHò RFC 1808 specifies that 1³ should staE0 //–w‡ expects˜Qthe scôotherwise it class_ e ”`ion of»• as path.Hw6[@('',  5ÿ"//www.python.org:80p *t‡ } :‚.?','†ÿ # Repeat for bytes input… b"f#"', b�g €Œ„!f”4b–�z($ðseparator(self): õ4 # Issue 754016 makes changes for port separator ':' from scheme # ñself.assertEqual(urllib.parse.url Å("path:80"),;BP ('',# %)),g http:"),(' E[ Q$sRsJVS$ÿ://www.python.orgÈ . ‰†ÿ# As usual, need to check bytes input as well`bÈ Bb'',ˤΠb"ý}bÐPk'X%ÖYs¢RZ%Ý}|ß ë1)) ®ðdef test_usingsys(N!):Säð3314: sys module iõed in the error6EÈÀRaises(TypeE$,, ÔÜencode, "foo"˜2any.™0790™ñ 3://foo.com/stuff has netlocZ/".¢j sYu*ƒ('s3', '‹ �  b"x-new  ê‘ :�šYÿ?query#fragment©4UËXµ P ¶­=¥~Q# And#G/..™/b"šb›bœ%b'�   Àual(urllib.p�arse.urlp ÿ(b"x-newscheme://foo.com/stuff"), 7(b';S', b'= B %))Qñ self.assertEqual(urllib.˜¡ÿ?query#fragment°9Zº^'½B´C¬jòdef test_default_ê(~!):#áò# Exercise the %å parameter of 3P) andfsplit(ÒÏfor func in Î,7 åD‰�Pwith ¡�.subTest(VPtion= .2�result =ö("http://example.net/", "ftp"®8iˆM.!, N8'tb'ubv$Pw ¯e("pathä¼ó Dù=¹K#b�LMˆÝ )>"ˆ;b<K, ""@·Y°_%sZ Vallow.cËQs = („3ò xÂassertEqual(O.=O, "":_True(_c0get^,Z`).endsþñ("#" + expectedº)v°öB"", ê ¾šè7 ׆Nx Ì‚{·B* p¶ <ïÃ´Ì  x4è ³)m ü Iñ def test_mixed_types_rej%(W‘# Several5ñ%s that process either strings or ASCII encoded bytesxáñ# accept multiple arguOÒ. Check they � ¢ ¢e inputHßÝeðRaisesRegex(TypeError, "CannotH¢"ÙŽ l½÷ ("www.python.org", b"http±Ib€S²þgþf"unþ(î-, ‰4"",H C�ý… ˜Œ?,""�P ( Àw.python.org3","C)) õ*with self.assertRaisesRegex(TypeError, "Cannot mix str"):BIó"urllib.parse.urlunsplit(("http", b"www.python.org‰?,""ŒNBjoinˆ8://‚! bž MŽy/, Žgðdef _check_result_type(·,�“ñnum_args = len(str"†._fieldsäQbytes% =Iñ._encoded_counterpartˆëu,6Is(AM._de6žA$tr�„('',) * °$WÃ/(b'Ù¿ (*< è+_D* /Õing = 'ascii'šeYv'strictQEqualws d /‰1.L/():-O vÿ~' B†*", tŽ/ J–",  Å {X.eÃ:-QÅv}Oing)¸& B†(y $Ž J–¡(Dtest&Qpairs'0# CJ SQ and pò‚between X B\ü0[) qDefragR«,%S"$ PQ $]R3for©”$ i¸ðs: s÷elf._check_result_type( ñ) def test_parse_qs_encoding(self):&*<¡ = urllib.1ô_qs("key=\u0141%E9", Hµ="latin-1")L[Ã.assertEqual™Â, {'key': ['Kv\xE9']}:†JC3%A‰_utf-8‡o_ascii‡"aufffd\%9E9-��,-ˆ;,#sïerrors="ignore`!̓ l$l4![((, /)] ‡(ˆL� ˆ%&Ž/-'‰;[ ÔÎ 1urlè¼e_sequences8q# Otherfàs incidentallyJ>� things;%ö non-covered cases…3# Shñ and object values.›4%¬@({'adö 1, 2], 'b': (3, 4, 5)}, TrueXõ# we cannot rely on ordering herewÑC setÐð .split('&')) == {'a=1', 'a=22b=3425'}–ÅÖclass Trivial�w__str__nÀ ó return 'trivial' òresult = urllib.parse.urlencode({'a': T8¥()}, True)@òself.assertEqual(QT, 'a=n)o•def test_^°_quote_via(H%):WF— ß'some value'}”0"a=2+2"1nµ/another'},³Qì=k‹P¼1%20¾3%2F„È]¡safe='/', »¾Ò2T"/g¬from_bytes,3úRaises(TypeError,× Jv, 'foo'~  7÷ (b'archaeological arcanaI”  :=%20<…p'O"unÐ/toO 6¯'abc%20def‡b/ -i` èæe3-1, b)í 0¯ing='utf-8µ m ¼�='strictá¬issue14072/p1:ÿ split('tel:+31-641044153ª¶°p1.scheme, 9+ path, '^/p2–•2•&2.•]"# ¼ð the behavior for9 àU#U~ðparse('tel:+3164³1044153') ÿself.assertEqual(p2.scheme, 'tel+ Æpath, '+3164]^ðdef test_telurl_params(q!):"ƒñp1 = urllib.parse.url (ÿ:123-4;phone-context=+1-650-516ž 1É#1.ÉoV É?, '–àï+1-201-555-012š Ñ!`Û?') ÃK7042¢¿example.comM l£oU Ç ¢ –à863-123†0914ºŽ ãrY ç6+1-™æ‹¼Quoter_repr‰q �1(¡Ï_ALWAYS_SAFEIBIn('91', l])U�d ‚yÀon.org:080')?, õ ('', 'www.python.org:080'))5ÿ self.assertEqual(splituser(:o ONoneq*ÏUser:Pass@')i ')áÏ5Â@example.comj| GˆJ!) j‘def test_^ppasswd({!): Âá# Some of the $Cord ±÷s are not sensible, but it is added toMð confirming to RFC2617 and-@ress¥issue4675.:¢÷ = urllib.parse./@¾0d('Hr:ab'), (� A,\nCEtEErEEfEEvEE:DC CC) 2"/ 2$!W+1:a+Š!+1FŒ:ªZ¨ < g>µbwa 7X', ['BÍE5]))FÇ� H'), ['?ºÇ!Â< Á¿ÿ Õn Öñ# Normal cases are exercised by other!s; Àdologic6l©á# with no key/p� pairs. (]d÷ ensuring coverage«|7dmØ$#('ê0foo"0barï©@ =:a:t £�0foo o, NoneÍ õ=ßÓù ìŒto_byteslresultè.÷'http://www.python.org'È Q/, :úRaises(UnicodeError,y‘2rü/medi\u00e6val'lunwrap lurl, '3Šò if __name__ == "__main__"Œ@unitM.¡() """Unit�ñs for the memoryviewàCSome"ã!in þa. Manyðs that require _hàbuffer.ndarray B†” import ¢F@.sup4sys $gc tweakrefqU$ioDcopy ñ pickle class AbstractMþRTests5bsourceðÁ = b"abcdef"‘ @propertÞ _1 qreturn ;"SGá_Fpfilter(â1, [T0ro_2,b!rw]Ÿàcheck_getitem_n#¨Q, tp)ïÀ b = tp(óself._source) ôoldrefcount = sys.get&(b)mCHviewYö assertEqual(m[0], ord(b"a")D*£IsInstance/?int)S5SfS*/-1+6+ ©õ# Bounds checking0ÃÿRaises(IndexError, lambda: m[6]Î4 /-75 ³maxsize> -?o# Typeþ( ý?Non� 6?0.0 57"a"5¥}¯ð â', !) ;ðdef test_getitem(÷!):9 for tp in v._types#?EQ_with+<(tpiOiterf ab = tp9܇‹_·»ðlist(m), [m[i] èiçìrange(len(m))]½s&‘_readonly�/bif not,!ro-ÐskipTest("no K-L \1 to�"Uú¿QtÜÁà! âg(valueÚEï1 = "›Zô¿N!, 4&65fbmemory ‘0:Ú‘_writable–0 w K  tpÙšrQP#�#Bó;'1'¡_àcontents(tp, býg1bcdefÕbm[0:1]Ô7b"0êI0Ið1:3] = tp(b"12")  óself._check_contents(tp, b, b"012def") .÷ m[1:1] = tp(b"H:F:abceL /•ð# Overlapping copies of a view into itV3Pm[0:3‚em[2:5]%:cdeª/m[Ç[2 = mdPababcs0õ def setitem(key, value):!�Pm[keyÑ2tp( ‘# Bounds æ5ingîô assertRaises(IndexError,t0, 6 aí8/-79$¿sys.maxsizeB$-C�# Wrong iìÏ/slice typesLType?0.0ž9O(0,):$®¯(0,1,1), 0G%80, JG':$<"a"ò# Not implemented: multidimensional´§»Xs = (ÍÛ&2)»íFNotIp ßTs§0TrygPto re¢õ the memory objectHpexc = V¯^õ if m.format == 'c' else &;®7exc”{“ 0/ab2 ©i(p/b" A50,2,å…m = Noneö`Equal(Çôgetrefcount(b), old!) ;"�test_del'H! for tp in !._î @bÔ fsource;a# =>U*(bBwith Ø�M0delO|H';:4] €tobytes(Ô€À for tp÷ in self._types: 3m =‚view(tp(+‰source))-êb = m.tobytes(Â# This callsRqgetitemvð() on each separate FÙ of b"abcdef"lùexpected = b"".join(!Ŭ hUÐs([c])) for cþb ³>ôassertEqual(b, w* IsInstance/o!) ™ñdef test_tolistI)nŽ tp�x�)l�l¯Ù1l, '  ´|compareµ€# memoryÝ#n )]e6ñity with other objects£õ# having the buffer interface.'=P_®s £�ÁTrue(m == tp=(3-9@Fals:!:&t"{s¬r8 «q1: r 9§O== m¦Y$?[:]' P[0:6]£m, æB[0:5-òE1# CóCisonÀºø which don't support½5API¶IëtœÔÌ O != +W'^J +!u ¯³# Unordered̰Ó=96(m,ŸÌ%üúRaises(TypeError, lambda: m < c<1c <Ã1y/>=z(>±<ðdef check_attributes_ôÅ4G, tp!WÉ«’m.format,E >0eCsize2Àize) ó self.assertEqual(m.ndim, 1) $¿shape, (6,)(Ÿlen(m), 6$Ám.strides, (i�itemsizeZ °m.suboffset9…‘return m ¿ñ def test_attributes_readonlyo!):(êbif notvro_type!ŸÐskipTest("no K-L .1 tom"ï2m =QXcheck†Awithd‡.q:m ™nm, True)â�writable[âw~â Ká/páMFalsâœgetbufferØ # ’â PyObject_GetB)ñ) on a memoryview o#.ö’for tp in¨sab = tpu†._sourceǰoldrefcountðdys.get*(b-_� 0old=OmOs#Çtr(m, "utf-8~œH_ô contents(tp, b, s.encode(: [ sÚÜ ± BìENonen’Ú WGb), S é!gc‹ØÄÝ¡isinstance¶HžA# Ifðs a factory rather thaRQplain ,  âDlBinue¦ßclass MyView(z°�__init__æo, base*NÜdà(/ ŽtSº?(tpNOpass5R {1 2ÿ# Create a reference cycle through‰ Vö# This exercises mbuf_clear()´+•%MyÔw(b'abc' %%lC = M4(¹ b.;máyb.o = oûwr = weakref.ref(oH0 = J: î#émust be brokend«gc.collect¥ÚI�(wr() is i , ; qàis exercises m÷emory_clear(). ùm = MyView(tp(b'abc'))#o#zObject(ym.x = m/ m.1oûwr = weakref.ref(oH0 = 6INone9ù # The cycle must be broken'~gc.coll¡ð self.assertTrue(wr() is i , !) Jðdef _check_released(=‘, m, tp):&9%0 = [ô RaisesRegex(ValueError, "K"ïQwith DŸ: bytes(mBm.to! 8lis“\Em[0]´  = b'x' ?len“oformat8–m.itemsiz wF.ndi* �readonlyYOshapVstrides:·qmÇ6pas=@# st"pand rep Östill functiovþ5In(é! ml!",ImJ1p2—Equal(m, ,Q6Not"�vÑ%�_source)Ž=!tpõ.2ñtest_contextmanager,’for tp inj_typesrLb = e §�µÃbü­Å_ as cË8íJIs(c/?! æà…c# Can Ûð explicitly inside t²) * ^Å ž#m.T(”wÀpZ“£‰.I+úbe called a second time (it's a no-opéy!eÈ4”writable_\ ®ó# Issue #10451:ºv� incorrecÕ`expose§Ih €# buffer�o� causingë¢gfault if Emmap>$tpE!ro+!ifG¦ (yÐskipTest("no –-< o@ to ÿà") b =ó tp(self._source) Bm = fview(böi = io.BytesIO(b'ZZZZ' 6ñassertRaises(TypeError, i.readinto, m) oñdef test_getbuf_fail–!): ’U _¨L, {}VLhashO€# Memory4Ps of –`only (/ôable) types are ¥, and they™#1 as€(obj.tobE()).'$tpP0ro_YÖif tp is NoneñõÁskipTest("no§-¨D1 to9"}?b =Ô!B´QEqualB(m),Ö¦b"abcdef")j°# Releasing% mQa keepsastoredEö value (as with weakrefsR1m.rR&e(™"@Hash—a•1for“ðfirst time after it~{d˜ð# results in an eÁ¿ä3Ú 'V!(r"P_writ¢Õ)Ê unC>é›w›( mšB'\!WCheckß/ /püƒsŸl ÀeL = []‡÷def callback(wr, b=b#ˆL.append–Dwr =Xu.ref(m,OS*ÔðqIs(wr()mYdel mž¤÷.support.gc_collect®<[Û� |L[0], bºŒreversedÈœO�aslist = (ˆAm.to)  õ@&8B)), T8KŒm[::-1])#¬issue22668%¡a = array.ð('H', [256, 256, 256, s256]) öx = memoryview(aæm = x.cast('B'b2H¥c = b[0:2]]d+]6b) Fel bö self.assertEqual(c[0], 256y $d$ßc.format, "H"L (¨_ÃîIî �±mõ* # Variations on source objects for the buffer: bytes-lik#, ñn arrays # with itemsize > 1. # NOTE: supportUõmulti-dimensionalsðis unimplemented. class BaseB€MçTests(Abstract!):ˆpro_type`5w´0get³sÉ1= 1h = 'B'™A…™ANoneVr˜plambda )B, b:X.ªÒ('i', list(b)• ¸=1.toÊ(Gæjp$).¨þ"i'‡ð@unittest.skip('XXX ñ should be adapted÷@non-zQs1def6B_getk(ÊuOpassrFNotI2‘Error: to,d) only}sà · }1z )pindirec9‡ levels:P, sliHf& # *PThis m+aant toa alloc©¹ subtletiesÛ[_R,gWgreturn¤C(objq:ãcheck_contentsD!tpH$, R> ”…obj, tp(,)8´S-µ†_*sÁ¢"XabcdefY"›Õ„žÒDñW[1:7]Mè2U íw±B_refF3eAp in÷.†s¾< Ó!tpŠ"._))ôoldrefcount = sys.get"(mô)8m[1}ÃÀertEqual(sysô.getrefcount(m), oldñ ) class BaseMemorySliceñTests: source_bytes = b"XabcdefY" òdef _view(self, obj):>Qm = m]#6÷return m[:7][1:]Pãcheck_contentsZ!tp^$, h|õ .assertEqual(obj[1:7], tp(1ñ) # Concrete test %esé³ P(unit,.QCase,Å:*!s,OBD26s):ÜHÚ�structorÝÊ¡for tp in ÔS_type‹5@ob =×!¡)’YTrue(ƒ),ject=ob3÷Raises(TypeError,ïh5 ä=$qargumenµF>*_Array,Dae|_assign÷# Issue #4569: segfault when mutating aƒõ with itemsize != 1Aa = n.ç('i', range(10ò ÄašOnew_FP9, -1Ma[:] = :Н¾"a,"°  S¢˜+™/5pas¡>iFç i Òn0Ü'Cá0sæ _POtherdöBì__castúó15944: Allow allŸ‚ formats A 1to ·.icb>àest.support.im’_module("%"ç p6ùÔ(ò.c_double(0.6))ÝàLd = #H I0d).ª7("Bl@m[:2! p6 ¹1m[28 p6  9àd.value, 0.6) # õfor format in "Bbc":$òwith self.subTest(/)'+ùd = ctypes.c_double()M&öm = memoryview(d).caV/J[:2]3*p64"8/2:8 =2:]8ëñ assertEqual(d.value, 0.6) 0–def test_ÈP_hex(<ç# Issue #9951:õ.-Á) segfaults eñnon-contiguous buffers.r9Ðx = b'0' * 20*m1!xv m2f1[::-1í©.å"m2”G, '3b ðLcopyæ Ðfb'abc'�Ûp÷Raises(TypeError0åb.,(m}opickleàPprotoßbrange(Hû.HIGHEST_PROTOCOL + 1�¼À]‘dumps(m, |ó ) if __name__ == "__main__o@unitS.P() # lð to see if openpty works. (But don't ry#Pit isô available.) import os, eŽÀnot hasattr("b"r©3P.Skip“S("os.+0() Fo"êrclass O°3x.CCasecH Ôøaster, slave = rõTñddCleanup(os.close, m?ƒ*a)!ifÐ@os.i"y( êNpfail("S €-end of �!isA°a terminal.‚os.writeW—, b'Ping!-\˜‚os.read(Óx, 1024): X'X'¶{X`from .j_‘* """UnitÚsõ zero-argument super() & related machinery."""jsz‘warnings |{A.sup•|echeck_(" CAÃ&f#¡return 'A'@2amethod5ccm(clsl�5,;)j3B(A'8mŸ.f() + 'B{&IPcm(),I‰C‰!C‰À returnó) (cls, super().cm(), 'C') class D(C, B): def f(selfereturnC•f() + 'D'2 cme2 {D{3E(D5Dpass‘3F(Etf = E.f3G(A/ÁQTestSß�unittest.uCase): ¥ŒtearDownÞð# This fixes the damage that N±_various___2ñ___pathologies does.f,•nonlocal -0 = ¡´ üst_basics_working«˜ñ.assertEqual(D().fÑ1ABCY„ʝgetattrU .fY'V2subY¿no_override]E²± ÜE.f(E()‡ÿunbound_method_transfeçFŠ_F.f(FŠˆs_stillA’•(A, 'A'))/ A¿-GXGXGX-†H=3_inê¦od = D(ÉdœVd, (DP, 'B'ôCDeY eYVe, (EYæÌwith_closure€Ä# Issue4360:� did not á in a functionCdáÓ# contains a aC% Eá1ƒ �snested(DdÏ"E'‹&7 h¶E¿%~f CPSee iGu #12370 XÍP¥t5413_x = XK xX'É%x.`V, 413+ÌU‰u1‹LfÅ/œ³Is(X.x, typ«�À with self÷.assertRaises(NameError) as e: úexec("""class X(!__)__7~def f()37õ""", globals(), {})JCself¬÷Is(type(e.exception), »ñ# Not UnboundLocalÔL¦ Áx �. £Y = 42ÛJÄbEqual(tUs()[".f"], 42ù6del (‡XgNotIn(NÆ, X.__dict__U@nonl-[ù÷ÕTUtest_ð_instancemethod(óOñ# See issue #14857H»ëafE.oreturnu„PX().f§1X) nU ¶}³3@Lo«wWf(clsËÉostaticÊ4MËÈIYª�ód€þà test_nÄamespace = n + Åreturn None õ4# This case shouldn't trigger the __classcell__ deprecation warningL³with check_•s() as w:$”ö .simplefilter("always", DdWc)@�q A(meta j=Meta)eiÙ@staticmethodCodef f(7-ý%__>ôself.assertEqual(w.ÐV, [])[*QIs(A,z õB = type("B", (), test_Áõ J0B.f-BKÇ9¬P_mro(4Üõ# See issue #23722Ò=H! =¤Ã^(ªP$zk # „­P doesXµwork yet...+-æ__dict__["f"](!—€super().~¯ ¶÷‚nonlocal‡L ¥ ,q1Å6Is(.3, A¨>Xÿ_expected_behaviour¬ § Á__new__(cls,#c, base < ÝP”�_snapshot#�_.copyЧm#œais injGQ into¿ž2 byuompilerÈò# when at least one 9ã needs it, and&õ be omitted otherwiseMo0[W—€WithoutCa?RefÒ EpassbiyNotIn("P"æÙ„‚ # {£ zero-arg Qô or an explicit`Õ__ reference,ƒ0`exact ×50 to1`popula3'byG[.ûC@zfV YE&__fª_Ð^U]Â>p_closur›s«0.f.l^ 0len4hodIð), 1) self.aóssertIs(class_cell, method_closure[0]) @# EnP the .õ" reference *doesn't* get turned into an attributeK±with self.a…„Raises(A)uError):0‚PWithCªaRef.__µ†1__ (™def test_�_missing(nRñ# See issue #23722Ei`# Some aeñes may not passÿ÷original namespace to type.__new__O!We™ù that case here by forcibly deleting ½Dˆ` Meta(dȱúvQ(cls,•c, base ¢ 6:¾i.pop('}v', None1 reà„ super()ðz ¢=Ã# The defaul áshould continuIPwork %õout any warningst check_z() as w6ò.simplefilter("always", DeprecationWd ñz|4outB(met=”Y)¬{é„Equal(w.—X, [])j” zero-argd0 orH„explicit%&__‚µ, we expectx€# __builÏâ_¤oemit aø€ complaih« Ha__ was Àset, and ask¸$if–”)§propagatedL (.áIn Python 3.7,…ú� will bec›‘a Runtime(B$edE = (_~â$__Å).*õ ³)',;)2– • . ¡/ž1f ã ÍCtìP__ st™ñgets set despite%Û(0Is(ê³x).f(),  vyU< isge5ry—9ts.catch#/s(�]0kéÚ> wzd i8Ï%ÓÀ__class__ ó def test___classcell___overwrite(self): ÷# See issue #23722O6Iing PÐ with nonsens?õ explicitly prohibitedK‹§ Meta(type€‡´ó__new__(cls, name, base pspace, Í <@/")['¦A'] =4ˆ.ÿreturn super().}%) E€for bad_Žû in (None, 0, "", object()¨1|”.subTest(C= 2¨6ÿassertRaises(TypeError37oaA(meta ={@o <Bpassð›OQwrongPPPointM1the™à reference at Z µ� is alsoQF>_cls =1@B = å‚("B", ()Ï )D1‰#clpõ, íÜÌf°q�D+__�obscure_6 _e€sOd }1(ý ÑbRuntimÔ6, f+PxQYdel xLc , ¶iFX~„nonlocal)__�#¥K±SX().f…—•‚@_as_Q ŠÑLmeth-š–Ík+f(Wk = XÐ>)g)UkSgQc = fŠ@closfE_[0]á.2@, X.Ó<, cέ_init_leak­3# IøR6718:÷"._2 _ 4ðed memory if call€ultiple ³%s.¥ð# This will be caught by regr°`.py -RJt)`>ÑNOTE: Despite u\n @‘ a directŠð of super.__init__  ó# is not endorsed. õ sp = super(float, 1.0)õfor i in range(1000):E<ò".__init__(sp, int, i) if __name__ == "__main__"D�unittest.¤() import #_ð_multiprocessing from  =0supE| B.PGOqUraise`².SkipTest("B%€helpful ü@PGO"É .ƒ�.installñs_in_module_dict(globals(), 'fork')™''¤þ òPaudio¡s$op„byteswapN$io estruct%ys àunau class S'Zj .AuPWrite)s, ,'ãWithSourceFileJ0‡ w@PCM8:(…,¿4CasHpsndfileoñ = 'pluck-pcm8.au' "Ñframes = 3307€nchannel2Ñsampwidth = 16@rateA1025n8!48pcomptyp&R'NONE{šŠbressed F¯.å�hex("""\Vó0 02FF 4B00 3104 8008 CB06 4803 BF01 03FE B8FA B4F3 29EB 1AE6 \Dõ,EDE4 C6E2 0EE0 EFE0 57E2 FBE8 13EF D8F7 97FB F5FC 08FB DFFBDð&11FA 3EFB BCFC 66FF CF04 4309 C10E 5112 EE17 8216 7F1°%12D 49&ð20D EF0F CE0F E40C 630A 080A 2B0B 5Nå8B11 B60E 440AD!""š¤PPCM16.)/16/.AÒ/ið#2EFFEA 4B5C00F9 311404EF 80DB0844 CBE006B0 48AB03FGõE601B5 0367FE80oõ8B853FA42 B4AFF351 2997EBCD 1A5AE6DC EDF9E492 C627E277 0E06E0B7 EF29E029Pð5759E271 FB34E83F 1377EF85 D82CF72‡`8EFB79‹ö7FC12 0864FB9E DF30FB4 õ81183FA30 3EEAFB59 BC78FCB4 66D5FF60 CF130415 431A097D C1BA0EC7 512312A0 ðEEE11754 8207166Ç`FE1448{ö01298 49990EB7 52B40DC1 EFAD0F65 CE3A0FBEPÿ64B70CE6 63490A57 08CC0A1D 2BBC0B09 51480E46 8BCB113C B6F60EE9 44150A5ÿ ð24Test(SunauTesù*t, unittest.TestCase): sndfilename = 'pluck-pcm24.au'#Ñframes = 3307€nchannel2�sampwidth'60rat_Q11025n8!48pcomptyp&R'NONE{›@not bressed Fñbytes.fromhex("""\Vô' 022D65FFEB9D 4B5A0F00FA54 3113C304EE2B 80DCD6084303 <õ$CBDEC006B261 48A99803F2F8 BFE82401B07D 036BFBFE7B5D<õ$B85756FA3EC9 B4B055F3502B 299830EBCB62 1A5CA7E6D99A< ED8õE491BD C625EBE27884 0E05A9E0B6CF EF2929E02922<ö#5758D8E27067 FB3557E83E16 1377BFEF8402 D82C5BF7272xõ$978F16FB7745 F5F865FC1013 086635FB9C4E DF30FCFB40EExö#117FE0FA3438 3EE6B8FB5AC3 BC77A3FCB2F4 66D6DAFF5F3´ö#CF13B9041275 431D69097A8C C1BB600EC74E 5120B912A2B´ð EEDF641754C0 8207001664B7 7F�14453F 80e1294E6´ö#499C1B0EB3B2 52B73E0DBCA0 EFB2B20F5FD8 CE3CDB0FBE1´ö#E4B49C0CEA2D 6344A80A5A7C 08C8FE0A1FFE 2BB9860B0A0,õ$51486F0E44E1 8BCC64113B05 B6F4EC0EEB36 4413170A5B48´ð""") class SunauPCM32Ö( ï/32ï.4r’ïm"BCñ#92óÿõ#9C÷"40ù5û"80ý%E0kÿ$400#FC"80 #92 "60 %34Lz#20"00#C00#40"A06˜"80!#40#"80%#A0'"A0)EÐ+"40-8L/0;S067003"D85‡7"009#80;"80=L?"00A#60C"10E#64G"A0I#20K"40M2çOAQ#B0S*U#F0W"80Y5["80]B|_"80a#B0c"80e$00gi#00k"80mA0o"C0q6su#80w"FFy#40{"00}`óT3B270ƒ0…2·‡"E0‰#80‹4d E13«�"C0‘ð90 6344A8800A5A7ñCA0 08C8FE800A1FFEE0 2BB986C00B0A0E00 \ ð*51486F800E44E190 8BCC6480113B0580 B6F4EC000EEB3630 441317]V5B48ALñ """) class SunauULAWTest( °, unittest.aCase):Œùsndfilename = 'pluck-ulaw.au'"Ñframes = 3307€nchannel2Âsampwidth = 60rat^Q11025(n8!48pcomptyp&'¿{šòCCITT G.711 u-law#Iôbytes.fromhex("""lò022CFFE8 497C00F4 307C04DC 8284083C CB84069C$õ3DC BE8401AC 036CFE74¼‘B684FA24 ð344 2A7CEC04 19FCE704 EE04E504 C584E204 0E3CE1fF04DF8PA557C#`FB24E8Gð2FCEF04 D784F744 9tÐB64 F5C4FC24 ·PFBA4 L: A11FC P3E7CF5õ&BA84FCB4 657CFF5C CF84041C 417C09BC C1840EBC 517C12FCPŠ216F.´15FC 7D7C13,[>°0DBC F0040F[XD840FP�5040CBC 6|�A3C 08BC0 r2C7C0B3…2‘ 8A8410FCm 2457-àVpif sys. âorder != 'big'ê# .Bwap(;, 2D@Misc+ps(audio;0s.A UPmodulÌs� �€LowLevel](–@def tó _read_bad_magic_number(selfÁ×’b = b'SPAPwith '÷.assertRaises(EOFError=.¨ .open(io.BKaIO(b))�"cMd bRegex(Rlq, 'bad Á Á'€� ïtoo_small_headðstruct.pack('>L2', •ñ AUDIO_FILE_MAGIC, 20, 0,kì  7ñENCODING_LINEAR_8, Ü/Ä¡ size too Ú ._large L!?124"36, 1%0b +¸•\0' * 100�>#Ñridiculously G*ïwrong_encodingsÀstruct.pack(1'>Lñ', sunau.AUDIO_FILE_MAGIC, 24, 0³11025, 1) ò with self.assertRaisesRegex(PõError, r'encoding not \(yet\) supported'):U\=ñopen(io.BytesIO(b)) 'ðdef test_read_wrong_number_of_channels(šYÿb = struct.pack(ýt— §4óENCODING_LINEAR_8, 606 ¤'bad # of Ó(ò if __name__ == "__main__"k@unitD.ñ () # A simple module forg·sthe dis0. „‘f(): passg im× c T.mockdrandom$os Dtime Upickló warnings from functools frpartialDmathõlog, exp, pi, fsum, sin, factor44¢M…fractionkFò class TestBasicOpsgr# Super0_ñ s common to all generators.m6b4âes must arrang”Ø1.ge>�retrieve ¡RL“ instanceKQto beÉ6ed.AyAlist)7, n,’"""Helper`i«pmake a 4–B zAs"""q%„return [ª.+!()TQi in ÏF(n)]’‘_autoseed•’KN`state1Ûˆqgen.get(%M—.sleep(0.Á U»à # different mGs atLsêj2 g#‘NotEqual(911, 2Ù¼saverestore †N = 1000ƒù­õZš ˜4seq& omà&(N>¿ZsZ[)/³# should reÅ‹¤same seque‰.J qBseq,F meedarg×Ñ# Seed value bòa negative hashSR0 My1w(objectb"Ö __6,__y ÝU-1729…,0argÚQ[None2A0, 1@-1, ¢10**20, -( %),AZô3.14, 1+2j, 'a', tuple('abc'),Á")]c6]§fed(argžÀlist(range(3÷)), dict(one=1)]: ñself.assertRaises(TypeError, ågen.seed, arg)=9¯1, 2, 3, 4@Qtype(b¡gen), []) zò@unittest.mock.patch('random._u ƒ') # os.9@def 8_Ëb_when_-ñness_source_not_found|#, A_l)82# RqLÐ() uses time.0() _ñ an operating system specific“†&# † †� is not ‰A. To¸ð this on machineseWre itLñexists, run the above?,ýðargs(), again after á7ingK?ñ() so that it r%^ðexception expected”zIà¥available..pñ.side_effect = NotImplemented 7)Ýà/öRhufflTÊs' =ë] ls%[]4O(lstÎPEqual·æH/37J#837]nðqs = [list(range(n)) for n inTmge(10)lOd_se<Xö@csê(3¼Mi(seq, T0zipss°_²k en7@), l Àvw:3set: :9# TKñs all would pass ifÏe was a.�# no-op.E`followñnon-deterministic q coversmH. IÜkpðd sequence of 1000 dRRnct e0sŽñmust be different fromQðoriginal one. Althoughh Eðathematically a Ïñzero probabilityÆ·c-…Aactu:Qhappe³°a genuinely¿4dom ,wi co t+ðnegligible, give~ at´p number@poss#‚ppermuta¾s#8pobjects� ! (factori\'),EPwhich.0con®Àrably largerþ�eˆPatomsé7theG0uniö6e.. .à‘)Ïm/d_)À) sh�uffle(shƒd_lst) ÿself.assertTrue(lst != -C%B%oôRaises(TypeError,uÑ, (1, 2, 3)) ©“def test_—ð_random_argument(Æ!):,Ør# Test & &4 toc.+R0 = DS.gen.#Cmockrp = unitŒ.ø.Mock(return_value=0.5÷ q = bytearray(b'abcdefghijk'(YPseq, Yp"¯Ü_called_with()lchoiceìëL ¤QIndex¥ei?6([]©G>dEqual($�50]), 50+%In(`25, 75,[ 0ampÑ7elf�ð # For the entire allowable Àge of 0 <= kõN, validate that#Csc0 is6Tðcorrect length and contains only•que itemsMuN = 100Âpopulation =–&(N„for k in'+1ßos»£(S6, kL/m‹mlen(s)(0uni§_set(sB/EøI&iV¤)`1ž�}ñ([], 0), []) #ö edge case N==k==[q# Excep\r[�d if sizù-� exceedsòÚ™£†ÀþVØþ,¤&, B_, N+1ßHí,-1Ç·�_distribuÝ Ô÷6l  generates@` possiCapermut»ßÆ5:5popÖn PtrialºP10000Êðlarge num prevents false negatives ‰ñout slowing normalúp /n-ðexpected = facto‡h(n) //-4è­%{}hKli›Ô q(?4[tu QÐ0pop{™)] = Nonea= if_(DT) == ÃÚ'YbreakECelse,À sñelf.fail() def test_sample_inputs(self):"&ð## SF bug #801342 -- population can be any iterableYõining __len__()N]R.gen.tÿ(set(range(20)), 2+'&0ÿ str('abcdefghijklmnopqrst'„ _tuple: ê Znon_dic\ñ assertRaises(TypeError, + , C”.fromkeys…± wmchoiceË& =\?îðdata = ['red', 'green @blue…yellow']2Cstr_6R'± ((4ßt#4)œŒõ# basic functionality^Bfor EU in [:Ö(˜, k=5), ›* Gk=5,÷=Z„weights=Bg=Ocum_A]ƒÓ+¢Equal(len(F), 5X-Ftype.Olist1ATrue—] & ¾Q=Ê�¾=Ž3§range(4), [= -ž$thÿH and8“UZ¹�à?[15Y4f M]2kðE=”ü R# TesBÀht focused oón a single element of the population òself.assertEqual(choices('abcd', [1, 0¯]), ['a'])?30, B?b?B?c?!B?d?¾ò# Test consistency with random. Ï() for emptyB2GõRaises(IndexError):quV–s([], k=1LI)�weights=U:Jcum_Y15) Ìðdef test_gauss(þæÑ# Ensure thatyñseed() method initializes all"öhidden state. I¢ð'# particular, through 2.2.1 it failed to reset a pieceóMQ usedµ}ñ# by (and only by)~.È¢.æ1û¾0 inÈq12, 12345š6, 654321ïP.gen.F(òaUx1 = %z(#y#«Ó�FEej2j #j 5jx1, x2¶�%cy1, y2µBŒpicklingEyPprotozarange(+÷e.HIGHEST_PROTOCOL + 1~ G3 = 2Bdump¦Š!, X ®±origseq = [¹²�iˆE10)]Rofnewgenpaloads( fƒrestoredj8.hšS¶,üY a¼bug_1727780d‚# verify©¢version-2-7�s can be Ï DÐfine, whetherAÀy are create[Ð 32-bit or 64 /Ð# platforms, ˆ${3{t h.;Pfiles¡ ("2õv2_32.pck", 780),)“)#64)?866)3&7343âŠ|p, valuesèðf = open(support.find((k),"rb"  1*(f{f.close  ðint(r.random()*100ñ0), value) def test_bug_9025(self):!ð# Had problem with an uneven distribution i×t(n*random())EùVerify the fix by checking thatJas falll in expectac%s.R`n = 10w€range = ÅU.gen.'k5um(ð(6755399441055744) % 3 == 2 for iÚY'(nÔcðassertTrue(0.30 < k/n < .37, (k/1B tryPs£om.SystemR&£/ò except NotImplementedError?8�_availablî¯False else) ©p @unitõÏ.skipUnless(]?, "µU not �™") class CØTestBasicOps( %, CCaseo geÖp(­Žautoseed­ð Doesn't need to do anythi`½EfailÊ-S l¼saverestoreo9Raises(¼,�†getstateBsB], NonÄÀLargs¨/# /<100MgauslÒMq_next =®pYj>RQEqualÊÉOü�pickling2QRÂVprotoÆ+÷e.HIGHEST_PROTOCOL + 19=�á QVdumpsï,6,to6ü53_bits_per_float²ð# This should pZ0wheq�r a C dou÷öhas 53 bit precision 0spaMu2 ** 53{ucum = 0àŒCþ1R|= in§‹¢P() * gξAcum,$,-10bigHý e r„ routine�build-upIðrequired number ofsÝ#ó’stages sohY31osiS¿ are active>0/?rm5elf8Ö(7hj¥‘(0 <= r <>b+…E|= rè<wÀ def test_óbigrand_ranges(self): ð for i in [40,80, 160, 20ö11, 250, 375, 512, 550]=D€start = XP.gen.mlÅ(2 ** (i-2))p3/op2i.±if stop <= l PŠcontinueeñelf.assertTrue(<E ©,g2) < N‚def test>_limitCBMô(-2,0), (-(2**60)-2, ,<+2)S¢»¢Equal(set(Sh1)),¢([‰6 ñQ~100)]))îd Ü_nonunit_step<?rinúHBÊ–Ô0In(:0, (#—, 4, 6, 8%!22X,<?, 0Ò]errorÅáraises = partit@R€, ValueE?,ï”�# Empty B¥bV(3, 3+M-721EW0, -1ðÒ# Non-integer/ go.14159Uv2.71828É# Zero and n],epWQ0, 42_tÂ3w9>0genb>s# Verif.s8\¨kLF‡(1, 1000º%Vå0á5getvkÙC2**k>{@all œf activH1getÞT «@span®[41, 3×b31, 325>ð3, 54, 119, 12789ucum = 0b®ª %93|= ¹(–è!20€cum, 2**+/-1õrgument checking—M$M(Typ"3Œ; , ZA Ÿ} ·€?D@û À.` ¡elow_logicb , ×=log, int=int÷#‡°`count äð sition points: 2**i and 2**“(i+1)-1 ÷# show that: k = int(1.001 + _log(n, 2))1ð is equal to or one greaterGõ n the number of bits in nBPfor iõrange(1, 1000):!›òn = 1 << i # check an exact pow\:two5!umoF= i+ãOÚÜ*Àself.assertEæ1(k,Î6its))š**(k-1)) ˜� += n - 19 ÒQ1 bel~_e nexÚÀ" In½[Œ5itsÇ?+1]ÊñTrue(2**k > n > 2Ñ Ñ-ÑQ>> 15Ó¤ÿ little fartheráK ¡Œ aAnoteŠ’stronger Ô&io‰.ïü?1))Qø class MersenneTwister_TestBasicOps( °, unittest.CCase geú�random.R(N@def 3ð_guaranteed_stable(ÆAÕö# These sequences are 7ºBstay!ðame across versions¹Gpyth-cô.gen.seed(3456147,2&=1S*n¡[<Ø›().hex() I4)],gñ ['0x1.ac362300d90d2p-1', Ñ9d16f74365005 =%Ñ1ebb4352e4c4d%Àa7422abf9c11¯ë"Ðöquick brown fox"ù2ùGô1239ddfb11b7cp-3ùúb3cbb5c51b120p-4'6áÐ8c4f55116b60fá6Ð63eb525174a27]_žbug_27706WPVerif7$atú0 1 'còunaffected by hash óvization dv'nofar'V1uB(õ ) == 5990528763808513177õSx8Á8645314505ad*Bÿafb1f82e40a40p-5Á2a59d2285e97`=ô56977142a7880p-6'¸Â(R‹('rachel#W÷-9091735575445484789Àlf.assertEqu÷"al([self.gen.random().hex() for i in range(4)], ñ ['0x1.0b294cc856fcdp-1', ú2ad22d79e77b8p-3'=%ô3052b9c072678p-2=Ð578f332106574=5]) |°ôseed('', version=1)Ÿú# hash('') == 0<ŸassertEquþ/×b0580f98a7dbeþÑ84129978f9c1aƒ£#¹aeaa51052e9þÐ092178fb945a6þðdef test_bug_31478( %):]ò # There shouldn't be an ó°ion failureØ_ñ!.Rø.OG) inNðcase the argumentXõ a bad __abs__() method.8÷class BadInt(int¡þÇ= Àµreturn NoneV6tryé%<¹ºo%))1úexcept TypeError>BpassU�W.82W´Verify thato0 1 yðs are unaffected by%h7˜domizatioTAwhenT>ð expressed as bytes ratherq–n stringsaçfà(b) values lis޲’Python2.7('�# which w0u|ñ”Bing.f|b'nofarupuõ5990528763808513177|º”‡2Ñ8645314505ad7o`ÿafb1f82e40a40p-5…×2a59d2285e971=ô56977142a7880p-6'‡krachelÿ-9091735575445484789F�mbžÙúb = b'\x00\x20\x40\x60\x80\xA0\xC0\xE0\xF0'õ€|/(bÏ JbCÿ501559423974936549ZÀ.hex() for i÷ in range(4)], ñ ['0x1.52c2fde444d23p-1', ú875174f0daea4p-2'=%×9e9b2c50e5cd2=Ðfa57768bd321c=1]) |ñdef test_setstate_first_arg(self):'¦ñ .assertRaises(ValueError, Dgen.I¢, (1, None)romiddlesQtart_˜& =cg¬%()�õ# Wrong type, s/b tuple Ÿ ½?Typ¼ 2¶)iblengthk?625i& 2*O2,3)m ÖÏ of 625 intsyâ¯('a',)*625{ÁLast elementR anr_ alsov+0t"4+{õbetween 0 and 624�Bwith Þ œ�Overflow«)Ó×¹"((’04+(šwN>-1,vô# Failed calls to nð() should not have chgad the C.5{bits100T@randF(100ñ: s– 'ƒQEqual>.89getZ , ed‘à# Little trickÙamake "Åð(x % (2**32) for xE�internalÛ')"Krž wp. I canPthink?Àa simple wayoçachieve this, áÑ# I am opting~ us áa generator aseÈQ argu4%ofŸžÑwhich attemptÄciPa NaNŠØ6ger­á _vls²U()[1]a.Xlist(²ïXû[-1] = float('nan'(— = (int(x‚W:elf'ˆJÌ™ referenceI°YQation`Ë€# ComparÑe python ã3 µÁresults from·�originalwñ# code. Create 2000 53-bit precisioÅ2dom3s-GonlyKðthe last ten entó$ries to show that the independent implementations ñ # are tracking. Here isA°main() func6p neededi`create%J÷list of expected random numbers:+� void b *){Ÿi¹;ÿ+unsigned long init[4]={61731, 24903, 614, 42143}, length=4N@ _by_array(0)/ðfor (i=0; i<200O++) Áð printf("%.15f ", gen�_res53()bÕ if (i%5==4)C?\n".}!‰õ= [0.45839803073713259,9nÿ0.86057815201978782)ÿ9284833172678215)�359326811QO2461Rÿ081823493762449573*ÿ1433222647016932Îÿ084297823823520024Sÿ5381486467183145|ÿ08921502491199340Ðõ78486196105372907] uáself.gen.seed(¼A + (¾P<<32)q614<<64 Ìe<<96))E‘actual = NZ omˆ(šu)[-10:]-º0a, R zip(=,±)£ SòassertAlmostEqual(a,e,places=14)Ðú def test_strong_reference_y(Tgb# Like;4I¬Ð, but checks Âõexact bit-levelÞ0# e  ity. Thisðuld pass on any box whäúC double contai t least 53isÖ°precision (]ø underlying algorithm suffer^€no round(ñerrors -- all results€Ó%).Ë�from math¸’ort ldexpkš Ùÿx0eab3258d2231fÞÿx1b89db315277a5&ßdb622a5518016&ß0b7f9af0d575brï029e4c4db82240L¿4961892f5d6ïïx02b291598e458ìïx11388382c1569èÿx02dad977c9e1fe˜æ191d96d4d334c6E·qÀ, expected):' ñself.assertEqual(int(ldexp(a, 53)), e) 4ðdef test_long_seed(?!):Uð&# This is most interesting to run in debug mode, just—make sureK@noth:÷)blows up. Under the covers, a dynamically resized arrayKðis allocated, consum[ðspace proportional�`ènumber of bitsKn€þ‘÷ fortunately, that's a quadratic-time algorithm,J‘so don't ýt9Õhorribly big.+lö = (1 << (10000 * 8)) - 1 # about 10K byte®žP.gen.B( Ê053_à¯_per_floatÒðshould pass whenever a C double has 53,§ precisionÁÕpan = 2 ** 53Øucum = 0Pfor i"Prangeé[_1 |=W§Ûõrandom() * span)NýÚAcum,$,-10bigHVtÏ e ’“ routine �build-upŸrequired : ‘stages so*”30osiÏs are active>0/?Ar = Ö(7h%;ÑTrue(0 <= r <>b+…O|= rw)_^s~ð[40,80, 160, 20ö11, 250, 375, 512, 550]Šœ_startô‹Z(i-2)ÏOstop2i.1if 11<= l ƒvcontinu× _<c �Ä,g)�_limitC^B\ô[(-2,0), (-(2**60)-2, ,<+2)S /Aset(�(h&))çð([à6 ñQl100)])î0gen»¶ 1ö# Verify cross-platform repeatabilit�†(1234567à�5get‚¤íñö97904845777343510404718956115l¹ùÀkµ@(1, ý¡e˜©­­Àbits(k) < 2*c*k) õ # Verify all bits active!1getð= self.gen.getrand'ðfor span in [1, 2, 3, 4, 31, 3@2, 5ð3, 54, 119, 127859]:N�ycum = 0ficªrange(100)593|= ¹(–)FÉðassertEqual(cum, 2**+/-1õrgument checkingQMÿRaises(TypeError,3Œ;_, 'a'@*šA OValu½ ?, 0?+_‘def test_K°elow_logic( , ×=log, int=inté#†¯`count �ðsition points: ÏPi and u(i+1)-1´ð# show that: k =d�(1.001 +zf(n, 2)ê`# is e,ð to or one greaterGðn the number ofšs§ns ºM, 10¾´n = 1 << i äÂan exact pow\5twoVïv¸F= i+ãÚÜ*t.!k,Î6its))w**(k-1)8+ n += n - 1 Ò01 bî2/exÚÀ"sIn(k, [Ç?+1]ÊñTrue(2**k > n >2 k- i -ÑQ>> 15Ó¤ÿ little fartheráK³¡Œ aAnoteX’stronger Ô&io‰.ïü?1))QP@unitÇÐ.mock.patch('Ó¢om.Random.¸÷¡overridden #om8_Y ýW-Kò() can only use 9b() whešpbuilt-i$Ú¶# has been ƒ° but no newBKèñ() method was supplied.R(!om¬ã.side_effect =�r.System»#()?pmaxsizeÿ"<= maxsize8óself.gen._randbelow()4+1,4 >:O56405 ö # issue 33203: test that õ raises ValueError onìñ # n == 0 also in its get¾õits-independent branch.=Qwith ¸qassertRj(j%):,\+ à=(Qñ# This might be goingˆbfar toðða single line, bu,Åcause of our„°# noble aim`achievSB100%Mðcoverage we needfèwrite a case i<ðwhich the followL†IhRandom)Y¦s executed#¢6rem8 % o„limit = R” - rem) /XH =¸Hdom(Qpwhile rÀN…¢' r7� # <== *…×*g�az ** (z-ÅÄ / exp(az) *è‘ * fsum([O¡70.9U5183,ö676.5203681218835 / zö -1259.139216722289 / (z+1.0)&ò771.3234287757674%2%ò-176.6150291498386&3&ó12.5073432400905%4%ó-0.138571033129652'5'øð34937113930748e-0áK(z+6*ó1659470187408462e-0T7*ð]) class TestDistribu;°s(unittest.CCaseaŠÀ_zeroinputs(ÒŸø# Verify that dWð can handle a series™M N'ËÁg = random.R(9dxð"g.°() for i in1pge(50)]¶f0.0]*5R1ö = x[:].pop; g.uniform(1,10c^ -àparetovariate(8_ ?exp0wweibullc/, h�vonmises9Unormap?0.0pogauss(/0logiž8 ×91o1×4mma71 6/20¥Àop; g.betavaóriate(3.0, 3.0) ðg.random = x[:].pop; g.triangular(041/=>ñdef test_avg_std(self):]ñ# Use integration to1‘ distribuñ average and standard devi4.OéOnly works forFñ s which do not consume va÷¥s in pairsNBg = ù!.R(…N = 5000-ñx = [i/float(N)~iTµrange(1,N)]-›xð, args, mu, sigmasqrd8[.)Ð(g.uniform, (mP10.0) £0.0+1.0)/2-�**2/12),I¼/, ¾p, 4.0/9Ñ7 0/18mLEexpoΠ(1.5,), 1/ /**†ˆvonmises>@23, Ö`pi, piÄ3ÃWparety05.0y¯5.0/(5.0-17G /0A**2* ?2))=¨(g.weibull°-±, gamma(1+1v x222-A5& ]+1‰ ‘y…g3kˆglen(x)‚$:tryl“y.append(õ (*±) %ÿexcept IndexErrorP6pasc8¦s1 = s2 = Nº ™ys1 += eý4 s2Ù(e - mu) ** 2$·y¿–ò.assertAlmostEqual(s1/Nš�places=2Öä msg='%s%r' % 7’.__name__ñ @�@2/(NÉ/, ŒA%­Ltant® 1¾2òŸ, expecteÞQàç£ä(‚ø", -4: èê`'inf')x¬qåb@)q^…(g.gaussßfÞulognormzÜ6ÁÀ (g.lognormvô ariate, (-float('inf'), 0.0+ ¥(g.normalv>D10.05 /),6fpareto6 s@), 1u9mweibulp@?µ@¯©ë 6)]:úfor i in range(N)óself.assertEqual(åñ(*args), expected) [òdef test_von_mises_]I`ñ# Issue 17149: von . `ðs were not consistently­1thekŸ#»µ [0, 2*PI].0g =Ådom.Random()uN = 100  mu]@`0.1, 3:6.2*Ukappa-ª2.3, 500.0*Ÿ._*a'ásample = g.vonQ(mu, p½2VŸUTrue(Ò!S0 <= h<^TWOPIÒ5lmsg=("“ÿ{}, {}) produced a result {} out"…X@" of™#ge¶ppi]").fytð,®)Yalarge_( _#`1` W°) was hang ¤Jhs¾r6 ’v0, 1e15�( ,00ÀSgammaß~_errors¾ðBoth alpha and beta must be >Ù¦ù Rapp(ValueEY,ht0, -ÞÀB nA*O2, 0A*S1, -3[P@unituÓ.mock.patch('—ü.'t¥ñ_full_code_coverage˜E_] c Th£ðare three different possibilitiesqthe curií•mentationÉ# °ð(), depending on Lvä1'%˜'. What w™ go5ato do ®–is to fixGÓs returned by2W() to›�generateÜ€ cases trpprovideNt% line =ž«rmethod.S# #1:Ý>‘: we want”Sfirst‡p number³ be\sl ð[1e-7, .9999999] range,ó so that the continue statement executes ñ# once. The values of u1 and u2 will be 0.5õ0.3, respectively.Kðrandom_mock.side_effect = [1e-8,D&3]3�eturned_{2 = Dõ.gammavariate(1.1, 2.3)7ù self.assertAlmostEqual(rN4E53) 6ó# #2: alpha == 1: firsttÀ number lessC‡n 1e-7 tPGbodyN!off¥while loop^Tn^.Ù2() ¥ws 0.45,NÒwhich causes Tqto stop\1ing€Ø‘algorithmž�erminate‰/45…0, 3.14†!Û0731416612380“c3: 0 <—0< 1‹@is i… e Ýð complex region @codeýXcoverFa7÷re are multiple if-elsðs. Let's take ab"k 6“PsourcG1de,}1detneù´pöat we need accordingly:J Ú1‰uü(a#’b = (_e +$G)/_eP#{p = b*uüif p <= 1.0: # <=== (A^@áx = p ** (1.0/! '?FBF¿-_log((b-p)H/u1é±>°Cji¡A<= xµ± -9)¤D:¨[break,%elTw_exp(-xJEJ F×’V beta` Fo,,@want�ÄÀbe True. ForyMÉ)%b*FØ\rY÷F / b# ° We now get�Sesecond)bbranchõµhere, sinceQs0(C)® Fab6"weWXYN2(E)æixùL¾bZ´d:f 'r2VýÅô&r2(î)ã *a(b*r1)h)V%_e|.š‚%xpŒ$5logËe= 0.35P È4Àpha)/_e ð epsilon = 0.01 !r1ö8859296441566 # 1.0 / b'2'ö3678794411714 # _exp(-((b*r1) ** (1.0/alpha)))fð# These four "random" values result in th#ållowing trace:ƒÿ$# (A) True, (E) False --> [next iteration of while]<F;)Æ loop breaks5§ô_mock.side_effect = [r1, r2 +W", =�eturned_å2 = Ná.gammavariate()u, beta)¬ù self.assertAlmostEqual(rQu, 1.449I7544páLet's now make;"be4Á. If this issðcase, when we get to“Ð# second if-ev0'p'=ð greater than 1, so (C) eô@atesHkG. WeM–`encoun=a]ð statement, (D)”0ich0ordhˆo executNÀmust satisfy¶4 foB´iFqr2 <= x®� -ï�#Ûô<= (-_log((b-p)Ô6;„9„L…)h0 --eAthatÓ"isÓ]r¨÷944540040889814ðP# And'ެ…aB) andéܪ†R�DN/ [‘¨ó5830349561760781‘¡@unittest.Kspatch('R  '‹@def 6_2_`_zero()(, Q¬)í<2() > s ?ðrG“� distribu/O#Û[p uses i±UnallyKHBsameÎ.; ˜.~50.0-ËôîD0.0,3Äð2.71828, 3.14159eõclass TestModule(pCCaseRáMagicConstantsH"Œ €©ÐNV_MAGICCONST†â71552776992141»GÿTWOPI, 6.28318530718<@LOG4zë38629436111989>ÀassertAlmostñ:Equal(random.SG_MAGICCONST, 2.50407739677627) def test__all__(self):#ós validity but not completeness of the DU listBQô.assertTrue(set¢0P) <= 3dir,))ŸÕð_subclass_with_kwargs(c ´õ.SF bug #1486663 -- this used to erroneously raise a TypeErrorºi# Srš!.R^o'Fr__init_C@, ne�[=None-1ÏM.;)�{L1P@unitµó.skipUnless(hasattr(os, "fork") Â() required"]¯@p_after_.EATest×rglobal ùõ instance gets reseeded in child½òr, w = os.pipe(yû2pidw1if E= 0:F1#Z‰ process:try-1cval = c0get †bits(128p*Jþ open(w, "w") as fV,úf.write(str(val)Nofinall‘¦os._exit(01Jelsee�# parenté¦os.close(wC’ìè_r, "rèÇ_XËeval(f.read(íuØ2NotzBval,­@®¦²pid, status�waitpid(-^[9ò, 0) if __name__ == "__main__"Qô() import builtinso dselectUsockeM errno fromG3no ^•EEXIST 7!OSP(Npass%‹WithInit-© ã, message, barS1Pbar =$vsuper()b?)ƒ?New‚™new__(cls€z€6 = p3¹Þ1baz­z­preturn Ÿ€Combined&“First(Sub[>,®3New£vT?NewSd a^" ·!Anƒ>0ExcA`Window§F(̇áFalse(os.path.2sþ3'†s.unlink.œ,g :ð AttributesTest(unit¡.bCase):ºw9Â,org`if os.� == "nt"ÖOqIn('win]t', dir(ÖLB?NotE e¸_posix¶|Y’ already î·", "foo.txt^#pEqual(e2Bno, LÎ*args[0],1str.?, "�h ¦Â¶ÐEqual(e.winerð@ror, None) @unittest.skipUnless(os.name == "nt", "Windows-specific test") C1defñ _errno_translation(self):i*ñ# ERROR_ALREADY_EXISTS (183) -> E/ðe = OSError(0, "File already existsœ`foo.tx§H>|ð.assertEqual(e.wineN/, * Ë,‘çÁTargs[0],3str€Ìh @file•4, "ñÀ¡blockingiof ~ª` = ("a6bcd&e"~÷for n in range(6—Bk"IOŸ*]F[:n]F+Wwith 5ñRaises(Attribute= _8ðe.characters_wr¢nÙ€Ô3‚yW', 2xE = 5|Sñ5) class ExplicitSub…ingTest(xbCase):’Ï„Œ_mappingÍô# When constructing an/# sn!, F Fµ isn't doneÓO4Subi„p, "Bad u· descriptor$ ÆIs(type(e), I �íinit_overridde †ðWithInit("some message¨?baz†âobar, "'°,, `)¶0kwd/ ƒ³Obar=�·;?newlsrObar,'z'ÀÁð def test_init_standalone(˜!):$è2# _#ó_ doesn't propagate to þ.&ö(see issue #15229ó 1UWithSxVInit(+†�� %òstr(e), '') if __name__ == "__main__"Þ@unit.ð() """Test the secrets module. A Qst of Åfunctions in-õ are thin wrappers around .@ def$ð elsewhere, we doW@needR”eðm exhaustively. ÕTmportt" iÌñstring # === Unitîsð class Compare_Dig ý$s(J.CCase #.c=d=ãQ.""" =aeP¬KW` F±ality with >Ò (byte/text) Ü!s.fLAfor ‰@("a" cdwxyz123"u-•a = s*100?b´…0Tru üW(a, b–P:ü.encode('utf-8'), b+))P!un©R@T ÁOFalsü@"abcmWabcd"@bA BÖxb mn_a1b2cÕo + "q"Ûk¦â ! aÐãŸbad_typesåLthat<braises50mixLB'ú'¨%e'!ø ¢P isin! ceë6str§"0b, ¬s$eR¤Q(Type4,È S!, r‰C"Lb, a<FboolTÀ # Testó that compare_digest returns a bool. úself.assertIsInstance(secrets.E�("abc", !),J)J+Exyz"Jð class Random_Tests(unittest.aCase):s0"""ò wrappers around SystemCÑ methods.""" 6@def N _randbits(S!# V)¤errmsg = "C(%d)Xaed %d"bEpfor num`ç in (3, 12, 30i(i"{range(6#Dn = Žy\|*ÍÎóTrue(0 <= n < 2**5#, Ê5% (;n)) Achoi 'lf–ùitems = [1, 2, 4, 8, 16, 32, 64]ñ1 Àúq(h)1 ´ OelowÕ ºª‘?2, ” %InlBi), À&i)’ÊúRaises(ValueError,Ò’?, 0<(D-1) =_Token<t,Ÿ function'"_defaul-p**Nƒ handle =ú size correctlyƒƒ×_NVbytes.Ehex,Qõ.(durlsaf/%Qwith �0subë(|=è.aname =Ô0.__-__|2try“6U(×¢except Typ=¤ñ fail("%s cannot be called Èðno argument" %  oŸ NNone4£7`œ ÙõDEFAULT_ENTROPYb�†Equal(le‚æ#(f1)),dÎ?5hex= 2*— gQ&" ÖnÓ17[ ðÆV.Ž7n=nb3# ¦ðtoken_bytes(n),› bytes) ñself.assertEqual(len(secrets.token_:‘(n)), n) B’def test_"@hex(I!):cu# Test .÷for n in (1, 12, 25, 90<@Pwith T@.subKK(n=n$(Js = ¯�né ÿIsInstance(s, str. _), 2*\  True(all(cãðstring.hexdigits ý)KurlsafeO $SPlegal oðascii_letters +Ↄo+ '-_'�›1, 28, 76k�'­(7 “ eþ Zò if __name__ == '__main__'£@unitÁ.a() """±¢öthe linecache module """ importPtos.path…tempfileY�ize fromJ Z0supbÖ FILENAME =o0.__G÷__ NONEXISTENT_* ó+ '.missing' INVALID_Oó'!@$)(!@#_1' EMPTY = '' TEST_PATH = Á@.dirF(yÖ) MODULES = "$´abc".split("J£±) SOURCE_1r' " Doc3@ " e“function(�õreturn result '''F2F7 0ê1 + 1 a = f()838ð3''' # No ending newõö class TempFile:\setUpÀ‚super().pX`.NamedSPoraryXò(delete=False) as fpÂý$¨á p. á%rfp.writW..Ö_m�M³addCleanup(Ž‘.unlink, ?c)pGetLine¨ sGoodData(ÉÄ»!# 9°list = [' ‚\n', 'ofBgood š_s\n'][ Â[ÓÔ@.joiÍ"lfóp÷).encode('utf-8'ü £AM(@_getù ØÀÎ1.op=p$´¬aindex,Û*Ãenumerate(fp1¹Rif noxP.endsx_('\n',4¬Ð += '\n'  àcached_line = @.get ø (self.file_name, index + 1) G +ÀassertEqual(A!, Pb!) 5“def test_esf!):J9s�*�…}1s, Àólist) class GetLineTestsBadData(TempFileŠ!# 8ÿbyte_string = b'Bad data goes here'× Ö‹ ðRaises((SyntaxError, UnicodeDe%), %\¬í­1q›M ‰œ‰PEmptyv(“1Goo”`, unit-.«4CasžœÔU = []ØaSingleUàU)F'\n'Y’¢U*’á\n', 'bbabcdef $á z?Bady¶" ¾…\x80abc'1&C`/s(o… µ Þ̶¾ # >¡values forqð number should return an e {„C«fyÿ (FILENAME, 2**15), EMPTY#:&-17rƒ# Float ·°currently rÆQ Type®,Â5it?=¯õ0�&, ¼$1.µí0ë5sa#%', åe§ V‚INVALID_Z:âõ# Check module loadingæöentry in MODULESê|ßò = os.path.join(-q_PATH, C•) + '.py'^@¤with open(JA) as½ i-�Ä,|Áin enumerate@ý, !#, Â:£!}F$¢that bogusCSisn'tòöed (issue #1309567»  ðs('a/b/c/__init__8¶ÀrtEqual(emptñy, []) def test_no_ending_newline(self):&*ô .addCleanup(support.unlink, uTESTFN)8•with open2"Æ, "w") as fpfjöfp.write(SOURCE_3M™@s = �cache.get s^3¸±ssertEqual(/ , ["\n", "Bf():€½return 3\n"'Qclearz ed = []üûfor entry in MODULESìòilename = os.path.join(-b_PATH,C•) + '.py'^¬v“.append(fNþ$ñ(-(3, 1( # Are all H!s 4%d?pJ#NoM$QD`_empty0fn  fn  if fn not¡@r¼ d[už‘# Can we £B theÁÀgÆ+\· 'in�7³wyQcheckE RÛïöáreate a source¼B andþÕ its contents6+_y º g…ùxMMöQ, 'w'ó�  û1R('o ¿áKeep a copy of?oldÿ@listé½¶±Õaindex,Ê“enumerate§@O �/, ß^V + 1)DÅÿáÐ΄2SÂ# Try to updvCbogu+¨eŽØ.ãy'dummy'SCQ that³4� matchesÅ~_ ƒ%×2# UübnÅ©whether itÁ8newŸL#Ù�öÌšÀ enumerate(s›ource): ð self.assertEqual(line, get !(s8þ_name, index + 1))H)±list.appendJ!) *ðdef test_lazycache_no_globals(„›y@s = ,.ަs(FILENAME€%Qclear0([ ßgFalse,\’]g, Noneä EusE¡ù_smokeôÄNONEXISTENT_$, <§–. š?Tru€ ma1, len ™û[R]Éð%# Note here that we're looking up a nonexistent file¢… with noÙ#'ð : this would error if the ÿõ value wasn't resolved.GÛ) ðprovide_after_failed_è/up"Eéý5”A!c‚ï[1f;(2�uoupdateWx_checkb m.Î  {H(Dbad_Ö§ 8ò(''{¹D[I;õ�already_dÚDã- Úª+ u®öI4‹Hamemory¿; Àlines(FILENASME) öself.assertTrue(linesðdef raise_memoryerror(*args, **kw %):OV0! M0E0ñwith support.swap_attrtácache, 'update.',{ k®@2 = 5@.get �s(FILENAìQEqualy1s2,>5s) ¨ANQclear (ÇC3Ç+V3, []¤ØìÉ"ò if __name__ == "__main__"ä�unittest.P() imÌ Dmath �sys from 8 1à # Skip this pf the _-ócapi module isn't available. B.Q!_m'%('9"')v{0getµ»_keywords, ñ_only # > How about•ð following counterproposal. TÁñalso changes some ofGÒð other format codes to be a little more regular.8à Code C type R[` check° b unsigned{ár 0..UCHAR_MAX!#h òshort SHRT_MIN.. &BGqnone **BHD6k *Plong 8I1intœ2INT›! #% i • ”!l PBLONG² ;K`+€L@L<c G`Notes:Ri * New©�A** Cà!d Ó°previous "r›À-and-a-half"Þ"‹ ";=[ %ËQ!waà`partic¡ly useful.(óPlus a C API or two, e.g. PyLong_AsU»Mask() -> #�?and3 75' #D (i�ò at exists). LARGE = 0x7Ff VERY_ŠFF000012?42 Ÿ½4, U¢3, U2, UÉEAX, \ºBIN, # -‘PY_SSIZE_þ(,  Ds; #FL4 0DBL’!, CAX ñ_EXP = sys.float_info.max_exp INF = ¶('inf') NANPnan')zPfake,7ày are not defiåðin Python's headUUiles פ = 2**63-1ðIN = -2**63 ULLò$ONG_MAX = 2**64-1 class Int: def __int__(self)—return 9951SubAC(int+B?Badz41.0{92�rJTrue;3²@,IFloa.f0D4.25|;486Opass&(2('ëq1Badt)> 4687ˆ= g> máû)N3ÑU�xComplexàc  T+0.5jšD·Aš **2(+ž€3BadYÇ1XB ¬Š vù°µ%3ì"=bÂUTuple!tzEDict%4dicn8Kô Unsigned_TestCase(unittest.[ª,_bæ`from _ñcapi import getargs_b%B# b Cs 'uyð char', and does range checking (0 ... UCHAR‰)Olö .assertRaises(TypeError,~o, 3.146‡Equal(99.(Int())/0.b6› ”(pWwith ÚðWarns(Deprecation3ing•W2Ö1§g2Ù232qŽOverflowu/-1D0þ Ç÷Ï:rœ@n + 1) àÀrtEqual(42, ógetargs_b(42)) õself.assertRaises(OverflowError, 8á, VERY_LARGE) A°def test_B(H!):Z`from _µcapi importLB(õ# B returns 'unsigned char', no range checking7n ¶KType²B, 3.14ì†Equal(99àB(Int()/0.�Subclass6Q›2BadqÕWwith ÚðWarns(Deprecation7inggk2§1§g2£2 Ù232œ e˜UCHAR_MAXm/-1?0* ]: Ê2+˜Ì(42Å+T' &@& 'H'H³?# H'_short(/H(H(.('2H, �(õ(@"H(g(2(JSHRT(/H((/H(( ]U3 ¿(%H(2(HG¢ b5 & b)&H("))I)I‡?# I)/in'0I'I'.''I'Àh self.asserðtWarns(Deprecationwing): õself.assertEqual(1, getargs_I(BadInt2()))6 202323ˆUINT_MAX:/-1e0* \8 Ç1+•È(42Â_42)) -ÔVERY_LARGE & a@!H°def test_k(w¼`from _µcapi importºk†÷# k returns 'unsigned long', no range checking7õ$it does not accept float, or instances with __int__>¬UöRaises(TypeErrorðk, 3.14Y6 OInt(ÉÑk(IntSubclass”û£p§ :<mtkm;JLONG</k(</k(< ]Uu2?/k(?”P(@ô! Sñà_TestCase(unit6.TjhjhÝ6# hj²short', andG hò (SHRT_MIN ... /AX hB`&99 h /�.:'2h, :,y’£,h6g>Ù™hÖ‹Overflow·#h,¯OIN-1sÔ(IN�I $h-/AX8°ÀerflowError,ó getargs_h, SHRT_MAX+1) öself.assertEqual(42,5_(42)),÷Raises(OverflowError8Ã, VERY_LARGEm°def test_i(t%):W`from _µcapi import„i(ñ)# i returns 'int', and does range checking (INT_MIN ... /AXÈ KTypeÄi, 3.146*&99òi(Int()-/0.�Subclass6c›2BadqPwith ZÎðWarns(Deprecation7ingy2§1§g2£2 Ù232œeÖ9"i,®OIN-1zÒ(INª� #-AX6/AX6«PiP$iP lPl–6# lPOlongQ ELONGR SlSlS.S'2l, º( S@"l(gS2S%2l, ¯T %$l(Ëþ$W8X#°Y·¥Å lY nYnYnYŸPy_ssize_°:¦(PY_SSIZE_ÁuÀrror, getargÃs_n, 3.14) ñself.assertRaises(TypeError, getarg6_Int()7wEqual(0.ï(IntSubclass()6m ?Badp:2«k3§ŽOverflowÿPY_SSIZE_T_MIN-1$ +1 2h*/AXD/AXD<ÎoAX+1) ‹(42/42s$áVERY_LARGE) 5P Longô_TestCase(unittest.!):š@def 0_L(ËÝ`from _µcapi importÓL>(ð# L returns 'long ð', and does range checking (LLONGîDC... /AX|_L•"¯L, "Hello"o¤&99¤L˜é÷2ý/Æ.Æ'2L, [‹Wwith uðWarns(Deprecation7ingƧ1Õgó Ù2ô%$L,éï (IN®.‡%àLvÛ#µÖ/L(Ö#9L, ÖÅ©K©KeK©¡ 'unsigned¬[', no«;t‡K‡"?K, ¬Ï}K„V'KVÝ Àetargs_K, Ba£dInt2()) ðself.assertEqual(0, getargs_K(Ba1o3())) 3¨ULLONG_MAX<o0*]/+1œ (42”/42- ÖVERY_LARGE & cB#Jô class Float_TestCase(unittest.!):=Gdef k�WithSign(„ó, actual, expected5¨! ¥ ,`+ math.copysk1h=), zí°È!_f£‘`from _µcapi import8fŽ[‘f(4.25), 0-0ºöRaises(TypeError±fb?+0j9ó•É!()k/2531Sub @(7.5>Õp=2> ç 1BadNÝWwith =ðWarns(Deprecation7ingÚD!fD[%73ã"õfor x in (FLT_MIN, -  [ ŸINF, -INF¹Vx), x¬3if X` < DBL½¥7 &00), ƒÆ6 -7»8ŒBIN >Œ/INŒ :™]wIN), 0.%”>œ?-@ <0 v6g!,  6r =EF(NAN±S#No«Cr, r«@@sup„ñ.requires_IEEE_754]ÊŸ_roundingÓ@ô3.40282356e38),bÅ T-=îáÂd¹ðd self.ñassertEqual(getargs_d(4.25), # _self.0-/0),õRaises(TypeError, hb?+0j9 •qFloat()k/253ÀSubclass(7.5>©p=2> ç 4Bad¾zWwith TðWarns(DeprecationUing):3‰2 ±f2%73ãuõfor x in (DBL_MIN, -  $AX ŸINF, -INF¹_x), xÑVŽOverflowA31<<„O_EXPD#-El‡WithSign*`0.0), 1 ¢6-1!, 86r =O(NANÎ#No®ar, r) >°def test_D(}y`from _µcapi importfD>V D S+0.5jy :5ä1D(400•D(Complexðœ:ßûÓ+0.25j)), 7.5 ç K*?LàcD, Bad\&() 8=&D(h:J>AúGM5Sc = cýWx, 1.|Ð Vc), cO.N91.0� Uú+D(N * ü$D(·0i¹o).realEIFJâ ”ÀithSign(getaòrgs_D(complex(1.0, 0.0)).imag # ÿself.assertEqualWithSign(getaI-J ñ class Paradox:\ñ "This statement is false."Ðdef __bool__(„)7– raise NotIÁ>tedErroriô Boolean_TestCase(unittest.Nf,_pd`from _Äcapi import ôp¤Œ›6(0,& (FÒ/)).ONone-0*Ûƒ/0jW/''+/()+/[]+_{})) Ø1‰?Tru[ -1ƒ *[ ,[ +/'x\ ,?(1,^ -/[1_ ,@{1:2bæ ê .bœR¼/s(½¯,+(â>_TupleÓ�Ö_.MPret =È_(1, 2ÅRret, %&ðIs(type(ret), tÈlo*(2, 3… r)u *[ã]¾ö¼ä7*Ì1Sub(}~Uh#InãO(), ‰(InË(Ì!, Þ5Ù*ÍIMz<ÓœÀ from _ótestcapi import getargs_tuple Zret =µ(1, (2, 3))'ð self.assertEqual(ret, (1,2,'(ñ# make sure invalid rõ arguments are handled correctlyB¥class seq:«Àdef __len__(�)#�return 28sgetitem<?, n?õaise ValueErrorGoüR$Rs(Typ$,:@, 1,»R()) ÉðKeywords_TestCase(unit�.Œâ0_kw© æ`from _! Ö0ÓŸ(a=1, b=2Ï P{'a':Ã'b': 2}0pIs(type�), dict){ 2**{R�, 'c': 3ZY Š8 ’‘**DictSub (j}ô 1(“hnc¿, ({}, Noneš(In�(�!, ¡4� ?**{ŠI|:Ù¿positional_âÆ# using all +9sd/äku(¡ù), 3, (4,(5,6)), (7,8,9), 10),@úùñ, 4, 5, 6, 7, 8, 9- ,YÝ_mixedØÎ3nd ŸÚ?Uarg4=ß_arg5=ä:¹æ¸"±&Sarg1=¶parg2=3,''3=ÀæM?opt¥ 1mis§' Ïp, skippÇ÷ =Ñ Ð-1, -1, -1, -C1, -W10) !) ñdef test_required_args(self):"4$# Å arg missing6try,00getGö_keywords(arg1=(1,2)†úexcept TypeError as errJ‰Õ.assertEqual(uhôstr(err), "function¡ ¶÷ument 'arg2' (pos 2)"Ž?lse{ffail('¤ü should have been raised'O�too_manyO0+÷ ,3,(4,(5,6)),(7,8,9),10,111¸F"5ðtakes at most 5ê4¯s (6 given0Htinvalid2�³extraneous V¡Sÿarg5=10,arg666=666M8_³666' is an Ö²S¤ for this ³ŠGŸsurrogate\;F 3, � ‘ÿ **{'\uDC80': 10}O9o\udc80Olrclass KÌðOnly_TestCase(unit?.5W@posi“/al 0# uJÐ all possible 4ãsä  tÅ_only(1, 2),B0¨ Á?mix ÕH andÞ­.,NÀ/=3½3¼ !rl"¯*b=1, opå/=2Á2O€v4/À, skipping tsuples õself.assertEqual(!ùgetargs_keyword_only(required=1, optional=2),:©(1, 2, -1)y,’/=3}V-1, 3oÎ!) Œ”def test_É_ä(‘!):"-1‡Dn$# òÅ arg missingòWwith ÷úRaisesRegex(TypeErroræ`r"funcN ctument 'vÇ' \(pos 1\)"jni]º*¦~ Šªd�too_manydÌ+ðtakes at most 2 posi‹ alß|¿s \(3 givent·3+q/ ¥3š4š!), q5ªqtinvalid³ ×Ä# extraneousJ•)ó"'monster' is an „`�¤ for this 7”dL=666ôŸsurrogateöi �"'\udc80ÔJõ **{'\uDC80': 10}) class PÍ‚OnlyAndKƒðs_TestCase(unitÈ.T`from _Äcapi import b&Î5_an,Ds as( Ç6-0# uK@ all‡Psible �st 8E3), ï_mixedQ#u$nd‚À args ñ self.assertEqual(ó getargs(1, 2, keyword=3), ñ 3)) def test_optional_9F!):"&¤# missing ' ' /† {O-1))9 ¼N-1, ½�required½� šY ›$# VR posi÷ ÅHwith‰õRaisesRegex(TypeError,/Q`r"funcTû takes at least 1n÷uments \(0 given\)"™Làò×—yÇ wcempty_½Þ ô"'' is an invalidþºL¤ for this ƒQ Cð**{'': 666}) class Bytes_TestCase(unitK.Êccà`from _4Ãcapi import Ë%_c2âå\W/ÿ, b'abc') # len > 1C(f¯(b'a'), 97—.‚ytearray89ª £memoryviewG©B ?'s'°5 ä4 CNoneVÊyÊyÞ0y, ÉO\xe9ä Šb‹Æ#b' sCValu•>y>onul:\0t$;€!'èI  K!¸__star½4OãN4Ç4(Á‘L èÀ.assertEqualö (getargs_y_star(b'nul:\0'), # ýself.assertEqual?Äytearray(b'b !')MPÖmemoryview(b' RSúRaises(TypeError, î�, None) <ðdef test_y_hash(ë!):ý`from _!·capi importP4-<'„ 4Ï, 'abc\xe9')@ g4]s¥Xs=ã¼|ðÊNÐ îP#Þwè¢Þ#Ê ð ) modifies first and last ó� L-t4 L@€?%¿# Ë36s')àQbuf =J=q äA(bufY[i] Ibuf,r6™ É^ Xš5¥¦Ë§7¨Kð class String_TestCase(unit×.C CÀqCëß') # len > 1B @C('aþ/97 -`\u20ac2 0x 6’U0001f40d: ;à b¬Ô6 ÖKa=ü8C, …‚¹À self.assertóRaises(TypeError, getargs_C, 97) ¿self.assert4 aNone) 7°def test_s(>!):P`from _µcapi importzs(7udEqual(�òs('abc\xe9'), b c3\xa9'´ LValué¯s, 'nul:\0; #s{_bytes:!°ytearray(b'D /')¾ ƒÖmemoryview(b' K!½__starÂ4Ç(Ì DÔ ‚ƒsMŽÒ{0¾ ÊŠ"PÄ ÑRSžs*/, æOhashæ4d(æ-DÚ  ‚æC ‡%, × ó‹NÓ ñP#ázÜzz ®zÒ „z„&z �²u;:„2?z,  Is¢Í z()6z¯·4¼ Àgs_z_star('aÐbc\xe9'), b'a £c3\xa9') òself.assertEqual(getargs_z_star('nul:\0C >rb'bytes> =’ytearray(G !')ÍLPÖmemoryview(b' RSlIsNone1)) 1ðdef test_z_hash([!):m`from _!Æcapi import o4-<—((ÎÛ&DÏ ‚”ÛûRaises(TypeError,ó%, Ì è‹NÈ æP ÖÖ/esÒ/esq e/esÊ+@’, 'latin1nï!†G‘UnicodeEn žEes, f Oscii9NkLookupå GOspamF )DoæÙERT*pV*‚A*¸E1¦/etÐt@Ëž/etÐ,@º¡Ð.tÅ0e9' Ð$ GÐ êtÞs}©ÿsCÁà, b'bytearray'3) ö'self.assertRaises(TypeError, getargs_et, memoryview(b' Ï'), 'latin1'V ONoneA*�'nul:\0'E*bF3•ytearray(P tðdef test_es_hash(�!):“`from _"¶capi import‰5.=¾eEqual(²)�('abc\xe9§b oc3\xa9­E e#, O\�N‘UnicodeEn W¥", ™ e9Æ_asciižSlLookup£LOspamK ìIpb'bytes”à$JT%’9%Y‡”6[™-‘,%) ,ebuf = (b'x'*8DjÜ—`, buf)pPIbuf,€4–\x00xxx')<¬5 ˆ¬@©4©NMValuð™cÆ ú VOx'*4Kœ@�iti!5J— çi)i, E&ÍÈi ðt_hash, 'abc\xe9Ó', 'ascii') ðself.assertRaises(LookupError, getargs_et_hashA`bc\xe9LOspamKkEqual(=€(b'bytes;¤latin1'), “HƒytearrayR L'WîOTypeìÖmemoryview(b' j[$eNone, °Fü|'nul:\0DEJ7�ˆÜã é`buf = ¤(b'x'*8À&'a‰÷Q, bufSPIbuf,€4–\x00xxx')<¬5 Dµ\¶¬6©4©íOValucÆ ú VOx'*4Kœ@�°def test_u(¤!):ô`from _µcapi importèu(7 Õ%u()Ê4u, ‚;  uR:s}Û:­D~DøI  Î )¸p½4Â(Ç ?ÕÉ'IÎ'?Ó À self.assö#ertRaises(TypeError, getargs_u_hash, memoryview(b' S')) �self.assPaNone) <°def test_Z(C!):U`from _µcapi import›Z(7zdEqual(¾æZ('abc\xe9'), :LValu¿Z, 'nul:\0'ï¯Z, b'bytes:!’ytearray(D rZ½ Is�D)­²4} ·(¼?³¾'ˆÃ'?È3N}Š ÍE(Òð class Object_TestCase(unitv.”ªSøSóUobj =Á%Isz€S(obj), +²¶0S, u1=*S, 'str½1S, c¶Ýö uYxY€x‰&‡Y‡&Y;&Yx#Yx"Y"xUxURxCfUf&Uf Àtargs_U, bytÂearray(b'byt S')) ð|cufffd\n8b10")m F"\x}J VP‹Pignor• uŠ)s0"""1R case„� op«ð Nick Mathewson 2ˆ/¢ â“is_jythonÆYÈôcompile_command, PyCF_DONT_IMPLY_DEDENTÙ!ioßT¡ŒsÊ@ defÈãfy_callables(dÈbU0n,vtd.itemsZñif hasattr(v, '_I7__'E'±d[n] = True}„return d€ê opb$s(2a9¶YVþ(jø, str, symbol='single†3'''�@ iff.ú"a APpieceu"''´¡9if DÀ co÷de = compile_command(str, "", symbol) úself.assertTrue(code"#if9Ù == "single":EP½d,r = {},{}òsaved_stdout = sys. *ú = io.StringIO(”q>try†AexecÈ>, d7".&%áN), r=ofinallx×äó æ)elQn'eval'É0ctxOn'a': 2Rd  'value': Eó^ctx) 0œ 0/ü Equal(unify_callables(r),&d),JelseÐpexpecte´£u›ö , PyCF_DONT_IMPLY_DEDENT]¾ ¡Uø $, ‰!) “Bdef û InDPlete(^ , ÷"='ô&')Öà'''succeed iff.ð is the start of a valid pieceZ1'''zÇ´=), None¿l¼ß, is_syntax=1ÉAn in`Ì ŒO ‹ÄË õfail("No exception raised for„G",! SÛVError¦Zåà C�OverflowE6notPŽQtest_+‹h avlV†¦å# special case3if kojythonÛ© uE""),Lg 2y("pass"-öB S¹f)\m²/\n´yËGav("~Õ·ÎWa = 1*/\nAN, #\nFà\n\n") ó av("def x():\n pass\n") !@if 1 A\n\n"= ^ A€/\nD"¢! H¥Ç$ lÃ:A3**3O +pif 9==3ùvHelse(  U >… pÂ#a\n#b\na = �¤L^ \na=Ä5K¹9+ \\\n3") oõ{","evalÇö(lambda z: \n z**3)) D\H/\n?Fa**3½ \nì/ " Ÿ`@ = 1 å¡4 a= =‘ͼ�®š _€üIRdef fÕCtry:Xñ finally: [x for x in (1,2)]¤ÅC²M#foo&�@a.b.c\n.qötest_incomplete(self):@i = ….assertI*´ˆi("(a **É?,b,(" ){=@b + ³/("" <' KiPJƒY/1:ZÂÍI9Í5"O s&ai‡ S?žï š5lgkYX?\n ]A* #Âh ˆK <O'a\\L''xy"8i("YÛß(/(²Ð\n","eval")  òai("(9+","eval")  _9+ \\™lambda z:" >·if True:\n  ‰ \n") 4;@a(„O@a(b,c+ eìfrom a import q  } ^4 •!C ¡J[");a,b) O{'{`>{a:%:`A{a:b`c?/,cVO,c:d/d^ ¾ #" a(– 6,b,‹'c~+a[G,a[.a[`>[b:8:s0[b: œd Mdef í ‘ÌŠ †1 ‹ +(aÕ (a4e<(a,�' [@if a ½pass\nelif 3$4\n 4 see W`while ¯= 0for nŠC 0try”5_xcept# ofinallGW4 ø?ith2 asé 2^class3  óø ) yk[x for`@ x iIµ L(LLL÷test_invalid(self):h0 = ‚.assertI' @("a  @äNa b !** <-= =_= 9 +-‚x():\n\n. "à\n\n if 1: pasãs\n\npass") ýai("a = 9+ \\\n")_'a\\ 1 2�1","eval5(]?())/[}/9+Ÿlambda z:6a b Ï«return 2.3Íÿif (a == 1 and b = 2): _[del 1?O(1,)?[1]<'1'·ð[i for i in range(10)] = (1, 2, 3^Îñ def test_filename(self): ò .assertEqual(compile_command$õ1\n", "abc").coN,HL H @©, 'single'J~’/No•'Zútls_active = False^ …starting"#ó def collect_incoming_dataì !):+ðíÈ�.append(% %PXfound6E0lin¨�b''.joinj.UÛ(@str( Ü, 'ISO-8859-1? \`cmd = >ö.split(' ')[0].lower(l@spac•+Afind*Óø2if "V!= -1 arT9[$F+ 1:ßOelse1(""^qhasattr ç, 'cmd_' + cmd9nPmethoÕ?get2Y1F(arg.…ð-ERR unrecognized POP3 command "%s".' %›ô²handle_erroÅ·Vraise+fp!, 9Aasynq | .–.encode(" p") + b'r&')gCCechoSjð# sends back the received str%�(used by¦test suiteCÁ1Z w2use , w if¶ != "guido"«T"…€no such P M1üpassword required!�opython� `wrong Op’¼10 messagesŒOstatŒüÕl10 100>?lis>ÊNR�%s %s' % ™Î 7+OKo©  ©“LIST_RESP�‹`uidl =Ñ_Æ 1%reû 1 p%s byteÇ‚len(RETRhÊ’›3‚›3topšˆÈOdele°ðÀ marked for ;\tion.ÆOnoopTÍdone nothingE/rpE0aEÀ self.ñ(push('+OK done nothing.') def cmd_quit(self, arg):!.ECclos@"pe_when_h(_¡_get_capasa\b = dic~u.CAPAS)~ if² cö tls_active and SUPPORTS_SSL¯‘WÕ['STLS'] = []Qrreturn # £¢ ù Capability list follows'¶²úö£òfor cap, params inä2{.items(:>0_lnÖ6capÙ#ifT ²_ln.extend({¶»òÆ '.join(_ln))! HOutf8EõI know RFC6856' �"if¿enable_UTF8&ðelse '-ERR What is *$?!á+if*Eû2stlš øˆ†}Žis Falseaq÷Begin TLS negotiation'`òcontext = ssl.SSLC(s'+þ .load_cert_chain(CERTFILE2¹tsock = =Pwrap_eu ,jÿserver_side=TrueAñ do_handshake_on_connect=_Nòsuppress_ragged_eofsKª0del?Onnelk#4set*IMž =  NQ'Ÿstarting ) �in_bufferêçM@_do_QE Ǧ 8@CommQànot permitted ˼ÕO9{’ ¬?tryr. ¼TxceptÎError as errS if€.args[0]M(Jÿ_ERROR_WANT_READU<[WRITEÞ S ï+el—=à–>EOFÌRÿÜ1le_` #+²# TODO: SSL$ðdoes not expose ûalert information ý&elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1] orFU FBŒ_UNKNOWNJ/):Iý return self.handle_close()/Yraiseðexcept OSError as»h ifÓP0] ==þno.ECONNABORTED6çžNelseAÔútls_active = TruÁd'õstarting = False ìCdef Pread(3 P"ifDpI“@_do_'RLshaklÎ>tryPÀ‘asynchat. _ [6le_­Ë2»¡ssl.SSLEOFÃbï ñ class DummyPOP3Server(„ðore.dispatcher, th‰Qing.T "):[¦6r =GHƒr w�__init__t÷ , address, af=socket.AF_INET� p.EÙ­+ldaemonHrcreate_“R(af, Æ.SOCK_STREAMy3Sbind(Ð ‹listen(5ÈŸÇNw_lock =rGLockÌ,Rhost,¯bport = ²0get ¥name()[:2]<=¢€_instancW3Non-²þ¯“0ass2notl¯ ZP__fla~ÀWEvent¿J.mM@.wai@�'HÑst_exceptionsy O™R¨#s(½Ëc_proto³®ý_shortcmd, 'echo -errr=use ùlß.|'guido'r1�I­, 'invalid–_pass_ —/'python™JOstat˜41¸), (10, 100òŒ?lisR1_)[1:]„ñ([b'1 1', b'2 213 314 4O5 5'D ? 25äÑ%k“„'1').endàiOK 1 1ãñ=retrÂexpected = (?¯116 bytes'æò[b'From: postmaster@A.orgàÿ Content-Type: text/plainRñ b'MIME-Version: 1.0H‚Subject:>-Blinew y 3k6113ŸRfoo =y[.V'foo'&{oqTfoo, D T�too_long_‡X:r„+%s' % (¬ð_MAXLINE + 10) * 'a®HAdef ?del— û. ùÀf test_noop(ƒself): ¡.assertOK(ñclient.noop()) +Ñdef test_rpop'D.]'foo'I¿apop_normalP5(Pÿ, 'dummypassworda\REDOS`ô# Replace welcome with very long evil..ô# NB The upper bound on)ø length is currently 2048BsAt this,,jðinput makes each ç§ call take�òon the order of milliseconds instead3cro×_óñ= b'+OK' + (b'<' * 10)q÷ñsupport.swap_attrT.+3, 'V'Òe$A>†4i·’valid, soùÆshould throw½AŸ­ñ Raises(poplib.error_proto, &š.J¼, 'a', 'kb'ÎtͰexpected = õ+OK 116 bytes',�ÿ,[b'From: postmaster@python.org', b'Content-Type: text/plainSñ b'MIME-Version: 1.0I Subject: DÿDQline1% 2 ?3']Ì6113Kq3Equªö.=t1, 1), 5 `?uidÞŸ oë UQtf8_rc_if_un�!ed•u¿öserver.handler.enable_UTF8 = Falsa0ï`Outf8 Š6Tru‰P ¦õ I know RFC6856'‡‰result =õ•(VÖÅ5¶LcapaÁ ggÌð('IMPLEMENTATION' in 3^.keysYLquituKrespu'Üu2aIsNoneaÀOsock,CfileèÑ@requires_ssl‰Pstls_äh‰ É> OSTLS4‚ }àexpected = b'+ó OK Begin TLS negotiation' õ resp = self.client.stls()"ÀassertEqual(3Á, expected) *Ñ@requires_ssl�def test_P�_context(N!):!‚Fo = b'+¯0ctx®tsl.SSLCTösl.PROTOCOL_TLS_CLIENTÃñctx.load_verify_loc†s(CAFILE*Ÿ.í;6ÿmode, ssl.CERT_REQUIRED= öcheck_hostname, True3Bwith}uqRaises(e÷ertificateError6:†  ¹iF=ctxg×ßð = poplib.POP3(" lŸ"",‰öserver.port, timeout=3LyÛ=ò if SUPPORTS_SSLAfrom>.C ft²0 im– û0nec˰class Dummy×I‰Handler(.,$ "):BT³�__init__ªk, connz‘asynchat. _ 6å[‚`secure ½g%öt_terminator(b"\r\n"€)îin_buffer = []nQpush(Ud÷"3 Þ� ready. <àstamp>'bÁtls_active =¹e#ústarting = False žDTest�C°(fñ# repeat previousps by use¾ç¾ºQsetUp·K*õ=ýSå€((HOST, })¬hF <v=3Ú}I°.¡.‡†bã C_all  éjDIn('i ',øï_8 N0ˆOi' ñ� QÃRJNONERÐBValu Ôæ 5GIu “uS , keyfile=Ûú²I–WOcert—Àaises(ValueEÿrror, poplib.POP3_SSL, self.server.host, .ÿport, keyfile=CERTFILE@ Jcert/å context=ctx) }ißclient.quit(), =Ñ(9Ð â´Jé ›" OòassertIsInstancew°ûsock, ssl.SSLSocket¾? 7.s!, t:Trunó noop().startswith(b'+OK')NÑdef test_stlsq%):.ŽsRaises(!e/c_proto$Ý3tlsZV_¶& =jË }\_capa‚" =Vc ð¤ðFalse('STLS' in *`.keys(îñ @requires_ssl class Testî@TLSC( ñ# repeat previousɨs by usingg.Iá\setUpØZˆ€ = Dummy‡SjÛ((HOST, PORT)4Ð ! öy ÂMHò« timeout=3mQ Ò�tearDown\#Œ"if\7Êù is not None and! !yN:try8` ùdexcept�¦J�# happens*1theÓð_too_long_lines case; @overoó sponse will be treated as reqto QUITrLIRthis Ã=ion!ü\closeÔ stó?ñ# Explicitly clearÑÁattribute toØ�ent danglÑethreadD{_! =ÍÁ 5š>—b?1T/s,fCase):ï0evtZ�ing.Evenº = 2et.(”.AF_INET,»SOCK_STREAM¹1C.setÙð(60) # Safety net. Look issue 118132 ðself.port = test_sup`.bind_ (#Zsock)6`thread8 Qing.T ‚(target=9Âerver, args=LBevt,UVï.daemon = Truex{.start(>pevt.wai5Ádef tearDown}!):þƒÅW.joinLò&# Explicitly clear the attribute to prevent dangling K_� = None “s‘ ,   œˆrv.liste—Þ seÝÀ6tryÑÁconn, addr =Uh.accep4'ö.send(b"+ Hola mundo\n"R)Wclose exS ªet.timeoutˆApassïEkfinallªò.Z+„TQqDefault& °lf.assertIsW(ˆBgetd3’&()Ì$s$&30% Nñ pop = poplib.POP3(HOST, ;<änocket.v¸<OÓ Equal(pop.²E.getÍ(, ¬#> b;Š#, Ú=« I4' JmF \ValueGÛ²æ. !0_ma¯r2�s = [Test¤pClass, J!s,`‹*G_SSL.1TLS]3ÔP_infoé!“ing_setup C›Q€run_unit (*sˆ ñ7gˆRnup(*•ñ) if __name__ == '_6__' ñ() """This is aïð""" from __futurE imÛñ nested_scopes, braces …3f(x’“3g(y^Áreturn x + yDñg print(f(2)(4)) # �ñcontains most ofkñexecutable examples ¨ðGuido's descr # tutorial, onc£@ # #ˆð http://www.python.org/2.2/dðDescrintro.html # # A few examples left implicit in the writeup were fleshed out, a >õB # skipped due to lack of interest (e.g., faking super() by hand isn't # of much 7 anymore), 'r€ fiddledlAmake«PoutpuGñdeterministic. from test.supporæ±sortdict im pp#á class defaul!(&`): ð __init__(self,*S=None&*Iict.+)B9.b$ =B Õdef __getiteme7key\2try�Mpreturn ©.=\+ÿexcept KeyErrorH –3getó§key, *args•pif not  U1 = <ö, ¼c‚QmergeHw, otherpfor key» „!if¡0in à r[key] =^ =ñ_1 = """ Here'stònew type at work:ªA>>> L(ã—)b¡# show ourBž-e‚ jk # its meta$7d7ypeJa†dOA=0.0Nñ# create an instanceP‡a)â ìQ <+{}C¦?(a)ICÏ%8ËÜ/Aa.__i+__ie!f)¦{(a) is q• Òm6TruW0a[1ŠF3.25L �# modify‹ Y•Ç3val{@{1: t �� 1�8àK¸;F �?[0]Eõa non-existent G50.0F"a.æ{1:100, 2:200}Rq# use a ù5hod<“öhÇaresult:l mñ>>> We can alsowÜñn contexts where çðic only allows "real" t°ionaries, sacálocals/globalsØ) òt°exec statem9!orÐbuilt-in funcñtion eval(): >>> print(sorted(a.keys())) a[1, 2] +1a['.B'] =8E£# need theAfuncvEhereGÂexec("x = 3;)r(x)", au3)m ›ù, key=lambda x: (str(type(x)), x¼ó, '__builtins__', ÂV, 'x'Új a[ †õ( Now I'll show that defaultdict instances have dynamicò variables, just like classic'es�#a.][ = -1 ¢a["noway"]¦! 8?000;$'u“' in dir(�6Tru¹‡a.x1 = 1\‡a.x2 = 2L2.x1¤/8d =^U z‚ and 'x1ˆ2Ñ ‘k¼ŠP(a.__ #__À{]p: -1000÷01':à 02':»}Z‘>>> """ œã 2(V!):'Õ__slots__ = [`]Qôdef __init__(self,HS=NoneC2R.+.9›bugetiteme7key\2try¬MPreturØ_ct.__=Û+ÿexcept KeyErrorH –3getó§key, *args•pif not  U1 = <ö, ¼c‚QmergeHw, other0for9ß „!if¡0in à @[keyýC p test_=FThe #€declaratzÿtakes a list of!ððreserves space ¹pexactlyZ seÃcxg. Whenusis used (‰@ canë0be † gnµo„§ã#2(ƒB=0.0šº2a[1B&0.m ‡W , ²O%õTraceback (most recent call lastËðFile "", line 1,?J’AttributeÁ ¤rô2' object has no a-u@ ÚA3 = ÚÕIntrospecting¾sËb@-in ˆes For! a, x.__f@__ iˆWPe sam’F((x¥X#([õ<; 'I$'>´6 []Vð ð >>> list  áisinstance([],/)ATrue &Bdict&OFals'Dobje)Oñ You can get the information fromªu type: ‰rpprint.P(dir(& ))âa# likeÃ0.__¤ñ__.keys(), but sortedL±['__add__',A '__! yontains|delattrJitemi$)oc )eq +getyMibut ~)gt<IhashiþJimul"*niDi>sub(:iteìl¡9len[lY zn>9new>Zreduc#+ex)p—zreverse÷r!seh K=setcjsizeof' .Ghook)eappend{Vclear7opy 5unt8ext8UindexVinser,5popgremoveñ'] The new introspec�ÚAPI gives mor«Athan«ñold one: in addi:!toñregular methods, it also shows#° that are nðlly invoked through —qial not/¢s, e.g. __Ò‘ (+=), __tQ (lenTt (!=). }[C any›{!isE— directly€ña = ['tic', 'tac']?$‰.x!(a’–ò # same as len(a928a54:q# ditto)/gA (a…1oe'9g#a. 'tA¢a ¿AÆ¢is is justQ itñfor user-defined ñes. """ test_4 = S�cWCs an/glPmakes$ÿpossible to add sU >,. wpre easyA�describe:pñy behave pretty muchì dðin C++ or Java. Here'Ðx exampl›1 C:e4...Ë" @Yª Õdef foo(x, y)=5ð(("?1", - C.Bà1, 2) statö icmethod 1 2 >>> c = C()’.foo(1, 2Istat9r Class Kõs use a similar pattern to declare)ñthat receive an implicit first argument (�is the *cl°* for which y W–invoked. º,1 C:0...â! @B­ @def êzcls, y)6;wprint("@3", .uC/,,! < p 'test.ñ_descrtut.C'> 1��R S ;D(C×Fpass»D» D»Wd = D<dR&a This s(s tð __main__.D 1" both times; in other words, uèBed aE `oø#) d3O@lvedVÀthe call, no�/e $Ä definition U`. But8–ice this:qFE—¤Á # override yòëµE‰ ) Æ2ed"L(>6(y)�31+ @f½HÜWe = E!e˜e41 Inb� exampleóât) from Ðtwill seÑC#Jits #øñA E. ›-ño be expected, sinäet’ specifieu>0C. “it stresspdiffere?`betweeÉ#es— fUs and>lŸAmeta_€es (wherO0 upíúa5aEp would  s targetÐacш�). """ »A5 = ¢AttributesþÐed by get/setxVhods V¨ö property(object–Z˜’ __R€__(self,Y¦, set=None7ê&0.__Ó=- P"!�=I!$Ê Ex¯inst, typezsreturn `@get(4>?...`;set`OvaluÖ$ifX¸0is þ¡¼eraise –pError("x! a«Àute is read-àonly") ...ò>return self.__set(inst, value) Now let's define a class with an attribute x #ñd by a pair of methods, getx() and s !: �3>>>T¡C(object):4...¬Ðdef __init__(²( „.__x = 0= Ç Š*A x<DÃD?, xG©if x < 0: ‹?:¨d7�property(±,6÷) Here's a small demonstrationSba = C(òc a.S1’print(a.x$+- ,E” Hmm -- «ó is builtin now, so@ötry it that way too.6delDÔ # unmask theO‚¸<Ž'€&'>TU€M!=”†E<=@\â  5->Sá""" test_6 = Mp resolu¬ð order This example?±implicit in writeup. ÀÕ A:ð%# ,’new-styleK ä4Dsaveª?Õ¡"called A.(7)")hUB(A):MGpassCjCjlD(B, Cmn3D()2 ¬B =c # exEäs,¨m±R"A" 6ú1  B" + superÀÖT).m()F#FCFCè)lfFcD(C, Bf� DIðD, self).m() ð>> print(D().m()) # "DCBA"  GU8Uò Backwards incompatibilitiesQÐclass A: ... Ödef foo(self)} "called A.'8)")I7B(A59pasgCjB\ƒ^1C()*) ~Å^º^U]Q!__SÑ_ = {"tut1": 01, 2233445566778±8} # MagicÕð name that regrèð.py invokes *after* importing this module. # Tðworms around a bootstrap problem)3Noth0docgìtò! both look in sys.argv for a "-v" argument, # so‡ðworks as expected=JÀways of runn¶h . …ñ_main(verbose=None):ß³# Obscure: ÷môn?.ð_descrtut insteads#asGQplaine(`becaus ez)of^Òsits wayH0intð$e 9‘examples,Cñunless the fullq žHPbusin+qis used3ÿðcan change depend3aon how%ì$ iØ!d.WAfroms,0sup+,ù,S.run_Ì([&#, �)¥[ñpart isn't neededÏR, butéTð directly. if __è�__ == "_û2__"ð.0(1)Ñ1est;JQðZIP64 functionalityèpzipfile35he Ü€equires ·" i˜±only reason­@keepct=pseparatIM_] _ ðXXX(nnorwitz): disabl[vaest byRjI extralarge¸� resourceQ which doesirexist. Ü0 ta ðover 30 minutes to`t‘general #’r@more˜`k spac›pan most@`¼buildbots. A(3l'¹'Þ'�oAload»Rdisk-s byªW@a loÀiðº'c2) Þ u , os, unit_Dtime Ssys ›mŸ Te)@aryFð from test.suppoòrt import TESTFN, requires_zlib 32 =!ðp + "2" # How much time in seconds can pass before we print a 'Still working' message. _PRINT_WORKING_MSG_INTERVAL = 5 * 60 clWðTestsWithSourceFile(unittest.ó Case): def setUp(self�# Create 6a data.1Ðline_gen = ("QÀ of zipfile ð %d." % i for iý�range(10%))Lw._Ð = '\n'.join(Ebõ).encode('ascii') 9ð# And write it to a �§¢fp = open(¥f, "wb"{1fp.?û„ cclose(r(0zipí/ÿ, f, compression:æhe ZIP archive™+œqile.Zip¥f¢"Xñ@It wðcontain enough copies„M÷to reach about 6 GiB of>1raw×:Gstor Gñ count = 6*1024**3 // lenþ-NQnext_ç=î. _() + ¸>$6num&€Vx0´Pstr("›@fn%dkUnum, É81# P` st>]\² since thisìŸ be?…lly slowªM6if ï<ðS%* )F)((‡ ' y— Þ�riting %dÿ%d, be patient...' %G(?x!),Lú=sys.__stdout__V‚ v.flush('± I6Š# Read t ˜6 =Ù’ rPE$ÁassertEqual(o].readR)SòS‰œ SÆd¡9Q# TrylAtemp×° first. If}#do¼2À, then it hoCgs ð# gigabytes of disk space for the durationUtest.@õ with TemporaryFile() as f:#jþself.zipTest(f, zipfile.ZIP_STORED)0öassertFalse(f.closed' STESTFN2YZá@requires_zlib@def Î�Deflated(S)¹Q# TryPtemp ±ó first. If we do z,.n it hoe{oDEFLATgB[VlarDownRTƒfname in:,2x1ñif os.path.exists(8ž&“os.remove"à class Otherq`s(unitê.CCaseH°MoreThan64kÃs¸a# This-ð checks that more Qn 64k!ñs can be added to an archive, ´P# and9t1¤ resulting*Eðread properly by Zip¡IH& =O(•ö , mode="w", allowZip64=TrueGBÅ.debug = 100[0numòõs = (1 << 16) * 3//2$ÐiÌdrange(3^êc0wri‚ñr("foo%08d" % i, "% ¶(i**3 % 57)œ�.¡Equal(len(ND•list()), w˜$19() 2./r"�/2.‚ scontent” 2.ð !ö).decode('ascii'œZ !QW 2P ]AppenA´ÅvǾCw5- 1ÆZ`tZ ‘aRaises¯%SLarge¿ ÚG, b'ûfÀ zipf.clƒose() pzipf = ù ile.ZipFile(TESTFN, mode="a", allowZip64=False)CÅ.debug = 100ðself.assertEqual(len(jö.namelist()), numfilesRWwith >aRaises;¥SLargeª%):oÒ^õwritestr("foo%08d" %fV, b''kf¤j/clO0?TruNJ`õ2 = (1 << 16) * 3//2=ôfor i in range(4ž2jQi, "%t¿(i**3 % 57)r&2:sÛ Ã&r"Hô2™ƒ' scontentYi2.readŽ÷i).decode('ascii’Ç ¢QZ )2.”Ðdef tearDown(VÆãsupport.unlink0&�2) if __Âò__ == "__main__"‹@unit.P() imfd types $0 ¢óglobal_function(¥]inner$Àclass LocalC ~EpassÝ` L S%n "�W)±2#' ‚creturn†;€Ñ{lambda:=2 äFuncAttrsTest(^.GCaseP\setUp E Bça*È Ý*b¹3Æ3~‡.fi = F(f$F )Rb = b§_ñcannot_set_attr—p, obj, Šà, value, excepDsôz:tryÛ1setF @—HO A ÿJelseëðail("shouldn't be able to set %s %rœ(Ä* ¸:del¸±À pass § else: ð@self.fail("shouldn't be able to del %s" % name) class FunctionPropertiesTest(AAttr)kð## Include the external setUp method that is commony‘all tests¯1def€_module(·_ÍÁ.assertEqual C.b._0`__, __ÂJ__) RRdir_i¡°s_correct_aÄF fqb.known"A = 7M „FIn('&a', dirME.b),15P"set mÐibutes not in0³ listing of%%");ð# Test on underly)f“v object97'?F.aÃ*zfi.a), º‹€"qã°"implementa:2s, r@w upù@nextþ"¦”uplicate_g _eê1ityZ§`# Bodyÿ$`d6']Áact same as b¯f3(SÄå'my docstring'4…return 3X�)No“%, a ã0copÈœ___code__Øžr(): pasnþ&f, None5.]# =ý½ OC3) #6‚ always úûs 3, arbitrarilybž__globalsÔ»!Isñ¶0#, &()É5’cannot_se­<7, 'nJ', 2p/ (®}±Error, Type ) �__closur›ea = 12Bªf§frint(a»Pc = fsJ4Õ3÷IsInstance(c, tuplÆ(ž–len(c), 1f@# doÈ´have a type_handyuMAc[0]Ÿdass__.4w, "cell‚‡ „Gf, "&j", c, a U`empty_]ÂtE2tryZÊ RÂPs_contenA+²except Valuã F T*�read an Ò ‚/!yÙŒ¼( ú-³0Nm! aFNÈðcell_contents =C 9 ÿself.assertEqual(c[0].cell_contents, 9)0?f()! aNdel c_Etry: £,úexcept ValueError:EpassKJelseùðfail("shouldn't be able to read an empty "Qwith B;¢Raises(NamŠ)l/f(;ÁUnboundLocalÍ C‘print(a) Óðdef test___name__(�3 ×$b.0V, 'b'• a = 'c'j„é$ McM dMdM$# ³F and 2mus¯z string­ñcannot_set_attrT.b, 'M“', 7, Typ°?pcAvail when in reuðcted mode. Exec will r N‚Attributh6 ifÃ…is not a_Uon f.<ps = """ëPf(): Ð5\nfÃ5""",ö exec(s, {'__builtins__': {}}æõ# Test on methods, tooEÖ çEfi.atG, 'a�2l64, "o"9*, ͂ѯ# PEP 3155° —Gp, 'Funcxsý�.setUp..:/__] Rûglobal_function.N J*()L%À 'e �wy1Uinner�?Ž_Class• ¿ W Û%V í/ 'XÂðfunction2') ð self.b.__qualname__ = 'c' "passertE%( 3,2)3 "UdU&d'U)# ¥úmust be a string}ócannot_set_attr´8, 'Dñ', 7, TypeError) Dñdef test___code__=!):�num_one, Ptwo =G8 A™a(): passb™return 12cX9one d 9two e ¡)ö for func in [a, b, c, d, e]ßããôPtype(;.0), `s.CodeDª >oc(), 7!d!8!dgE = c Éb$&, =Q1r“# ô•#:try&â#¦²except Valub ? Jelse³dfail("tð with different�õ bers of free vars should "-Ñ1"no8–possible"% áeV' =WZᕱ—Ø`blank_Íœ_defaultsã| ð2†__, None>2delD '|CT5±«M_arg¯*QfirstÖ(Ú°}u1a+b[5csecond6=1, b=2: Ê|%._T" 8 9f(1, 2)]b2 = *Ö d:,9c:,3*_3), 5+*(, ÷C“ âF ¡ßÀ ósecond_func() õexcept TypeError:!EpassJelseö%self.fail("__defaults__ does not update; deleting it"Zkð*"remove requirement") class InstancemethodAttrTest(Func s1): \±def test___=0__(³)ÆÁ.assertEqual €.fi.a.__5__.= , &.F>öcannot_set_attrC5, "<"=,l)¦�¥3^/.a�=œ@.a, EBibut£ó£3£/fi¢<¢/fi¡ÔR_non_$‘ôò# Behavior should be the same when a ;ð is added via an á[¯€# assign¢±AÁid = types.M«c?(id…�id(), idÂF.fi); # ée usage|6tryÛ¢��.unknown£1þ ô C usâh*Hsf[raise`"ÒSC and:%on³Ós_'‚êO', 23L�Arbitrary>@tion X OMN êY›&b.hJ = 7¹ æ/6, 7ÌaaÍ:1set±ñÇ#on Òe8¢ %ó(e_�Ç0 ã2delcb¯P¡² ±¸ ã/un @for ˆR in [ø:.a]b H>.Ärexisten\M#ðÀ pass  delse: ý#self.fail("using unknown attributes should raise "CKD "A5ðError") class FunctionDictsTest(/)™ðdef test_setting_dict_to_invalid(®,va.canno3_´$b.b, '_?á_', None, Type™)Ä¡from colleŸÐs import User¬)5d =1({'$pV': 7}Q“Úfi.a.__func__Ÿdœt  ž •H'$b.E = d # ޵ assignmentÊÁassertIs(d, Gôñ# ... and on all the different ways of recf"�method's  wF+þ_¯„ • [è¡6 f-Zvalue–xSEqualf.6, 7Dq /ƒ[A];Moagain,T<_names§ ³; 2n tdelete_Ú£2try܉e HðStaticMethodAttrsGUìfunc_attributeY| @>Upass ¬Ac = Êm{/(fø1.__p_Ó&f)EQs = sÁFsF°BuiltinFuncÖŸPropertie   # XXX Not ó! w:IþÀreally go siáI can't find a#zp moduleŒQcific7Rfor b™üšB_or_è.g¼_*_lname__“²import time=“#d `dŽvWlen._b, 'len'¸2m. 8'Ȉ‹Àdict.fromkeyØ÷9, 'Ÿ úfloat.__getformat__á¥( '<ÑŸÀethod: ð self.assertEqual(str.maketrans.__™name__, 'C')  F_bytesH 5') Kõ# builtin bound instance method:) tü[1, 2, 3].append½Clist» ü{'foo': 'bar'}.popI@dict·b if __!â == "__main__"ª�unittest.Â() crandom Rð#p0 (tRp1 (I3 (L2147483648L L994081831L L2806287265 ð228999830L L3396498069�956805457€27392776A0920>0¡18626244923p2129248Z 1779526843�46910550 p5169629 �125439071M�77919708Œb165356™�200736521Ì‘187002881s�89651936M€85557843'�979518416¿�48171024 q1918615À�39930065��296797147�335334275Z�357678257t'jf�236767573P11620ÀL L122005443Ù€48659705�191211514K�10370447?‘409690472r€40914617L�370165122M€31582461&�4138604583�13857648Må@7890&‘232058221Ø�420677494˜q7765031ò�11482474¥b829555 r9020640qq9346427¿�247710857˜�25839282Ë�16586125K@2865å1¦b291473‹€69117188@�15693281Ù�13728601>‚10541391æS61770&6›5ñ�38102716¾t1853953þq9980307r0275450K€22904360e€250848722�332493262²0353r 96ä�2494323343 32v3r4147541ó‘363634818Aq0254550À�2678771940584[�346182690¦q8545114�€94346355‘360923902€977577982€25307009¿�77739454ã�14408656dq09294792�85432728&ƒ22275008eC1835‰a124664¼3%@3109¼�22350225c�30130605H0254$ 29"�348012634Z�18397627Ö�26326081³r1108889}`304505ê£L L7315131‹q0543678Zs0627620q6£6=r1354126›‚11435739›€81664570Ž@2100d�281767910²�12107460�24099152J‘2910119966S30900§€22035182�366735287)dA1485è�288616021`423939Þ2�189270584q0679855g02745§q3551648²�369601355õ�42270378Z�19051127@‚33128436(0930Ì6è€82879535Oa769335‘398710079%P28836FKð64529151L L965498079L ð L1444623093L L1372893415 �536235597 ð341994850L L963594758L L2115295754q8209868?€05343390�207846984  3059765792Y‘753606181Ma301712M€567588193ð529629426L L362152353�302757656 �117643808Ì�40962878¦�11685746‘142505896€€42963165´ð2902106759L L76190064™�132918395��194705093@€447490282�328251627&q2000373q9218681J�3331403992�408876024 ‘218832631Xr8840196~p6080267¤€31430280%KP63921–�374982120þ�228608157�27689390ñ‘320054101¥€13349548Ë€385029883‘421723220@1716��66084665g€45998762�269177612Œ‚42250304¨€595396774�11036806Û5—1405d€49284110M@16615Lq7579736Êq5338930"�27848795#Q10218CIq3505481òq1768521ñ�350316602K€14807991d‘163346623�77309016&q1628467—‘357573779�62417823¾r4548947Œ€01469193¦€52635567&�18708240ï�33624258þ�39075666tP34625 ›�22291120J 42V0574Z�15574424NS92413X�19066342Û€88045972d�40658958b141426n�12584501û�324311503`157495�}a139392r�30556642613cZ€53177879€50950550X�162022749âÐP55494c8*L€79729988²q2371358L‘320314221Hq0877453q�18971518„39365900»R76516Lq8590806@x0»€57456776¥�27527881>�264422896Á�23777051H€601277903�404648049—c324401ûq2799317Ù�222705937�P15388 ��42205320Èb478044ÔQ29171W`L L635$y�23197632G"42eq8204732 �16731514¥�14040954Õaë0±r3217106°s2406310-q9313092pP24586[æq3236705ï0326e7Gp4008394Ù�31683873üq6077221%‚12568376Ù­1249Ù�42449693�12899592 �51975032r2294824Ì€105196981F1844q�37610372¦@2363V2s�329795771�P57276§“@1958e¦�22392079cc203424c1Ž"05%0881ULA7164â0L LÃA4391 1Q@8193&�23451004Õ�278605917¿�28222321³q9870253o�30611665£0490c1�25510301·�263870762}`134472ØÑð14108911L L28317197ð00L L2188615369L L373509061L L1351077504ð136217056L L783521095?�554949468 €66249955Y’120382695Mp7963238'�191885898A€60746597Y 1980450237s€54007921@�339781341Z�2913309264�228957262'�413393532A 4166227663Nr3718017Î�06547490ô�58056234'€83217237¨‘255613071'p1047370´‘373401434�q4904138›b347233'q5266680Í�11583936@€54432970q‚21500854dq9140381X0106  58eƒ41593948MQ32051ò€30996677—�409878446 ‘3635222962q4175165å 2020923€�172580754?�272812252s�236583652' 25040785220443òNq3841714§�997046533€24913165Œ�16998759Ís3618097ç0716)24�2629818604‚29292178€36725031't1726434[0884]ö‘210760218Ï€82236684µ�305297919‚37967986q54381334b959000\�136384599�29525281Ü€87418493Y�188838719š�23286952�344295985š€84180594Ú�10877392¶‚323000545q0453992Ñ116181731�€89867313�q8600110s@9405Œ2'0808å 42§!16Á@1577Íò 42²0188��381905722¦�196943955s¥2963çq2418740ô‘351703345€29534566�10989114(8 ß4ò7§q2793473@‘361655879³q38441195€74253773€76422154Ù�28716989À`353063¦pL L6912Š‹q7587309%P17177?�75185637þr1884840L€76746967'9A8630å�353323679òP40992ö'0723¤² 31â 03 22• 74V`226656‚%b018433þq9699685ñ�33511708$P34651uË‘271224671äq5213830#20@6179°q2163575q‚21673019c13£7ä!01–�36207476&R95971{04252!97p`417427æTq9745115»�10071239 �311247762—q8064615½�314807400 52I 88Ö�25459795ý`256228Œfq0102494¯­A3316n�32106564Ô0103˜I�290689357- 11–"87 �870004401[q8983004�268685640�3ð123484V¾P56567@0760±ûa689843¯R41262Ea038554$�398896355c€27625679-@5440 ’�102387206%A1747=É@9755¢Ÿ�40337669eP29465Ab492957Zq9582716kð46480515L L90776ð0635L L1306626357L L819652378‘172300279 p1685131 �49560107?ð157715330L L53422010?€37732002 à1672286106L L2pP19284X€84238635L’254605946p39457334‘347619444 S05055[�594705582Mr9058135Ø€81303341�27008581å€16906797�425288904€0192e5�€49767147Œq2101439X�268839848 q3251583 ‘345084644I0917Ì q7128025É‚11325574 c417044I€63988966I‘174637997 q4787416Y�281756348 ’257361253Ëa664444ä�291160161Ø�804745411~0207h53‚11891406Wq8297251'‘363736734¿r9447317��193440343r�43019541 €17351522�158261821‘207076703 c479089p60675433€55600159Úq3276293r�103613387�422812960Ùq9991740¥�36358040K�141655048ó�127054026e�42807438p3960765�155254062Ê} 29Õa041372ð!41²2e`713022‹�134297005¥‘175571644Z!16@2r�27314013'@2319f}�28692214oa239726ˆ�22514953€�14298608¡•P13599Y�424143297À�3698275020216=$q0400469eq2460771%€89467568Ë�39322822�309720510Š�212881865 A0106ËmP97400ò0255¢9Š�35540160Í�420939564˜�201334010À 33 1780P30727>d�79509135Ša021094&0988t$%Q87075°q1327268§€58274622>�311230542e’1843020682a001892ÿ�110134916@4211XÀ�28666775X A6211ûqA3241ÔP77319h™A6495Ž0267– 04��29962482U�167699248\�347306704�420579369\P40194@K`157999Q(€89961799A‚11363477™€80284226Q35917 4q1973087Ðq4336297Z�40321427M�31480419›�33121388µr3896860é�329818256› 901��16586640�26829803š�25235231¶‘120872210‘€80853036 �10790039¨�42824028&�20410100A�266755507wq6880181OP14051Åjr4167994 355f@1923«·S435980936ù9Bq6062438Ž�10174200heA2111j5K"97ÁP84425îƒq8402162´‚26738077mq4072025P�27379710 %B4230Ã@6840EÏ�31466272Sq5996505\ 69ƒ1ið1257035919L L80748529ð 1L L2376230687L L303659314 ð2642411658L L1060800443�199622729 q9183451L€69761136 ð11689733L L625123952c@2260q ò9663265L L7530594c€84361018cò*624L tp2 Ntp3 b.def __getattr__(): "Bad one" x = 1 ) di%sbad_sig,ð�return [] """Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unit�ó from collections ,Tdeque„ntextlibÁ_GeneratorCo¢Manager, cmÚ class Mock+(D<Vóinit__(self, *args‹£super().__'!§ û elf.enter_called = False"?xit!|� = None @¡_¢›{6Truz9.__Z s°rý , type, value, tracebackŠ3 ‰[ .e â(SõW»O ¢=A Ó jZmock_fS(funcó–0helx, **kwd7À“H , !, 5·0V Ò÷Resource(objectƒ“_÷o.yieldŽWstopp? @óu$_g™°%! =�¯)Ø2tryÓ™'™ #° "8lfinall<¸<ùfNested!B¥ "3, *2©-4 = Dµ!(1œ9if 9ais notÚ_óraise RuntimeError("Å 5¢reentrant"T7 ]!= I(`vars =- ‰ 0mgrMù Ÿ*M·.append(mgr7)r)L/5@left9-jexceptj!if"@!__-÷_(*sys.exc_info()åð raise  Ðreturn vars ñdef __exit__(self, *exc_info):#'÷# Behave like nested with statements-÷first in, last outöNew exceptions override old oneH@ex =*�A°for mgr in °†.entered¬°:try if9.ï7*exã"zv(None, )„(Ãf<Dsys.G(8±! =[TÅif ex is notö _ðraise ex[0](ex[1]).„ _tracebackñ2]) class MockN­(ðö(inöƒmanagers#ã4?.__*¼Øû_called = False"g!Dargs@®è_¥¤{6TruzóÌ Hk Ä j ÃÆQ ŒMÓxÀô FailureTestCase(unittest. "‘NameErrorËy!÷fooNotDeclared("I– foo: pas„ÔpassertR~%s(d,/R)MŒE˜‚Attribut–1—¦QLacks/{(object›½µ‘õ, type, value, ÿ 8×Í€J7fooq 3hfoo = <N%jRegex(ýS, '__}'<g;2; AndExitB <  'Rn :xitX  Ž Bê6Y.&<+97xit¤ðSyntaxError(self, c£odestr): ÷ def shouldRaiseSyntaxError(s'.õ compile(s, '', 'single')L±self.assertM's(O,g3, c• I‘ótestAssignmentToNone”7elf— rqð('with mock as DŸ:\n passµ C’ü P(QZ):\n'%aÎðTupleOnlyContainingLá1,â>,ã'ß-Ay }Afoo,Ó_, bar¤ÀEnterThrows(<Khclass !gobject#ˆÑ0__eH,__D!rKs Runtim¹"Zv threw"3.S3xitRl, *arg+¼'9¼Ó(«Ict =Ñ wa.foo =I n: ct8'3{� ' üÿý¨‡5QEqualP”Ü)ëçAExitA¼ »(Yeturn €?__e ù&42ðJ±væ Ðgt' ᕱextmanagerA­•ionMixin(7®AetUp—�·ûTEST_EXCEPTION =ï±· exception"Ë%rInWithM‡’InvariantÚ,µ_¤ y@PTrue(Ü'.”fcalleds¬3LFals4Õ3– g3Ÿ ¤f_AfterÜ!, WOç6 À.exit_called3) õself.assertEqual(mock_manager.exit_args, !) =Bdef 8¢AfterWithM6ðInvariantsNoError(e(, Z!):E…‚J —,<@v(None, )¢ InŸ–Generator¡šgœBTrue†)�.yieldedNMFals1Pstopp1ÂC¤E‚«3ÛªñraiseTestException>ƒ" ÐïTEST_EXCEPTION2¨4 ÷û�exc_type=«¥¿þö�nter_call«e3 ) 24if €1 is¢÷WS} O[1],WxMk = ò�.ˆ1z 0]úD> # q the __ñ _ arguments. Issue #7853èžq“IsInstancwDmðÏv C2NotŽ>"2] _fyhZR clas&a alhäCase(unittest.“, ContextAăionMixinëb6eInline÷aSyntax")£Bwith¥cZ_(.2FpassÜiuUnboundj d/ =f 6“ 8x�ኀ³ BÀ!'z as foo°£‹6fooì±# FIXME: Ingñ future, we'll try to keeptõ names from leakingHðself.assertAfterõ(WithGeneratorInvariantsNoError(foo) def testInline3ðBoundToExistingV@¡ble(self)::>¥foo = Noneô with mock_contextmanager_g�–() as fooHL[Ÿ.assertInÀ¹.2_After5õoDottedóà�å#;)Uê/äÕã Ì´/ =» “Í4 ÑM<Á(¦&i% T p<wý2ÿNestedSingleStatementsV/_aX!/_aZŠ/_bQì­ _bU:bar|$} &_a7;b; õ ¸q u::bart6Jö _µAz9� gw7tê Úo'ræ¡‚ class ðxceptionalTestCase(unitp.,UC,AƒionMixinpxr;Arg³lSyntax€ú’<–h\Jpass$zIŽToNonTupmžñ# This will bind all the arguRQ to nl±() into a svQ list?°Ð# assigned tos foo. ðwith Nested(m) as:&õself.assertInWithManagerInvariants(m)2._After1pNoError89ò def testSingleArgBoundToð ElementParenthesizedList(l)­òm = mock_contextm¨¶_generator(§ð# This will bind all the argunbs to n¡) into a s Q list¸ # assigned2] G(foo²@Å_dƒMultiplea Tu ™•¨ òshouldThrowValueÂ%Í O‹ m[, barHLEpassf‘&vRaises(…/, œ!) >¼ \0Unb^ >¯Px/t = MockUW†/;Ìôy^ D»š|dž JŒ ¿¬?ArgÁ¯n,o,Ì f, n, oaû/Lén2°dn8$Þpä8 ê«Èjå %H½,f‰€ê, Àtmanager_gen³erator()) õwith mock_nested as (m, n, o):'.òself.assertInWithGenQÆInvariants(m[4n4 o4 xManageršå<Ô_After×xNoErrorÞ:ä:ê: é¬ðò class ExceptionalTestCase(Contextm2AáôionMixin, unittest.0@def ðSingleResource(£"Bcm =_cf$_g<(�SÇshouldThrow(HL« cm¢f#.rt ¦*ª %+(c©7á\{¼@@aise0oæ"�R(‘s(Runtimec', _5¨ Õ½E Þ;Ù=1â›îѯNormalizedósô)# Note this relies on the fact that 1 // 0 produces an eæÁ#4…is not nïÝ immediately.6cK ìÁZeroDivision¬ñ5-, [!) ‰¼Ná°pStateme²¤j a¶1b1�åçUaë>fooæ)b)>bar)Óæ ½ >(Kat7?b?�H7.foð~ ‚C8bar†À seó lf.raiseTestException() Àself.assertR(ÿ s(RuntimeError, shouldThrow5ð AfterWithManagerInvariantsE(mock_a?+b? �Generato€ä?fooC-Qbar) :ðdef testMultipleResourcesInSingleStatement(}!):6sqcm_a = ‚contextm:$_gÄŸOcm_b/Wánested = MockN (w , NÅß(¦ªBwith¨Q1as Î#.rî@_a, ßbDH"b In *ž˜5959)y^ F2ÌÂn?â`ÿ v=©D¤m‚1·Ë Jbnh¿BeforeInnerá1ý¥bar = None‹Ba asé6fooËk`á ´7 ;|j ¿;? &ÍbÍ>barÍ-Epass&dÞ!j à#ð # The ió&nner statement stuff should never have been touched ñself.assertEqual(¯bar, None))ÿ False(mock_b.enter_called.?xit- „[-DargsŒ�ðdef testNestedExceptionAfterI S Ì!):6ïWAa = ö contextmanager_generator(Æ(b1œygThrow(}�Bwith}Qa as k6foo¢%)b)>bar)-GÃrInWithMÓ¢Invariants¬aÙ7?b?GI€d?fooC->barC]•raiseTestÈ""R(ós(RuntimeError,,³_5\ZE c?'No=a=X~1 aô¿C‚/_/Ée/pdStopItLion1Wñ# From bug 1462485C`@e_,cmiyield %M Ew  ¶0("f¥Y&")dˆ+ðysRegex(@5, 'A'× ¥\á@2@ûclass cm(objectxe"__�_VEpassS6\5û , type, value, tracebackn<MNJ ü  \¡ 3K£# Another QÄ where the e€r hasn'tf§instantiatk(e705170J(Àd d÷ef shouldThrow(): |with cm"õraise next(iter([])) =9Àself.assertR.ûs(StopIterationl ‡Jrdef tes>@dGen:€orExit1(^Cõ# From bug 1462485�õ@contextmanager_ÝRyield€è% ›" ¶0("f¥".Ë ) 6,£7—2÷class cm (objectQýœ__enter__W!EpassTœc__exit5û , type, value, tracebackn<MNJ}ˆÌErrorsInBoolÔ# issue4589: ò return code may F€an excepüò # when looking at its truthI.¥ÇÆ 'in�Îbool_convers‹‰SÚ ñ›!__H(ö-u%()ì% 9�result = ‚ *{– t3d:ša, b, c‹B ”vNbtrueAs¥ )å<Ïlambda: Truef_qfail("S‰æ NOT see this"$j „Ofals…F+†š¨ ÍAÚ1ion', ‡¥Ó%ß%O1//0Ÿ%¦€ZeroDiviç©"il�B) éðNonLocalFlowControlTestCase(unitl."):�ÜœWithBreak0cou<E = 0ˆQwhile 0,E+= 1-BI@mock±È$_g O}PÐ break  ôcounter += 100 # Not reached %óself.assertEqual(6a, 11) 'ðdef testWithContinue(8!): K6E = 0¦while True(,˜-4if H:> 25 Ybreak2÷with mock_contextmanager_generator(¥De�¯Jã i 3L 2LlReturnJn1£Ù*^2*~r, 3) ÙðExitSwallowsExceptionTestCase(unitO.*):h? C9ÚnsAfrican.x ?n §’z:tryie Š(’j51/0Deú ZeroDivisionErrorYwmfail("*ò should have been sv;ed"¼T¤FalseDoesnž�ZoEurope[O™\ Œ]3 Oelse|)Braisy¯NestedWithôÃÇDummy(object6˜'in:!=Nqgobble=>6h1if *@ is - Ø" = `{¡" =Ez2 = !ê‘called = £&à %&Ðdef __enter__—(self): ù.enter_called = True%qreturn ,evalue Ádef __exit__`¿, *exc_infok*jc@4 = p»"if‹jgobbleÐ ¯Ç9÷class InitRaises(object Ç%inÇ@): r,ò RuntimeError()ùPE6Q YR²ƒJY pass~xÎ }Aim û9ñtestNoExceptionsøMBwith¢ÝDummy() as a,b»ü`assert»)(a˜)ʼ ,b, (!a.a�S 'b'{úø¬InExprList:tryÛ ˜Eæ ·et \ ! ÉD(™æñóî+6ï™ñfail('body of bad A–executed'¹ ¥;els/oéq not reo/£(_-xiL_úv = Falsžnk=@ vE. u `;ð}Zð/K O |Õ'€NotEqual Vœ[0], None§œRªlsTuple¨ ,Êa=(1,2),µ(a1, a2), \¶¸4S0, 207kb1, b2WÄÁ\1äY $2€ } $_10, bI%ð2) if __name__ =ð = '__main__': unittest.à() # To fully ñJ this module, we would need a copy of the stringprep tables. # Since we don't have them, Xbõchecks only a few code points. import©h fromo!¥* class SŠeTests(ãRCase)û1defäS(selfñ.assertTrue(in_Òá_a1("\u0221"))> /OFals0201 `b`00ad0\� `0e0`3mapÁ!b2Áp041"), ÌO061"Ëš:/:u3u&:uª#c1K 20GK1Ü×bLab1bxD1_c1—È5Ì2�/1f�1Á�2È9b1Áb?1_cf5jø?e00“0"f90Ê4’?fff+00�`5`"d8�y}07�`6`Offf9M0( Ü7`?2ff€0c�À8`?034`0 Hñ# C.9 is not in†5bmp€!# sÀassertTrue(ió n_table_c9(u"\U000E0001")) õ# self.assertFalse(i78727867Tru5 d1("\u05be0fe0f0`2`)04Ç� Åd00`ô2# This would generate a hash of all predicates. However, running Úõ2# it is quite expensive, and only serves to detect changes in theóò# unicode database. Instead, stringprep.py ¯s?· version ofJ'thF aimportç7libí° = [k for k£Fdir(~ô) if k.startswith("0?")]Ph.sort(s\p\u:;[¨f = getatt~8, pH)`# CollW³ABMP CkpointsUXÞë"0"] * 0x10000%�i�r¦(%)¡|Pif f(µ_hr(i)#'w›[i] = "1"np".join( â4h =°Y.sha1K`�h.update>ðprint p, h.hexdiges�ò if __name__ == '__main__'é�unittest.a() """1ñ case provides supT9€checking?ñwait behavior. To G©different "¡, overrideàñ_impl method. We wanteò1() semantics --t1forƒÀthread survi‰wÑchild after aKð(). On some systems (e.g. Solar0Òithout posix Zðs) we find that;` activÀ{#|Vš{0; t‘�is an err*S""" ²0os,”p, time,+ ‹™0b.›aƒ¦ô LONGSLEEP = 2 SHORTð0.5 NUM_THREADS = 4 class ForkWaitðz².TestCase):a def setUp(Ž%._¢d_key =7.WsetupÞ8 alIE= {}:vstop = ¾Mså]–ŒtearDown™0# SF5`1ß*Çn2Š$ÏËu = NoneTFh.clearÿX!"Qnup(*8 R)ïÀef f(self, iSd): öwhile not self.stop$õalive[id] = os.getpid()F):try:úime.sleep(SHORTSLEEP8îexcept OSErrorCQpass jàdef wait_impl(™X, cpiÏ÷for i in range(10ë�#A½ñ# shouldn't hang, but some of the buildbots seem to(ŠK#k,ðforking tests. This is an attempt@1fixZ‰problem.LÂspid, statusgì«ä,xzWNOHANG@0if ;1 == AYbreakkt–H2 * š(_Ð.assertEqual(ep%¿ñ, 0, "cause = %d, exit R" % (åT&0xffòV>>8))çH_çÅ á·NUM_THREADS%›’thread = Qing.T�(target=áÊf, args=(i,)W7k.startê: ’s.append(€°# busy-loopûÌ ½)sCpdeadlin)—õmonotonic() + 10.0+¬1len.•G) <  þQ~:0.1à5if {!< *{ HÐFŒ§a = sorted�g.keys(I*E‚a, list(Ÿ¹)þl0preQ_v Gg.copy(gþ°ys.platform�Ú['unixware7']ÉJ\`1ØOelse, tI:= 04u# Child&Í[…OLONGFn = æ4)0keyÎü k'ý¶ ™[key] != >:>in += 1¬@os._«&(n-‰# Parent;¨æž!´) import os @unitÜQ from. $0sup,P spw·.�_module('d') @Kð.skipUnless(hasattr(os, 'geteuid') and? (),)0,¿õ 'root privileges required') class TestSpwdRoot(†kCase):Ærgetspal±¥aentrieß0pwdT'zS>³IsInstance(8I-35 7iesøÀ self.asseðrtIsInstance(entry, spwd.struct_ ñ) def test_getspnam(self):!?Ries =B'Uall()"sif not ):>Mö.skipTest('empty shadow password database'TÔrandom_name =[`[0].spp}vy�Ä?TŒOasse¿7REqualQ‰/, l 5·?[0]ž2v6 ó,Ÿpwdp, str2 h-š1š2nhš¿lstchg, int4 œ/ž2žh?mine,b3b/axb,b4b?warÅ-d5d_inactÈ.f6foexpireg/h7h?fla\-d8dWwith þûRaises(KeyError) as cxðf$‡à'invalid user ÍãZíõstr(cx.exception), "'L!):Akfound'"9¦AType§úH4!?, 07# D:try7PbytesÙîÇos.fsencode(Bƒ"@ Uni$E*ì U`(:lse€4 &,  �) @unit5ÚðUnless(hasattr(os, ¶ðeuid') and os.get…() != 0,—a’'non-root0ðrequired') class DÅSpwdNonRoot(‡ðTestCase): ódef test_getspnam_exception(self): Åname = 'bin'6try")Pwith :ú.assertRaises(PermissionError) as cm;?Tspwd.Œ(s)lšA KeyDC:excDz skipTest("Oñ entry %r doesn't exist: %s" % eg, exc)k?lseYÓÒEqual(str(cm.•öion), '[Errno 13] ñð denied') if __Öò__ == "__main__"m@unitŽ.`() -- Èàcases for funcœÐs in math. --'ðEach line takes the1#m:  -> BTwhereO% Q°is a short ÙÁ identifying†y,D i¦Óa to be�÷ ed (exp, cos, asinh, ...)H ¼„ trt`repres„ñng a floating-point íŽ ñ’`expect…rideal) &<p, againt°n ed�1a s†—ñE £qlist of ™ló required by C99©ÒThe possible )aŒðdivide-by-zero : ru`d whenainite 2„ gives aÀDâematically inf-fresultÇ�overflow] ET thatpc€oo largeò0fit˯°usual range$öan IEEE 754 doubleŽvinvalid�èðs (e.g., sqrt(-1)M…ñignore-sign : indicat3!atš¦2 is<ò unspecified; ciÑ+dn0inf³)Zðn both -inf andn:0uldú acyHecorrec€FD° may appear3”any orderÀLines beginn Šñ'--' (like this one) start a comment,�0areä‘d. BlankTRs, or q contaiaø only whitespace, are alsoH M­'‚¨N@were‡ pup² phelp of;0ver6@ 2.4ÀMPFR libraryåð multiple-preci/: arcomputa>jeó rounding. AllîB«"in<Afileäð(modulo yet-to-be-disc#º0ugsm _"lyaped, proªd e´®�fpdecimal€ Â�0 be9i`terpre:a…Œå@1Š1spoæà nearest IEEE ùX754 double-precision value. See the -- MPFR homepage at http://www.mpfr.org for more information aboutGÏproject. -tñerf: error funcN/--4ð erf0000 erf 0.0 ->1-20inf031.03--40nan00nanÇR tiny9s@1‡`1e-308*ñ1.1283791670955125.ž 24.ó4.9406564584124654e-324.³A1e-1å [6˜Ósmall integer›2›hò0.84270079294971489d2’2%ó99532226501895271%‰3%ó997790950300136%J×20.9”845827420oV5J(d984625J5{6%�`3Ï -1-Ñ3Ñ-Ò-‰Ó3Ó-Ô'Õ3Õ-Ö'<999×3×-Ø'ÜÙ3Ù-ÚkChugeT€ should Íògo to +/-1, depending on sign44Q411e1jDõL1e153éE1.7eÉ0[ðIssue 8986: inputs x with exp(-x*x) nearýð underflow thresholdã±incorrectly¿ƒalled ov,Õáome platforms.à1ä126.ÎÈ"10à126.˜à926.ø"10Ý326.£ý"10·"27EH¨,27x6™,27x7xÁ-£"11ÃÄÅNÇÈÉ-ÊËDÍ ‚Ï‚‘ Ýðÿerfc: complementaryã RMcócí¯M c î Mc«0÷3L$c ù2L/c ú 2c00Ý(c üY’ê®1”Ø¥+Yq8716204zÕ2c00Ö!c ó0.15729920705028513,à21 erfc 2 -> 0ð.0046777349810472662 erfc0022 ô 3 -> 2.2090496998585441e-05*3*4*ô1.541725790028002e-08)4)5)õ374597944280349e-1}5*6*ó2.1519736712498913e-17 U"30+ -1,ô1.842700792949714|#31'2'õ995322265018952'ö-÷ô1.999977909503001ó3ó-ô'Ä999845827421œñ-ò'T84626'î-ï 0 -- as x¬‘infinity,Áó(x) behaves like exp(-x*x)/x/sqrt(pi)X4 20Hð5.3958656116079012G„4 2« 8.îÇÔ11965228e-274X%"27Xô2370464393526292e-319,* 28,"0.ܳhuge values(5¬!-4­42.0™11e1C™3005‡\-1e156wi1.7e30|ðIssue 8986: inputhFwithKð near the underflow thresholdœó incorrectly signalled ov,òon some platforms.Í#10æ326.ˆP64325¯³4389461e-30û#10û126.hð4.4017768588035426.”#10126.) 1.08851258±@2269.˜#10!126.ð2.484962157196662.1ò#10É127.i/5.ô#10Ð"27æð9.881312916824930\2\6Ù2 27æá5107ÒI1I-J1#1167#R‡1ý-þ6êÑ× ‡Ø‡/ -%‘ólgamma: log of absolutdÍ$Ï function --t(utspecialÉ„P0000 Bma 0,Ainf ðdivide-by-zero &D0001/-0/2/Wd-> infJ3-40nan‰1naneónegative integersM1ÆXRÅ —1Æ/ Ƽ2^ÚA1e30‚0/íT-1.792ðdivide-by-zero ð -- small positive integers gðfactorials lgam0020 ´ma 1 -> 0.01223ô69314718055994529B3)4)Ð1.79175946922-'4'5'ô3.1780538303479458(5(6(ð4.7874917427820(… -- halfô:3ä!0.dô0.5723649429247000e3ö1+ô-0.12078223763524522W 2,õ0.2846828704729191W 3+ô1.2009736023470743U-­ô1.2655121234846454+-­õ0.8600470153764809�6=-­ö-0.0562437164976740Z7.°ð-1.309006684993042 nÄvalues near 94nTó2.252712651734206À4l10.0* 4.B´79878042021K4k@1e-8ÿ018.K¥8073818020+kA1e-1+ô36.84136148790473B4mP1e-30Xô69.07755278982136B4nX-I368.Y4oY²õ709.196208642166t4n05.6ˆ9‰/Õ776027137418978�:5.5/`940456Õ4167f9/‹\ô11.4987937351601¸5¼-2áP743.7µ@4740«5À‡2åõ744.440071921381-6ZRáô2.368961332728788á6X¤ô611024992752801„6-8497°6, 6- 6-/16 6./30 6-6- 6 Ž! 7Ç"7Ê# KInega½Ì8~:0.98¹ô36.736800569677101;‹:1.0áõ36.0436533891171 8c uÉ€35.35050ÛE5572�8q2t.ô34.657359027997268~*00<ð -331.85460524980607 lgamø0085 lgamma -99.9ð86 -> -331.85460524980596 -- large inputs CD0100L0170<ô701.43726380873704*1*1*ô6.57306224578736*2*B.624.ô9.78077443669895.3.5.µ59168294836.4.2*ô11.71472580228999X&1200Ûö13198.9234480542U6Uñ2.55998332785163e30�ô1.7976931348623099e+308k7@4@Äinf overflow585p1.7e308Î (³­± for which ù³(x) is tinyN2ÈQ-100.µö-364.90096830942¢2Ì4-16.ô656.88005261126432\Ð4-17.õ707.9984331450788.ÐC-171Šô713.14301641168481\ÐD-176.ô38.9524759084648Z2ÔD-177.ô44.13144651738037\×E-178.ó9.3160351186001 .3Bç@59140701¹$51]3C5300sÀ279278.66299<>3D‘450359962^#95™ñ1.5782258434492883e+17¸óresults close to 0: positive argument ...Ì5Ì0 @9989h�6.4083812Ñu00075e-Û5Û 1.Ûsô-1.2816762426960008e-1¤5ê1|{ø-9.3876980655431170|>2|Gñ1.8775396131086244{+É... and nega6Ñ-2.7476826467” 5.24774081t9136e-1¤6±-2.45702473¯ð3.3464637541912932e-10 µ-«Å1: GÅÏfunction -- 50---Uð special values gam�1 0.çD ãdivide-by-zero/1/-0-1/2/&c-> infH3@b-> nanvƒ invalid(4( '˧ƒintegers™0 ar¤B#10B-xHi j1Ú§(ÓA-1e11+ º1â21e3C)(ÍVsmall�Ïg�“factorial­2ÌË1#2¹¸¦ð3 -> 2 gam0023 ògamma 4 -> 6 gam0024 5#2456ò120 -- half integers)#30)!0.Aó1.7724538509055161(1(1(ó0.88622692545275805)2)2)ó1.3293403881791370(3(3(ó3.323350970447842à3à-¢ó-3.5449077018110322Rô-¤ó2.3632718012073548)6{-¤ô-0.9453087204829419¦7+§Ð0.27008820585!11[Ãvalues near <4[1†ó9.513507698668730â4[20.0)ó9.43258511915060á4[A1e-8R9¢.422784343á4\B1e-10)]Q1e-30S.Sc88e+29.aW/+1.XT0e+16h^²0#30˜4m05.6�9‘“1.7857142F48e+28Ÿ55.52ãinf overflow»9)‹Y' )5µ) 23‚)¶y2’)6R1-0.ßó-10.68628702119319·6S- ó-100.5871979644107+6 - +Œ’.57721567û6 +,20±6+/-960!16-ã62!302ã6-- 6--  6�' 7Å)Ä )‹0‹negative›8t0„"98ª`900719ƒs740992.È8… �2Òó4503599627370495.¼8V r8õ22517998136852488c2°-1125899906Ù%239q*00;+ô7.5400833348831090e-14¯9¦8õ =R40962=€@largq2put $10o!17É@4.26± 0090047051y`$10b!17©à7.257415615307ê-á$10WR171.6,ð1.79421175992481041Þ$10P1À25 -> inf ó overflow gam0104 gamma 172 -> inf  )5)J2000* )6)w1.7e308,)ò -- inputs for which6²(x) is tiny¡"20p -100.5Nó -3.3536908198076787e-15911161ó5.2555464470078293e-28612171ó3.3127395215386074e-3081311“ó1.9316265431711902e-3100dB-1760ó -1.1956388629358166e-3211lB-1771ð4.940656458412465‘#240sB-17804-0.~7®98€201.0001`9`2.9999[3œ;>3‰0+.3B|ö4503599627370495ª-òthat cause problemAðthe standard reflection]Pmula,Còthanks to loss of accuracy in 1-xL4Ôñ63.34907872902298}ó4.1777971677761880e-84òñ27.4511763294329<ÿ 1.1831110896236810e-214 -'Üðlog1p: log(1 + x), without precis ÷o¯small x --x*yñspecial values ˆì‹Q1p 0.+1F 2†�S3-3nan¨uinvalid040(`-> nanfô singularity at -1.03#103›k^ådivide-by-zero7Ò#Fñ36.736800569677101Šcfinite:» < 1.0 are É2–[±à 3’!1.Ñ$k"-2¤$t21e3õ&¨! xz 1p¼3~ x1P5Û4  !¨1!* !¥� !¢1B$15Ô$11D1e-2 420 A^›¥- #¦-|E #¨© #ª!15‹ #¬h®ò -- some (mostly) random Êóand moderate-sizedVZÐ200 log1p -0.ñ$89156889782277482 -> -2.2216403106762863 log1p0201 ñ -0.23858496047770464<õ0.27257668276980057=2=ó011641726191307515>÷0117100216544956?3?ô090126398571693817@õ090534993825007650€4A‘023442805DE2781BÆ5554240995695Cò1.5672870980936349e-Ä�µ01662046e-5„6A 7.96500132xq5295e-6ƒõ330482740401e-6A7Aò2.5202948343227410e-Ö51519170971e-†8Aò8.2446372820745855e-1p4144559„9Cp1663670@9078(E&8.¤824230e-12C#10Cð7.0351735084656292e-18AŠð5.2732161907375226hA`236188AŽ;1.0@e-10A49.95#71�`2.1401†°66000197e-9@µ43099470e-9€Žñ1.2668914653979560e- 57¥e861e-8?Š01.6é³07816299069H 4999461317®G1ˆ08.3d¤9564583939?¡1450242662X~†3=12<58P89997X1„Q0.007[‚Ð6975613736425B~€ñ0.01302623531505300}õ2942123564008782z%¡3497160797!ÃÕ0688552191503v2v 0.02762559öT13528=Ô0897463483054·2rñ0.1417968724554487oà0.132603225409µó9 -- large valuesL$30Æñ1.7976931348623157e+30@ô709.78271289338393Ç ü1>Žô690.7755278982136$30È>Ëp161.180Àu0958321¹61òD3ñ3.025850930040455Sotherð transferred from testL¡1 in S_mathr4+ò-0.63212055882855760 È34)P71828a459045¦9$] 0.³P47180C4452%40!ñ.2379400392853803e+2±€62.38324ùp395075 &-À-------------  -- expm1:ñ (x) - 1, without precision loss for small x -- B# yñspecial values ˆ@0000‹�m1 0.0 ->1-20inf85inf3-E-1.040nan81nanž�1~ xúdtiny x71§`5e-324: !­1!Ë !±0!0š1·T1e-15!&15!»D1e-2 420 b2¤-›¥ #¦-†E #¨© #ª« #¬h®ó-- moderate sizedð, where direct e( atŽóruns into troublef1=3.S54e-1B%10ÿ:9.9Q5e-082?u0163e-8r3ihP1e-05A4?U34e-5@;Q0.007:1@æõ069755570667648951AYô0.071499208740094633@õ690029857448202D3105ÿfõ63296004180116799?õ1334416373633009~6?ð0.02390954035597756=õ4197665143819942<7< 85\¡5264904490ùõ0.089411184580357767=8=ó596617494741100x€81596588F0148r9:ñ3024720621207513ðõ0.3531998703584867uõà0.745747273758�v�1.1080161>E3745(1i00.9Ç`512926Ò1ëö1.65826892073721¯1að0.8450154566787712aö1.328013797653589­ZÐ1397926032312f; -0.1304614šU396061Vñ5289932203964327±@-0.4íÄ213643695923œ1Tô7408326147890063=÷523283171247970·Rñ-0.9384776698454605Oõ-0.60877704724085946zS1"2íÅ.46579480671¹1A"27iõ532048240600.7986212!12Qõ2.6195173187490626e+5þv"12ZÊ]µ38557876466²2V-35.1ú"00<@#44 ãtreme negative5 2Ú3àà-0.99999999999ñ999989 expm10200 ä -38.0 -> -1.017710â-- the formulaBð(x) = 2 * sinh(x/2) * ö doesn't work so -- well when&ð is subnormal or underflows to zero; check we'reFÕnot using it!¹1Txm1 -142ºíF0212 5 3 /50 4 .e575u.79e308Y²óextreme positive values¼3“ ô -> 1.9424263952412558e+13¤$30ë!70‰ð1.0142320547350045e+304y´²next test ( ñ 302) is disabled because it Às failure onFóOS X 10.4/Intel: apparently allÎñ over 709.78 produce aAÔÐ on that platLð. See issue #7575.q¨VUÀ271289328393_ð1.7976931346824240ø8VÒ >P48402>1inf²˜3å"10[%ì1 %6»¥ )èòweaker version of5E0302“7Y5¹ò1.3549863193146328÷/ -k�log2: logWŸbase 2 --45dspeciaá D0  %Ö  divide-by-À71~?2 -8727fd-> infP3-9nan…” invalid040(p-> nan ãRexactÂ@ at ÞB00100110.00@negaÃsW2'p-5e-324¡b‹ ‡2X - ·2c-1.7e-Y 5` ÎsÏ`powersY2°#10°2×ð#10™442.02‚.3‚"1634l3f55V6g66#12i77#25j88#51k993102mÒÕÞ3204o1 $1 0.r!$02&20.2(#20(30.1+#20+C0.06.³ ` closeœ‡l  ”vÀò3.2034265038149171e-16Áà301 log2 1.0000ð1 -> 1.442695160185àe-10 log20302 0 1.10ó878274712997e-5 0"100;0.9kô-1.6017132519074588e-16<1<6¢w3302210¢1¢r1Ñ7022544056922£â-- tiny valuesv#40²b5e-324?C074.#40–1 3 3 €!1.B"ô2.4150374992789n3ä2N32.0A4Ao#08oó23.1538532253071#41›ö2.2250738585072014e-3=^Å$04,ù4.450147717014402811Ý1¯Ž7Žù 19.8319251304202 -- hugeY5Yó1.7976931348623157e+ž5102i5i.!ã3.919387971670û5˜ð8.9884656743115795]ª0102¦�ùselection of random¬6¬ð -7.2174324841039838e+289úÒnan invalidÏ6´ö-2.861319734089617e+2657 85à-4.35076468940:Q2e+25Àp��-6.671726¡520224e+23¿84w-NÐ180237866192982à58ö1.5478221302505161e+206á 68ð438048513136460à/00878÷3.7235198730382645e+18Q p88ð1.04722422350957/1898ÿ5.0141781956163884e+16¨¦2-2.v�80311603pGˆ²÷-7.9677558612567718e+9o 0¹÷-5.5553906194063732e+4 80ñ16573900952607.95¨£  P10€71983710õA8861“80ð6.072711512142267“2÷ ¨0À2.5406841656«X57e-3t ¨0ð4.9056766703267684ä 80ñ2.1646786075228305e-7çä 80ø2.470826790488573e-7§ à2e0-3.xÀ709303489064Á p2â0-1.u÷496976649986e-18Q 8`p1.59354hÐ4317996e-255 ð -> nan invalid log20623 ÿ -2.8750977267336654e-293 848ð7.607946679473258586858@3.20/ð3539988545e-3077ô-1018.1505544209213­6=€1.6749378¡72249e-244<ô809.80634755783126<7<ò0911259044931283e-21=R710.7ÊG2274y8=ò2.0275372624809709e-15=ô510.55719818383272z9=ñ7.3926087369631841e-115·ô379.1356473531229="30= 1.34801982Ýq2423e-8fô-285.2549744509443ó"31<¡8.99273846 a947e-8Úó-272.55127136401637µ"32<ñ3.1452398713597487e-60´ô197.66251564496875<Tò7.0706573215457351e-5ðõ179.8842008778221xXò3.1258285390731669e-49xô61.13023800505653\ò8.2253046627829942e-41<ô33.15898277355879´[ò7.8691367397519897e+xõ165.7506820273241;Z2gñ0561983925013e+6°214.1845353%75îXð4.7827254553946!+7 õ258.0462962844567íVñ3.1903566496481868e+10f 350.476167/41164Uà5.619508244950ÓAe+11 37 Ã831861008250)4U€9.962565¡651047e+12x0418 •529212287¡4Uò2.7358945220961532e+14<õ83.131586369234ü4Uñ2.785842387926931e+17fõ579.4936021486028³Tð2.416917250725275<ãô642.4052903928965€4T�3.1689091€0956³2g�682.6592Ûü4Tð2.535995592365391e+208��692.30359[E6046³T`6.20117Á66089916e+23¢ö776.641775767309*U2t@32744"77³5<À841.57499717ï4‘4V 8.a0931n1747´9’€989.74184€073981 -ðBEGIN PRIVATE KEYðÿ|- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCr77F9oBLYuLIb 3t4mDHPoxOEnu1h7NQaJdn9tR/KjW6AzhXXm9USh45qt3sR6Wo8sDlBIJ3vZyhyW P939qYUeGOZJahupYi4IkqVckZXARm3k9qhAI/aC4ixVFyxnxg3bNpk8Ir0AyyQV oudY+33+ZNj6+fHzeboGDJ9uE/RTcp9JqE/qo0haATZufJfY63ZCUpYFn6j5W4jG vpqg5/0hba8Cxdk62387uNknfVHSMzGkkq82zbBpud6TYQofCp3VlEPBjz9iLCz6 FFOKgLZmbk8QsdktXF6zfRJJk+vbZTh/OGH0p/eiIfW1kXOzOcuW31XRFTPnykJd 4QðÿÿUX9OajAgMBAAECggEAHppmXDbuw9Z0FVPg9KLIysioTtsgz6VLiZIm8juZK4x2 glUh/D7xvWL2uDXrgN+3lh7iGUW13LkFx5SMncbbo9TIwI57Z/XKvcnkVwquve+L RfLFVc1Q5lD9lROv2rS86KTaN4LzYz3FKXi6dvMkpPAsUtfEQhMLkmISypQQq/1z EJaqo7r85OjN7e0wKazlKZpOzJEa5FQLMVRjTRFhLFNbHXX/tAet2jw+umATKbw8 hYgiuZ44TwSEd9JeIV/oSYWfI/3HetuYW0ru3caiztRF2NySNu8lcsWgNC7fIku9 mcHjtSNzs91QN1Qlu7GQvvhpt6OWDirNDCW+49WGaQKBgQDg9SDhfF0jRYslgYbH cqO4ggaFdHjrAAYpwnAgvanhFZL/zEqm5G1E7l/e2fCkJ9VOSFO0A208chvwMcr+ dCjHE2tVdE81aQ2v/Eo83VdS1RcOV4Y75yPH48rMhxPaHvxWD/FFDbf0/P2mtPB7 SZ3kIeZMkE1wxdaO3AKUbQoozwK³ñÿÿÞDqYgg7kVtygyICE1mB8Hwp6nUxFTczG7y 4XcsDqMIrKmw+PbQluvkoHoStxeVrsTloDhkTjIrpmYLyAiazg+PUJdkd6xrfLSj VV6X93W0S/1egEb1F1CGFxtk8v/PWH4K76EPL2vxXdxjywz3GWlrL9yDYaB2szzS DqgwVMqx7QKBgDCD7UF0Bsoyl13RX3XoPXLvZ+SkR+e2q52Z94C4JskKVBeiwX7Y yNAS8M4pBoMArDoj0xmBm69rlKbqtjLGbnzwrTdSzDpim7cWnBQgUFLm7gAD1Elb AhZ8BCK0Bw4FnLoa2hfga4oEfdfUMgEE0W5/+SEOBgWKRUmuHUhRc911AoGAY2EN YmSDYSM5wDIvVb5k9B3EtevOiqNPSw/XnsoEZtiEC/44JnQxdltIBY93bDBrk5IQ cmoBM4h91kgQjshQwOMXMhFSwvmBKmCm/hrTbvMVytTutXfVD3ZXFKwT4DW7N0TF ElhsxBh/YzRz7mG62JVjtFt2zDN3ld2Z8YpvtXUCgYEA4EJ4ObS5YyvcXAKHJFo6 Fxmavyrf8LSm3MFA65uSnFvWukMVqqRMReQc5jvpxHKCis+XvnHzyOfL0gW9ZTi7 tWGGbBi0TRJCa8BkvgngUZxOxUlMfg/7cVxOIB0TPoUSgxFd/+qVz4GZMvr0dPu7 eAF7J/8ECVvb0wSPTUI1N3c= -----END PRIVATE KEY----- import io im Qos im ”threading…unittestðrllib.robotparser from $ E0supM´http.server ð BaseHTTPRequestHandler, S*� class +Rl¡Test: {¡s_txt = ''Aagen‡_"�‘good = []-#ba òdef setUp(self)dhñlines = io.StringIO#ü� )..)!()N9H.M = u1.ÑQFilePA;B(]!) ]«Aget_î�_and_url”,g¼÷ if isinstance(url, tuple#ªI<©fvreturn $è ¤…t s¡y0for®A in B)vzT# =$ ö6urlr5Bwith-0sub.÷=ûÀagent=agent);: ñself.assertTrue(ñparser.can_fetch(agent, url)) Dñdef test_bad_urls:)a0for0A in T6bad…T" =#Aget_1_anU(qo1Bwith-psubTest#a=url, :=‡5„èOFalséÀ class UserA�Wildcardy�BaseRobot`, unit.CCase…r#Ðs_txt = """\ O-¨÷8: * Disallow: /cyberworld/map/ # This is an infinite virtual URL space C!tm8ø these will soon disappearo�foo.htmla1"""ñgood = ['/', '/Ò%!']#ba ¬QindexN7amp/xxx gC'] QñCrawlDelayAndCustom`;(X&"# l.lû http://www.example.com/ ‚Ž -d�ø: 1 Request-rate: 3/155 ø¤@ # Cßmˆùr knows where to go.•f+}�¨G, ('?ƒY­)×¾‘RejectAllþsµ-ygo away ø¸Æ„gëNRateÆ+):êr._î G+ªúl"if‡cu_çS#oEqual(&2*%W'-),pI)ªi 4}�ίIsInstance°]± Šdqurllib.Xð47×I±\¬./s,~l'ð_rate.requests  /) ÿ self.assertEqual(&:*ÿparser.request_rate(agent).seconds,A :32ò ) class CrawlDelayAndRzÛRateTest(Base°, unittest.#aCase):dñrobots_txt = """\ User-Á¡: figtree p -dqC: 3 ^-ìø: 9/30 Disallow: /tmpªa%3cd.html=2fbÂ%7ejoe/indexg1"""¬•C = '—'?¡ = urllib.Ø›¯!b(9, 30øcE_ÕA = 3M•good = [(dq, '/fooŽ1')]&!ba%'ë'!2tmp! &/a+Ba%3C'D'/a%)~ %']þ DifferentAgÑ(¡ê>�FigTree Rûò libwww-perl/5.04Uð # these are not actually Dñ ed, but we still need to p1 it% # in order°accommodate[` input1qameters3 ËANone ª oInvaliàþ%*±Htmp/È /Õ®Oabananaúû˜s†/3¤zC '/a« ‡=%7Ez† …3Ž‚Ô‚s…�ñ # From bug report #523041þÅ�÷): Ÿ.¤3peaTBÎG#~ôsays "/" should be deniòqthat is!inÉ1RFC¬¦sAnother„ Aalsov }Ae‚ and Diasñ works well with each }šFÁ: Googlebot [ñ: /folder1/myfileÉã owhale/»h¶jcÓRq'œU‚”aU™¸OtðingTest(BaseRobotðTest, unittest.õ-Case): # the order of User-agent should be correct. note6óat this file is in(ð because "Googlebot"!a;�substringq$�-Mobile"&örobots_txt = """\ š%: Xß Disallow: / #W$ A'ö"""gê5= 'R'ñbad = ['/something.jpg'] class(A'9»[(¨OT0ingmož'YP8URL?`(BaseRMÍ ?€ also go¢Ýñwrong. You needçÁ# to specifyãURLs from more ic'qgeneral=£y folder1/my2X.html¿\  gJ 3goo¡7V!']DÄ#uanother~ÏGaQueryS�jx señsue #6325 for details�- * sò/path?name=valuuý+ óDï…UseFirst¬�Wildcardõ`obey fIÿ * entry (#4108)ô& Å ¿`#_Emptyô&”normalize; (#17403² Ñ?õ: ó >÷€DefaultE²ò equestRateeË òCrawl-delay: 1 RX¸-rate: 3/15áùcyberworld/map/ãr:_:¡ = urllib.sparser.\´b(3, 15tc‚_‚A = 1U5Q', '/ ƒ 4 ‘Qindex¬@!Fÿ#ttâ+¿Ù/* >)@ # T’àis an infiniteõ4 virtual URL space # Cybermapper knows where to go. User-agent: cy+ñ Disallow: /some/path """ ðexpected_output =\Q .ø* Crawl-delay: 1 Request-rate: 3/15—®Åworld/map/ šñdef test_string_formatting(self):ÀÍñ.assertEqual(str$¡.parser), # ìó) class RobotHandler(BaseHTTP¸"):0–ado_GETb †ösend_error(403, "Forbidden access")H±log_messageM", äw, *args\Epass®ÁPasswordProt¼ðSiteTestCase(unit7.ºQsetUpl]�server = ûS ù((support.HOST, 0),*Ê‚=±threading.T (¥'fname='b vYing','wtarget=˜.)eJever.ð# Short poll interval�make theFù finish quickly.qò# Time between r²as is s\û enough that we won't wakeGú up spuriously too many timess kwã0={'·_·…':0.01})Wð t.daemon = True # In casßøis function raisi>cstart(¯Á�tearDown `.shutd$ �[join( r§tr_closeq@FRreap_!sá‹/stÑ œ0addŸÓ n"esSfôurl = 'http://' + ‚ÈQ + ':0tr(;6[1]Ír "s_CB+ "/Q.txt"¸eZ¡ = urllib.$.OQFileP,!0setcF(url{@2ðÜcFalse('ñcan_fetch("*", ¸)×tNetwork @base‘7¡www.pythonMQnet/'ýj txïq'{}elseŒ'"'.É(Y|@oamethodM”Cˆ8(clõ¶�rires('nÑ'5Ewithß’transientP0netR.…2Â3cls Æ0ýƒ L.Àß1urlË , }wðreturn '{}{}{}'.format(' ðself.base_url, path, '/' if not os. .splitext(Å)[1] else ''N!) ðdef test_basic(`!):vÁ.assertFalse ÿ.parser.disallow_all)30 yGreatere¯mtime(), 0cÿcrawl_delay('*')7@requCrate8Ó ‘can_fetchŸ$:Tru#5Q'*', OPurl('Žwhere')¢LTNutchPH-˜_brian”/L�webstatsO" /K y) ÛŒread_404Úèò = urllib.robot .R `FilePa ;.÷!i-(H.txt~8l(”Ä&( ‹+†cEqual(.O dIsNone-K 3Gòif __name__=='__main__'f@unit€.ð() This is a sample doc ` in a ÓÀ file. In t-!ex)ð, we'll rely on some silly setup:ð¡>>> importõ.Z_b0  .ESD0 ¦ ¦*’ also haspð (random) encoded (utf-8) uniÁŠó Ã�‰Ã�ŠÃ�ˆÃ�Â�Ã�‚^ðdoesn't cause a problemðthe tect surrounding  ðs, but we include it m3 (i5¼N�) to makeRce. :) &Tpipes o dstringIJshutil fromg1suptUÄTESTFN, run_<ð , unlink, reap_children ifÕ?£ != 'posix<Praise[B¡SkipTest('¶ð module only works@2) …B2 = ð + "2" # tr a-z A-Z‰V½sable, s(nòranges explicit s_command = 'tr %s %s' % (/ð.ascii_lowercasNG2uppð) class SimpleðPipeTests(unittest.ó Case): def tearDown(selfòfor f in (TESTFN, 2$(§unlink(f) S€stSimpleƒ1Zòif shutil.which('tr') is None™Y”P.skip¹)'ñnot available')w-÷t = pipes.Template(ó.append(s_command,-ÆSTDIN_STDOUT0¥f = t.open''wmùf.write('hello world #1"Hclos„Wwith So) as fòòassertEqual(f.read(), 'HELLO WORLDkûÅr2rU Ñ , $Ö.2.½ô + ' < $IN > $OUT'ÏpFILEIN_ Ñet.copyÍÍC> Ì2ž*Û[ž3žÙ —gr/ry $‚ØkfinallJ$f.  ©PEmpty¸Mline¼ # F  through e-HDlVd = 'F |e COPY'' o;dœ <2='S=%Þ$Gd% l ¶ # úl"OREADl3t.#¼%Þ­&ð3(self): ó # write through empty pipe Vd = 'õline test WRITE'(1t =9Ås.Template()õwith t.open(TESTFN, 'w') as f:'s!f.“+(d><7ñself.assertEqual(f.read(), d) b1defºPRepr(0)z¾ , \rBdt), "<íö instance, steps=[]>"Ãót.append('tr a-z A-Z',1ÆSTDIN_STDOUT3vÍ+Š uQ'--')žJ�SetDebug1t.d4_False¼(kging, -O(TruC, ÀÌReadOpenSinkÄñ# check calling M‘'r') on a‡@ end«X^õ # a sink raises ValueError#: ÷†boguscmdõ?INK1Rk(k,:1, 'Fpfile', ¿ ÙWÌ_ource†R'2preÿ _OURCE ++w'ãABadAp|Options µÓð# try a non-strucommand#�°2Typ¯í?, 7ãGj0typ…ÿat isn't recognizer "s$b4'xxÎ`shouldb²be able to :êå�är;3s.SÔK€kQ1twoZs$”·I6‚K'µ‘�## ôA neex° input but )u no $IN5Ä Pu $OUT',^  »pFILEIN_ C�À selÿ#f.assertRaises(ValueError, t.append, 'boguscmd', õpipes.FILEIN_STDOUT) 1õ# command needing file output but with no $OUT7Bt = Y¥Template()?selÁO $INÅÌÆõŽ;ŠeSTDIN_‰Pàdef testBadPre¥€Options(%):!°ð# try a non-str”¤#P #6Typ"p~C, 7,¦°þkÿ type that isn't recognizeds –tù'tr a-z A-Z', 'xx'o`shoulde³be able to = a sinkt  ñ9INKxTcheckiTµtwo sourcesq™f.§(zo_OURCEJ Å K•£-in¢%IN5Ê ?ÌXþ=1).êbš‹õOóXÂôj�ÜEW~‚ô�OpenMode Dopen&šSR}OClonwF(®9è 8qu = t.clêÿNotEqual(id(t), id(u)*'ð t.steps, u.steps) óself.assertNotEqual(id(t.steps), id(u 3) 63æt.debugging, u ñ) def test_main():E€run_unitò(SimplePipeTestsgñreap_children() if __name__ == "_Q2__"RJô() import errno $os drandom…selectoresignalUocketqys fromÑ g0supo5imeDleep;î T.mockŽtempfileLòmonotonic as time tryú‡ñresource except IRError(!� = None S‘hasattr(sè2, ' Spair'¬2 = .&R elseaê‚(family=ä.AF_INET, typeóSOCK_STREAM, proto=0vjJwithrUF3)lƒ6ƒl.bind((œ’.HOST, 0)\"al.list_cèvÈ3�ðc.connect(l.get À(†+Šaddr = c) d(“while Trus3a, J@l.ac(ó-ý# check that we've got the correct clientƒB#ifg0= cp }"¿return c, aJ{a.close¦Ã'OS¿Rc6@raisÛŒñfind_ready_matching(c, flagiQ = []¡ñfor key, events in 4ã$if&H�OÀ.append(key.Ð2obj‡%ã class BaseS‡TCase(0.1): ¡ÚPmake_P et„(�Ï„Prd, wO#€-â.addCleanup(rdN",wr"Èi˜…0regVr–sWo‡SELECTORõ ”sqó¶kC )„)0key&.‡:æü.EVENT_READ, "data"ø  IsInstanceÅ&, Aª?Key:úO, rd* d%+(no ’Xš”Õi ñÐ, "data")  ñ # register an unknown event !ô self.assertRaises(ValueError, s.Ba, 0, 9%) > b¥invalid FD!_@-10,Žÿectors.EVENT_READo_twiceg?KeyÄ/rddÿhe same FD, but with a different objecM ‡¥.fileno(),Ä’?sel´def test_un¢(l%):P0s =PÆf.SELECTOR()ö÷ddCleanup(s.closek*$wrC÷make_socketpair()#(4´Ô's.°'rdG&# ®(g »±dE® A7%, ¶ƒ¡_after_fd_O’2;]‘ (†, w = rdc5 wr HÛ(ékTäwAVWRITE\"rdMo-wr > w!P@unitïð.skipUnless(os.n�ñ== 'posix', "requires "Xª¯_and_reuse´åo2, wr2ð Þµos.dup2(rd2z2, r�K!(wr!w!Í&.a¢o£ F%J tbj+þÙh…  iÀEAD) ó s.register(wr, selectors.EVENT_WRITE) –rd.close(-wrEs.unV&rd, Awr) Yñdef test_modify(self):w0s =—§f.SELECTOR}+Ò.addCleanup(sŒY>drd, wrC÷make_socketpair()0key&: GREAD4"# ³u events³Akey2M(K ZÊòssertNotEqual(key.Z , S PQelf.a52÷2, s.get_key(rd)¯ ˜±ÉEdata·d1 = objecttdÛ-@F, d1ÃØ+ vF, d26.ù+ `ñ3 c \c‘ 2.R¹'jÀunknown filee"KàRaises(KeyErroŸ.R1, 9±,óoÕse a shortcutm/d3ãp = unitŸ§.mock.Mock S,ms¾¹O, d3‚fFalse(—h.calleZ ,„.Š o_( z÷# Make sure the fd is 0ð)ed in case of e¥1 ong~õ(): http://bugs.python.org/issue300146*ifðó.__name__ == 'EpollS§''p]patch‡(_)'ÝT$._V_cls'�/elš P™?S˜&8Devà44 Vž*se¦rÖã·skipTest(""µQwith ¶Z as m>ãm.return_valueR ô§ óðside_effect=ZeroDiçvisionError) ûs = self.SELECTOR( úaddCleanup(s.close%drd, wrJümake_socketpairQ .register(7úselectors.EVENT_READ]žú assertEqual(len(s._map), 1-BwithÐ2ØRaises(ZeroDi:�s.modify—ZWRITEk˜ 10) b‘def test_7(5)|~ +.zX²pmappingx@.getm^• Gs’-0wr,k ¿(\ø;×Ï�qRuntime�1, sËkey, rd7"wãn3Keyj?Ï.__getitem__t = zûö—?keyø;Ú1keyr�, "data"pv’�C(rd)âŠñ# unknown file obj‚ O1, 9S ??map?g¡’‡¯False(keys>´#?, 0' 2istKF, [])É3!In܈ «é$7[rdƒÈ(Ó…'Ó0rd.!Ono()[ 4ó.values()), [key]!Yt¾�Iì"9]µÃ# Read-only *4`2TypÆ aAdel e#rdaáÿàCÀ self.make_sãocketpair() õs.register(rd, selectors.EVENT_READ)-—wr_key = 6.wr6WWRITEearesult8a(Tòfor key, events in /:w«ñ self.assertTrue(isinstance(>X¹SÃFKey)gDr$bFalse(%V & ~(d) |§g ?&'ä‚Equal([(rb#],,Eð def test_context_managerº&f)Qs‹Q‡SELECTOR�…óddCleanup(s.closebÜ($wrComake_s\�with s asW~D?sely 3vÊ3ðRaises(RuntimeErro¶@.getÑF, rd7#wryofilenop;òif hasattr(s, 'c'Ï fd‘.ÏÒ <fd, int)rGreater�.0ó×õ;õNUM_SOCKETS = 12fñMSG = b" This is aó(.""æ_LEN = len(MSGÜ`readerÿ%[]0Mwrit†r2w = {}&2ó&{};ºi°Wange(² œ1 ¤Z7]�51*ˆ.append(ü#äÅr2w[rd] = wr`w2r[wr&rd%3bufo-cwhile g ›`ù É_:‚ = find_‘matching(1„±qif not 1U �&=’fail("no és5 ŽFing"e6 Òrandom.choice™h . .s‹¬ ¤bd+10[lÁþ5À readyñ_readers = find°y_matching(Oy,  ýselectors.EVENT_READ)J1if dyMers:"{]breakð# there might be a delay between— write to end andP� #±is reportedy1šsleep(0.1ØNelseÈðself.fail("no socketbqady forcJing"L6ñassertEqual([w2r[wr]],2y9 7Jrd = 9[0]À0buf#êd.recv(MSG_LENE |¯len(buf), 0±bufs.append' pûs.unregister(r2w[rd]o "dÇ–rs.removeAd ­Žñ, [MSG] * NUM_SOCKETS) 5ÿ@unittest.skipIf(sys.platform == 'win32'þ'à.�() canno‡ò used with empty fd sets'Ò@def w__@¿)5ó# Issue #23009: Make sure EpollS\~ñworks when no FD isæ>$# y5ed.óv¢.SELECTOR( 2üaddCleanup(s.close!—s‹ãtimeout=0), []lô(aïŒ"Ê�rd, wr = Vb.make__Spair(ƒ×. @(wr,/ ¢VWRITEä@t = ° ÷01, þ60))A�¼ ./-1/RLess(|™ - t, 0.5ÈL'wrrá\ƒà hFalse(ÙpØ &Ñ'Ð /t0k e1c.t1:dÙ190�ñ# Tolerate 2.0 secondsyövery slow buildbot;ëàTrue(0.8 <= dts2.0, dt™ P0UnlÄÿ hasattr(signal, "alarm")U¥",.*±() required¬Athis>'Yëï_interrupt_excfÀ.SELECTOR()  ó self.addCleanup(s.close) !¡ rd, wr = +÷make_socketpair()õclass InterruptSelect(Exception):S[Fpasseûdef handler(*args.\raise\?£orig_alrm_E¯qignal.s(”.SIGALRM,m)”Þ 8?,, @ r :tryì=walarm(1* °s.register(ks7æors.EVENT_READ¦1št = time(#¡rd) is i‡sed by aÁq which Ods an eŸ c@withO�f.assertR+s(Ü ¤9"s.À?(30ž+waŸ‘efore the×ùout of 30 secondsš§•RLess( ‡ - t, 5.uofinall‰ 0‰ð@unittest.skipUnlXshasattr81, "½9"),Žó"çð) required for this e"ñ_0_°1_nož(êbsÓ­‡SELECTORÿ+Å4 Øw Jqlambda ¶b: Noneâ ™JU¶Q, butÀ]‰ doesn't3#} |@, soo¾Qshoul¶�retries �Ëa recomputedR*ouh{)eFalse(›F1.5)£§,ÉGreaterEqual]1] ‚Scalable‚orMixIn:½µáe issue #18963.�why it's ’ò ped on older OS X version“@support.pòs_mac_ver(10, 5êäôresource, "Test needs | module°üabove_fd_setsize¨S# A sò° implementa Úòhave no problemßm%anÜð # FD_SETSIZE file descriptñ Since we don't know„`value,6jusð# try to set thûe soft RLIMIT_NOFILE to the hard£ceiling. >,*õ= resource.getrlimit( b)@Etry: T1sD 0, (¡})REöself.addCleanup†U,­ š,�L(ï rÓNUM_FDS = min™V2**16™ñexcept (OSError, Value )Mp “@# gu”öfor already allocated FDs (stdin, stdout...UV-= 32TAs = /–SELECTOR(3G†s.close)>Š´i in range(dK// 2Ô éXdrd, wr‚÷make_socketpair‰,?> 1  # too many ð, skip - note that we should only catch EMòbIû.# here, but apparently *BSD and Solaris can fail upon connect¹Pýor bind() with EADDRNOTAVAIL, so let's be safe‘‹Ó‘Test("FD `— reached"”pn°s.register(yöselectors.EVENT_READüF50wr,+ 5ZWRITE6 ©^ as e®áif e.errno == ~.ENOSPC,‡C# thpðbe raised by epoll ifÞ}go over<@1fs.-°.max_user_wŸes sysctl7w]›! ‰!fdr.~+73QINVAL“Àsys.platformTŽ'darwin'Pð# unexplainable~ðors on macOS don't need ßMtest% !òInvalid argument\@ cal7 ­:()"02DQ¹assertEqualTó , len(fds)) class DefaultSÎ œCase(Base"):šìzÑ IaE/or`'B or @unitV.ÙòUnless(hasattr( ¤ors, 'Poll8/')£"š¶s¦;"")3À PollSelectoõrTestCase(BaseSelecto•, ScalablóMixIn): SELECTOR = getattr(sB„s, 'PollRý', None) @unittest.skipUnless(has@(EpA!),tx "Âu needs ~.<™") class 8úD hû¸@def ýà_register_file85f):â0# eýð(7) returns EPERM when given a :• to watch<0s = $f.Ÿ%()�with temp;ð.NamedTemporaryFˆf) as f‰³5÷ self.assertRaises(IOError¶-$s.ÝG(f, •–VENT_READ’0d# the +õKey has been removedÁ/�?Key‘Ÿget_key(f‚UKqueuü'ƒ =)… †H i‡ nbad_fd‰gódescriptor that' ðclosed should ra an OS‹·!# µUEBADF© ŽÉÁupport.make_dÏš~Ì*cmÍœO  ^ñ Equal(cm.exception.errno, .ÞÚÖjbÒ$s.ÎÂÒ0DevYlÓ >Ó ÔH jÕ% ZSmain(—kh„[Defaultù£,w ¦r Ë; ç : …% É]>söDrun_.!(*Ì`!Ðeap_children( ðif __name__ == "__2__"ðtest_main() #ð -*- coding: utf-8ó # IMPORTANT: this file has the)ñBOM signature '\xef\xbb\xbf' # at,ðstart of it. Make s0Vð is preserved if any changesBóre made! # Arbitrary encoded†ð text (stolen from test_docñ2.py). x = 'ЉЊЈÐ�Ђ' def y(): """ðAnd again in a commen¶:(0÷pass import collection¤nfigparser'$io o(tpathlibÑDwrap@unitË¥warnings î …0sup�÷ class SortedDict( P.User1): Ð £items(self�return sGb.data.-&))??key>,=_value?°[i[1] for i—¢€]€Biter–!à Á&”; % :½ [w'> __P__ = Z¶ACfgP5�TestCaseCÍ«‘allow_no_Pƒ = FalseÆ0limMás = ('=', ':')Ë‚_prefixe";"#"inline_)`empty_-Bs_inˆP3TruˆÖict_type = coá._default_dict—kstrictÆ$sM D±DEFAULTSECTB�interpolaz -f_UNSET%2new‘“#, �gs=None4@arguú׬(k6 , ¢=T. 0$de·, ( š.  4Õ; Bî@ >= 2 &# h_)  2 0 .×pinstanc¶´*_I5(**29h˜É#ngi qQcf = v£ásp‚cf.read_N(�%cfITBasicE(WÀTestCaseClasñs): def basic_test(self, cf):"õE = ['Commented Bar',"_ 'FooýInternationalized Stuff@�Long Line0Sec>þ \\with$weird%characters[\t2_pacesy¦S2ý From The BeginningI>Typ_]N0if Fö.allow_no_valueP$ÐE.append('NoV%')RvE.sort(F�ð('baz', 'qwe'), ('foogbar3')€Å# API accessU‚L = cf.sNs^LoCeq =Â¥ssertEqualIveq(L, EžZitems('K 6vX&F)HŸ# mappingÌ[ÊT for ein cf]« Úv ƒdefault_>œ �ô[î "].Z,ݦed(list(L)eF-/cfDØa¶�(len(L), Em6Xname,<L¤9eq(#.Ÿceq(cf.E0s()6[�Y]Ô\€use of sw…s in the‰fÕs serves as aÐÐ# regression ®ýöSourceForge bug #583248Ìò # http://www.python.org/sf/+s;éFget(ç ~‡), 'bar1½- §®020 † s3C$D†EYµ ç u4u 3es@key Ù Ù'/k9}another=osplat!>Sint('¼P 'intm,42Ñè 'F"42")åfRAlmos"xgetfloaikF0.44Dsm+",q-wbooleanÈa_Falseb À '123'), 'stó range but acceptable') õif self.allow_no_value: 'àeq(cf.get('NoV ñ', 'option-without-8¥'), None) Aõ # test vars= and fallback=#`pFoo Bar`Vfoo',.@'baz_W'bar1Á= u {'J!: A2}), ÁðssertRaises(configparser.NoSecïjError)k Such ÄjOXi a€no-such-ãi/No•YzXpDoSpaceyÜ3™/r2ƒÇGN] int('Types^8int^18), 42C 7?/18?%q"18"), u # sic!ÀŸ5 Æ´³AlmostEqualûHfloa@%',§( ù¯0.0), 0.44}$†…10„7X- p•A"0.0º»C� ¾wbooleanÀñÏTrue), FalseDLi"yes")  aE£_«p3ˆ •UOh ½u<‰ÐÀ, None)  òeq(cf.get('NoValue', 'no-such-option-without-v  < òfallback=False),  /õ# mapping access…ü ['Foo Bar']['foo'], 'bar1'))oSpacey,2,0sec½v = cf['3ø From The Beginning']b9.name, : œäself.assertIs(E¦parser, cf*O /õRaises(AttributeError):”hP•õ = 'Name is read-only'/_)¯aP¹c$eqá «3#1bazÎ:qwe"šŸCommentedÐ4/] ÷sRBkey =s�Йˆ5}another9nsplat!��Long LinerÄ—Á 'this lin»`much, ÷ longer than my editor\nlikes it.j#if;�llow_no_Å -ÈÑ?]['Év], Noneõ# test vars= and ÓÆ[«;ë®1z')¶4b'È=©{-:,2z'}Bz1õ�n?Keyh’…No Such ±åSK\4xS ¦‹ Wº¿“¿ÇH; wL)”w”óéÁhrý6 ¨?Ž'¨ pTypes']Ðöint('int', 18), 42—Í.Ë7Àtint('no-suc±h-int', 18)# ôeq(cf['Types'].getint('no-suc6Ÿfallback=?#q"18"),  # sic!€$CJ'…), None)~üself.assertAlmostEqualqfloat('p', 0.0)/44I+†‹‹†.ã ×0Ö$ PÞ3�ªº¬q', "0.0pq8GjP2 {Ï“boolean(' ç', True), Fals¶;¿DɇA"yesRR:T5', —T'_*í[0ì¡DƒK! ò2if pållow_no_value:\«0NoV‘ñ('option-without-8' ÔGògP=Ÿ WçP Aå ¾o/ð## Make sure the right things happen for remove_secmg() andEìñ (); added to include checkKõ SourceForge bug #123324. P1cf[ tdefaultvr]['this�'] = '1'5(at5ð2' # API“ access ÿself.assertTrue(cf.remove_section('Spaces'))5AFals6ihas_op2ß, 'key with sE{# 6Ótdefaultƽ ò¿õFoo Bar', 'foo'),ù5"{:ò) failed to report existence of '"IІ Ìy Ì'|0Onon-U²" that was �d.ºv±¯this_value· fºD„ C~?, '’Ó<�Œ¬òRaises(configparser.NoSÕError) as cm:CFó£('No Such ;\7¨‰ÑEqual(cm.exceS.args, G5)) C eq¿åget('Long Linei Å�á line is much,p longer…÷n my editor\nlikes it.'oœ# mappingTõdel cf['Types'] ã7"f in cf…2Keyr lnFVH¥ >Ãmy&!][&$BÊçFå[N:ó-†©'YŒOm=  b[ 3, LZÇÀassertRaises×(KeyError): õdel cf[self.default_section]['that_value']7Qwith 1ÏassertRaisesa ¢'No Such S]¥']['foo'] Xò# Don't add new ^ðs below in this method as most of the op²sLCand Éòs are now removed.uðdef test_basic(Óõ%config_string = """\ [Foo Bar] foo{0[0]}bar1 [Spacey X bar2ð From The BeginningY7foo2t3 bazåqwe [Commentedc`{0[1]}bA4 {1 c%B baz€0qweô 0]}another one [Long LineÇI^Pline f`uch, m±ðlonger than my editori³likes it. [Õ \\ð$weird%characters[\t] [Interna¨Áalized StuffƒC[bg]ЖBulgarianbD˜0[en)¡0]}English#desDeutschrps] key ” s sSìÓ  !ô0]} splat! [Types] int;q42 floa*À0.44 boolean$`NO 123mñstrange but acceptable """.formatzp.delimi0,^Π_prefixes)u»"if"‚allow_no£ Ù ¿E+= (?D€ "[NoVÝN]\n"T-Aout-4)˜Bcf =šBfrom:(‰,n.y_„6(cfàB*ctØ�d ~fñparser.DuplicateOøscf.readãñ(textwrap.dedent(ñ( [` a`s HereÉ + š ¾!a L r=u/;/»5G&))R[Mw:Ò;>àAnd Now For SoÍ¢ òcompletely differe†HOTrue@[a9Tlarcho1S^Jelse¦[!W$ ×SÀ option {0÷ [1]} with another value ù""".format(self.delimiters))) +ùcf.read_string(textwrap.dedent("""\0fý[And Now For Something](ûcompletely different {0[0]} Tr´Y�the larchN1|ÿòdef test_basic_from_dic0%):O¥config = {©«"Foo Bar":Ùfoo": "bar1",8}"SpaceyJ2Jÿ From The Beginning§ 3]Æ0bazÆ;qwe ÅŸCommentedÈ4MkŸLong LineÒ ñthis line is much,ù longer than my editor\nlikes "©—K"it.µ �Section\\˜Ð$weird%charact=[\t¯ BpInternaFÍalized Stuff8”€"foo[bg]ž›Bulgarian¢($Default"1[enJEnglish&!de&lDeutsc& Î×s½2key¿sü%"ÁyâW 0ksplat!1 „@Type^ ¹ in‘*42�@floaO0.44þboolean": False"ÿ 123: "strange but acceptablG}|1if ²‘allow_no_�¥”�.update(à0NoV€A0"opi-WAout-do": NonÓ�<%})¬Bcf =®2new•(YVä{†6(cf’*ctû²sÒassertRaises(_óparser.Duplicate–WErrorÓÆú¡F#á'1': {'key': '''h'1)2*2+?6ÐÀlicateOption›Error): ícf.read_dict({.ÿ "Duplicate Options Here": 04!'o*ÿ': 'with a value',b2fOPTION2onother8 }O%})bJelseñí @'secà€': {'keyŒ·iC'SEC±-2.+2'/”ê† ok'gË`÷def test_case_sensitivity(selfhPcf = ¶.newconfig(£scf.add_xO("A"aBsL = cf.TsngL.sort$eq�±assertEqualà¨àeq(L, ["A", "B9a"] `set("a,Šbeq(cf. s))ObE#gHbb"), "I ÝÑ"could not loŒXP, exp·0ng Œ4-inŽ"e #g names˜’”÷rRaises(ž parser.NoSV/on9## ^[Q are }{EIŽ@t("b*NáL�@True7Bhas_À:o, "b")1MFals2k 2…€!A-±2A-B`0for8� in ("a-IAa6"ââ À ÿ!8cf.Ñ…Iopt)ã(' "'À) returned få œÁion which shWexistÄV>sVyÍÀ %az)["žªJmoveŠnF5]) ö# SF bug #432369’µfromstring(8C"[My‡2]\n}ö {} first line \n\tsecondŠ".formatNR©×delimiters[0]U Ì|O½,2, "©6"«'\n¦"!o561822! #"[|I]\n".à À"nekey{}nevaÿlue\n".format(self.delimiters[0]),  õ defaults={"key":"value"})7TðassertTrue(cf.has_option("sec Á", "Key")) ;ñdef test_case_sensitivity_mapping_access´!):4©Qcf = t¦newconfig(�Çcf["A"] = {}32["aT"B": Ä !B!6SL = [¾T for ein cf]=gL.sort„$eq¢UEqual/\elem_#[Count(Pq(L, [0ed(Õb, "B",û–_“ , à)0eq( øa"].keys(), {"b¶"d["b"], ò"could not locate ÖP, expØ0ng ¿4-inÁ#v names"“Bwith½÷Raises(KeyErrorâæ#nHQ are jhQ/í0b"]'üá#/w£A"b" ƤGAG-R"A-B òM 0optAP("a-bÚA a-¢5"Ð ‚N¾R‚ †' "Tñ) returned falsežš‘ which sh¹Wexist„õAÃÏ$;@del ¨a*&B" Û{"})ôÊÿ# SF bug #432369Ú¹fromstring()P"[MySxaon]\nObö {} first line \n\tsecond NŽ˜  t 7pS/"["¤`¦'\n¡"o561822 "ŸM]\n"Ûß¡"nekey{}neÎ\ú17´#"]ù ÕèP{"fooÛ8Bar”àú_ PUcf.geéSPFoo")v:ar"‘9Ð {"|?: "Î#Àlf.default_s÷ ection, "Foo"), "Bar", ò"could not locate op50exp@ñng case-insensitive defaults") Mñ def test_parse_errors(self):!qPcf = Å.newconfig()?R(cf, & r.ParsingE] Ä^•"[Foo]\n"[ ñ"{}val-without-opt-name\n".format»ÿ.delimiters[0])«•1«esD™Z0MisZSï�onHeaderg LC"No 5K!\n""üassertEqual(e.args, ('', 1, ?@!if‘æallow_no_valueO�ß9Q4 @é wrong-indentß*œã 21ð# read_file on a l  ©`tricky·°upport.find&Q("cfgÇ7r.3l\"ifY ²z == '='2.Ÿ/ =^ ‘2 bed = (¡,­!+ls›« imv/ 1úÀ ' # INI Ü’ as many ³` partsºpossible\n'Ç6Dopenæð encoding='utf-8')@fT²Aelf.¢im:, fi>u'edYR8 , ‡exc, srcaðif hasattr(src, 'qWline'%˜0sio¯%rcseÀ$°io.StringIOTÅ*Ž.ç¡Raises(exc"*cm#0cf.�þF(sioIáreturn cm.exce{ TRqueryRT! ‡Bcf.sås(), []Na"new C§AQer sh+phave noTined R”ÓFalse(cf.has_+(�• }Ùacknowledged ëÀ ó "sections") òwith self.assertRaises(configparser.NoS9uError):=DQcf.opV_("Foo[<ðset("foo", "barWvalueg2e =ÁPget_e¢_(cf, Â(, S ãEqual(e.args, ƒ)+scf.add_Q “O7T’ 1)) “Fdef Î , Sexc, «", ®Æ=tryÓLget(2dóúexcept exc as e=†return e.+ls#šð.fail("expectedMeÅ type %s.%s"Dvð% (exc.__module__,?0.__µhname__Ðtest_boolean(|ü$cf>¹fromstring(wÚ"[BOOLTEST]\n’P"T1{et>s}12NTRUE3>rue4.oN5=yesF•0•NFALS–F–NFals—F—.FF^˜-nOE—2—>foo•-gE’/0.’ðò AND MORE".format(¿=æ.delimiters[0]Íx÷for x in range(1, 5O,LM´True(cf.get€'NÇ', 't%d' % xY B‡C fCÒV7m àq  ±), ²eor_Rweird~sd2new—(Q JD™Duplicate¦›*cmœl ¶2cm.Þ5ion'Ò“str(e), "rø 'Foo' already existe AYïb, None¹“"ifÙ—*ct˸àDuplicateSectiûonError) as cm: ýcf.read_string(textwrap.dedent("""\4C_[Foo]ÿwill this be added{equals}True3O[BarM‘hat aboutSJ—Doops?ž]won't�²""".format(¶ù=self.delimiters[0])), source='')Lùe = cm.exceptionSpassertEð(str(e), "While ’—ing from c) "Gˆð"[line 5]: sec€� 'Foo' al\šy exists"´ —øe.args, ("Foo",‹i, 5)) �Wwith DñRaises(configparser.DuplicateOœðdict({'Bar': {'opt': 'val', 'OPT is6Êlly `opt`'}}Ü�9�Q>': oÄ•¹6 in“Ò“& Bar", "opt<•t", Nonešðdef test_write(œ)™úI = (Îê"[Long Line]\ny¡"foo{0[0]}– n�is much,ý longer than my editorHÍ likes it.£[{default_Ä}‰ý1]} another veryK�§ ç@ - WÞComments!oM@ {0[q$we|"{c2]} cana&@also& 4_place6 _s6ii Qmulti—ikvaluesÊ%\nðé#, x €_prefixe,1Ø ¹B   #ifE�llow_no_¸·b »+¼VìNlessĶ-®Aout-^ ÚBcf =‘Ž' €»öfor space_around_7ø(w, FalseˆÑÑoutput = io.S‹6IO(Y#2cf.Ç,,jà=space_around_×delimiters) … = self.Is[0]+öif space_around_*:(^õ = " {} ".format( ˆýexpect_string = (Sþ"[{default_section}]\n"(ÿfoo{equals}another very,¿\tlong line a [L4OLine�Athis^‘ is much, vÿer than my editor‚¯tlikes it. ¢ ÿ - With Comments!³Dtest5w _talso„#tc__multie ¸=%,ß^ =Á % g: Öøîallow_no_valueÒ ¡+¢]0"[V@Olessj$ op¿‘-without-r:- ÇûpassertEü±(output.get_I(), Ã!) [@def ý4_se~p_types(R)$cf"Bfrom¨0("[‹éÀ"òp1{eq}foEñ¶ F[0])Üp# Check*ñt we don't get an exceK  when sett>ñAs inâ�#.!is ´`ion us.Ësêçlass mystr(strKEpassX€cf.set("R4", ç fsplat"É+j"12 2]+]1]´ Küread_returns_file_listQyìqv != '='�sŠò .skipTest('incompatible V'6p1«°upport.find×("cfgparser.1˜1# caB0we à  a mix of Ëah…and non-T5¦newconfig(•xd ps = cf.H ([Eð1, "nonexistent-&"]<þÚM", D0ÀtEqual(cf.geót("Foo Bar", "foo"), "newbar") õ# check when we pass only a filename:.öcf = self.newconfig(Lpparsed_7Às = cf.read(1&?ÈassertEqual(71, [/]0_cf.geß0¿Path objectâ,€pathlib.RïÀð]wed bothÑp and a ¯3[,@1Ê  73qmissing¦s,à["nonexistent-Â"ø+�/no¥3h… 1]) õ�def test_Ê�_returnsâÐ_list_with_by#Pring_(])R"if3ödelimiters[0] != '='&�9ö.skipTest('incompatible format'Xf1|š°upport.findQ("cfgeÇr.1").encode² oû1an Ë Û Ûª '²Ìù :ÊÃOnon-ÇC,b'í–Ê º ª‚«ÌGnZ/, ßµà w–I`# shar‹py subclîsPdóget_interpolation_^pL‚P`fromstw(Hà "[Foo]W\n" ÿ'"bar{equals}something %(with1)s interpolation (1 step)F9G¼9)s lots ofO9OsP/10Q/10R/10S 1Sì¥1õ¦%T5=0)s)Ð)9(H'8'8Ë%(With7'7'OITH6'6'¬5'f5'4'JITH4'3'f3'2'2'1'ˆ[ ‚ ý[Mutual Recursion]#6foo{?bary>_%(foo# W)[IT]Error}±# no definizúfor 'reference'ÄFnameª&�‚.format(äñ=self.delimiters[0])) Nðdef check_items_config(1Á, expected):,APcf = ê.fromstring(""_@[secÀ]7;°ù {0[0]} %(value)s"Ðkey{0[1]} |%(/9)s|!¦getdefault(+4"""«ú ),_ACs={";S": "< E>"})sÁL = list(cf.#("Ú¡", vars={'È3': '})?f.sort(�passertE}'(LdvÊc+rRaises(š¢parser.NoScH i®„no such ¶õ€test_popØïEå1æ1ç1Ú�2727273737375 ¶4cf.9s)[0], '`/1'ì626"362Às(KeyError):' Ñcf.popitem() ñdef test_clear(self):7Pcf = õ .newconfig({"foo": "Bar"}),'ÅassertEqual(JA.get`ò .default_section, "Foo"),S,8ò"could not locate op50exp@ông case-insensitiv#v names"¢òcf['zing'] = {'Iã1': 'value1', 252'}� â3cf.ÄTs(), ^r 2Fset(‡—.keys()),Ž„w, 'foo'd2cf.¨c™0), w)4[¯ ž]¥�:1setR><áfromstring("""=[@)1]º’1 {0[0]} � 7272727373737•""".forma¼³limiters), +@s={"²D®D Žü'dJ‹ dþa.b I2I2ÔI3I3I × ['{E1'],c…<22']<2</2'<3<3<3< -Ƙ3, ' H 63']Š µXô2BC Ã|U  Š?@AaNotIn(ªj Gé } ý¼ QC73�g $žÜÁÜ ŽÜ>Qçuæ;„ ÊÀf['section1'ó].keys()), {'name1'}) ýself.assertEqual(set(cf['section2'@/22A3A])}3cf.xUs(), †F1', ’ Q3']) Ìðdef test_invalid_multiline_value(é!):,û0if ’.allow_no& $!ÔskipTest('if (A is :ðed, ParsingError³not raised'�M˜õ = textwrap.dedent("""\˜+™[DEFAULT]ÞA {0}ç [¡""".formatíæ.delimiters[0]u Bcf =¦newconfig(BwithRÓ"s((xparser.û]Åócf.read_string(¤_]Zyƒcf.get('ýòóR'), ' õ<[8"][/]8à class StrictΤCase(Basic`, uniti.Òò_C"= ARawC9 !er¢ò¤ct = True |'a‚1X pterpolaÉÒ ý ge6+_ã $eq-²íK3eq(½ñ "Foo", "bar"), "something N'inf¦ (1 step)"JE9"),l- V‹lots of ^9^s_/10`#/10a'TeJ(cf,3IQDepth:', ='11« à=Šo_UNSETÁ² (e.args, (¢ 11«²_Òd %(¼_11)s j1ÉkËÒlif isinstanc€.à iLegacy¯– ÷ÏP]Á@_misù;`+8M{ OpÛ@ª'ð ð "Interpolation Error", "name") #õself.assertEqual(e.reference, " 3 0secf,vn #op: ™1if œiÇõ== configparser._UNSET:ÏÓ€args, ('dO', ')',EI5'%( )sL&')éþelif isinstance(Ë,ÉiLegacy˜)×wádef test_itemsÓ£âRcheck _¨°([('default-< ?>')pS('get2>|?|@1key9_value5&5i,2, ' J)]) 5Ysafe_Í Bñ# See http://www.python.org/sf/511737U™Bcf ="Ófromstring("[ŠE]\n"+/ "y�1{eq}xxx020#%(=?)s/<k7?%%ssYnot_o;ÿ2)s/%%s".format(ä õ1eq=›×delimiters[0]ªƒcf.get("J4×ok"), "xxx/%s ¤8vþz ~d@BwithU±Raises(TypeAð\¹ bet_malº?ted àÝUfoo\n1I'4', 8˜Cfoo"é <:Vx;¡, cf.set, ZWû1 %JEI Àon1", "foo%"3) ð'self.assertRaises(ValueError, cf.set, "sect", "option1 f%oo") JàEqual(cf.get('<'<Z), "f<õ!# bug #5741: double percents are *not* malformedu¡( 2 �oo%%bar"í £ ?£?nðdef test_set_nonstring_types(F!):(XPcf = R.from*0("[ E]\n"(, d°{eq}foo\n".õaat(eq=Uædelimiters[0])ßò # Check that we get a TypÏò when setting non-š vòs–Á# in an exis+¸6ionà† 5e4 1¬C&/.0E/wobject(;�!fÒ,CÒ-EÒ,ÿ123, "invalid opt name!;( óCadd_(S, 1236 �_default6¯newconfig(ì ©b,}h˜ “œs_keyword�ñ"""bpo-23835 fix for C˜†Parser""Ëó½aŸ={1: 2.4}Ί[„4´ß]['1'], '2.4'?oAlmostE ˆ°float('1'),ŒLº �"A": 5.2¼#a¼?5.2¼2a¼É5.2) classŽðTestCaseNoInterpola¬d(Basic`, unitÈ.¸q_X"= pè.õ'ibs = Noneøi = textwrap.dedent()‘[numbers]0þuone = 1ötwo = %(one)s * 20hre,ö${common:one} * 3†f[hexen]ðsixteen = ${numbers:twñ o} * 8 """).strip() ñdef assertMatchesIni(self, cf):$:.)ÿEqual(cf['numbers']['one'], '1')41two4¿%(one)s * 2>2hretÀ${common:oneì3F Phexen¶Psixte S, '${Ï2:tw3'$ñtest_no_interpolation)%Qcf = *@fromh!ng$O.iniu,cfo¡empty_caseEi¯newconfig(`óIsNone(cf.read_“<"")lÿnone_as_defaultè Álass CustomC~rParser(‹p .¼Nð _DEFAULT_INTERPOLATION = ®™'Pgë Ù|l" cÇÁùTestCaseLegacyIìÏ(×÷_P"=  B .y «ÿset_malformatted¬ ”¡"[sect]\n"“l0"opèÂ1{eq}foo\n".wA(eq=mÔdelimiters[0]VL 1`.get('z4', [“"), "foo"ç<€cf.set("+"+B, "%+&f <fVfoo%"ff <f %÷Èf<¿ó# bug #5741: double percents are *not* 8%ed9 2wÊO%bar  «2Ö%@ mÅNonStandardDN(ot€ = (':='¿õ Áent_prefixes# //#"#inline_* ³10Sec*· *_Öôion = 'general' mPMultiždValueshd(Basic`, unit’. ‰Àass = configáparser.ConfigP ñ wonderful_spam = ("I'm having  "8< "(Âbeaked beansI:1and,ñ !").replace(' ', '\t\n') }ñdef setUp(self):ŽPcf = Q.newcì%()÷for i in range(100;?ö s = 'section{}'.format(iC&scf.add_(*(seje dBáset(s, 'lovely}r2j),Ç Ÿjöwith open(support.TESTFN, 'w') as fswwrite(fDŒtearDownG›os.unlink^ ;üst_dominating_multiline_valuesSÀ# We're readZðfrom file because this is wher�e code ch­dÅP# durB1per °nce updatesw¥Python 3.230cf_o_o UPT.Õ^^n‡ÈassertEqual(‡T.get(k8à E4'),½K X +&.øn')) class RawùäTestCase(Basic´, unittest.»I_L"= Q [ I _interpolaR ­:get+_d¼$eqÚS%Qeq(cfTÊ"Foo", "bar"Fp"someth; %(ë 1)1¡¦ (1 step)"iZ9[ É9)s lots of 1 (9csd/10e /10f/10g1g(Í11Î�šú=tem»pcheck_i ç [('default < > S('get2>3|%(?)s|B3key;Oname8.9!%(õ/)sp.9 ,)]Y�set_nonstêN_typQ>ë¤Àd_section('nÓon-string') –cf.set('n¯, 'int', 1' 0lis(Q[0, 1ÿ2, 3, 5, 8, 13]@ 0dic@ö{'pi': 3.14159}6ÿself.assertEqual(cf.g®)¯9À%), Úkë?), ìöcf.add_section(123¥ö 123, 'this is sick', True*Ž;)<pif cf._ª`ñconfigparser._default:1ñ# would not work for SortedDict; only checkingûthe most commonOk ‰Òionary (OrderQí¨Pcf.op2ùxform = lambda x: xXD é¶ PA 8oa„def test# s_keyword(L)-ñ """bpo-23835 legacy behaviorARawCuPu1"""açPwith PöRaises(AttributeError) as ctxs;62newÐ(^—s={1: 2.4oPerr =AQ.exceV�F‹±str(err), "/ô object has no aš– 'lower'"hBcf =Í—‡"A": 5.2™} Al9[Ó<p]['a'],D«) class \ÿTestCaseNonStandardDelimiters(-Ìd)à = (':=', '$TÒÁent_prefixes# //#"#inline_* ¹PSamba*B(Cfg,ÐCí`, unit”.»_"= ã õú¤#Í;O----Õþ`empty_ÿ‘s_in_valu#aFalse sO|readingF0smb·Bôupport.findfile("cf°2o#}  when we p�a mix of gpable anÄ%n-TsL¶ÖfE!d_4E f.H#([¯ð, "nonexistent-'€"], encoås='utf-8LPÙpa$, Xc:rð['global', 'homes', 'pr¯inters', ð 'print$', 'pdf-generator0tmp•Agustin']Aôself.assertEqual(cf.sections(), )2 ÿget("global", "workgroup"), "MDKGROUP"D)inGÀmax log sizeJ/50B†°hosts allow>_"127.„P("tmpÅÁecho command@ð%cat %s; rm %s") class ConfigParserTestCaseExtendedI°@polaPd(Basic#´, unittest.!):ecQ_^"= p`.m-b .‡Eƒdefault_á@ = 'í1on'Xástrict = True €def from0ng(:", #, O s=None, opòQxformÛ¶Pcf = =B.newÝ(>›&(ifD7cf.`( =*ª%Rread_¡(`–return cfÜŒ#_eº_YíÄÐtextwrap.dedeÊ%""Ž’[`|ùfavourite Beatle = Paul9$Òcolor = greenºEO[tom[›band = ${J_} dayk0pop�IJohn9§I} II9ksequeleD+}I¨Oambv©]š = Georgebûon of Edward VIIm<?} V6P! V4sJ ¤stanley§ ${Î:W… ƒ‚7tom5}3ò_black$Pstate!miè�paranoid/@moviÛ¢soylent ${™’v“AsongÆÙ0© sabbath -2 ŸUP""").—Fp())$$eq–Êdeq(cf[ª6]['„{P'], 'B'ì5¹4S5Otom'g 2d°•Àn day') ð% eq(cf['tom']['favourite pope'], 'John Paul II') 4 8msequel01JambvjRBeatllnGeorgef5Qcolorp_green3ñson of Edward VII5i/ V8)  ×stanleyÚ8Ý^black¥6PstateìAmindæ�paranoidABmoviˆ�soylent \1<usong'],]A 'û· sabbath - Í(ñ def test_endless_loop(self):!¦Pcf = õ.fromstring(textwrap.dedent("""15Ù[one for you]”ping = ${"™me:pong} 'A+me@o@@you:U A³:ish>!me|5me}nP""").×Fp())…Bwith÷÷"assertRaises(configparser.InterpolationDepthError= í0youà°'šl;ùhBme']Óë strange_opµsî ÞvdollarsÂè@$var^e$value`2{%|õ{sick} = cannot iVBe me¿)[dAothe�{Ÿ:m4try�&�–wO.QEqualì<de+ø):Á?·A{º==�Aexceó`_classoË�MissingO0ÓΫ ^v) as cmE¼ þ� 5%m.^Ó.reference, ' !:$ëC `args[2Œ$)CÂ}}') #rawval6ð case_sensitivity_basic(seclf): õ ini = textwrap.dedent("""")‰[common]ùoptionlower = value O 1Upp V !/[CV²a better ${ƒ:v}N o;A B9 )} :z[randomÞ4fooÛ|© redefinedL4Fooò"${à:z- R7Æ""").strip()™àcf = self.fromung(ini)o$eq"·assertEqualR(cf['6G']['9Q'], '±'O 1·1Â1åb½k: k¾t±t§¢h™¬8¨8 o£'�ðdef test_case_sensitivity_conflicts(«X9S1 = -¤O Æõ5 = Œ ÍD5 = /£:, =±}—£¶1Foo-½+}ƒ- &:Bwith%pRaises(–òigparser.DuplicateÂWError©Glb# raw Os9,*Àxform=lambda:s ²êàîí,,,rDÖ,'a5a-jv1foog^�3F3 e! ¤pother_eç –° í�interpolaàZ failU1¶úwhere's the brac(2(êdoes_not_existt&3&�wrong_secx:*141þi:like:colon:characters/Ð5 = $100 for ÃFail No 5! U""") ó0with self.assertRaises(configparser.InterpolationSyntaxError): TXcf['i+ÿ fail']['case1']u'�MissingOp‚|2|h3|)m%4ua5u_ValueÀñ6'] = "BLACK $ABBATH" class C¬P¬¡TestCaseNok(· allow_no_v• = TrueU êTrickyFile(CfgqC‹´, unittest.‰mP_±"= _¤#ñdelimiters = {'='}òcomment_prefixe#Ι@def ”3_cfÒp_dot_3(÷ (tßð = support.findfî":A.3")�1 cf-<2newÓ(^UòEqual(len(cf.read(lÿ, encoding='utf-8')), 1Dõ cf.sections(), ['strange',–š a'corruK7dyeah, Ÿ can be 'yÿindented as wellÏanother one!91no ã_s her*§ Ö|Kmore?]ß agetintœ“.default_t_, 'gogvars={�×e': '-1'}), -b>©J# noÑÉ will happen ?cf.ÍP raw=zÁÊn kÀal(len(cf.geót('strange', 'other').split('\n')), 4) ðself.assertEqual(len(cf.get('corruptionL]valueL&10Mðlongname = 'yeah, sec?ÿ s can be indented as well'‰SFalse…„boolean([ô, 'are they sub`&')† ÓÏCÿlets use some Unicode'), '片仮å��'Q$‘items('anfQ one!_”5) # 4 inÿE andéyõ# `go` from DEFAULTOWwith óðRaises(configparser.InterpolaŒ�MissingOØuError):N–3cf.Ú1no õos here c˜'tricky iq<q`do thisL0 ´¸� /go/@'mor±; Êágo shopping') Ž¢def test_uR�_failure( f&ô= support.findfile("cfµ&3"‚Bcf =å2newÛ(× DeÝéRread(�ð, encoding='asciiÖð class Issue7005TestCase(unitë.ß0"""ð output when None is set()úaW¡ allow_no_jA == ÿ.Rô http://bugs.python.org/i�&2""" “expected_C= "[#A]\noó! =‘C\n\n6·Sprepaª", c_ýÙ^`# ThisËðthe default, but that's˜q point.5Icp =Q(ó=ðÎscp.add_·#("  p.K2, "Û!",ÛL÷sio = io.StringIO6Æcp.write(sio2 return sio”(Þrnone_as²!_s[\ifiedèûŠC—P—.øOTypeï7´Ú_çL_rawëqë.NHü8Rawÿt3„M>;lf.Ô3) •ðSortedTestCase(RawConfòigParserTestCase): dict_type = SortedDict ‘ef test_sS(self7;Pcf = ñ.fromstring("[b]\n"@%_"o4=1&?3=2&?2=3&?1=4&/[a½uk=v\n")ãÑoutput = io.S6IO(’cf.write((;³assertEqual!Å.getvalue(),d G"« �"k = v\nõ ®o"o1 = : o"o2 = „ o"o3 = Î q"o4 = 1³ô) class Compatibleº;(CfÌC*`, unit°.*­rconfig_P"= pQ.RawCqñcomment_prefixes = '#;'inline_#+;'7%Phandlò”щ_:ñ = textwrap.dedent("""\u-"[C–ued Bar]Ãbaz=qwe ; a qæfoo: bar # not!!"Ö# but this is! �; another\aquirk:;:;is`?ò space must precede an H V'""Ya 5M cfI)('7�', 'foo'Z '1'j!¿baz'), 'qwe@"c¬ º &')=$py d(Basic.# +æGdef ÿâ", Òä, defaults=NonqÌÙ2newÑ(,iscf.read (UT_copy„J #Gê6(cfð2# we have to clean up option duplicates that appeared because of Ëñ# the magic DEFAULTSECT behaviour.++qfor seccQin cfÄ.ð's(-$if,s.name =o+_IÉ1ðcontinue ó for default, value in cf[self.û_section].items(): 3if %[5B] ==R.==del3WPreturˆò_copy class FakeFileRÐdef __init__(°˜ð file_path = support.findõ("cfgparser.1")u with open(&>b) as foµjñ.lines = f.read(J '±.reverse() l¸6 ¸aif lendÔV„G.popz X'' hÃ_generator(fSÐ"""As advisedöôDoc/library/confi%qrst."""½ë ø}`while .Qyield;À! ?Þ@ReadÞôTestCase(unittest.ºÙ_¨,b¼Ÿ[ü ]™6try¹ Hv.appendös[0].encode('utf8')ü except Uni E&ZError_pÐð # unfortunately we can't àð bytes on this ϰ¹ë¾ sié9 = Ó CoàPÂõ+EÍŒf §òassertIn("Foo Bar", 9- 5foo)[;]4bEqual(Y0 ["I·], "newbar"…dœ_iterableHªCôtextwrap.dedent( à[ÒGCfoo=iö"").strip().split('\n'À«™-mjŸMj )�6Yb%¯„†´õ"""Issue #11670mdú'¼].v±Raises(Type„t\Va(Ñ�%Ð8;þ ±)”LÀtest_source_óas_bytes(self): õ"""Issue #18260."""ø lines = textwrap.dedent($…[badbad]5õ """).strip().split('\n'))òparser = config!.C P(-Pwith »é.assertRaises(;öDuplicateSectionError) as dseòùm¡read_file(ë², source=b"Ö"�|eEqual(ÈPÐstr(dse.excep|)), p"While p²ing from b'e0' [~r 2]: s» Žh0"alD†y exists©Lµ•bad = bad¶ÈhOKÇ�Q3]: oºÆE' in×±Îæ×DÓÁ_¾?ing¹ySÙk`tains Še$&s:�G\n\t�'C'¸i"VqsMissingoHeader¢yF!2con %no4h«@s.\nª« , ìV: 1\n X… ¸ô class CoverageOneHundredTestCase(unittest.)1"""6Às edge cases×Áthe codebase:é@def F$_d‘__n ‚ Ì#('B', 'RO ¡àerror.section,Ó 'section') ð self.assertEqual(error.op(2, ' 1Ïsource, None^olineno-uargs, (¼•A)u2str×Q), "OÚÙC in % " 'ñ"already exists") 8ðdef test_interpolaMq_depth_`(w!):.[ø = configparser.I>D=Eœ(”,±,JN'rawvalÞ„z E‚àU ¯o b+?ingVPwith jáÁRaises(ValueKv) as cmˆ: „qParsing.(ácqcm.exce`jòRequired argument `&_' notd“¶ "given."„Þ=œ"='Ô', filename=' ) 0Canêåspecify both `M5andBV. Usek K Ç�ëT-‡æ…ôwarnings.catch_Á(record=Truejwi(ñ.simplefilter("always", Deprec<Wb©­ß¯7!.&6 = ß F_ BCfor ÖX ðQ(*6�egory isô–TQvalid# S,er Ca'erÐ-.ͪ_string(""[&]�I!in‚P_percâ?= % çreference = %(zErvariabl$‘does_not_\%)sW'""î€YãÄÀer.Interpola÷ tionSyntaxError) as cm: °parser['sec/õ']['invalid_percent']1ðself.assertEqual(str(cm.excep?ð ), "'%' must be followed by Eor "N† À"'(', found:B%")?Wwith ’ÒRaises(config× .Interpola� (Ÿreference Xbad i…Ÿ variable ƒ¡ '%(()'") ñdef test_readfp_deprecñ()ðösio = io.StringIO(""�[ïoÔ� = valuen©'""†i9 = xC…P\(³ôwarnings.catch_Á(record=Trueªw¹v(ö .simplefilter("always", DøWbx@©.&ô(sio, filename=''4Cfor tK in ŽZ ±(*Ô�egory is’ @JBlen(£F), 2‡ )% ±¨Q'], 'ª'Hsafe % WϤc MOSafeQ¥CêX¬proxy_reprW’ ¶²-‡0_st‡ …ª‰?keyŠ *¬p/b), '3ÿinconsistent_converters_state*áimport decimallà©.k#['#D'] =//.D7×P1Ôkuone = 1{:[s2% tw-2% öl5In(©-, ÆÊC.getéÿ('s1', 'one'), 1<ð2', 'two'), 2)  ñ%self.assertEqual(parser['s1'].getdecimal('one'), 1) 9? <2<0two<2<Bdel keZHwith_õRaises(AttributeError):0’ N(Ä", ¹+µCIn('ß$',ޝconverters­[<]]?Not`ïH['í[*"ô class ExceptionPicklingTestCase(unittest.0"""ñ s for issue #13760: ConfigPØ$ eZ°s are not pd‘able.""" ß@def f _ei(4hjSimpor8e0ae1 = cl‹¦†('value'N¢ñproto in range(ƒ÷e.HIGHEST_PROTOCOL + 1xf*2d =·Áe.dumps(e1, Tg.&e2)Sloadsjd'à äe1.message, e2 5 ¢repr(e1), ;2))NPnosec×W*2NoSF`TbÐqe1.args” ‘ 3e1.2 5 ¼Æ oœÅ,OEÄRC', '¦Îÿ52e1.[Ðoption)  ò self.assertEqual(repr(e1), P2)) ,ðdef test_duplicatesectionerror(I!):*.Õimport pickleôe1 = configparser.DMSMEM'[õ', 'source', 123)Jòfor proto in range(l÷.HIGHEST_PROTOCOL + 1™�*3d = ¢.dumps(e1,Tg.&e2)Sloadsjd' Jäe1.message, e2 5Aargs2 /+2 5U4 3alineno3 3 ?I/opH7OLGdQLå]ÿ:k* * 2e1.å3 3…3 3 �ŸinterpolaŽ.IJŒ �ë Fmsg'¸Õÿ-b Zã ¡rmissing[õ* MW ¸d!Ò)',®p'rawval!ŸreferenceHÀe.HIGHEST_PRçOTOCOL + 1): ¢pickled = ù.dumps(e1, proto).&e2)bloads(6d'ôself.assertEqual(e1.message, e2 5Aargs2 /qsection2 5%op4 3‚referencÎ9 ¢repr(e1), A2)) ^ðdef test_interpola’Àsyntaxerror(Q¹cimport²CÒøe1 = configparser.IPSPEP'êC', '( Fmsg'Ä2for“ in rangeí¿.HIGHEST_PRWÿ9_depth7DOdh'rawval+ÿŠ?ing *sParsinggsourceôÿe1.append(1, 'line12233yøuÏ ž‰ gó4Àerrors)  ò self.assertEqual(repr(e1), C2)) ,ô e1 = configparser.ParsingError(filename=' '<ÿ.append(1, 'line12233õ!for proto in range(pickle.HIGHEST_PROTOCOL + 1):Ï×*Bd = ¢.dumps(e1,TÁ.&e2)Sloadsjd' Uäe1.message, e2 5Aargs2 /Rsourcc 3eºd 3  QÀdef test_misÑsectionheader[(cimportxDc dMQSQHQqhD, 12ÿqJ ä 2e1.?1 3Y!no3 3 J� class InCðCommentStrippingTestCase(unitl.V0""" s ñissue #14590: C¶¯Àer doesn't sZ! im" cnQ whenŽó'delimiter occurs earlier without preceding space..""" ; b¼ ýf?g']Œa3ean�ÇOTrue<sâg1e`-R!('’Y 3W1R/K~;I � DWwith íùRaises(AttributeError):ôKsdecimal£)Y!±W Rsimport iŽÃconverters[' D'] =,".D«4ñ5In(3*, Mk‘IsNotNoneSz8‡;len87), œndec0_5»_('0.5jþ •, '0_g˜{8;del$q_?Notb’*4[a!ß?get%¾Y!?R ?Key_d¦T/']¡7õ ] class BlatantOverrideCžôTestCase(unittest.cð"""What if somebody oG�ode a getÇÐð)? We want to make sure that in ð+this case the automatic converters do not kick in.""" #`fig = Q[one]µone = false>two0hre*òlong story shortiJO[twoX'Afour�« –def test_éñ_at_init(self):'{ cfåáconfigparser.C P (Bè={'len': len})AÁ.read_string`.P%u!._“{len(cfgðassertIsNotNone"E¦[z"])2Þ±inheritancew×Ìlass StrangeÑë>�gettysbur P'a hi»òic borough in south central Pennsylvania'«I³¡getboolean­Ò, section, op€*, raw=FRp, vars= ,lK’fallback=pÀk_UNSETÏ7$ift3 ==v "¦return TruÛ ‰super().× ÑÎ3rawÌÑÌ_Þ 4%TP_P0hO%}B._gen(Ö2lenØ #• ½æ+?cfg :�’ÑAÌ&q'one', )¨6 0two667m70¤L#['ÐP'] = pC_to_¼àª áª7g?, '70݈Ûç, €.`Equal(´0LO), 4 5In(gX1ÀIn('len', cfóg.converters) ÿself.assertNotIn('tysburg', cf4zIsNone(*['int']e1Ofloa3booleanhQEqual˜ágetlen('one', O), 5ž6Otwo'6 @hree8/16oh¥6¥/D, 't¥4¤öfour', fallback=0), 0CWwith ^õRaises(configparser.NoOptionError):•œS»ªrb]¸[à$].:õ 6p6 Iî ['a¥ 6¥(lî ¤|ᩃ r:0), )!) ;ðdef test_instance_assignment(T icfg = 7CDPD(2Ð = lambda sece1, oma: Trueˆ h2ACcfg[K"][Kã}±read_stringÆq6fig¢Ûm²X)š?, 31›Û›Ï?len0šËo¯Ê Î06šóÎ6E6l=)l(ˆ#['Ñ ']åCfg._C_to_«?BFalsw3get(À self.asñsertFalse(cfg.getboolean('two', C)) self.as7?one7!n>nTEqual¥Plen(',!, O), 5¤6p6 ¯hree'), 16oh¥6¥/²¥4¤õ2# If a getter impl is assigned straight to the instance, it won'tñ# be available on1õsection proxies./Wwith 5õRaises(AttributeError):0g/À[è]¢ý j7Hjô class MiscTestCase(unittest.Í@def €__all__(Õäáblacklist = {"%"}Øsupport.checkBõ, configparser, G= ò) if __name__ == '__main__'i´P() imn4 os �sys fromÂ.Ž7þort TESTFN, rmtree, unlink, captured_stdoutAÂ.script_help†OM°_python_ok,—4erttfailure›„textwrapÌ Strace} ·  ±)„dmodules&³mod #- ¿ Utilities ) 0# `fix_exÛP(file¢ô"""Given a .pyc ðPvertsŠž°appropriate-1"""9%if6P.ends ('N'eyY=.Q[:-1]Cereturnµ0my_5€_and_modµ(QQ"""Th…4R and Q '‚ of this"(_H$_)²Nð = os.path.spliâ(1bas'=;)[0­Ta,†‚Âóget_firstlineno(funcÂòøunc.__code__.co/ € Target Mü`s for U?ing `# # # 8�relative ˜€ numbers51s i\'sec!maÁj´verifying #v€. Pleaseþ1ifyš-Ýðs if you changeð< one of the # functions. Absolute line numbers don't matter. # def traced_=_.ñar(x, y): a = x Qb = y ‘c = a + bžreturn c N8oopL8Lófor i in range(5mq4c +hZ˜importing_/ðx + y + testmod.Ù>(1)Ÿósimple_caller(x„¥t)x)ðN + xUš X9k =k ~\ký~OJ(k, �k}×generator(numÐ5Yñ # executed onces ‹94Ÿyield i +ß9Fing_vsë0]Ô0#102lüiÕ@doubœ•äynum * 2-�óer_list_comprehension(e—1˜ my'C = [™j;i) 1k)]Ëz:¡ class T*C s(objectmðdef __init__(self¿Sí.\^/´inst_method‰'Œ9‡.„/y @ ( zà.oahcIä_H˜Rx, c)z@ ·‹ Ì?clsËyÊu{@staticM N 7I? #- Ï Test cases ) #ìðestLineCounts(unitd.PCCaseúÁ"""White-box…0ing¤\ -c<Àing, via runV5""":QsetUp1Oá°ñaddCleanup(sys.set¼ , g"()¥6$2r =ª(€2=1,‹A=0, †s=[ers=0Lñmy_py_filename = fix_ext_py(_#__Ð_€ ^ÎÝ�result = .0#r.( ?k, 2, 5šÂassertEqual(P3, 7‹ Q# all _s are&PexpecA= {}’Pfirst½—no = get_¡› J1¸\r[ò.a', ið + i)] = 1 sðelf.assertEqual(sñ"tracer.results().counts, expected) def test_1±d_func_loopG!):%) V un((4c, 2, 3Z5÷firstlineno = get_ ?)m¥E = {Q–÷.my_py_filename, UŸ + 1): 1,7_2): 67_3): 574¥}¯hÏ;‘importing>Ô9Ù5Ù"DÞH°fix_ext_py(ÌQmod._P__), Ù 2 Ô2}+€ž9lŸgenerator�…calling_AŸ_(€ &Nð^I �=Î'½Ö#?Ô˜rM @0è/»$Rgen +¼·< ³dCñ_list_comprehensionXgw/erDÍ%QóÐ/dÓdoubler¼1M¢p# List HGðtions work differently in 3.x, so the count  ÷# below changed compared to 2.x. ,ÿ% (self.my_py_filename, firstlineno_calling + 2): 12,@&3@?!`ed + 1>0?}ˆòassertEqualÔñtracer.results().counts, expected) C�def test_ñ¡ar_methodsF!):#2ó# XXX todo: later add 'static5CË' and 'classOöhere, once issue1764286 is resolved. @for ¢©« in ['instf&,]¸¼ @ = T( A=1, A=0, Ufuncsøeers=0)|KTd_objO dCè:(25)¥Ñod = getattr(m:, 3"Pr.run‹(BR, 20)ª€Ÿ`_7 ZôI = {ÏOê ~}7� …Í€ "Ñ TestRunExecC¤P(unit“.CCaseˆñ"""A simple sanityº@ of ½-Çñ ing, via runctx (exec)"""ùîQsetUpöXÁ ñ = fix_ext_py(_!&__ZôñddCleanup(sys.setú , g#()ÃÚ_•_° jWErd³&±code = r'''R d_[á_loop(2, 5)'''-1@ile($, ÷0, '´'ÿV´3ctx3õglobals(), varsýdª¼N¤mÂȾ7ñ6õ7è574á7}ô�# When usÅòhrough 'run', some other spuriousÍõs are produced, likeéd# the «?athread;Ðwhich we igno£€just mak�sure thatBPÊ2 foTö were right{#;ÐkÉág.keys(™6 ãÀf.tracer.resð+ults().counts[k], expected[k]) class TestFuncs(unittest.ð Case): """White-box !€ing of f6± tracing"""-ãdef setUp(selfBFð.addCleanup(sys.set?0e, g1())K6$¡r = Trace(Ò1=0,{e �+=1<Ðfilemod = my_ Û_and_modname(-q_saved_pO+ =™ ™äŒtearDownçiÿ=lf.K²is not NoneWßû N <)wñst_simple_caller3 hÂPr.runÇ( d_ =3, 1]Š A = {é¼=JO+ ('Q',): 1,>llinear7}A{±assertEqualï.€Tr.resæ dásèÛ¯sst_loop6¡_importingQ@9JC…¸ É „A:À(fix_ext_py(4Rmod._�S_), '@', '¶'7:@ÙàskipIf(hasattrƒ4, 'wk') andñ Ê�'pre-exisBˆòtion throws off measurements'mޱinst_methodKŒ4objö dC®2(20F† êOobj.Y¥%q{Wù–,DúÙCåÀ716CTr˜s\Àount=0, tracóe=0, countcallers=1) ðself.filemod = my_ ñ_and_modname() .ô#@unittest.skipIf(hasattr(sys, 'gettrace') and sys.1(),Bsá'pre-existing ?ò function throws off measurements'¼@def �b_loop_Ù`_imporL(×%):v.`Pr.rund( d_ 9J3, 1ö­pexpecte {Sò((os.path.splitextV"._Fñ_)[0] + '.py', 's T*Š'Á˜2+ (<¯Š',))): 1g(E csimpleñB >à8 †`linear:|©( À†bÊ+>€°fix_ext_py(í6mod[P`estmodRÇ'}­È²assertEqual�Âr.results().G4s, ò ) # Creaÿõseparately for issue #3821 class TestCoverage(/3ase�ºQsetUp…n¥�ddCleanupX#.sV,QžLŒtearDownOÒrmtree(TESTFN5feunlink#G$_c¹ˆ,Žr”r cmd='øƒ@.supx,©‘_pprint;'_w '%8_.è.De.QueryD'1Àfun(cmdã3r =¿Ü‰„r.write_öó show_missing=True, summaryDdir=JK3¦ð7 �Š.ò�ˆò with captured_stdout() as ÌJl.² 3# =<‰@valuË>BBIn("°S.py",5N#+Icase)¤ # from Å"f;ås = os.listdiry‰V1", A‹p.”4Às) def ótest_coverage_ignore(self): 1# Iõ! all files, nothing should be traced nor printedAÐlibpath = os. P.norm (pdirname __dE__))Að# sys.prefix does€ð work when runnŽõfrom a checkout@œ2r =¥ .T«(í`dirs=[_Rbase_d,pDexecP æ"],f¶=0, count=1Éò with captured_stdout() as u\ˆ.ž(ÆM%ifP×exists(TESTFN»FNs|tlistdir( ÐmÁassertEqual(8ð, ['_importlib.c*U']) _1__ PAdef Vœissue9936PÈ Ž40mod@ = 'X.*�dmodules.Amod'|ïò# Ensure that the +@ is Í‚uted in Õ7 if(i!inÿ7s“8del[�]H‚cmd = ("_ ²õ5t;"9¼ò "t.func(0); V2();"öC0V, cmdR{}.seek(0–readline(…age = {}Á@for )]S ;s v,k ul@¶.split()[:3Hhf@ule]Y@int(5@s), ‰cov[:-1].€XXX Thisô�needed to&P regr30.py�va scrip*Ð�S_full(&mx“-%].¯ J3In(=ùfH)sñ^ò, (5, 100)) ### TestsÛ±don't mess ž1set† and can™>ñthemselves TODO: Skip¤TQhDB\rinvoked€ñ-T option. class¬_;Q(unitxÁCCase¥.cd,"jnº-U.joinf¿©ið['x', 'y.z'], [jn('fooobar')]~CTrue.xps('x.py6'x'Z±MFals4y5y654� Õ`, 'baz{) } Ànore.names(jðn('bar', 'z.py') S')) õ# Matched before.ðself.assertTrue(ign vnames(jX%baZ0baz\ð> # Created for Issue 31908 -- CLI utility not writing cover files class TestCðageCommandLineOutput(unittest.T'aase): ½@codeGp = 'tmp÷8verr'5 def setUp(ø!):2$‘with open.]¶, 'w') as f,0 f.Ñõe(textwrap.dedent('''\U)mx = 42Zif []W.0priMÆunreachable'Í!!''ƒ ÔrtearDow¾×junlinkÔI 7)*x_?_Q s_ôñten_no_highlight]s@argv”ð-m trace --count'.split() + [~e]ástatus, stdoutberr = ¡À_python_ok(*gÊP%Æáos.path.exists£.ÉÈ)8 ÷ódõEqual(f.read(),À�"21: ù?\n"""H?  4¸ïº¯ --missingÄÈ Ê�Ø ÕÔ >$Ð 0ßc! ¢st_failureùœ¹_errors = (o0(b'õC is î°: required 9ð the main optionso!-l+T'`(b'canùòspecify both --listfuncs and (--%$or()Q/lcRñ argument -R/--no-report:aTallow«*3r/-'X/rRXTmust ¨sone of ™,— o Æ!, ºÅRkcallge-ŠXps -f/--{�7ð-summary can only be used with --coun÷ t or --report', '-sT'), ñ(b'unrecognized arguments: -y4Ey'))3õfor message, *args in _errors:'að*_, stderr = assert_python_failure('-mcctrace'PlERself.=5In(zX!) qðdef test_listfuncs_flag_success(D)œö with open(TESTFN, 'w') as fd&}òddCleanup(unlink, 8 ©úfd.write("a = 1\n" astatus1out,okO'-l'sØ b'ûátions called:'gAand_— =Û„ÏPmixedGP@a, bÌYؘ*=0ØPa + bÛà\6ë Q/2(R¯s\gûs“tú sortnum(*nums, reverse=Falsea*0ed(©(-).6)F)Ï1s(*(VÁ7`8a’class Foo`¶�__init__ %, ~r�vk1 = k1‡22O3setJpýÌ L!umL=:ld ð2 class Keywordô OnlyArgTestCase(unittest.ó!): def assertRaisesSyntaxError(self, codestr04ashould4 3'+Ðcompile(s, "<€Ñ>", "single")‚'j.‡(U/, m› IËc;ðForFunctionDefini ب }A ("Vÿf(p, *):\n pass\n¼ ?Ï1, *, p1=100H-_k1, kJ2H–1o, **k1Ü-ŽJ5ONoneL/¹(t!2)Owå}`ForMan�lumentssñ# more than 255 pos›bal arg4÷ D1 okj00fun˜#= Ÿ)%s”ö % ', '.join('i%d' % i for i in range(300)ƒf([¯ ¿Ïkeyword-onlyÁ#?*, ÄTD=+0Too¨Pù|Messageµ5sf(a, b=[1, c Mž#g ]with cQ(Typem‚) as exc�2–f(1, 2, 3¡ÿexpected = "f() takes from 1 to 2Fõ but 3 were given"š•ðEqual(str(exc.excep*4), v)dLCall6f. b"Z�k=1, p2)U6 1=50, *(1,™"©ti ”allWithUn×KºAu½¸#, öõw_sum, (O ÷:¯nodefaultsE:FoosÐtry: ð# keywordonly_sum(k2=100, non_existing_arg=200) 2öself.fail("should raise TypeError"0fexcept:JEpass:try¢¤nodefaults­2e™•<–ðdef testFunctionCall(i)©õ.assertEqual(1, posW&1)¨,++2.¯,**{"2":2}8 -+3:_(2,3)7/+49z@4":4zÿW ߘ:w ,oÏ1=1, k2=2)) o"q’and_kwargF°g/Go, k3=3Î U+3+4,´s h? L a":3,"b©:‚mixedarg6q1qW+ 8_2, k1 =ï4\?+5,E3…4H57 ˆ2™kþ 9ÿ&>¸"F Ç o+4+5+6©!92, d6³j(ÿ**{'k2':5, 'k3':6ƒ Foo(k1=1).�  $, /,p4ƒ ÿ[1,2,3], sortnum(3,2,Ê ["2Bï, reverse=True² Ã['a','b','c'GŸ!s(cè "['$?,'a@À'b', reverse“=True)) õself.assertEqual(['c','b','a'],(/äsortwords('a',5� reverseg¢, ignore='A')) Qðdef testKwDefaults(ˆ!):d"÷ foo(p1,p2=0, *, k1, k2=0'+ðreturn p1 + p2 + k "k2k"\ äÿ2, foo.__code__.co_kwonlyargcount „{"k2":0}C3kwdÄ&__7_p = {"k1;æ6tryóªóv1,k1=10LÉfail("__Wö is not properly changed"@úexcept TypeErrorsBpass+t– }_method›Úclass ExampleLBf˱=³2³Ò·Õ�é�iP().f(Ÿ2), (1, 2Ê :3.f( ()E”C uRaises(5,ò).fEºù;¡issue13343øõ-# The Python compiler must scan all symbols of a function to1ð# determine their scope: global, locwcell...8rThis wa-€done forD ¿a value|0keyÚ>ðarguments in a lambda:0ini¤Q, andNçfollowing lineC€used to Åá with a System•¬]ñP=unitYk: NonemŒmanglingk¢Xœ ___a=4˜5__a½ ”XŽ[), 42Ò_N _eOal_order¤a# See /e 16967nea = 42+‚™2NamÎ{) as erÖ‘¡f(v=a, x=bއy=c, z=d”q l‚str(err.Hóion), "name 'b' €Ydefinw¹#4f =_¾ ©­-p if __Îò__ == "__main__"?�.¤() import #&Q fromÛ 0sup18tfilecmp$os &sy †ubprocesThutil+ðtextwrap KEYWORD_FILE#= xð.findfile('keyworød.py') GRAMMAR_FILE ô= os.path.join( øsplit(__file__)[0], 7 c'..', `Pythonÿgraminit.c') TEST_PY�Ð'keyword_test¾½5Â4= 'V.3c' Uð_WITHOUT_KEYWORDS = '€Cmal_b]ºNONEXISTENTŽó= 'not_here.txt' class Test_isEQ(unit«aCase):+@def ¤_true_is_axS(self&IÃ.assertTrue(Z.d'J')) Z•uppercased²hOFalsi>RUEi‚none_valÉe-DNoneÌð# This is probably an accident of the currñimplementation, but should beñ# preserved for backward compatibility.,¢ñ changing_the_kwlist_does_êHffecñ¯¾0old14 = ¸BcßôddCleanup(setattr,02, '23', M)= T€ = ['itsP0all1eggAbean 0andauslice']N»jQŸïK“QGener{ögUR_copy<’without_g;$eds�, source-0, d[t`Bi open(+²'rb') as fppkñlines = fp.read(QQnl = „[0][len( ¦.strip()):1}›O, 'w{�fp.writeRX: ô.index(b"#--startýös--" + nl) + 1]¨ËP O>endM':],} |=3mar}dtarget$_Š proc = sub Qess.P˜ÿ[sys.executable*•q/ ¨fɨ], stderr=Á6IPEt =Œöc.communicate()[1breturn% Dcode_¤@¥skipIf(notkxexists(•)'Có only works from5ð build directorèÐdef test_realó_grammar_and_keyword_file(self): a._copyõ_without_generate>ñs(KEYWORD_FILE, TEST_PY)Oÿ addCleanup(support.unlink6 ÿssertFalse(filecmp.cmpw xBòEqual((0, b''), âÐ ‘s(GRAMMARÁ,Á “?TruÔŒ„def testɸ‚-U openM !¦'w') as fpnWñ'# Some of these are probably implementation accidents.?ð fp.writelines(textwrap.de,Y("""\/3o{2, 1}èÿ{11, "encoding_decl", 0, 2, states_79;b "\0004"›ŸH8d"Á�, "jello"o326, 0@ oturnipA0\t{!ðThis one is tab ino/edÒO{278r þcrazy but legalHS"also „=�continueÁ" >_lemon!#_tomatGf_wigiiB"¯'no good'}«?283 ü "too many spaces"}""")XcØ‹ ;Û 3©Éexpected = [à"ÅO '&:',"C3æ%à# P*, ) &! M!I ]U[•iQð = fp.read().spÃlitlines() �start = ².index("#--õkeywords--") + 17?end53/dactual2[]U:end]"òself.assertEqual(3Á, expected) ,ôdef test_empty_grammar_results_in_no_„(V!):9ðö._copy_file_without_generated:ÕKEYWORD_FILE,AE!PY<“_WITHOUT_QS{óÿ ddCleanup(support.unlink, B`hutil.ÑÐ(dys, TEST_Ev6 Ÿ¢(0, b''), UCB¯os.devnull@"g � Ç‘PTrue(ˆcmp.cmp(3G R65_pyümarkers_produces_errorXÏrc, stderr = Ò#NoY0#bRegex(uŠó does not contain format Á'íumissingA@æ1³NONEXISTENT‡•Ëî œ(?ms)' + oŸ.encode()ðåô5Î,‘òZò if __name__ == "__main__"@unit=.ð() # # Test suite3ñ the textwrap module.(�Original~@s wrKð)n by Greg Ward . # Converted to PyUnit7ðPeter Hansen â_O, 80é –ocustom•‘3Œ÷�,5#=4.Ÿdef test_ñ(Ý%):ìá,pe//60/ >ð# SF #847346: ensureÿtmP doesE€right thÉó even on input short enoug�!itB"n'Q7 toIZR$ £AMmP. Notªße single spacB 9:?(^GD!# X9PhairyÐA cas/?at Й#ÍasupposA� handle (R easy stuff&Wed in<a_white ¥() above).$JÒWell, Doctor?žado youÃ/k?ˆ 56B'™!\n8šÆ¥cõ'I say, chaps! Anyone for "tennis?"\nHmmph!'8Ž ?@# @Àr.wrap(text)Ã, expect) õwrapper.width = 20,ð = ['I say, chaps!', 'Anyone for "tennis?"…Hmmph!']Eµself.check(kŸrap(text)� =aõ"d she said, "Go to hell!"\nCan you believe that?'t¹.AnG%',*B '\# \% qæ' v6v½¨ “'yÿFile stdio.h is nice.\*‚#�def test_p_short(;%):¬0# W¬0ing Qmake (Ö lines longerÙÐP"ThisÈ2a\n/¶paragraph.".l§‚Ÿv, 20, [Bp"?I "g%])Åh4h B¬( _1.ÒTest endcases>œ ÖF3ª�/."ç=E(1) • }]Zðinitial_indent="E2") ׯhyphenatedPbreakB*^ word õ("this-is-a-useful-feature-for-"ÒTð"reformatting-posts-from-tim-peters'ly´.  \.[• @ ŸÄ/41eŸq2Ÿ& Àå "Ý>Q# TheÓðs current behavior but˜1not"–õparts of the API. Ó˜ƒ|is-|a-|›|œ|�|žÀ "refó&ormatting-|posts-|from-|tim-|peters'ly").split('|') ÿ(self.check_wrap(text, 1, expect, break_long_words=FalseA_B?/) i(´'e-mail', [ ]W�'Jelly-O0 1¡# The testò s current behavior but is no"ÿing parts of the API.¯ñhalf-a-crown', 'B|a-|]ö1def‹ð_hyphenated_numbers(w%):n1# T¹Fhat . .ñ (eg. dates) areÃÁbroken like ™¼‚ð = ("Python 1.0.0 was released Ç994-01-26. *1*5\n"�*. ">c2-15."ð(ØO 30åd Ž-',oO /'1´ DÆ'LÆ4Æ  Žy£eŸ01, ùˆ)ºj/ð = "I do all my shopp†at 7-11._25, [C"×"i�/27kW9k°’/em_dash$Àext with em-(-esÑEÏÿuld be written -- thusØX ‡? ["bì "~]5q# Probe…•boundarie—…properlyÂø[p# ie. "Û"¯98×wß U/ =.W? --Z"¥]„ ÏÀ(text, 30, eƒxpect) ÿ self.check_wrap(text, 35, e*%6,LSõ["Em-dashes should be written -- thus."]) Cõ# The improperly.eJ÷ is handled too, becauseAõit's adjacent to non-whitespace on both sides.9ùò = "You can also do--this or even-%."7&L = [:""AP$u5."]g§1§.16Ñ»/--™ %»7‘å9*» ¥¢Æ` 2{¥/31¥'-o J.32{¥/Zô# All of the above behaviour cµðdeduced by probing0Eþ_split() methodX@Here™ùÎdand--háother---and an!jLP", "  an K0em-€ 0and8ŠM„¤@0!¸!g°A~û thi@bam!Ÿ was gone 8¬@Úg›@ "he¸5was jÀZðdef test_unix_options (…!):"xð # Test that Unix-style commTline < ar(öapped correctlyT0# BÂpOptik ( onParser) BÐDocutils relyñ×!pxö£0useÜ3 -n�,®÷ --dry-run in its long form òM/20  6 z©// "–1 ðrun in its long"?, •"form."])#ÿ self.check_wrap(text, 21Eÿ ["You should use the -n"2ÿ "option, or --dry-ru1 Íin its long ´Ÿexpect = ‹ o–"„ h B32, �E /34*5*8*Ž~?run!9’U.41*¼:"Ë4Ëöñ# Again, all ofÞõabove can be deduced from _split().@AB = "‹|fÌ9 €the", " Z ×#or Døä!fN3 !]?¸ØÍµ(ð def test_funky_hyphens (<!):#†À# Screwy edg;÷ses cooked up by David Goodger. All reportedFöin SF bug #596434jr»®P"what±¡--hey!", [1X --#  OK/--I ?.@ŠA --€"--?7]) "øWhen I first read.¡, this is ’I thoughtFðwas talking about. I `wrong;Wùse have always work¬ fine. Theˆ�l problem~2 ed_ <vparens(HŸ# below..å "--T É &: 7 ?optÉ Hfoo CO barCù€ ["foocu:lŒFËVTpunctVU Oh bother,ð#965425 found another ó problem with hyphens -- #÷'ated words in single quotes weren't handled correctly.G÷$In fact, the bug is that *any* punctuation around a{I…E waso%inqø, except for a leading "--", whichIñas special-cased6÷Optik and Docutils. So test a varietyGÏof styles ofÇ B (Aö€lly thisbŠ"n Œ-öreport, #813077)Dðself.check_split("a 'wibble-wo¥' widget",¸ßä['the', ' ', "@C", "D"'L5'])M „L) "„"„'„'@•„"  „(„)„@)„[MÅ/']†B‡/']ˆ‘R# The³¸ðs current behavior butn1not'&ApartÅA?APId ÿwhat-d'you-call-it.U "0|1|2.²a'|')) ½1def� _funky_par�(a!):"²�# Second ³w!SFSñ#596434: long opN`string·GsideD]othesesë rfoo (--N_) barê P["foo§ 8@]îÌ1Rel^ðstuff -- make sureàBworkwßmpler context·0bar²z²3­/z"è q"blah (eÏdong), wubbap 5c=E? ! "GgI7þdrop_whitespace_false?C0 2 =F2€ preservÝM%õ# SF patch #1581073X™c = " TÑaæ‚sentenceh@much“ª%."BíÒPwrap(RO, 109[nK! %v QÀ € "with à", "much white space."], Qdrop_0,�=False) 0›def test_% _f%6Á_only(self)::jÛ# Check that Bg preserves a´„-N… string.O^ .cRñ_wrap(" ", 6, [ /],eÌ"_T_indentØ ¸b gets A…ed (whenË#ªB is yð? "òísinitialÙ_=" " å à? onÓ#Ò]— wleading„§ Ÿrdoes no˜ MƒG (if¯öfollowed by non-)±ô## SF bug #622849 reported inconsistent handling ofyjZq; let's�Dõa bit, shall we?7Ðtext = " ThisL°a sentence Éhá%."> YNO, 50G[j/])l 3l"àº/."<d__line9ðskips the whole AQ if a�ï# þ!s Ù(ofˆ,wÅ@abcd?Fefgh¥‘# Include|¬result forJY¦comparison¤ìDxS|€9?jbê ®?š ìð®applied to ‹#} Rv¤Àspecial caseÀBfact eGpingH½ã occurs beforeá ), ÎÀt="++") ø def test_drop_whitespace óindent(self): Û# Check that >‚ does no W L's.G`This cLö s a special case of the facthGpingSJÓoccurs beforek6ingmÃ.kð _wrap("abcd efgh", 6, [" R", " %],aù‚initial_Ôø=" ", subsequent!) FnOspliRbEnsureëù¢standard _1ñ ) method works as advertisedaœA# in7‚comments|Ðtext = "Hello$ðre -- you goof-ball, usƒÖe -b option!"CPresulELFCper. `)‰"n(6 K[ˆmPthere H5"-- 5you ¨"J! "º%&usH&th $-b#$ "Û]œþbreak_on_hyphensù § 2± attributesª €åyaba daba-doo"1Ÿ/@, 10™3Ã7š ‘_=True™hbžg]FalseP�ad_widthI #` <= 0 Vaughtº :ÁWhatever, itf»n't matter.Ið assertRaises(ValueError, µ , R;, 05,-1ä"no�_at_umlauÝoÁû Die Empf\xe4nger-Auswahl½7 ž3!DiÍ A®E Í�ý_followed_by_das‹ž0aa ™-š 7™9‘9"’Anon_ Ping_sl �'iôentence with non-Bñ\N{NO-BREAK SPACE}S&.'²V,20D![{'/% '—& ´kÒ; åÀ ['Thiÿs is a sentence', _'with! ÿnon-breaking\N{NO-BREAK SPACE}space.']c<ñ_on_hyphens=False) ”ñdef test_narrow_non_1Aing_\q(self):.ÅËtext = ('Thiè Ì °'7;'ÃoARROW Ê™,zÀ.check_wrap({O, 20ì[–] ²& ¼ †4Tru…ìXç ºë9qô class MaxLinesTestCase(Base jëð = "Hello there, how are you t~ûfine day? I'm glad to hear it!"älsimpleÑ f€O, 12kœo[...]"úPmax_lð5=0)eÛuB1u6†" "¢2œ3s[†œ> >U80, [Á6], ò}^á?you¥ ;& W& s) �%6š†s¶‚# strip ÿ before placeholderk5ZÀre you",  ß"this fine", "ß"day? [...]"](Åmax_lines=4)Mð# placeholder at the start of /+ñself.check_wrap(text, 6v["HelloÀ »2»Ïfinal spaces§ÿ + ' ' * 10, 12³ ?re,º ¿how are you( ÈO I'mL Ïglad to hear) ?it!16) ?—def test_ç!): möT?...“1Ÿ�f='...'�+ñÈgÈj# long›ånd indentation�Qwith ø÷assertRaises(ValueError¼À »Â16, initial_` ='('�B(1,�ê=' [truncated]“ 1¯subsequent£2£>ÓÚ (Þ: $@¶¦? Eæ0 Ÿ ¼s= 4Þ/ 2/Q80, [m6à], placeholderñ(='.' * 1000) def test_placeholder_backtrack(self):*.÷*# Test special case when max_lines insufficient, but whatBðwould be last wrapped =× so long the �h cannoD€be added*ðre without violence. So, text_ Ï's,ˆiaddingh toQÁ penultimate˜.6Sð = 'Good grief Python features arœ@vanc^•quickly!'CRp.check_�(SF, 12›i[oB', 'r*/']7“/=3%f ='Rð*') class LongWordôCëT(BaseA\setUp,éã±per = TextWí:r()Vñ0''\ Did you say "supercalifragilisticexpialidocious?" How *do* 7ûpell that odd word, anyways? '''ö`break_u ¿ # ®E`šQò s and lots of punctuation\»üåçO, 30Ž/['ÿ ';/ ' 9 85 T+']Íö5ö(Ù› õH ½‹ð# SF bug 797650. Prevent an infini oop by makàBsureo ä leÜöone character gets split off on every passb*Dÿ'-'*10+'hello', 1I -" £h-e-l-Foû àsubsequent_indÃ= ' '*15öý#íH1146ëç0 to¦uwrongly©ï7the8QpreceMÊ is exactly @shor AthaniUwidthI û5 5qÀ '"ÿsupercalifr', ß'agilisticexp) Ïialidocious?) ¯" How *do*' Ÿyou spell& �that odd% _word," Áanyways?']) ñ def test_nobreak_long(self):!1Æ# Test with &_o¥s disabled.=�.wrapper./?= 0*–width = 3 ñexpect = ['Did */ayá''"é̯";§a‹ o 'ù%, LÐ,]PresulÄ fe.text).%bcheck(9", ¯^Â# Same thing”ñ kwargs passed to standalone jµ) function.k`" ="yŒ!, ‰M=30,ì/=0ªYŸmax_lines[xñ_ªˆ/12°  ×+9 ) 6) [...]']žóð=4) class IndentI¤Cases(Base"):Žñ# called before eachŸb methodZQsetUpA§<° = '''\ Thiðragraph will be fidS, firÖ0outÏ! i¤a)¢, and thendÀsome (includy`a hang 5b).''' Ç¢Uj ¦M"th‰$()ÜšòÅ ›Å Å Å; #ȯ?, 4 Ó‚initial_1 %¢ parameterZš [" æ "§"û 6=m K" äJ40, ò=Õ"jð"\n".join(expect)# ñresult = fill(self.text, 40, initial_indent="4%")=/bcheck(H±, expect) %ódef test_subsequentMk!):&W}# Test (¢ parameterR,dñ = '''\ * This*Ñgraph will beÔ‘ed, firstkÂwithout any Öõation, and then&ñ some (including a hanging#=V).'''™M6¾ cN* ",}|�# DespiteÔð similar names, DeÎoÑCase is *not*+áinverse # of I÷){! class?P(unitã.("):ü�assertUnc;!edõ , aû2"""(q that dŸð() has no effect on '9E'"""L�=`Equal(",C &))ާ__‘_nomargin“�£# No lines 5ed.oQ� = "Hello0ÿre.\nHow are you?\nOh good, I'm glad.¯U¥2# S¯ , ­� a blank”Š o\nBoo!pé óâ, but overall *) stZOzero‹  ”iG˜@Agaiš/dd /\nq¬?eve1All‡Ôî by two spaces* +% -ca?\n .$Ýf97 H g3amedbÄ·Æs€.0Ê;Ì3Now¯@ one¼7the9×/ Ù{ “/un•L¬ '-lyŒà'''\ d·ef foo(): zwhile 1 `return305''' úexpect = '''\ d] UMEòself.assertEqual(Võ, dedent(text)) u°# Uneven in õ ation with a blank line.0@° = " Foo\n×QBar\n eBaz\n",{.,* (´9ÿwhitespace-only¾ ¿UÖRtest_�°_declining(I˜3³o level¢ ¥q" # 5 Ÿs, then 4¯Ü®Î¡ZDÝ ª^\ º— ‰ ¼@Ã"\n<äÅ;m m Ï.Ó�ÔK#ñ) should not mangle internal tabs3 ¯”preserve_+_+ ¼$Àhello\tthereùÖhow are\tyou?[) 1/Åômake sure that it Êsí w Cit's�king any·õ# changes at all� Üs€ L0 in˜³ margin (i.}#©3andÀã both count as1P, butca *not*¦ñ # considered equivalent)â�à°ß#\t° Þ""UnFdˆ‡€same eff‘³f we have 8ó²Žb! 7ˆ3™"()Ò†removes êÀ that can beó uniformly removed! õtext = "\thello there\n\thow are you?"/Qexpec1 /-òself.assertEqual(>�, dedent(|5)) ]Œ+ Ž�c)) Äe/ ÊPe ˜”3ó# test margin is smaller than Pst inœ”¦•á\n \tI'm fine,V/ks:8lyã~Hò@ # TðUSwrap.Ùqclass Iæ!�Case(unit.!):ñ# The examples used forJÀs. If any of7�se changü5*#edH results in,� variousIó cases must also be updated.>†“roundtrip0�õseparate, because ïdƒ doesn'tHñ handle Windows line endings"ñROUNDTRIP_CASES = (– # Basic± "Hi.\nThisSa “esting.",(ñ# Include a blank}E \n�G0lea¸× and trailingZÐ_ "\n¢ #\n¤)�ø + /UsC! Îr%\rw[ÁPathologicalÞ‹½9 aB PP1defŒ_÷2_noù�_default(Hæ #ùð should do nothU°if 'prefix'äRempty™9x9 T.B?  •a, ''),¸» �explicitÄ(bsame a[ þd, but H"qu”s�Cthe 'ð behaviour by pass2NoncÅhe predicateA1 , d@all_ËsÕÀ # The só&ame as test_indent_nomargin, but using the optional õ# predicate argumentõ= lambda line: True&õfor text in self.CASES: jÂassertEqual(¨(8V, '',‡!),N!) A;defÙ_ƒ s(R)eò# Explicitly skip bù1any¸sR�ÙOFalsÚ:nÞÿroundtrip_spaceßqA white-µfix should =€ with deì Ÿ¯ROUNDTRIP_©N °Ö)ª�O_tabÊ�_\t\t'Ê^mixedt•{\t \t ÏŽ_defaultÎSTest ?"of>Ø that are notŽEonlyo0pre›e= ' 'Åexpected = (‘ # Basicâ7 ca{ñ " Hi.\n This is a(™esting.",NñInclude a blank¸!ShU BleadOpd trail h^0 "O¾+\nÀ±Use Windows¼0 ens [rb Æ-\r_ÍPathologicaloQ³E sN "w ^)fo", ô1zipn'edÀRÓ.%Y)> eæÍÀude a blank eline ñ " Hi.\n This is a test.\n—esting.",4ð # Include leading and trail `blank hs5"Ok3 Ti+\nk±Use WindowsT0 ens [Ärb Æ]r_ùPathological casQ³E \ ^)ýôfor text, expect in zip(self.CASESEed):7¤#òassertEqual(indent(OÔprefix, None)D!) B1defÉ_2Q_all_”wgr# Add 'L�' to allkAs, iéÖñwhitespace-only ones.j¨>u = ' 'ïeed = (‘ # BasicŸ tÌ�% #Ž&a {oã ã|WåQ4 *çiµÒ é2 \ë40íñpredicate = lambdaLV: Tru]N‡ _empty`solely! X AI Ón° MÉQ ieû"Sô findfile class TestFormats(>.CCaseULdatað@for QÈñ, expected in (QŽ"('¹£.8svx', (' ß0, 1, 0, 8)),3Aaifc3 �44100, 2Q/168 f8 8u64.«nAhcom8 Q220504O, -1à Asndt: t1à"vo�i 1wavhgGú¹á4 = A(¢, subdir="á%º?cwhat =º.>ã)â�NotEqual(/u, None,i6ˆSequence;”5-.ÕFtypeÊ?[0]9xramerat:1:—nchannelst2:fu838AsampzrA4]) }íZMableó0ileïÞ¢ ÒXPprotoKbrange(’û.HIGHEST_PROTOCOL + 1°sdump = 1sHSÑ 7`loads(=0), ´´ ô""" Very minimal d!s áðarts of the readline module. =ɳcontextlib Ç’ExitStackêUerrno$IOFloca$os†selector†ubprocesy @temp>Ðunittest from÷ test.support imù _module, unlink, temp_dir, TESTFN, verbose fromJä.script_helperXñ assert_python_ok # Skip;ò s if there is no readline ˆ =P¡$('ô') if hasattr(ñ, "_READLINE_LIBRARY_VERSION"): is_editp�= ("EditL}µwrapper" in’.Oo) elseSŽð.__doc__ and "libx _"á) def setUpM�(¯f|lÃ1# PYàlementations oVs than C#Ámay not haveAàthese private Eeibutes#^ VV„print(f"½tsion: {TEe:#x}"){HruntimeP tRUNTIMEó XÓ 1� Ûlibrary“ U(!rêSCuse Q emulÏF? {i¬7r @unitɯkipUnless(ùclear_history"),\ÍS"The %@ upd ]@ can4°be run beca¢_the "J qr methodÞò t available.") class TestHžSManipó% (à"CCase"""zT¸¥0s wBàadded to checküt\Oq on OSX�"th §%l"î%>õsame interface for(m°r. That'61why<�ñ cover only a small subset oý^.Sá CU—cs(self ¼M y1() D "4add €("first ýqM +dsecond,X‰.àUEqual}D.getiæ_item(0), NoneÛ=O1), ¯E2EÉö{replace¼3, "W�/…)Ày_item(2), "ósecond line") ðself.assertEqual(read%÷.get_current_history_length(), 2D3eremove.item(0)ld6o, None="_1), "ð<1ðõ @unittest.skipUnless(hasattr<•, "append ufile"), ~ 1À not availab:9@def {p_write_w_h(Ç!):&Thpp = temp ÷.NamedTemporaryFile(delete=Falsg:v.close(}qname = . o~ò.addCleanup(unlink,+*=›#à Ãp-clear-Éu == nopS‡#H“!%adgt("firståo+ !(,¡x_E(ú Ï0¨a04e ”¿r%2ðC ªmwE2²1é  1{=S* RûKß :3gzÊÎ ò3­�'no such 8µ' behaviour¿2os.%UˆWwith ‘pRaises(¶×NotFoundErrorñ7¶àˆ#‰ íõ can create the target3g"²„nonasciii ±UG6tryß îð entrée 1") except¡ UnicodeEnçrror as err: ñself.skipTest("Locale cannot e=õ test data: " + format(err))Lÿreadline.add_history("entrée 2"*treplace.–_item(1, 67Fwrit5¶file(TESTFNcÕüaddCleanup(os.remove, +¸TclearŒ(L!  _w if is_edit  hX# An ð ) call seems to be requiredbE getnf¹!# ))5�register°s from the Ÿ 5½• ŸWdummy›8µssertEqual(7Ž'1)©1D#2D2í€ class �RRP(unitƒ.qCase): Ý@Á&If¯ð_READLINE_VERSION < 0x0601 and ܪ,N\ "'ósupported in this library versionû1def(`_init(I)ñ # Issue #19884: Ensure that¯ðANSI sequence "\033[1034h" is®¡ # ÿðten into stdout whe�B†p module>#imÀù0N is redirecã¥to a pipe.#3rc,fqerr = a#ò_python_ok('-c', 'l 6'Y f öTERM='xterm-256color'‹V.|ŸÏb, b'')Eauto7ëscript = """\ � ¦X.set_8ò({}) input() print("HÒ¥ length:",å.fcurren±'r()) """š!kŒ_enabled1Poutpuºqrun_pty .:Ý.�GTrueŽ*LIn(b¿’ 1\r\n", h<¢?dis£3OFals¤0¤ �nonasciikqloc = lÇÚ (ö.LC_CTYPE, NoneZ if3ã0('CÊgPOSIX'X§ñ # bpo-29240: On FreeBSD, ifÇ^LF�is C or M È1ing�‹ ñnon-ASCII bytesä/Õõa TTY works, but ˜Aàline or ncurse÷s ignores non-ASCII bytes on read. õ"self.skipTest(f"the LC_CTYPE locale is {loc!r}") >Etry: R]õ line.add_history("\xEB\xEF")-ñexcept UnicodeEnºrror as errW ¢""L”�cannot e=÷ test data: " + format(err)±ñscript = r"""import´� is_edit #0ead ð.__doc__ and "lib$2" iK"à inserted = "[ò€]" macro |tô[after]" set_pre_input_hook = getattr(O>, "(È", None) if º0or 1Tb# The ª_¾Ê() call via ŠQ() doFÃthing with E",ÌÐ# so include 9óextra text that would have beenyqed hereC“Qed +  Ù¿ð.parse_and_bind(r'ò ^B ed-prev-char'r5 ÿ"\t" rl_complete6Ã-s ^A "{}"'.n¸)) else¯ ÿControl-b: backward³®/: ¬Ãset disable-5ion offç;ÿshow-all-if-ambiguous>"¯unmodified? ÐdM def° uS_Ž( +ed¡redisplay(I6(,!) ‘b0er(u‚, state)—"ifA== ""9"if+V == 0pprint("P�", ascii])Ê#'Ò'ø1getìŸ_buffer()=•indexes",.:‹begidx()1end ˆcreturnâ1nt"ä¡ã1ã 4x4 /!x"ƒS (A% É¥ ¿ ñsubstitution, matches, longest_s_lengthÝ9‡y/IqØ/))±Cion_¢ƒ!es2ð(display) printõ("result", ascii(input())) print("history!Óreadline.get_p_item(16c""" Mû! = b"\x01" # Ctrl-A, expands to "|t\xEB[after]">+?¤2" * len("))PÿMove cursor back>1t\t}ÿ Display possible completions9x8C'1e "ªTx" -> t±rñ output = run_pty(script, )yòself.assertIn(b"text 't\\xeb'\r\n", L4š0 '[4 fnJBed]|C7Jßindexes 11 13~áif not is_edit|Äand hasattr(+±, "set_pre_ó…_hook"):ú/ þ€substitu� @“matches [BDnt',HOxt']Ó€expected¶xr"'[\xeITxebxtJã ½U@ " +éQ+ÆW@Añ# We have 2 reasonVâskip this testl0# -#À$: fósize was added in 6.0[ô See https://cnswww.cns.cwru.edu/php/chet/îƒ/CHANGESB$-  ró is broken on OS X 10.11.6.:À Newer vers¢Q wereqÒbed yet,P@unit.ö%Ifzñ ._READLINE_VERSION < 0x600,e9 "2Ë{Q doesztsupport<-<"� …nP P¡ configuraü(h1defÓ}4(‚RÜ_B = 1Ðëòwith temp_dir() a!%%«ðrc = os.path.join(g-3, ""˜4aBopenL�rc, "wb"jfc/�f.write(b$X„ %d\n" %Í)^>èOfileª'ª _G¯ #ŽP * 2 ý`s crasp< `@dataV"""I b"9åi1àPfor iŸdrange(´ãB* 2)‡ 2\{9À script ô= """ import os ô%readline history_file = os.environ["HISTORY_FILE"] 4. _8( –) input()1_write2 ¤' ¶env = dict(’)#á["INPUTRC"] = w.rc% È8 = ¯ 0òrun_pty(script,Tr=b"last Ú\r", env=env)=™with openÙ, "rb") as f:mð…Qs = fV(èñself.assertEqual(len()%),ÊOsize7 øines[-1].strip(), ØŸ") def [dummyRNone)Õ0pty„iÒ_module('pty'—óoutput = bytearrayçà[master, slaveÈ@pty.Fˆ=0arg$ò(sys.executable, '-c', ¬* proc = sub Pess.PK(B�, stdin=i 7out4err࣑os.close(9hë¡ExitStack(Þrcleanup9ð.enter_context(™E$r’terminateA!:tryD.7Oþ except ProcessLookupErrorHú# Workaround for Open/Net BSD bug (Issue 16762gkEpassÓïPcallb¡ , ±? *c", +ô# Avoid using DefaultSelector and Pollõ. Kqueue() does notŸq# work ºspseudo-¡ôls on OS X < 10.9öa20365)fKq20667).ˆxnZp10.6 or`4Ifeitherqñ472). Hopefully the ›"deè÷or is low enoughLbto useâs#5(). dsel = { ”.Bors.JFor()Š€sel.regi®(§&, 9ÍEVENT_READ |VWRITEKõos.set_blockingNGFalsÇ wh”JTrueº©à[_, events] inq.Œ(�Ÿ#if, &*<&s.² _6zRchunk0Ãv0x10000ì1š!OS�/er–+ò# Linux raises EIO when*—d=2538xÀ  ôif err.errno != EIO: _raise"¿chunk = b""$qif not 'hßreturn outputH�.extend(O))Üÿvents & selectors.EVENT_WRITE‚?try�input = ò[os.write(master,=):]Œ<ðexcept OSError as{kÀ# Apparently˜ÿ means the slave was closedosß8öß� # Stop ?ingƒï7é¥sel.modifyH ¯òREAD) if __name__ == "__main__"^�unittest.ô() import contextlibð &$io$os eshutilUocket&ta †ubproces:y „tempfile9–Ewrap%imÌ` from Ö ©@ sup×.!ôcript_helper TESTFN =9.â class TestST(v.qCase): Û1def…_…Ò_module(self)}p‰.%†"ftplib"£7€.assertRQsy@Skip},¯ M�, "foo")–_freshœ +¢ íÎget_attributí3elfÅdEqual(þ60, "Â_1"),n9 !3B$ w, fH@øóskip("failing buildbots¼Rýoriginal_stdout  <r), sys.J Ýlunload`G sch8YAIn(""\²sCô._- Á?NotOÄlunlink¬¢with open(|`, "w")f=ApassQ PT; óFalse(os.path.existsk)1À support.unñlink(TESTFN) def test_rmtree(self):òirpath = support.>e + 'd''Esubd*0os.4c.join(2, '$%')5„os.mkdir$4N‰±a ôelf.assertFalse(�eexistsn2Ewithà£swap_attr(iç, 'verbose', 0 $.�å-„os.chmod®ô, stat.S_IRUSR| OXUSRÈJäUú?0â�8lforget8ömod_filename = 56.py7yXopen(0¶, 'w') as f‰…ðprint('foo = 1', b&=f#sy{ inÿ@(0, IVurdir& imÉölib.invalidate_caches(&:try~‚mod = __?%__H›(#In" , ˜smodulesw0VF(…'S?NotV*kfinall»1del„I5[0]£1Â!un‰ ˆ«ëQ'__py63__'ÖLHOSTsEqocket.smts.bind(s.@m‚Œs.close(jÀfind_unused_× vy½ /b'™ \)A£Ûœ ±=jilistenB ð# Tests for temp_h <cÙ0""">W that>õ creates and destroys its directory."""^`parentz! =G¯óx» (­@real¯(¿µ �+ =î {:Àdir, 'temp')' ðself.assertFalse(os.path.isdir( )))2õwith support.temp_)A as 7:6sleEqual(, , 2 h 2?Tru�cÏzfinallyªÛÐrmtree(parentä!) Ò‘def test_¾Pdir__½`_none(€)Pñ"""Test passing noéA."""LäP)Le.´—’¸23˜ä€existing ÿ__quiet_defaultö ñ a directory that already TszEcall^ƒS3ô7:óraise Exception("should not get here"é0T! =Õ€file.mkd-(«"7@real·MH,trfxÄB¿BÃRÅps(FileE–‰sError, 8S±# Make sureÓÌ2 diÿðdelete the orig¸.Ê Œ½eehutil.d#thu ^& ztmw  yÉ=Æ ‡�ø)/ ùvdñcheck_warnings(õŠrecorderów ;‡Ài&, ÈEÅFJ:BŠ+, ß.¤ô = [str(w.message) for w in º.-]C~�§ Dlen(Òe), 1, à% =&[0ûPgKp.startsÑ0(f'ðõs may fail, unable to create 'h¡ Mvmporary½ð {path!r}: '),  pwarn) ð@unittest.skipUnless(hasattr(os, "fork"), "&Ò requires os.G@def °_temp_dir__ñed_child(self):+vò"""Test that a + +õ process does not remove the directory."""Nð# See bpo-30028O— details.%1RunE¨ð as an external script, because it usesKkD&ø _helper.assert_python_ok("-c", textwrap.dedent(ªü•import os›AfromB 0sup( %Swith .jPcwd()ÍFpatheWTpid =°)()R 0if #N!= 0=!…# parent›(ª1has:C== 0O/`# waitG{8Íto terminateŽ>Ò(pid, status)¼G2pid0Å7#if4 Ì(qraise A¿ÀionError(f"Cªäqfailed sVexit pD"f"Àò indication 0x{_:x}."3€Make surô5at Ûò is still present. WheÕZM#Óaleaves‰'U€cwd'-con³, __ì___()-M‘method of0=\ must­c_oraryJÍ!!ifQ0os.×p.isdir(T_M ‹ßÞLdT‡AC""")• #  � change_k5dî â€original7Â7getCt\ ÏãÏ 2} 0newwͤ·cEqual(*µ"mpX Œ 54os.Ì#, B7Ö0 5NP__non‹PstentPBñpassing a non-exi2)}•ŽWcall__qŠ+… ŸPExcep�("shouldíˆget here jé&—ìÀ non_exisó tent_dir = os.path.join(par÷, 'does_not_exist') ù&self.assertRaises(FileNotFoundError, call_change_cwd,BM 2nonl„%) 1oð Equal(os.getcwd(), originale5‡def test,__aÐ__quiet_true(c%):rñ"""Test passing a non- ñent directory with H•=True."""E™lµÛ@Àsupport.temp™f() as �˜,0bad%R¾! tâcheck_warningszŠrecorderx| ;Ü(”, Ä0new—IMtF×. Ó,  < I µCèô = [str(w.message) for w in þ.-]¯ wDlen((e), 1, % =5[0]P?Kp.startsk0(f'Çòs may fail, unable to [% 'Má �f'the curçP workÛÌJ3o {õ!r}: ')à™ # WsmÀ(·Tchdir¡¨CÁ ÚhÒÓP whenâB!()As¢>ë = TESTFN + '_÷\Ž ¨4 70y= 2'€„ÜÜsÁ:UÁydmsg = À ?msg¿E¾6`f'to {}º3msg›¹§}·×NBhere¯Ì !@Rname=–G0Z 4Â@base7#),Ûà) selfó.assertFalse(os.path.exists(TESTFN)) Cself16Tru0qbasenamñgetcwd()), here) ?ðdef test_temp_cwd__2`_none(X!):(jô """Test passing None to ;e()."""/€originalVd = os.„#Õwith support.G�=]€) as newB‡‹šò“NotEqual()(, y% 7 )TisdirAY 4hÉ,žgš/ ›‚Œsortdictw R11ð {3:3, 2:2, 1:1}), "{1: 1» 2, 3: 3}")ò¼make_bad_fdsEfd =˜(è»yáRaises(OSErrorº*cmµöos.write(fd, b"foo"P æñcm.exception.errno, l.EBADFÎàcheck_syntax_e„ Õ7*0, "‹ö class", lineno=1, offset=9¬üA³2ion ý~=x=1¤pCleanIm  Ïi 1libM±žUA§"asyncore"Õ2D. ‡_module(1 <ÜDirsOnSysPathš � *Ë'foo', 'bar'…1In(B, syû|° +Obar"+'?NotU * T^ -ícaptured_stdou²  ,8 "¿print("hell <M`value(ï5-\n@}?errª ,©?err©p, file=©fstderr«V !º/in¹4in(¸*in·Sstdin‚'1'®Y#jseek(0a# call+ñ code that consumes from­e-PW– = input(Y !Àl(captured, ñ"hello") def test_gc_collect(self):#‡support." =ýpython_is_optimizedFôelf.assertIsInstance(\A|), boollœswap_attrb–class Obj»¿EpassÌPobj =$(()e.x = 1Twith ›púobj, "x", 5) as xi7â°Equal(obj.x-Y� 'Fx, 1Ž F#Ÿ yŸyŸyŸ �IsNone(y�‘False(has‹F'y'),¦ ¡@del íy/ o-Æ­Litem±D = {"x":1}2Š¢:DåoD["x"]G  æ Gç ŸåOD["yŸ æ pNotIn("pDÛ šÙˆ{Ú c"Ê@RefCÓMk�ibute1 = œ.Ë2q_hidden2<´__magic_1__=X†_Otherˆ nˆ3Kžf2�Öüdetect_api_mismatchà€missing_‰5s =¾;.^,ì‡Àçø%{'Y1'}, ©Üz Á~Ã(ÁW3', '®Ð¹ Œ__ignoreÁH = [1&,  ~À, 'not_in_ei¦"']ÔOÀ= support.deûtect_api_mismatch( ñself.RefClass, SOtherrignore=)?(õassertEqual(set(), missing_items) 0 ß = support.de¤•~µ�¤*ðdef test_check__all__(h%):Åõextra = {'tempdir'}•blacklist Glate!ò a,D ›kOfile' œ=* ª= ©BÄÿTextTestResult', 'installHandleýPload_MPs', "CðProgram", "BasevSuite"}" %@unitmö $(")!.rÑ�_case"B  Bs½,ô/erCImainƒOrunnBŸsignals")¸ Ò0 .ó�Raises(A•ionError,ÕãS$, kk@ù.skipUnless(hasattr(os, 'waitpid') and �WNOHANG'ú “'need os.H(H5os.>xùÜreap_childrenúð# Make sure that "�e is no o ‘ pending C� processcÈÞ f !¯# Create aBPpid =ÑVfork(Š1if 6= 0ªR ‹õ: do nothing, just exit¢3@os._'(0š÷t0 = time.monotonic�deadline$v + 60.0ã was_altereË´environment•:tryÕ5… = False=Ò÷stderr = io.StringIO(Ý$ªwhile Truel-ifû4 > õ04)`fail("7Kout"r&ðwith contextlib.redir°³(~5OÀ ù2 # Use environment_altered to check if reap_children() found a# the '� process$¿if support.u:0ambreak Î# loop untilzž complete¨útime.sleep(0.100)\ýmsg = "Warning --ÿ*edêš %s" % pipùself.assertIn(msg, stderr.getvalue())Û2_True(/9zfinally@:d = wasìó# Just in case, again thathåre is no other¼`# pend2Ž=L|2defl�_options(Ö, args, func)Üócode = f'from test.]0 im[ {2â}; print(repr(U()))'³ò cmd = [sys.executable, *v`'-c', m]2Áenv = {key: ¾“ for key,Tin osÛv.items(§Î R0not7õ.startswith('PYTHON')}oF` = sub Åess.run(cmd,#S wstdout=9OPIPE68err6DEVNULL9 ðuniversal_newlines=¼7 venv=env õ.`Equal(÷.ͱ.rstrip(), Ñ¥;;`returnÄ$, èl5_B_Dò_interpreter_flagsi# Testl.? Ó @optsT(¶#Dï *[]8’# single  ,K'-B'0O['-sSEvbqT# sam¦  multiple n O['-bR-vv|C# -Wø D~Wignore‡/-X3}X', 'deg4['-NO, '-'Ìfaulthandler[?Šý"ïshowalloccount& ?ref$ atracemLG#Àc=3'], w ): ðwith self.subTest(opts= *5)Ñcheck_options/ñ, 'args_from_interpreter_flags') s�def test;/m_2(h # š=�.support.€E )v·@for ÒU in (@# no9ion:[],O'-O'OÉsr5 x`match_ƒ aQclasse ³�__init__4,…;_idÕÙµ.^T_id =)ü Q!idKBbreturn�I?�access =¬ ('spos.File(s+'-o_chdir@§Win32ErrorF0J¿…£swap_attr(—F, '_gË_func', Noneï!# 'I alliHG.setIFs([]ɇm¤assertTrue€.Väð)=#ý)¿vºa usingßÅ *zÇj�the full°º identifier§ð –d_.id()¦DOFalsä§ à¿module name×YO_os'ÐD³ Ï•º '*' patter°7Ê*É~ÿcase sensitivity˜@filetš -Àatch_test(te×st_access)) ðsupport.set_match_tests(['FileT +']3ôelf.assertTrue(C?(Dp q # Uù pattern containing '.' and a '*' metacharacterBp³*xQos.*. *».*/ sø‰chdir)) µ¤# Multipleûs ÕÉ»q.id(), ež-ã6Ã'²Äß', 'DONTMATCHŸEOFals˜; 2defQ�fd_count(ç%):�±# We cannot)õ the absolute value of ?÷): on old LinuxH÷*kernel or glibc versions, os.urandom() keeps a FD open onDS/dev/,q device4ÄPython has 4:�s instead %3.F„start = °»#@fd =–�‘(__file__¨†O_RDONLY6try.MOmore_ [inall7¶os.close(fd]�laEqual(]!- Ä3, 1fÐ# XXX -follow=@list÷ un|aed APIÞó# make_legacy_pycóis_resource_enabledrrequire¯c# fcmpEumak0ind'�check_warÚ$ôEnvironmentVarGuard£TransientR„Gt0_in/#etórun_with_localedemlimi)`bigmem$Pprecix Çbigaddrspace1 Iƒ7doc*ôthreading_cleanu(Rreap_ qstrip_p¶b_stderä#kƒ_symlinki»skip_unlessðSuppressCrashReÉ5 ÓSmain(˧Ps = [~8Aort]aÐ@unit*(Jðs) if __name__ == '__V2__'ô-S() # †ð set -- built-in functï@ imª m4sys dpickleôitertools # pureiPimpleOaZð (3 args only), for comparisð on def pyrange(start, stopÂep): if ! -Ò) // step < 0#'‘# replace%ñ with next element in the sequence of integershEðthat are congru91to œ` modul 5ep.3°< +=¤%£&@whilšaart !=£»zRyieldh5z+38ep 1’_reversed4 :›greturnƒ!opfeƒ­t-r°) class R³àTest(unittest.CCase·Ûðassert_iterators_equal(self, xs, ys, =ä_id, limit=NonC‚# check ˜$n L± xs matches×ðexpected results[Iò# up to a givenjÃ"if€ is not ƒ žAxs ={Ðtools.islice(µ)j³y-ë -ösentinel = object(IJpairH€zip_longuzQ¤fillvalue=LBÐfor i, (x, y)þ@enum‰!e(]¨²šif x == yú co¨)ueæ$el2{9é¡.fail('{}:A” ended unµIly ']vô'at position {}; 8Å {}'.format(GiðG¬yÞ¬�u excessH_{} at° ­ \x, i) /se>Uwrong† ? /_, got7a, x)) Š¿S�7elf1ÙÞEÓRlist(+æ3)), [0, 1, 2]é4 A1, 574o, 3, 4:07--œ.r1, 10, 41, 4, 7;@5, -<°5, 2, -1, -×`—ea = 10bbc = 50�/A aa, a+2  1©`a+2, a�<+>4>z++õÕeseq = Àe(a, b, c))  óself.assertIn(a, seq)   No!b! Equal(len(CW, 2) Hÿ q = list(range(b, a, -c)l In!GB¨Š«Š-ˆbŒ #� -&ÖñRaises(TypeError, * ,Ï, 1, 2, 3, 48 IValue90³› Q, 0.0q1n Òm:7 _, 1.0n³e100, 1e101ç�, "spam"yV0, 42;˪íù(0, sys.maxsize J-1))U2r =$/(-51Íx)fð def test_large_operands(%):Êx‚P10**2fo+10, 3.z/x)§$2xù4šÍ wo‚wBw*False(x“", �›-”sŒ—/, ”F(*:Tru'Q# NowZºÅ) with longsW¢for x in [•-2**100),""?0, %If, -1)]ÇJÚà­¤&[]É *Èa = int(10 *ËCb"#c#5"¯ `a, a+25[ 1ÁÀ self.asseòrtEqual(list(range(a+2, a, -1)), [c+1]) Ÿself.asse>4>2>W+2]) ?Hq = r, b, c)bŸIn(a, seqNotIn(b!ß0en(C?, 2G&Ÿseq[0], a$ -1%/+cÔ bÕ´Õö¯lÕbÕ/b-Õ -Ob, -×#jî-Ø-úÙ!-¯%-aÛòdef test_large_öÔ%):¶Ñ# Check long "ös (len > sys.maxsizeS # Žð ) is expected to fail due õlimitations of the __len__ protocol£™"'(xš„6try«`lengthZFen(x›þexcept OverflowErrorBõstep = x[1] - x[0]‘Ee•1 + ((x[-,P) // C {`return6gthWa = -Kj8b =cW… = b - a2x =¦,êHòÆ™?b, yRaises(>,Ò1HTrueƒkâ Ü,3Ü> 6’ ž idùF%+1>1idx¹/idèœÂx[idx:idx+1]+1Wwith ^QIndexY ­8x[-¼&-1VKJ]N0ûC?2 *GÿÀx[0], a)  ðidx = sys.maxsize+1 ÿself.assertEqual(x[idx], a+idx)( ž:idx+1][01Wwith ^õRaises(IndexError):]‰õx[-expected_len-1]KJ%] IUa = 0b6**1gc = 2*36[õ = 1 + (b - a) // c(sßrange(a, b, cL InhŸNotIn(b, Q�OverflowT_, len1_True(Lû_°~X(x), ê½6xþ"o$v(idx*c)H=j:idxs 5,wSK i… w-xÿÿ4ðdef test_invalid€ocation(Y~TCTypeP”,Ï, 1, 2, 3, 48 IValue906°ˆint(10 *À"¼X`a, a +˜M0cÏA., 1w 3r, 1e1001AŸ0, "spam"7À, 42, "spam"3) ÷+# Exercise various combinations of bad arguments, to checkCõrefcounting logicöself.assertRaises(TypeError, range, 0.0�14!O.0, h4ž!?, 17!p1 !p!m?0, p7à9r"9t[ðdef test_index(5!):×2u =\/(2M‚Equal(u.=/0) (/1)- DValuÛ]_, 2) ˜_-2, 3œ P(œ/ œ(ìv›˜ðclass BadExc(ExcepüQUFpassË36Cmpy(›a__eq__—{, otherM)"ifZ == 2Dr3™/Æreturn False›aþ43" ˆï2, a,gWCmp()K± F±‰±ó`(1, 10|/(4[ 6-73-3)8:-5)bç :T0**206É4B1 - = w{tø`2**100¶Ä, 2**87ª �) ;(:+’ 6¹ŸbAlwaysFkobject‡¬jETrueÎa^ _eM8 = mÎ�F‰ašáBuseræq_methodVÈöbignum = 2*sys.maxsiz¦Qsmall!À 42 ó! # User-defined class with an __index__ method '%I:1def2Úit__(self, n)#'¿.n = int(n)CuDArreturn H?ôassertEqual(list(range(I(bignum), ¢ + 1))), []‰J TsmallL N5]) ›d� failing9ökXIl3)õaise RuntimeError“äR&(s('!, 8o, IX()ÉŸn invalidÊNÊ!óæ"not a number"aÎ2TypòËN˰Test use of ÿes in slice indices.>l/³(10)[:I(5)]v((5>V«y îW20, ZFX()]õOúL NLK¬test_countL°ë23)./o-1), 0=Ä0_0), 1/^/2^3¼sIs(type@¾ -13?intÂ54 Ud10**20Zû 4B’Ý(h´, 2**100, 2¢_2**87C Ú>+~[ZbAlwaysBkobjectεE__eqj[other%n-ETrueda^ _e'8 = m؈É1 Fw0) 63lenL×sys.maxsize, 0+10\1Gâ—Orepr–%¢G' ;+)'ÕÀassertEqual(÷repr(range(1, 2)), 'C') ûself.assertEqual(;;, 3>1') Bðdef test_pickling(P!):bðcases = [(13,), (0, 11 p-22, 10 µ20, 3, -1),=A=0 21~p, (-2, ;p**65, 2E+2)]@Òfor proto in ÿ¨÷e.HIGHEST_PROTOCOL + 1¶u=t9ÃÖ Pwith ò‘.subTest(o=,+=tX83r =”&*t�Y› libjƒe.loads(Ï‚dumps(r,î/))DZQ,r)Í�iteratorÖä¡it = itorgeJ>*t)©rdata = Jq'„kId = ®$it¯ ,�-èdy Qtype(·3), ± 8»Pit), Ì ·�>try >onext(iãÁexcept StopIq?ionC�continue)UO C[1:]!ú¯exhausted_7SW�0éð i³ 2®while TruecZ¦ 4¾sif r ==]1=%Ybreak‡™í&i2é­Z), []­*2+ž´olarge_º`0µ®:À if r == 1O9: Ybreakù d = pickle.dumps(i, proto)'&i2(zloads(d!ÿ self.assertEqual(list(i), []*2+wðdef test_odd_bug(_)Ôð+# This used to raise a "SystemError: NULL result without e"dñ# because the range validation step was eating%Pexcep EBforeq/•returned.$€ Å$R²as(Type®ܘŠÁ([], 1, -1) I^typesðNon-integer objects *eŽ*&aany ofÅ`ñ's items are supposediƒ#3öbe contained in<ÚÕrIn(1.0,H6(3)ø %OTrue&H1+0j&š†class C1°a__eq__¢, other): � uC �OC1()j3# OG#±never coerc"tod �0 fo†mparison!¯2¯3int°©1¦×_index*ЊNotIn(C2ÓKB# ..Âö if explicitly told so·SaIn(intT(§Check that$#__=²s__ optimizYuis onlyê#ËC‘ints, notQ�instancesº1subM6int®0 C3© L)E3(11ó/10ÒC)õ](. ¸Ýstrided_limitÁ3r =;Ÿ0, 101, 2BeþO1, rOIn(2;/99 Þ0y ¶r÷p Ô2-20Î d\OIn(-Ó /-1µÕy— l?-18^�ÛQempty¬±0Ár*ÀertNotIn(1, Sr) õr = range(0, -10)ðself.assertNotIn!rO-1, _‘def test_z°_iterators(t!):$ õ# exercise 'fast' +Â, that use aÁ÷object internally.Låsee issue 7298õlimits = [base + jiggle ‰öfor M in (2**32, 2**64&*N-â-M, -M//2, 0, M6}e -2’5e1, 2)]“<¸ÿ(start, end, step]— ˜-aùU!+?end)u* (-03,  31ÄÁm^‰¶AÚ•Þ1¬ ; ñ,a2 = py` sbid = "/B{}, Ÿ)".formatC õ # check first 100 entriesðÃÝQóp_equal(³!1,ß"2,Aid, £G=100²K/‚eversed(º  $_r> 8 ¸!2p&.)+0>¾_invocationIbverify*gqõ instances cannot be created byö# calling their typ! ’_! =Ò—60))‰òRaises(TypeError,ŸK–, 1, 3, 1>Blong6&q@1 <<‡yX~w\sliceb+BstopŽW=NoneÖÁ3 = H¼/í)/E* list(r[i]) ) £15%en42en(D8n“r„[ÑY(10),VZ £( 1, 9, 3>8Õ-# ùsys.maxsize+1, }]1�09ð che·ck(0, 20) ¯check(1, 2_20, 32o-30, -N`-1, 10mT817�-3, -1) ¤ñ def test_contains(self):Ä·r = range(1¥%�.assertInôrn ?1, ?5.0 NoY/5.?!Ð_ 1a )""�í9$ØY Inë•?In(ôˆ0S ¦ Ëól K;ùˆí  ¿ýð•Òïüreverse_iterationø¥for r in [þ,C/0)1, 9, 3"08, ±# ùsys.maxsize+1, }]îгEqual(list(rd(r)), |)[::-1] ¬issue11845*5`*sliceÿ 18HÆ.indices(20)Hávalues = {Noneü1j0, 2ï¡, 5, -5, 1—9Z4-2:+96599}¬ÉiÉx j8!k!j - {0}D'�r[i:j:k]YnmpariscxAh30),p1ðG~51E5, 6> ’M>A5, 7'N2AA0, 4X7ð rangeð(0, 5, 2), range63] ñtest_tuples = list(map(!, ;Es)) 5ò # Check that equality off™s matches÷the correspondingNnðs for each pair from 6…š…s above.:šÑ_eq = [a == bEHa in¼bÿG ¡GGÀself.assertE(Ÿ", ,?_eqF"!=¡ctly givesüðlogical negatione,=="ne!$º¡ne, [not xBxBÕ]Ëò²should havev hashesºë ¦:ל"lv "&2if ø ÙˆA(a),‘*(bÕR$�s are un×ò to other types (even sequence)·n"Isþ0(0)—Ÿ(), False-('æ/(0- '23e[0, 1]^Œá# Huge integerÕÖn't a problem‹¶Å¹À, 2**100 - 14,\Z ‘02.é`„ 3e)f8kl(No†(�e" Å1" +fÒÍR2**20hP201 -@$99Ú @8x} ~ Fƒ„ b ‚<l ;q} ¡ñOrder comparison× ¡±implemented«RpWwith êúRaises(TypeError)@?¼<K%>K7/<=LÀf.assertRais÷es(TypeError): Ärange(0) >= ! #÷ def test_attributes(selfB#!ö the start, stop and step :2 of`� objectsc‰Sb.asserj$s(ˆ1, 0/1)-210)+?0, /-0/-11&f1F0, 353ÊÉP-1), �O0, -Ò+m É as,�0objµ¼ 'epã,ŸREqualžEobj.ò?artØ 0 op_/op.e.2ep)Æ,Wwith ’„Raises(A¡â°E = 0NO,oop = 1O6eOí+5delØ¡í* O/opN9òep if __name__ == "__main__"¦@unitƒ.ñ() import difflib from‚A.sup!Drun_<¤, findfile?0doceô sys class TestWithAscii(9.CCase(*`one_inË *Dsm =¸ö.SequenceMatcher(None, 'b' * 100, 'a' +0bAlmostd�sm.ratio(kß.995, places=r6õlist(sm.get_opcodes()),ärb[ ('Ô'š” (,0('e"'È1Ä?1)]Á…÷sm.bpopular, set()-5@ 50:@'50Q3elfÍ?Y5?+50h@h'1,U'm5nÀ self.asñ.sertEqual(sm.bpopular, set()) def test_one_delete(self):#ð"sm = difflib.SequenceMatcher(None, 'a' * 40 + 'c'b )[`elf.as¨VAlmos®ÿ ratio(), 0.994, places=3<ä@listéõget_opcodes()),mÌp[ ('eƒ', 0, 40 )-"('''#410,U'8+L80)]i_bjunkd is3ú=lambda x: x == ' 'ܳ(a=‹p4, b4œK/t ,a  ©D´ P/20´S{' '}w´!@in [^_ 'b']d+»!,xÀð class TestAuto‘P(unit°.CCase©0"""³s for the a2ñ parameter added in 2.7"""  inŠÓ_homogenous_sï °@# By<Eaultk‘=True and�ðheuristic kicksxœ$a T€ õ# of length 200+`seq1 = *2al2200ÒR¦ ³\ß/q2T�‹@o9{'b�«# Now turn(6offâuÂ,ƒ_FalseÒ_.9975×F¦oSFbugs¤lÝ�_for_nullenaàCheck clearing#ÖSF bug 763023*žo[], []:!s.’o1' oquick_-^real_2¹ Acompáp_empty_Ås 1fixàq#979794Nóðgroup_gen = difflib.ð SequenceMatcher(None, []ó ).get_grouped_opcodes() ñself.assertRaises(StopIteration, next, AF_gen:@diff0 = Àlib.unified_(€j<W!) : def test_mÝðing_blocks_cache(¿!):*Ñå# Issue #21635s¤-ö"abxcd", "abcd"æ‘first = sH … HOcond)q€Equal(se:¶[0].size, 2}Þ� ,1,2,0Rîadded_tab_hintKõ Check fix for bug #1488943Y­€ = list( ð Differ().compare(["\tI am aEPgy"],?"])ö8"- -Agy",s?[0]6 ?D--\n717 H+ \to626 6? +a,3]lm _cÄt_stop_ibxÃU33224j â �_mP(["2" "3I1)),3õ[((1, '\x00-2\x01'), $+3fTrue)]<P) pÈð914575_from1 = """`ð1. Beautiful is beTTer than ugly.%²2. Explicit$$tt$"im(@3. Se&[1lex%¯4. Complex&€icated.   ¹/to· “·O3. ‘z•»m5. Fla?nes³�nonasciiu=±Ä±mplıcıtSxJÅ�$ü9‚¯ƒ!ö0ì„ð2ð)ðLine 1: preceded by $ñ:[tt] to:[ssss] W.2.(ss0t11 \t232Àm:[sstst] to1:[sð] Line 4: \thas fromPt] to ¢s] after :+65: (&ð] at end\t """ patch914575_to2 = A pã1: preceded byutN@ss] ,!\t.2.(ss0t1_31sbd^üÓs%ûùL3ûlfÌ0 1234567890  *123²4 changed567)´8 subtract<9Œ`short ’ù just fits in!!A two%°s yup!! the ò +4addà $GEa(G)6g" Ñ another longÕõ that needs to be wrappedSSÁclass TestSF(Àes(unittest.qCase): @def ñ_html_diff(self):±# Check SF N wð for generating HTML @uerences@�f1a = ((=<_ºõ1 + '123\n'*10)*3)3t32-to0/¢f1b = '456Le + f1att �f1a.splitŽ,s(Œt|?f1b>›tfºç2K ,/to*f V3 &to1i =Æ�lib.HtmlDj–tabsize=2(k(Ù¢column=14)€bð full = i.make_file(f1a,t1a,'ñ ','to',context=False,num«&=5v`tables •\n'.join(öi[r '

CVq (firstü† within cú(default))

',Iº» [True)=†…%_b,t1b@…t6ðÀfrom','to',cø ontext=True,numlines=6), b'

C,% ((‹0)

'.òi.make_table(f1a,t1a,'from','to',cJ v0vSSame {nrncOFull`+_Falsea_EmptyÅ_[],[]1bÄ_Ÿtabsize=2#jñO2,t2¥EdefaultK <Kö (wrapcolumn=14šk©q3.splitôK(),t¦ ‡WæˆKpÉ–t5  |%])ôactual = full.replace('','\n%s\n1 % 5s) Cñ# temporarily uncomment next two š€ to base ¦ this testE°with open('ö_difflib_expect.html','w') as fp::â’fp.write(ОX�findfilea)^]óself.assertEquale³, fp.read()p1defÖð_recursion_limit(B)³õ)Check if the problem described in patch #1413711 exists.öX¥ = sys.getq(àðold = [(i%2 and "K:%d" or "V:A °) % i for ixarange(GE*2)]q?newIBIÙ .SequenceMéðer(None, old, new)Öœ_opcodes(`™Ì_…}_charsej7K4 = yˆHtmlDiff&…utput = 0bc(Šp914575_þ1p"+E*toC®(jAIn('»@nt="Ý/œ#; éð=utf-8"', outpuñ#t) def test_make_file_iso88591_charset(self):/3Àhtml_diff = ålib.HtmlDiff()'•output = 0.dõ(patch914575_from1.splitlines(),EpE/toC"ã`='iso-ö6-1'Ãùð .assertIn('content="text/×$; A@B"', üctusasciib’_with_nonOinpuvNn2Nˆ-1us-†#>„? Í’ımpl ct½Á class TestOͰFormat(unit4.CCaseLÜtab_delimiter?ðargs = ['one', 'two€Original ŠCurrent'ð'2005-01-26 23:30:50.õ2010-04-02 10:20:52']B'ud§qunified¾ (*Š , toterm='tõEqual(list(ud)[0:2], [`_T"--- Ð/\t·"Ú< S"+++ ? ß&"]¤cà¢/xtà%cà?***à* à aRÀno_trailing_^�on_empty²Odatef(,N 8", àËëùÌD"°€€€kqrange_fë_1 ^‘# Per theð spec at http://www.unix.org/singleI x_(¥ification/÷u = '''\‘ Each <�ñ> field shall be of~¦™Cñ %1d", if the röange contains exactly one line, Hand:ñ "%1d,%1d", , < 1 ofØs> otherwise.MaIf a rŽïis empty, its YÓ shall be them8 ofQò just befor.e‘, or 0 ifAo~astarts7fil¥5'''`ñfmt = difflib._format_Z…_unified,ÿself.assertEqual(fmt(3,3), '3,0')* 4*4(5(/,2*6*3* 00,0*0¦§tdef tesìù@@ext(ë)$Q# PerJ*ð spec at http://www.unix.org/single< x_(¡ification/w…u = '''\c Theºc@ in »1&pwritten`follow­ÁPÌ0two2mEVsæœÿ "*** %d,%d ****\n 0endK¿>…1and8 ©=€}d 9#©"an�Xl UpreceÊ .`M isþ€dj «(. þQNext,`9 Ù2Ù[3---ÙO----Ù_€ }¶=¦³w»¦( /3,¤5R¤6* ¤ð') class TestBytes(unø0st.CCasežñ # don't really care aboutv$nt¡routput,I²1act9Ð# that it's bq ¹#we^Qcrash)7Qcheck#,:‹?p= list( ð) # trigger excep bs firs{71forU×7 Òð IsInstance( û line, bytes, A"all"ós of diff should be4ñ but got: %r" %.!) J�def test_^ñ_content(self):!nâ# if we receivV’ strings,Aturnn=ð a = [b'hello', b'andr\xe9']\Ñ # iso-8859-1Bs;b;Pc3\xa?s# utf-867‘unified =Clib._'í'xt''(pheck =  .c (VfH#s(q�, a, a))1#b)� ñ# now with filenames (ªgnt and@are Ì/s!vaœ¢'³=b=ñ#£ ¿¶FdateêWIea¨C2005 13w1ObObF OÆ2sam\²over again,–‹!xtl1�.1ßbãa  n=ÔvzI¬ŒO{ Î0Сsomebody rR1d aG’ from ISO�¡2 to UTF-8^ý fnÐàb'\xb3odz.txt'S# "Å‚".Ã.cc5\x82!'|8ñthey transcoded the ûßt}EtimeY…[Xa†õ is a city in Poland.'].….†O1odz23åõÜ88ÖÄ_#iú `b, fna ;à*÷ assertDiff(expect, actualû£Ð# do not compd.Úð equal as lists, because unitXqIAuses*0lib]Rrepor<ð erence between lists  âactual = list(") ðself.assertEqual(len(expect), 6 7ófor e, a in zip2#, -:dj h>%) (sE = [7ûb'--- \xb3odz.txt', Ï+++ \xc5\x82$½@@ -1 +1 @@@@-\xa]  is a cityÔ}Poland..+kO1odz2 ]ª° = difflib.ð _bytes(unified, a, b, fnaöb, lineterm=b''}«LDifftLö # with dates (plain ASCIIGõa = b'2005-03-18'°b9`check(ÃËP!a,‘&b)…I~context I±>ð# note the mixed encodings here: thisÇõdeeply wrong by every^‰ü+# tenet of Unicode, but it doesn't crash, it's parseable bH¢patch, and+Áhow UNIX(tm)!‰ behaves€ '\tº09×!¢  ±S#‘def test_Dq_types_£0nt(Ø)ï # &cinput '€ must beñsistent: all str or ô�–[b'hello'J–[.Eb_§'Ž'xt''(O"2Ås to compareÉ@str,^ ·$ («%)"F"._±6e_error¸£æ7Ob, a7ên7nÝ#Ç•arguments "ä(´º a/, 3 Àassert_type_ðerror(expect, difflib.ó _bytes, unified, b, a) ÿself._assert_type_Kßcontext, a, bK4–—ádef test_mixed•Às_filenames(²!):*Äå# cannot pass 'A as úA if ±ðnt is str (this may 8'beLðthe right behaviour, but at least "žù demonstrates howF–ings workõa = ['hello\n']/bo  fn2Ðb'ol\xe9.txt'ð% #åõ transcoded from ISO-8859-1^ fn`F5c3aH¥# to UTF-8+Y !ð"all arguments mus+W,N!: k²)",>‘™�_GP, fna1b) 3dm¸A of ”ôconsistent with &sgÔh_[b'fo™Yb'bar˜e2…'1 fév'Gm+'3Y)Ä[d$ (v)ZRó n¯ú±b'a', b'b',CaŠ)#GDinpuE“qn-ASCII4–s are finN%[V U_list(°(d!, ¢¡,Äx÷, msg, generator, *argsA+.ÀRaises(TypeEV)K6ctxs±V(UíPaEqual(†ðstr(ctx.exception)) cl¹ðTestJunkAPIs(unitd.CCase¯üis_line_junk_true@for "Ñ in ['#', '  # *']Û¼T[—ÐIS_LINE_JUNK(]r), repr ‹»_£Ofals¤ ™! ##¡1abc¢�Mr. MooseË?up!»Fs¼0\REDOS`Revil_Á= ('\t' * 10v) + '##Q–Sdï–characterôÀ(self): ð for char in [' ', '\t']: ðself.assertTrue(difflib.IS_CHARACTER_JUNK(Kr), repr !) JÀdef test_is_$ðacter_junk_false(c)v —a—#!\nfrv®F\¯«Smain(”Cñ HtmlDiff._default_prefix = 0é0DocèRs = d Å.DocTestSuit;)-€run_unit2(r-°WithAscii, @Auto-”SFpatchesYbugs,@ÂOutputFormat&4Byt1¤JunkAPIs, ®ð) if __name__ == '__2__'•£Ä() import os %sy ¤contextlib./EutildnspectVpydoc „_compiletkeywordV_pick8pkg[r75stabdstringBWtempfaß@.supÙ$%imJEtypeä7typKÁ70urlíEpars?Žxml.etre—.ElementTADwrapR`threads‚from io T! SÔ1IO ´collections!Ðbdtuple#çä.script_helper2æ®_python_ok8*± TESTFN, rmß…Ðreap_children 2ap_ÄÑs, captured_o£bstdoutC&àstderr, unlinkM¢quires_docÓ6s )¥�Pð_mod class nonaQÏ€'Це нñ»Ð°Ñ‚иницÑ�'IApass 3òHAVE_DOCSTRINGSL exÊwed_data˜2 = $Õ1'di›1arytòinstance variables (if defined)':ÿlist of weak references to the object>¯) * 2 else­'P5) Ú’ñ_pattern = """ NAME*!pÁ - This is aòq moduleõ+_+± %s CLASSESE’builtins.ÎýA B hC \x20ç+A(Kjñ | Hello and goodbye7$ |J” Methods�C her>-–__init__(i¹ñWow, I have no funÿ!e t-2^’ Data deã&orÌÀhere: |@\x20 Ó| __dict__%s"qweakref%'ñ class B(builtins.object)ó | Data descriptors defined here:'WzœÓ- |G-2–Ìÿand other attributeÕóNO_MEANING = 'eggs'[ ¹ö__annotations__ = {'?B': } AX#CœoMethod¾öget_answer(selfâ|äReturn say_no( Ž ¯is_it_trueDGelf.mMm� q2-NÀÍ&G2àôionary for instance variables (if-%__¢ ^€list of ò references to the ¥ b¡ FUNCTIONSJ„doc_funcÍ€ This –° solves alliVóworld's problemsÞ‘ hungerXü@lack5ePython?warÉ'noŽQ DATA4Q__xyz`'X, Y š±Z' VERSION$ñ1.2.3.4 AUTHORò Benjamin Peterson CREDITúÁNobody FILE0ð%s """.strip() expected_text_data_docðngs = tuple('\nì7ó' + s if s else 'ü Us in w r’ðhtml_pattern = """

ðstrong>^>! .pyBTmodClasses \x20²O>
ëÛõa href="builtins.html#object">d <ë] ddfk . B_modqOA">A^¿TOB">BT=NC">CT/m/   ðLoffc8d8ð%0ðÀa name="A">cï ýA÷Oa>(<>)>Æ//t)%ëã¯rowspan=2>3! /RHello[2and pgoodbyeB<�0 Data descriptor® ܇__dict__™ dtñd�&%sj! <ùðBweakrefEF!P´BPBZPIÄTyÕ¡gÀ width="100%ò2%">Data descriptors defined here:
__dict__%s ¯ÿand other attribute¸´NO_MEANING<º’ = 'eggs'¨ë·annotations­V = {'Pô': <class 'str'>}U€/td>

óCYõ(30)MethodM ýÅ-get_answer" Qself)("#()Ã:P¨ަis_it_trueŽŽ¬.“Õ&"> ›Ë—“ãïž:»bionary{2for ‚instancevìBbles2(if ’ã&BlistUo]„referenc€"to#th 3�ï ‚<“Koeeaa77“%f“5big„1Funsb \!¸\�«nYÆ–-doc_func,Ì a>‘ctt>Thi¨<’DsolvB2allÀof the&Ñnbsp;world's& ñproblems:
hunger Black#"ofaPythonÀwar

#()
index (°file:%s">%sÉptd>žp

�u"isða test&nbsòp;module for ðtest_pydoc

<ñtable width="100%%" cellspacing=0@paddñ#2 border=0 summary="section">

< ñ width="100%%" cellspacing=0@paddð 2 border=0 summary="section"Mñr bgcolor="#55aa55@d coRòn=3 valign=bottom>ÿPfõ" face="helvetica, arial">1 on8Östr class.'''ÿ\n', os.linesepØÐò with bad imports bad ã"1@a%s - M=@NotFà“Error: No% Wd %r"Ýødynamicattribute_p"" HelpÙÑ0 DAksd %s: ð(builtins.object) | að descriptors defined here€: |\x20þ | __dict__%sweakrefM’ DocsHr4putð, loc def get_pð%ydoc_link(module): "Returns a documentation web /b of a 4"3ódirname = os.path.£basedir = (¡__file__)))pdoc = p˜’.TextDoc(lÓdoc.getdoclocµ#, _=1rÄá loc def get_YS_text< ñ!ð generated output as 5ëŠ*¤(¢_mod) or "C if˜mqÝð"\nMODULE DOCS\n0" ++� + "\n" %•=�B.docˆÒ$ñ# clean up the extraÄò formatting thatm@ persaòpatt = re.compile('\b.'X~&ƒ.sub('',)"z)�.strip(),ÇŠ°html_title(ZˆP# Bit]ðhack, but good enough»Ò test purpose®áheader, _, _ =å`.parti³@(""œ%!, y0 = )er.. Z¯ -/!.ø  class PÌÐBaseTest(unitÂ.0Casrs¢0_re-ù cted_walk_packages(self,  , f@=NonD+"a `A vers·¹of pkgutil.D"()Twill }0 ito1 to™Jqa givenr.l€default_”Á0athï[ (ï]Gú€wrapper(?Ó‘, prefix=\anerror)–s ÖF~•Q2, oND„?@@con˜Clib. qmanager¸´0«ƒ ° ¥%“_–±0 = œ.* e,NR Ç)6try³NUyielddkfinall#Ç ¨tUócall_url_handlerú‘url, expea ©Pj.>8" /q»Presulå�Óq# CheckCv° to ensure ]n” ¢â page was not œe!»ÂassertEqual(… Ú,ÃwH V0DocGU@oðskipIf(sys.flags.optimi¯ze >= 2, ñ"Docstrings are omitted with -O2 and above")B0@un"ñst.skipIf(hasattr(sys, 'gettrace'):Dsys./()„'2ó function introduces __locals__ unexpectedly'Œ¥requires_dÆ¥Ðdef test_htmlq(self):°result, docb� = get_py4( 2modj4àmod_file = ins‹Û0abs1ô url = urllib.parse.quote(N`ßµ9 = Å_pattern % (Æ–UTurl, ^â?) +7 i@data3s CÔ.assertEqual(E @!) h ' Ïflags.optimi—ê@textd—4f~!77öOloc,%W %](, /,)` Ú", o`â�Àenum_member_º¼_value_zerocð# Test issue #20654 to ensure I II‘ 0 can beÛrð# displayed. It usedGðthrow KeyError: 'ƒ%'.8aimportgðclass BinaryInteger(ˆ‡.IntEnum·{RE = 0@ on—1adoc = Åq.rendero ezYIn('<'.qQ: 0>'M €ñmixed_case_module_names_are_lowerd‡‚X16484¶Y_link�ÿ(xml.etree.ElementTreeÁ.e.:¿` Ä‹N8225¦- ã* no= žÕ appears for |Ö¸= l¾ÝÑl£ð "", "MODULE DOCS incorrectly ðludes a link") ó def test_getpager_with_stdin_none(self): ‚previous#q = sys./#6try07#u = None*dpydoc.õ() # Shouldn't fail./ofinall] � 9â½non_str_namÖÁ# issue146386šð # Treat illegal (non-str) C� like no 4zclass A_t{__ = 42+B+Epass"radoc = "õrender_doc(A())%b%B%ÅÐ.assertEqual([ð.replace("A", "B"), N)9]t_her5ðmissing_module = "J‚.i_am_no4"¨`result1qtr(run_×(E¦), 'ascii'á´expected = -•pattern %m„m ðE", ˆ,+êô"documentation forY Ys found"Q@unitìpskipIf(áúflags.optimize >= 2eið'Docstrings are omN d zã -OO and aboveÃ!t_ –Õ6 = Y'¡jA.non<þ', PYTHONIOENCODING=uAncodt7 ._|A__.e(3Ã, 'backslashP¶ìˆ2In(:d„NÞPinput£,ipàùŽ1= "¶ l m[.Ä&p(©íe u ñA,idí#Ü#õngs, other imple©ø s might have different repr—Ptripi?r·%id # egp the  Î&‘id('')ø=>/Bat�01F65390u)Â# nothing to ¡Aturn•same text1042'Â.Ð""F ; Á§Àflags.optimi¯ze >= 2, ñ'Docstrings are omitted with -O2 and above')B0@un"ñst.skipIf(hasattr(sys, 'gettrace'):Dsys./()„2ô function introduces __locals__ unexpectedlyŒ¥requires_dÆ¥ñdef test_help_output_redirect(self):)ò# issue 940286, if 2ô is set in Helper, then all"GfromI'.v´ should be y%ed+äold_pattern = ÙT_text,ðgetpager_old = pydocU&ònew = lambda: ( R x: xÁóõ.maxDiff = None J buS6IO(6×%erƒí(,F=buf*°unused, docÁq = get_ºä( 6mod4 module = "º.""™€Q_head…&""‹R on mD AÀ:ãP""".l÷pß_‹Çwrap.dedent(}´¹Ñª+ß×êÑ,ÜE_new&6try³Ä¢ƒcapturedä€('stdout~s¤5, \E882err8:errk3Ó!erÛ(g Àresult = bufÑŒvalue().j,?mmN % (Á?(jO,) +- wW_data@@@(insŠãwabsfileÑ.,)póassertEqual('',ŸE(8?err5 ð", ¦mkfinall^•2oldIeü namedtuple_public_underscoremVNT = 1ð('NT', ['abc', 'def']£#V=True¨ ñéa() as /*ioµÂ6(NTFo 7_ioM;±�In('_1',f:L &@replü,iasdictW~VŒsynopsisBuò ddCleanup(unlink, TESTFN�À for enco÷ding in ('ISO-8859-1', 'UTF-8'): ð with open(TESTFN, 'w', encoH= º) as scriptAL%if14 !=j(,‚print('#`Õ: {}'.format(lr, file=o)°Cÿ"""line 1: h\xe9'74�2: hi"""4 ôsynopsis = pydoc.+*{}�ôself.assertEqual(21, 'w«!) Öñ@unittest.skipIf(sys.flags.optimize >= 2,.ü ð'Docstrings are omN!d Õâ-OO and above'©@def o_™À_sourceless(¾ð expected = os.__doc__.splitÌes()[0]˜±Dname.…cached__!rN;â‹I—.Ò `_empty¹ Ü! ñ.support.temp_cwd(éJ_dirÃ’init_pathå d.join(/ã, 'foomod42.pytÐ6P = imw‘lib.util.S_from’(mºBºo°!³·Jfobj³3ú.write("foo = 1"U³py_compile.Æ�eIsNone ‡]_y xƒ/, fP 2ËÖT2_deoQopen(9Ú, 'w').close()¬ô.assertTrue(pydoc.isÌn)7–os.removee!) ‚2defÒ¬allmethodsö# issue 17476: )ó was no longer returning unbound Q.jèR# ThiC÷- is a bit fragile in the face of changes to object and type,Pðbut I can't think;Àa better way@`do it ÙÀout duplicatª7theMPlogicAˆÑunction under%.4ʰclass TestC (£G%]_ _t¸È -1& ÛkÐ# What we expðto get back: everyúCg on*&..s4äed = dict(vars®%Û# ...plus ourÀN/['ØF'] =.$p0...À no¼be non-3sÌ03delßed['__doc__'] £ "Q# insCñresolves descriptort_T into¼ , ¢5ˆ doesn't~ so—@needgÁupdate __sub}ahook__¸ü.__¢Ô : O YúäBFGþ ’ ‡gz"= Uè(ç1Á‰£DictEqual(C,§A)  P© ImPN(@Base"):‡0\setUpƒnÜbÌmkdir(TESTFN—üddCleanup(rmtree, (iŠ lib.invali¹Œ_caches(2bad/ –Îs»cix for0â5230, where ifV! f`Xmodul~ip had an�bernal „c errorM€would reV‰5doc#kg°modname = 'J¥mod_xyzzy'3•pairs = (˜°('i_am_not_Ï;', )0L.5p_either<H".nI‘iN'Gài_am_not_here.÷{}'.format(modname), 'i_am_not_here'), ('test.: D%) Sôsourcefn = os.path.join(TESTFN, — + Õextsep + "py"Dðfor importstring, expectedinmsg in ™epairs:6Ô¤with open(ˆº, 'w') as f+/’f.write("nd {}\n"A‚)))gôresult = run_pydocoÒ, PYTHONPATH=ôú).decode("ascii"KÚb = badt¶_pattern % X) Dôself.assertEqual(,", ª 1def9�_apropos_/Ð_bad_package(J)(ñ# Issue 7425 - êð -k failed when¶ ?@ on ò,opkgdir §"syntaxerr’os.mkdir(<é2bad0 O)ß, "__init__")] ô#R$f ånvalid python ‰G$1\n½\D0.re9tct_walk_ s("=[]i�=ñcaptured_stdout(º6out”+ /2err/>err/3À.ý†('xyzzy'b#C# No5¥, no errorÐ"ßmÐout.getvalue(o S 1?err1 U# TheTÅù is still matched’ 9Mÿ?errê .p#B,ý̰unreadable_D{fÏ?367ÏB » ÒR.$f �Þ6, "'#àJ6, 0Ž ñaddCleanup(os.rmdir, ]„7Á0te,‹°Windows theÌòectory appears to beVQÜD# A€ so this|0not1lly@1ingUitVC�¢UÀaptured_stdeïrr() as err: õ pydoc.apropos('SOMEKEY')-ð# No result, noJ%or÷self.assertEqual(out.getvalue(), 'K -=err-[“def test_™°_empty_doc(E)Ì÷pkgdir = os.path.join(TESTFN, 'walkpkg…’os.mkdir(:éYü.addCleanup(rmtree, (Pinit_k u)Q, '__$G_.pyy¡with open(B¡' FfobjÕ¨ö.write("foo = 1"­ðcurrent_mode = stat.S_IMODE(os.á".s'=:trylƒos.chmod3), _0& ~P`FEXECH§Ö;�restrict_t _packages(è"=[‘ò]), captured_stdoutŸ •^ žNw}5In(ì", O[´ofinall*) “¤url_searchål_erroršâ# URL handler 2Ñ should cope ;(ñ that raise exceptionszë\ rV1, ",†”,òˆ Si7, "ÅL´Åò , "wt", encoding="ascii"Ó ÏfÍ"""æV#E:¼"ouch")\n""lä[ o2# P‚ò has to be importable for theÎõhave any effecty}QsavedóÂs = tuple(sypZ*0.inB(0, ¤ ' �<[ïÓR vsRegex(,#, - ïAã< ò # Sanity checkÕ3@textKÒPcall_é¿"("À_?key=m,0R "P]1: S.! REsâ)ÿfound = (''k'•K1pb1In(z , ü £(@ã0[:].RP@unit�ñ.skip('causes undesir|Rside-g£s (#20128)ªù~modulesUôSee Helper.list(%).Ànum_header_l£ines = 2 Ànum_module_lù _min = 5 # Playing it safe.5bfooter5E = 3°expected = ]Ehead(+ pR Oõoutput = StringIO()ñhelper = pydoc.H(2= -"('~&s'Presulc3÷.getvalue().striprÒ(r = len(;a.split6())¼õ self.assertGreaterEqual(F$, .6ó)@unittest.skip('causes undesirable side-effects (#20128)Î@def >Ó�s_search(‰%):8b# See /S.list&()ä™A = '_F - 'Û+—0ð with captured_stdout() as Þ6_io·³%erÆúþ ‘$ =>ͽ˜4In(ê", =‹ðsome buildbots are not cooperat)Ž_E4„Iterator8¤Tuple[int,"J]zG5...[4T =*ÅTypeVar('T') ƒclass C(˜¥Generic[T]a0Mapéuxstr]): bûÑ.assertEqual(€.render_ÿfoo).splitlines()[-1þ»€'f\x08fooJCò#, ,'Ê;'HA:A]ÂCÀ2¿ T¿óC(collections.abc.O_r,)'`|builtin[ðfor name in ('str',  .translate=!s.!$'%?ÈO#ïá low-level funÐ VD“IsNotNone plocate(µ)y[Ohigh\ :tryá< f` ”þexcept ImportErrorG¸ðfail('finding the doc of {!r} ¤ed'.formatÈj ‘4notWˆDstrr¢rdüÔÉ/rrÌMz3 ÎC Ðò°ª§2wRaises(S,, Š, ÏÑ@staticmethodºAÐ_get_summary_'(o¦ctext =XSplainJToKAsè2exthG('\náîQ len(,a) >= 2Ž?qreturn 2[2]è#ðse should include " ";É òunbound_python_ì ¸8 ' ýðwrap.TextWrapper.)4"e , 4$)"r€requires|strings°©±,‘_pickle.Plr.dump¬¬eobj, /®gŸno longerj h:D({z²‹À.wrap),  ð"wrap(text) method of ð .TextWrapper instance") > de)ñst_field_order_for_named_tuples(self):15‘Person = %$"('�', ['nick”', 'first µagegroup'])MÐs = pydoc.ren~Bdoc(M%öelf.assertLess(s.index(k5), t)C.D«)*ùðclass NonIterableF6s%K×BNoneg=OHash=F[[]]=õ# Make sure these doesn't failM I ¬, ›úñ@requires_docstringsr=âbound_builtin_ƒ 5S=7IO(†Á = _pickle.P6r(szùQEqualVñ ._get_summary_line(p.dump),˜n"x(obj, / p ð# this should *never* include “!hðmodule_level_calløÄOQä|os.statåð(path, *, dir_fd={ð, follow_symlinks=True)û �PxðServerTest(unittest.CCase¦0"""Ss for­�_start_s=2"""«ê.’ # Minimal ga that IsÖ 6, µn stops it.>^ômy_url_handler(url, content_typ²mÿ = 'the URL sent was: (%s, %s)' % GuFareturnRè­ethreadÄ (­B, ho A='0.Ÿ', port=0ò7In()p.Š{ƒ.address¬™šptime = .söout = 1 #secondsØ@whilæÞ.{:ingèG¦.sleep(.01Áƒ#ifÌ AH and“" -þK! >:outgO€$erL7topÎ VbreakÆUÑ`error,ÊHe) BUrlH\ò("@Base”  D_err·f?H‚ËàRaises(TypeErróor, f, 'A', '') ô self.assertRaises(TypeErr1B1‘foobar') 8ðdef test_url_requests(J!):!\ñ# Test for the correct title inøhtml pages returned.A1hisis.ñdifferent parts of÷URL handler withoutDñgetting too picky about:`exact …vÏE = [GÐð("", "Pydoc: Index�«Modules"),-�get?key=5iW2gtopics3T �xkeyword+K -pæUmæ  .ë%6 asearch$ 9S Result\õ:7def§€KEYWORD  ¦5wSTRINGS9dTOPIC  ;þ03 -  1qgetfile£$=% I]o~Ù bð.restrict_walk_pack@(z0wFurl,pÙ¢(WAcallÐK(>ö+ppath = †Png.__ê)__ÿå=/ëP " + ? -surl = "$4(§a classy°Helper(unit«.�CCase(à ¿nÑEqual(sorted(¬.^.= ¸&8+£.kwlist)) ¬Q�WithMetaC¿/es¶@ÏúskipIf(sys.flags.optimize >= 2�‹B"Doc·€s are omd6€ -O2 and2ve"! pphasattrx0, '\arace'):�( 't2ó function introduces __locals__ unexpectedly­²qDynamic,œAttribute¿ TD(typö LP__getÍ!__=\, nam)1!ifž == 'ham'A&Ày 'spam'à su”().|v1¸qDA(meta =ŶK@Ô/s. Kà def ham(seklf): Õreturn 'eggs'òexpected_text_data_docstrings = tuple('\n |Pö' + s if s else 'L!0for9%n s n)•¡output = Sˆ6IO(ñhelper = pydoc.H(2= -6(DA~ñ' =Žõ ynamicattribute_pattern % (šÝÖ(__name__,) +DT EF[:2]PresulÛ«À.getvalue().upêùself.assertEqual(»", K!) �ñ@unittest.skipIf(sys.flags.optimize >= 2,.Ç&"Dõ`are omNòd with -O2 and above"Ì p0has;xÑ, 'gettrace'):�/()„'2ô function introduces __locals__ un2ly'Œ@def ûä_virtualClassAÈÀWithOneMeta(Sc) GtypeW»__dir__(cls"SA['__Kä__', '__module)iLIFE']‚e0get=!__¢ , 3p!ifA =='Kå–)42i£super().__x(p/Ì FQ(meta=' ”Epass6ѵ7€á¼ö©¸õ@ ¸D1 % ¦¥42 = ®ÿU0Two>ÝCX/1(€R?one4J~ 1s½- }/__12À rôeturn ['__class__', '__module3nam wtwo'] ðdef __getattr__(self, 2)):)4!if@ =='J!%r”2>ˆsuper().vp1Ëp Meta3(!1, 2’» di·;cls‹õlist(sorted(set(i$D�hree'] +G°6.__—" +¾ 9)))?̇ �‰ 3iï‰CZa1(metaš=ä oEpassi' 8!2(:1, @3@ €fail1 = •2 = False^öoutput = StringIO(Lñhelper = pydoc.H(2= -¡Ðexpected_text‡pvirtual+ðibute_pattern2 % __Å%__§Qresul@x÷.getvalue().strip·vÕ.assertEqual(s„#, M¥T<2` �„3@±'212) dñ@unittest.skipIf(sys.flags.optimize >= 2,.ø @"Doc‡ ngs are omNòd with -O2 and above" p0has xÑ, 'gettrace'):�/()„'2ô function introduces __locals__ un|2ly'Œ/û`_buggym¹TƒgM(type=¡>! âcpmissing GhereUyC/ €1Õ = 'present!'¡$Õ8.õCÕ5 = ÊÊ ÔÎ2 = ©Í'ÌË’Ï�resolve_fñ Óð# Issue #23008: pydoó c enum.{,Int}Enum failed ñ# because bool(.(µ) is False.,õwith captured_stdout() as help_io:+^`pydoc.%('X%')$dtext =@¦.getvalue(&ðself.assertIn('class ¢!',7BB) ðTestInternalUtilities(unittest.qCase): ‡ def setUp(g)Àýtmpdir = tempfile.TemporaryDirectory¥Crgv06?Q.namehb .a$ò = os.path.join(m.ü, "nonexistent"”ddCleanup4c (bbs_curŒa osdÐ_get_revised_ÓJq, given!, õ@=Nonx ò# Checking that .0cliRÓctually callsjö#®ðhandled via code —öew (at least for now)Ó"ifž@¡¤¹6 = »Îoreturn› ÿ)3�starting#4~`# Get Æ‚py of sy/ ‚ôout the current d�ÖZ½=H.cop´ ï2 inåì 3 __-frange(ht.count(P)ÍI-fremove. V+6ÀA_sys×ð_adjustment_adds_missNÀ PPQM „NcexpectÐ HF] + S½&ªQEqual†.jŠ!;9), l%ï<!s_œA_dirgp_íI@leadq‡i[â?dir%, `+T@trai³‹++ ˜° aŒ§‘protects_é¹�.Jäø‚u 7Àpath(given_pó ath, argv0=pydoc.__file__) ñclean_path = self._get_starting(/@leadUqdir = [6F] + Tg�expectedP5�bs_curdir7 \=a±ssertEqual(£SrevisR(<9), sÂ[trailñ, +І Pà ]>Ä =ÅOÁdef test_sysPó_adjustment_whenTð_already_included(…!):Eÿ÷ü€for spel>2 in.¿_s^bBwith(‹subTest(0=9—9R# If 0C is Îõ present, no alterations are made at allæK#R¹Í}  96!.aaIsNoneH(…b)tâ"' =+z‘„' c…²Ë) Œ©�' m�²‘€œ#]’'[LÐ)) @reap_th1%s bSmain(›6tryÝ€ð.support.run_unit (Pi0Docî,§ 0 ImI3(qDescripûg`Server?3�UrlHandl7_oHelpere WithMetaClgs8fÿInternalUtilitie9–gfinallÑðchildren() if __name__ == "__ 2__"ìq() from’! iÐP findqó, TESTFN, unlink Tarray "ioIJE5moc1 pickle c*ð UnseekableIO(io.FileIO): defã tell(self): ñraise io.UnsupportedOperation '�def seek;Ð, *args, **kw Lò class AudioTests†øclose_fd = Falseu1tUpveÀR.f = —out = Non8ŒtearDown;iȱlf.f is not7…U.”!()ÿ:o= =out@æunlink(TESTFN)âÁcheck_params®ð, f, nchannels, sampwidth, fram˜Ae, n %s, ¤ comptype, Lname?ôassertEqual(f.getnr'()l 6�6 6 ¼@rate6 6 ó4 2 ý3 414 ¯_©1 = 5& &"§$(npâ ÃÆÍÅq._ 6•6¢6Ä,Ë2à 4Ã4 Í÷for proto in range(pickle.HIGHEST_PROTOCOL + 1C sdump = 1"s(},U�/j`loads(?2), @8) )AMisc-(8&):Bñtest_openfp_deprecatedL³µarg = "arg"4@modeñwith mock.patch(f"{½ðmodule.__name__}.tQ") as.ƒ5, \^öN7sWarns(D¢0ion7ing¥3lb€fp(arg, ¥= X©{.f€_called_Æ 9 X_WriteY ±create_fileN , k³ ˆ ¿(4f, 'wb'½8f.sv8n '˜ˆ. '‰'Àate) ô f.setcomptype(self.%, sname) ‘return f Òdef check_filC`, test², nframes, !):5JBwithcÆmodule.open(:¦'rb') as f48–ó assertEqual(f.getnchannels()¹º?•sampwidth??ÝErate??%= 6Areadd$s(3d™NÑ_write_paramsã…2f =„bcreateÄfTESTFNƒ%fA. #f’£ #*Œfª{J^,=Ê _˜8ÊŸf.close()2òcontext_manager_calls_2nG0# CI õs for a minimum header and will raise an errorÓñ# if it is not set, so this proves that �&�5ed.AQRhò.cEr¸C7%ˆk, 'wb'15Opassy2mó¸@ úy®0ª5®¯®-_ÝX_� à («1Ez=z×רiÊ@nJ+/-š/L//C.` –¶‚ ömd=16_fdy4(eC 1oº,e1 RFalse@Cfp()¡’ϰ1 = k('Zú*.ÃûC×CCëÀe, self.fram‡erate) ùif not self.close_fd:"-úassertIsNone(f.getfp()O)âEqual(testfile]*d,j!) k@def )ð_context_manager_with_?Pname(])��# If the !Ñ doesn't get Éqd, thisY0 woñfail, but it will~áõ# produce a resource leak warning.+”Æömodule.open(TESTFN, 'wb') as f©aáf.setnchannelsË. D+’sampwidth++AframÚ++rcomptypK.•0omph8ë å¡.'GFals&ÿ[‘params = M(#RP&;¼K?O?~c??XœTnBwrit´ÿ2f =‡acreate'‡‡Ln u #_Cs#R(¯¼¾XcheckyqZ< Ô¡_bytearrayyÞN o.šéQåXk.J('h'†ìQ¯memoryviewÖS p×S in?aleted_A ì=ìµ #.Oöb'ababagalamaga'º€þB+À f.setnfram÷es(self.nframes + 1) rf.write, '…close() >õwith open(TESTFN, 'rb') as testfile:-r‰ÄassertEqual('ú .read(13), b'ababagalamaga'†B`check__A!, åÇ„1def–¡_multiple_÷)¨ÕwÕ ÄP(À 2f =ªjcreateÅ ëSf.setÑ— '×4izeZ²nchannels *k‘sampwidthˆ÷2[:-9Kize]l+[3:48´¢overflowed:”9š/ -üí±unseekable_r5 Ã.ŸÝ×f(D£7 LUŸ/IOT+Ä œ LM P1RV+±°‘. Z€3Ï#S <1Ÿincomplet +!+F,À fó.setnframes(self. w + 1) Itry:xf.writeA <îexcept OSErrorGIpass\moclose(\ ]úwith open(TESTFN, 'rb') as testfileŸÄassertEqual('ú .read(13), b'ababagalamaga'¡B`check__A!, qBµ1defšñ_unseekable_overflowed_º)¸åU0&IOíwí ÜWØ 2f =ÂjcreateÝ fg-gÿ764ize—²nchannels *¨‘sampwidthY¿…Ÿ9- 1Ÿ5[:-rö]) class AudioTestsWithSourceFile(1): �@2amethodë`setUpCKG(clsÔpcls.sndB’path = fi)ðname, subdir='a�0dat’bä_¼b_param÷i× qmodule.6.ˆè#*£f.getfp().—`<;„•fmÅÄ„Qrate,áÑ_yo?pcomptyp4�¬)¢‘/xG)fU[ dsè\Ó~._UFalseH.žd.f ,D ÍDg'_fSì7J Dfout‰ è0, 'M ÁªîŸ3DRaisÑrz¾À ÷ fout.close() ò self.assertEqual(testfile.1d, ";:_fd=Vá # do nothing d@def O`_read(H!):€²framesize =c²nchannels *•sampwidth4dchunk11Bb[:2 * Jize]-2- ,?: 4;f6 ±module.openÉ@.snd&Fpathã M f.û��(0), b''/ Ÿtell(), 0& UB2), 2vGwindë’pos0 = f.a% ²),0poswlF2, 2¹ ŽÊ#ad@ë2�f.setpos(uI5}*BwithÀVbRaises5FWError É&-1ÇL-cf.getn?k) + 1)šAcopyœ�þ%0 ö<·TESTFN, 'wb .aarams(·p )Ui = 0ºnÏà¶while n > 0peei += 1({Swrite' si.en -= iA=kr;.re¸4get,Ø.:7c%),Óæ ÏÆw)Tgü_not_from_startcÙ1 as1Z ºG.«÷(b'ababagalamagaK¼^«0, 'rhfa8 e (à"ZÉP= W�  _&1(13ÍGHnÑÀ self.asseõrtEqual(f.getnchannels(), self.;)  IasseC•sampwidthCC•framerateCCn2ÇssndfileFCreadFê<ô) import __future__ô unittest class FLUFLTests(.qCase): _@def 4ð_barry_as_bdfl(€!):"„Çcode = "fromy ‹<r§; 2 {0} 3"@`mpile(Hñ.format('<>'), '', 'exec',:~îð.CO_FUTURE_BARRY_AS_Cc½.'ñRaises(SyntaxError, co� %deŽN!=')w{!'<ß«0·ìˆ_guidoˆ 'a';hÔ aÓa-,»}� -ò) if __name__ == '__main__'oª(î¤contextlibî$io $os �„lib.utilGpath9Pposix Dtime dstruct0zipÅœ1 1tem  Te›raryFile#drandom!Pint, pom, get EbitsTast.supäÐâ script_helperX´ '²(TESTFN, fi}ð, unlink, rmtree, ²C_dir ?cwdô õrequires_zlib, 7bz2OlzmaF 0cap¨²d_stdout) ¨B2 = c + "2"9DIR€d" FIXED+ò_SIZE = 1000 DATAFILES_3'®P_data·¡s' SMALL_<0  = [('_zipA1q¯1q2w3e4r5t(Y/T2dir/<2<¯qawsedrftg<w3H3H¯azsxdcfvgbHT4Tð6y7u8i9o0p')] an€ytes(siz¹hreturn�Q(8 * "U.to_b1µ, 'little')S_l("3SyieldÜ2'Àwith TemporaóryFile() as f: uyield fñ test.assertFalse(f.closed)#ÿwith io.BytesIOO)ð class AbstractTestsWithSource­¦@(amethod„ def setUpCAR(cls)*Óðcls.line_gen = [b© ("Zipfile ß ñ %d. random float: %f\n" %dK3(i,8Â()), "ascii"2€for i in5õge(FIXEDTEST_SIZE)]n¹ðdata = b''.joinÛÍ!) +ýW(selfù¡# Make a s@ ï¯AsomeôsB¥Popen(‹‚FN, "wb"pM+�fp.writep.¢ŠPmake_Tr_archiv&ö, f, compression §level=Noneº·kwargs = {'5*':CD}Ûó# Create the ZIP š!üz@.Zipj (fR", **Ž % ;Ëanother.name 08 2(€str("strÁ0", çw�Æ!p.È'¥@ten-Ñ-w', mode='w'ËòB™ "ine 7 /ö&1zipùÛC= {–o# Readè&r"‘1ion € ùž aEqual($S.read6)ž< "/D#  ƒäUPrint ™directory&@fp =Ñ`StringÒ ôpI@dir(”:=fp¼Yú = fp.getvalue(&8å.a.split + >Alen()ñ), 5) # Number ofç¢s + header$þH@In('ér Name',:[0]¤ 1�Modified0:Siz\ Kófn, date, time_, size =‹"1]  F'B'ÃàTrue(time.strp÷ time(date, '%Y-%m-%d')) ðself.assertTrue(4P.strp _>H:%M:%S>ñEqual(size, str(len(]‰data))) wù# Check the namelist! s = zipfp.#(½u,_s), 4,¡In(TESTFN,|s) �"anotherƒ"1strfile,æwritten-open-w3 ,@info (# (` = [i.›  for i in 4)s]U¸X»ù :( =_ãj"ß ÞcÞ0get^ [x nmy… d"C"")¨b)r:(nmÕÑ5nfo/, 4æùat testzip doesn't raise an exception(ù5(?1defHa_basic`[fZ@get_és"@zip_\A(f, Ç·compressionl'œ,)X, f, -‘Q.make.€_archiveb0*a# ReadCZIP 0Awithÿ¡ile.ZipFilM:"r"‚1 as(p‹è0zipœ1ø ßZ p.݈)H1KO`while $ Pread_qŒF.N(256�3pif not %:Y*Ubreakæ….append(MÆ (2 Ž2¡ 2JÀ zipdat÷a2.append(read_data) ðself.assertEqual(b''.join(zip0A1), % )<2<=àdef test_open(Z!):•üfor f in get_files"&5A.zipC_M#(f¥³compressioné pì_with_pathlike\0 = ölib.Path(TESTFN2ù}1€¬u@ zipÑ’.ZipFile(5?"r":1 as0pH{¬ IsInstance¨0fp.\—name, strû'grandom.IX, f, /lQ.make\€_archived0Hó# Read the ZIP 0Õÿ1f, üR÷‰U = []VZ!p.N­)H1Ö1®while True * =…F.(HÆint(1, 1024)8pif not 2qf.YbreakÑó¾=mÐ ‰J4,Fß1~•Bead1-*�r:Qfp, \,�¿f 㽯z/vuN1(-1hd`Ÿ[ ‘ Ø Ê1P-Ú J/10MôÀ read_dataû = zipopen.read1(10) ð self.assertLessEqual(len(3�_data), 9uif not ':[j]break0zipZw.appendk +˜”“b''.join(=1), $I)8�def test_•P1_10(")šüfor f in get_files"´5E.zipG_U#(fq·compressionx0Aline95LX, f, 6‘Q.make.€_archivek0Þ›ó# Read the ZIP 05@withôÛq.ZipFilMq"r") asEp, \1T.(t(TESTFN,¬,mi = b''Cªwhile True/3Œ Š$(‹RGKM”!+=Š*0?(10 ~:ØV¾¥@ 9\1 ”ñ# Issue #7610: calls toñ5ñ() interleaved  %5().¯ d™¥�ߢ€ ÜÎ| _1_zipfpWGM J_gen[+ø 2UBC , Anò+_ês1µë¾0zips¼sÆ,T51zip–.#s©ôC�:÷ ÈÀ for ÷f in get_files(self): ñ.zip_readlines_test(f, Ñcompression) :@def 1Giter1.X, f, 2lQ.make_€_archiveg0bŸó# Read the ZIP 0�@with†Øq.ZipFilMq"r") asp~ 3Ôp.open(TESTFN. 04@for ä,Q P1zipJ.A_genA \BüðassertEqual(zip<,\Wz_XeS�ÑHrjˆoÑzGlow_ €�"""Check ‰µcases whereòõed data is larger than original."""Á�# Createâ´o2, "w"¡ú�zipfp.wriæ`r("str8s", '12'€©`# Get ³¡pen objectî2¾�r�K—žšV>objšÌT*.È¥(1), b'1')²ß8< f =*^–&w"�.”öb.txt", "hello world"Ma_type=½¢OCinfo|Pp.get!('U@5'.QdV• \level-à’?ileßC&=1Ð?a+ On,MQ% Æ2QC@ � followsùÅconstructor.^ a_—<ÎÎ 9зáAæ±?, 1Ò Öis overriddenÈbÈ}È 9È%Àal(b_info._cñ'ompresslevel, 2) def test_read_return_size(self):%)ð # Issue #9837: ZipExtFile.:Ò() shouldn't F· more bytesEõthan requested.2forˆ|Á in (1, 40956‡7, 16384–šAfile³' =C5+ 1]&ájunk = getrand—(:)+€with zip@.ZipæP(io.B̰IO(), "w", "#.cXqion) as86zN@.wrik�r('foo', “ z+~T.open,1'r'_.fp]6‚buf = fpŽg_-¹öassertEqual(len(buf),A  truncated_Ì-il!Xfp = &TÒ.P²fp, mode='wÚW Ü50str’'yddata, a_type=Ù’„÷¢end_offset+Vtell("o0ileX “getvalue( D æ5JñÁ1 ç.ñè/ 2‰.“(ÙF- 20‰)cöûRaises(EOFErrorQ20zip|SäPwhileÕ ?10015Bpass[/Ù+/1(,‡,pr{�fname = 'ÿ. 'Ø8f0@get_ s>‡z ‚D, 'wN5ÇkDp”‘(TESTFN, Ÿt‘r = repr(4 �DIn(" G", rl¾ a"ðr = repr(zipfp)+ ýif isinstance(f, str):'6ýself.assertIn('filename=%r' % f, r)8OelseNJ ~¯"mode='r'"wð r = repr(zipfp.getinfo(f°)¦ \ Ú6g8˜._size='/1if `ðcompression != Òïile.ZIP_STORED`FO_typrå7s©Awith—cp.openf0 as¡¤&—�‹' :8/ 1o,C¯!<s 3€[closed]¿ 5Qfp)) �”def test_ŽÀlevel_basic(IíÐfor f in get_ßs"æ@zip_W2_Tion, l,=9‹1per_ ” lá"""Check that � kñin a Zip archive can have differentú¬‰<�Us."""O¥]ü.ZipFile(TESTFN2, "w"Ë#1)×*fpÕ–dp.writA4, '~:_1'Á. ,9'w9?@one_Ð àr/ni49¦ðdEqual(x.¹:, 1  9~ : larDown cunlink˜j ñ2) class StoredTestsWithSourceÚ�Abstract,7@unitò.>CCase9åc� žY9E_low9.FNone§T_G str_permisúŠ,fqƒ¯²# Make sure1Eà and open(... ómode='w') create files with  # &÷) 0600, when they are passed a name rather than a ZipInfoG¥instance. õself.make_test_archive(f, compression)/˜@ zip¦q.ZipFil-q"r") as%p:/Árzinfo =@.getP('strE'\-�Ô�rtEqual(>ö .external_attr, 0o600 << 16)Ë@/2nïwritten-open-wu2vAdef 7_¡estr_permi4 s(Ì) Ðfor f in get_û "Á5B.zip�X!f,Lãile.ZIP_STORED’€absoluteÒ mÊÏTESTFN2, "w"fäApfp.®(DD, "/„"�àw rw- .ˆð¥list(), ["†]‡$�ppend_to_q“ ´‘"""Test a*ðing to an exist 5"""õã Z/bÎUaUÓÌSstr("©1", oOdata´ †³%, N�?non‘'Æ¥t is not a-¤Á# NOTE: thisÃð fails if len(d) < 22 because ofse firstèð # line "fpin.seek(-22, 2)"æµ_EndRecData2<“ = b'I amžEU!'*10)C¬Nq2, 'wb'cfSüfw\P‘", Ò r ´r´/jO Pý†âd ž  µ]p=Creadò)¬õ ÀtEqual(f.reaád(len(data)), ' pzipfileµ = f.read()#÷with io.BytesIO(/£) as bio, Á.ZipFile(bio%p:Lvñself.assertEqualQöp.namelist(), [TESTFN]…9¯11), ^Ë!) v�def test_'ð_concatenated_zip_ù(4)¥ ñÉ6bio"Ž&ß8ile÷W, 'w'‘IP_STOREDG1 Mr.write(Ë",  («Çbio.getvalue±þó = b'I am not a ˜Q!'*10vÃCopent2¼!b'©fîf�\ “›{c&Ú2h �!`Ÿappend_to&ó0+uB, 'a˜09LÙ€str('str'FË .r. ÂUˆ¤%, “,H %�¨‹Ò ÿignores_newline_at_endÎ[¨‚_, "w"¬Hp24¨V½U‚"\r\n\00"`Kt¼/r"CÀelf.assertIsðInstance(zipfp, ð8ile.ZipFile) def test_ignores_stuff_appended_past_comments(self): 9LwithX×(TESTFN2, "w"vÑIP_STORED) as5pIM #p.kó = b"this is a "³-1Swriteu", })(¢Copen"a2, 'a'ƒf"f.JË"abcdef\r\n"HqBS1"r"S! Ößself.assertIs“×:REqualÈ!,  ÕÓÜ_default_nameÃó"""Check that calling $ Epout arcC¥ specifiedgöproduces the expected result.""¸KýHwH[�x�2YéR, "rbN é.\Dread^A, f.)U0to_OonlyT 0tryS!to^ “„() on a Bqu objectXPraise¯ValueErrorOomode="T str("somef™Ótxt", "bogus"ÿ7eŠ%$022, o RØ(Ö)páÇ z+>ô ) ìç)p.Rá3'w';@add_8Ì_before_1980ñ# Set atime and m Õto 1970-01-01í@os.u[†, (0, 0)ñСˆò ƒp @requiðzlib class DeflateTestsWithSourceYŸ(Abstract,äc@unit‘.?CCaseœÖcompression =C»IP_DEFLATEDÑ2per–: – þÄsîi�0Zipóöhive can have differen¤_� options¤­á ’'storeme'®ZÐ ðzipfp.write(TESTFN, 'deflateme', !÷ile.ZIP_DEFLATED) qsinfo =*Pp.get`('storC -d-r /ñself.assertEqual(mê.compress_type¤MSTOR¢ F†F êÿ' @requires_bz2 class Bzip2TestsWithSourceFile(Abstract,5@ �unittest.=aCase):3í3ion9�gBZIP2 ¢Clzma£@LzmaI¢8¡cLZMA ’ÀZip64InSmall9së€# These sò# the ZIP64 functionality without using large fileshB# seH_ÂB‘or proper\1s. a@Õamethod def setUpCîC(cls‹«pline_geŒ€(bytes("h1 of@ile #ú %d." % i, "ascii"ÚKðfor i in range(0, FIXEDŒf_SIZE)7ðcls.data = b'\n'.join(m�)ͼ(<¸z._limitG�64_LIMITû“*M_count4«_FILECOUNT<m/Xu = 1000_# GB = 9Lj¡# Make a saßøB somfsVU openDz"wb") as fp^TñéR<@zip_?W, f, €O„# Create¡Š archive‘ì ipçy(f, "w"Tq, allowQ=True´9 · «Û"another.nameb0W&FNS(€str("strü<", .o# ReadöröåsñžCreadÙ)˜“< )D# ƒòˆu# Print ™directory&ÿfp = io.StringIO(’pIcdir(fp aUA = fs[valueFEs = .ð.splitlines()  ñ-self.assertEqual(len(lines), 4) # Number of files + header AHñIn('File Name', NO[0])1 �Modified0:Siz\ ]ófn, date, time_, size =‹Ÿ1].split(’ F 'another.nÍ1PTrue(lP.strp (€¿'%Y-%m-%d')=BÏ_, '%H:%M:%S>¬áQ, strÁŽzdata)))¨À# Check the ÓIlist;‘s = zipfpö#+ 6:O), 3é¡In(TESTFN,|s) "y"10str¢, Øù@infoÒ õ# õà` = [i.h  for i in 4)s]U… [6[%vÀ Î:Î! Ò _}"y xcx0get+ [w nmF þ"Ý)–P±`:(nm]¿5nfoÌ/, 4önùat testzip doesn't raise an exception�5(Ç1defHp_basic(oIfH@get_¤s"@zip_\@(f, FÌ.compressionl�too_manySa# This– ä°s that more Sn 64k<ðcan be added toý…archive,üP# and9t¥£resulting * Eðread properly by ZipwIACile.c.w"û‡*°allowZip64=ôenÅ.debug = 100‡1num‹5«9drange(%Í}U0wriªñr("foo%08d" % i, "% §(i**3 % 57bÓ |àzipf.namelist(ó)), numfiles) Ùzipf.close() @2 = öile.ZipFile(TESTFN, "r", self.compressionUðassertEqual(len(L¿2.namelist(�õfor i in range(°:›¸scontent¡ö2.read("foo%08d" % i).decode('ascii'œ@  QA, "%@¶(i**3 % 57):Á ,ñdef test_too_many__€_append(h)»A´UwU,ù½ úallowZip64=False°Å.debug = 100JVE = 9zÃ@.wriõrs= . Bwithk>aRaisesNESLargeŸk%¬G, b'¤&j €ï aïT×&{ÿ?Truiz&¡„/15¤ Ø2i¯:2v Í*·²QE�Ø *°SnoarDownA>ÂIP64_LIMIT =e_limit*hÀ.ZIP_FILECOUóNT_LIMIT = self._filecount_limit ïunlink(TESTFN)ÿ 2) class StoredTestZip64InSmallFiles(Abstract,[y�unittest.BaCase):6ðcompression = zipÍÁ.ZIP_STORED &‘def largeì°_exception_S(W, f, M_ŠFwithZ ipÒy(f, "w"3q, allowý¡=False) as:p­Nqä.assertRaises(¹L¥Zd 4’p.write, ¥ÿ, "another.name")ÿ2°(fnn?els¿T‰fn[:-1] áÑzipfp.writepyV b�0os.µ‘.basename'òself.assertNotIn(bn, Z0[list(3�Compiled8’pwith TeâaryFile() as tn‘ile.PyZipat, "w" ‹ n…__file__aÑ if fn.endsoŠ('.pyc')>(BTú, "testpackage")‚c¹"%s/%s" % (,,¥ } ûK~F@def Ä_*ƒ_python_Ò(‚"½e email[,Udir =Õ0dir!(+.�ßY .requiresW¥vAccess(NN°42nð$# Check for a couple of modules at different levels5theG™hierarchy=s =K %$}J'Sñ/__init__.py', P^{> ™mime/text?~ �filteredJF‚]*mª®ñ # first make sure that the û folder gives error messagesH1(on7àbadsyntax_... ‘s£×Pcaptuabstdoutø re&>SIOžÁÆAt” ÊIO.getvalue(ˆ+qTrue('S·EåÚB'tr”j#è1n c+/3s works cwhole  0À õ2 zipfp.writepy(packagedir, filterfunc=lambda whatever: False) ÃreportStr = ÊIO.getvalue(-ôself.assertTrue('SyntaxError' not inFItr) jð# then check that¯ð works on individual)esC0def©ter(path):Ôareturn‹0os.%’.basename3ú.startswith("bad"âô captured_stdout() as×GIO,  Warns(User ?ing”¬· ��œ$if£.treprint(Q hÐ׌Qtest_…_9à_optimization(V imie email·¹4 = ±1dir°+–.__file__³Y .requiresWgAccess-õoptlevel = 1 if __debug__ else 0‹Æext = '.pyc'¹×0 Te¼raryFileEt, \;y’‘ile.PyZip)ƒt, "w", $e=ŒP ©Õ I1s =r p.Olist«AIn('Lð/__init__' + ext, =s-É^ä9œmime/text: üpython_directory öos.mkdir(TESTFN2€:tryTopen(Djoin9Á, "mod1.py")lY*fpDÕ,"(" k42)\n"Xm2m"? * r(?txtàCbla âÎ|¿SV°Îvf± -|€Compiled„å'°8 °83NotkV2.txt4Îkfinall¡drmtree‘Q Ñ_teredÀ û+ with open(os.path.join(TESTFN2, "mod1.py"), "w") as fp: ù fp.write("print(42)\n") )m2m"? * ráTemporaryFile(Ãñt, zipfile.PyZiptãæé&py%þfilterfunc=lambda fn# 2°not fn.ends+P('mod+')I<qnames =È p.ilist()r)ñself.assertCompiledIn\Ù0', <s8 3Not3�3lzfinallyõdrmtree'Ñdef test_/p_non_py‰(¨)B »3KåØQ, 'w'fp+fà!àst definitely ž�a python ²'4ÀhòRaises(RuntimeErrorq&Bpy, ‹ Ccunlink21-¼_bad_syntax8ƒos.mkdirF2b+tr¡ý5BBad —8 in, à3·#xenas are ‹Åed to stdout°2’captured_%"s1 7 Ã9&QIn("SÄ"ï", s.getvalue(ó#~qit will�chave cÕH thes#, + ö‘# include31.pyÏRM.pyc0!k0c 3c—Žd&×Olike*zœ'7 ³àpathlib.Path(TûESTFN2) / "mod1.py") ànames = zipfp.^list()óself.assertCompiledIn('Z0', <s8‰finally:rƒrmtree(T›ð class ExtractTests(unittest.qCase): F�def make_`_file(–)dAwithË€ile.ZipF$nf, "w",ÑIP_STORED) aspI&ð for fpath, fdata in SMALL_RZ_DATA15H0wri¤(r(@)Æ"_eõÄ—temp_cwd(Ý_ð.t" /r"ï=ó"9ñ0ten”Màý,#ÑÓ sure it was Kñ to the right place> scorrectz0os.²Á.join(os.getF,Ê +?C@normL(Æ–cEqual(Ä•/, @. rsuOôJopeny2"rbîf¨ø »ëÿ.encode(), f.read()ûhunlinkx)­©_¦q_targetô", ãŽßA©ÞÛ×"ÄÓÀØNÑ×ðï9 = Ó2Î:ʬ|Å@True>ÿP.same‹ä Õ*, ¥2¬éþåלáÝ4 göÝ õíÑéAdir(—jextdir®ÁJ3uÀef test_extróact_with_target_pathlike(self): $ö temp_dir() as extdir#*6»._test_extr^(^rb.Path(@1)) eIdef 8?all…Gcwd(ž{Bmakeafile()[Ä0zipP.ZipF#ÁTESTFN2, "r"×!pÖ=.Õœ \#Pfor fãð, fdata in SMALL_e^_DATAX90out”` = os.AÁ.join(os.getë,Y,4ÙSopen(JÎbÏfs?­ÁassertEqual(¶ô.encode(), f.read(£4dunlinktœÈ‚,H_allcÕ", pÄŽÀã„?ile¼4p¸y º"l ¶`±Ê­©$¥Æ›7FN2¾ † ½µÍ"  ‡§@ �‡/li«`check_¶Ð ×name, content&À@TrueÙ_0.is6(;)SX%a, 'rb'¢ Ó^Ç·‹ Vðsanitize_windows_~ȵPan = ?s/._<M # Passing á0sep±allows thisãõ to work regardless of platform.N Ú÷san(r',,?,C:,foo,bar/z', ','), r'_,C_QK÷a\b,ce|f"g?h*iLß_d_e_f_g_h_i'O ¢'../../foo Pba..rQ/�Bfoo/n°hackers_arc“ìs_common_cases¡4-E = [;â(‘u‡ À), ñ ('foo/../bar',  G), '*obar/..Q .v}oz /%�M.|x]üñself._test_extract_hackers_arcnames(common!) ?P@unit:ð .skipIf(os.path.sep != '\\ ðRequires \\ as "Ñ separator.')L@def K…à_windows_only(¶!)::Äò"""Test combination ofk³fixing and C Å� sanitiz-E."""M&ïE = [o¯(r'..\foo\b(‘\~ r˜?\..*\[~/C:Z@r'C:¤£?C:/)ÿ//conky/mountpoint`!\\8\8pq U� ,?r'\ƒ Jx?, 'J“JO//?/o\\?\C:€ C:¸ Z%C_ôgða:b\ce|f"g?h*iQüb/c_d_e_f_g_h_i'7'þ2foo Gba..û 3   e/', r' / )_posix Áäsº'ÂB ƒ Dím#..—Òp& Ñn.´Ànames(self, Óhacknames): pfor arcp, fixed E in .-4ôcontent = b'foobar' +C•.encode()`3öwith zipfile.ZipFile(TESTFN2, 'w',ÑIP_STORED) asp€Qqzinfo =TKInfow*ù# preserve backslashesž'Q. þ=Ð)ÿ external_attr = 0o600 << 162Ñpfp.writestr(j#, F)) 0‰ €ú.replace(os.sep, "/"\ðtargetpath = os. r.join('£', 'subdir Jsub'Dpcorrectÿ EDU5, *».split('/')Âë /r'× %3tenˆ1£p.extract(&, ’ ÅÇ÷self.assertEqual(Rtç,w; Smsg='~ÿ %r: %r != %r' %>°ƒ)¿»`check_(”ºt 2ermtreeç‰9 {Oall(u¶=ö Š¿os.getcwd()‹s Ž@8"4" %” xt8!Í?[0]GJ»Zdunlinkhð ) class OtherTests(unit—.CCase@def à_open_via_zip_u(p&óð# Create the ZIP¥Ehive" ?"w"ü˜RL"­{", "foowðself.assertWarnsû(UserWarning): ùzipfp.writestr("name", "bar").òself.assertEqual(;1’list(), [?u] * 2) >Pwith .ñ ile.ZipFile(TESTFN2, "r") as!p¡rinfos =.jZÍ©data = b""@for 21 ins[:˜pp.open(/‹26p+•%o.read(+0In(1€, {b"fooW0, b_Zfoo"}8*Ë#:•"fp“Π—9@def _ ð_extended_local_header_issue1202(cfbú1'w'o{orig_ziýÁ×þin 'abcdefghijklmnop'œzñ-oAInfo gÆ.ô.flag_bits |= 0x08 # Include an ï ï ï.EÁH_ , À L\close)ñ"""Check that theôqile is 2qd after'X—' block."ù:jwjm€fpath, fµ6`SMALL_¨__DATAr <@q?“IsNotNoneCPfp, ' pî–not open'D <9+'t  } u±R %ß_on_exception2!"ifÅC^`raisedß5theÉQ‘­:tryŒã2:!54Bad¢€…$ N 2§.2.á ¨÷ÿunsupported_versø # ?B hasÜTtract-ð of 120 datüa = (b'PK\x03\x04x\x00|!p\xa1@;' $b'1x{2{3 €]” d mc[ 0, 8HÌ_5\x06[C/H"1f �5') nõ(self.assertRaises(NotImplementedError, zipfile.ZipFile,@ µô io.BytesIO(data), 'rrá@requires_zlibEðdef test_read_unicode_m`names(¡!):+lÅ# bug #10801f+p = find:õ ('zip_cp437_header.zip')1LwithÔ(FA) asptxAfor f"in.Wlist(ž*/pp.open('ƒ).close(xó_writeô®²TESTFN, "w"´f±1zf._ðstr("foo.txt", "Test Îk 1¥"Ã@O\xf6A¹ZòIsInstance(zf.info9D[0].S, str!€õ rõtPEqualoao m öA 1®"µÖðexclusive_create_�† Ì"""Ž1 1‘ing a newiv5"""»runlink(ÿ2¾aÇ@ = 'P³Fócontent = b'hello, world. this is some '.9‹g2, "x" ’IP_STORED•;ipfI›§·,xÒw‘ €aExistsœ ~_3©(§Yo?rÒ£u$ 4, [ç]ßå; (3)­i.pe_non_e1ent9¼_for_appends±if os.path.3s! F9os.hã³—Àme = 'testfi“le.txt' ócontent = b'hello, world. this is some '5.' :Etry: Núwith zipfile.ZipFile(TESTFN, 'a') as zf59Àzf.writestr(=Tname,s)dêexcept OSErrorGñself.fail('Could not append data to a non-exisò@zip n6.')ÕHñassertTrue(os.path.6sÎ)1õ rõfÕEqual(zf.readþ)ÿ@def !ð_close_erroneous_Â(P)0# T¼0ó checks that the ˜^‘structor T$eq objectxŸÐ# it opens ifE€re's an †@r in:P. If.€doesn't,Hð traceback holds a reference¡ „ø and, indirectly,Mh¯. On Windows‚‚is causeâðos.unlink() cally91 be& ³¡underlyingâAtill". j÷is SF bug #412214�—*GFQ, "w"&fp¼q"fp0("tÈ"isÎ` legalb‹6\n" �@zf =+  �6R´3Bad �Bpass#‡ois_zipˆ @"""C~3�z"orÒ  identifieæ$n-–Us."""<@# - †‡aþ$[J].dFalse(/Ñæ)Z ±C\-like[\=ƒlib.Path;)j_ e/rbz�/fp~ èöfp = io.BytesIO()ìbí¦Æfp.seek(0, 0{Ghûpdamagedn } õ,!s …@missÃb ’£fraise € ýàCreate a validÙš3 aðwith zipfile.Zi÷pFile(fp, mode="w") as zipf: õ .writestr("foo.txt", b"O, for a Muse of Fire!")@<õ iledata = fp.getvalue() %ð# - Now create copiesN÷it missing the last N bytes and make sureK‘ a BadZiàõ exception is raised when we try to open itDÒ÷N in range(len(Ç*))�fp = io.B–(IO+F[:N] RÀself.assertRŒs/.³,ƒCile.ÄC, fp.@def ‡ð_is_zip_valid_fÉ[›â"""Check that /(ð) correctly identifn@zip Us.""" š"pa‚a 6namnLwith®(TESTFNVB˜íHETrueFè‡)€Ìf objecùÏÄ2"rb*fpö�'fp}ýÆfp.seek(0, 0—Ë‚contents'Vread(%¼\-likeÁ ŒA"fpÂ*_kÏËFÇË€non_exisþË_§ s_OSError(WÚ#÷ÅRdon'tÚÑ an Attribute<ëña partially-constructed‡## j� instance-ñfinalized; thisxsïpregressU×on SF trackerQÈbug #403871.é@The Qwe'reSÝr0cauœÃRto beá³Åaº3wasId­·fdid noñ!# yáÐe .fp member Dpnot ini7B but€eeded by“òð__del__() method. SiKº – is_6,Ki±‘ ignored,z,°user should�sufficienÊQannoy—H5 message on°r outputÇ@willTYnotic…quickly.WŽ{踄ñYemptyêý í1f = ’6'w'·`f.closLÇž»aÀpFile, zipfióle.ZipFile, TESTFN) ¢with open(Õ, 'w') as fp:&-õfp.write("short file")#ðself.assertRaises(zip$E.Bad€v‘ñdef test_closed_zip_rMÀ_ValueError(j)œá"""Verify that@õ#zip() doesn't swallow inappropriate exceptions."""Çödata = io.BytesIO(ã, Â(1¡, mode="w":# <>óstr("foo.txt", "O, for a Muse of Fire!"<ò# This is correct; calling .read on a 2 X� should =ÜF# a H„, and so,U‚÷zip. An earlierDpversion¬.+! wnit°` (h–any otherO#�0repN¼rhe firs]ò in the archive waEupt.�  wâx%%, u�<<%pb´str, "bogus' n‹�· zfw (' 1ile  µ'™ @¯ðbad_constructor_§RCheck¦1bad40s p4Ed to¼J¹ are caught¦ºiöD, "qY »H´+.C­¬Š·+9Dxr± # 6,Ÿ‘make sureÚ”Óeްê™èj!½Owº=P# uni‹ñal newlines supM©is removedšy"Uv}E"rFŒy`0% ’+2(0)é`ZipExtÎð object returns an empty string óand doesn't advance file pointer.""" €with zip!ñ.ZipFile(TESTFN, mode="w") as%:8?7ù.writestr("foo.txt", "O, for a Muse of Fire!")?ñ # read the data to make sure”0 is )re;¶V.open{©f¦ª�ði in range(FIXEDån_SIZE)04ðself.assertEqual(f.°©(0), b'') ’2 1G@def G_Ðð_non_existent_item(�¨ð """Check that attemptingDPcall G"()… n C+t³f†ÿ archive raises a RuntimeErro67ËXRiA(Keyc,dÓ(, O#r"n'ðbad_compression_ª% Gbad 2  methods pãd9þ€' aricaught7ÅçNotImplementedÐ4ileY , uZ|"w", -1שunsupporteß Ú#1°is declared¡õshrunk, but actually deflatedòk÷= (b'PK\x03\x04.\x001 ‚e4C\xa1@"'I?#b' 2J VHx|0†1W2š3IŸƒ‹XN ŸH X8( Hxã_5\x06W/W/5!  'XvÀ(io.BytesIO(þa), 'r'+ þÙ)D, 'x žÐnull_byte_in_ÆLnameŠģ(€ containÏ a K K …properly„`terminà ž{+Õkqqq", bÊH>k.à£list(), ['1,']Ïstruct_sizes7 ðZIP internal structuóre sizes are calculated correctly.""" ð self.assertEqual(zipfile.DÿEndCentDir, 22)521ral5/465j_64, 57!`Locatoª10) «ðdef test_comments(î!):ä"""Check that &à on the archivóe handled properDH1# cGedefaulJ• is empty)Twith bñ ZipFile(TESTFN, mode="w") as%©­¼ ª.µV, b''l0g@.wriór("foo.txt", "O, for a Muse of Fire!"6<¨r¨r©rª<Õa simple shorC'èð" = b'Bravely taking to his feet, he beat a very b+¥ retreat.'Oá‰Y� [@#|7š{z«é~¥max lengthÕñ2 = ''.join(['%d' % (i**3 % 10)Wö i in range((1 << 16)-1)]žM ö.encode("ascii",©2Õoª @œ«&­ ¸°is too longrPtruncò¨Dä{ Warns(User 7ingOPTÀ$ =X¦2 + b'oops‡.,u�wáh]ÆPified`appende� Xðb"original comment"  ô$zipf.writestr("foo.txt", "O, for a Muse of Fire!") ;Pwith @ñile.ZipFile(TESTFN,mode="a") as$:7?6ó .comment = b"an updated "1hrhøself.assertEqual(y,x%) zÄ# check that˜ðs are correctly shortened in append þE¿w¿®'„original�š–'s longer3dÚo r²¤×' uÔ@def é“_unicode_l(()£› Q "w",Ó÷ŸIP_STOREDê †#ÅŠžÆ÷Raises(TypeErrorµ/ 5Ð"this is an e3"à Uchang ÿ_in_empty_archiveaØRFalsež†filelistiÖb×Z/ "V'Js XL?nonO(kUg9Ô Ë/ "Õ%?TruÔ°¿ 7# C" reating a Å¡'w' or 'a'� and clos&u5out)P# add1anyA“s to the ‹0s cb±es a valid œA ZIP0J­& =¥ÑÀ(TESTFN, modƒe="w") ¶zipf.close(Etry:")&0 = ÷ ile.ZipFile(TESTFN, mode="rWeexcept13Bad4 Xñ"self.fail("Unable to create empty ZIP file in 'w'k5") ž“šaš1ñFÞ*aÞádef test_open__ (5)jð # Issue 1710703: Check that ;Ring aD�with less¥n 22 bytesM¶# raises a ² ̲ion (rather>÷ the previously unhelpfulNvOSErrorY1f =”:7'w' ˜ë�.assertRš(¿ƒ ,fc$, ˜3'r'+M]ü_zipinfo_before_1980X|QValueÒ,å ¢ñZipInfo, 'seventies', (1979, 100, )¥C_°ü_short_extra_field©‘"""If an $ $/¡—header is÷4öÕ, skip it."""еzipdata = (àþb'PK\x03\x04\x14\x00û93\x9b\xad@\x8b\x9e'Gp\xd9\xdI1A $e,abJc?AŸB2Ÿ3B DC·§M$q2](Pa4\x8¹0PL50abïê\5\x06aAY1\x0I5% B—† dP(io.B< IO“30), p1 as-¡?#Ë zip return‚ e name of ªÑfirst corrupt¯™, or NoneB— Is€ f.*Mzip(Lü_conflicting_handlesFó# It's only possiŽ@‘ one writ£… F– at a tim¤‘msg1 = b"O1funÓ`harter¥¶accountant!vAmsg25�And sailVwide 0I sea333ñTo find, explore;�funds off>Ðe" wiöth zipfile.ZipFile(TESTFN2, 'w',ÑIP_STORED) as7: #wiLñ.open('foo', mode='w'5*w23>ïw2.write(msg1)R =barR1R‰þself.assertRaises(ValueError)4мhhandlem ™.ïf+"*r'üc.Upstr('st7o'abcdefB0(__AP__, ' e=oclose( 1;2žÑ8bazÎÂ� 53) õO(rßp [ `Equal(#R.read >), ÷5 5 ñ5 "z'53&5Ónamelist(), [Ç'y0, 'H]ðdef test_seek_tell(Q^p# Test å functionalityYõtxt = b"Where's Bruce?" ñbloc = txt.find(b"""Èr# CheckePon a ƒAºQ, "w"˜– ¹]C "foo.txt",Š|] r]7n^"4*fp�0fp.I(Ö, os.SEEK_SET�'‡ýw1fp. 0), ?2]-^>CUR,^ 0/[Z,?]Œ_!5)¬[7:>+5]?œ0ó>END(gQ†len(txt)6 “jmemory˜÷data = io.BytesIOà n1O·-Àwith zipfile÷.ZipFile(data, mode="r") as zipf: Awithô.open("foo.txt", 4*fp2=ù fp.seek(bloc, os.SEEK_SET)]+ð self.assertEqual(fp.tell(), ?2]-^>CUR,^ 0/[Z,?]ŒÐread(5), txt[7:>+5]?œ0ó>END(gQ¡len(txt)) ˆÐdef tearDown(8)ËÖunlink(TESTFNf ò2) class AbstractBadCrcTestsLd°st_testzip_RŒ_bad_crcu1""";À that files 0ó bad CRCs return their name from ]A."""ÚZ0zipã0 = Û.|)bû5ile³io.BytesIO(I)-#ˆ§s¨¦!of Âfirst corrupá•, or None¸“² 'a"',Œï(É0st_Pb-£aise a Bad*ð exception when ej#ƒ# Using Y.J(]‰6?RÏsÄA.ÖKƒ#, _‚«0Ext1®F÷dŒQ, 'r'–/_ÁU¡ìDÉ ëSI‡Qsmallâðs (in order to exerc the bufferÊ_logicÂ@�”" îùMIN_READ_SIZE = 2jGmH 8TwhileÖ§c/(208Epass>gStored<(P`, unitû.%CCase`€compress¢="ÊðIP_STORED zip_withã_bad_crc = ( ôb'PK\003\004\024\0× \213\212;:r'0£\253\377\f*2005H00af2øilehello,AworldP}R1\002}‰…6r…(\01™t200\001±i/!leT5\006%171 b/,÷%') @requires_zlib class DeflateBadCrcTests(Abstract°, unittest.$aCase):…ñcompression = zipfile.ZIP_DEFLATED'�zip_withõ÷x03\x04\x14\x008 ˜n}\x0c=FAXKE\x1+ 0n,5 Ð\xcbH\xcd\xc9ÀW(\xcf/\xcaI9\xaV@=\x1§³0PK\x01\x02±3޹±Å¹7Å 8„œ La¥à 6S? 7þ1  k3bz2jWBzip2Th5_BZIP2e"¿c¿/nueÈ bðBZh91AY&SY\xd4\xa8\ Y 7fX£f\x11\x80@`6D\x90 X \xa5@rP\xd9!\?†S89\xa‰c2u5:\x9 ð\x8b\xb9"\x9c(HjTe?jïÞnh£>;KE84†¿> !  I  ¢Z9Ø 4ä Ç}L[M F OClzmaåOLzmaä@OLZMAã.eºã@\x1b¨ O"\t»0k$0]EÐÙà9I' b'ó\xee\x8d\xe9\x17\x89:3`\tq!.8\x00PK' öb'\x01\x02\x14\x03 00.@\x0e˜nu\x0c=FA=`KE\x1bn 5LC S \x80™1%Hafil=`ePK\x0d6#?3@> ð') class DecryptionTests(unittest.aCase):Oõ"""Check that ZIP d:ñ works. Since the library does notC¤support ens1 at/ômoment, we use a pre-generated1!edG|‘file.""" �data = ( û!b':4òi* ôn\x92i.#y\xef?& 1a L1\x0g 0,ðtxt\xfa\x10\xa0gly|ú-\xc5\xc0=\xf9yOP18\xe/ð8r\xb3Z}Lg\xbc\xae.ù|\x9b\x19\xe4\x8b\xba\xbb)\x8c\xb0\xdb/ôäî0ü ¥ì ü_"0 jb6\x81Qv-=ºè SLt `1' )!2"tDá cf}38xu\xayU e2Ž0\x0o�ׄ0zeroUT\a@3\xdb„RG\xdaâP92GUx<Te•43\xðc7r(f*Ÿm ipï¢ (bãO'w',�A) aspÅ›TÓVß'ones', b'111²7 32two3?2223  �ðf.getvalue()[:5], b«'abcPK') ñwith zipfile.ZipFile(f, mode='r') as :;J?³.open('ones459ðself.assertEqual(z0ï.read(), b'111¯; t?twot4a222') éðdef test_write(¯)Îðfor wrapper in (lambda f: f), Tellable, Unseek <ÃT“.subTest(N=l0þf = io.BytesIO(Ë"f.¬bí<bB€ufferedWÚ>r(fJbš (bãA'w',"•IP_STORED.pðÀóþ addCleanup(unlink, TESTFN‰4�(&R, 'wbd/f2g7%f2Kùp(^ÄIŒ/cT ŒÜ ŒH>ðf.getvalue()[:5]Bóÿ'møÿ%�7à&ÈÇû:¥f$§w@2 rF&lêáÀ self.assðLertEqual(zipf.read('twos'), b'222') @requires_zlib class TestsWithMultipleOpens(unittest. ÁCase): @6amethod def setUpCOC(cls*.ñcls.data1 = b'111' + getrandbytes(10000)J121¹12|÷ make_test_archive(self, f‡ó# Create the ZIP +EwPwith <öile.ZipFile(f, "w",ñIP_DEFLATED) aspEDPp.wri’ r('ones', “ ë/´/12) ¤éRp_same_fžS ãòVerify that (whenîÍð is in control of c@ing N† objectsž3# mð open() calls can be made 6Àout interferNÁ each other.¿ëPfor f„1getÂs©Ã&Ö.Óf™&ek ¯…mode="r"ž � ;.ס01ï2OSázA~5Õ%-Ý-2-Q1 += .1.  X+Y+`5ass1�01, 2/G41¡‚differenä ã/# ¦ÿA5æÈwù Ú2L ·oleaved¨¡À f in get_fiÇles(self): ù.make_test_archive(f)&ñwith zipfile.ZipFile(f, mode="r") as ]h;Â.open('ones'0126‘data1 = z$š.read(500–) c8twoc2c:g2g2g 1:1 +™–/2/a/…ÀassertEqual(˜11,  42412) ÄAdef ÜEÌ_after_closeÐfor f in get_ê1-ñcontextlib.ExitStack(ûs —É g#'r2>ipf6i(1 = Z1.enæ€(¹ ~NDD _D©M1M)hµÝ)n'f Jb0^Owrit^$1w',a±IP_DEFLATEDOá.Œ3stry 1 2é222° `º–j±Þƒ j[:500]•‘)ªC ‘2ipf¹¨B³*¼*' †¼0o ØÎÙÍ#.?"w"oP~=6_ «ÊÀritestr('two÷s', self.data2) ñwith zipfile.ZipFile(f, 'r') as:2=I11 =Ê.read('ones'\*2*outôd(opt, l‡1‘ Û'.rÐADoneÉ7ing�N º‘wtar.tar+‘×X¦¢i_list_i.@Æio.StringIO(‰@withF¦”.ZipFile(°Ê, 'r') as tf“Ötf.printdir(tNðexpected = t.getvalue().encode('asciiè÷backslashreplaceZ Ï --,“òPYTHONIOENCODING=¤:¡IÀÿ!) z@Öas_zlibAocreateÚ_ö ddCleanup(unlink, TESTFNp¾Ropen(B, 'w± °�f.write('Î' 1oPos.mkÇB6DIR_ ‡drmtree‡ +Š´os.path.joi—aDIR, 'c_txt')§2§=Rs = [§„]Y•u*'g + '/'8W.”F €c­"--® ‚:try„¬º@2, *vsg8o’ 'o·a±z5 d4zf.8ì ž>Tread(71[0]1 g>„ F2FBofinall{% 2„qÀst_extract_cóommand(self): õzip_name = findfile('zipdir.zip')*ö for opt in '-e', '--extract'PWú with temp_dir() as extdir'+`out = ”n~”cmd(opt, š,=Š97÷assertEqual(out, b'µ'“0zipbP.ZipFèb¢.zfž:÷ ziöÇzf.infolist(B% path = os. b.join(ÿ,L0 0zi.¦•Ð.replace('/',RNsep)B‚if zi.iswÏ,<TTrue(¯ is´ºiOelse_%Ü(` ¥²Aopen-a, 'rb'©¨4ݳf.read(), z ¡zi)) if _ÿò__ == "__main__"Þ�unittest.ð'() from __future__ import annotations USING_STRINGS = ]ÿ # dataclass_module_2.py andA_strø"re identical # except only the latter uses string‹". °z$es±’, InitVar+0typE×C¯” T_CV2 = Q[int]3Q T_I(U' IV'5 @ 2 CVog4QÐJcv0:yQ = 20K6cv1D = 302: M2&33rnot_cv4À4 # When usûGð, this field is not recognizedÜaŸ.ÝIÝ IVÝÜiÜ-%1:˜Ð"IVÐ!ivÐ&IVÐiÐbÐ0n~ð. # # Test script {0curvÌ&&&ðdoesn't actually displað0ythhðvery coherent. but it'ñoes call (nearly) e,amethod1@funcmžFš®ð ed: {def,reset}_{shell,prog}~€e, getchð getstr(), # init_color() # Og‹1ed,ö\€getmouse@&unC # ;$os Qy  l¶mA.supaV“requires,ÈÍð ule, verbose, SaveSignalsuÐOptionally teðst curses module. Thisò rently requires that the # '4ð' resource be given on$p regrte^ñommand line using ð-u # option. If not available,h,pafter t“B@willmô executed. import inspect ¯(¤@) #a�either of€ðse don't exist, skip ´2s. à2 = ^!_mTƒ.ascii')” 6ó.textpad') try: _nñses.panel except IØRError,•pass def“_§²_func(name)*°return unitÐ.ÞòUnless(hasattr(:!, 6,Œ�'VªR%s' %=ô term = os.environ.get('TERM'~1new'pwas sup³ñed we could use iÅ@tead¥€initscr <iexit @Ó0If(X1or Ï== 'unknown'× "$–�=%r, callbi�() may ca‹m1" %S)v sys.platfoù¯= "cygwin"q'RgsVñ just hangs") class TestCŒ(ç asÙ¤@+amethod`setUpCDC(clsÊiW¯À__stdout__.i'y((,@# Ter3ary@estsÏqnon-ttyo*Vraisea@Skip«*('l0 isʉ a tty')Cõcls.tmp = tempfile.‚ZFile(/Sfd = 4..'no"Belseüž+y = NonezK ©R# !Psetup] ()fCide 4u/endwin]#?s8Æinal breakag€x.Tqfd=fd) DÞ�tearDownáèý\.closI4delHvCW(selfò.save_signals = SaveS *7!Œif verbo¦!# uto make‚ð output a little more read,äWprintj‹ td<=¯°'ˆsavetty(� p 23res2~ cŠ?p.restor‘Ãn‘st_windowÇsw"Xös1!s"G„sñu0win<[ð.newwin(10,10)  òwin = curses.newwin(5,5, 5,5) $m win2'D15,1)*ö for meth in [stdscr.addch, Ustr]:3e7Aargs7�('a',), œ‰A_BOLD),7;�(4,4, 'a';ÄH @ x=ðwith self.subTest(Á=ð.__qualname__, ¢=)¾F3!(*! ¨ÛÛUclear�clrtobotÜ4frtoeol7…ursyncup_delchF …deleteln4Uerase�getbegyxE &8kgd68key?maxEXparyx7/inË ginsertËFinstVßis_wintouchedÐæwin.noutrefres¤Predra �"×ð£…standout6&en*±Odown�H ×Ä&wi´u×;winÏËÀ£&()·‹0addV¦('1234', 3",s3 1¯XÊ' ] ^cttron(Ò6%/ff&?set& �bkgd(' '³REVERSE+jGJÛÌÿborder(65, 66, 67, 68læ69, 70, 71, 72‘Fp'|', '!-/_'J '+ \\#/ ‘ as®ÿRaises(TypeErrorRWð msg="Expectedˆ.ä`) to rO N"ØÍw&[] ^x[70"x((_û÷n.box(b':', b'~nå6x, ´p:2ðx() stdsócr.clearok(1) ÿ win4 = stdscr.derwin(2,2)" Š1,1, 5,5'3.mvB79,9e^Æechochar('a'9ý, curses.A_BOLD,·hline('-', ‚IIÍM ! Q'~2idcb`Z:idl²if hasattr(;Õ, 'immedok'):WG .¿ 0.Žinsch('ctˆinsdellnSOPnsnst«obc', 3V !   Q58? 'aW ' ] ¯®?defç J§,O #U s_²Žtouched(£okeypad‡Zleave9òwmove(3,™mwin.mvÀ0nodelayd˜notimeout�win2.over46winowrite(6a, 1, 2I1, 3HH. Æ`redraw²£ [scrolh9(Ç ð .-3È{1×O×etscrreg(10,1�Fwin3h0sub¨$ $4M<@sync;ÿ and not sys.platform.startswith("sunos"dF #†Öß(,í v:/'add†STANDOUT~_chgatK!(5™3ZVBLINKW¨2 , š +G5, 8ZŸUNDERLINE^õ ‡ƒŽrefresh(‘(¦ JÀ stdscr.vlóine(1,1, 'a', 3, curses.A_STANDOUT) õif hasattr(stdscr, 'resize'):&-.…(25, 80)"HoenclosIw(10, 10“óself.assertRaises(ValueError, ‡·getstr, -40†;2A "in{2ÿy8x2óðdef test_embedded_null_chars(Xˆ”# reject , ,° bytes and 6eactersš10 = L.Áfor arg in [/Zb'a']ùCwith=çubTest(arg=arg™!d¼ 1addAV'a\0'D@D†E?, 1H$?insŒ.K†ö.BUTTON1_PRESSEDó"if-Z == 0¦ ¾XR stufþ…KòV+§interval(1èò# just verify these don't cause errorŠPUE(0, nàmKç SpanelÐd üuserptr_without_set’wj0new½H10, ùp"eQ.new_ &(w’ó# try to access {ö() before calling set_ð-- segfaults  ñwith self.assertRaises(curses.panel.error, 0ùmsg='userptr should fail since not set'):I#p.31() ¢@requires_„q_func('Š!')#“def test_;Ð_memory_leak(ÌdBw = Iâ.newwin(10, 10JÎp"e(_ &(w&Öobj = object(ö nrefs = sys.getrefcount(obj%÷for i in range(100¡ƒ5.seÎ<éFNoneYì¸oEqual(‡!, ¥À"~ Eïed references"™(�segfault– zšzclass AW#|__del__|Uã y ] 6A()|?¹Å4newëT °Â,1éQTypeEàa type(ƒ)ó üis_term_resized–  ÐŽ &*œ`stdscrKPmaxyxqQ ‚Ž †‚"~( } |á2tâ“ lines, colT)dLINES,ÅECOLS0;42 = 9- 1KR+\¨L , 9š�"jA�2� 2Á c¯Òœissue62438pËungetch(1025lL;?keyN GC_wch¹ò# XXX Remove the decorator when nñ on OpenBSD be updatedqP@unitÃq.skipIf‹ðplatform.startsl¿("openbsd")’"b#'sôð (v.5.7) has bug’”5Î 5mÀscr ôencoding = stdscr.# ñfor ch in ('a', '\xe9Qu20ac ÅU0010FFFF'):9@:try"chf$e(m)5ðexcept UnicodeE£oeErrorKyontinue@uÿurses.unget_wch(chvE}Ÿion as ert¶self.fail("N@%a) „ed with Ú‰ %s: %s"¡l% (ch,€,})£FreadªÉ $žÀassertEqual(5 , î „[m = ord c+:odefUŠ-ðdef test_issue10570(¾CCb = Ždtparm( öigetstr("cup"), 5, 3¢F.ñIs(type(b), bytes) }© {äï:¹pimport D%csK5M2.lookupÿ<¿¢Raises(Typˆ—NÆ%10�¡#otypŠ`check()«, expected¿Bwithj0suba(ch=c,^=: 0 ²QEqualb7(i)e•0æ4c45FiC›range(256†c2Bhr(iôaÚb = bytes([i] T´.isalnum, b /()54pha5?pha5Rdigit5 5Rlower5 5Rspace5 54uppj 5ŽZ?ÚŸ, i < 128;@meta0/>=1@ctrl17< 3¤‘'cn0p or i =k7œ€blank, cwC' \tOl Àscii.isgraph÷, 32 < i <= 126) ò check(curses.ascii.isprint7=8ðunct, c in string.pouationy[xdigiB"he5s) ºPfor ifü (-2, -1, 256, sys.maxunicodeE+1):Büself.assertFalseŠalnum(i)¹6?pha6ù6_lower6_space63upplETmOctrl5n6!_blankl_graph6Y6D667±¼ ƒmeta(-1)k‘def test_(>C9 = =paEqual(Ö('\xc1'), 'A']_� -A*4ord[1), -A'Ì[lË ÊÉ1('J›/\nÆ *$0, 'U @U0Uâ4J')í] º-lt¸,ltì?alt–Aalt(¹À?x8a˜ ,±äW ¤l, 0xc1½ø,rlÀ Ão 1('a^Å +È£ +;V; + + +A\x7f./^?/n-ðJ') selóf.assertEqual(unctrl('\0'), '^@') ?sel-€ord('A')1A0"\n1'^J2ÿ# Meta-bit characters€Q'\x8a¯!N°R'\xc10¯câdh5iñ if __name__ == '__main__':å�unittest.Ä() import os &sy $sldpprint”threadingðurllib.parse # Re�÷ HTTPServer to _Pso asòavoid confusion with89Ò. from http.sK²(O(as^,é`Simple%ÿRequestHandler, Bas") k d0supð here = os.path.diráó(__file__) HOST = 2.— CERTFILE:Pjoin(Nò, 'keycert.pem') # This one's based on ù—, which ibsocketr class2>(t1):  de!pinit__(¿", @²_address, h*_P,žRtext)A©W?.__L è0conY$ =c¢3str¡yñreturn ('<%s %s:%s>' %ؘØ"._Á4__.&Z6# &))¨Rget_r`u¬À# override tÙ‚to wrap ´ê5SSL½6trybœ) , –Y¦et.accept(N.dslconn+\.s_8(î–side=TrueG exX€ OSError¢e’#½e!ñ s are silenced by the calf1 m ðç¬%if)kverbosh$ñ sys.stderr.write("Got an |·:\n%s\n" % Á8Uraisen1sN)nRooted"(;Ý`# need¾á�ranslate_ òget a known rootXð# instead of usingTÀcurdir, sinc-!e …rcould bÍa# run AanywSæ½1verA@= "Tí{Q/1.0"%‚& =‰1# Ay@hang…swhen a Ê÷ gets interruptÜQlientR¶timeout = 5tÀth(self, patSh): ó0"""Translate a /-separated PATH to the local filename syntax. Fþ Components that mean special thingsKu systemŒð (e.g. drive or directory tõs) are ignored. (XXX They shouldGöprobably be diagnosed.)­5"""-ð# abandon query ýemeters#ñpath = urllib.parse.url (L)[2].0os.P.norm (?bnquote>)<€words = 1®.split('/' Ñfilter(None, 5$<Å = self.root]1for,1 insÆwN4 = ¿…(hg3Ohead2-˜YAjoinÿAYareturn²ðdef log_message(Ú÷, format, *argsÐÐ# we overridezx€suppressI€ging unl†"verbose0if -Cort. 'õ'sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %…7 Ó.G@_add±,: ç :Oport7ÿrequest.cipher()5Šÿdate_time_string;®%¬ò) class StatsR†úHandler(BaseHTTPá°"""Example $ Â" h=r which Bñs SSL statistics on GETP8!s. HÁ_version = "¢kfS/1.0"‘ado_GET¹ó, send_body=True¬æ@"""S a{¯.qEsock¯``.raw._”$pcontext'Cock.ä6{5@'sesÇ“_cache': 7.7 »' 0': ‚A'comO5ion* T}˜$ßrprint.p(‰%ç.encode('utf-8 .wÆresponse(200D ¤Per("CD°nt-type", "Q /plain; chÔ!t=f"FðLength", str(len(®+));€&s(b3 \´w\#¸qdo_HEADvfgÀelf.do_GET(sñ+end_body=False) def log_request(self, format, *args):*.öif support.verbose ’BaseHTTPRN�Handler.a � class <ñSServerThread(tBing.&):¸ƒ__init__µòcontext, host=HOST, h‚__W=NoneÎì€.flag = çs‡( =• ((\U, 0),-ø }  or Rootedå !MÞ)x¥‹1 = ±._, F.; TØdaemon = Truen3strmEñreturn "<%s %s>" % �"._uÈ__.__name__,¨€Estarz?lag¨ ¯×J_1run’µÈ1elfý ÂJeV.set(?try)lsÖ_forever(0.059ofinall= ‡r_close(·Lstop¸župhutdown4 Dzmake_https_#£(case, *, =Yÿ, certfile=CERTFILE€íI $if^1 isG(w¡ósl.create_default_ò (ssl.Purpose.CLIENT_AUTHBõ# We assume the»tñ ains both private key and'qificate-l`.load_ÿp_chain( m6 òv(A\ W=46 = jDEvenBZ.Ÿ*4D.wai'Æ‹cleanup(®v ðsys.stdout.write('<Bping¼ 2\n'w®.)æjFjoiniþi(i–S.addCêòœOŸd if ?â == "__main__"f imè‚ argparsí 5r = .ArgumentP$!r(ùdescription='Run a test65. '040'By=Ë,›ðurrent directoryÈ#d.yšü#_a“ ('-p', '--ÉÄ', type=int,^_=4433¢€ help='=ñ to listen on (hÀlt: %(defaulñ.t)s)') parser.add_argument('-q', '--quiet', dest='verbose±fault=True,GK ñaction='store_fal<ähelp='be less T� s�@stat �Ause_‡_handler—Fk˜0truÓ—áalways return `_ page-  -curve-namIŸ_�type=str“'(¦] ]ÿ for EC-based Diffie-Hellman´ VipherPc®†‚allowed :_ lists !dh¤K`dh_fil/n /@PEM Cà containing DHÏ@ametÚS`args =çîéAs() ¹ƒsupport.‰0 = 2#"if s:÷„P_clasoS¬‚RequestH ,Oelse6¯RootedHTTP; gò.root = os.getcwd(ò exÑssl.create_de²_(ùPurpose.CLIENT_AUTHBò .load_cert_chain(CERTFILE&ŽëÚg¡.set_ecdh_%([ 0 HE‡’dh_paramsE- BŠsB‡? €erver = {!SSR(("",ø 9), ä,x:ext‚F‚Áprint("Liste¤ð on https://localhost:{0.e‘}".format¥)[s�.ð_forever(0.1) im5ð unittest.mock from  á.„builtinsª4lib$io o&dshutilósubprocess py_uuid = i.xð_fresh_module('$Ñ', blocked=['6Q']) c @U>S defëPable()€2try ;#__˜_#�ìËfexcept9 T2 âÂBaseTestUUID+ár = NoneY˜ˆ_$S(self—uPequalô°elf.assertE‚!`ascendÕE= []ïó (string, curly, hex, bytesð_le, fields, integer, urn,  ñtime, clock_seq, variant, version) in [ -3('0- )',50 '{ 1}7 1Ob'\0 2/I(0, )í0¤'urn:uuid:Ëö  ¡kPself.Dû.RESERVED_NCS, None€¢ü10203-0405-0607-0809-0a0b0c0d0e0fg¢6¢6kjih ¢þ&x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\x0d\x0e\x´#b'BJ31\0HPHPLa(0x000Ë@, 0xÏ‘607, 8, 9A v4@<  y°Q0x607jv _809, +ÿ2d9e6d5-9467-382e-8f9b-9300a64ac3cd+6+6kjih ßð2\xd9\xe6\xd5\x94\x67\x38\x2e\x8f\x9b\x9Iþ0\xa6\x4a\xc3\xºRFN9ƒNVNVR7×�Ûß 8f!9bS=FB> =9ÂP0x82ej0= f§=«FC_4122, 3®°('12345678- - 66 66 häû12\x34\x56\x78'*4>$"78 (0 D*\x v4(0x¡L   12 34  Z F"  Ê\)^À678',  �0x6781234€5678, 0x ò, self.uuid.RESERVED_NCS, None), @ú('6ba7b810-9dad-11d1-80b4-00c04fd430c8'5? '{6}76kjih ð.b'\x6b\xa7\xb8\x10\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x3 ºRFNV^dVNVR4(0xׂÛß 80 b4ë ˆ FB>  „@urn:å:ÂP0x1d1j= ¦<«FC_4122, 1­51s56 5® fã×51ß5,1ƒ5=1y‰ß55 Œ Z 5¼525"6 52ZV M Û 525225C2%Ûß55 Œ Z 5¼545"6 54ZV545245À9d\xd1\x11\xð 80\xb4\x00\xc0\x4f\xd4\x3X8', ð(0x6ba7b814, 0x9dad@11d1 80bÛ00c04fd430c8)GFB>H80b42 1¤'urn:uuid:-:-;-<-= ¶P0x1d10=¦Pself.WË.RFC_4122, 1­ò('7d444840-9dc0süb245-5ffdce74fad2s/'{6}76kÝih òb'\x7d\x44\x48\x40\x9dËð11\xd1\xb2\x45\x5f\xf¾e\x74\xfa\xºRFN4^VNVR4(0x×yÛß b2 45ë ˆ FB> 5Â5$c0=  32¨7ðe902893a-9d22-3c7e-:Ý-d6e313b71d9f{676kjih åâe9\x02\x89\x3a7þ22\x3c\x7e\xa7\xb8\xd6\xe3\x13\xb7\x1d\xºRFNV^N7NVR4(0x×{Ûß a7 b8ë7FB> 79ÂP0xc7ej=  27¨73¯ÿ('eb424026-6f54-4ef8-a4d0-bb658a1fc6c7676kjih åPeb\x4RÀ0\x26\x6f\x5~Àe\xf8\xa4\xdUþb\x65\x8a\x1f\xc6\xºRFr02\x^NVN4‰R7×{Ûßa�d©S ˆ4 0x‰B> 7ÂP0xef8jv¬ 24¨74¯ð('f81d4fae-7dec¥ô0-a765-00a0c91e6bf6nÀ '{f8ø1d4fae-7dec-11d0-a765-00a0c91e6bf6}', 2'f865432 1ðb'\xf8\x1d\x4f\xae\x7d\xec\x11\xd0\xa7\x65\x0 ÿ0\xc9\x1e\x6b\xf6RFNV^NVNVR4(0x×@, 0xÛß a7 65ë)FB>  1¤'urn:uuid:Œ P0x1d0j=  27¨Pself.YË.RFC_4122, 1¯°('fffefdfc- Lfbfau '{- 167l> 0dfc2 h7ôf\xfe\xfd\xfc\xf(7 ºRF&VF ,4R7Ç0dfc{Û e(ë ˆ0 0x:;&7-Âoer= g3ffe, 7ûESERVED_FUTURE, None¹Afüf ÙA 1@?fffA hï[f'*16>Ï]  Ï ‘1  fèÏ O3fffÏ)]:êùequivalents = []ù!# Construct each UUID in several different ways.=Pfor u-[p@ˆ(string)¹^curlyw>v>v>v!<!<þÝusortingÚð (above list is®zv order)ý re?8ed f%:]d 0.re&e(²BÆs$, )iàdef test_excep gs(selfkðbadvalue = lambda f: $ð.assertRaises(V$†Error, f™0badu= FType<ñà# Badly formedå Ñ2Ÿ(�ð: self.uuid.UUIƒD('')) ÿbadvalue(lambda: self.uuid.UUID('abc0�12345678L9/89N2z²Mõ# Badly formed bytes.6 /=<6o\0'*15¤8E7)) §Å?_leÈ?_leË#9Î#;Ñ _field—0_=(1,)_6¿ 2, 3, 4, 5A.`, 6, 7G¯FÑ ‘ßs out of rang³®X-1, 0kõ À EC0x10K?, 0N"*, –E$–’J% ’E' ’J(’E*’"H+�E-�H.�E0�Û!00ψïVersion numberŠ$ '0ÉB6, vN/=0u =6ÙrInteger,¡ Àlambda: selfó.uuid.UUID(int=-1)) ûbadvalue(lambda: self1•1<<128)) 6õ&# Must supply exactly one of hex, bytes, fields, int.>ó h, b, f, i = '00'*16, b'\ I(0, E), 0> ¡hÌ ?ex=¡/=b> ?_le#Ý/=fDni7ÀWrong number,öarguments (positional)+obadtypž É* t.?, b1?, f4!:, i^¥Duplicate !õfor hh in [[], [('hex', h)]]:'à*(bb*Ö'Û ,0-le2?_le59(ii7@int'×g2Ÿ(ff6f/'G9 =ñargs = dict(hh + bb·le + ii + f™2 pif len(Ij) != 0= /� Qh, **P7  z1z.wæ# Immutability> object()) def test_getnode(self): @1 = d.uuid.))$òassertTrue(0 < 8ò< (1 << 48), '%012x' %�eõ# Test it again to ensure consistency.p\2”`Equal(5!1,{2ŒE != • "÷.# bpo-32502: UUID1 requires a 48-bit identifier, but hardwares½ò!# need not necessarily be 48 bits (e.g., EUI-64)ó£|1_eui64§ð# Confirm that *©P igno°—ðaddresses larger4An 48¤��ô . Mock out each platform's */ð helper functions¼greturnNësomething justvù!to‡÷. This will causeF Õ to fall ba£nòt_random�q, whichNHðgenerate a valid"uelþAtoo_Hãter = lambda: ÍM�with unitCõ.mock.patch.multiple(+Z)Ç,_œ±=None, # I°‘ any cach1,de¦Pü_NODE_GETTERS_WIN32=[¿]m 4OUNIX3  rªz    Êä1 can use the ¿H‘de, i.e.,ûY#®? fe- t() rathWusingMz¼value from eX abovD&ryD9ûE1m=NG€except Vf¯Error as eG`fail('Hò1 was given an inÑXC ID'W A ;eÔÆ2 ¼q# Make ‘v%()†ssC t ôöactually version 1Z¬for u in [ ) iªrange(10)]û¨·(u.variant,“†RFC_4122L·1‰:, 1 „ññIn(u.is_safe, {êP.Safe÷._?/unA.cknown}Ó}—Ÿ²sŽÀally unique.# ¥uuids = {}ðfor u in [self."@1() iÕrange(1000)]:;U0…s[u] = 1¡equal(len(¡.keys()), B (à# Make sure th ðpplied node ID appearsƒ UUUID.>Lu = ´%0)… u.L', 8ßx123456789abcE&RfR%/f)ïclock sequence" Ä  2 ) ÁA((u.‹ø_seq_hi_variant & 0x3f) << 8) | '9lowq8Š1, 0‡ ׸¥4Ò ¾q�ÃF3fff4hAÃ�3ý# bpo-29925: On Mac OS X Tiger,aó).is_safe returnsF‰ASafe©qunknown!ò@support.requires_mac_ver(10, 5ð&@unittest.skipUnless(os.name == 'posix', 'POSIX-only 0'@1def_v1¦(˜)³gif notÖA_has0á_generate_time=7J™dTest('É m=G(3)'Ð(¶\#FS) mayló 0 or -1 but what it2s iŠNÁdependent onZôunderlying platform “‘ At leasP0can"!be¸OÊ1 (u”" I<s¶Q–is buggy)¤5¡assertNotEuC^ 6;Ã@contextlib. qmanagerŸòOmock€{ , «g_value1"""?ÞMOÄ.EC) toc¦ a given *T*êT4if ·!·N Ñ Ç‘ö ._load_system_functions(FfÀ._generate_t£ime_safe Õif f is None:ôself.skipTest('need uuid._generate_tO%');ñwith unittest.mock.patch.object(WH?, 'J,J… ðlambda: (f()[0], ÙŠ_value))Ìayield Z@œÜðUnless(os.name == 'posix', 'POSIX-only Ìä1def_Ä‘1_unknown×uñ # Even if the platform hasDù (), let's 4a it to±O# be9Ñ() and ensurej tyÑ™.D™~a‚ÄyAu = 4î.&1(ì"ñassertEqual(u.isd,:“SafeUUID.—)�By �ú0÷M˜ôF un_ö/-1÷MšùCÂbogus_returnö3O <3¯e?pR+l # Œa some X° version-3 ^sîÑfor u, v in [j¾z ÿ.NAMESPACE_DNS, 'python.org')‹ÿ'6fa459ea-ee8a-3ca4-894e-db77e160355e?�ÖURL, 'http://”/Vÿ '9fe8e8c4-aaa8-32a9-a55c-4535a88b748d?•ßOID, '1.3.6.1Kÿ 'dd1a1cef-13d5-368a-ad82-eca71acd4cd?Š¿X500, 'c=caˆð658d3002-db6b-3040-ÿa1d1-8ddd7d189a4d'), )]:ÿequal(u.variant, self.uuid.RFC_4122)1Ÿersion, 3 IUUID(v)(±str(u), v) f�def test_‚ 4(�)±­" =¤passertEÀ<íÂ# Make sure CÀ) generates ‰òs that are actually vÌ1 4.…I for u in [„QiŸrange(10)U>4‹Ô5theÐdÐ ËfuniqueÈ´os = {}Û#0ÝRu[u] = 1TšQ(len(ã.keys()), 1000Ì Ü5Ü!ôTest some known¸"-5 ö¢@u, v¥[jÂzÿ NAMESPACE_DNS, 'python.org?ÿ '886313e1-3b8a-5372-9b90-0c9aee199e5~ �ÖURL, 'http://”/•ÿ4c565f0d-3f5a-5890-b41b-20cf47701c5e?•ßOID, '1.3.6.1Kÿ '1447fa61-5277-5fef-a9b3-fbc6e44f4af3?Š¿X500, 'c=caIÿ 'cc957dd1-a972-5349-98cd-874190002798?Ð>5ýu%$P@unit&ñ.skipUnless(os.name == 'posix', 'requires P…ˆ‘Issue8621ug´# On at leap"‚s of OSX‚ëH4”s # ¬s“€sequence=ƒ!inçparent and any;÷ children started using forkådÙ‚os.pipe(Ü0�pid = os./1if 6= 0S1öos.close(fds[0]JTvaluetòX&ros.writCA1], 7û.hex.encode('latin-1'”os._exit('OOelse¤1¤À sel÷f.addCleanup(os.close, fds[0]) ñ parent_value = self.uuidy4().hex1úos.waitpid(pid, 0PUchildO‚os.read(zù , 100).decode('latin-1') aƒøassertNotEqual(¦', dô) class TestUUIDWithoutExtModule(Base°, unittest.aCase):~ô` = py_ 5 @)ÁskipUnless(cñ, 'requires the C ! mp/')‘Ž$pãÊ™Internals»BNoneJ¼øos.name == 'posix'ÈPË@def # _find_mac(“(;ð'data = ''' fake hwaddr cscotun0 Link encap:UNSPEC HW$O 00-P eth0s T…EthernetVð12:34:56:78:90:ab œØ=vpopen =üòmock.MagicMock(÷*ð.stdout = io.BytesIO(ô1.enº)²KwithYõpatch.object(shutil, 'which',•o breturnJ÷='/sbin/ifconfig'�D…Ðubprocess, 'P‰a �O ‚%9macB@õ•command='Öoargs='±òhw_identifiers=[b'�/']Mþ get_index=lambda x: x + 1/å.“�ómac, 0x1234567890ab/=pcheck_nå: , $, 5=ª@%ifA and.@ is 'â^N.�½(†5' +CÍ0hex¦�%012x' %XŠúif support.verbose >= 2pÀprint(hex, eª& '^Œ�True(0 E_arpu!):_‡t0 = i.uuid.-H(!¬/ar­>lanscan± 1µ1f=netstat¹ 1¹1¹)nt‚Windows'h�ipconfig¹ 2R(2» øimportable('win32wnet')ßÃ"HznetbiosFD  1 Õoorandomn 0mð# The multicast bit, i.e. the le¡significan ñ of first octet, À@# muC¢e set for wøly generated MAC addresses. See RFC 4122Ku$4.1.6.]E±assertTrue(} & (1 << 40ê�%012x' % ã: P¶-2Ç·^ K…�NotEqual‰!2,t;, '„¿i‹ Eunix•ÖŒxif not ¿_”m') andwctypes'A T/áTest("neither Iò extension nor A` availv"%ò try: # Issues 1481, 3581:I_ ö_time() might be Noneñ‘œ › töexcept TypeError¥G Øñ! �à5 70, '�Š ÙE ÁÀe('ctypes'),ñ' 'requires ctypes') def test_windll_getnode(self):#'0 = l.uuid.0N+$`check_6(ù) class TestInternalsWithoutExtModule(Base"`, unit¡.CCase–†` = py_ 5 @)ÁskipUnless(c,ýathe C ! mu/')›˜)zò if __name__ == '__main__']¶ñ() """This is a™ð""" from __futurIóimport nested_scopes; �string; 5\Õ < 3f(x]3g(yÖÁreturn x + yAòg result = f(2)(4Äóest script for ftplibr ."Ôñ# Modified by Giampaolo Rodola' toQ FTP <ó, IPv6 and TLS # environment ýi‰asyncore4hatUsocke$ioEerrn $os•threadingrime trỹÁssl except I¨RError#£ssl = NoneÕ½æ&, Çÿ&0sup.!`HOST, ðv6 TIMEOUT = 3 # ²dummy data Ɇ€server o'!ðchannel when # RETR, LIa NLð MLSD commands are issued +ð_DATA = 'abcde12345\r\n' * 1000 I$0foo0bar ' `w ("Õñ=cdir;perm=el;unique==keVO1+ZF4;QZ"ÃØ=p= <d?3; ..:óOS.unix=slink:/foobaˆ JR4G4; N’chr-13/29Ò J5JodeviceJ¯blk-11/108K6K_blockJBfile<;awrŠ8?writablŒ]=cpm�7C¿promiscuousˆF „Ï1t2; no-exec=Å ÃE€�two word~ArIH4; lO spa–F1‡1ÄGðincoming\r\n"  ð"type=file;perm=r;unique==keVO1+1G4; p2\r\n" 4=3=)4=ñ) class DummyDTPHandler(asynchat. _ !):©ò dtp_conn_closed = False ðef __init__(self, ,a, basejFï[ d.=)Z1Q.J& =V#ö .last_received_data = ''­hðQ_read°Ÿ nK1+= %ý recv(1024).decode('ascii')i5 jõ2# XXX: this method can be called many times in a row for a singleÿ#oðection, including6÷ clear-text (non-TLS) mode.>ð(behaviour witnesâ‘with testAýbšbif not !6¿0Ãö.push('226 transfer complete'^9> tg = Tru”h|g, whatæ"if¶”2nexê1 isÖJNoneÆD ý9Q¹%0 = Y,C[ mbreturn¦¶_when_done( ksuper(Ç,6)gZ9.en ¡\error¡°raise ExcepZ 6F6 ã¢m/cw9?siz|L1000û/mkyž7 "%s"' %z/rm@O0 rm¹pöA7 "p÷"¼?typø000 (t?quip021 (?Ékclose(J?abo…@226 (T"?/st?@125 (??resÒ =˜tÉ`3Üw?retÕ–(–\"ifÃ{¶is not None&²offset = in¿.0ú?els20Ë2dtp#¢Pnext_•b_data[g&:]Y&4Ì�_when_donÖ˜#�! =º x/liq Y( X{%ŸLIST_DATAœô3/nlƒ(ƒ /NLƒ&Oopts¾000 (ƒ Â6mlsDÀg): ó self.push('125 mlsd ok') !2dtp%ŸMLSD_DATA!ñclose_when_done() Eðdef cmd_setlongretr(Uq, arg):$lð# For testing. Next RETR will return Be line.8L`.next_[ð_data = 'x' * int(f -ï”öð# class DummyFTPServer(asyncore.dispatcher, thread­T "):ñ•handler =FH„__init__ ÷ ddress, af=socket.AF_INET  o.E�¬+;Údaemon = True)rcreate_“R(af, Æ.SOCK_STREAMyNbbind(aÐ ‹listen(5Ûactive = Fals�w_lock =q[Lock(Hahost, …bport = ²0get ªname()[:2]ê´€_instanc�FNone²Qstart¯“¢assert notl¯ Zi__flag¾WEvent¿ ÚmM@.wai@OEOFÌ;R *a‹le_close#+…# TODO: $ÿdoes not expose alert informatio©ð"SSLV3_ALERT_BAD_`€IFICATE"R2erra/1]µ.Yraise1î/OSé ==øÿno.ECONNABORTEDž*NelseA‰ï�shutdownMÔ`Ï: " =Î0.unè TÎYBo½ r# Any " ðor" corresponds to as‚SYSCALL b ƒ{ñ# from OpenSSL's:Í'),[¹]DØ3ed •Pcondiy@. Se�.sobó# http://www.mail-archive.com/openssl-users@ý.org/msg60710.html‹Ipass|Çþ¡if getattrÀ¡, '_ccc', +B) is Ç¢super(SSLC¥Aion,©!). ¢nðpass d÷ef handle_read_event(self): 0if ú._ssl_accepting$/%!do(Zyshake()M)elOOclosM�shutdownL/se‡ñuper(SSLConnection,Á ).• ï%) žd_writeØð Asendk, data>try��return sˆUO~A ex\þ ssl.SSLError as erre ifÓ.args[0] in (8´_ERROR_EOF,KÉZERO_RETURN,y} QŸWANT_READ<%[WRITEAv40—Zraise¥Crecv“»buffer_sizeYš$\V ‘¡:PQ9b''Áo:, hRý`Õ ø$é™ëQe ó ~3! E8:ion(‡™ 6áif (isinstanceXu.socket2S]) andAÇV4ìobj is not Non�2_Ñ5ã") ùñclass DummyTLS_DTPHà #B"""ABB sub[`supporþ TLS/SSL."""}äC�__init__WÁ, conn, baseCk1 ‰.= ‹H\€.secure_YŒ_channel9À self.securõ$e_connection() class DummyTLS_FTPHandler(SSLC0,#!):?CL"""AB sub[òsupporting TLS/SSL."""}>Rdtp_hs" =G‰D‰+ðef __init__(self, Ò‹QÌ©.2¼1Jþ .secure_data_channel = False-E_cccÃdef cmd_authŸKlineŸ¢"""Set up sÃStrol v—Ÿàpush('234 AUTHJÕ successful')„51] òª?ccc©Gxr20 ReveÇÿback to clear-text�$?TruAádo_ssl_shutdow�™�Opbszžô"""Negotiate size of buffer for]Щ transfer.'0ForH’ð the only valid!ueGúparameter is '0'G“Any other6úis accepted but ignored5ìl—00 PBSZ=0â:.')hOprot! ’Setup un/  g`arg = ±z.upper(U1if "V= 'C'üÁ2roti@ set-C- (=ú }'el‡P‡!Private‰ ÄOelse ÿ"502 Unrecognized PROT type (use C or P)."‡tServer(ÎL4õ2 ~€TestFTPCæ( 0Cas’ jQsetUpF\•�”2FTPƒ¦((HOST, 0)!0g.start=ûclient = ftplib.FTP(timeout=TIMEOUTN2.à"ecç!.sq.host, Xa!ÔPtearDV$ ×YLlose§OGstopÂ# Explicitlyõ0�attributeß@prevâPdanglìathreadgçR6Non asyncore.c“R_all(4 =|ÛQcheck)´ù, received, expectedñÀlf.assertEquðal(len(received), Ãexpected)) õself.assertEqual3%, . .ðdef test_getwelcome(>!):P Mwclient.7ƒ), '220 G+')bsanitiz`5Ò'foo'), repr( ð£C¦pass 12345J*'A QLPASSQP*QFe¯exceptionseùRaises(ValueError, ~ÿendcmd, 'echo 40\r\n0' KI6r’ €ftplib.eß__tempä N:/99. œOpermœ /50œNœOroto� 9O „Aall_x „žI = (yreply, · ào9  )»æ"OS A1EOF ê–for x in º·~:tryr`E x('6Ð not includedP$G set.@7 +j\ |et_pasv # -õive mode is supposed to be enabled by default'î2Tru`. Vfserver:3#s“= #V0_FalseW ®â=0voiù1 ŸË#2›(&Ûø?¦5_ & N’1O:À 300') ódef test_login(self): ‚.client.!!) 7Oacct6  Œ'passwd'=orename? "‘'a', 'b')}�šúserver.handler_instance.next_response = '200';ñassertRaises(ftplib.error_reply, aû†&, ‡M_deletÈ "O'fooÅ&?199Å)ƒ#, „ Â?sizÀ  :try.ž£—cmd('noopxVñexcept (OSError, EOF ,(‚BTrue€.a# base‡¯RÌ ftplib.FTP(,8 as ×Ó~ÖEÓ&Wßk•—. (®Ö(Í[/Ý" 'B›Qñ�Z`# QUITŽÑt inside the qUblock*„–¬6pfð force a wrong response co{1o bAt onš0: e`U_perm‹#îÈ1and´Ü0ion¡supposed tT@Z üÞ* "ŠfHÀelf.client.sûendcmd('noop') ô2self.server.handler_instance.next_response = '550 error on quit' Páexcept ftplib.%€_perm as3:zvÿassertEqual(str(err),d¶OelseJqfail('E‚çion not raisedòð# needed to give th0rea€ some tiQo set%•attributeÄò# which otherwise would still be == r3U¦.sleep(0.1Ó ’ 0las’Ñceived_cmd, 'ˆQñFalse(is_client_connected()) šð def test_source_address(–)j.E.o(o port = sup Ð.find_unused_*6tryR7V›y�Qost, &Ÿ.R,¹@ Ì€=(HOST, <)¸=[ ‡|è€sock.get“name()[1]G ƒF5 1OSE5  @if e- no3úerrno.EADDRINUSE,²°skipTest("cvqn't binÙåb %d" %ð ©ø „_passive*1ion’ bð “8 = •¥ "Bwith`�transferÓ`list')a¤- ßÓ´�Œparse257›qð�0ð'257 "/foo/bar"'o*H` creatm?, 'P'�ˆ"€@R#s(ždreply,²%i, '250& `# The E"isûsY`includX·e directory@Ið and in case it contains embed�×double-quotes>�they mustc%ðd (see RFC-959, chapter 7, appendƒix 2). ó(self.assertEqual(ftplib.parse257('257 "/foo/b""ar"'), 'Oar')K(� createdSTðdef test_line_too_long(²!):"ÄÁdRaisesÂqError, õclient.sendcmd,=A Y'x' *50max�a * 2) :™@retrsž ~ñ('SETLONGRETR %d' % Õ.(q^Ñreceived = []‡¹Þ¿þ(, :rÈ0, ' 4', o|.appendú?stoú ÿf = io.BytesIO(bY �—Ñ š…0, ' ñT', f) @skipUnless(support.IPV6_ENABLED, "IPv6 not enabled") class TestIPv6Environment(TestCase): QQsetUp· Œñserver = DummyFTPSö((HOSTv6, 0), af=socket.AF_INET6êF{.start(¶3 = ¬ÿFTP(timeout=TIMEOUT2�.connect·.bChost&0 ðaarDown6 í‹l.close§OGstopñ,# Explicitly clear the attribute to prevent dangling thread})"u = None‚asyncore“°_all(ignore Y=TrueÛ_st_afÚ„pëMaf, »°@makeE XIwithÁ)Wà �Pôhandler_instance.last_°_à _Œ 'eprt' �kfinallNE^./d’def testT7€Default(.)%2# dð -- use global P3et tQ–>Ô.assertIsNone(3getI3&()4M $&30% &öftp = ftplib.FTP(HOST0 Aocke€ j¬<Ç’Equal(ftp 5getÁ(,  4Ý8waiÞ;y zv$no\yodo not€‘,·=ØRŽ4UT5.�m‹%^ValueŒ0a våyù INCr À ®(GH1ect=ÄoïDifferentOrderË‹=s Õï�TÏDirectAccessÇ£½ÕX = 30t.«3Ö#Àlf.evt.wait(3) ôftp.close() class MiscTestCase( !):4ódef test__all__(selfRðblacklist = {'MSG_OOB', 'FTP_PORT pMAXLINE @CRLF"B_ dI `'Error(…parse150 7227 9 O57',N print_line/Pftpcp ×%'}4Øsupport.checkï¥, ftplib, î= F$Smain(^Ps = [Q@FTPCk , ‹Timeouts°ÿIPv6Environment"DTLS_OSMixinT 6ß!] ðäthread_info = ú¢ing_setup(62try £+€run_unitæ (*s.ofinall2]’cleanup(*†Gðif __name__ == '__P2__'e`() """.ð program for the fcntl C module.(0 im×” platform$os estructyáQ from. Uø (verbose, TESTFN, unlink, !,/_— ŸWñcpython_only) # Skip{c if noâI". ð=`!(''Tá# TODO - WriteIs.Àflock() and `f(). Ê@get_EdataÍáos.O_LARGEFILEPñexcept AttributeÀ·Ûòstart_len = "ll"4?lse#2qq"¨„if (sys.½.Jàswith(('netbsdËCfree @open )�8or E]sdarwin'­&2if à.calcsize('l').8¨*@off_ñ1'l'Ê2pidieæ&>Fxxxx*BZŒ©ªb.pack(G$+ ;“+ 'hh', 0  b *².F_WRLCK, 05 el xT'gnukq@¨w'qqihhi”Äux  in ['aix3æ@aix4Qhp-uxf¶unixware7']£‰`hhllliŠ ö-6 U!'+•ß+}_ \!ifuc¸3if O¯¿#('�ý¤: ', repr(—îbreturn\Àata lockdatò.a = get_lockdata() class BadFile: def __init__(self, fn) ….fn = fn1afileno/+sreturn 2nðTestFcntl(unittest.uCase): S\setUpRKv = None,ŒtearDown/#if}ƒ and notv.closedÕÙ!()ˆèunlink(TESTFN)t@st_fÈ_þñ# the example fromÅlibrary docseØCopenlf, 'wb'‰ rvtq.wí3.f.~1), ö.F_SETFL, os.O_NONBLOCKH“if verbosñåÒprint('Status°Qf with Jv: ', rvQ™TLKW, ƒD•Mring•ë2LKW“vepr(rv)UVÒnßt»±_descriptorTÂà# again, but p,Ôrö rather than numeric IlV„? = ÚÑ} �È|1bad‡ Á¼„÷assertRaises(ValueErrorí¯ò`)-1òSf)}?(-1Âo?TypÔo'spam'Ø,i×qÛ0Ñ@cpython_only ®æœ_overflowïf_àòcapi import INT_MAX, !IN[îÕ# Issue 15989_Ot7 n? + @-rlzqÀl.F_SETFL, oós.O_NONBLOCK) õwith self.assertRaises(OverflowError):/6afcntl.á(INT_MIN - 1, ¿.F_SETFL, orBxBadFilez){ ¿ñ@unittest.skipIf(Ñð platform.machine().startsÅ('arm') and )õsystem() == 'Linux',OQ"ARM ò returns EINVAL for F_NOTIFY DN_MULTISHOT"‘@def ¢_J€_64_bit(žƒò# Issue #1309352:xõ shouldn't fail when the third arg fits in a«ñ# C 'long' but not Uint'.):tryRcmd =z.Ó.Uð# This flag is larger than 2**31iÙ64-bit builds>7sa+'ñexcept Attribute« ¥:îdTest("¨9 or~à unavailableŠÂfâõos.open(os.path.dirname0abs“(TESTFN))÷bRDONLYÖL @âE�fd, cmd,-s5kfinallyÑos.close(fd) 6Nlock/ðSolaris needs readéQ file’pshared =P°:Af = ýÝx, 'wb+' bleno =@ f.R7no(!*Z(ª…?_SH+/UN+¨ V# |™f/NB;f¼/EXV+V Y kBValu½Çf15, -SÈ.÷ F?TypEd'spam'ZI�Ñ@cpython_only K#_o T€import _¬Acapi<7 ˜ I‡á@.GFAX+1FO 3à ®Smain(#Drun_ê(øF…€) if __¼!__· __72__'4Ì3() àDcopy $gc dpickle4sys vuwarning tweakrefÑinspect from÷ x0sup`% 61 ýI‰ú"ð = None # This tð·ests to make sure that if a SIGINT arrives just before we send into a # yield from chain, the KeyboardInterrupt is raised in the innermost # generator (see bpo-30039). @unittest.skipUnless(_testcapiWïnot None and …hasattr(71, "�_ê`_then_Ø_I?"),Hu"needs G.E ð class SignalAndY*•FromTest(×qCase): vEdef �1(self):Û�return (yMw".2O2())I2I6tryVZRhnexceptÈ 4ކ"PASSED">?lse*@FAIL*+ëÛ_HAand_†\_from±jgen = í11()IÀ@gen.Ã(à è¾F(genD QBaseEºion as _excçQexc =˜²÷assertIs(type(exc), StopIteratiom0PEqual.„.value, i3) ^qFinalizDJX müframe_resurrecth6# A€ -… can be 4ved by a(G's fŠ.þãGgen(í‚nonlocal`. ± 'olÄ+²¡= sys._get(!0g =¹;öwr = weakref.ref(güHnextUdel gŠðsupport.gc_collO;Ê�Is(wr(),©"QTrue(¬lp iß�refcycleØ `caughtŒ$a 2E getÈ–ed anyway̰old_garbageC#c. 1[:]ƒ]—Åized = False¡  @eÄÂ% 1u“*r0 = 73a¬I gl)î€Greater(ƒ0get`0ounG6, 2ß2+(ª=$oÎNÀ self.assertóEqual(gc.garbage, old_ ñ) def test_lambda_generator(self):%)ò # Issue #23192: Test that a <Õ returning a H‡ behavesIõ like the equivalent function'3f =Xµ: (yield 1)·Cg():t"##Ø" '<Ufrom'.f2^"K g()e2f*Q3QfQ3Q*Q orD÷_fun in (f, g, f2, g2, f3, g3ž¢Tgen =5(ÇÍr.assert¨next(gen),W+Wwith 0ÐRaises(StopIt¦ion) as cm9¯gen.send(2€ €cm.excepôô.value, 2) class G‡gP(unit¥.kCase):¾Lname²$W((1Bµp# check;à0or O²YK¡"Rû __:P__, "/"/¢3Z“ ". h£..mC�# modifyÓ .­@ = "„"?Ëœ"&ÓK % "ež#Åá must be a stro�nd cannoudeletedΨÌðTypeError, setattr,e4, 'o', 123¿DÇ/__H?delŒ‡ ?‡ P As of‹BŒ` creatU¡ÆM(6.__[! fº$\&H�©”¨  undò¢€(x for x�‡range(10+d~T5__,LÐ  "*QÀ"GeneratorTeñst.test_name..") def (±copy(self):'f(uyield 1%ug = f()Pwith Iû.assertRaises(TypeErrorOx.,(g“opickle•2òfor proto in range(^û.HIGHEST_PROTOCOL + 1£ÒÓ#, MP²2ingé G=(‚dumps(g,”ð ) class ExceptionTest(unitœ.CCaseQ #  s Õðthe issue #23353: check that ôcurrently handled ee³°# is correc%àsaved/restored.pPyEval_«FrameEx().=So_throw°N _r P_exc_†\rator]6try1M Equal(sys.Göinfo()[0], None„6¬çªi0 asu#� ¹’d by gen.æ>excpªCValu  šž@ IsÓþ(exc.__context__sã J†# ensure ú0ionñ�not lost8‚l �òwe should be able toY1 ba±&e Y ˜ƒv)make = XBPnext(0_? g_€Ð82 Qfu. V�FpassñÆ[—E)Ý*cm[Iôv cm`þ W5)0, (À™)�s_’OßÜ$òǨ d#ô�6¹ÿ§@%“ø* ø†<óB NF)ýNï…Å!g.sl“ÎûO stopiteratòeí ðò# See also PEP 479.@­ âRStopI]Àon ³ yield ðwith self.assertRaisesRegex(RuntimeError, 'rõd StopIteration'):KR²next(gen())dôdef test_tutorial_stopi@({D!# � e " 4�s the gen{ror too:dyh'f(Jì) 1¢Æ ` 4÷2 # never reache2ug = f()5Â=bEqual(C), 1‹hB`üdÌreturn_tupleZ%g!1" (õ°gen = gè"enêåé(6z) as cm;ßgen.send((2,)_€cm.excep‚.value, 3“è ;o-“ @/(2!¿IsInstance(& DbhÀ2) class YHàFromTests(unitw.CCase‹b_¹A_gi_pOfrom¦a¦ bµinspect.getWPstate{T_b), "¶GEN_RUNNINGñ§TSIsNon;.� 2´c@Dúv˜N‡_b0Ü ‘' aó åM¢D3—gen_b = b‹l,vCREATEDÒP× “Ÿ-H!SUSPENDšR ™ ócode.co_name, 'a' p2MàNone) ô$self.assertEqual(inspect.getgeneratorstate(gen_b), "óGEN_SUSPENDED) RSIsNon9õ.gi_yieldfrom) /Q[] = [° # Exhaust{(W©!OCLOS¦ ö tutorial_tests = """ Let's try a simple±:ÛÁ>>> def f():Ä0...!. 128�for i in=‚ print(imE2Ko0g =2hnext(g,&ñ2 "Falling off the end" stopsØCóTraceback (most recent call lastþð File "", line 1N! ?³#2#g#`StopItÿion "return" also´ Œ � To³'ô2 # never reached$[�>N3>f£ >�µÍq # onceFóped, can't be resumî°7 �@ How[&, Ô9nd %÷ are not exactly equivalentœè+g1u« †ýênexcept+ )O=Plist(of&[]ʼn2‰Jaiseíb€– 4•C2())–Ð42] This mayÓpsurpris÷}at firsC3º� ­finallyD$3(®31] aðcreate an altern ñrange() function ¿mented as aŠy;n’]m*þiçþW5¿ 0,Öµ2, 3, 4] GEs alwaysx1 toa 6+erÎ,or�Er = |“Ò"81", ãr¡ð... return ‘r ...ñ>>> def caller():0...%é r = creator()ªfor i in r27¢ print("WE", i?GwXf! 0( 1 2 3 €4 Gener§Qs canÎ… other g!: 5{ò‹zrange(nóÙy áqyield iOISlist(X"5)òð2[0, 1, 2, 3, 4] """ # The examples from PEP 255. pep_tests = "/ðSpecification: Y�ÏsRestricAð ñnot be resumed while it is activelyÅ{running"g²i = next(meÝ(`cme = gÛ 6òTraceback (most recentµClast’¤0 F¸ "<ê ng>", lineTAin g·ValueError:ûalready executing KbReturnK€Note tha’ð isn't always equivalªðto raising StopIt|š1the�ðdifference lies*‘how enclo9ð try/except constructs are tq"ed 4For',¦�SÄ$f1£Ž2try• rí 0‡3Ùˆ3yÛì€è"[]£¡because, aùqany fun¤", …` simplš‚its, but;GeÞ2ÞJaise‘‹Së ì4h5ˆí82()í*42ï {dðcaptured by a bÝ"m"Bs an‚Mion.£ÜQand E5¡ion Propag=±98÷t21//`) âðf() # the zero divisr¦# p|!esdi@042 @®‘we'll nev‹Rt her!ƒk&k[%5din 1,r?œ?#2#g#f#SZeroDhvinteger�or moduloñ::êkVZ™©77àStopIteration ó >>> Specification: Try/Except/Finally ,‘ def f():0...J tryyyield 1)-121O1//05ý3 # never get here.eÒþ ZeroDivisionErrorºqX4F5Orais|j 6N‚7q� # the "]ù" above stops this;çkO8,9ŸZx = 1šfi1¯j1ñ>>> print(list(f()))„ñ [1, 2, 4, 5, 8, 9, 10, 11]¬ö Guido's binary tree example.§9# A"dclass.F U TreeÀÑæò__init__(self, label, left=None, righ ³5.4" =< a#0eft"?eft!f" =n#G“f__repr­ðevel=0, indent=")"§|Bvel**0 + Iô¿šH2if Þ5eft?ös = s + "\\n" +/.¨l¢$+1¢fg0hureturn E[4ite[CAqinorder:)‰�Create ao€ from a ù�oÉ cn¢n �žif n == 0”[8½ši = n // Ê-fA[i],XH:i])ii+1:])ãäShow it off: cðÒäæù("ABCDEFGHIJKLMNOPQRSTUVWXYZ"Vô A recursive generator that"esUh�s in in-‡x\œt\?if ÂRfor xML0(t.ö <íÚxštE d¹e H?/# t$ÀJKLMNOPQRSTUñVWXYZ") >>> # Print the nodes of õtree in in-order.3Pfor x!t:0...N pIâ(' '+x, end=''hñ& A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [¢÷ A non-recursive generato”adef in©(Ç)›¡stack = []W²Bwhil÷ /ÏK.lefë!Xr.appendx `#’! =`M %Syield Mabel!Žt%Origh“>tryÍ…‰·Bpop(¡#ÿexcept IndexErrorRmreturn°FÕŽ.Òõ�Exercise�”Tò""" # Examples from ItŽñ-List and Python-Devñc.l.py. email_tests = MñThe difference between <�ing NoneEiPit. õTg(): Àišwrange(3‘R2heia°list(g()) [6,)€] Ensur¦ðat explicitly rais­BStop!Àion acts likÓ‚y other m²ion in try/S, not, ”÷Å1Âù�)e ‹-nD0Q2$3ð1, 2, 3] Next ªåwas posted to ù®—comb(x, k›""GÐ`e all "qinationŒ“k elementn”@ x."�°× if k > len(xZ; *O== 0ò%[](Jelse#ö first, rest = x[0], x[1:4o8# AÃ0 doSrÁn't contain N.o;QIf it+,÷r1Ñnder is a k-1\£‡ ?ýcýgC(!,3 j²c.insert(0,‰)‰#óc&# ¡ ÌQ, it'¦¤¢s`seq = ù(Ùa1, 5))ökö…seq) + 2WÀ print("%d-ðcombs of %s:" % (k, seq)) ...  for c in g,•(seq, k): $ðprint(" ", c) 0-,Xà[1, 2, 3, 4]: -O[] 1 "1](23O4] 29 $, 441, 71{R2œ/ 3[=Ô4˜lNí/ 4Q85*ñ From the Iterators list, aboutAtypej÷ these things. >>> def g(­pyield 1½!=ñ(g) 0i =@ +i+2gen“,0[s +s+ô#dir(i) if not s.startswith('_')] ['close', 'gi_cod Dfram srunning%»@from@sendqthrow']¡ñ test.support imñHAVE_DOCSTRINGS-²ði.__next__.__doc__´ 0ð else 'Implement 2¯(self).') d2ite‚s i True•OsÑsinstance(i, $.G]RType)=ó And more, added laterêSi.gi_1! 0XJ(Uº¶ 8ð = 42 Traceback (most recõ call last)Æô... AttributeError: readonly a‡„(me²­'men ÑxQme) 1Y #ð A clever union-find¶a× $ð@c.l.py, due to David Eppstein. Sent: Friday, June 29, 2001 12:16 PM To: python-‘!@p ð.org Subject: Re: PEP 255: Si@ Ùs¢x¶disjointSetY9�__init__og, nameÎNˆ.! =Û0parÁn= NoneÈ1 = 0!e(1�) ‰RwhileðBelf.vÎ�1 ÇiZ;x;Z=.o/orGxDCîõ- žfreturn»\æ?E", Ç M!ifÁ§�¢raise ValuÁ("Sorry, I'm"�a root!"|¼û# =zÝ áS__str —äGb ð s = "ABCDEFGHIJKLM" >>> seð ts = [disjointSet(name) for 1 in¡s] >>> roo2�sets[:] Ñimport randomSgen =!.RA(42)Ðwhile 1: ... kshUõprint(" %s->%s" % (s, s.find()), end='')L1qif len(·8) >w`ós1 = gen.choice(N#;¦.remove(s1[/s2@ºs1.union(s2<«ð"merged", s1, "into ,Jelseñ:break A->A B->B C->C D->D E->E F->F G->G H->H I->I J->J K->K L->L M->M m{0 K v/ BR$BRARFRF¤RER Fö RDRC¤CHRMR5CšJRš H¤ BìöRBRöC>R CRCìRFRGHGì RGšG�RLR¤R$UC M->¤GRI¤I¤I¤I¤I4¤ RIRHRHRHRHRHRH†RCRHšHØH�RHšHšHöñH """ # Emacs turd ' # Fun tests (sòufficiently warped notions of "fun"). fun_7 = Yð Build up to a recursive Sieve;ÀEratosthenes^e"r.-ödef firstn(g, n)Ûâreturn [next(gƒiƒrange(n)oB§intsfrom(iA Z£yyield iÔbi += 1�ŒQ÷5), 7) [5, 6, 7, 8, 9, 10, 11‚ðexclude_multiples(n,Ãs‘gÂ^é—Šif i % n±-žm3mò1)), 6) [1, 2, 4, 5º¯s�(ˆà): ... priðme = next(ints) ... µyield primeñnot_divisible_by_ñ = exclude_multiples(*, Tÿfor p in sieve(O%):pˆR >>>�3s =A^�from(2)) bfirstn}ðs, 20) [2, 3, 5, 7, 11, 13, 1 ð9, 23, 29, 31, 37, 41, 43, 47, 56ð'9, 61, 67, 71] Another famous problem: generate all÷ðegers of the form ÎñJ2**i * 3**j * 5**k in increasing order, where i,j,k >= 0. Trickier than it may look at ú ! Try writJ¤it without�òors, and correctly 'Qing 3ÄÀrnal resultsÅS each‚ output.šçdef times(n, gÄôiôgØXn * i»D"10;Ý`1)), 1Ëð20, 30, 40, 50, 60, 70, 80, 90)&0]“§merge(g, h“$ngógð$nhhzwhile 1ºªif ng < nhà6)ngÃt"elP>P hP¯P/se˜1L ! TÉ@llow^ðworks, but is dopa whaleöPa lot  redundant 2ñ -- it's not clear how to get+Aintew1use@@m235!€share a &3le pñor. Note that me_Br2 (etc)°AneedBðee every element—Bthe âð sequence. So thisÛ£an example•°lazy lists ’ômore natural (you can ˜þ@head %a ;° any number´)Kõ(³X1è=w22, 5¾%$3 %3%5%5%ÅPl,—5 ‡))#5óH÷€i Don'tÿÑnt "too many";rhese --=§Ú°ation aboveÄòextremely inefficient: c²#of?` leads/À3 recursive $<rin turn<à`ose 3 OYso on ñuntil we've descended enough levelrqsatisfyËðprint stmts. V¶Podd: …2n I ‚ed 5 lin*Ç‚s below,ÁSmanagÿðcrew up Win98's malloñŠc in "the usual" way, i.e. the heap grew over 4Mb so Win98 started fragmenting address space, and it *looked* like a very slow leak. >>> result = m235()Pfor i¢àrange(3): ... áprint(firstn(r<ð, 15)) [1, 2, 3, 4, 5, 6, 8, 9, 10, 12&ð, 16, 18, 20, 24] [25, 27, 30, 3?ð&6, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80] [81, 90, 9V0g 08l Y 12 35, 144, 1M1J 16�8(ð92] Heh. Here's one�ð" to get a shared list, complete with an excruciat‰ñ%namespace renaming trick. The *pretty* part is thatòqtimes()»ðmerge() functions can bTðused as-is, because?Áy only assumàir stream argu'ó s are iterable -- a LazyLisŠðe same as a generatorœ1Uclass;÷def __init__(self, g9=µ.sofar = []Uðfetch = g.__next__$# cugetitemfifa$, Lu!, TYñwhile i >= len(¢ U'�.append(F9())Iqreturn )A[i] N¶]-uyield 1=�# Gack: )0 be¥ðactually refersг.;1me_¡A2 = 1(2,G›#3#3#5#5# ~,‘+ ƒ))#5{,@i P| pmany ofús±2youå°-- *this* i§ùaClómemory- efficientÑs=Ò(ÙE>>> ô › [.1[j]*j4@15*ir�*(i+1))] ª [2]2½2X2¢`243, 2S0256ÅÓ 88ËÌ@4, 3q3´ 38ò4L 40àñ4B4‹0486ðñ/5e0576üýy66ö675] Ye olde Fibonacci¹,Ñc styleí�²fibgen(a, bk»‚sum(g, hÉ$1ß®a(g) + h} XÐtail(g): ...  pnext(g)ð# throw first away ...¹for x in g:pyield x abPsPåsum(iter(fib), EFtail%*))ƒkðs >>> fib = LazyListU£gen(1, 2))!FrstnNp, 17) ["ð , 3, 5, 8, 13, 21, 34, 5ð.9, 144, 233, 377, 610, 987, 1597, 2584] Running after your À` with êàtools.tee (newð`version 2.4) The algorithms "m235" (Hamming) and Fibonacci presented above are both examples of a whole familyõFP (functional progra}” where a +)Qduces†ó returns a list while the&\Êr suppos!0£as already1ðed by recursively callM°itself. Foras"€to work,¤y must: -Tp at leaÕÝqelement’1outCœj¿àexistence of WP rest8½`ctheir UÔòa lazy manner T Á efficiently¬R begi-!offZÁp not be Ðomputed over ü ð again. This is ensuredMðmost FP languag«¢ð"built-in feature. In python, we have to explicitlÀdintainà%of°c–qresults™áabandon genuin½É@ity.׫ðwhat had been attempàa¿&eá class. OnWSblem %"attVpit keepïJ±l·`generakµÄ tâófore continually grows_Qparti de=s«>> def fib(): ... ¢_isum(g, hqwhile 12òyield next(g) + h)V'Zr<1(2^ù fibTail) # throw first away-²for res in ΀fibHead,ôBÅ0resJŠÁ realfib = _½ R[PRes =l(81, 3L@turnƒPRes ‡À!n([ , 17) [1, ‹ , iBp, 34, 5@9, 1QÀ233, 377, 61‡ 87e 978 ñ """ # syntax_tests mostly provokes SðErrors. Also fiddlùjù#if 0 # hackery. Q!= g`These ÁRfine:Ýófb ì re-:try¥ >!fio %3pas[ ~ Q ¥E1//0åñexcept ZeroDivision0 x*¡?666@.ª0...: ÌC‘1IpåVc‚Ox = ™0 Ï› [T]€list(f()Ux2, 666]lÀ): ... yiñeld >>> type(f()) $õdef f(): ... if 0 /yiO)P Q! 1~¢ Å¡.""¢_ NoneT%t returnI trybÆJx==4Epass7-elBSy 1//0Bþexcept SyntaxError{( Oelse/›4�while 12<"mx += 1²âÿ2 # don't blink2 ùf(a, b, c, d, e)-Ð û0 ¹(x ¨âRu   ˜g9ýà?...�«@Type…‘K„nÀCâs<Ö__init__(selfË”¸@f92Ë7Špì«r ÃÿThis one caused a crash (see SF bug 567538):ðû for i in range(3@ R‰continue§kfinall9.Ði-F0g =s ÿprint(next(g)) 0+ * ðTraceback (most recent call last): StopItÿion Test the gi_code attribute0Î5Î$g.Fais f._Rb__ Truœé! 5è·5l ؆__name__ÙA andóorepr()èç UA 'f'ËK1g) ôõctest: +ELLIPSIS '<¶ð object f at ...>' Lambdas should2@have£ƒir usual¡¢ behavior.µãl=Ð: (yield 1) >ó>> list(x()) [1] >>> x = lambda: ((yield 1), 12))':ñl, 2] """ # conjoin is a simple backtracking generator, named in honor of Icon's # "conjunction" control structure. Pass aÂò of no-argument fu9Ið)that return iterable objects. Easiest to explain by exa¹õ: assume the #Xu�[x, y, z]ìÕpassed. Thenð acts like: # # def g(): # óvalues = [None] * 3Bfor 0[0]!x6: 1 y $2$z$(ân¦ So some 3-äs]” *may* beÄðed, each time we successfully # get into?ó innermost loop. If a”ðtor fails (is exhausted) befor{¥then, it "M s"¶d‚the next4Q froms@nearݲenclosing #p(6Sone "¡ðleft"), and starts all over ag#atWðxt # slot (pumpëUfresh^À). Of cours> is%þ€useful w(W—ðtors have side-eff¢0, s>‚at whichájs *can‰ a“�˜‘depend on²Àiáed at previousÇ@s. �°_Äp(gs): %A«0len <qgen(i):/3ƒif i >= ) uJelse'èiÄPgs[i]È0*x*‡'+1‰'xx¶ 402&0# T?àworks fine, buO0curP€Aevel42cheâi/ê%b for #+°item producüðs inefficient. By do'amanual,p unrollPacros×F° boundaries €'s possiæÔ‘liminate |1of Ô`head. â�‘n't worth1£bother *inì l*Å ¬ *0) i–Àa core build¯Qblock9RÅCPU-intensivE or applicaìŠYƒn˜Pd“n×P# Do Ùh n¹£!re¹±vely, untilî#ä.s_€# remainÇris diviVRby 3.j÷ nÊS´=—êelif (n-i) % 32‘ip1 = i+1�.´F[pÀ  �yield x Uelse:úfor x in _gen3(i)# Fð## Do three loop nests at a time, recursing only ifSleast7Amoreƒó6# remain. Don't call directly: this is an internal optimization forJ¢gen's use.í?defÒñassert i < n and (n-i) % 3 == 0Lò€ip1, ip2`3 = i++%+3&òg, g1, g2 = gs[i : ip3]�GfZ >= nVõ# These are the lÂ, so we can xevalues.b¾!0[i]Æ/g(Á&"p1(1) S"p2-2-1§üjR# At 6<Á; peel off 3›Heä$ ÷:/st iM/p3Ž4<¡>Wgen(0:& # And one Eð approach: For backtrack}‚apps likaðKnight's Tour # solver below,_ª number ofGalevels�ñbe enormous (one # Ä per square,® qÕòthat e.g. a 100x100 board # needs 10,000Uð s). In such cases Python×ðly to run out ofÕátack space due �od´So here's a¥@on-fÊrversionGð conjoin too. # NOTE WELL: T‘ðallows large problemsm"beXbd withÿötrivial # demands on s©p. WithÄðexplicitly resumable generators§@ # m`harderyåachieve. OTOH)'¡slower (up+a factoé‘2) # thanäfancy unrolled"3ve 0. USflat_p(gs): Ž1namqkœtÍansteadÍpn = lenEÈÑ = [None] * nniters p_StopIt¼*= ` # mak¦ cal becausX0ugh­R*lot*` ûvwhile 1¬–# Descendk6try Ç5S  it>Á 'Á]().__next__�)-Mit()!ei += 1rexcept Àteration:  Tpass Uelse:Ùassert i == nÕyield values õ$# Backtrack until an older iterator can be resumed.<ei -= 1Êwhile i >= 0•:tryªŠQ[i] =kes[i]()N#ö# Success! Start fresh at next level”38i +œYbreakdÑexcept _StopIò>ion®Ä# Continue b1?ingy ¢9< 0Šœò # A conjoin-based N-Queens solver. class ¬òdef __init__(self, n)ø8.n Prange 8(n)÷Assign a unique int to each column and diagona€#ôs: n of those, e1u# NW-SEDrs: 2n-14e44i-j€mõinvariant along<#—°, smallest 8ð is 0-(n-1) = 1-n, so add cqto shifÓ'0-Ip £OE-SW£ +£$0+j £a, largµsÿ(2.†1ForÜð square, compute a bit vecŸeex˜Ò¢Às it covers,#$ f\7rowX×function thatH0genñes the possibilitiesK2s i>F rowL‚3rowI…ors = []c�i;* ‚arowuse2 (1 << j) |Ø }… ordinal] ' DA(n +,+)R—C 2*Tp+ i+j))j1# N7C +<j÷]ÿÖ4(=Ü)BKýGF&[j�"1if )!& ·u†=×*(!|=<| ˆj J@&= ~‡  ’ ors.append#$geÈ3# G³7uÔsŽUJ(IZì›Wprow2col¨›<.‡Jè:Ãz�printsol’F,)_Aðn = self.n ó assert n == len(row2col) õsep = "+" + "-+" * n–print(sep0õfor i in range(n):.Rðsquares = [" " .j.].[–@[i]]�)Q"&†!"|£ƒ|".join(i)·&|" …1·€ # A con4òJ-based Knight's Tour solver. This is pretty sophisticated # (e.g., when used with flat_c_ð above, and passing hard=1 to the #Šûstructor, a 200x200“ñwas found quickly -- note that we'rL@reateñ10s of thousand  generatorsz2n!)˜ isÃgthy. class|sÇò def __init__(self, m, n,É0íA.m, 1n =( ¸!# Yð() will set up succs[i]�be a list¼ÎX #i'sC¥uccessors.C" =x ([]zðRemove i0 from eachd1its�R' †fs, i.eh#,ðs can't go back½ð i0 again. Return 0 if we+¬ # detect t\pmakes aò ution impossible, else rK&1.ΑrÐ_Í_òÁPs(i0,Í<=le…1# IŒ9p all exÿC‚ a free s,OR deadAc# evenÖQ to it next6ê`'t lealtüCˆcªït;1one–L¤must visitc;J!‚somebody/Zh%to=è@sinc/7ereR”Ponly ~�adjacent,#Pre woæ˜0wayçÝ ƒFinally,$æ0morz!andk÷aØ'l c94ly sªÞ#em|–;ingI‘the otherxaÒF endÓÿÙne0 = ne1 = 0B«ÙcZs[i0]>Ø É.p:(i0�"e €s@if eŸ0p:²I+= 1­$el:1:-1 :dVA== 0®6< 2vP# PutAð/inD ¹jadd_to´CÅv6q.append`2# Gëuðe first move.  Òdef first(): Ðif m < 1 or n %yreturn 7ð*# Since we're looking for a cycle, it doesn't matter wher3 J�start. SG inFùorner makes the 2nd move easy.Dc,ù = self.coords2index(0, 0)- reFò_from_successors(D +O’lastij = " L_yieldoadd_to`@¡# GenerateßCsecoâsÞ¸ ¹Ž ôbassertÐÑÑ # i.e., we ŒQed in•e³13131.�@len(t"s[Zy]) == 2a+| ËP1, 2)š B<O2, 1< ð # Only two choices. Whichev½qe pick,0othœQust b¿ †r# squar1Red on¹²m*n, as it'Óoqûway to get backJ2to Ä!�ave its Û ðÑfinal so thatjŒs beforeL0he þP know mÁ–kept freey¹Ï@i, jj(~1, (Jô_this ŽB W\µ¾Ž3-i, 3-j4î!=  •XÞŸQQuccs[J�].appendY}> P ^#³j¤j<S)ì:Ëös 3 through m*n-1Æ?ûadvance(len=len # If some £ Q has ›¡one exit, *0tak€_õÆ# Else favorDÁs with fewerCÔ6ùcandidates = []Kwt’'s[y]xFe = V.i]åP�e > 0, "e®‚ `) prunƒyflawed"˜¸@if e³1Š ×()Ý&Jbreaì@�D ÖÀ<À.sort()  ô for e, i in candidates: þif i != self.final$,ÿ if remove_from_successors(i)26V­lastij = i~$_yield jadd_tor J°# Generate ž÷ s 3 through m*n-1. Alternative version using aGö"stronger (but more expensive) heuristic to order .Gð Since the # of backtracko�levels is›�, a poor·— early onJÐcan take eonswðundo. Smallest square board ð§which thisGÐmatters a lot|V52x52³ñdef advance_hard(vmid=(m-1)/2.0, hn{len=lenö–# If someq has onØM‚it, mustÖ&it„¸# Else favo\ü with fewer exits6ðBreak ties via max distÐ « Ñcenterpoint (e$~Acorn(ú nd edges whenever possible)|WY = []P�|&'s[].‚e = len(,9i])KŸðassert e > 0, "e*�`) pruno}flawed"Mžif e == 1Šl ×0(e,s*i)à)b~bc1, j1 V°index2coord. . d = (i1 - {�)**2 + (j| 4¥€.append(©j-d, i)?,é@fsort()R׿0e, OAض­“ì"(ó•Ü:+Ä4*ij8é3w ifJ < 4®,ëgê0orsqVfirst^è: Ý, second] + \`[ I and4 orß] * (m*n - 3)C]áC2(œg, i, jUQ‚0 <= i <”mœjðn returðn i * self.n + j def index2coords(!,!):#'²assert 0 <=" >>z cr@ð([lambda: iter((0, 1))#p3): ...ä pc) [0, ] 1 E1, 0   P] [1,Hð1] For efficiency™ô typical backtracking apps,ô1() sëñsame list object each time. So if you wan'Ásave away a &paccountTDits G±d sequence,@@needgócopy its resultsX0gen(JGatorA�d\aÏ x´¦n ¾'10K0allDist(qÌKn)))Íðn, len(all), all[0ò] == [0] * n, all[-11¡) 0 1 TrueA 1 2 A 2 4 A 3 8 Q 4 16 H 5 3:86 6;H7 12=H8 25>H9 51?ñ And run an 8-queens solver. >>> q = Q1(8)‘LIMIT = 2‘count = 0ñfor row2col in q.L€(): ... 0E+= 12if 1<= ].2òprint("Solution",.)@%!q.'s%(…$) 7[ 1 +-Y |Q| $",$ ,/Q|$ J$J$ À$F �(H=2}‰$i$ *=B$Ñ  ,l($ &$� $–(ß4, "Ÿs�all.") 92qÛ ˜ð$ Knight's Tour on a 10x10 board. Note that there a·bout 20,000_BevenC26x6AÀ, so don't d: àthis to exhausu 3k =��s(10, 10xðk Vk x,Jelse_Zbreak'O--+-ð | 1| 58| 27| 34| 3| 40| 29| 10| 5| 8Pt€ | 26| 38ð2| 57| 28| 33| `h_0| 11Tð59|100| 73| 36| 4¸hß9| 32| 9| 6Tð74| 25| 60| 55| 72| 37| 42| 4¨ð61| 86| 99| 76| 63| 5Pø@8| 40¨P24| 7¨€2| 85| 5ÿ1| 64| 51| 48| 13Tð87| 98| 91| 80| 7ÿ 7| 84| 53| 46| 65| 44| +---ÿ | 90| 23| 88| 95| 70| 79| 68| 83| 14| 17TÀ7| 92| 21| 7H@1| 9Hß9| 16| 45| 66Tÿ22| 89| 96| 93| 20| 69| 82| 67| 18| 15T¯Solution 21ð 1| 58| 27| 34| }EÝŸ0| 5| 8‰p| 26| 38ð2| 57| 28| 33| `h_0| 11TP59|10Í@3| 3u¸hÏ9| 32| 9| …P74| 2½@0| 5-À2| 37| 42| 4¨P61| 8Õ@9| 7Å@3| 5Pø@8| 40üP24| 7¨5@5| 5@1| 6-@1| 4-3T8ÕÍuX}8-}9Í}=9Ũ}2ð""" weakref_tests = """\ Generators are $ñ ly referencable: >>> import!1refðdef gen(): ... Àyield 'foo!'(Dwr =9“.ref(gen)P() isFQ Truep.Rproxy0«?-it´ ƒ as well¼@gi =d(vb�i�iŽ .’list(p) [ï1] gšcoroutineiðSending a value into a startedžÔ³\fZrprint((a01))^r 2;Sg = fæ’next(g) 1ÿ.send(42) 42 2 �6newŒó produces a TypeError¡2f()Sò"foo") Traceback (most recent call last% Gp can't —“ non-None]just-A Yd’by itself s @œ=­`f()) [)]Hðis allowed only in the outermost iterable iñ4n generator expression: >>> def f(): list(i for i in [(yield 26)])+õtype(f()) A 2edð with augmented assign .~ðcoroutine(seq): ... •count = 0bwhile V< 200-1"+=‡6±seq.append(?)Ñ�seq = [] Jc = ‹bnext(c0Qprint¦ 5 .sT.10!#10X# ?, 2'ñ, 30] Check some syntax errorsº �sæ£f=lambda: Ö31), ñ2) Traceback (most recent call last): ... SqEp1: 'mö' outside functionÚX#x ‘k$82 toßÊÛ not possible~åObar)€(Scan't¾‚u�ö$vf Now cÐthrow() condiŒæKJTrueD:try>øK%))DÁexcept Value_ as vCi"caugh/²(%s)" % (v)D¡import sys€0g =  Œ"g)n"g.î{@) # ¤o only k:Ð("xyz")) # vËC?xyzF, (1NO‘+matching ›1V2Typ\UQ# misQ!edP`, rewrßd[=°(1), None) �explicit$ t!`TP"foo"U/¯# bad argsÿ²: instance wqion mayòhave a separateÇ*!, –C, 23š™,‹a) thiràuåp must b˜Bz objectš_"abc"ˆ snðclasses or instaô`nces deriving from BaseException, not str >>> g.throw(0) Traceback (most recent call last): ... TypeError: eWÿ s must be classes or insta‘:int‘Olist”lBtype•Bdef (Àg,exc): ... 6try Praise#e$ &wñ*sys.exc_info())”jQValueiõ) # do it with tªöincluded caught 32 ()¼²g.send(1) 1_Çÿ ) # terminate the generator fóprint(g.gi_frame) NonO“2à`StopIt”2ionbDô0,6)ƒ Ðׯ on closedÒ!Y2: 6t3f()1",7v##tŸjust-openy/¡7 Plain "Z"UVide aÒò should preservÂ$×(#13188). The<6õhave 3 levels: -`) - f(21/0ÿ/f(ÿ _yieldû Çè1g =aˆ Hpa:Ñ ZeroDivisionV as vQ <+v)Š CwC6•tb = w.__;!__¨A = 0†while tb>!E+= 1qN¡tb.tb_next:(ñ 3 Now let's try£®Ô:q e$ G³FExitœÚŒ”"exiting"£"(g!g.33() 1¼];Âbe no-op now° >( ¸Tbe ficå¾Iöan even simplerüœ v3! #V�e before �1ing/xùCGÐnormally And¯PalizaQª0finD�)Udel g™! öÀatorExit is ñnot caught by except Eðion: >>> def f(): ... ¥try: yield;-1rprint('%%')6vfinallyZ-"')…0g =…‘qnext(g) cdel g -ÿ Now let's try some ill-behaved generatorsÝG<JExit´ q "foo!"—¯ðg.close() Traceback (most recenŽöll last): ... RuntimeError:Á™ ignored —}eY Ourócode should be invoked during GCáimport sys, ioV@old,—.stderr = %0.StD2IO(š²Y"ÛG" ins‚.getvaluL!ue¤6sysŸ°old And e<„s thrownì‰ô “propagateö ‚ ’raise TypÀ("fie!"! $ a : aò Ensure that various³ð expression constructs mak.deir enPfunct)ax R x +=Z‚õtype(f()) ËZ? x :%¡lambda x=(zO): 1~bd): d[>‡ "a")] =b!27VÁdata = [1,2]ÛÊõgóéñg.send(None) 'a'E?T [1, U%X0) 'b"%27#yM1GTp StopItÛ¸W passeCð 7] """ refleaks_tests = ÀPrior to addÁcycle-GC sup ñto itertools.tee, this PwOU]°erences. WeN0 itXðthe standard suite so ƒroutine ˜-— T trigger ifG�starts be¢òuncleanable again._»­0ef  Ç :gen³Ÿ __?w__(selfú preturn Í< <U.itemAVBgen(ÙOÊhead, tail =~ÿbgG0 = /N£„Ait =À() Make surñe to also test the involvement ofñ.tee-internal teedataobject, which stores returned items. >>> ò = next(it) Thisrñleaked at one point du—ðgenerator finalization/destruc ð . It was copied from Lib/Í/[!rs _Mñ_cycle.py beforeáPfile Isremovedº@def F°(): ... 7gen¥while True)tyield g@Ag = @^ Àisn't really,ð related, but rather excep Ã-in-cleanup )ñ. The coroutineoðs (above) just happen†cause anR@ in 9à's __del__ (tp ÷) method. We canIö for this explicitly, withoutÔs:ado havóðredirect stderršð avoid printing warnings andñ doublecheck that we actu=Ced w‚wanted tíäáimport sys, io±Pold =.‡6tryÜ3sysô = io.StringIO()è€ class Lßr9CJV(self]#ˆ¯ke(message%*õraise RuntimeError1Š(Q""©#3l =«ÂUdel l#�÷.getvalue().strip:$"E˜` ignor•n" in errR"·: $žTraceback!in¬)ke,l¬@old § “pese ref“�ðs should perhaps b! a2€ir own, Xhsce¬bm(¬@drew€ðse out. """ __"À__ = {"tut":¾¡ tutorial2s, D"pep(?pep#Remail% %2fun#_ fun#asyntax& &aconjoiM 'pweakrefN 'Ç) +Ã4s":Îs(¡} # MagicÐ@ namŸaz gr‚$4¢s *after* .‰Þ± module. # Òðworms around a bootstrap problem)3Noth0docgÊ"ret  both look.gPargv O°a "-v" arguœ@, # ·Jñworks as expectoJ@ways§0run7ð regrtest. def teð st_main(verbose=None): from test import sup,±_generators.�.run_unit9­(__name__)#1doc"K#, ‰ð) # This part isn't needed for regr<R, but¡unning the¡ä directly. if Ša == "_ô2__"éHD(1) ì$ys Î$io datexit?os 3.(Tòcript_helper ### “s def h1(ŽÂprint("h1") 2233Ð4(*args, **kw `@4", #, nUraise�§ TypeError#•#gSystem%1� #I‘ class G[dlTest(~.0CasžN£setUp(selfƸò.save_stdout = sys. ; &6err&;err&òtream = io.StringIO(ÓJ] D Qelf.s>R4¡._clear() Ì�tearDownÏ _RÜ>…É&Ï}0st_÷ ~‘# be sureõ are handled properly„^¶register(h1% 4 0, 4€m="abc")_dITfuncsDù±assertEqual΂Å.getvalue(),³5 ð "h4 (4,) {'kw': 'abc'}\n0) { 01\nQ:»ost_badA ùÁlambda: 1, 0!(x¿±x in (1,2))0÷ÑÖR‡%s(z#, `  W�st_order (ÛÒ!rs߀executed��reverse @5sè2È 83 ÇÛ!¿ "h3\nh2\nh¦t ç4ë 2“3Ð/SÞ_unnormalizedÓóIssue #10756: MakÈàthat an unnormóalized exception is õ# handled properlyõatexit.register(lambda: 1 / 0) (óself.assertRaises(ZeroDivisionError, MP_run_Wofuncs)DMIn("A1", góstream.getvalue()ˆ�def test\(+%):]ÿ # be sure a SystemExit isü³k9a óXìQEqual¯.ÚC, ''sÞñprint_tracebacks; êöIssue #18776: the .p shouldI�ed when e£…s occur.6u'f(]ù©1/0 # one(g(9two(h(6hreR,yf( gh=·° b·tderr =‰èlß9o.countÛF), 3Ç? lþE'?two'j)·ë>…sVqa = [0]+N/†#ÚʘÂ2.__ yÔØ‹'_oU__tearþð s Ô Z1 is Ued onù#u YÞòexpected = b"TheMPhas pV'd!zã, w = os.pipe(¨] Ì o†3 nâ×éïos.write({:d},¶xX�`&Æ""".format(w/reˆos.closeA ð os.read(r, len(expected)),à expected) ños.close(r) if __name__ == "__main__":1�unittest.ð() x = 1 __getattr6û "Surprise!" __diô again!" import T` from ^ 0sup")$os &sy óubprocess SYMBOL_FILEÞ#= Lþ.findfile('symbol.py') GRAMMAR:ô= os.path.join( 0dir%0(__LA__),n c'..', pIncludeÿgraminit.h') TEST_PY�¸_)½á class TestSÔ´Generation(].qCase): «’def _copyÂ’without_g;2ed_ás(self, source,a, dest )ðAg open(+v) as fp&*ñlines = fp.read(�Ig_, 'w'L‚fp.writeE![:ö.index("#--start constants--\n") + 1]v™M LÔ!' def iter_~†formats(C= °): for ¦D in 8s#8( %)6if l@ not- (' u@') andk#('à)ˆ@�continue¡Byiel@%, �õóstring_reverse(sSâreturn s[::-1]+ó bigendian_to_native(value47if âL+—Melse ‰.¡) class SgTTest(‚.4Cas~Âv5_is©S(selfž â.assertEqual((À€.pack('=VP1)[0]�80),Ð!) ¼g¿consistencegdRaisesgserror, uÓcalcsize, 'Z'_¦zò.$Q('i')�"9elfÈmsz * 3Zw('iii')\0fmtS1cbxÕhhhhiillffd?'_@fmt3&÷3c3b18x12h6i6l6f3d3&s§7fmt§zG î(^$Ë'z3¸ºS È!, ö?, 3f? ',M3C i(TypeEÓá)ˆ�Æ?foo‘NPNu��#un‘¨d', b'flap“v'<', 1, 2Hi?, sA('?›{`transi€Lness~vc = b'aÏQb = 1B<uh = 255†i = 6553l6$–f = 3.141%dZBTrue)l!hprefixÎ6, '}Œ'!'¥9‚9`xcbhil¥�, 'xcBHIL 6: maŠx+¦5matÌÐ s = sûtruct.pack(format, c, b, h, i, l, f, d, t) òcp, bp, hp, ip, lp, fp, dp, tp = s])un_sJðself.assertEqual([c(b(£h(Çi(ël(÷int(100 * fp), )>d>d>t‡!) ·ðdef test_new_features(w!):!Ûô# Test some of the new /§ in detail25üargument, big-endian result, little—asymmetriê¥Us = [dš›('c', b'a;0),(x)"\01-(cxP"\0-s (0)¡helloworld21²10h1292q:B1¥ ´ é1ºzdI&b'GŽ2Ža+10*b'?P'WPb', 76!\7Ç'-(2371* ,BS'1249|K2b'\ Tä1700-r002\274…¯274\002', 5-6A375D3_D\3750H¹e50x10000lil7Ö’4,\035\20c @,\00íàDtE°373\323\342?ð /73ûI�0D ’š4lš0D�À3', 0),  ‚('L', 70ñ, b'\004,\035\200'0200,s', 0), ?D20x1E900-Pº373\323\342S/73Vpf', 2.0ƒ0@\0„•@?d?K 'ÎÓ 0$vµ-¶"\3±> ¹!¼FNÀÎÁ~?”w\ö'3'1Ú1'LTrue*Q![](r?', RA(1,)*u0b'\*%] ¤õfor fmt, arg, big, lil, asy in tests:.û2!(x4@exp)&a[('>'+›big), ('!<;lilT 3('=0ðISBIGENDIAN and¢0 or¤*)]˜Dóres = struct.pack©Iarg)Å-ðself.assertEqual(res, Ô+c�calcsizeg`), lenF)m6revš'unœ}res)[0]t0if 5 !=›ë ÂER(asy)Û1def¼_¢î)G�expected_¿I = {€¡'b': 1, 'B ‘h': 2, 'H ‘i': 4, 'I l1 'L ‘q': 8, 'Q }Òðð# standard integer ¿s0œ0codO€yteorder Siter_2�_formats(d�, '<', '>7!')!p+D = bN+^o$�Úo; ƒ q<r‹[a]Æ`�# nativeòP_pairû0'bBË hH iIlÅ0'nN 5qQ'½,¦>(M+†-+'O*@'&*FsignW (D'+ }:[0]+J/unL#1L{§ð, unsigned_size) # õ# bounds for native integer sizes*ð self.assertEqual(struct.calc*Ÿ('b'), 1)2BLess6=2, 9?h')6 46l6iIiIië _’8qlIrGreater€ µnLL!Pá“def test_c s(V!):’3# I}'õs (bBhHiIlLqQnN).(õimport binascii PclassE°Tester(unitK.GCasemq’�__init__�, ;mat(,�super(IntLAer, ½.?ÀmethodName='tV_one'ÙC6“.format =nÀ!%Ecode#O[-1]'–byteorder,:-aif not¶.45in sŠ…öraise ValueError("unrecognized packingG}: %s" %®P ê‚/ e- =>J8$it7¿G=* 8ž"ifvÿin tuple('bhilqn'ǾÝsigned = TrueX'Pmin_vE� = -(2**q".b¤'-14c5max<:M - 1y/elÓoBHILQNÓOFalsÔ0‚ÿø»/seŒ" Ć6)L¾ ̯A, x,ò=Jþ,ú@ un*68„hexlify=î3.un*):®n=ÍŸÀ ðif self.min_value <= x"ax?: Ïexpected = x!_ signed and]/ 0ObSr+= 1 <<Ÿbitsized©ôassertGreaterEqual(JO, 0)9!¤ = '%x' % /eif lenW_) & 1È= "0" +\ y% =(ÿ.encode('ascii'Öunhexlify¢ÇkÁ(b"\x00" * (F@byteh* -ë?) +L±X©'ifcÿorder == '<' or[”1 in ('', '@1=')Pÿnot ISBIGENDIAN)“ïstring_reverse2 ‡aZ ,¢;/) ÏÏ# Pack work?!ÿgot = pack(format, xK �Egot,7€ Un]‚qretrievÎu-Šgot)[0]¹ �5x, KްAdding any uÿ should cause a "too big" error.z ñRaises((struct.5p, TypeE@2), Ò#, ]QË b'\x01' +  POelse‹ñ# x is out of range -- verifyï realizes thatý�Overflowó0, VÏ -),­ñ01Ž 8qdef run9u@fromÝ¡dom importï#1# C»Ð all interest!`powers)2±^s = [›0for0 inx!ge¨.HO + 3´T�.append(‚?expÈ # Add someaç; &S‹i‰…M = 0JNjN}r7ðval = (val << 8) | randÏrange(256) ývalues.append(val) (1# V&ý absorbed from other tests3W0extW€[300, 70ÿ, sys.maxsize*4]pòTry all those, and their negations1+-1Œ €#0òm. Note that this®[¯power-of-2=áboundaries in CqÄa few out of>pluý# +-(2**n +- 1).e€for basea.:$°(0val'-0,6,0Aincr11, 0, 1.2@x = b + 8…'Pself.òo_one(x¼þSome error casesûPclassš_AnInt�Àdef __int__(v)'•Ÿreturn 42ºðObjects with an 'Uðdex__' method should beMowed°# to pack a tegers. TX°is assumingu¯ implementI€ÀsžOint'1±Indexable(oÕ:i;,Þ/ue/Ba!._† .ueL)\A˜]UA# If6³aises a typR,,n ?tÕÎCusedøq deprec;� warningg1Badjf Ê` TypeE\·°2ònpassertRv5s((x‘, struct.ž-),H‡ 1ü!, \oformat< "apNing"{K§sArand⦊_3+42j¢ÀeError, struÏct.error), ÿ struct.pack, self.format<½NotAnInt())jKðassertRaises((TypeE™#, v§S€BadIndex§ ¨ð# Check for legitimate values from '__i@M__'.@8�obj in (f–able(0), 17š :+42I J]27)):”õ?tryõ(ïN objÆ-oexceptM5ðail("integer code ^  failed on`_ect "®hX"withw­ method") >À_bogus»-Ib'a'u*'bONoneÁ‰{'a': 1}RŸ[1, 2, 3]½=<Zóè@~öå°, byteorderSiter__Y+s(¡& =:+J[mÓt = IntTester¢ �ct.run(Àdef test_nN_L(@wð# n and N don't exist°åstandard sizesƒP»Sµð(func, *args, **kw f¹¹~.@û}ïn as cmP`(_”^Y±In("bad chazbÆAmat"aB(cm.¼7ion¢¼J'nN'Š Ô€('=', '<>+!'õ›Ö(WºP.calc†,Ä ï; i7?, 0:*un<$b"cSpRœ° p ("PascalÒQing")ü'O“ö, input, expected @backŒ[ìòð('p', b'abc', b'\x001b''ŒÀ á ('1p', b'abcw\x00', gb''),  =('29)1a:?b'a:3:82ab;�;4;3º•# ʱ5<ñwcx6<@<B1000?0x'* pð\xff' + b'x'*999™x'*255)]:nùgot = struct.pack(code, input)+úself.assertEqual(got, expected,)Z'un\/goZaback) ‹ðdef test_705836(“)Ñ’# SF bug ð. "f" had a severe rounding1@, whqa carrylôñ)# from the low-order discarded bits could propagate into2ˆexponentN ield, causzXðresult to be wro‘õy a factor of 2.Bpfor baseÇ range(1, 33¶ñ!smaller <- largest representable float less thanUgEµdelta = 0.5Qwhile02 - %�/ 2.0 !=Ž.%=& K¦9O #b# Pack,"is´Ps awa#Psolid¼ €of trail 1š Ѐ&ed’(#, ˆ ²24?ked)[0]°áThis failed at� = 2, 4,‰’32, with Oa 1,!;andLp16, resaZivelyÒý �,X Ï2big³ ?>f"`D,u _rK2se([)sá`(Œ%, ’ Ey8aseÙ'3# LßÀfinite IEEE \&le-õbig = (1 << 24) - 1Bö math.ldexp(big, 127 - 23Ñâ=6big(ãÖõG òî‚HùHñ # The same, but tack on a ðd so it# upS!in9ð 5 4ä²ð Raises(OverflowError, structñ.pack, ">f", big) def test_1530559(self): ÷for code, byteorder in iter_integer_formats(7;Wmat =:+L]&pó .assertRaises(struct.error, ¾jo, 1.0)F15Fˆ;'P'…?!5„ unç\_fromˆ¤`stringRµ'abcd01234'–fmt = '4s4s =ASVF(fmtôÝ lsÑ(ßsæ[arrayÍ·data = cls(‹K ˈEqual(s.ÒCQ), (b½?',)>2, 2AüA#4A; Ai {range(6ã0, idî|[i:i+4]ê hY, lenWO + 1~ ,p , ƒŽ"ÍðId…p‰úHK >n g —R, fmt™"#õ# keyword argumentsäàwbuffer=Å, offset=2),FG 5(b'Ð&”Ointo öReykjavik rocks, eow!ñwritable_buf = à.×('b', b' '*10TL/21M³Ñã# Test withoutûs�4(o(�B, 0,‚Þ²11.to¬L()[:8]oðelf.assertEqual(ó from_buf, test_string) õ# Test with offset.òs.pack_into(writableL+10PN o8 = 2ø.tobytes()[:len(ŒF+10]sôelf.assertEqual(Q p[:10] +Ó÷Go beyond boundaries×@mallÈ‘ = array.ï('b', b' '*10)’ð Raises((ValueError, struct.e7), 34, siE, 0,Q+'s x(2xySbogusÇ (issue 36946b =ä@¹?Typ0?h�_', sb¸ CNoneÃ2defB@_fn(ƒ%):’`õ = b'Reykjavik rocks, eow!'/¹#$¦fmt = '21sF‘ô = lambda *args:3!R(fmt,Ö‡™3out‰Å>¯iéKH™–½ºTÿëRZvPŸ!unPÎzI'1£/á '@ð0x12345678) dóef test_bool(self): ðclass ExplodingB#gobject%,Qdef _C,__E Õraise OSErrorcûfor prefix in tuple("<>!=")+('',iâfalse = (), []U'', 0Qk0tru%`[1], 'ÞÓ', 5, -1, 0xf+9/2 Ci„Format =¢Á+ '?' * len(!)4spackedF£pstruct.-N?, *; un( = ?))´÷e³ ²T/±+K0, * 8˜*ed:(/<­' ¬jÐ.assertEqual(T:!),_Lb)};T <Š)yqtlb&ô@f"*(t† HåG !F48 = ~{+'?', 1À˜9g$),F–calcsize(J !ifh:_ != 1¾ Pð, msg='encoded ;ù is not one byte: %r'êU %Œ Õy˜\“ œ,­ :dexcept„WIpass´Nelse'ƒåfail("ExpectedT‚Ìi(%r, "Q ?[c))" % ´Ñ¶rcº [b'\x01', #7f f 0 Jf0']¿»w�v 0('>rSc)[0]vÙAü_count_overflowäAhuge"¡ = '{}b'.f;€(sys.maxŒ&+1A‡R#s(‰e Ç%, a˜H2v?{}HyW//2, ‰?//2Š12‹#‚trailing,,er%@stor—aarray.1('b½c '*100QÜ"# Aò lists containing only lñspec should resulØ1an FxmÀstruct.erroró , struct.pack, '12345') óself.assertRaises(0Uerror>)un@O, b'ECU_intoˆ`oore, 0’$__fromOâñ-# Format lists with trailing count spec should result in an J,çB, 'ckO, 'x+pFbG!‹rJ"sts,Ù n!µ“ pm 50) ’# Mixed fµUtests‚ÿ14s42', 'spam and eggs�(Q�1 bl-²o ±x- ¼ z @def ‘!_STð_reinitialization( %): ÷# Issue 9422: there was a memory leak when K˜aDmñ instance. This‰ð can be used to detectj[Ee0unn^@regrÍE -L.)4s =1w8('i10.__óP__('i9Ácheck_sizeof,Âù_str, number_of_codes$@The 9r of 'PyxqObject'`[Qtotal&ð= support.calcobjg('2n3Pª%# W±taken up by'[‰ÿ' dynamic arrayn+nk»P3n0P') * (ØG + 1ʨeì(‘*5), êu@ï¢python_onlªxÂ_x!__z]@for èÏrinteger�¤]·.Â5,Ì( #ç'BHILfdspP', 9ö*@' * ,, ofd', 2# x'>À.check_sizeoãf('100H', 1) ðself.check_sizeo%?87s%?20p$0G�0c', 0) �ðdef test_boundary_error_message(¬!):+¾•regex = (û'pack_into requires a buffer of at least 6 ': bytes for Dbing 1 ½at offset 56„\(actualdHv is 1\)arPwith Ëà.assertRaisesRÍ�(struct.÷!, áñß" äQ('b',¥±array(1), 5âÜS _�¢_negative_ã hx_list =i0Ó‡ºÂä Ñr'no space to‡! 4vs¹¡O -2'#ibcp'# it$.¨ðF(b"" È“<1234567Cõ# Wrong bytes length`Wwith ôdRaisesª\errorU É�ŒS5'78Ur# Zero-¾qÅ„€‘/‰M/Q12") ¼Åç÷ Eq@nextF÷, (0x01020304, 5R4 ¿6070809, 105¯b0c0d0e, 1j•BStopµPion, ®O, itÑ3 €ÿarbitrary_buffer‰21‰Çmemoryview(b*a •B- œ3 `·\_hint[rlh = ope.)Bv>3:?('>I"lh3Yk”3elfZ;525!15!05˜À) señ+lf.assertEqual(lh(it), 0) def test_module_func(self): $õ## Sanity check for the global struct.iter_unpack();Oit ="ö '>IB', bytes(range(1, 11))<† ¼Bnext¾ï(0x01020304, 54¿6070809, 105ðRaises(StopIteration, yO, itœ3  g®half_floatfø Little-endian examples from�ð http://en.wikipedia.org/ /H`’precisionjñing-point_format’ÙR_bits*ð__cleanRoundtrip_lisÂ[37ÿ(b'\x00\x3c', 1.0), c0', -2!àff\x7b', 65504$� # (max % Åv }ð04', 2**-14), # ~= 6.10352 * 10**-5 (min pos nùlJ1ËJ2Jt5.96046J8J?subM0M0Ï8!7U"'+inf')_f*-*ô55\x35', 0.333251953125451/3©]gå!le, f in -©FbB3 = Le[::-1]q$ ç$f,2OT'}É}* }E }pif sys.±order == 'l'H«ªýªD. ®H ­Oelse•&•.•=5# C�ÆNaN handling¦³O_nanÏÕl1\xfc'q!_0\xfe!Ö/ff!_01\x7c 7c 7c ¸Ðformatcode, b÷its in format_bits__nan_list: ð self.assertTrue(math.isnan(struct.unpack('Fc[::-1]LMÐ# Check that xàing produces a€ð pattern represent$¶a quiet NaNáà# all exponent=ñs and the msb of ñfraction should5Ube 1.—ŠSed = 16nanS`Equal(.Ñed[1] & 0x7e,1 ^-_(¾Usõ round-to-even behavior,3qfloat__21ing>E = [-H"('Óó'\x00\x01', 2.0**-25 + €35), # R|ðs to minimum subn¥lT 0TI‘UnderflowMázero (nearest ØFmodea¨T6T”U3\xff”C14 -è!24K@Larg‹ÞJ ‹K5VO65),Œ4xŒ6·PSmall¸“µ#3cèB1.0+ì%11ì1O6Ÿ&o**(-10“S“-?!11• HæS2SY#7båB6550×l×9+19qM:8@-U2A'UZU“B+ UôUëbCC-1.0š%11òD"TêTîE&TFfFO-655 %] .0for­rmatcodew<, fÔ ¡Àng_list:  ô%self.assertEqual(bits, struct.pack(formatcode, f)) <õ# This overflows, and so raises an error1J_cð_float__roundingE)•_list = [2ká# Values that 1Ù to infinity.-ÿ('>e', 65520.0),/36O1e308-V W-X<­ VU�9W ­]õBfor ÈB in Ù :ŒyR/#(OH  ƒ,ar ƒbDouble5ingd“d+RrEñb'\x67\xff', 0x1ffdfò * 2**-26), # should be 2047, if j-¬ðed 64>32>16, becomes*8«^+?, fdgÑjãò if __name__ == '__main__'\�unittest.P() # s¨ð slice objects;»ô!particular the indices method. import itertools„operator%sy�óweakref from pickle XÂloads, dumps ­0sup~ñ def evaluate_Ʋ_index(arg)ø1"""·ðHelper function�“convert a€argument¢an integer$!IATypeñP with=@uitaÒòmessage on failure.†„ if hasattr¡,¤¯3__'®>treturn K.#1)€BelseÛ-Š ”(#"¾0ustõÙRs or -P"None@have_P#__û"")uY(ƒ, lengthÊô�ReferencÜ le`a�—\=åKg 8á# Compute step´l4 as§sV=?BE0= 1ø~1is ÿaV-Ñ!# ï׃negativeQAzero¾§$if<< 0Î=ðError("length shñould not be negative") if step == 0:òraise ValueError("slice+3canLqzero") 7ñ# Find lower and upper bounds for startQstop.6/E= -1Š¡< 0 else 0"G¿= length - *ˆ`Comput­2artgæÁ.„vis Noneð=´.Цޙ7‘evaluate_&q_index( qkYiBmax( +Ú,;)*2min-,¡rêP»é?op èBop =ji5ep hkç6æ (opå0ä?op ãozâ*opábreturn8 , 5ò ep # Class providing an _zñ__ method. Used}@test'–±indices. cG0MyI´Âable(object)æ1defW°it__(self, ìeÓAelf." =‰;3dex<5Û< ‹S¿�Test(unit·.0CasužZÁ_constructor�a¬€.assertRÍRs(TypÍ!, °†, Ã, 1, 2, 3, 4~…?rep~ bEqual(%Û(JB)), VK[LhashÙà# Verify clearÓñof SF bug #800796%›Ù] 6(5)_with ?edÕP5).__R<__(!= 0 andL_ != 0úqrange(*Z GÔLþ5m[<]ö,»AÁ9ø l()g)¹ø10), (0, 10, 1–MJ!, zO, 2J2J!1,Ž›J1”JC,-1”P9, -1”CÞ-ÞJ”3ÞJ3�8, -JÁ# issue 3004&s#×L, -9òÐ÷�A /10BE2--1v?0, BÀce(None, -10ñ , -1).indices(10), (9, 03) ð self.assertEqual(slice(None*1G-H2H29Š�0, 9, 1)ˆ/10A/10B T>„8 É9EEù$F%F2 -100, 100 i0b %$¿$dxw~ Ï0x",  /.‚uo{2Å0, (  E2)) R g list(rangeœ÷ )[::sys.maxsize - 1], [0]Cð# Check a variety of start, stopõep and length values, including�#` excee õ(see issue #14794).;ƒvals = [B12**P-2**3]`53, -7 m`1, 7, !1]P¬S:/ Afor „ð _args in itertools.product(£Å, repeat=3):l6" =A&(*Hñ#d—` sF'Ôc”_g#s,|Q&cîY), -3èƒNegativeLð should raise VÕUError×Qwith hÉR)&s(* €Á¼)-1ƒŸZero step}Dù70, �5€xUsing aà ú’$orõthat can't be interpreted as an!#4gerÎg^aa TypeK6 ..âO-N#0.Ó!5T#2, 1X¨T Àises(TypeErrgor):  slice(0, 1å.0).indices(5))ÿwith self.assertRaises(TypeErrT RE.0) Uô8# ... but it should be fine to use a custom class that provides index. ÌŸjEqual(Ú†0), ñV5, 1)ä@0MyIhsable(0)'M%80, P1QM(´ Q)M,1@X*5)4ÄÁdef test_setl_'Sout_g(Tp�tmp = []?¸×‡X(object*`_]aitem__Mk, i, k)-Átmp.append((#ifx = X(êµx[1:2] = 42ŠªÝ>ctmp, [E³1, 2), 42)]X�ýapickle�—As = (£V20, 3€0forÆ€tocol in�71,2>Ñõ = loads(dumps(s,4µ* »Fs, tn#æh15), t;2NotÌid(s), id(t)>cycèÕmyobj(): passzCo = .Ao�÷w = weakref.ref(FENoneC÷support.gc_collect3 Is70(w(Êò if __name__ == "__main__"4@unitõ.ò() """This is a sample module«ádoesn't really-Ñ anything all&²ð interesting. It simply haZ1few<û s, some of which succeed andAfailJP's im 1antoð the numbers reÊ` const!oanotherq@ is ð¯7@runn ofF!se%às. >>> 2+2 40 Cfoo(Õ2"""ø(•54  .B?barB /«`_silly6/up<º.10doczŸ .SQSetup%2Trug¨xw_blankpáNBif 1=í print('a'× #'b)a|±b‰æ1y„x_is_one�À""" >>> qx 1õ""" def y_is_one():'Q>>> y1ð__test__ = {'good': J1 A!42B I""",00'babc!9666Kƒ d}×Esuit import docLdreturn’.DocTestS6` from , ;0supCs # Skipó f _tkinter wasn't built. ..=”_module('.<') Iö tk cannot be initializedLÐrequires('guiB¤€.¬PruntksDmainŸ€run_unit,(Z*DA.get*ð s(text=False, packages=['?Ûà])) if __name^P= '__2__'—12() #T sys “†û1estø„_grammar¬ú (VALID_UNDERSCORE_LITERALS’í/IN<…) L = [(†('0', 0)Uy('1', 1Y9', 917189' () *™314', 314TO314 p \t\t 5 &ðrepr(sys.maxsize),¥ú 1x', ValueErrorœ0 1 † a 1\028RÛ"‰"\u0200"¯ñ ] class IntSub C(intHGpass"*dCases(«.1): Žç£basic(selfLnÀ.assertEqualk(Ô”)B(.ý& 3'ñ # Check that conversion 'ÿ float truncates towards zeroi "-3j-kºH.9),‘&!-3'N5N'N"-3"), (O -3 *à\N{EM SPACE}-3N @ò# Different baseÿÚÈ"10",16), 16Þ]ð conversion fromð strings and variou “omalies åfor s, v in L:0ign`"", "+*-"&*eprefix, , \t� \t\t 9=Sss = >0+ sq&+ ¡#ivv = v¥"if;b== "-"õþ is not ValueError»@[-\?try9ÿself.assertEqual(int(ss), vv)«_excep–Upass E)örepr(-1-sys.maxsizefAx =  Ÿ_x+1, ?,ÐIsInstance(x,TRà# should returt¢ w[1:]), ³6+1)×Q ÒV1e100„ª=->™òSF bug 434186: 0x80W/2 !=E>>1.ð# Worked by accidentðWindows release build, but failed% desRF!’all Linux@s&ñ “2§Çx >> 1, x//2�CC'1' * 6u7k¢Raises(Typ€K,w1u2�‚ï0o123', 0), 83ý.x.z16), 29aäBug 1679: "0x"ÿa valid hex literal0ÅFÆKO, 16š5 0rý5_o", 8i4i_b", 2i4i## 8€1334662:A(�ö, base) wrong answerí3# Vªèõesentations of 2**32 evaluated to 0°Ó# rather than+ inXvú@versI§G1ß' ¿, 429496729ÿ Rÿ 2002022201221111211', 3)F “L', 4BÀ self.ó$assertEqual(int('32244002423141', 5), 4294967296) ]self.?€15501040_4', 6>°21130142235=7=%40O', 8<‘120686574x9<_', 10<�19044405w/11<€9ba46159*/12;�535a79889²3;�2ca5b746v4;€1a20dcd8V1WÛ±Tqa7ffda9uQq704he7gêO€4f5aff66®MÏ3723ai4g', 2Kp281d55i®2Iq1fj8b18:H€1606k7ic®Gamb994açEphek2mglrCpdnchbnm9Aab28jpd9@a8pfgihW?a76beig>`5qmcpq93=`4q0jto«3<uO', 3;Q3aokq¼3:p2qhxjlir:p2br45qb9:a1z141z :ø# tests with base 0õ-his fails on 3.0, but in 2.x the old octal syntax is allowedHr° 0o123 ', ô/83£ Ð 0o123 ', 0)s, 83) ðself.assertEqual(int('000', 0)+ Co123-Yx.?291ˆ%b1Š4- Ÿ 0O123 Ž1 0X21‘d 0B100b54) ò# without base still %10%n_), 12™+0, 1›/[q# tests†² prefix andƒ?!= …š_16), 0ø/8)QÉO2), É–?', ‹ø?', ‹Â3', ‹Að&he code has special checks for the first character af7theHS type„ûñ Raises(ValueError, int, '0b2™506!B5"k"!o8�Ö/o06!O5"k""xg£×/x07"X6#m¥ð# SF bug 1334662:{�(string,-÷) wrong answers:C õproper evaluation of 2**32 + 14õ^/10 1Ï, 4294967297û ð10200202220122111121à3oF ˜ˆ4BÐ3224400242314�5?€15501040@5', ‹°21130142235=7{À97) ô self.assertEqual(int('40ó1', 8), 4294967297) <ÿ12068657455', 9<f_', 10<�19044405w/11<€9ba46159²/12;�535a7988a²3;�2ca5b746v4;�1a20dcd82v5;ÛÚ/16;qa7ffda9u7:q704he7gêO€4f5aff67éMÏ3723ai4h', 2Kp281d55i®2Iq1fj8b18:H€1606k7id®Gamb994açEphek2mgmrCpdnchbnn9Aab28jpd9@a8pfgihW?a76beig>`5qmcpq93=`4q0jto«3<u—3;Q3aokq¼3:¿2qhxjlj', 3:p2br45qc9:a1z141z :Wðdef test_underscores(h!): zöfor lit in VALID_UNDERSCORE_LITERALS.2�if any(ch4;Cw'.eEjJ'_1…continuex‹ /Plit, %–eval(lit)$5qðlit.replace('_', '')SH²º_in IN÷,Àin '.eEjJ'):+ ‰continueõself.assertRaises(ValueError, int, lit, 0)7ñ# Additional test cases with b õ!= 0, only for the constructor:K~öEqual(int("1_00", 3), 9w,ð0_100"), 100) # not valid as a½_eral!s btGæbyte underscor4†0"“r3+4 1_(!hq100_") œð@support.cpython_°1defÙÀ_small_ints(ù)ºñ# Bug #3236: Return .ñ longs from PyLong_FromString^—Nw!IsöA'10'€Ñ% -1%/-1% bK&b'L—õmno_argò³¬) @keywordE0# T1€invokingaP() us 8± arguments.X /|a'100',rf=2), 4‹±”Regex(Typß's'âx�_x=1.2[E Äð»¶•h'=1– î30ýî@int_M^_limiè0"""² Æ32ed /1 ofÞ))‹ï parameter."""ÒÂÀ5Do»–£'HD&/37é ‰A-909‹ÀAn old magic”"ue"t& 2å¶&¿¿=0-(2**234)Ã0ROÃ1# BÝõ2 through 36 are ÌöEë in range(2,37»³ ;=ƒ²†bad_type«À """Noó&t integer types are not valid bases; issue16772.""" õwith self.assertRaises(TypeError):+2Õint('0', 5.5)E'10) FÐdef test_int_²°_indexable(ž‡•class MyI!gobject#ªR�__init__C,+ue'+a‚.value =%”J3dexKDbreturnJKØ@ò# Check out of range–.h1forÔ in 2**100, - Z1, 37ˆrVŸˆ¼A43',jy¡?in-� aEqual(J3101K=�W2)), = 10>6101\@!36@ƒ + 36**2äÁ]ñnon_numeric_input_1Ôà# Test possiblL#n-7b¯õ the argument x, includingÕQ# sub¯ esú2áexplicitly doc=²ed accepted_=õ CustomStr(str): passe#pBytes(b' QArray+a /WÕfactories = [._,G —lambda b:ºb.decode())-å´ ¦memoryview]œ:try7Qfrom ªr import 1 exˆ! IH @ zJelse5†.append(u0('B3)˜NJfö< SÆx = f(b'100':0sub±(Í7(x)Ê(Ezx), 100V.ðif isinstance(x, x", ùÎi?m~, 2), 4nGEömsg = "can't convert non-stringÅ-²ÑVRegexÖ_, msg(Eáx²_ ~R, 'in�literal'njàpA' * 0x:µç¬À selfó!.assertEqual(int(memoryview(b'123')[1:3]), 23) Oself;O\x00?( <(A<(4<ôðdef test_string_float(!):!ñRaises(ValueError, int, '1.2') 3TÜintconversionUö# Test __int__(ƒpclass CöicMissingMethods“—Apassq ¤9Typ£R#()µDz sw(object*{ StJFoo0ÝEÜ �…’return 42w*ªú]}()), 42í | ÞÃfor base in ,ž •@ðIntOverridesTrunc(? +­ã'çAtd,__`)C5-120.¿ ;<ìOJustä£4¢uš¿Exceptional¡3Y1 / 0?Wwith D€ZeroDiviõ#û‘ ¢cz:presult_H‡<Ÿ�Integral(G”7R’Ú'+T~}wR¤sNonInt 4z¨Ì -|ß=½ ’)=ĸD!Êñ# Check that we avoid infinite recu>.z¡rbð NonIntegral()  úclass TruncReturnsNonIntegral(base): 3pdef __t9__(self)/r[ [)V?trykOint(¢)Hÿexcept TypeError as eZ·ý.assertEqual(str(e),œÅ" âted non-@"Hh (type /)"Ù/lsÈ ÷fail("Failed to raise¯with %s" %— (ø", Ýqresult_ M,)) =ý"# Regression test for bugs.python.org/issue16060.B…~BadInt(v¼�?intN42.0¿}`‰ò| ªýVA™‹R¹%s(ÁY ab Ž_#1subè_l ²0 My‚;intsL_7l6 42bT—U+¹ myŠ# =®7)DÏ+/, $ G(S), 42>íO “s, int, Ü'ss¬_vF jKrOTruet/2(u)X&¶ < ¼dCIntSºi' É0bad“& =�ì õðWarns(Deprecation;ing0n =(Z�On, 1!Is1(n)Y„U¯&2(A°À: ó n = int(bad_int) ÿself.assertEqual(n, 1°Is(type(n),K%) DUö = TruncReturnsBadInt(LWwith pðWarns(DeprecationUing):Z¥»J1goo ¼·IntSubclassÁŠ5ÛÖFã]we5T³ðdef test_error_message(Ä{&÷check(s, base=None!µ ÓÐRaises(ValueE^,Ë3Pmsg="ž´%r, %r)" % vŠ)) as cmE!if—@ is š!%Fnt(s¨Oelse1ñ 7 )€cm.excepºŽ.args[0]ïð"invalid literal for?1() =Z­ %d: %r" %.K(10 é ½ûC, s)ÔÕ®f'\xbd'¼?123Î 123 456 'M7'00Pò"# SF bug 1545497: embedded NULs were not detectedè�explicit¹ç�00', 10º¯00 245', 2! /16BA  @Ó# byte stringÈí Ç.b'.á â¸# non-UTF-8jXÖX+bd:ô # lone surrogate in UnicodÍ cº9ud8ê¼½;D¬issue31619A 1â_'1_0_&)dýO0b10 ž±2_3_4_5_6_7ªÿ2_3', 8), 0o12345670123I08_9¢6FxF/89Dð.', 32), 1144132807) if __name__ == "__main__": unittestñ .main() """ Test the API of ñsymtable module.)timport  ð unittest TEST_CODE = \#ñ"sys glob = 42 class Mine: instance_var = 24òdef a_method(p1, p2)04`pass $óspam(a, b, *var, **kw*uaal barSb`!47 xk3 ' P“internal(Dn�return x% (†4foo1› namespace_"A(): f6Q¡ind_block( , 3”¡for ch in Ô.get_children‡¸Qif ch=Q() ==GH&Ñ4ch œS(â.qCase): Utop =.(á, "?", "exec")4ð # These correspond to scopesÐ<.$F = f `top, "Q# '!4, ",+ (O#Ö '!4, ",:foo'NRfoo")"êû£_type(selfÁwÁ.assertEqual A.top±2B), "„s8ò 9g8# <�function?;$N?C‘optimized(HBFalshH6is_6)� B 2@has_®#() /3Tru`ù a ²Onest¯3¬î?is_0®0 Ý› c ÞpÈ�QÖ\5â1á2ÀLfoo.2 ³olineno@ˆ4O), 0A3e‹4#11HÇZM_inf‹S@elf.N¿ ƒq or\1@ðparameters()), ["aybðkw", "var"]) ð expected = ["a", "b€internal kw0varSx"] õself.assertEqual(sorted(func.get_locals()),h)>Dglob?2["b€/"]F •¿†ñfrees(), ("x",)) ƒ�def test_RgÎ!):àÝQTrue(Ðspam.lookup("9S").isC/()—OFals? �declaredH †…= ƒËbx EMineJ�instance_e Í‘­RŒ«�>§Ü? ”¯referenced™^G¢ÄP€FÄ Î# @ é¬parameterséÂfor sym in (FÊg, "kw"©X1symnXÉ ? Èssymbol_ºÙ¤øÕ1lenïA.topP€identifi1)),\Ú  :y…3qñRaises(KeyError, x¬Ã, "not_here"B�namespace�E§CU ("Œ>Et@4À�a_methodE…�@4… Ê…6_�Q SS,”Û!")pB2 isn!ns°" =Ò Ð selfó!.assertEqual(len(ns_test.get_namespaces()), 2) Cself;ÿRaises(ValueError, D!) >@def a _assigned(L!):^[ATrueö.spam.lookup("x").isA)˜=?bar?5top{ˆ?EMine@�a_methodDCFals…internalIB_onnotat`ät1 = symtable. (';`f():\n‡Àx: int\n', '°Wexec'm t2J!t1-Ñchildren()[0]ŒG Î$t2Ä1'x'Èolocal(Å 4aÞ8;9Kglobn t3ÆO = 1 4I/t34× 5 }θo_imporÃ+ ì"ys§B)Ä!¡ÀVYS—(), "top"K�5nMh67- yx@² 4"ý¯class_infoEÎs$('-',^@fileúŒ_correctgñ### Bug tickler: Syntax… = > >  whether e¥ r·d+¨Lðwhile parsing or build rsymbol 24cPchecklk÷(brokencode, offsetg6tryꃌH"ô0, "~¼:iexceptøOas ec `$e.µ", b�Z¹ ¿e.lineno, 1. 9]?els¨‰fail("noبfor %r" % fþ Š"�ðf(x): foo)(", 14) # parse-time  ð0checkfilename("def f(x): global x", 10) # symtable-build-time C. ð ("pass", b"spam", "exec") /ðwith self.assertWarns(Deprecationuing), \595ùRaises(TypeError):+Ž—“ytearray(¡)¢(u¯memoryviewvã&Olisth!è test_eval(†:•symbols =ó@ 42Ì?<:") QosingleS%> U;SàÈareturnÈ"¶‡p if __÷ò__ == '__main__'Ï@unit#.„() from Ó import mock $os „platform•subproces"%sy @temp�-c’warnings ‚“~0sup†“ class PwTTest(G.CCaseáDÍ_architectur¯ reþÇ.+ñ@}ú.skip_unless_symlink>D_via&ÑÁ # issue37629äð8# On Windows, the EXE needs to know where pythonXY.dll and *.pyd is at K±# so we addM�directoryM^Apath>µPYTHONPATH.�tif sys.-r"win32"*b[ðrestore_environ(old }&3os.%v.clear(#eupdateOu(ÀË.addCleanup(…v, dict(q)Ä@ð["Path"] = "{};{}".É5at(56@.dirE(#¨u%>), V â w|?os.\ þsBget( frcmd = [}, '-c',Ç'¾Þ„; print( ý9)']Cp&ßö.Popen(cmd, stdout=üZ.PIPE� p.communicä�`real =J l’}02abs/(ð.TESTFN) ð os.symlink(real, 3) Etry: ñself.assertEqual(get:0), ?@kfinallD¡os.remove(. aðdef test_platform(k)~÷ for aliased in (False, True&¤*_terse( ,dres = t. (j!, I)¤]syste¢ L% <LnodeÜ :# 8oreleas; & >versiony & >omachin| & >Ÿprocessor~ (B\setUp9c.save_²s = sys.QÞ(3git$O_git!ú&ù]arDowCx< šk0ys.| % Œ%ys€ %Œdst_sysÿ Q# OldO.€Ñinput, output/ñ&('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 5(™40809)]',UÒ ('CPython', a 1 lkj :'))kb('Ironmþ 1.0.60816 on .NET 2.0.50727.42¥;z> NŠ ! (Q¯1005.1977)•&0�‘Ûôtruncation, date, tÕºJƒL t ?GCCš~6|{gzdð) \n[GCC]',  ð('CPython', '2.4.3 ‚truncatid„GCC')), A(:& (0Ê, ) \n[GCC]'- srq]pJ)):bû$# branch and revision are not "parsed", but fetched@ù from sys._git. Ignore them* (name, verc,x,udSildno ùdate, compiler) \Nó = platform._sys_^y(input)2ùself.assertEqual(P ¢'%'�˜Q, outmPÑ# Tests for p¡_implementô4(),±�( #- @PbuildÀm45().”Us = {ùô"2.6.1 (r261:67515, Dec 6 2008, 15:26:00›@ 4.01ñApple Computer, Inc. ”� 5370)]"¤ Ptags/tiwA'), ©Tsave_Ü É ÁÀl2", Ë ^ ^ �<'�õ‡÷ö'�4O'GCCA rBIron!� 2.0 (2.0�) on .NETÿ .50727.3053", None, "cli"_þ] !(" ×"};), ¿1g o0920.0Ì_1433)Í-16.1À , ÈÍ~"ÍY7.4 (Ír2.7.0.4ÊAMonoñP30319þ32-bit)Ð.?7.4ЄÖ59Ñk:6107, Mar 2Ò±9, 13:02:18ÒÿJava HotSpot(TM) Client VM (\"å&\"ÜÀ ('JytÀhon', 'trunk ÷ 6107'), "java1.5.0_16") :Ð("Jython", "25 T T-",5" (w: |¿Mar 26 2009ƒ), B(i§2 (63378, =ü , 18:03:29)\n[PyPy 1.0.0]… ('{¬ N~ÿself.save_platformNñ2 W WQ", (' j±/')"v}ÿö for (version_tag, scm, sys¬µ, info in \8ª)?šs.items()ÔCsys."3 = k L ifyŠ is NoneBhûif hasattr(sys, "_git"k)0delÂ.$ f?els\¢+ =„ 1—  ?not¤HáL9 UÄassertEqual(5!.púò_implementation()�:[0]7HmA1Aebranch@2@XrevisÃ3Bdbuild(4?…compilerB25])üðdef test_system_alias(SUeres = Ÿ + Ó #(…release ²_ °_uname© $.×.rßTrue(any(res)"”Âres[0], res.ø- 1-Onode+ 2+. 3.. 4.omachinŠ 5.“processornP@unit°.skipUnlessy.Êðstartswith('winçÑ"windows only]wl˜ü_win32_ARCHITEW6432Ïð# Issue 7860: make sure we get architectõ from the correct variableBÒ# on 64 bit W£é: if PROCESSORŒp existslˆshould bKð using it, per # httòFp://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx Rtry: òwith support.EnvironmentVarGuard() as e ;Aÿif 'PROCESSOR_ARCHITEW6432' in8<4del![E]­6‹2ýCTURE'] = 'foo':ý platform._uname_cache = None-òsystem, node, release, version, machine, poUor = ba.()Võelf.assertEqual(G³1îeî?barî�³îkfinallšM¯Zödef test_java_ver(self)¦8res–'ztif sys.lP == '''EuX¸úTrue(all(res)) ‰_win32Š( B?mac@&>£-if.ÅÕkDarwin×ð# We're on a MacOSXù¡check thatãc´# the right 0 inWùation is returned8ðfd = os.popen('swævs', 'r'�b@realš`for lnZ*fd¢:Àif ln.startsØ¢('ProductV¶':'1sAþrip().split()[-1†:[breakåk.closeú>eFalse(p!is~ ósult_list = res[0]�+'.-Wexpec,;.àlen_diff = lenÂi1) -P •ó# On Snow Leopard, Ä0 re=€s 10.6.0/ š|>> 0»xð.extend(['0'] *—µ �TJ%re6', O#µ#Qù1] claims to contain±5# (ë�dev_stage#n_ £  —l# Thatúno longer availablqðself.assertEquaòl(res[1], ('', W)) ùif sys.byteorder == 'little':*5Ñself.assertIn_2_@i386c™x86_64')):OelseL BEqua®O²'PowerPC') ¬ð@unittest.skipUnless(¶�platformµðdarwin', "OSX only 4"Œ1defð_mac_ver_with_fork(Õ) Ô# Issue7895: b.7ð() crashes when using G Q…out execÿ# Q This„ð checks that the fixDi~v works.> �pid = os.u(Ý›1if 6= 0Ìu# childAoinfo =Þ &§os._exit(05͉# parent<’cpid, sts­�waitpid(0¶�€U <?pid( Tsts, œáLdistÔœô warnings.catch_(ü�t.filter(ß)�'ignore', r'…ð\(\) and linux_�ribution'8P'func ÿs are deprecated .*gƒPendingD'BionWã ’ F re“Ø–(ßC1lib% G•import osº if‹¡path.isdir—butable\/% /RexistÇ0{+'.exe'’ø# Cygwin horrorNnl! =ÊM2 + O1¼. ?6 2< @ôparse_release_fileJUúfor input, output in dã# Examples of N Nš contentsê€('SuSE Loà 9.3 (x86-64)'«09.3":'))4@('SUKÈINUX 10.1 (XLE!#MCi586—K!IµFedora Core@5 (B¼2auxS%–5"TsRed Hat8h²8.0 (PsycheV 'S08.0$X�9 (ShrikV9T"TªEnterprise·À 4 (Nahant)'ð, ('Red Hat Enterprise Linux', '4ÇNahant')), ð('CentOS release -8NNone9VRocks8ñ.2.1 (Cydonia)'•"E ‡1#ò )), # If there's nothing.Ã)):óself.assertEqual(platform._parse_êð_file(input), out  Kðdef test_popen(Reômswindows = (sys.a == "win32")Ii5if 2 ªðcommand = '"{}" -c "print(\'Hello\')"'.¼!atj±executable)©`OelseXP"'{}'X'X"XO")'"X ôwith warnings.catch_(„ò.simplefilter("ignore", DeprecationWRÀ@lG.vº) as stdoutæ8h&# = ê.read().strip(b.Fo.close 9^", 4Ó@data¶Uplop'‰éÀimport sys; P=JSstdinǰ; exit(len( 6))"kôc%'"Î3 = 0”T, 'w'5.in45‚in.writebü-5ret(6PIsNot,N(ret if os.name)N'nt'�vÝurncode = ret—þ79ret;] >> 8@Ð "7&, pà lO0_di^ buË _e¦‚return '"'I3ß±error_condiy BŠÀRaises(TypeE6,÷Bect.Ÿ, 1, 2, 3Ç=[jùa()], [K)&M/‰‘ï"not a number"� OValu&ÚQ#-1?ðB# Issue #12367: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/155606 @unittÿ!est.skipIf(sys.platform.startswith('freebsd'), 'Añ because of a FreeBSD bug: kern/155606')Cñdef test_errno(self):`vö open(__file__, 'rb') as fp)-€fd = fp.)2no(`‹fp.close:tryE,rselect.ƒ([fd], [0Wàexcept OSError–?errRñf.assertEqual(err.ò!, k.EBADF\?lseKbfail("}ñion not raised") >Xüreturned_list_identityiñ# See issue #8329E ¢r, w, x = 1¹Áê`IsNot(@ x{ Òˆ  cmÿñ'for i in 0 1 2 3 4 5 6 7 8 9; do echorðing...; sleep 15ne'ø�p = os.p~0cmdy´h@toutkú(0, 1, 2, 4, 8, 16) + (None,)*10Åÿif support.verboå°print('timed@=', m)ƒ`rfd, wxû p¡=Iif (A`) == (Άm…continue$IJÐline = p.read —Y((,Prepr(J)%"!if! ‹“(oG'EOFYbreak#<-ÌÂ'Unexpected ²à values from{j():', ¶ià1# IÍó16230: Crash onJ� resized 00FŒ_mutatedfaa = []2Öjlass FVK„áÿ†del a[-1IMü�®__stdout__Ò@a[:]Š•F()] * 10’r€jÐ@], aÎ"),íAa[:5)@)) ºótearDownModule(¾Šð reap_children() if __name__A¢"__main__"@unitß.ð() # Tests the attempòðautomatic coercÒ!of$óC locale to a UTF-8@ imE c1$os (sy ðconfig import shutóil from collections import namedtuple €test.sup 8ä.script_helperGñ ( run_python_until_end,ñLinterpreter_requires_environment, ) # Set the list of ways we expect to be able to ask for1ô2"C" locale EXPECTED_C_LOCALE_EQUIVALENTS = ["C", "invalid.ascii"]~Bour na(añ default encoding used in~C|#0¦filesystem31and/ÿstandard streams³òSTREAM_ENCODING = "©,/FS(NÐ 5Îówhen none is specifiedró_COERCION_IN_DEFAULTap = TrueCô Apply some platform dependent overrides if sys.$ò.startswith("linux"):9)f ~¢is_android w2# A ¦s* us§QUTF-8–0allt’ŽQfacesdD6ƒoutf-8"4 ‹0Helse²Låñ distros typically alias&SPOSIXY� directlyÙ!C…##.ò TODO: Once https://bugs.œð.org/issue30672í÷addressed, we'll beO  wðcheck this case uncondi.Â8Rˆ0.ap!("æ_") el %aiP# AIX°¼s iso8859-1ˆÅ, other *nixˆs5a ASCII¤ òcö4 ò0 Ò == "darwin" F# FS2is ®�on macOS§ seo8cygoC'!C.{r"# @ñ Work out a robust dynamic’Tóthat doesn't rely onI:!CPc's own¯` handl¢‘machinery4bm AFalsnQNote Dabov+½ðs are still wrong(œ¹ñ s, such as: # * Windows õPYTHONLEGACYWINDOWSFSŽ!et65AnybvAthan¥š®uses latin¨B�1re ! iUƒa simplefõw * ‰GÀ where the dðnefault locale is something other than "C" # # Options for dealing with this: # * Don't set the PY_COERCE_C_LOCALE preprocessoE@finiUô on # such platforms (e.g. it isXÀon Windows) r@Fix lÀtest expectaR�s to matcŸ…e actual[ð behaviour # In ordïBo ge¼@warnwmessageOSup ask1ed,~³candidate #K°here must mÔ£ ar^nròin Python/pylifecycle.c _C_UTF8_7ñS = ("C.UTF-8", "C.utf )ÇTtô's no reliable cross-RÐ way of checkÞŒñalias # lists, soÕDonly2@know1PwhichCSthese:Ðs will work #G`to tryEm"hB.set €(). We di³at in a subEðn setUpModule() below to avoid alter‘YT– qrunner.¸ IfŠEevanïm[  attributeÔðist, and we're not oœA@ # wf3 wež–PlwaysÀ cerwe alsojGRt # `©Ó.nl_langinfo(‘CODESET)`F s,c if]Rfailsf°interpreter‰tCskip†‘ coercion¡øthat particular t}! __‰_‚  = bool( �4ys.û °in ("darwin‡plinux")200hasOÕ7, "a' |ò") ) def _set_F_in_[q_name):uôcmd_fmt = "imporás; print2|Xñ.LC_CTYPE, '{}'))"N?if q"# V"reqcvalid È,•`to be °1pedkH½c+= "; Ààsys; sys.exit(…³O×s¿ccmd = V.Fa4z²result, py_1Qrun_pˆð_until_end("-c",L‘, PYTHONCÍC”C='')MRturn Tð.rc == 0 _fields™pfsencod±`stdin_üu stdout 2err � lc_ctype sall" _EC0Det0 = ‹dtuple("3", €›) class "(QPð# XXX (ncoghlan): Us¹AJSON[àchild state rer0mayáÁless fragileðCHILD_PROCESS_SCRIPT‘;".join([& ¿–sys, os",ÊÔgetfilesystemU?()).m.'ð + ':' + sys.stdiÓn.errors)", ø"print(sys.stdout.encoding + ':' + @ ?err@@ÿos.environ.get('LANG', 'not set')´ 4C_CTYPE8 ?ALL61]) *Á@classmethodõdef get_expected_details(cls, coercionT, fs_Y‡, stream¡env_vars):^œ´"""Returns eó child process sÔ for a given d5"""J_o, =xv + ":{}*°# stdin and ðout should use surrogateescape either beca5thes#Ù triggered, o-Á C locale waÍICµ³_info = 2*[Ç›.format("�5")]<È4err¾aalwaysÅöbackslashreplac³pŒ.append(r <5"))s¤„_lang = ÒÏ"ÏC", "Ï–").lower(@%if36 býc_ctype = CLI_COERCION_TARGETZOelseJ °K´ ’>allö_C_ALLD $nväOEang,ö#_lð 5all}r)P dict�(m*Ú0, *éUQ)._as2)åkstaticæà_handle_output¦Êiations(data±²Adjust the /B to @P plat»ò specific idiosyncrasiesiée* Some1õs report ASCII as ANSI_X3.4-196881US-D2öUTF-8 instead of utf-i]0 = .S:(b"¢¶", b"ascii"ñ29£3 @2ataJ³E °”rieves fsXPandar$ȉZrom a¦�×Î(L„�derr_line -Ð,3: EŸDqþ‚eager de¹?àstderr_lines: ó'result of calling splitlines() on the stderr output ñThe child is run in isolated mode if@õ current interpreter supportsNUthat.5""" ¥ , py_cmd =lõ_python_until_end(/žÐ"-X", "utf8=0 ù-c", cls.CHILD_PROCESS_SCRIPT,<–**env_varœ)!rif not “•.rc == 0:|Rfail(³?ó# All subprocessTs;õthis test case should be pure ASCIIh’adjusted_”! =Üs_handleÃiations(”6outŒqstdout_ì; = Sø.decode("ascii").ˆÿø_encoding_details = dict(cls(*gQ)._as)ˆ5errˆ«=errƒrstrip(Œbreturn’ “,Ågc # D­o¥ðshared library warn@emitÐ atwòtime LEGACY_LOCALE_WARNING = ƒ!"Pš.ò initialized with LC_CTYPE=C (a locale@defa�ì "]ð), which may cause Uni¤ð compatibility problems. Us„C.UTF-8,Q C.Q, or õ (if available) as alternative-e$leI»sþïecommended." )_4CLIì�coerciond ÄCLI_COERCIONcM_FMTgPdetec¡W:c kôed to {} (set another�f‘or PYTHONu"ECÝ =0:0dis ¡õYÄ’behavior)øù AVAILABLE_TARGETS = None ÒP7ò def setUpModule()n}global o›swÞ.ifYçû–ƒí#àk  already dô"›| ±R = []wa# Find3ctarget¥sŸ)$e SasystemZBfor 7_¥²in _C_UTF8_ÐS¹sif _set+F_in_–(GqÈ Á@.app� 5ÒI„4# C bis expÊ0to ÞzWfirstþdö“è. =Âð[0] CLI_COEùRCION_WARNING = CLI_COEÉ_FMT.format( ô"TARGET) class _LocaleHandlingTestCase(unittest.â): # Base =ñto check expected lN# hO± behaviour >Qdef _3ñ_child_encoding_details(self,,n �env_vars0¦5_fsy<ostream@'warningµ”coercion_d‰A"""C€]the C}@for ò given process environment•J¢Parametersçu3:ïôsys.getfilesystemЙ() resultËN ERA ½’standard 0sMRó: stderr output to¨• (if any)?5""" §C = E‹DŠØ¥œpI®¿,„Œ_lines =Sw '(®”  Ä=æ"WÌî|÷¥Þ.assertEqual(dê=#if˜3ed_»Ÿs is None}'E= []� †|,eõôÐConfigurationç/s(s # &Yølicit external cJA viawq@>amethodÎ`setUpC”C(clsrïñ# This relies on *�Module() `ñ ng been run, so it can't be`G•%ed @äpskipUnl•decorator9òif not AVAILABLE_CS¬eraise R@Skip-ô("No C-with-UTF-8¥²available")†q_V‚_target_S_d'")::Þ1Exp– ly!rting a Ctpshould ¡Fsame¢& a`#‘sSuwhen im\} ng_Jthatc5œ‘maxDiff =Ü­¢– = "utf-8š'ðstream_encodingÓ = "utf-8" õbase_var_dict = {!»"LANG": "",C_CTYPE?ALLüPYTHONCOERCECLOCALA}gpfor envœR in (‹D, "L{%):-¬1Ðlocale_to_set7úAVAILABLE_TARGETS48ð# XXX (ncoghlan): õù=UTF-8 doesn't appear to work as{Gðexpected, so skip that combination ´?nowMñSee https://bugs.python.org/issue30672A­discussionH%ifD2== CZ and )ð"Ò†continue7ówith self.subTest(´= 83²configured_˜=È è@µ Å}.copy() 84[ž:] = 6àô_check_child_encoding_details(Yï‰ -5_fs^M/ostreamQ8ßwarnings=None &”coercion_öò =False) @test.support.c÷²_only @unitÒkipUnless(sys@R.get_ 5R("PY_k3_C_m)³#"C ›ñ disabled at build time") class LjCÉú2s(_€HandlingCCaseÀ #  implicit re­"ur `of the°ò ironment during CLI startup‚Ddef �3_¹(®çvh (o3e_cqì_Dk .?Tru}p**extras…@"""CÌoùh¶S‰various ¢s}CªParameters1U$: ñ@ sys�¤filesystem?™() resultw �I8¤ƒstandard½ ’4ðe_c_locale: settùing to use for PYTHONCOERCECLOCALE ûNone: don't set the variable at all2Cstr:'1lue5!inùchild's environment<ôexpected_warnings:  û lines on stderr@øtra_vars: additionalo»sÐÕin subprocessN5""" ðself.maxDiff =  õ if not AVAILABLE_TARGETS:"Nð # Locale coercion is disEQd whe `re areiÁany target l9šO€fs_encodÍÒ= EXPECTED_C_ÂÉ_FS_ENCODING‡ostream< oSTREAM@¾_–y= Falsef%if¶É "ÄC#¤ = [LEGACYdžWARNING]n@baseà™_dict = {W»"LANG": "",C_CTYPE?ALL '}g ™¤.update(ex�))"ifBe_c_Û CX 6 U/["�<] =P.ñ# Check behaviouróÁddefaul]�Qwith ïƒsubTest()«Z=True\Ë£=5ï)ä#ifÀ_…ãION_IN_DEFAULT  2n�> RØ3_Œ5ion@? 7Oelse€Á <s4ö# On Android CLI&cprinte40allX u#2öû are undefined or empty. WhenHàthis code path�Arun $Áð['LC_ALL'] == 'C',� HÕOÌ.xóif (test.support.is_a9and,aÏ?= [H]€?ç _cR_ÉH™_details(±( T Ö< Ú @À  ÿ_expected_warnings, *•_coercionL%) Dõ$# Check behaviour for explicitly configured locales<*õ_to_set in EXPECTED_C_LOCALE_EQUIVALENTS:<®@penv_var:ú("LANG", "LC_CTYPE")15ówith self.subTest(C= ‚nominal_¾=Å@ÒPYTHONCOERCECç=f3e_cU»¿ðvar_dict = baseüy.copy() 04[â3] =Œ³6Úáon successful °?ion=a _cô _child_encoding_details(–0Æ %fsUD&ostreamH/f/ßW mŸdef test_<@_not@(w9Ò# This should±óe to the first available targetµ by defaultß\.Ó¥p("utf-8} ÉÐS=None9ÌNzeroÍð*Any* string other than "0" isj@sidejQ"set"Š’gpurposy´# and henceQresul�Ñ2`ion bes en*d€@settPin ("ÿ1@true\false†I-sL0setãûOI=* è s runtime :Qclegacy(ÌÕD÷ D"‹"î •a=[CLI_wâION_WARNING]) З KšCThe —ŽrU:disVJ ÀCALE_FS_ENCODING, ÿEXPECTED_C_LOCALE_STREAM_ENCOIÿcoerce_c_locale="0"„;õion_expected=False)Ãõ2# Setting LC_ALL=C shouldn't make any difference to the behaviourJµself._check«_€( /FS ER_'/"C„/;’def test_Y _set_to_C(P!):$o ©§q render” tÅ ineffectiveGV¦¥ONoneùN=§1~ð# And result in a warn;õabout a lack of ‰¿mpatibility‚²"òù„¦_hÄings=[LEGACYB�WARNING]   xSmain(i‰ð.support.run_unit(¿L„öConfigurationTests’"4erc>uNcðeap_children() if __name__ == "__Ÿ2__" =À() from collâ`ons im·s deque ÀÐ class basedP�__init__qC, el ó.tel = elBdmyset(H-I�containsMureturn TU?seqSugetitemRnqžQ[RD][n]¥“CŽ(.3aseDµRpcommon_ s!eàa = base_set(13) ¶b = myset(1xc = seqöself.assertIn(1, b/ No0;c; ÿRaises(TypeError, lambda: 1 in aT5 3not9 °# test charestringçßIn('c', 'abc'z &'d%H"Dfe@à@NoneÄ¢=1defáð _builtin_sequence_types(á!):+ò# a collection o=Ss on A%A A:Æa = range(10Pfor i”adhw[/i,ÌR/16 a Šgtuple(!‰aêclass Deviant1Ñ"""Behaves st8õly when compared Ñ1RThis Qù is designed to make sure that the contains codeGRworksh)ðlist is modified duÿEYheck.>9""" aL@ = G(ÅF(15)þ¹�a__eq__lw, others%"ifj == 12. 7vª.remove(12o&*3*4*†return 0–b§é5(),õ.#)6 mÑ_nonreflexive#¾ñment and equalityÈðs involving ele%sù&arë # ê²necessarilyE/¢themselves•-XeMyNonR˜gobjectš*ÃÎ0FFals—BChash b$=&28£ð values = float('nan'), 1, ö–+, ÄȰconstructorF²!, &ñ , dict.fromkeys, set, frozen d2øIMÜs¸‰@er =ׂ(ΞõYÒRÁ*erO'w0In(1,[/ Ràself.assertTru÷e(container == constructor(values)) îself.assertTru>K!) 5ð def test_block_fallback(E!):#[!# Ding #ƒ with __�¥s__ = None5’class ByC¿‡s(objectW[‚F{{, other+/·return Falsj( =hƒÜ†‘ _°"""Is not af('zRThis Uñis a perfectly good iterable (asWUed byBðlist(bc)), as wellqinherit`=romZ Crer, butƒù prevents the usualBÄ"to´qtion in/_ù protocol. ThatBðis, normally, 0<�bc would" F1 toRšequivalenDòof any(x==0 for xF)×’here it's{yed from… do19so.9"""a›!__] ÷–RwhileUõZyieldß¹ ÿ bc– {™`¥Ë(Cc! >âIô Raises(TypeError, lambda: À) if __name¯Â= '__main__'÷@unit.¤() import  ƒ@ doc$ ÂDocTestSuite!0supCJtweakrefñgc # Modules under8 t_thread4ing Âing_local žJWeakp`pass qtarget(1 , ’W1 = @Ž(.| 7€.append(qref.ref %))ŒPBaseLž':Qˆx^\_refsœÚ× "20‘y 5 7100ðTH3, nýZ‘0 = .+(xç÷Q = [] 4¾i¾hrange(OEt = »!.TÓ(†=}, args=”yHg.start�GjoinRdel tg ˜gc.collec9Þ%‘Equal(len¸Ý)Al# XXX kR keepa3!ofíÃlast stoppedöf alive¦@deadhEQþ "in�Àist if weak(Ã) is None] õself.assertIn(len(deadlist), (n-1, n)) 0õ-# Assignment to the same thread local frees it sometimes (!)E%.¡othervar =˜"¶gc.collect(7šÑ = [weak for !in·1 if (í%÷), ðdef test_derived(>%):¶Ð# Issue 3088:‰Þeua às switch insid6§e __init__G4of 2Aing.0 uq class,zCper-y§dictionaryHñis created but not correctly set onHwobject.:ñThe first member.Æmay be bogus-pimport çA¤ L %!._Ä,€Pþ' $W¶.sleep(0.01Q# =e£V;f(iL/e.x = i¦`ñ# Simply check thatqvariabl¾ 4 >?cEqual(g7, i’€with sup(r.start_¶"s(åTAö(target=f, args=(i,)ô± ëi in range(10)BpassÈ!Çì_cycle_dealloc‰ð # http://bugs.python.org/iìE6990ö‰Æ0sÿ#¥ed = False`Ce1 =I2HEven /e2?ø+f(1non„ t-¡Â# 1) Involveha!a 0 *˜ó)aH�.append( Óò[0].foo = 'bar'«>q# 2) GCš.£ (triggers¡module.c::Ïi_clear¤‚# before¤ï Š?delÞŽ—Xe1.seƒP2.wai b4) NewI€s shouldPFempt¶CŒp = all(¶rhasattr_�, 'foo')î— svt _÷t’h-e1Á?# 3½"re�ðoriginal's address. C}5ing `# them¯3ý  overwriteÌJñstate and avoidH&buVûÀange(10)]  ‘e2.set() Å t.join() ðself.assertTrue(p d!ðdef test_arguments(0%):?õ# Issue 1522237Ñclass MyLocal50._l <•b�__init__'Ð, *args, **kw 15¤Âe6a=1éºêñRaises(TypeError, ¢), J/rt7 16_7Aone_ ÛcÍXð_failed = "No eŒõ message set or cleared."\wobj = c×øe1 = threading.Evenö/e2Q…7f1(�fÕobj.x = 'foo',y:bar@del 8y0+e1‡E`e2.wai§,ˆ2ˆ6tryp:Qfoo =kx?òexcept Attributß?ò# This is expected -- we haven't}@in t,_Y yet!rv ÌP" # ¦)ed,Nelse� >ñ('Incorrectly got value %r from Q‰ %r\n' %_‹ †(foo, c)"ñsys.stderr.write¤.’Ë,t]Tg—(target=fapt1.starÓ8$e1åtŒ N2§-t2N$t2¿JÈe£Ìðdone; just let t1 know it can exit, and x… for it.A,1n$ª JFals3EÓAÓ ?2ingemqZ57ðOA_sub X †S#W ŽR"""ToOTthat VPes beÆ properly.""‘½ tåddict_a¦¶W, clsç'lsé\”5“`Equal(#!__`¶_, {'x': 5}XBwithïÉÕ 2‡gTU = {}N!%¦ Û» �l )Àelf._local) ñ def test_dict_attribute_subclass(self):,0x LocalS#0._l*.Q"""To`d that Vões behave properly."""et/._—(y!) 2Ãÿcycle_collection¼XÍ£BpassHqx = X()X.×2 = ” .8x6öwr = weakref.ref(xRFdel *3gc.°UkòassertIsNone(wr()) ~aThread �Test(unit-.¥Case, Base!•¢Q = _tA³V"PyX5ing:[%2ingn?5 ¥Smain(’‰suite = ÁS!@.addÚ@(Doc!'Æk"')e 4[Bmake:çä7 •'V_orig_™(`setUp(° Í4M¬,E�tearDownH¢¦ %Y ,3{Ó=$, ›= — ;»Äsupport.run_ª(œð) if __name__ == '__<2__'ÁBP() imG” datetimeSQ from‡.r 2òcpython_only try[‚Ñcapi except IgRError)"0 = ©ydstructâDionsñitertools # The�ñ cases here cover several paths through the funäð calling # code. N±y depend on-ÒMETH_XXX flagŠ is used to•ine a C #Xñ , which can't be verified LP7Z. Ifb@declG orQO� changes,.sï“s may notí×Rrightï.™#CFì^Calls“"):À¼st_varargs0X±Raises(TypeÏó, {}.__contains__¡ T1T 7/(0929�o, 0, 1Z\0_ext^Ëw¨Àntains__(*()3) õexcept TypeError:!Qpass ö def test_varargs1_ext(self)3ÿ{}.__contains__(*(0,))A2A6tryN�R_1, 2)ÀHJelse^Âraise Runtimÿ¬L1_kwìû€.assertRG%s(D+, ·_, x=2\0>, ya0oldª<0_0¼Œ{}.keys(“212î O?, 0Q2Q$?, 1T0BÛ-*(yÞ9{ÖÅB1'q ¤¤Z¦0IGTº!R²÷2÷"?x=2¬ 1¬X �[].count$-1_É2(X/1_¬Q!, ƒ A3/1_­ +M(¿(,R/1_Ó’1Ì߯ MÇX§Àgs1_0_kw(selSf): ñself.assertRaises(TypeError, [].count, x=2) 5ðdef test_oldargs1_1_kw(HW/{}[ 2['ax=2, y·ñ @cpython_only class CFunctionCallsñÐMessages(unitä».TestCase):ý0varý0øó2msg = r"__contains__\(\) takes exactly one argument \(0 given\)" — P ˜XRegex�ˆmsg, {}.k ¤§2§32§5o, 0, 1­3­·^from_bytesSàat most 2 posiÑ%al\_s \(3¶&Fint.tÿ, b'a', 'little', FalseÆ ¦no keywordÀ-_]£e«ÿb¨3¨Gbool C2T8 4�o^index’ $Ö1[].Y— 5— hasattr™>X˜ 6˜ ?get˜BX˜ 7˜ Onext->U’ 8’ Opack’(ÀRegex(TypeErñ-ror, msg, struct.pack, x=2) def test_varargs9_kw(self): $�msg = r"^=õ_into\(\) takes no keyword arguments$"<Kÿ .assertRaisesRegex(TypeErža£ /10¤ _index >ñcollections.deque().j© 1© M¨>æSí O("")´ 2´ Ïstaticmethod¼@]Ÿ, func=id§/13§ _class¦D\¥4¥ wproductG�at most 1RÏ \(2 given\)]ŒÌ£itertools.“ÿ, 0, repeat=1, foo//15ã aImportèç2ç_s \(3èFŽâ@nameàbpath=2è3p6è ?minàp1minØadefaul»?keyÚ7Ú Oprin£4¼5¼FˆÞ0sepµ1endÚâile=3, flush=4Å5Å0oldÜ?0_1ÛGkeysÃ&noÍD \(1ØØ0{}.[?, 0”2”# ”ÀsertRaisesReñ6gex(TypeError, msg, {}.keys, 0, 1) def test_oldargs0_1_kw(self):"&€msg = r"?õ\(\) takes no keyword arguments"5Dÿ.assertRaisesRe– ?x=2•2•h?, yš@1_0(è,Wcount-µexactly one.Ï \(0 given\)91[].d5?1_2›,2›._, 1, Ö?1_0ÖÛ?l23/, m1 —L/{}›  ›L4x=2  6Àpyfunc(arg1,Ñ2†return [7] 2z_noarg(."ð" class PythonC :QramethodÕr x¨|? µ9‡4@‹u„_C(clsÇ0D#""er@staticKLI!6øPYTHON_INSTANCE ='ñ () IGNORE_RESULT = object1@cpTS_onlyfðFastCallTests(unit .CCase“ # ð calls with positionalùø×ñCALLS_POSARGS = (0# (/¸ós: tuple, resultÁ'ú -cq2h+(�1, (d0, [2]),t##! N5outO Nc, (), Qä ›sE½·.#ÞQ5?"),7õ 89:áðinstance methods  ð(PYTHON_INSTANCE.method, (1, 2), [C]), 1 2Ñ_noarg, (), " "5 eclass_m5; jstatic<=®õ # C function: METH_NOARGS"‚(globals»õIGNORE_RESULT), 'IO (i2¿"hello",), G:VAR‘1dir€H#" |çwKEYWORDéïmin, (5, 9), 5Ý †FASTCALLäBdivmü000, 33), (30, 10)MRtype • –}W¦GCLAS£Ðint.from_byte“ú b'\x01\x00', 'little'), 1rþbpo-30524: Test that calling a C ‘õ with no argumentêÿ# doesn't crash (ignore the result)Εdatetime. ?nowh^)n#þs¥@posiÁåal and keyword¹sº­@S_KWLA = (W0# (,0ôs: tuple, kwargs: dict,×�5ePython=Š2E.u+2(py` (1û¿{'arg2': 2}>-1), +1': 1, 6Ä�ƒinstanceV†Ék–=;¦ mÝï•rax, ([];Ádefault': 9}¨’ƉW ãpuorder':g}gä(F:Js': ªP ë¢def check_XT(selfŽÅ, expected): %if: ish&¯ereturn9ZÒ.assertEqual(rek“�test_fast„”‚Ÿó_PyObject_FastCall(Õ}1for:ueA in Š®0POS¯ ¹˜%0subο=dµ=’qÒ@ = _Á‚capi.pyo¥ðfastcall(func, akrgs) òself.check_result(Í, expected) 5Íif not args:a#€=NULL, n(/=0)mð = _testcapi.pyobject_faÞll(func, NoneÀnÄ@def h[`_dict(@)ɲ# Test _PyO‰�FastCallD-Bfor œâ2@ in Tæ.CALLS_POSARGSa´Bwith%0subpæ=O=T–5@# kw] TPôiZž/{}œ3.{}ôš"´",m �qÅqOÛ"9r¾�4¼"‘Mº :ÓB/KWA%bP{Uš(Š�keywordsŽK1’q_names“'ý—H£(µ¡.()M8œ"kwÀS ZDÆÀbject_fastcaòllkeywords(func, None?) òself.check_result(Ï, expected) 9¿# kwnames=(ZHð = _testcapi.pyobject_fa­/()Q«Bfor ‚args, kwÖA in QÙCALLS_KWARGS:êBwith$qsubTestS=V=S[=)Dr(’ = tuple()_.keysëU1 = +3_value5m aÅr ` if __Bò__ == "__main__"@unitþ.P() # Hðing the line trace facility. from 5° import sup T4sys tdifflib"gcM²TtoolsREwrap5òasyncio class‘rcontextÆB"""CÒ manager that*ñ s its enter and exit."""K de pinit__(R¡, output, Ì..# =&DC2" =:•`}aRq.appendƒ.HÖAx¡Ÿ*exc_infoK -”);KÑ @Aeƒhronous MaÑNaOZÀ …V# H].O Piter(Cable¥£„vert an 0 to6}5tor¤*x2bleõwð(yield x # A very basic example. If this fails, we'reMàdeep trouble. S:(°¡return 1 õ.events = [(0, 'call'),�P(1, '7Y0')]´`Many o¢eR s below arxÀicky because�°y involve p`statem—2. #èeÜFQlicitÉRrol fUkound a>@ (in…±except # clqsor else�) under wXòconditions do you set a0ðnumber # following that clauseð ? # The entire "while 0:" statement is optimized away. No code # exists for it, so the line numbers skip directly from "del x" # to "x = 1". def arigo_example(): x = 1 8 « Apass .( aJñ.events = [(0, 'call'),0= Ÿ(1, 'line% 2%5%�return')]–¡check thatMñ!s consisting of just one instruction get traced:LAone_ _ÊM 3 14 5/ (6? (37&8òdef no_pop_tops():Ù1# 0ëè"# [ÃÀa in range(2<1# 28-Cif aOE # 3\5# 4Jelse85876 Áƒ€}z/(6�i44i2r&Pblock(“y‰ ^Rnot yƒª1blaê¨Cª ,E? ($%  ed$#d" -ÑßL#!# #G: ûž (-ïMp (-ÀÃÚ Ñu!] Uraiseô` ExcepE#Qtest_6'tr 1s()e;Bv as exc7PT1s)&_À),  ç(-2, 'line'),  #Ÿexception( _retur%oL3–4"�ò] def _settrace_and_(afunc):Dsys.(ñ_getframe().f_back.f_E1 = MpGo ” / Eò.events = [(1, 'Ê/')çGaiseÉæ:(raß RuntimeErrorý$ …2tryŽG  1: kv as excGLpass5L4†•(Ž&(–&*·²# implicit ñ* example # This test is interesting because of the else: d# part°code. The Ñ generate for:0trui4ðif contains a jumpZt/i� branch. XQmpileOnaFs anÙ"Ú�None" # IËanally,W#coDavisitsÎð statement # and stores $»q numberÎn;Ànext instrucº« V? �§.Êi¹_“()Qa = 5˜b –if a == b‘1a+1):Ý+ ^¨�0, 'calluK  ' ö'îÁN6¨ Ã'fÆô # Tight loop with while(1)Ñ (SF #765624)¦t21 ¨@item,±range(0, 3)� ~Qi = 0‘n& 1«ÉLƒ[i]; i+=Ôa Indexþ6á ™ã å? (çÀ  Ó(3, 'line'), /(4)5)”Ÿexceptionû6Ò7)ñreturn')] def tighterloop_example():”ñitems = range(1, 4)2try!²Qi = 0�while 1: @1[i]÷¶ IndexErrorCopass ‰`.eventƒ¯[(0, 'call61 2)¬?Õ)CŒƒU¬) ƒàgenerator_func‚ j¡yield TrueQo±"continued"gfinallž""ìi êõ# any() will leave the 0ñ before its endl1x =6%¾!) ##F following ñòs were not traceM„for x inl0ƒåvy = x h½(/ (÷0 (-¬t? (-)? (-Ô+-( -®ƒ? (-T+³1] +Æ'[(7 (o#�')] * 10>Ky°) class Temðâ__init__(self,„_v_mT=Nonehopcode˜A.Ä@, =TÀts sÿ elf.trace_opcode_events = # s7*1[] ðdef _reconfigure_frame(-!, !):)F0if }5lin{¶is not None/3C2.f_š3¨Fh åj5 l/œó!, (W, argÿ¶-ä)¾'A¡s.append((#0.f_#no`)4greturn^ ž¯WithGenexp¨7ö(o for o in [1]�Á4€ class TªôTestCase(unittest."):ëñ # Disable gc collection whenØñing, otherwise therñ# deallocators may be1±ed as well.*ëBsetUC Øðusing_gc = gc.isen�&d(Bgc.d£,ñaddCleanup(sys.setS , g2())êˆ�tearDown΋bŽ M2gc.—(KÕ@staticmethodåBmakeq'r(\Ð"""Helper to 3 w ŠA subª es Dñrs differently"""fÚ³ßr‘Üdcomparâ , ùs_offsetþ³s, expected’¬?‹ = [(l ->)¸`(l, e)½-]š"ifÀLs !=d Q¾Ufail(=Û"VA didÛSmatchNašn:\n" +8�\n".join(8Plib.n r([str(x»x¶ ý-],K‡K(])bƒrun_and_އDfunc€o¯2r =� @–ÌÚ(1 "^ (*y›þ(>1.__Ò _.co_first9/no ޲ßn ëýŒ#/� , .Wrá,O2PŽM YE h6À self.coÿmpare_events(func.__code__.co_firstlineno, rtracer.H!, I !) 9ñdef test_set_and_retrieve_none(self):*fqsys.setVe(None)passert "g"P) is 'l ˜ lš‡fn(*argsƒ‡BpassSs•&fn“6try»*¤%fnÈkfinall9 cÑ >Œ01_basicÅ@P.run_d(# ÞŸ_02_arigo: #s_exampluB¿3_one_instrF '_< ‰ÿ4_no_pop_blocksK + J5J?topH) Fo6_call‡ " 8n7_rais¼6elf‹|( Ë8 ã?urn‡ $2(€2 —9W¤ V1 U10_iret  (%AÏ11_tightloopè ('J2J/erL)N‡Ú�13_genex– $VratorHîñ# issue1265: if the Û õtion contains a IUY# and:d;fnotherAÈ�@that`not coÀ÷tely exhausted,•‡stopped.?aWorse:$'œÐ' clause was WXinvok7ãAr = €Rmake_(Aš Ô.QWithGw-cI`õÍ KÚ2VçP14_onþLr_ifíy+s(tõif True: x=False£è el¤ x=" �% 0l(À onlineWrs, Ê[(0, 'call')® (1, 'line3 ±return')]) lñ def test_15_loops(self):Œõ*# issue1750076: "while" expression is skipped by debuggerBcÇfor_example(]aûfor x in range(2#EpassO õ.run_and_compare(/m 7Q#2Q…4!N ŸÏ@uB0# W”“ð should be traced on every å .Yx = 2mf x > 0Šex -= 10ŽN»�Bá4ª4;N ª¦I€6_blank_Ÿ Oånamespace = {}G`exec("D°f():\n" + "P* 256 |5", D)@‡5_["f"]ˆ/57V2 ‘7_none_f_…ZIZó 20041: fix TypeError when 9aµet to None.ö0Opcodes´2oLà events enableò!d""" def compare_events(self, line_offset, £, expected+!):DH¤skip_opcodHã = [e for e inCÒ if e[1] != '/%']Erif len(nV) > 1aeðelf.assertLess(-y(),F,^B umsg="NoŒ§õ received by the tracer")M‹super().< 6›B†Ñ@staticmethodd˜Rmake_z(k�return T“( zñ=True) class Raising0ôFuncTestCase(unittest.e|QsetUp :ñ.addCleanup(sys.setƒ , g2())ÚL Ls, frameQW, arg_B"""Ajñ function that raises an excepñin response to a6¥specificJM.ðƒêA == Ò_0OnE qð ValueError # just so«2ing Âisn't Runtim)ŽKelseT¿z)f% 7TheoÖ;f�!'s³Ecase‡`we're íqing, so*('T']l fires9¶0EB ëUx = 0„|uy = 1/x1@run_ºB_fory'E .0estÿ*at.³dˆ5ÚCgivež5 is™©handled OK/9:tryizAange4÷getrecursionlimit() + 1Ë,Tbö.3ˆ% w².f(2÷Ý ·<6pas·oRail("aÅ#noÄ'd!C 7 ƒL/‘ counter TSeset"j # ÇÓ½ž&of2s4ÓÈeach kind ofõ.Ç´�est_callvš•“'-'gAA- AìC/ EiÀion(self):  ðself.run_test_for_event('exception') ,Adef %Àtrash_stack(?!): $'f(ûfor i in range(5#õprint(i) # line tracing will raise an ”� at this-ŸG£ûg(frame, why, extraqÀif (why == 'mU' andÃHF0.f_" no-óf.__code__.co_first;+ 2dB·ðRuntimeError("i am cAYing")v†return gÐpsys.set 6e(g.6trytk&f(% x -Q# theËÔ is really thSúdoesn't segfault=™import gc»¨gc.collect‰:lse=.r.fail("¦òion not propagated") Ìo*¯_argumentswYx = 0¦ù—is shouldV› )åx.no_such_attr“_'[, argû_4G ·@type¤j,÷0e =Vv)=õassertIsInstance(4, E² 8WPexist^ = bgb8 a(Ša -’¨’ Attribut£®is expecte™Epass0fin¿ I ­íX�# 'Jump'ý�s: assign ;to ñƒwithin a”@func� # movesDPexecuQ posi ð - it's how debuggers impleº0 a �ñ # command (aka. "Set next stat+¡"). class3bTracerè­"""DefinesŸÈöjumps from one place to another."""e�__init__U$, é , FBFrom ATo, ×=5,„ßPdecorÅg=False¼<% =aNI&v% =�!#To*To¢" =ª ±L]0= N5if ²a else �§ á Id=!= äG¥B,K/ #"ifgFÏ<2 ©l#G!.fu ’ºÆÕ1 of”Ówor whenNð'function' is dòecorated and the dó or may be written using ñ## multiple physical lines when it is too long. Use^Qfirst)Jótrace event in 'function' to fi™;7 of%.J‘if (self.+@Line…ANoneÞñframe.f_code == + 5andEà�@== '×9'):"<g$= ]-eno - 10—Ýur H‰ ZD}+Ê‹jumpFromª#f ��âpwhile f Fnot $ !  û?Uy.f_backX*ifU;ö# Cope with non-integerÄéTo (because of^{P# no_ìƒ_to_non_A†s below).>try‡ Z„Y-To‰ÿexcept TypeErrordÀSd°e= Truetbreturn .ñ # This verifies^}ô-numbers-must-bea¿s rule. defBs(outputA 7¡.append(2)šBValuV as e 5'©'ästr(e))Çðat you can't set f_رno via _get¸ú or similar # trickeryàeAout_3_W(á’previous_]e= sys.m,()í 0.¤/= 2Õ;2he `òion we wanted; make surPezv messag/á# talks about þ þs!Aif ' ' 2in —Â&Brais[7elsÞñ# Something's wrong -‡PexpecTÁ asÏLd‚` AsserñH0("T-±`-less 2q failedðail") class JumpTestCase(un±4st.ðúQsetUp%âw°addCleanup(û1set, g"()ú64ys.&(A!) ägrcompare¨u$, §, received‰%if5 !=, �® A( "O±@s do^±match:\n" +Ц ð"Expected: " + reÿpr(expected) + "\n" + ó"Received: " + repr(r1)) 7òdef run_test(self, func, jumpFrom DTo, yÑ, error=None,E õevent='line', decorated=False):1átracer = JumpT ({TM)Fqsys.setM(!r.#µoutput = []7"ifÅ@ is È—̇(7GJelse'Pwith 4ñ.assertRaisesRegex(*$ïX\ Æ�w`€compare_•_™",  Ñ_async×ûaio.runjãmä4iñ<à · ¦¦B"""D²ðor that creates a `1makmSõ!from one place to another in the following code.95""" �3!or¥�?b@wraps6:¢Å 5 Hê†Ú- \@ Þ=,LR¤V=True[@areturnI`õ—FóÙn®Í’�� ÛSµhronousèkŠî�@## T!Ðirst set of 'ïð' tests are for tñ#hings that are allowed: @jump_test(1, 3, [3])@def _"ñ simple_forwards(output):+I’.append(1D2-3)‘�2, 1, [12— Oback˜.Ë¿3, 5, [2, 5|Ïout_of_block€for i inÌ20 8j8Á[3]: # Also’ s “±ing over a ƒ¿9 ’4y5y6ry5, 6, 7 Ž!î&?[1]% 3Çè7%2%15^ B6 7BRasync0:"(4BE6" [HHR ,D LPiter(Ì'2]¯= Ê ^!FJxB5, 2J4 6Zõ  ã�«2/ P mP ´s1ƒÿto_codeless_line„`# Jump2€to this AÑ should skip ±e next one.›Ò§Þ¼>to_same· Mº ”f# Testòwithin a finally(R, and:èƒB4, 9¬9  ®£in_nested_V‡?tryà ÈC. d \£ð6) f›inally: ùoutput.append(8)! 19) ò!@jump_test(6, 7, [2, 7], (ZeroDivisionError, '')T@def 4_>²in_nested_fš2_2(n)¤+tr±"­2YÑ11/0Ÿereturnh^( Q6Q 7 8"11/11-3~ ˜K I}6&10e1 ƒ.12„Â3, 4, [1, 4]8 ‚þfinite_while_loopi gHš5_ TrueQ 31 J4°B2, 3°3°þ forwards_out_of_with_block·Ó tracecontext#7, 1_È —R 3°RasyncÃÍ(¶" l ¼$ " È ÍBŠÇ03, °A1, 2 ×/-2ŠOback‹ HÂÜ×2¤ ‹Ä G ˜ Ê%™ Ð;² Û™�2, 5, [5‰ W5tryO » г .4ß5/Éž1éÒ ‘Ó ”bÐtry: ð output.append(3) …finally: .15) ò@jump_test(2, 6, [6]I@def _"òforwards_out_of_try_except_block(_)t/tr� 2fšH:OÜ4-Qraise¿ +6Ù�3, 1, [13ßObackà w1¢ù ¨ù5Wëùú¹�5, 7, [48àietween³s´11/0n}®ÿ ZeroDivisionError¹ 4Ý\ßFloatingPoint]7 Y85Ý47$Zwithi#""1p Ô6í7íB2, 4ñ�4, 5, -4ñpacross_øé ~ß/Ó tracecontext<7, 2þÁøC4C µRasync™£»ñ) Ë÷ý5 À +CN ¦ ôï3þÑÈË bin_forØ’Êfor i in [1]ÿ`.3Y. a ö = ^%( $ $>f ð3):  ðoutput.append(4)  5 16) 7ñ @jump_test(4, 5, [1, 2, 3 b-2, 6]D@def (_2ñout_of_with_block !in(r!):i ¹1XGÓ tracecontext<7, 2?* 3*. q*,Rasyncþ0 / 6* <Ow l qGN?A±5, 6, [2, 4 7jfinallym6tryz 2~I .'"4ivy6y Ÿ7“�i((bë4D‘: ?caR8, 11ÓÐ/12g âcomplex_nested(sŽø ºÊÊfor i in [1]Q 33#7j7;, 2:! > a! ï[k[ % c8¡!= × >*10? 1 2Æ»˜5½ z¤_assignmenE·:�% \ÁéJas x Çj 5ß äå%Ð def test_jumóp_out_of_async_with_assignment(output): ¥.append(1)@ @ ´tracecontexGe, 2) \2RV as xa e4e 15) Mñ@jump_test(3, 6, [1R8, 9]=@def !_+ÿover_return_in_try_finally_block÷?try¼ 3Õrif not Çñ: # always falseÌ&¢ :6^ÀŒ 8. G9HB5, 8H3 ¯10, 11, 13Q_breakP-¯while TrueË W …B ä5ý�2â � if˜ 6*10  h< ˆ ,3ο1, 7, [7, 8¿2forþÏ_before_else  OÝ Êfor i in [3]çÞ Ðþ‘ / +H7a 680·!+(6" L_BXq H‡iter([3]® òSVp# The s d set of '‚'�Qs areűthings that%�allowed:ä@2, 3œò ], (ValueError, 'after')é¦#noÔ`oo_far¦_wardsÛ ?21Êw_2, -2”L•Oback–3ñ# Test each kindtð except' line. @jump_teñ0st(2, 3, [4], (ValueError, 'except')) def test_no_jump_to_e"±_1(output):*.6try "’.append(2Tf- 4-1araise j@‰eÆ22Æ/ @Ñp3Ñ:_ as eÖ ©A4Ø0 êbRuntimø)è51W VOintoT�forwards_&®_for_blockñ O1"ßfor i in 1, 2¯ #3)DSasyncÓJ¹4 ¿%Å": Ë`iter([Ö]h Ø¿3, 2, [2, 2�Oback�¬¡w ú¸î�¾8” Ä&• !|$Ý•2, 4, [‘ a_while"Qi = 1&$¨D_ i <=/ …0i +_`†5õO3, 3Ù ¦–Ú+Á3$À i += 1  ðoutput.append(5) ñ@jump_test(1, 3, [], (ValueError, 'into'))/@def -A_no_:�forwards_&Â_with_block(o!):7j€1P5Ó tracecontext<7, 2?* C3ÃRasync�œÉ4 Ï %Õ#; Û à)iÚ�3, 2, [1/-1«Oback¬¸³1“ 2Ö¬ÒI´ Ø&µ "œ é-µX0¿try_finally_6try…Fb. 75�_[2, 4�*äË ~Ë4¬äÃ4oexceptÂHaÁ ë]raise 6ÓÐ.�ñÏHØ ÎÜØ  Œ682# 'X' ó variable creates an implicit S ßÖ<5, 7, [retween_‡'3s_2j *11/0ƒÞ>ð ZeroDivisionError:  òoutput.append(4)  5ÿexcept FloatingPointError as e:E7E ^18) 7ñ@jump_test(3, 6, [2, 5, 6], (ValueiÂ, 'finally')S@def 7A_no_DSinto_%r_block(s)¡6try õ"2[ 3fð : # still executed if the ’¡ is failedêR Vf6s 67>17[70._29 1˜R 5  ¿5, 1, [1, 3Ûoout_of Ûf3²�1, 2, -2ßÑîÂbetween_withîs¶6Ó tracecontext<7, 2.‘ÏC4C 5»Rasync»Èÿ5ê< $< Þ &+CN 1T*B7, 4+'6 B_for2Ã_before_else»rif not Palwayí1lseÁ:Êfor i in [3]yB}�‘ / +Hs•zO8vU[Yq aƒiter([3]ÆÀ óoutput.append(4) Uelse: +6+7 618) Tödef test_no_jump_to_non_integers(self)€P.run_5(5ÿ, 2, "Spam", [True]oüwithout_trace_functionvñ# Must set sys.set0�(None) in`Up(), .` condiHq is notêÅ# triggered.Å‹ ºOlargªed = {}\€exec("""g"f(ƒ ):‹…# line 0/Px = 0 /1/]y = 1+/2/0'''/3//%s*/‰s 4-10045dI10052?x +ÆgY 10062K/!x)”272ðreturn""" % ('\n' *Wf0,), d'¥f = d['f']> ôfÞ�1007, [0ÙEPfirstß.noÎAThiswðs that PDB can =Ñ back to the F&Ein a“ñ# file. See issue #1689458. ItNvonly beô* Do‚ call ifsñis defined on a single�=àcode = compileëú # Comments don't count. ³@2) Æ&¬Lhere)+3):ð4) """, "n"Ë`class %YÉ, __¿!__Á%de^]�r = JumpTš)r(G0j •>.#€namespac."{" [": []-’%, .A dù°¡ƒ2areÆ`a([2, 3­W3, 4]X[ƒÁ@|Ö5À[1], event=' ð', error=(ValueE P, "caã=e from"•aA "UB Uò of a new frame")êd�U_€>bå1AwEwnested(» 333/]5 &81, &b(W…îÐonly jump froñ,m a 'line' trace event")) def test_no_jump_from_return_*‘(output):04’.append(1I7 )@N[²(2, 1, [1],|ð ='exception', error=(ValueE ,@P "can only T ¢Ô t×]1 / 0Ö†3, 2, [2ÖÿÓ)'tÐÏyield statem¡-šÎGgen(­D ±2±K% 3uQnext(E( Aò5) if __name__ == "__main__"(@unitý. () x = 1 ¡t__dir__¥6� ['a', 'b4c']+`getatt/lØ0if xCyolotÎâraise AttributQò("Deprecated, use whatever instead"ë‹Àf"There is {hñ}" y = 2 # IMPORTANT: the same@’s are runŸ"üñ'_xml_etree_c" in order # to ensure consistency betweenXaC impl a(A and‹Python # ñ. # # For this purpose,3ð module-level "ET" symbolàðtemporarily # monkey-patched whenÓAningJÖè  suite. iMdt copy ”functoolsDhtml $io „operatordpickle%sy?Etype e(0war¬ ‘weakref 3Aiter‹<²ort productÉÁgsuppor.:óTESTFN, findfile,r_fresh_rð, gc_collect, swap_Ë� # pyET he¬"e-×FõÕ*2nlX!is�pC accelHÀed version i,Ü5A_c. O£= None ET õ SIMPLE_XMLFILE =á1("s‘ð.xml", subdir="xml\¢data") tryý Gò.encode("utf-8") Š@ UniEú>Ãܰ.SkipTest("j�:Anot X@ableQ0utf\{/NSÅ?-nsÈ �UTF8_BUGC�expat224_qO_bugK 4 SARü = """\ textðb' id='inner'>subtext õ! """ SAMPLE_SECTION = """\ <-ð" subtext Apples African Coffee T˜#80 ‘length>12 &ÞŠð§¢ENTITY_XML¤ò\ %ñ; ]> &CEy;]�ummarize_ƒC(seq¯*[t.@for … in seq] 0est «@3amethodÎc`setUpC4(cl›—Qcls.m^j0{py 6ET}žópickleRoundTripG2objHà, dumper, loadSprotoÌcµsave_m = syl[ƒð] try:  õ sys.modules[name] = dumper $ð temp = pickle.!Ùs(obj, proto),SKloadSfresultU# s(iOdexceptwP~ùingError as pe:zó# pyET must be second, because ayé(equal to) ET.FPhumanðict([(ET, "cET"), (`0, "6")]©,ò raise support.TestFailed("ð to round-trip %r fromito %r"…Q!% y-1 ÎP.get(¶3er,ß/),C ¤C2)))Ã%peLzfinally˜esave_m8rreturn  °def assertE¬ö Elements(self, alice, bob)m.4³IsInstance(+C(ET.E, )ÈA_bob, ?´’(len(list„E)), ºzòfor x, y in zip1 à£dÓ s(>ÊÐproperties = ñ ator.attrgetter('tag', 'tail0ext#6ib'J q([¦)n(Ø_ # -0B # eøò tree tests class E@TreenP(unit!|fCase):Jóserialize_checkF]¯, expectedJf(@(4)5d}¡_interfacecS # ¦ Ð-.Fáø¤‚_string(J&H.H@charH   ÒM5O), 1Tmsg=",P one-4bacter kP, gotÌ0 % Ew3newÓ# =1J + "ù% &oO[:0]8@mapp9: ;0key-.(ÂHitem# $�!keÈB~53 = gY[key]‡P"key"�k"value3elfê  6#, 5ÎÀ ó)msg="expected value string, got %r" % mapping["key"]) ódef check_element(%):$+óself.assertTrue(ET.is+3!, Žsnot an )")I0dire = dir: #ðfor attr in 'tag', ' ib AtextJail'¥©0has<j,Z)),q8Âò'no %s member' %4 30In(f,Õß` visible by7h i�ÒÅJ.tagV&æ'“*ib*$if™.J@ is °NNoneMW }?extT?ailT!:ailTJ?ent ÷Ûs = ET.EÞG"tag’á*A'enÝItree@NTree' F5¦.getroot()Öf Pñ("t\xe4g", key="À L 1�Š–Regex(rep]c, r"^<" 'r·' at 0x.*>$p¤a¡¤ô # Make sure all standardfõ methods exist. 9z"(x Ï-Ï, '__call__'ÔÐ""%å*Aable—/ÅXãv.appendÄ%?ext% in<J oremove% ¿getchildren* /fi¼Oiter'#'al£ &U— _clear$ 'ge‡ms"Okeysg Oitem$® Fù0get*Gatoryu# These)`returnB-ðble. See bug 6472. def÷ check_iter(it): õmethod(it.__next__) '#?€element. Ïfind("tag")),**OtreeS )P{ö# These aliases are provided:Îöself.assertEqual(ET.XML, ET.fromstringÒ0!PI/óProcessingInstruction9ðdef test_set_attribute(N‚P =~E]c('tag'Gª4 ²6c.tag, .)… = 'Tag'"I ,ø I/AGI/AGÀuIsNone(\?extr1ext¼?exttpext, 'T.M?EXTM.ƒ Ã?ailv1ailÃ?ailv0ailÃ.M?AILM.Ãø…�N, {}{ð = {'a': 'b', 'c ?d'}X?,>m AcBmC Dm>•Œimpleops‘‚# Basic r sanityA&s.E<µñXML("') # 1r=subuÀent("subtag"3) óelement.append(sub#óself.serialize_check(&ð , '') # 2r¯insert(0, uLÅ… �3CÉ.removeG4rH" /e5dQwith ¹ asg€Raises(V¢ÕError) as cm:2K TôEqual(str(cm.exception), 'listQÐx): x not in 'Z&ç6µ±–[0:0] = [JV ]<×0[1]Ú: ´„u1:9], [4], ;2]]õAH:9:2B0B5del[?1:2Ó,ùêº ûÄ @ðdef test_cdata(D)Dò # Test CDATA handling (etc).@x5 P€ET.XML("Nb>helloy/")¹% Ÿ Ö ]`h18?11;vE1þ;d¤$SIãOFILE¨ n°.£/../empty-Oµ¹'&"')dR¬path_cacheÖ0# Ct  that the + +÷ behaves sanelyf¡from xml.e5àimport ElementsPath õ elem = ET.XML(SAMPLE_XML)"ðfor i in range(10):/ÀElementTree(Eö).find('./'+str(i)Cócache_len_10 = len(?�!._ /r0ÿself.assertEqual(t!, |œƒ2õ ƒGreater…,/60†+OLessƒB500)àdef test_copy(Ç%):p# Test ò handling (etc).>XRimpor%9&e1gð"hello%b%2#ðself.assertEqual(ET.tostring( %),t¶@ b'<§ 0a="Aval"bp2">aan asortedi±.keys()), [ËÔ6b'] °BAitemC ³[ZT(", k r.attrib£3b']xS'" = %1'› '4c']'2' ñ¡31¯c¯ ¤¡c\'\rîâbO\r\nc™\t\n\r !d!n?)µa=" " b c 109;@ " d"100" /Ì1defïP_make轓!): +w# Test "¯ handling. V"tag"òqÁ = {"key": "O%"}i0subƒ0 = .qP("subO", GW­ùcIsNot(Fá1r, msg=">ˆ aliasinŸsdappendC eñserialize_checkí’, '< S key=ØP />\n'ñ text') W”with openŸœe as f:(šçdata = f.read(Eàrì@XMLPïrÀbRegex(1÷.version, r'^Expat ?$Pfeed(zOôserialize_checkSOclosS¿‡btargetj¨TreeBuildel7"Œ8=J-.d÷‘def test_Pliter²Felf) îÜóXML("j]*õTlist(Z˜¨À ñb'text\n"§" "ÿ_, ids = ET.XMLID(< S¿len(ids), 0bP id='³'¿¨l1l &Pids["_‚"].tag, l!) 4ðdef test_iterparse(B!):õu# Test ² interface.C%G"0con�& =Jö(SIMPLE_XMLFILEÄ€action, ‡ƒ = next(@%§ Î(7ëÀ), ('end', 'K_ent')A[BX for XC in ‹E], [&qC$Umpty-›*[root'#]Ë£.8 0, ' 'öª#‘.NS” o.:¿{namespace}/(sd; Ÿ]KPeventB(“_ð", 84d1˜7=ŸW×"start", "endóEe×¢J P%('#Ã$ J À ('end',ë 'element'), ÿ('start', 'empty-, ?end*=roow5]) ‡±events = ("ˆp", "end0-ns 0end )8òcontext = iterparse(SIMPLE_NS_XMLFILE, _7ð self.assertEqual([(action, ø’.tag) if < in˜K HYelse cA 3forz�€éE], [ýl¼€-ns', ('š¿namespace')í {*}¤c_W.(L /ã`]æÆ5!XÏ{', None¨¦ê'?K% ðio.StringIO(r"<�Þ xmlns=''/>") re‰[ü� Š Pores, [®Ø öfbogus"Û”with openßܵ"rb") as f:�·2™ñRaises(ValueError5*cm6:Kf!VæFalse(f.closed°#bÀstr(cm.excepj²), "unknownŸ! 'ô''"Äðupport.check_no_resource_warning(m)È:çþ!Ij F èAfdel cmãË©o.BytesIO(àü!b"\n"=Dbody þ http://éffbot.org/ns'9±C“:cl\xe9='@e;>š junk")1 it-’terparse(@raction,–= next(it øself.assertEqual((2P.tag)0endχ&')BWwith G°Raises(ET.P’ÕError) as cm:¶ŒÀstr(cm.excepÇz't after žíøent: line 1, column 12'kûûddCleanup(support.unlink, TESTFNéRopen(a, "wb"ÛfÚŸf.write(b¹Tn‡ ¹Hõ²check_no_reC�_warning(Û)àó&÷e ‡û8ÿ6¢del cm, it�‘def test_¿LfileþL€= ET.Ele‘W("tag�!.g@ = ""ôä¡serialize_r(0€, '/ Pext…¼°# Test tag 'uression—,u = Noneó îq�[ in¡0(0,z2Comzc "�q”ý'�3!--G@--><ˆ!')5Ò# assumes 1.32¢A[0] ÷PI("key", "valueœ ŒQ?key 6?‹yd«ìcustom_builder°¸Rr w. / /.MÆÔÞïSIMPLE_XMLFILEàædata = f.read(¬sclass B‹Klist9¶i¨,P‹, attrib*“1‘append(("8"4ñ(V$0 À:  ñ self.append(("end", tag)) �def data(/‰, text):")Epass²builder = B (SAparsqET.XMLPƒ(target=9 .`.feed(…ŽÓ.assertEqual(<5, [ˆ™ÿ('start', 'root'),# oelemen&0endG$ m& J_mpty-P* 5]) úwith open(SIMPLE_NS_XMLFILE) as fŸ— = f.readñUclass text%s" % encoding ”def bxml(%):#yreturn ".,e32¡supported_#…ings = [ Rõ'ascii', 'utf-8 D-sig &16 &be Jle',M�iso8859-1% 2 3 4 5M~M73¯9/10N1‚1ƒ)15D6DAcp43�Pcp720,5cp77>Ccp85>852B%85'Ù0T!85ÑDcp86B6JK6ÌT6T6Acp87âScp100=112lDcp12·3125v 12Â! 'l4125R2Ë *h#25Ù 12Ú *Àmac-cyrillicJTgreek ticeland]latin6Troman'|turkishx iso2022-jp)ª-­?004M-O