openSUSE / obs-service-go_modules

OBS Source Service to download, verify, and vendor Go module dependency sources
GNU General Public License v2.0
19 stars 18 forks source link

Usage of `capture_output` keyword argument breaks under python3.6 #43

Open josegomezr opened 11 months ago

josegomezr commented 11 months ago

capture_output was introduced in py3.7 as of this commit.

INFO:obs-service-go_modules:go mod download
Traceback (most recent call last):
  File "/usr/lib/obs/service/go_modules", line 276, in <module>
    main()
  File "/usr/lib/obs/service/go_modules", line 229, in main
    cp = cmd_go_mod("download", go_mod_dir)
  File "/usr/lib/obs/service/go_modules", line 183, in cmd_go_mod
    cp = run(["go", "mod", cmd], cwd=dir, capture_output=True, 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'
Aborting: service call failed:  /usr/lib/obs/service/go_modules --outdir /home/scc/obs/home:josegomezr/saml2aws/tmpsevpawis.go_modules.service
Source service run failed!

zypper info obs-service-go_modules

Information for package obs-service-go_modules:
-----------------------------------------------
Repository     : Main Repository
Name           : obs-service-go_modules
Version        : 0.5.0-bp155.1.7
Arch           : noarch
Vendor         : openSUSE
Installed Size : 45.8 KiB
Installed      : Yes
Status         : up-to-date
Source package : obs-service-go_modules-0.5.0-bp155.1.7.src
Upstream URL   : https://github.com/openSUSE/obs-service-go_modules
Summary        : An OBS source service: Download, verify and vendor Go module dependencies

python3 -V
Python 3.6.15
jloehel commented 9 months ago

Same for the text parameter:

Changed in version 3.7: Added the text parameter, as a more understandable alias of universal_newlines. Added the capture_output parameter.

Traceback (most recent call last):
  File "/usr/lib/obs/service/go_modules", line 276, in <module>
    main()
  File "/usr/lib/obs/service/go_modules", line 229, in main
    cp = cmd_go_mod("download", go_mod_dir)
  File "/usr/lib/obs/service/go_modules", line 183, in cmd_go_mod
    cp = run(["go", "mod", cmd], cwd=dir, 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 'text'