File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
src/textual_fspicker/parts Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
# ChangeLog
2
2
3
+ ## Unreleased
4
+
5
+ ** Released: WiP**
6
+
7
+ - Handled Windows throwing an ` OSError ` when ` mtime ` can't be adequately
8
+ worked out.
9
+ ([ 6#issuecomment-2669234263] ( https://github.com/davep/textual-fspicker/issues/6#issuecomment-2669234263 ) )
10
+
3
11
## v0.2.0
4
12
5
13
** Released: 2025-01-30**
Original file line number Diff line number Diff line change @@ -99,7 +99,16 @@ def _mtime(location: Path) -> str:
99
99
mtime = location .stat ().st_mtime
100
100
except FileNotFoundError :
101
101
mtime = 0
102
- return datetime .fromtimestamp (int (mtime )).isoformat ().replace ("T" , " " )
102
+ try :
103
+ mdatetime = datetime .fromtimestamp (int (mtime ))
104
+ except OSError :
105
+ # It's possible, on Windows anyway, for the attempt to convert a
106
+ # time like this to throw an OSError. So we'll capture that and
107
+ # default to the epoch.
108
+ #
109
+ # https://github.com/davep/textual-fspicker/issues/6#issuecomment-2669234263
110
+ mdatetime = datetime .fromtimestamp (0 )
111
+ return mdatetime .isoformat ().replace ("T" , " " )
103
112
104
113
@staticmethod
105
114
def _size (location : Path ) -> str :
You can’t perform that action at this time.
0 commit comments