[ 
https://issues.apache.org/jira/browse/TIKA-4408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136796#comment-18136796
 ] 

Hudson commented on TIKA-4408:
------------------------------

SUCCESS: Integrated in Jenkins build Tika » tika-main-jdk17 #1769 (See 
[https://ci-builds.apache.org/job/Tika/job/tika-main-jdk17/1769/])
[TIKA-4408] Fix Python env shebang detection (#3473) (github: 
[https://github.com/apache/tika/commit/2c68426fc910d6461de6f8b31621a060b5165ec6])
* (edit) CHANGES.txt
* (edit) tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
* (add) 
tika-core/src/test/java/org/apache/tika/mime/PythonShebangDetectionTest.java


> python file identified as application/x-sh under several circumstances
> ----------------------------------------------------------------------
>
>                 Key: TIKA-4408
>                 URL: https://issues.apache.org/jira/browse/TIKA-4408
>             Project: Tika
>          Issue Type: Bug
>          Components: core
>            Reporter: Carol Alexandru
>            Priority: Major
>              Labels: match, mime-type
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> The [definition for text/x-python in 
> tika-mimetypes.xml|https://github.com/apache/tika/blob/25619272d2f615df4ad87e27e7c8dec576f37627/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml#L8347]
>  is missing some matches. In particular
>  * #!{+}/usr{+}/bin/env ...
>  * all variants using python{+}3{+} instead of python
> For this reason, a file starting with any of the following valid and fairly 
> common lines are misidentified as application/x-sh (which matches #!/)
> {{#!/usr/bin/env python3}}
> {{#!/usr/bin/env python}}
> {{{}#!{}}}{{{}/usr/bin/python3{}}}
> {{... etc ...}}
> I might do a pull request if I get around to it.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to