View Issue Details

IDProjectCategoryView StatusLast Update
0000587fileGeneralpublic2024-12-15 17:19
Reportergeorgthegreat Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version5.46 
Summary0000587: 5.46 has broken python code detection
DescriptionThe following pytest:
```
$ cat test_magic.py
import magic


def test_buffer():
    res = magic.from_buffer('<html></html>')
    assert res == 'HTML document, ASCII text, with no line terminators'


def test_file():
    res = magic.from_file('contrib/tests/python-magic/test_magic.py')
    assert res == 'Python script, ASCII text executable'
```

is detected as ascii test
Steps To Reproduce```
file test_magic.py

test_magic.py: HTML document, ASCII text
```
Additional InformationWith 5.45 it worked just fine
TagsNo tags attached.

Activities

christos

2024-12-15 13:05

manager   ~0004132

How do I test this?

georgthegreat

2024-12-15 17:19

reporter   ~0004133

I do not quite undestand the problem with testing.
Just save the code into `test_magic.py` and apply `file` to it.

Steps to reproduce section covers exactly that.
This example is written using python-magic binding, but this does not matter at all.

Issue History

Date Modified Username Field Change
2024-12-12 12:19 georgthegreat New Issue
2024-12-15 13:05 christos Assigned To => christos
2024-12-15 13:05 christos Status new => assigned
2024-12-15 13:05 christos Status assigned => feedback
2024-12-15 13:05 christos Note Added: 0004132
2024-12-15 17:19 georgthegreat Note Added: 0004133
2024-12-15 17:19 georgthegreat Status feedback => assigned