Skip to content

Commit

Permalink
CSVReader - Remove string type check for file name
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Sep 12, 2023
1 parent 5e68379 commit 2e8de49
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Orange/data/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,7 @@ def read(self):
skipinitialspace=True,
)
data = self.data_table(reader)

# TODO: Name can be set unconditionally when/if
# self.filename will always be a string with the file name.
# Currently, some tests pass StringIO instead of
# the file name to a reader.
if isinstance(self.filename, str):
data.name = path.splitext(
path.split(self.filename)[-1])[0]
data.name = path.splitext(path.split(self.filename)[-1])[0]
if error and isinstance(error, UnicodeDecodeError):
pos, endpos = error.args[2], error.args[3]
warning = ('Skipped invalid byte(s) in position '
Expand Down

0 comments on commit 2e8de49

Please sign in to comment.