tensorflow / tensorflow/tensorflow

tf.io.gfile.walk broken on Windows

Open
#48,086 38 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

comp:ops stat:awaiting tensorflower type:bug
Dominant language
C++
Stars
200k
Forks
76.9k
Avg merge
2d 3h
Merged PRs (30d)
433

Description

It seems that the path isn't split correctly. Filenames come with an extra \ prefix. Minimal reproducible example:

import os
import tensorflow as tf


tf.io.gfile.makedirs("ram://folder")
with tf.io.gfile.GFile("ram://folder/file.txt", mode="w") as f:
    f.write("data")

for root, _, filenames in tf.io.gfile.walk("ram://folder"):
    for filename in filenames:
        assert tf.io.gfile.exists(os.path.join(root, filename))

This passes on *nix but not on Windows. Here is a quick CI run in GitHub actions showing this: https://github.com/adriangb/tensorflow-test/actions/runs/688190284

ccing @mihaimaruseac @bhack

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.