OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by zhanhb - 02.07.2020
Last edited by Petr Štetiar - 14.07.2020

FS#3212 - fail to generate json overview image info with python3.6

With commit 263f7e5bbd119ebed1f514c16f659a2e2a2b132c, fail to generate json overview image info with python3.6.

$ python3 --version
Python 3.6.8
$ make V=sc -r json_overview_image_info
make[1]: Entering directory `/firmware'
cd "/firmware"; git log --format=%h -1 toolchain > /firmware/tmp/.ver_check
cmp -s /firmware/tmp/.ver_check /firmware/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/stamp/.ver_check || { \
	rm -rf /firmware/build_dir/target-mips_24kc_musl /firmware/staging_dir/target-mips_24kc_musl /firmware/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl /firmware/build_dir/toolchain-mips_24kc_gcc-8.4.0_musl; \
	mkdir -p /firmware/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/stamp; \
	mv /firmware/tmp/.ver_check /firmware/staging_dir/toolchain-mips_24kc_gcc-8.4.0_musl/stamp/.ver_check; \
}
WORK_DIR=/firmware/build_dir/target-mips_24kc_musl/json_info_files /firmware/scripts/json_overview_image_info.py /firmware/bin/targets/ath79/nand/profiles.json 
Traceback (most recent call last):
  File "/firmware/scripts/json_overview_image_info.py", line 47, in <module>
    text=True,
  File "/usr/lib64/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
make[1]: *** [/firmware/bin/targets/ath79/nand/profiles.json] Error 1
make[1]: Leaving directory `/firmware'
make: *** [json_overview_image_info] Error 2

Patch:
Work as expected with 3.6, not sure if this patch is working with other versions.

diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 59d69df314..3dd8c9c353 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -2,7 +2,7 @@
 
 from os import getenv, environ
 from pathlib import Path
-from subprocess import run
+from subprocess import run, PIPE
 from sys import argv
 import json
 
@@ -41,10 +41,10 @@ output["default_packages"] = run(
         f"target/linux/{output['target'].split('/')[0]}",
         "val.DEFAULT_PACKAGES",
     ],
-    capture_output=True,
+    stdout=PIPE, stderr=PIPE,
     check=True,
     env=environ.copy().update({"TOPDIR": Path().cwd()}),
-    text=True,
+    universal_newlines=True,
 ).stdout.split()
 
 if output:
Closed by  Petr ┼átetiar
14.07.2020 09:11
Reason for closing:  Fixed
Additional comments about closing:  

Fixed in git.openwrt.org/5b8b42c78b10957c6dea82eb 7a3e56a227d16edd

Rod Egan commented on 12.07.2020 09:54

This might be associated with  FS#3227 

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing