Bug 9834

Summary: with python upgraded to version 3, "yocto-kernel patch add" script failed
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Ke Zou <ke.zou>
Component: meta-yoctoAssignee: Humberto Ibarra <humberto.ibarra.lopez>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jose.perez.carranza, leonardo.sandoval.gonzalez, poky.bs.watcher, poky.watcher, randy.macleod, sgw, yi.zhao
Version: 2.2   
Target Milestone: 2.2 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ke Zou 2016-06-28 06:55:26 UTC
test environment:
poky commit: 6f0c5537e02c59e1c8f3b08f598dc049ff8ee098

test case:
https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=305
use yocto-kernel to add patches for a BSP kernel recipe

follow the steps of this test case
create a qemu bsp ---- add a kernel patch
an error occurs:


Traceback (most recent call last):
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 394, in <module>
    ret = main()
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 370, in main
    start_logging(loglevel)
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 354, in start_logging
    logging.basicConfig(filname = 'yocto-kernel.log', filemode = 'w', level=loglevel)
  File "/usr/lib/python3.4/logging/__init__.py", line 1760, in basicConfig
    raise ValueError('Unrecognised argument(s): %s' % keys)
ValueError: Unrecognised argument(s): filname, filemode

############################################################
Start to test case 305: add a new patch to BSP
############################################################

/buildarea/jenkins-yocto/workspace/Yocto2.1-yocto-bsp_create_qemu_bsp/build_1
BSP: myqemumips64
PATCH: /buildarea/jenkins-yocto/patches/yocto-testmod.patch
Traceback (most recent call last):
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 394, in <module>
    ret = main()
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 370, in main
    start_logging(loglevel)
  File "/buildarea/jenkins-yocto/poky/scripts/yocto-kernel", line 354, in start_logging
    logging.basicConfig(filname = 'yocto-kernel.log', filemode = 'w', level=loglevel)
  File "/usr/lib/python3.4/logging/__init__.py", line 1760, in basicConfig
    raise ValueError('Unrecognised argument(s): %s' % keys)
ValueError: Unrecognised argument(s): filname, filemode
yocto-kernel: patch add failed
Comment 1 Leonardo Sandoval Gonzalez 2016-06-28 14:27:10 UTC
Looks to me that this commit fixed the reported issue. Moving it to NEEDINFO asking the reporter to try to reproduce it again, this time considering the 0aa5c commit.

commit 0aa5c2759901c6e1976eb34ce1d83a584a90f5a6
Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Date:   Thu Jun 9 11:01:40 2016 -0500

    scripts/yocto-bsp: Fixed typo in parameter that was causing exception
    
    There is a typo in the logging parameters, "filname" is being used instead
    of "filename". This didn't cause issues before since python 2 didn't
    validate unused parameters but with python >= 3.4.3 an exception is
    thrown. This patch fixes this parameter name.
    
    [Yocto #9736]
    
    (From meta-yocto rev: aae5c2c39f64be87152b2e5470b50681c0f54670)
    
    Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
    Signed-off-by: Ross Burton <ross.burton@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 2 Leonardo Sandoval Gonzalez 2016-06-30 15:02:51 UTC
I will try to reproduce it containing the missing patch.