question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

filesystem.get mixes up filenames (when using GitHub)

See original GitHub issue

Disclaimer: I might be going about this the wrong way. If I do, please enlighten me 😄

I have the following snippet which (I hoped) would copy 3 files from a remote into a local folder:

fs = fsspec.filesystem("github", org="githubtraining", repo="hellogitworld")
fs.get(
    ["README.txt", "/resources/labels.properties", "/src/test/java/com/github/AppTest.java"],
    ["README.txt", "labels.properties", "AppTest.java")],
)

It does copy the content of the three files; however the order is mixed up. I.e., the copying happens as follows (order: remote --> local):

  • “README.txt” --> “AppTest.java”
  • “/resources/labels.properties” --> “README.txt”
  • “/src/test/java/com/github/AppTest.java” --> “labels.properties”

I haven’t dug into the source of fsspec, but my hunch is that it has to do with GH having a different order of files remotely than what is listed in the query.

Is this intended behavior? If so, what is the rationale behind it?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
martindurantcommented, Feb 4, 2022

No rush, I haven’t had any other complaints about this. I assume most people access single specific files with the github backend (so no problem with ordering) or, if they want many files, just clone the repo.

0reactions
martindurantcommented, Jun 30, 2022

Thanks for the test case! I will look at this early next week if no one gets to it, and put out a release when fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

duplicate files being overwritten · Issue #305 - GitHub
I have tried several way and this is the only way that prevent all issues with file name. Using timestamp is unique, so...
Read more >
Filenames and directories truncated to 30 characters #2706
Just make a simple project with an embedded resource file name with more than 30 characters, example: mylongfilenameherebuthereandherealso.
Read more >
FileMigrationHelper: Issue with case sensitive folder paths #273
Place an image in a folder with an uppercase name (e.g. assets/Planning/diagram. · Create a corresponding entry in the File table with a...
Read more >
Enable filenames with colon (:) on drvfs · Issue #1514 - GitHub
A plain dir shows the first line (size 0, short filename up to the colon), dir /r reveals the complete name with a...
Read more >
File names missing when using local files #1881 - GitHub
Describe the bug Label studio don't infer filenames from file system while using local files option To Reproduce Steps to reproduce the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found