Fix Python dependency in test scripts for KFileMetaData (bug 375472)
ClosedPublic

Authored by awilcox on Jan 31 2017, 6:37 PM.

Details

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.

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
awilcox updated this revision to Diff 10780.Jan 31 2017, 6:37 PM
awilcox retitled this revision from to Fix Python dependency in test scripts for KFileMetaData (bug 375472).
awilcox updated this object.
awilcox edited the test plan for this revision. (Show Details)
awilcox set the repository for this revision to R286 KFileMetaData.
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 31 2017, 6:37 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
awilcox edited the test plan for this revision. (Show Details)Jan 31 2017, 6:40 PM
mgallien edited edge metadata.Mar 29 2017, 9:19 PM

Sorry for the long delay before any actions from me.
Could you update the patch such that one can apply it to the current filemetadata repository (seems like you are renaming from kfilemetadata-5.23.0/autotests/samplefiles/testexternalwriter/main.py.old to kfilemetadata-5.23.0/autotests/samplefiles/testexternalwriter/main.py ) ?

Thanks in advance

awilcox updated this revision to Diff 15456.Jun 15 2017, 1:38 AM

This is now a patch made with `git format-patch``` against current master (6a24cf9). Still passes on both Py2 and Py3.

mgallien accepted this revision.Jul 11 2017, 7:49 PM

I tested on Debian with python2 (the version for /usr/bin/python ) . It works. Please ship your patch. Thanks for your work and sorry for the delay from my side.

This revision is now accepted and ready to land.Jul 11 2017, 7:49 PM
This revision was automatically updated to reflect the committed changes.