-
Notifications
You must be signed in to change notification settings - Fork 146
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
CsvReader does not accept absolute path names in Windows #398
Comments
@alaindebecker try using |
Hi deepu9, Thank for the quick answer. I do not see how to use I did try to wrap to warp the string in a My minimal reproductible example goes as follow:
FYI : According to your website, I insalled bonobo with |
I think this may be the hint. Look at the last error message. There is a
missing / after C: ...
'C:Users/alain/Desktop/projects/pyetl/Employees.txt'
…On Sun, Mar 21, 2021 at 6:26 AM Alain Debecker ***@***.***> wrote:
Hi deepu9, Thank for the quick answer.
I do not see how to use Path.cwd(), which gives me the current working
directory.
I did try to wrap to warp the string in a Path, which is fine for Path in
it self, but still produces the same error (on a a still no existing line
56 in bonobo/nodes/io/base.py).
My minimal reproductible example goes as follow:
myFile = # Change by any valid csv file of yours
print(Path(myFile)) # This is OK
graph = bonobo.Graph()
graph.add_chain(
bonobo.CsvReader(Path(myFile)) # Faulty ccode
)
bonobo.run(graph)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#398 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKFJ3SY4R7DE6GGVGID6OTTEXXZHANCNFSM4ZQRWIIA>
.
|
@alaindebecker When you use Say your file path is C:\Users\alain\Desktop\projects\pyetl\Employees.txt. When you use
Say your file path is C:\Users\alain\Desktop\projects\pyetl\subfolder1\subfolder1.2\Employees.txt, then your code should be:
|
Still not.
However, this time, the "/" after the "C:" was not erased, but all the "/" where converted to "\" and file name got truncated.
|
@alaindebecker Don't worry about forward or backward slashes, as the pathlib will take care of them. Also, I've noticed I've created same folder structure and it works for me. Thanks |
@alaindebecker Did you get a chance to re-check your code? Can you let me know how did it go. Thanks |
bonobo.CsvReader('C:Users/alain/Desktop/projects/pyetl/Employees.txt')
produce en error,while
bonobo.CsvReader('Employees.txt')
does not.The error is an
fs.errors.InvalidCharsInPath path 'C\:Users/alain/Desktop/projects/pyetl/Employees.txt' contains invalid characters
because of the filename contains ":
".The error is generated on line 56 of nbonobo\nodes\io\base.py", which is strange because this script on github does not contain a line 56, it stops after 46 lines.
The text was updated successfully, but these errors were encountered: