ÿØÿà JFIF    ÿÛ „ !.%+&8&+/1555$;@;4?.451 4,$,44444444444414444444444444444444444444444444444444ÿÀ  á á" ÿÄ     ÿÄ ?    !1AQaq"2‘¡±ÁðBRbrÑá#‚’¢²3S CñÿÄ   ÿÄ !    !1QAa‘2ÿÚ   ? 5˜Z¯V¦cø)›t/? z¨±>Õ5€¶‹Á¤·¼z¼Ü¬+ñ®v¤¨_ˆR­BFn©—˜ý®ç̝P8gýt·ÉSTŦˆìät?þé¼íìN/Þa)ì–í6ô… Ï¿øÃj´¿KÇü]ÿ ªô¹-eKànëÕHTx}ýSÜ›ÿ ”7Ø×&µ<¦  ¥ÑO¶[Ù¯ä¨ÞÃÿ PZ-¬;#õ|•oaÿ ©CìÞz3˜öː/¤­ñTûIØ}š^ mÓ%ªxˆ¥ÉŸu=Z+ISe¿45™¼u;ú&WØ÷€æßQ™®{|íx*TC“#ZŠìZ§²‹ 6pv…³¿¡äª*áZÐ%ÒOáˆo"x«OHk w±æ+¬V(kMúŸ5Vö«$ ÁrÏbàb57/luR ¸ÑÛj Òµì`Мq­û žICÀÊ•©4€Âcà¨Ï€O´<èÐ:›ù(Ë^L8þ‘ÍÌ#¸Ð_Ì©ÙK(Öz 4¬û+¸;ü’V’84‘¬ÃŽ:[â‡ÔÌáõp¢~§ªlæ£ö{®G>J¼"°‡7¯ÆÉèßû ‹É‹§ÁòÃýâßî ^ƾÙõ‹×óH#«LP½ïX=xÑÍ$|W?•~• îëÔ©ª‹ {ÝT…Kÿ ”hûâá)J*ö˜–ÔU;iÇ€/ ÆþjóZ\ýwØ=Ìm ºèËL9 ýèÆð/¨’¥öo=nË.%Îì ŽÕ¯È|{Oj²ƒE6e/ßdÄõ²Ìâ1O®ò×TsəԸhOMýíMˆ¿¼H˜l²,7Â¥#MF/Úf°Ö½± ¸–dr‹NýÊ íjqx{œÉ ä-È ¦ øÄër¨q°ð †nцýÑÄÆ’mä…n<0È™;ÁÝá¯ÁZƒ7FÀmì­ É&9ˆîéi¶ùN§Y• ÃZãAâ?•‡©‰ , ó¾IŸŠc1 4â&y­&pŠ­6;M À 0¹qç»p.á …ŸÅáK@%6·y6ƒ‰3?”úºŽ‰éX5ªPT §µ!=Mž«Ú½‹ÅgÂSâÉaþÓoö–¯ÁÔìR>5éÿ üs¶ÆUcÌ kÇR ]ÿ ù¬¼«VŽ;Â|‡~¢¦”ÏŰæ {L™Õ°Óv¹ò¸írޡעCÃ!íVÕ {¶»sŒNPg/ "uÕbkm²“$ďå¿é¹§°½æz¯6 †s¿!s–wÚÝ“™Œ °.ûj>·+™Òa…©Œ&rÝÎtÛë긪Ît’LAVp%c Úý[ÄzJ¾ÇàXXç@˜ó<êL]·T˜¾¥1Ó©V‡g´æ½¦Ý@¹óø!_@´ÞâSÁ —S3™•& ]@JHÚý©ZŽ €×æÔr»Áf!‡yÞ4Mv*èÓã_{‘åóUuљØ«Oïé*®EvÑ Œ÷‡U \"㪒ÍK+À 4“M¡ï:0¥5í!'<@î´”>Ç»&Z–ïCCV˜Ì5Šo&îhè.žû |ÓK©h$s6KìŒëã)¹hI¦GïOåóI;ììü#É$Š0…Ææ¥TØ.5­¾gn´ “ÂÖ\:hœ89G)J@„}œ:’Ò{/Š"¦_Æ×7Æ3VÇŠÊa]ÚŒÙ€Ä–=®uÁßâACZƒ§§£ Qnâ:«,×{tyø¬iÛcœÜÄ€H½ÄÍCk´÷šß .W'b¤Íåh]÷€=,Žv×cÚEÚHXJX¶îo¨FÒtèöŸ>ªª6[J®Fµ£sGÁeqõfe\íjÒÐïÄÐGˆe1Ø‹.Ø”‘Ëuø Y­ˆÜ ŽG|zùªüMpDnQWÄ”%JŠ™)â*p@Örš«ÕT2Ð%ˆG#ª„ ·¤!°ŸOTÂT¸aÚ%4&h™LµšØüÐ.F¿²ÐÞ_Ç‚¾ÅÃaÜ÷09Æ q€öy˜v‡85õN÷]¬äѼóS{°_MެúÔ#°Ç¸0åÞè2ëôPcvÆw9®ií1Ä8F™˜à‰´+‰Ik1òÝ7“Ñ×ÒsÝ\x‚h`ÞÑ`ó"|µEcý£n˜h`}GÞ !±ù²Ápü²ß6 0ïi󜵩SÈÇ7˜-ÕURO˜¦´f$ªž-Í6(œ}<„ éc øs]ŽŽ„*—¾ ìdŽ„)méª\¿êÎIg¾ØÞ~I#C/¼¼´EÁÈŽi8“©õådô·>euä ƒ'Ê×लR1ÉJE1ÐAát`t;ÇР%Ý<‡¥„ÍÆ`×Oyó)õiI€ñQaŸ4Ûù\áàaÃÔ¹HÃu¹*k€¦<„e S‡&õÏ B!ŽhüÞ`yj}mªf×\¿ Ç~æ­9‡û\՞Ǖg²1Žû5V7 !àöšm° c`ܬøÇìµÒ'P"?…´Ö,"§^•õލsÔ)6˜sæéÍR¼ ò|Sl”‹7 nPW Gòú÷½§O¯‡„l¡kSÞŒr½PÊ@æ¢pŽ-mÿ #Ÿ˜Àº¶Áä¦;ïÔæ$1££`“Õ>„—·ž)ßð³ñ#Ï Ô$¶œ‰ÊE‹À;÷º ¯«P:Ñ”8–IÊtpÞ3ª“>ê“þës4ò2OÏÕ­±zô†Õ§‰.÷ä¸;¿˜“'œ›žª}«Œ{ª±Ì 9ÔóÞÕ‡0 $íWV3Üì¬ —@kÝ4@¿r¼±½¬™›?øØæ´'Áé®CË3-g$˜ö‡×auÚi´Žp/êÛ æF›Ú2v‹ã¿¿,nB1̨ƃqÞa5͝@&Æû“él÷ \C²½UÍc ¯k×¢U ÖéQå™—-r wô ÞÏ<Ò=&=ÿ Ôê Òêˈt,i—;LîÜ á¸*ÚÃ1$êL•LÍ <É)ýÐà’ ;F™{ƒ™˜€&'}‚ãÄK`¡ÞT@I;®žZóè‚s’7®°›+§O­Åq©é»²9<Ô J ¼9O’HL»Ùïì¸rk¼Ž_ý‘TŸu[²ßÚŒ·ü÷B%¯E ŸÔX5êO´ Ç•€’I0 ÉJX` ñ¹õ%;µŸD‘«´€àwÒ™U ûئžÖö\×®×´8 ½‡ºÐÆÓ§?Àkmœ=;d5*@-ì0F Rªýš[Ü6âö̃ڸr*KA9· u*µæ£?U¸Âêí†8@¦X4 e-ò„0s{ HâUpU?¼mñRa°®a%Ð'tÉ×’\¾ÊÉ]t›h>·(Ë@R¼¡Ãt h}’O÷au<+nT…Ö…MӐ??Óe95 q>í/;&JSû °¯ÊéÞ øƒ*Ã2½Ài&:nôUl=¾¿5eˆ3”ñc|Ú2V”>„»&eE;«ÚäC p¢Û úy 9š[ŒÌx¼擼A&DåÒ¯ˆ¤ÀÌ;"˜ ÏQä¸åhÊ}Ûq«Û0WžÒ|»€ø®öCm5•\ÇÀ§Pe3£]0ÃàLDÉ‰1øªxjgwT‚÷¿LΨK‹›ùs—xˆÜ±µ kæ¸f‰‰ÜGk/LÛØ6d9ò¶ùA{ƒA3š/¬D¬khÓk‰`˜"㯒r¿±Óã jx‡°e}<Ñø\3y:'À•/h½Í€Ç4~g ?Û(¼]v‘ªlKÎâ~?O‚W%{Ì:“'©úNq¾›úo(X’¥¯ˆ nFê{Ç€ü?º'ë ø‹ì Þ09ŒÌç9Æ —ËC`j@ÓÄ(+a‹un¸#ÂꟋ{K`‘ÑÍÍ'à´»/Û,KW;Þ4²þð ï Nm|~fGÏ(…³Ã)«1ö­Õ ¥‡¨©ƒÃ™ü-s=à=U66Ï«Ýc蓦W¹íž®›nÔ%êÇìŒ<#Ü×84ån®Ð ÒåOC` ñânÑs‡¢ç 1õ%Îhì½Ã½® e:ݼUZo™`  ÅZŸŒÊ«ê1ÏÄo$q¹Þ€©ˆhÐÉä¯ñ[!…Ú˜àJ:x2$Íß&PåT£6ç— ‡Í*4Ýšçjÿ ‰É nófÐ ó(L5C•åÆ\rMÒ@ò }y-W}™üýVù—ú¢=Ù”c®‘< M ž ´Phr ¦©TD ‘ù.$´÷O‡‘V2Æò.=IUŒ=ž‡â¬i™aþÓåÙ?òUø'ØÖ•.~* šTŒ!•-×áºTâ®ä#õü'´ eýlYÅÓeÕKÂrT"CÚ@u!Óxƒ{š3€}1¿(r}%«nËamjÑ%ÑNEò v ˜à  σöK³,*º.àzù¨™Ó ÚçâU¦*¿ 9{%Ö¹ njûdaXöb) kÛÆ±ûÓ\°M7ˆÂ=û›ç¿Ã‚­V»Cg–8ÙêE- j)k$º`Ã-ùEýeBÆÇ]c¡°ñty&Òd0nõ'¡W+ƒ*|–øµFa\GQªEAÔp5\Ǽ·¼Ç8·õ -â§Ú[ ‡ uZeÖ 3}×d'+¹:ð+K†Û®s!Ï$úe€<Û”x)1»a­¡LC]¸µík…ÚàA»AYº{†ªS[¦5HÒ7ù --,ísòDØ€èk ÞÀîÜ ò@â( ËNˆë›4ô½•/¦o‡€Û7 ê•ÆêòðÜy'Án½µ á˜ݦ ndeo…[ì¶Ê,¥R³Ä=À±—–ß;£™´ñSâ*g§”ïaið‘Jå~™ÓÞ ß³Õ¢»8x埒²52>AÊb&-÷\7´éÄù€T˜,w;3{ï˜k…à¹ÄqÀ«œ{€\ ˆ¾[´¨јr &Úé„Ívˆ±8†¿]|¬ņ4I×pÞS1ÈÖz‰#Ìv‡G!YNògñ:màTz¢Ý1ô©^O=~ë|5Bã™ç•¼µõ•bÆ@úÕS¬ÈŒ#¬zünrŸ û” Z²•èðV"ÁHÚý©wÝ €7¼Ìu1hÑa3Éä û f$o¿É ™Ú›ÝçnpÒ3äÌ3†Í§,Äï]$‰/pê †«À¼¸e9­Æê_C]žƒ·ý·frÁN«, E=›Çq -‰öŒ:aÏ¿±í&£Í:-} 84‘ÿ eƒQÑeëSsuiA ³g㟥ú£?ÿ ʼn*”“÷aühe:ÊWa@ÒÞk±eØ] F Ô—r.åä˜ @ö¥ªZoÐýYL·¥S²G/‡ñ <~*ZÆ´è>JlòàÛÆ½ÿ 窘ìGN¢:I®KšJp/`íIÁÀõ#Ä-€ö­šµŒoF4|ÆQØÆ@Ì|£Ô…¢À{9˜è½Üó›€ôYÒÎYsið;ís¤€à²ˆ‚4qÉVŒI$ ‰"° æµ8cXGjœˏ¡Aâý•ËÜ¢ûï e·çLx']á"oÅÎê3¯Ç—¹”ó0nå‚âg{Œñ> S´˜îè°g238‚ãköÝfÚd´6Ò€;ò÷±¢™¼›º ¢Æ'¥Ðx'e¬ç ]bÈÆV¢ó‹kýBO ðÊâ$Ÿ!×T 3Mýמ žìٍàÌü‘8÷€àæØ8æ©6‰©L´«…oãpð„~Çk‰!ñ;‹”ÛžÍ àž±z Ÿôû øŸÝužÏ;ÿ #|u6™Þ¬ÚˆÐõA4¶â|ôl|Ê2ŽÇ¤ÝÅÇY.<#Aí.k§hóF‚”Y; M½Ö4hŸ4&›­¿tès´%FìL¥£Ãk‰ÇT¤haÁ¤ÚxfÉ`ÑìË›>i 3t‚:,–+^÷´–{Û–Nxi"x‘Ûg î¨>¥Õ܁ùZH,2Û“:8xÊ¢Çí9.É-Ìâã-=çjwµS˜dütžçwýGòú®®ûº_ˆýx$–¡ãøO EÚÛÏ÷R„×w+3£Á£öUMyR²¹âŒ°š›¸Ñãò9§Ó_Dl+Ùßc›úšGÅÌc†Ž!Ko=¶.‘Îÿ c²(2®V mª.ÿ ¹B›¹å ù„öŸSV>™ü¯$y:G¢Z×àøúdî¹û­·ýÇ´:•c LÍõi_‹ö+ÎæGÊè>OŠ•äž´§Þ{X}¨1ÚTc›»Qþ•êô°t¿OP?eæ~É{5]•ÙR£r5†nZ\ã@ &îJõ ¾àC°þV>fé¥/ü5ñÊIº_é5 ;e­h<@ Ä&æÃëE%;X,ÒãÆÞ`Oò¦kŸm#˜!ÀyÄ¢| óLšò¥Ä` ¶R=|ÈCâh5ò3DˆïF†ðÒ#ÅìÛœ?¸yhBãœí ZxßÎÄhºRK„`Þödvײ™ÀÈÑÒgŒuY w³%†ƒÓzõ ÖÏp‚dH®¦A´ù§»ÓÇMæ~)ˆð‡û:ù&Ä •vGD´À n ݇¼Ö8Fö óáà£~Ë¥x`oK|Ä?fxiØü%pìR>éò+Û±éÎ>núlFŤ'tq8LZÏvÃ?„¡ß±È⽆¯³íü@x|PöUäèØã¡ð‚ŒAìÏ"vÍwóŸÍ{ ý0.z È•Ö{,N¡£¡ŸKÕÙž>Ýœþ ÍÀ°<×EA!Å‚D™IúOÍ¡>ôG}Â` ÍßkÜL™Ž Þð™ {IøF²¹òQ3&!ÃÂÞz.d&Ï-sH¸,Ôõ˜ŽP€ 77ˆÝ¼ÊëÜw =cÕ Ú,ØÐ5ÎYÐ)ì´öœgŒ[¤ßv㙑8心>h]§µháYš£²ºÑ.{Ï7Sð•?´~×SÃKýJÛ˜ ™Íäiúu<µX¶1õ^kâçIÑ£sZ4h>j*ÔšD:4­¿_ ÷¸ Õxæÿ ¸?Mù _•­ÊÐ ä ÷ý ÑwL œ­ïnTkÛUÍN©ë:¦fV ¶ÜÔÜMªÅâA½–¿R×TXš-%iTÊT•‡Ù‚JôϐZxWÑè‰f‰òG º ×Õû2aZ7OU3[“×AT–ÞŒ…-‘¤”Ì ì&(ˆ¿­•ƒkï’:ðY¦W‘ Å)“†‘˜³Åtcø˜ñTÂwÚÇ4|üLÇªí–v- qˆèU qPE.†â‘˜µ Æ,ÐÅs]8¾„oúÑ i>ÜxxÈó)ƒ ´æÁâØ$À‰vžŸf$Ž |ãw;ÀÁIJ»b` {¦Ó¤Ú$©YÀ‘n@Óïž«9J¼êG m¤ ܯ¹ÌW4€ÐÒÅÛ‡#褕Ÿn-?í|с¥÷Ú¹¬'´ÞÜ9ÓK `hê£SÄSà?7—Wí_´…óB›»:=Ãïq`<8ñÓŒÑlú2d¬ê³£hÖ[l|$vÝro~'R®‰§°ñmY ͧäP |PUª¹·:3Œ[Û{Xÿ ºâ@‚W–Äé u‚ ¯´*=íή.pûÒdt @G‰¬ s¸ ëÉücr ÞæÑ¨Ê@>¤¢Ö±. Þ'¯°ÌME[YéïĵÂCå½ Ué©Áû'Ê9%eÔðNU”ë‘ÌsD3/®+UI˜9h.WC”빓$#:pz:YÓ ¿xž* ³$Í +$kñAŠ‹†¢ Uê>¸)_š¬÷©ßAÂÔb9ÇU ¯¾á•9¯ÏÏ÷O÷¼¼Fähal1‰3Ì[Ïr•´UCksNÐ] R‘¸¥H+§Šé†c©vÖÞ0iÓ76s†î!§=ß ¼~Ô'°Ãmäoäš³ªøi1úÉ)³yV8 CLÄØÁ‘WYïi€H6ÖÑiámø^ÈY´°Ñ7¥Û*—Ñ©L«Qƒï—Ùrÿ ›£Ð*š¸ˆL©ˆ$ˆ ÷¾D§9È®«qbqC)–ˆïv´çñsÑVT­Ø, <àïºÀO«Jý·õ àfPìð .wFšir´þ’2_Y *Æ€x\« ì€9š@ Ž|F⇥ˆkZ@hÖÄ0t¿-<“‹qµ¾*ZL¤Ú)&BJpÓF5=$„at*Zš$’ÑtdûÝRI1 2މ$€$I$#‰SÞ’Hë¬ï;Á$¡t$’`<(ñÇt)$‡Ð.Êf¢X’Kt=Éé$‚ˆªè¢oÝëòI%Rgcª÷ŠyI%¡‰ÿ !ñ)´õ $¤ Ô’IIGÿÙ""" Collect various information about Python to help debugging test failures. """ from __future__ import print_function import errno import re import sys import traceback import warnings def normalize_text(text): if text is None: return None text = str(text) text = re.sub(r'\s+', ' ', text) return text.strip() class PythonInfo: def __init__(self): self.info = {} def add(self, key, value): if key in self.info: raise ValueError("duplicate key: %r" % key) if value is None: return if not isinstance(value, int): if not isinstance(value, str): # convert other objects like sys.flags to string value = str(value) value = value.strip() if not value: return self.info[key] = value def get_infos(self): """ Get information as a key:value dictionary where values are strings. """ return {key: str(value) for key, value in self.info.items()} def copy_attributes(info_add, obj, name_fmt, attributes, *, formatter=None): for attr in attributes: value = getattr(obj, attr, None) if value is None: continue name = name_fmt % attr if formatter is not None: value = formatter(attr, value) info_add(name, value) def copy_attr(info_add, name, mod, attr_name): try: value = getattr(mod, attr_name) except AttributeError: return info_add(name, value) def call_func(info_add, name, mod, func_name, *, formatter=None): try: func = getattr(mod, func_name) except AttributeError: return value = func() if formatter is not None: value = formatter(value) info_add(name, value) def collect_sys(info_add): attributes = ( '_framework', 'abiflags', 'api_version', 'builtin_module_names', 'byteorder', 'dont_write_bytecode', 'executable', 'flags', 'float_info', 'float_repr_style', 'hash_info', 'hexversion', 'implementation', 'int_info', 'maxsize', 'maxunicode', 'path', 'platform', 'prefix', 'thread_info', 'version', 'version_info', 'winver', ) copy_attributes(info_add, sys, 'sys.%s', attributes) call_func(info_add, 'sys.androidapilevel', sys, 'getandroidapilevel') call_func(info_add, 'sys.windowsversion', sys, 'getwindowsversion') encoding = sys.getfilesystemencoding() if hasattr(sys, 'getfilesystemencodeerrors'): encoding = '%s/%s' % (encoding, sys.getfilesystemencodeerrors()) info_add('sys.filesystem_encoding', encoding) for name in ('stdin', 'stdout', 'stderr'): stream = getattr(sys, name) if stream is None: continue encoding = getattr(stream, 'encoding', None) if not encoding: continue errors = getattr(stream, 'errors', None) if errors: encoding = '%s/%s' % (encoding, errors) info_add('sys.%s.encoding' % name, encoding) # Were we compiled --with-pydebug or with #define Py_DEBUG? Py_DEBUG = hasattr(sys, 'gettotalrefcount') if Py_DEBUG: text = 'Yes (sys.gettotalrefcount() present)' else: text = 'No (sys.gettotalrefcount() missing)' info_add('Py_DEBUG', text) def collect_platform(info_add): import platform arch = platform.architecture() arch = ' '.join(filter(bool, arch)) info_add('platform.architecture', arch) info_add('platform.python_implementation', platform.python_implementation()) info_add('platform.platform', platform.platform(aliased=True)) libc_ver = ('%s %s' % platform.libc_ver()).strip() if libc_ver: info_add('platform.libc_ver', libc_ver) def collect_locale(info_add): import locale info_add('locale.encoding', locale.getpreferredencoding(False)) def collect_builtins(info_add): info_add('builtins.float.float_format', float.__getformat__("float")) info_add('builtins.float.double_format', float.__getformat__("double")) def collect_urandom(info_add): import os if hasattr(os, 'getrandom'): # PEP 524: Check if system urandom is initialized try: try: os.getrandom(1, os.GRND_NONBLOCK) state = 'ready (initialized)' except BlockingIOError as exc: state = 'not seeded yet (%s)' % exc info_add('os.getrandom', state) except OSError as exc: # Python was compiled on a more recent Linux version # than the current Linux kernel: ignore OSError(ENOSYS) if exc.errno != errno.ENOSYS: raise def collect_os(info_add): import os def format_attr(attr, value): if attr in ('supports_follow_symlinks', 'supports_fd', 'supports_effective_ids'): return str(sorted(func.__name__ for func in value)) else: return value attributes = ( 'name', 'supports_bytes_environ', 'supports_effective_ids', 'supports_fd', 'supports_follow_symlinks', ) copy_attributes(info_add, os, 'os.%s', attributes, formatter=format_attr) for func in ( 'cpu_count', 'getcwd', 'getegid', 'geteuid', 'getgid', 'getloadavg', 'getresgid', 'getresuid', 'getuid', 'uname', ): call_func(info_add, 'os.%s' % func, os, func) def format_groups(groups): return ', '.join(map(str, groups)) call_func(info_add, 'os.getgroups', os, 'getgroups', formatter=format_groups) if hasattr(os, 'getlogin'): try: login = os.getlogin() except OSError: # getlogin() fails with "OSError: [Errno 25] Inappropriate ioctl # for device" on Travis CI pass else: info_add("os.login", login) # Environment variables used by the stdlib and tests. Don't log the full # environment: filter to list to not leak sensitive information. # # HTTP_PROXY is not logged because it can contain a password. ENV_VARS = frozenset(( "APPDATA", "AR", "ARCHFLAGS", "ARFLAGS", "AUDIODEV", "CC", "CFLAGS", "COLUMNS", "COMPUTERNAME", "COMSPEC", "CPP", "CPPFLAGS", "DISPLAY", "DISTUTILS_DEBUG", "DISTUTILS_USE_SDK", "DYLD_LIBRARY_PATH", "ENSUREPIP_OPTIONS", "HISTORY_FILE", "HOME", "HOMEDRIVE", "HOMEPATH", "IDLESTARTUP", "LANG", "LDFLAGS", "LDSHARED", "LD_LIBRARY_PATH", "LINES", "MACOSX_DEPLOYMENT_TARGET", "MAILCAPS", "MAKEFLAGS", "MIXERDEV", "MSSDK", "PATH", "PATHEXT", "PIP_CONFIG_FILE", "PLAT", "POSIXLY_CORRECT", "PY_SAX_PARSER", "ProgramFiles", "ProgramFiles(x86)", "RUNNING_ON_VALGRIND", "SDK_TOOLS_BIN", "SERVER_SOFTWARE", "SHELL", "SOURCE_DATE_EPOCH", "SYSTEMROOT", "TEMP", "TERM", "TILE_LIBRARY", "TIX_LIBRARY", "TMP", "TMPDIR", "TRAVIS", "TZ", "USERPROFILE", "VIRTUAL_ENV", "WAYLAND_DISPLAY", "WINDIR", "_PYTHON_HOST_PLATFORM", "_PYTHON_PROJECT_BASE", "_PYTHON_SYSCONFIGDATA_NAME", "__PYVENV_LAUNCHER__", )) for name, value in os.environ.items(): uname = name.upper() if (uname in ENV_VARS # Copy PYTHON* and LC_* variables or uname.startswith(("PYTHON", "LC_")) # Visual Studio: VS140COMNTOOLS or (uname.startswith("VS") and uname.endswith("COMNTOOLS"))): info_add('os.environ[%s]' % name, value) if hasattr(os, 'umask'): mask = os.umask(0) os.umask(mask) info_add("os.umask", '0o%03o' % mask) def collect_pwd(info_add): try: import pwd except ImportError: return import os uid = os.getuid() try: entry = pwd.getpwuid(uid) except KeyError: entry = None info_add('pwd.getpwuid(%s)'% uid, entry if entry is not None else '') if entry is None: # there is nothing interesting to read if the current user identifier # is not the password database return if hasattr(os, 'getgrouplist'): groups = os.getgrouplist(entry.pw_name, entry.pw_gid) groups = ', '.join(map(str, groups)) info_add('os.getgrouplist', groups) def collect_readline(info_add): try: import readline except ImportError: return def format_attr(attr, value): if isinstance(value, int): return "%#x" % value else: return value attributes = ( "_READLINE_VERSION", "_READLINE_RUNTIME_VERSION", "_READLINE_LIBRARY_VERSION", ) copy_attributes(info_add, readline, 'readline.%s', attributes, formatter=format_attr) if not hasattr(readline, "_READLINE_LIBRARY_VERSION"): # _READLINE_LIBRARY_VERSION has been added to CPython 3.7 doc = getattr(readline, '__doc__', '') if 'libedit readline' in doc: info_add('readline.library', 'libedit readline') elif 'GNU readline' in doc: info_add('readline.library', 'GNU readline') def collect_gdb(info_add): import subprocess try: proc = subprocess.Popen(["gdb", "-nx", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) version = proc.communicate()[0] if proc.returncode: # ignore gdb failure: test_gdb will log the error return except OSError: return # Only keep the first line version = version.splitlines()[0] info_add('gdb_version', version) def collect_tkinter(info_add): try: import _tkinter except ImportError: pass else: attributes = ('TK_VERSION', 'TCL_VERSION') copy_attributes(info_add, _tkinter, 'tkinter.%s', attributes) try: import tkinter except ImportError: pass else: tcl = tkinter.Tcl() patchlevel = tcl.call('info', 'patchlevel') info_add('tkinter.info_patchlevel', patchlevel) def collect_time(info_add): import time info_add('time.time', time.time()) attributes = ( 'altzone', 'daylight', 'timezone', 'tzname', ) copy_attributes(info_add, time, 'time.%s', attributes) if hasattr(time, 'get_clock_info'): for clock in ('clock', 'monotonic', 'perf_counter', 'process_time', 'thread_time', 'time'): try: # prevent DeprecatingWarning on get_clock_info('clock') with warnings.catch_warnings(record=True): clock_info = time.get_clock_info(clock) except ValueError: # missing clock like time.thread_time() pass else: info_add('time.get_clock_info(%s)' % clock, clock_info) def collect_datetime(info_add): try: import datetime except ImportError: return info_add('datetime.datetime.now', datetime.datetime.now()) def collect_sysconfig(info_add): import sysconfig for name in ( 'ABIFLAGS', 'ANDROID_API_LEVEL', 'CC', 'CCSHARED', 'CFLAGS', 'CFLAGSFORSHARED', 'CONFIG_ARGS', 'HOST_GNU_TYPE', 'MACHDEP', 'MULTIARCH', 'OPT', 'PY_CFLAGS', 'PY_CFLAGS_NODIST', 'PY_CORE_LDFLAGS', 'PY_LDFLAGS', 'PY_LDFLAGS_NODIST', 'PY_STDMODULE_CFLAGS', 'Py_DEBUG', 'Py_ENABLE_SHARED', 'SHELL', 'SOABI', 'prefix', ): value = sysconfig.get_config_var(name) if name == 'ANDROID_API_LEVEL' and not value: # skip ANDROID_API_LEVEL=0 continue value = normalize_text(value) info_add('sysconfig[%s]' % name, value) def collect_ssl(info_add): import os try: import ssl except ImportError: return try: import _ssl except ImportError: _ssl = None def format_attr(attr, value): if attr.startswith('OP_'): return '%#8x' % value else: return value attributes = ( 'OPENSSL_VERSION', 'OPENSSL_VERSION_INFO', 'HAS_SNI', 'OP_ALL', 'OP_NO_TLSv1_1', ) copy_attributes(info_add, ssl, 'ssl.%s', attributes, formatter=format_attr) for name, ctx in ( ('SSLContext', ssl.SSLContext()), ('default_https_context', ssl._create_default_https_context()), ('stdlib_context', ssl._create_stdlib_context()), ): attributes = ( 'minimum_version', 'maximum_version', 'protocol', 'options', 'verify_mode', ) copy_attributes(info_add, ctx, f'ssl.{name}.%s', attributes) env_names = ["OPENSSL_CONF", "SSLKEYLOGFILE"] if _ssl is not None and hasattr(_ssl, 'get_default_verify_paths'): parts = _ssl.get_default_verify_paths() env_names.extend((parts[0], parts[2])) for name in env_names: try: value = os.environ[name] except KeyError: continue info_add('ssl.environ[%s]' % name, value) def collect_socket(info_add): import socket hostname = socket.gethostname() info_add('socket.hostname', hostname) def collect_sqlite(info_add): try: import sqlite3 except ImportError: return attributes = ('version', 'sqlite_version') copy_attributes(info_add, sqlite3, 'sqlite3.%s', attributes) def collect_zlib(info_add): try: import zlib except ImportError: return attributes = ('ZLIB_VERSION', 'ZLIB_RUNTIME_VERSION') copy_attributes(info_add, zlib, 'zlib.%s', attributes) def collect_expat(info_add): try: from xml.parsers import expat except ImportError: return attributes = ('EXPAT_VERSION',) copy_attributes(info_add, expat, 'expat.%s', attributes) def collect_decimal(info_add): try: import _decimal except ImportError: return attributes = ('__libmpdec_version__',) copy_attributes(info_add, _decimal, '_decimal.%s', attributes) def collect_testcapi(info_add): try: import _testcapi except ImportError: return call_func(info_add, 'pymem.allocator', _testcapi, 'pymem_getallocatorsname') copy_attr(info_add, 'pymem.with_pymalloc', _testcapi, 'WITH_PYMALLOC') def collect_resource(info_add): try: import resource except ImportError: return limits = [attr for attr in dir(resource) if attr.startswith('RLIMIT_')] for name in limits: key = getattr(resource, name) value = resource.getrlimit(key) info_add('resource.%s' % name, value) call_func(info_add, 'resource.pagesize', resource, 'getpagesize') def collect_test_socket(info_add): try: from test import test_socket except ImportError: return # all check attributes like HAVE_SOCKET_CAN attributes = [name for name in dir(test_socket) if name.startswith('HAVE_')] copy_attributes(info_add, test_socket, 'test_socket.%s', attributes) def collect_test_support(info_add): try: from test import support except ImportError: return attributes = ('IPV6_ENABLED',) copy_attributes(info_add, support, 'test_support.%s', attributes) call_func(info_add, 'test_support._is_gui_available', support, '_is_gui_available') call_func(info_add, 'test_support.python_is_optimized', support, 'python_is_optimized') def collect_cc(info_add): import subprocess import sysconfig CC = sysconfig.get_config_var('CC') if not CC: return try: import shlex args = shlex.split(CC) except ImportError: args = CC.split() args.append('--version') try: proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) except OSError: # Cannot run the compiler, for example when Python has been # cross-compiled and installed on the target platform where the # compiler is missing. return stdout = proc.communicate()[0] if proc.returncode: # CC --version failed: ignore error return text = stdout.splitlines()[0] text = normalize_text(text) info_add('CC.version', text) def collect_gdbm(info_add): try: from _gdbm import _GDBM_VERSION except ImportError: return info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _GDBM_VERSION))) def collect_get_config(info_add): # Get global configuration variables, _PyPreConfig and _PyCoreConfig try: from _testinternalcapi import get_configs except ImportError: return all_configs = get_configs() for config_type in sorted(all_configs): config = all_configs[config_type] for key in sorted(config): info_add('%s[%s]' % (config_type, key), repr(config[key])) def collect_subprocess(info_add): import subprocess copy_attributes(info_add, subprocess, 'subprocess.%s', ('_USE_POSIX_SPAWN',)) def collect_windows(info_add): try: import ctypes except ImportError: return if not hasattr(ctypes, 'WinDLL'): return ntdll = ctypes.WinDLL('ntdll') BOOLEAN = ctypes.c_ubyte try: RtlAreLongPathsEnabled = ntdll.RtlAreLongPathsEnabled except AttributeError: res = '' else: RtlAreLongPathsEnabled.restype = BOOLEAN RtlAreLongPathsEnabled.argtypes = () res = bool(RtlAreLongPathsEnabled()) info_add('windows.RtlAreLongPathsEnabled', res) try: import _winapi dll_path = _winapi.GetModuleFileName(sys.dllhandle) info_add('windows.dll_path', dll_path) except (ImportError, AttributeError): pass import subprocess try: # When wmic.exe output is redirected to a pipe, # it uses the OEM code page proc = subprocess.Popen(["wmic", "os", "get", "Caption,Version", "/value"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="oem", text=True) output, stderr = proc.communicate() if proc.returncode: output = "" except OSError: pass else: for line in output.splitlines(): line = line.strip() if line.startswith('Caption='): line = line.removeprefix('Caption=').strip() if line: info_add('windows.version_caption', line) elif line.startswith('Version='): line = line.removeprefix('Version=').strip() if line: info_add('windows.version', line) try: proc = subprocess.Popen(["ver"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) output = proc.communicate()[0] if proc.returncode: output = "" except OSError: return else: output = output.strip() line = output.splitlines()[0] if line: info_add('windows.ver', line) def collect_fips(info_add): try: import _hashlib except ImportError: _hashlib = None if _hashlib is not None: call_func(info_add, 'fips.openssl_fips_mode', _hashlib, 'get_fips_mode') try: with open("/proc/sys/crypto/fips_enabled", encoding="utf-8") as fp: line = fp.readline().rstrip() if line: info_add('fips.linux_crypto_fips_enabled', line) except OSError: pass def collect_info(info): error = False info_add = info.add for collect_func in ( # collect_urandom() must be the first, to check the getrandom() status. # Other functions may block on os.urandom() indirectly and so change # its state. collect_urandom, collect_builtins, collect_cc, collect_datetime, collect_decimal, collect_expat, collect_fips, collect_gdb, collect_gdbm, collect_get_config, collect_locale, collect_os, collect_platform, collect_pwd, collect_readline, collect_resource, collect_socket, collect_sqlite, collect_ssl, collect_subprocess, collect_sys, collect_sysconfig, collect_testcapi, collect_time, collect_tkinter, collect_windows, collect_zlib, # Collecting from tests should be last as they have side effects. collect_test_socket, collect_test_support, ): try: collect_func(info_add) except Exception: error = True print("ERROR: %s() failed" % (collect_func.__name__), file=sys.stderr) traceback.print_exc(file=sys.stderr) print(file=sys.stderr) sys.stderr.flush() return error def dump_info(info, file=None): title = "Python debug information" print(title) print("=" * len(title)) print() infos = info.get_infos() infos = sorted(infos.items()) for key, value in infos: value = value.replace("\n", " ") print("%s: %s" % (key, value)) print() def main(): info = PythonInfo() error = collect_info(info) dump_info(info) if error: print("Collection failed: exit with error", file=sys.stderr) sys.exit(1) if __name__ == "__main__": main()