
À«‘_5  ã               @   s†   d  Z  d d l Z d d l Z d d l Z e j j d ƒ pH d e j k Z d d „  Z Gd d „  d e e	 ƒ Z
 d	 a d
 d „  Z d S)z›
    werkzeug.filesystem
    ~~~~~~~~~~~~~~~~~~~

    Various utilities for the local filesystem.

    :copyright: 2007 Pallets
    :license: BSD-3-Clause
é    NÚlinuxZbsdc             C   sG   |  d k r d Sy t  j |  ƒ j d k SWn t k
 rB d SYn Xd S)zÛGiven an encoding this figures out if the encoding is actually ASCII (which
    is something we don't actually want in most cases). This is necessary
    because ASCII comes under many names such as ANSI_X3.4-1968.
    NFÚascii)ÚcodecsÚlookupÚnameÚLookupError)Úencoding© r	   ú7/tmp/pip-build-5gj8f0j9/Werkzeug/werkzeug/filesystem.pyÚ_is_ascii_encoding   s    r   c               @   s   e  Z d  Z d Z d S)ÚBrokenFilesystemWarningzcThe warning used by Werkzeug to signal a broken filesystem. Will only be
    used once per runtime.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r	   r	   r
   r   "   s   r   Fc              C   sR   t  j ƒ  }  t r |  s% t |  ƒ rN t sJ t j d j |  ƒ t ƒ d a d S|  S)a  Returns the filesystem encoding that should be used. Note that this is
    different from the Python understanding of the filesystem encoding which
    might be deeply flawed. Do not use this value against Python's unicode APIs
    because it might be different. See :ref:`filesystem-encoding` for the exact
    behavior.

    The concept of a filesystem encoding in generally is not something you
    should rely on. As such if you ever need to use this function except for
    writing wrapper code reconsider.
    z`Detected a misconfigured UNIX filesystem: Will use UTF-8 as filesystem encoding instead of {0!r}Tzutf-8)	ÚsysÚgetfilesystemencodingÚ#has_likely_buggy_unicode_filesystemr   Ú!_warned_about_filesystem_encodingÚwarningsÚwarnÚformatr   )Úrvr	   r	   r
   Úget_filesystem_encoding*   s    r   )r   r   r   r   ÚplatformÚ
startswithr   r   ÚRuntimeWarningÚUnicodeWarningr   r   r   r	   r	   r	   r
   Ú<module>
   s   !