-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid characters in the path #555
Comments
Couple things:
|
@dargueta thanks for your response. I don't understand from there about the first argument "src_fs (FS or str) – Source filesystem (instance or URL)." what does it mean? What should be passed here? I also don't understand your second point. What is "OSFS" as "a second file system"? Is it about the second argument? Note: I copied my code from this solution https://stackoverflow.com/questions/62247379/extract-tar-file-inside-memory-filesystem, is that wrong too? Thanks! |
Okay, I figured it out. The working code:
But I think the documentation should have examples. |
If you're trying to extract the contents of your zipfile to an in-memory filesystem, there's no need to copy the zipfile itself to the memfs first, you could just do something like: mem_fs = MemoryFS()
with ZipFS('C:\\project\\test.zip') as zip_fs:
fs.copy.copy_fs(zip_fs, mem_fs) |
@lurch Wow I didn't know there is an easy way to extract the content of a zip file into a memory file system, this is superhelpful, thanks! |
Oh, I thought you were trying to copy the zip file itself. Sorry I misled you! |
@dargueta I was trying to copy just because I didn't know that extracting can be done in other, simpler way. Also, I needed the copying anyway, so this thread turned out to be very helpful. |
I am having this same issue, using jupyter-fs on Windows. This is because To get fs to behave nicely with commonly used |
I have raised this issue with jupyter-fs, but the os.path.join pattern is very ingrained in Python coders, so it might be worth accommodating that. It would also give an easier route to adoption of PyFilesystem. |
@PaulKGrimes : PyFilesystem abstracts away from paths, and for any path manipulation there's |
@PaulKGrimes Pleas see the docs on PyFilesystem paths. |
I apologize if my question sounds silly but I just started using this library and can't find the answer to my question.
I'm trying to copy a file from my disk system to a memory file system:
I have the following exception: fs.errors.InvalidCharsInPath because the path contains ":" and "\". If I replace all these "invalid" characters with "/" the resource can't be found.
The OS: Win7.
How can this issue be solved? And what is the cross-platform solution (I will run my app on Linux too)?
Thanks!
The text was updated successfully, but these errors were encountered: