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

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Wed Jul 1 22:17:48 EDT 2020


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - zhanhb (zhanhb) 

Attached to Project - OpenWrt/LEDE Project
Summary - fail to generate json overview image info with python3.6
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - 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 
    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:


More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3212

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list