Bug 375472 - kfilemetadata test scripts have unnecessary dependency on Python 2
Summary: kfilemetadata test scripts have unnecessary dependency on Python 2
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kfilemetadata
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.29.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL: https://phabricator.kde.org/D4377
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-23 21:05 UTC by A. Wilcox (awilfox)
Modified: 2018-01-03 02:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.37.0
Sentry Crash Report:


Attachments
Universal Python patch for KFileMetadata 5.23-5.29 (805 bytes, patch)
2017-01-23 21:05 UTC, A. Wilcox (awilfox)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description A. Wilcox (awilfox) 2017-01-23 21:05:09 UTC
Created attachment 103608 [details]
Universal Python patch for KFileMetadata 5.23-5.29

The test scripts for external extractor and external writer use a simple Python script.  This is great, but there are two issues with the scripts:

- unnecessary imports of {os.path,os,subprocess}
- shebang uses /usr/bin/python2 when the scripts function on Python 3.4 and 3.5

Attached patch should work, and has been tested on the following matrix:

- KFileMetadata 5.23, 5.26, and 5.29.
- glibc and musl libcs on Linux 4.4 kernel
- x86, x86_64, ppc
- Python 2.7, Python 3.4.4, Python 3.5.2
Comment 1 A. Wilcox (awilfox) 2018-01-03 02:57:09 UTC
Fixed in commit 76ed16d7943791c851ea2222afd9afedd3127b02
Author:     A. Wilcox <mailto:awilfox@adelielinux.org>
AuthorDate: Tue Jul 11 21:41:34 2017 +0200
Commit:     Matthieu Gallien <matthieu_gallien@yahoo.fr>
CommitDate: Sat Jul 29 16:51:36 2017 +0200

    Fix Python dependency in test scripts for KFileMetaData (bug 375472)
    
    Summary:
    KFileMetaData test scripts are usable in both deprecated Python 2, and new Python 3.  This removes 'python2' from the shebang and uses the regular 'python' interpreter, thereby removing the requirement of Python 2 being on a system to be able to test KFileMetaData.
    
    Additionally, it removes unused imports.
    
    Test Plan:
    This patch was applied to:
    * 5.23
    * 5.26
    * 5.29
    
    It was tested on Linux kernel 4.4 using:
    * x86_64
    * x86_32
    * PowerPC
    
    With the following Python versions:
    * 2.7.10
    * 3.4.4
    * 3.5.1
    
    It was tested on glibc and musl libc.
    
    Reviewers: mgallien
    
    Reviewed By: mgallien
    
    Subscribers: #frameworks
    
    Tags: #frameworks
    
    Differential Revision: https://phabricator.kde.org/D4377