Bug report
http.server.SimpleHTTPRequestHandler.send_head() does not check if a file's mtime is valid for gmtime() on windows.
An OSError: [Errno 22] Invalid argument exception will be raised which is normal according to the documentation.
|
fs.st_mtime, datetime.timezone.utc) |
|
self.date_time_string(fs.st_mtime)) |
I encounter this error when using windows built-in unzip functionality to unzip a windows WireGuard client exported zip file.
The zip file does not contain any timestamp information. And windows will not auto fill timestamp information when unzipping.
And win32 api GetFileInformationByHandle will report back a timestamp of -11635213907.559603
Your environment
- CPython versions tested on:
3.10.9, 3.11.1, 3.12.0a4+
- Operating system and architecture: windows 11 pro 22h2 OS build 22621.1105 amd64
Linked PRs
Bug report
http.server.SimpleHTTPRequestHandler.send_head()does not check if a file's mtime is valid forgmtime()on windows.An
OSError: [Errno 22] Invalid argumentexception will be raised which is normal according to the documentation.cpython/Lib/http/server.py
Line 752 in ef633e5
cpython/Lib/http/server.py
Line 766 in ef633e5
I encounter this error when using windows built-in unzip functionality to unzip a windows WireGuard client exported zip file.
The zip file does not contain any timestamp information. And windows will not auto fill timestamp information when unzipping.
And win32 api
GetFileInformationByHandlewill report back a timestamp of-11635213907.559603Your environment
3.10.9,3.11.1,3.12.0a4+Linked PRs
fs.st_mtimebefore use. #101036