Skip to content

Unable to retrieve files from tar when the name of the inside files start with ./ #810

Description

@GravityCore

etetoolkit version used: 3.1.3, but is also seen from the code of the problematic script of ete4 at the time of writing

extractfile() method cannot recognize an existing file inside a tar file when the inside file has leading ./ in the name. Found out when used NCBITaxa(dbfile=ete_db_fpath, taxdump_file=ncbi_taxdump_fpath).

Not working for:

$ tar --create --gzip --file "resources/ncbi_taxdump/taxdump.tar.gz" --directory "resources/ncbi_taxdump/new_taxdump_233" .
$ tar -tf resources/ncbi_taxdump/taxdump.tar.gz 
./
./taxidlineage.dmp
./nodes.dmp
./host.dmp
./readme.txt
./delnodes.dmp
./division.dmp
./typeoftype.dmp
./merged.dmp
./images.dmp
./typematerial.dmp
./gencode.dmp
./gc.prt
./fullnamelineage.dmp
./rankedlineage.dmp
./citations.dmp
./excludedfromtype.dmp
./names.dmp

Working for:

$ tar --create --gzip --file "resources/ncbi_taxdump/taxdump.tar.gz" --directory "resources/ncbi_taxdump/new_taxdump_233" --transform 's|^\./||' .
$ tar -tf resources/ncbi_taxdump/taxdump.tar.gz 
./
taxidlineage.dmp
nodes.dmp
host.dmp
readme.txt
delnodes.dmp
division.dmp
typeoftype.dmp
merged.dmp
images.dmp
typematerial.dmp
gencode.dmp
gc.prt
fullnamelineage.dmp
rankedlineage.dmp
citations.dmp
excludedfromtype.dmp
names.dmp

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