+
    i   c                   s(   R t ^ RIt^ RIt^ RIt^ RIt. ROt ! R R]4      tRRR/R lltRRR/R llt	RRR/R llt
R tRR	 ltR
 tR t ^ RIt]P                   ]P"                  3 ]tR#   ]]3 d     ^ RIt]	t R#   ] d    ]
t  R# i ; ii ; i)a  Utilities to get a password and/or the current user name.

getpass(prompt[, stream[, echo_char]]) - Prompt for a password, with echo
turned off and optional keyboard feedback.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

NGetPassWarningc                   s    ] tR t^tRtR# )r     N)__name__Z
__module__Z__qualname__Z__firstlineno__Z__static_attributes__r        /usr/lib64/python3.14/getpass.pyr    r       s    4r   	echo_charc          	     s   \        V4       Rp\        P                  ! 4       ;_uu_ 4       p \        P                  ! R\        P
                  \        P                  ,          4      p\        P                  ! VR4      pVP                  V4       \        P                  ! V4      pVP                  V4       V'       g   TpTe    \(        P*                  ! T4      pTR,          p	T	^;;,          \(        P,                  ( ,          uu&   T'       d%   T	^;;,          \(        P.                  ( ,          uu&   \(        P0                  p
\3        \(        R4      '       d   T
\(        P4                  ,          p
 \(        P6                  ! YZT	4       \9        YTTR7      p\(        P6                  ! YZT4       TP;                  4        TP?                  R4       TuuRRR4       #   \         d    TP                  4         \        P                  P                  4       pM$  \         \"        3 d    Rp\%        Y4      p Mi ; i\        P                  pT'       g   \        P&                  p ELi ; i  \(        P6                  ! YZT4       TP;                  4        i ; i  \(        P<                   d*    Te   h YJd   TP                  4        \%        Y4      p ELi ; i  + '       g   i     R# ; i)a;  Prompt for a password, with echo turned off.

Args:
  prompt: Written on stream to ask for the input.  Default: 'Password: '
  stream: A writable file object to display the prompt.  Defaults to
          the tty.  If no tty is available defaults to sys.stderr.
  echo_char: A single ASCII character to mask input (e.g., '*').
          If None, input is hidden.
Returns:
  The seKr3t input.
Raises:
  EOFError: If our input tty or stdin was closed.
  GetPassWarning: When we were unable to turn echo off on the input.

Always restores terminal settings before returning.
Nz/dev/ttyzw+:NNNTCSASOFT)inputr   
) _check_echo_char
contextlibZ	ExitStackosZopenZO_RDWRZO_NOCTTYioZFileIOZenter_contextZTextIOWrapperOSErrorZclosesysstdinZfilenoAttributeError
ValueErrorfallback_getpassstderrtermios	tcgetattrZECHOZICANONZ	TCSAFLUSHZhasattrr   	tcsetattr
_raw_inputflushZerrorwrite)promptstreamr   passwdZstackZfdZttyr   ZoldZnewZtcsetattr_flagss   &&$        r   unix_getpassr      s(   " YF					5	$RYYr{{%:;B))B%C$$$S)E& >:''+!fA7<<-'Fw~~o-F")"3"37J//#w'7'77O#%%b3?'e2;=F %%b3?LLN 	Tk 
 	  
	$KKM:YY%%'"J/ :)&9: IIE
	$8 %%b3?LLN== 
:%  &KKM)&9
:Q 
 		s   KBG KA
JA!J2%I)'J>KI&7HI&H7	4I&6H7	7I&I&"K%I&&K))JJ:KKKKK'	c               s   \         P                  \         P                  Jd   \        W4      # \	        V4       V  F  p\
        P                  ! V4       K  	  Rp \
        P                  ! 4       pVR8X  g   VR8X  d   MVR8X  d   \        hVR8X  dZ   V'       dK   V'       dC   \
        P                  ! R4       \
        P                  ! R4       \
        P                  ! R4       VRR pK  WC,           pV'       g   K  \
        P                  ! V4       K  \
        P                  ! R4       \
        P                  ! R4       V# )	z:Prompt for password with echo off, using Windows getwch(). r   Z N)	r   r   Z	__stdin__r   r	   msvcrtZputwchZgetwchKeyboardInterrupt)r   r   r   ZcZpws   &&$  r   win_getpassr%   i   s    
yy%//Ya 	B
MMO9T	;##9Rd#c"d#CRBByi(
MM$
MM$Ir   c                s    \        V4       ^ RIpVP                  R\        ^R7       V'       g   \        P
                  p\        RVR7       \        WVR7      # )i    Nz%Can not control echo on the terminal.)Z
stacklevelz&Warning: Password input may be echoed.)Zfiler   )r	   warningsZwarnr    r   r   Zprintr   )r   r   r   r'   s   &&$ r   r   r      sJ    YMM9>   	
2@f	::r   c                 s   V f   R # \        V \        4      '       g"   \        R\        V 4      P                   24      h\        V 4      ^8X  d-   V P                  4       '       d   V P                  4       '       g   \        RV : 24      hR # )Nz''echo_char' must be a str or None, not z='echo_char' must be a single printable ASCII character, got: )	Z
isinstancestrZ	TypeErrorZtyper   ZlenZisprintableZisasciir   r&   s   &r   r	   r	      s    i%%A	?3346 7 	7 	I!!!## ,,5=: ; 	;  r   c                 s   V'       g   \         P                  pV'       g   \         P                  p\        V 4      p V '       d#    VP	                  V 4       VP                  4        V'       d   \        WV4      # VP                  4       pV'       g   \        hVR,          R8X  d   VRR pV#   \
         dL    T P                  TP                  R 4      p T P                  TP                  4      p TP	                  T 4        Li ; i)Zreplacer   Nr"   )r   r   r   r(   r   ZUnicodeEncodeErrorZencodeZencodingZdecoder   _readline_with_echo_charZreadlineZEOFError)r   r   r   r   Zlines   &&&& r   r   r      s    		[F	!LL  	'yAA>>DBx4CRyK " 	!]]6??I>F]]6??3FLL 		!s   B- -ADDc                 s~   R pRp VP                  ^4      pVR8X  g   VR8X  d    V# VR8X  d   \        hVR8X  g   VR8X  d1   V'       d"   V P                  R4       V P                  4        VR	R pKn  VR
8X  d   V'       d    V# RpK  VR8X  d   K  W5,          pV P                  V4       V P                  4        RpK  )r   FTr   r   r    Zr!   z NZZ r"   )Zreadr$   r   r   )r   r   r   r   Zeof_pressedZchars   &&&   r   r)   r)      s    FK
zz!}4<44<( M' V^##V^tt|W%CR[FV^ M #V^NFLL#LLNKr   c                 s   R F.  p \         P                  P                  V 4      pV'       g   K,  Vu # 	   ^ RIpVP	                  \         P
                  ! 4       4      ^ ,          #   \        \        3 d   p\        R4      ThRp?ii ; i)aM  Get the username from the environment or password database.

First try various environment variables, then the password
database.  This works on Windows as long as USERNAME is set.
Any failure to find a username raises OSError.

.. versionchanged:: 3.13
    Previously, various exceptions beyond just :exc:`OSError`
    were raised.
Nz"No username set in the environment)ZLOGNAMEZUSERZLNAMEZUSERNAME)	r   ZenvironZgetpwdZgetpwuidZgetuidImportErrorZKeyErrorr   )ZnameZuserr*   Zes       r   getuserr,      sr     9zz~~d#4K 9
C||BIIK(++" C:;BCs   .A% %B6BB)getpassr,   r    )z
Password: N)r   NNN)Z__doc__r
   r   r   r   Z__all__ZUserWarningr    r   r%   r   r	   r   r)   r,   r   r   r   r-   r+   r   r#   r   r   r   <module>r.      s   "  	 	 

0 ([ 'I IXt <;D ;; 6:C2 w((( G 	^$    #"#s0   A, ,	B6A?:B?	BBBB