@@ -755,7 +755,13 @@ def open(self, mode="r", ensure=False, encoding=None):
755
755
if ensure :
756
756
self .dirpath ().ensure (dir = 1 )
757
757
if encoding :
758
- return error .checked_call (io .open , self .strpath , mode , encoding = encoding )
758
+ # Using type ignore here because of this error:
759
+ # error: Argument 1 has incompatible type overloaded function;
760
+ # expected "Callable[[str, Any, Any], TextIOWrapper]" [arg-type]
761
+ # Which seems incorrect, given io.open supports the given argument types.
762
+ return error .checked_call (
763
+ io .open , self .strpath , mode , encoding = encoding # type:ignore[arg-type]
764
+ )
759
765
return error .checked_call (open , self .strpath , mode )
760
766
761
767
def _fastjoin (self , name ):
@@ -1261,13 +1267,19 @@ def get_temproot(cls):
1261
1267
@classmethod
1262
1268
def mkdtemp (cls , rootdir = None ):
1263
1269
"""Return a Path object pointing to a fresh new temporary directory
1264
- (which we created ourself ).
1270
+ (which we created ourselves ).
1265
1271
"""
1266
1272
import tempfile
1267
1273
1268
1274
if rootdir is None :
1269
1275
rootdir = cls .get_temproot ()
1270
- return cls (error .checked_call (tempfile .mkdtemp , dir = str (rootdir )))
1276
+ # Using type ignore here because of this error:
1277
+ # error: Argument 1 has incompatible type overloaded function; expected "Callable[[str], str]" [arg-type]
1278
+ # Which seems incorrect, given tempfile.mkdtemp supports the given argument types.
1279
+ path = error .checked_call (
1280
+ tempfile .mkdtemp , dir = str (rootdir ) # type:ignore[arg-type]
1281
+ )
1282
+ return cls (path )
1271
1283
1272
1284
@classmethod
1273
1285
def make_numbered_dir (
0 commit comments