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