@@ -3,7 +3,7 @@ from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite
33from  collections .abc  import  Callable , ItemsView , Iterable , Iterator , Mapping , MutableMapping , Sequence 
44from  re  import  Pattern 
55from  typing  import  Any , ClassVar , Final , Literal , TypeVar , overload , type_check_only 
6- from  typing_extensions  import  TypeAlias 
6+ from  typing_extensions  import  TypeAlias ,  deprecated 
77
88if  sys .version_info  >=  (3 , 14 ):
99    __all__  =  (
@@ -271,6 +271,7 @@ class RawConfigParser(_Parser):
271271    def  read_string (self , string : str , source : str  =  "<string>" ) ->  None : ...
272272    def  read_dict (self , dictionary : Mapping [str , Mapping [str , Any ]], source : str  =  "<dict>" ) ->  None : ...
273273    if  sys .version_info  <  (3 , 12 ):
274+         @deprecated ("Deprecated since Python 3.2; removed in Python 3.12. Use `parser.read_file()` instead." ) 
274275        def  readfp (self , fp : Iterable [str ], filename : str  |  None  =  None ) ->  None : ...
275276    # These get* methods are partially applied (with the same names) in 
276277    # SectionProxy; the stubs should be kept updated together 
@@ -331,7 +332,8 @@ class ConfigParser(RawConfigParser):
331332    ) ->  str  |  _T : ...
332333
333334if  sys .version_info  <  (3 , 12 ):
334-     class  SafeConfigParser (ConfigParser ): ...  # deprecated alias 
335+     @deprecated ("Deprecated since Python 3.2; removed in Python 3.12. Use `ConfigParser` instead." ) 
336+     class  SafeConfigParser (ConfigParser ): ...
335337
336338class  SectionProxy (MutableMapping [str , str ]):
337339    def  __init__ (self , parser : RawConfigParser , name : str ) ->  None : ...
@@ -443,10 +445,22 @@ class ParsingError(Error):
443445    elif  sys .version_info  >=  (3 , 12 ):
444446        def  __init__ (self , source : str ) ->  None : ...
445447    else :
446-         def  __init__ (self , source : str  |  None  =  None , filename : str  |  None  =  None ) ->  None : ...
448+         @overload  
449+         def  __init__ (self , source : str , filename : None  =  None ) ->  None : ...
450+         @overload  
451+         @deprecated ("The `filename` parameter removed in Python 3.12. Use `source` instead." ) 
452+         def  __init__ (self , source : None  =  None , filename : str  =  ...) ->  None : ...
447453
448454    def  append (self , lineno : int , line : str ) ->  None : ...
449455
456+     if  sys .version_info  <  (3 , 12 ):
457+         @property  
458+         @deprecated ("Deprecated since Python 3.2; removed in Python 3.12. Use `source` instead." ) 
459+         def  filename (self ) ->  str : ...
460+         @filename .setter  
461+         @deprecated ("Deprecated since Python 3.2; removed in Python 3.12. Use `source` instead." ) 
462+         def  filename (self , value : str ) ->  None : ...
463+ 
450464class  MissingSectionHeaderError (ParsingError ):
451465    lineno : int 
452466    line : str 
0 commit comments