Skip to content

Commit

Permalink
Merge pull request #2320 from ajkerrigan/ajk/fix/guess-tar-open-bytes
Browse files Browse the repository at this point in the history
[tar-] use open_bytes() for guessing filetype
  • Loading branch information
anjakefala committed Feb 19, 2024
2 parents c4f0280 + e05e87c commit be295d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ jobs:
- name: Ensure VisiData can create completions
run: python -v dev/zsh-completion.py

- name: Ensure VisiData does not drop lines from RepeatFiles
run: |
NUMLINES=$(seq 10000 | vd -b | wc -l)
if ! [[ $NUMLINES -eq 10000 ]]; then
exit 1
fi
2 changes: 1 addition & 1 deletion visidata/loaders/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def guess_zip(vd, p):

@VisiData.api
def guess_tar(vd, p):
if tarfile.is_tarfile(p.fp):
if tarfile.is_tarfile(p.open_bytes()):
return dict(filetype='tar')

@VisiData.api
Expand Down

0 comments on commit be295d8

Please sign in to comment.