Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Low Target-2.7.7

New issue 1333 by pekka.klarck: Tidy: Using `--inplace` with directory fails with an exception
http://code.google.com/p/robotframework/issues/detail?id=1333

This is invalid usage but it shouldn't fail like this:

$ python -m robot.tidy -i -f html directory
Unexpected error: AttributeError: 'NoneType' object has no attribute 'rfind'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/robot/tidy.py", line 184, in main
    tidy.inplace(source)
File "/usr/local/lib/python2.7/dist-packages/robot/tidy.py", line 131, in inplace
    self._save_file(self._parse_data(path))
File "/usr/local/lib/python2.7/dist-packages/robot/tidy.py", line 155, in _save_file
    data.save(output=output, **self._options)
File "/usr/local/lib/python2.7/dist-packages/robot/parsing/model.py", line 114, in save
    return DataFileWriter(**options).write(self)
File "/usr/local/lib/python2.7/dist-packages/robot/writer/datafilewriter.py", line 41, in write
    with WritingContext(datafile, **self._options) as ctx:
File "/usr/local/lib/python2.7/dist-packages/robot/writer/datafilewriter.py", line 97, in __enter__
    self.output = open(self._output_path(), 'wb')
File "/usr/local/lib/python2.7/dist-packages/robot/writer/datafilewriter.py", line 117, in _output_path
    return '%s.%s' % (self._base_name(), self.format)
File "/usr/local/lib/python2.7/dist-packages/robot/writer/datafilewriter.py", line 120, in _base_name
    return os.path.splitext(self._source_from_file())[0]
  File "/usr/lib/python2.7/posixpath.py", line 105, in splitext
    return genericpath._splitext(p, sep, altsep, extsep)
  File "/usr/lib/python2.7/genericpath.py", line 91, in _splitext
    sepIndex = p.rfind(sep)


Reply via email to