-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Steps to reproduce
Create a file with a hash in the name.
echo "a,b" >> "test#file.CSV"
echo "1,2" >> "test#file.CSV"
Try to read it with another tool:
head "test#file.CSV"
Now try with tabview (1.4.4)
$ tabview "test#file.CSV"
Traceback (most recent call last):
File "/home/matthew/Documents/TSE/Internships/IEA/Workload/aws-batch/nemweb-batch/csv2parquet/venv/bin/tabview", line 108, in <module>
view(data, enc=args.encoding, start_pos=start_pos,
File "/home/matthew/Documents/TSE/Internships/IEA/Workload/aws-batch/nemweb-batch/csv2parquet/venv/lib/python3.12/site-packages/tabview/tabview.py", line 1301, in view
with open(parsed_path, 'rb') as fd:
^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'test'
Same result with using single quotes or no quotes to escape the file name.
Cause
urlparse will delete the # component, because for http URLs that makes sense. For local files, # doesn't mean anything different to other characters.
Since files are openned with open(parsed_path, 'rb'), it seems like tabview doesn't support reading remote files over http. So what's the point of the urlparse usage?
Solution
Delete the parse_path function. Just keep the filename data string as is.
Metadata
Metadata
Assignees
Labels
No labels