@@ -200,16 +200,16 @@ def test_read_non_existent(self, reader, module, error_class, fn_ext):
200
200
201
201
path = os .path .join (HERE , "data" , "does_not_exist." + fn_ext )
202
202
msg1 = rf"File (b')?.+does_not_exist\.{ fn_ext } '? does not exist"
203
- msg2 = rf"\[Errno 2 \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
203
+ msg2 = rf"\[Errno [0-9]+ \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
204
204
msg3 = "Expected object or value"
205
205
msg4 = "path_or_buf needs to be a string file path or file-like"
206
206
msg5 = (
207
- rf"\[Errno 2 \] File .+does_not_exist\.{ fn_ext } does not exist: "
207
+ rf"\[Errno [0-9]+ \] File .+does_not_exist\.{ fn_ext } does not exist: "
208
208
rf"'.+does_not_exist\.{ fn_ext } '"
209
209
)
210
- msg6 = rf"\[Errno 2 \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
210
+ msg6 = rf"\[Errno [0-9]+ \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
211
211
msg7 = (
212
- rf"\[Errno 2 \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
212
+ rf"\[Errno [0-9]+ \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
213
213
)
214
214
msg8 = rf"Failed to open local file.+does_not_exist\.{ fn_ext } "
215
215
@@ -270,16 +270,16 @@ def test_read_expands_user_home_dir(
270
270
monkeypatch .setattr (icom , "_expand_user" , lambda x : os .path .join ("foo" , x ))
271
271
272
272
msg1 = rf"File (b')?.+does_not_exist\.{ fn_ext } '? does not exist"
273
- msg2 = rf"\[Errno 2 \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
273
+ msg2 = rf"\[Errno [0-9]+ \] No such file or directory: '.+does_not_exist\.{ fn_ext } '"
274
274
msg3 = "Unexpected character found when decoding 'false'"
275
275
msg4 = "path_or_buf needs to be a string file path or file-like"
276
276
msg5 = (
277
- rf"\[Errno 2 \] File .+does_not_exist\.{ fn_ext } does not exist: "
277
+ rf"\[Errno [0-9]+ \] File .+does_not_exist\.{ fn_ext } does not exist: "
278
278
rf"'.+does_not_exist\.{ fn_ext } '"
279
279
)
280
- msg6 = rf"\[Errno 2 \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
280
+ msg6 = rf"\[Errno [0-9]+ \] 没有那个文件或目录: '.+does_not_exist\.{ fn_ext } '"
281
281
msg7 = (
282
- rf"\[Errno 2 \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
282
+ rf"\[Errno [0-9]+ \] File o directory non esistente: '.+does_not_exist\.{ fn_ext } '"
283
283
)
284
284
msg8 = rf"Failed to open local file.+does_not_exist\.{ fn_ext } "
285
285
@@ -610,7 +610,7 @@ def test_bad_encdoing_errors():
610
610
611
611
def test_errno_attribute ():
612
612
# GH 13872
613
- with pytest .raises (FileNotFoundError , match = "\\ [Errno 2 \\ ]" ) as err :
613
+ with pytest .raises (FileNotFoundError , match = "\\ [Errno [0-9]+ \\ ]" ) as err :
614
614
pd .read_csv ("doesnt_exist" )
615
615
assert err .errno == errno .ENOENT
616
616
0 commit comments