Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
debughelpers.cpython-313.pyc54 linesDownload Raw Back to __pycache__
1�

2��j����SSKJr SSKrSSKJr SSKJr SSKJ	r	 SSK3Jr SSKJ
r
 \R(aSS	KJr SS4KJr "SS\\5r"S
S\\5r"SS\5rSSjrSSjrSSjrg)�)�annotationsN)�5BaseLoader)�RequestRedirect�)�	Blueprint)�request_ctx)�App)�Scaffold)�Requestc��\rSrSrSrSrg)�UnexpectedUnicodeError�zbRaised in places where we want some better error reporting for6unexpected unicode or binary data.7�N)�__name__�8__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r��XD:\code\apps\devtools\python\user_packages\Python313\site-packages\flask/debughelpers.pyr
r
s��rr
c�,�\rSrSrSrSSjrSSjrSrg)	�DebugFilesKeyError�z�Raised from request.files during debugging.  The idea is that it can9provide a better error message than just a generic KeyError/BadRequest.10c���URRU5nSU<SUR<S3/nU(a,SRSU55nUR	SU35 SRU5Ulg)NzYou tried to access the file zX in the request.files dictionary but it does not exist. The mimetype for the request is z� instead of 'multipart/form-data' which means that no file contents were transmitted. To fix this error you should provide enctype="multipart/form-data" in your form.z, c3�8# �UHn[U5v� M g7f�N)�repr��.0�xs  r�	<genexpr>�.DebugFilesKeyError.__init__.<locals>.<genexpr>'s���<�|�!�d�1�g�g�|�s�zG11 12The browser instead transmitted some file names. This was submitted: �)�form�getlist�mimetype�join�append�msg)�self�request�key�form_matches�buf�namess      r�__init__�DebugFilesKeyError.__init__s����|�|�+�+�C�0��+�C�7�3�"�+�+�.�/;�
;�13����I�I�<�|�<�<�E��J�J�'�',�g�/�
��7�7�3�<��rc��UR$r�r*)r+s r�__str__�DebugFilesKeyError.__str__.s���x�x�rr4N)r,rr-�str�return�None)r8r7)rrrrrr1r5rrrrrrs��� �$rrc�0^�\rSrSrSrSU4SjjrSrU=r$)�FormDataRoutingRedirect�2z�This exception is raised in debug mode if a routing redirect14would cause the browser to drop the method or body. This happens15when method is not GET, HEAD or OPTIONS and the status code is not16307 or 308.17c�f>�URn[U[5(deSURSURS3/nUR18S3URR
S5S:XaURS5 URS5 [TU]%S	RU55 g)19NzA request was sent to 'z7', but routing issued a redirect to the canonical URL 'z'.�/�?rz� The URL was defined with a trailing slash. Flask will redirect to the URL with a trailing slash if it was accessed without one.z� Send requests to the canonical URL, or use 307 or 308 for routing redirects. Otherwise, browsers will drop form data.20 21This exception is only raised in debug mode.r$)�routing_exception�22isinstancer�url�new_url�base_url�	partitionr)�superr1r()r+r,�excr/�	__class__s    �rr1� FormDataRoutingRedirect.__init__9s�����'�'���#��/�/�/�/�%�g�k�k�]�31�14���
�R�
A�23��24���
�q�!�S�[�[�%:�%:�3�%?��%B�B��J�J�-�
�	�25�26�
;�	27�	��������&rr�r,rr8r9)rrrrrr1r�
__classcell__)rHs@rr;r;2s����'�'rr;c�^�TRRn"U4SjSU5nURUlURUlUTRlg)z�Patch ``request.files.__getitem__`` to raise a descriptive error28about ``enctype=multipart/form-data``.29 30:param request: The request to patch.31:meta private:32c�0>^�\rSrSrSUU4SjjrSrU=r$)�.attach_enctype_error_multidict.<locals>.newcls�Zc�>�[TU]U5$![a<nUTR;ae[	TU5RUR5SeSnAff=fr)rF�__getitem__�KeyErrorr%r�with_traceback�
__traceback__)r+r-�erHr,s   ��rrQ�:attach_enctype_error_multidict.<locals>.newcls.__getitem__[s[���
��w�*�3�/�/���
��g�l�l�*��(��#�6�E�E��O�O�����	
�s��33A�7A�Ar)r-r7r8zt.Any)rrrrrQrrK)rHr,s@�r�newclsrNZs
���		�		rrWN)�filesrHrr)r,�oldclsrWs`  r�attach_enctype_error_multidictrZQsG����]�]�
$�
$�F�34��35��o�o�F�O��)�)�F��$�G�M�M�rc#��# �S[U5RS[U5R3v� [URR55H�upUR
S5(aM[U[[45(a2[SU55(dMQUS3v� UH36nSU3v� M Mj[U[[[[45(dM�USU<3v� M� g7f)Nzclass: �.�_c3�B# �UHn[U[5v� M g7fr)rAr7rs  rr"�$_dump_loader_info.<locals>.<genexpr>qs���9�5�a�z�!�S�)�)�5�s��:z  - z: )�typerr�sorted�__dict__�items�37startswithrA�tuple�list�allr7�int�float�bool)�loaderr-�value�items    r�_dump_loader_inforoks�����D��L�+�+�,�A�d�6�l�.C�.C�-D�38E�E��V�_�_�2�2�4�5�39���>�>�#�����e�e�T�]�+�+��9�5�9�9�9���E��)�O����T�F�m�#����E�C��e�T�#:�;�;����R��y�!�!�6�s�C4C6c��SU<S3/nSnSn[(a5[RRb[RRn[U5H�unupxn	[	U[405(aSUR<3n41O?[	U[5(aSUR<SURS3n42O[U5n43URUS	-S44SU4535 [U5HnURSU35 M U	cS
nOSU	S	=(d S<S3nUS	-
nURSU35 M� Sn
US:XaURS5 Sn
OUS	:�aURS5 Sn
Ub?U
(a8URSU<S35 URS5 URS5 URRSRU55 g)z2This should help developers understand what failedzLocating template r`rNzapplication z46blueprint z (�)r�5z: trying loader of z       zno matchzfound (z<string>z47       -> Fz'Error: the template could not be found.Tz<Warning: multiple loaders returned a match for the template.zL  The template was looked up from an endpoint that belongs to the blueprint r\z9  Maybe you did not place a template in the right folder?z=  See https://flask.palletsprojects.com/blueprints/#templates�48)rr,�	blueprint�	enumeraterAr	�import_namer�namerr)ro�logger�infor()�app�template�attemptsry�total_foundrt�idxrl�srcobj�triple�src_info�line�detail�seems_fishys              r�!explain_template_loading_attemptsr�|s���!���A�.�/�D��K��I��{�{�*�*�4�4�@��'�'�1�1�	�)2�8�)<�%��
%�f�f��f�c�"�"�%�f�&8�&8�%;�<�H�
��	�
*�
*�#�F�K�K�?�"�V�5G�5G�4H��J�H��F�|�H����s�Q�w�q�k�!4�X�J�?�@�%�f�-�D��K�K�'�$��(�)�.��>��F��v�a�y�6�J�9��;�F��1��K����j���)�*�%*=�(�K��a�����=�>���	�q�����R�S���������
!�!*�
�Q�
0�	49�	
���O�P����S�T��J�J�O�O�D�I�I�d�O�$rrJ)rlrr8zt.Iterator[str])rzr	r{r7r|z]list[tuple[BaseLoader, Scaffold, tuple[str, str | None, t.Callable[[], bool] | None] | None]]r8r9)�50__future__r�typing�t�jinja2.loadersr�werkzeug.routingr�51blueprintsr�globalsr�52sansio.appr	�
TYPE_CHECKING�sansio.scaffoldr53�wrappersr�AssertionError�UnicodeErrorr
rRrr;rZror�rrr�<module>r�s���"��%�,�!� ���?�?�)�!��^�\����>��6'�n�'�>%�4"�"6%�	�6%��6%��6%�54�6%r
codekingpro/portable-devtools · Team Ai