[Touch-packages] [Bug 1857824] [NEW] kmimetypefinder5 misidentifies mimetype of python files containing certain strings

2021-05-18 Thread Launchpad Bug Tracker
You have been subscribed to a public bug:

Expected behavior:

$ kmimetypefinder5 example.py 
text/x-python3

or

$ kmimetypefinder5 example.py 
text/x-python

or

$ kmimetypefinder5 example.py 
text/plain

Actual behavior:

$ kmimetypefinder5 example.py 
application/xhtml+xml

Summary: Python scripts with a string containing HTML can be
misidentified as HTML files by kmimetypefinder5.

For example, this python script is identified as
"application/xhtml+xml":

#! /usr/bin/env python3
example_string = \
"""\
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
http://www.w3.org/1999/xhtml;>
  
Example title
  
  
Example body
  

"""
print('Hello, world!')

This difficulty is not shared by other mimetype identification tools.

$ kmimetypefinder5 example.py 
application/xhtml+xml
$ cat example2.py #! /usr/bin/env python3
print('Hello, world!')
$ kmimetypefinder5 example2.py 
text/x-python3
$ mimetype 'example.py'
example.py: text/x-python
$ mimetype 'example2.py'
example2.py: text/x-python
$ file --mime-type 'example.py'
example.py: text/plain
$ file --mime-type 'example2.py'
example2.py: text/plain

$ lsb_release -rd
Description:Ubuntu 18.04.3 LTS
Release:18.04
$ apt-cache policy kde-cli-tools
kde-cli-tools:
  Installed: 4:5.12.8-0ubuntu0.1
  Candidate: 4:5.12.8-0ubuntu0.1
  Version table:
 *** 4:5.12.8-0ubuntu0.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
Packages
100 /var/lib/dpkg/status
 4:5.12.4-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: kde-cli-tools 4:5.12.8-0ubuntu0.1
ProcVersionSignature: Ubuntu 4.15.0-72.81-generic 4.15.18
Uname: Linux 4.15.0-72-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: KDE
Date: Sun Dec 29 13:28:37 2019
InstallationDate: Installed on 2018-12-12 (381 days ago)
InstallationMedia: Kubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 
(20180725)
SourcePackage: kde-cli-tools
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: qtbase-opensource-src (Ubuntu)
 Importance: Undecided
 Status: New


** Tags: amd64 apport-bug bionic third-party-packages
-- 
kmimetypefinder5 misidentifies mimetype of python files containing certain 
strings
https://bugs.launchpad.net/bugs/1857824
You received this bug notification because you are a member of Ubuntu Touch 
seeded packages, which is subscribed to qtbase-opensource-src in Ubuntu.

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1857824] [NEW] kmimetypefinder5 misidentifies mimetype of python files containing certain strings

2020-09-23 Thread Launchpad Bug Tracker
You have been subscribed to a public bug:

Expected behavior:

$ kmimetypefinder5 example.py 
text/x-python3

or

$ kmimetypefinder5 example.py 
text/x-python

or

$ kmimetypefinder5 example.py 
text/plain

Actual behavior:

$ kmimetypefinder5 example.py 
application/xhtml+xml

Summary: Python scripts with a string containing HTML can be
misidentified as HTML files by kmimetypefinder5.

For example, this python script is identified as
"application/xhtml+xml":

#! /usr/bin/env python3
example_string = \
"""\
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
http://www.w3.org/1999/xhtml;>
  
Example title
  
  
Example body
  

"""
print('Hello, world!')

This difficulty is not shared by other mimetype identification tools.

$ kmimetypefinder5 example.py 
application/xhtml+xml
$ cat example2.py #! /usr/bin/env python3
print('Hello, world!')
$ kmimetypefinder5 example2.py 
text/x-python3
$ mimetype 'example.py'
example.py: text/x-python
$ mimetype 'example2.py'
example2.py: text/x-python
$ file --mime-type 'example.py'
example.py: text/plain
$ file --mime-type 'example2.py'
example2.py: text/plain

$ lsb_release -rd
Description:Ubuntu 18.04.3 LTS
Release:18.04
$ apt-cache policy kde-cli-tools
kde-cli-tools:
  Installed: 4:5.12.8-0ubuntu0.1
  Candidate: 4:5.12.8-0ubuntu0.1
  Version table:
 *** 4:5.12.8-0ubuntu0.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
Packages
100 /var/lib/dpkg/status
 4:5.12.4-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: kde-cli-tools 4:5.12.8-0ubuntu0.1
ProcVersionSignature: Ubuntu 4.15.0-72.81-generic 4.15.18
Uname: Linux 4.15.0-72-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: KDE
Date: Sun Dec 29 13:28:37 2019
InstallationDate: Installed on 2018-12-12 (381 days ago)
InstallationMedia: Kubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 
(20180725)
SourcePackage: kde-cli-tools
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: shared-mime-info (Ubuntu)
 Importance: Undecided
 Status: New


** Tags: amd64 apport-bug bionic third-party-packages
-- 
kmimetypefinder5 misidentifies mimetype of python files containing certain 
strings
https://bugs.launchpad.net/bugs/1857824
You received this bug notification because you are a member of Ubuntu Touch 
seeded packages, which is subscribed to shared-mime-info in Ubuntu.

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1857824] [NEW] kmimetypefinder5 misidentifies mimetype of python files containing certain strings

2020-09-23 Thread Launchpad Bug Tracker
You have been subscribed to a public bug:

Expected behavior:

$ kmimetypefinder5 example.py 
text/x-python3

or

$ kmimetypefinder5 example.py 
text/x-python

or

$ kmimetypefinder5 example.py 
text/plain

Actual behavior:

$ kmimetypefinder5 example.py 
application/xhtml+xml

Summary: Python scripts with a string containing HTML can be
misidentified as HTML files by kmimetypefinder5.

For example, this python script is identified as
"application/xhtml+xml":

#! /usr/bin/env python3
example_string = \
"""\
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
http://www.w3.org/1999/xhtml;>
  
Example title
  
  
Example body
  

"""
print('Hello, world!')

This difficulty is not shared by other mimetype identification tools.

$ kmimetypefinder5 example.py 
application/xhtml+xml
$ cat example2.py #! /usr/bin/env python3
print('Hello, world!')
$ kmimetypefinder5 example2.py 
text/x-python3
$ mimetype 'example.py'
example.py: text/x-python
$ mimetype 'example2.py'
example2.py: text/x-python
$ file --mime-type 'example.py'
example.py: text/plain
$ file --mime-type 'example2.py'
example2.py: text/plain

$ lsb_release -rd
Description:Ubuntu 18.04.3 LTS
Release:18.04
$ apt-cache policy kde-cli-tools
kde-cli-tools:
  Installed: 4:5.12.8-0ubuntu0.1
  Candidate: 4:5.12.8-0ubuntu0.1
  Version table:
 *** 4:5.12.8-0ubuntu0.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
Packages
100 /var/lib/dpkg/status
 4:5.12.4-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: kde-cli-tools 4:5.12.8-0ubuntu0.1
ProcVersionSignature: Ubuntu 4.15.0-72.81-generic 4.15.18
Uname: Linux 4.15.0-72-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: KDE
Date: Sun Dec 29 13:28:37 2019
InstallationDate: Installed on 2018-12-12 (381 days ago)
InstallationMedia: Kubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 
(20180725)
SourcePackage: kde-cli-tools
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: shared-mime-info (Ubuntu)
 Importance: Undecided
 Status: New


** Tags: amd64 apport-bug bionic third-party-packages
-- 
kmimetypefinder5 misidentifies mimetype of python files containing certain 
strings
https://bugs.launchpad.net/bugs/1857824
You received this bug notification because you are a member of Ubuntu Touch 
seeded packages, which is subscribed to shared-mime-info in Ubuntu.

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1857824] [NEW] kmimetypefinder5 misidentifies mimetype of python files containing certain strings

2020-09-22 Thread Launchpad Bug Tracker
You have been subscribed to a public bug:

Expected behavior:

$ kmimetypefinder5 example.py 
text/x-python3

or

$ kmimetypefinder5 example.py 
text/x-python

or

$ kmimetypefinder5 example.py 
text/plain

Actual behavior:

$ kmimetypefinder5 example.py 
application/xhtml+xml

Summary: Python scripts with a string containing HTML can be
misidentified as HTML files by kmimetypefinder5.

For example, this python script is identified as
"application/xhtml+xml":

#! /usr/bin/env python3
example_string = \
"""\
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
http://www.w3.org/1999/xhtml;>
  
Example title
  
  
Example body
  

"""
print('Hello, world!')

This difficulty is not shared by other mimetype identification tools.

$ kmimetypefinder5 example.py 
application/xhtml+xml
$ cat example2.py #! /usr/bin/env python3
print('Hello, world!')
$ kmimetypefinder5 example2.py 
text/x-python3
$ mimetype 'example.py'
example.py: text/x-python
$ mimetype 'example2.py'
example2.py: text/x-python
$ file --mime-type 'example.py'
example.py: text/plain
$ file --mime-type 'example2.py'
example2.py: text/plain

$ lsb_release -rd
Description:Ubuntu 18.04.3 LTS
Release:18.04
$ apt-cache policy kde-cli-tools
kde-cli-tools:
  Installed: 4:5.12.8-0ubuntu0.1
  Candidate: 4:5.12.8-0ubuntu0.1
  Version table:
 *** 4:5.12.8-0ubuntu0.1 500
500 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 
Packages
100 /var/lib/dpkg/status
 4:5.12.4-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: kde-cli-tools 4:5.12.8-0ubuntu0.1
ProcVersionSignature: Ubuntu 4.15.0-72.81-generic 4.15.18
Uname: Linux 4.15.0-72-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.9
Architecture: amd64
CurrentDesktop: KDE
Date: Sun Dec 29 13:28:37 2019
InstallationDate: Installed on 2018-12-12 (381 days ago)
InstallationMedia: Kubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 
(20180725)
SourcePackage: kde-cli-tools
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: shared-mime-info (Ubuntu)
 Importance: Undecided
 Status: New


** Tags: amd64 apport-bug bionic third-party-packages
-- 
kmimetypefinder5 misidentifies mimetype of python files containing certain 
strings
https://bugs.launchpad.net/bugs/1857824
You received this bug notification because you are a member of Ubuntu Touch 
seeded packages, which is subscribed to shared-mime-info in Ubuntu.

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp