Skip to content

CsvReader does not accept absolute path names in Windows #398

Description

@alaindebecker

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.

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 ope
│     _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 1489, in validatepath
│     raise errors.InvalidCharsInPath(path)
╰ fs.errors.InvalidCharsInPath  path 'C:Users/alain/Desktop/projects/pyetl/Employees.txt' contains invalid characters

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions