aboutcode-org / aboutcode-org/typecode

Filetype detection differences on Windows

未关闭
#12 5 条评论 0 个 reaction 已指派 1 人 已被 @JonoYang 认领 在 GitHub 查看
主要语言
Python
星标
10
派生
15
PR 合并指标
30 天内没有已合并 PR

描述

Some of the tests have different results on Windows:

```
FAILED tests/typecode/test_contenttype.py::TestContentTypeComplex::test_size
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_archive_e_tar_gz_4
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_archive_file_4_26_1_diff_gz_5
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_c_netdb_h_44
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_java_appender_java_53
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_java_commonviewersitefactory_jad_55
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_java_logger_java_56
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_java_contenttype_java_57
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_code_python___init___py_59
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_config_defconfig_ar531x_jffs2_71
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_doc_office_glitch_erd_vsd_84
FAILED tests/typecode/test_types.py::TestFileTypesDataDriven::test_filetest_doc_office_word_doc_91
```

In the case of `test_filetest_code_java_logger_56`, different filetype, mimetypes, and file size were detected:

Expected result for `test_filetest_code_java_logger_56`:
```
filetype_file: Java source, ASCII text
mimetype_file: text/x-java
mimetype_python: text/x-java-source
filetype_pygment: Java
programming_language: Java
is_file: yes
is_regular: yes
size: 6800
is_text: yes
contains_text: yes
is_source: yes
```

Result for `test_filetest_code_java_logger_56`:
```
filetype_file: ASCII text, with CRLF line terminators
mimetype_file: text/plain
mimetype_python: text/x-java-source
filetype_pygment: Java
programming_language: Java
is_file: yes
is_regular: yes
size: !!int '7013'
is_text: yes
contains_text: yes
is_java_source: yes
is_source: yes
```

The detected types and size should be the same. The other failing tests have similar issues.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。