Skip to content
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 files in another directory #397

Open
alaindebecker opened this issue Mar 20, 2021 · 2 comments
Open

CsvReader does not accept files in another directory #397

alaindebecker opened this issue Mar 20, 2021 · 2 comments

Comments

@alaindebecker
Copy link

bonobo.CsvReader('../input.csv') gives an error.
However the file exists and bonobo.CsvReader('input.csv') works fine when the same file is moved into the working directory.

The error comes from:
fs.errors.IllegalBackReference path '../Employees.txt' contains back-references outside of filesystem
which tends to indicate that the root of the fs is reset by bonobo.

Note that the log message tells the error is generated at line 56 of bonobo\nodes\io\base.py. While in github this script has only 46 lines.

 Traceback (most recent call last):
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\execution\strategies\executor.py", line 54, in _runner
│     with node:
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\execution\contexts\base.py", line 73, in __enter__
│     self.start()
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\execution\contexts\node.py", line 85, in start
│     self._stack.setup(self)
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\config\processors.py", line 124, in setup
│     _append_to_context = next(_processed)
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\nodes\io\base.py", line 52, in file
│     with self.open(fs) as file:
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\bonobo\nodes\io\base.py", line 56, in open
│     return fs.open(self.path, self.mode, encoding=self.encoding)
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\fs\osfs.py", line 631, in open
│     _path = self.validatepath(path)
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\fs\osfs.py", line 678, in validatepath
│     return super(OSFS, self).validatepath(path)
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\fs\base.py", line 1502, in validatepath
│     path = abspath(normpath(path))
│   File "C:\Users\alain\AppData\Local\Programs\Python\Python39\lib\site-packages\fs\path.py", line 89, in normpath
│     raise IllegalBackReference(path)
╰ fs.errors.IllegalBackReference  path '../Employees.txt' contains back-references outside of filesystem
@deepu9
Copy link

deepu9 commented Mar 23, 2021

@alaindebecker Try the same solution as #398. I'm sure that'll fix both the issues.

@alaindebecker
Copy link
Author

I know it's probably the same issue. When issue #398 will be solved, I'll try if the workaround works here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants