Skip to content

Bug Report: Tokenizer failed to handle the final line of listed projects when missing newline character #59

@Xiaoven

Description

@Xiaoven

Steps to reproduce

When prepare the file assigned to FILE_projects_list in config.ini, DO NOT end with an empty line:

path/to/project1.zip
path/to/project2.zip

Run python tokenizer.py zip, then check the log file and see:

[INFO] (MainThread) Starting zip project <1, path/to/project1.zip> (process 0)
...
[INFO] (MainThread) Starting zip project <2, path/to/project2.zi> (process 0)

The path of the last project is handled incorrectly which results in project not found.


This may caused by proj_paths.append(line[:-1]) in tokenizers/file-level/tokenizer.py .

Recommend to use line.strip() instead of line[:-1].

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