Bug 9736 - yocto-bsp: unrecognised parameter exception using python3
Summary: yocto-bsp: unrecognised parameter exception using python3
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.2 M1
Assignee: Humberto Ibarra
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-06-09 00:44 UTC by Humberto Ibarra
Modified: 2016-06-20 15:10 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Humberto Ibarra 2016-06-09 00:44:35 UTC
Tried to run yocto-bsp script using a recent version of python3 and got the following error:

humberto@humberto-Gazelle-Pro:~/poky/build$ python3 --version
Python 3.4.3
humberto@humberto-Gazelle-Pro:~/poky/build$ yocto-bsp 
Traceback (most recent call last):
  File "/home/humberto/poky/scripts/yocto-bsp", line 150, in <module>
    ret = main()
  File "/home/humberto/poky/scripts/yocto-bsp", line 137, in main
    start_logging(loglevel)
  File "/home/humberto/poky/scripts/yocto-bsp", line 121, in start_logging
    logging.basicConfig(filname = 'yocto-bsp.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): filemode, filname


This didn't happen in python 2.7 or earlier versions of python3. I think the problem here is with the "filname" variable, after checking the history I realized this name has always been wrong but the logging system never complained (and apparently no one noticed the file name not showing up in the logging). 

I think it was this change https://hg.python.org/cpython/rev/2bc3e839a3a3/ the one to introduce the check that broke this part.
Comment 1 Humberto Ibarra 2016-06-09 15:09:39 UTC
Checked on 3.4.2 and the exception is not thrown. Checked 3.4.4 also and the exception is there. Seems like this issue only appears with Python >= 3.4.3

Will send the patch in a moment.
Comment 4 Jose Perez C 2016-06-20 15:10:23 UTC
Working as expected now

Validated on : commit 7b9e1f5ad8a427356f2ec516b1718138a7d3c64e


**************************************

poky/build$ yocto-bsp
Usage:

 Create a customized Yocto BSP layer.

 usage: yocto-bsp [--version] [--help] COMMAND [ARGS]

 Current 'yocto-bsp' commands are:
    create            Create a new Yocto BSP
    list              List available values for options and BSP properties

 See 'yocto-bsp help COMMAND' for more information on a specific command.


Options:
  --version    show program's version number and exit
  -h, --help   show this help message and exit
  -D, --debug  output debug information