Skip to content

Commit c5ca85e

Browse files
author
Release Manager
committed
Trac #30758: for python 3.6, universal_newlines=, not text=, must be used in run()
after #30740, `text=True` is still there, in the call to `run()`, and also not supported by Python 3.6. Cf. https://docs.python.org/3/library/subprocess.html {{{ Changed in version 3.7: Added the text parameter, as a more understandable alias of universal_newlines. Added the capture_output parameter. }}} as reported on [https://groups.google.com/d/msgid/sage- release/8404a7d9-b906-4301-b891-59733da482cen%40googlegroups.com sage- release] URL: https://trac.sagemath.org/30758 Reported by: dimpase Ticket author(s): Dima Pasechnik Reviewer(s): Clemens Heuberger
2 parents 1e728ac + 9307ef2 commit c5ca85e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sage/features/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def package_systems():
373373
# Try to use scripts from SAGE_ROOT (or an installation of sage_bootstrap)
374374
# to obtain system package advice.
375375
try:
376-
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
376+
proc = run('sage-guess-package-system', shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
377377
_cache_package_systems = [PackageSystem(proc.stdout.strip())]
378378
except CalledProcessError:
379379
pass
@@ -440,11 +440,11 @@ def _spkg_installation_hint(self, spkgs, prompt, feature):
440440
system = self.name
441441
try:
442442
proc = run(f'sage-get-system-packages {system} {spkgs}',
443-
shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
443+
shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
444444
system_packages = proc.stdout.strip()
445445
print_sys = f'sage-print-system-package-command {system} --verbose --sudo --prompt="{prompt}"'
446446
command = f'{print_sys} update && {print_sys} install {system_packages}'
447-
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, text=True, check=True)
447+
proc = run(command, shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True, check=True)
448448
command = proc.stdout.strip()
449449
if command:
450450
lines.append(f'To install {feature} using the {system} package manager, you can try to run:')

0 commit comments

Comments
 (0)