-
Notifications
You must be signed in to change notification settings - Fork 23
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
A string file path was read as bytes in pyreadr.read_r() #94
Comments
The string is transformed to bytes to be passed to the C library, that detail is not relevant. |
Another thing to check: the string must be utf-8 encoded. If it is in another encoding transform it to utf-8. It is described in the docs. |
Hi Otto, thank you for your reply. Unfortunately, I still have the same issue. I run the script within Docker. The script and the Rda file are in the same container, so it is not a remote one. The string is utf-8 encoded by default. |
strange, I work in Docker containers and it works without issues. Maybe it is the way your volumes are mounted? if you are working on a mounted volume have you tried moving your file to your home directory? In any case, unfortunately the opening of the file is happening at the C library level, which only accepts local files (home directory in docker works for me), and nothing can be done to change that. |
closed because lack of activity |
I was trying to read a Rda file but kept getting the error below:
File "/usr/local/lib/python3.8/site-packages/pyreadr/pyreadr.py", line 65, in read_r
raise PyreadrError("File {0} does not exist!".format(filename_bytes))
pyreadr.custom_errors.PyreadrError: File b'/path/to/file/file.Rda' does not exist!
I am sure that the path I pass to pyreadr.read_r() is a valid string, but it seems that there is always a b in front of the string. I have tried using strip() to avoid any possible spaces but it didn't work.
Any suggestions would be greatly appreciated!
The text was updated successfully, but these errors were encountered: