Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Deserialization/deserialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function TBEventFileCollectionIterator(path; purge=true)
# Only consider files whose first event file would be valid.
# So if there are other files in this folder, we ignore them.
for fname in fnames
# Skip subdirectories and other non-file entries. Opening a directory
# throws "Permission denied" on Windows (and silently misbehaves
# elsewhere), so guard the `open` call below.
isfile(joinpath(path, fname)) || continue
open(joinpath(path,fname), "r") do f
is_valid_event(f) && push!(good_fnames, fname)
end
Expand Down
5 changes: 4 additions & 1 deletion test/deserialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ ENV["GKSwstype"] = "100"
f = open(joinpath(dir, "mockdata"), "w")
write(f, "baddta")
close(f)


# Issue #152: ignore subdirectories (opening a directory throws on Windows)
mkpath(joinpath(dir, "checkpoints"))

tgs = TensorBoardLogger.tags(logger)
@test "test/val" ∈ tgs
@test "test/b" ∈ tgs
Expand Down
Loading