New GitHub issue #101334 from gpshead:<br>

<hr>

<pre>
Run `test_tarfile` on a posix system as a user with a high userid such as 734380696 and `test_add_dir_getmember` will fail with:

```
ERROR: test_add_dir_getmember (test.test_tarfile.Bz2UstarReadTest.test_add_dir_getmember) 
---------------------------------------------------------------------- 
Traceback (most recent call last): 
  File "/.../cpython/Lib/test/test_tarfile.py", line 225, in test_add_dir_getmember                      
 self.add_dir_and_getmember('bar') 
  File "/.../cpython/Lib/test/test_tarfile.py", line 234, in add_dir_and_getmember 
    tar.add(name) 
 File "/.../cpython/Lib/tarfile.py", line 2001, in add 
    self.addfile(tarinfo) 
  File "/.../cpython/Lib/tarfile.py", line 2020, in addfile 
    buf = tarinfo.tobuf(self.format, self.encoding, self.errors) 
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  File "/.../cpython/Lib/tarfile.py", line 823, in tobuf 
    return self.create_ustar_header(info, encoding, errors)                                                                  
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  File "/.../cpython/Lib/tarfile.py", line 842, in create_ustar_header 
    return self._create_header(info, USTAR_FORMAT, encoding, errors) 
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  File "/.../cpython/Lib/tarfile.py", line 954, in _create_header 
    itn(info.get("uid", 0), 8, format), 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  File "/.../cpython/Lib/tarfile.py", line 214, in itn 
    raise ValueError("overflow in number field") 
ValueError: overflow in number field               
```
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/101334">View on GitHub</a>
<p>Labels: type-bug, stdlib</p>
<p>Assignee: </p>