File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ def setUp(self):
41
41
os .symlink (self .norm ('broken' ), self .norm ('sym1' ))
42
42
os .symlink ('broken' , self .norm ('sym2' ))
43
43
os .symlink (os .path .join ('a' , 'bcd' ), self .norm ('sym3' ))
44
+ self .open_dirfd ()
45
+
46
+ def open_dirfd (self ):
47
+ if self .dir_fd is not None :
48
+ os .close (self .dir_fd )
44
49
if {os .open , os .stat } <= os .supports_dir_fd and os .scandir in os .supports_fd :
45
50
self .dir_fd = os .open (self .tempdir , os .O_RDONLY | os .O_DIRECTORY )
46
51
else :
@@ -350,6 +355,10 @@ def test_glob_non_directory(self):
350
355
def test_glob_named_pipe (self ):
351
356
path = os .path .join (self .tempdir , 'mypipe' )
352
357
os .mkfifo (path )
358
+
359
+ # gh-117127: Reopen self.dir_fd to pick up directory changes
360
+ self .open_dirfd ()
361
+
353
362
self .assertEqual (self .rglob ('mypipe' ), [path ])
354
363
self .assertEqual (self .rglob ('mypipe*' ), [path ])
355
364
self .assertEqual (self .rglob ('mypipe' , '' ), [])
Original file line number Diff line number Diff line change @@ -155,9 +155,6 @@ resize_buffer(bytesio *self, size_t size)
155
155
alloc = size + 1 ;
156
156
}
157
157
158
- if (alloc > ((size_t )-1 ) / sizeof (char ))
159
- goto overflow ;
160
-
161
158
if (SHARED_BUF (self )) {
162
159
if (unshare_buffer (self , alloc ) < 0 )
163
160
return -1 ;
You can’t perform that action at this time.
0 commit comments