Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
e85d0d89
Verified
Commit
e85d0d89
authored
Oct 15, 2021
by
Baptiste Beauplat
Browse files
Use text=True as default for debexpo_exec
parent
fcb2642c
Changes
7
Hide whitespace changes
Inline
Side-by-side
debexpo/base/views.py
View file @
e85d0d89
...
@@ -63,8 +63,7 @@ def get_debexpo_version():
...
@@ -63,8 +63,7 @@ def get_debexpo_version():
# currently are in a git reposirtory. Hence, this is tested manually.
# currently are in a git reposirtory. Hence, this is tested manually.
try
:
try
:
output
=
debexpo_exec
(
command
,
args
,
output
=
debexpo_exec
(
command
,
args
,
cwd
=
dirname
(
abspath
(
__file__
)),
cwd
=
dirname
(
abspath
(
__file__
)))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
log
.
debug
(
'git not found, skip revision detection.'
)
log
.
debug
(
'git not found, skip revision detection.'
)
except
CalledProcessError
:
# pragma: no cover
except
CalledProcessError
:
# pragma: no cover
...
...
debexpo/plugins/diffclean.py
View file @
e85d0d89
...
@@ -43,8 +43,7 @@ class PluginDiffClean(BasePlugin):
...
@@ -43,8 +43,7 @@ class PluginDiffClean(BasePlugin):
def
_run_diffstat
(
self
,
diff_file
):
def
_run_diffstat
(
self
,
diff_file
):
try
:
try
:
output
=
debexpo_exec
(
"diffstat"
,
[
"-p1"
,
diff_file
],
output
=
debexpo_exec
(
"diffstat"
,
[
"-p1"
,
diff_file
],
cwd
=
dirname
(
diff_file
),
cwd
=
dirname
(
diff_file
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'diffstat not found'
)
self
.
failed
(
'diffstat not found'
)
# Looking at diffstat code, it only exit with a return code different
# Looking at diffstat code, it only exit with a return code different
...
...
debexpo/plugins/lintian.py
View file @
e85d0d89
...
@@ -68,8 +68,7 @@ class PluginLintian(BasePlugin):
...
@@ -68,8 +68,7 @@ class PluginLintian(BasePlugin):
# run as root in CI.
# run as root in CI.
"--allow-root"
,
"--allow-root"
,
str
(
changes
)],
str
(
changes
)],
cwd
=
dirname
(
changes
.
filename
),
cwd
=
dirname
(
changes
.
filename
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'lintian not found'
)
self
.
failed
(
'lintian not found'
)
except
TimeoutExpired
:
except
TimeoutExpired
:
...
...
debexpo/plugins/watch-file.py
View file @
e85d0d89
...
@@ -48,8 +48,7 @@ class PluginWatchFile(BasePlugin):
...
@@ -48,8 +48,7 @@ class PluginWatchFile(BasePlugin):
def
_run_uscan
(
self
,
source
):
def
_run_uscan
(
self
,
source
):
try
:
try
:
output
=
debexpo_exec
(
"uscan"
,
[
"--dehs"
,
'--report'
],
output
=
debexpo_exec
(
"uscan"
,
[
"--dehs"
,
'--report'
],
cwd
=
source
.
get_source_dir
(),
cwd
=
source
.
get_source_dir
())
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'uscan not found'
)
self
.
failed
(
'uscan not found'
)
except
CalledProcessError
as
e
:
except
CalledProcessError
as
e
:
...
...
debexpo/tools/debian/source.py
View file @
e85d0d89
...
@@ -57,8 +57,7 @@ class Source():
...
@@ -57,8 +57,7 @@ class Source():
try
:
try
:
debexpo_exec
(
'dpkg-source'
,
args
,
debexpo_exec
(
'dpkg-source'
,
args
,
stderr
=
STDOUT
,
stderr
=
STDOUT
,
cwd
=
dirname
(
self
.
dsc
.
filename
),
cwd
=
dirname
(
self
.
dsc
.
filename
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
log
.
error
(
'dpkg-source not found'
)
log
.
error
(
'dpkg-source not found'
)
raise
ExceptionSource
(
'Internal error. Please contact debexpo '
raise
ExceptionSource
(
'Internal error. Please contact debexpo '
...
...
debexpo/tools/gnupg.py
View file @
e85d0d89
...
@@ -225,7 +225,7 @@ class GnuPG():
...
@@ -225,7 +225,7 @@ class GnuPG():
try
:
try
:
output
=
debexpo_exec
(
self
.
gpg_path
,
cmd
,
env
=
env
,
output
=
debexpo_exec
(
self
.
gpg_path
,
cmd
,
env
=
env
,
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
input
=
str
(
stdin
)
,
text
=
True
)
input
=
str
(
stdin
))
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
return
(
e
.
output
,
e
.
returncode
)
return
(
e
.
output
,
e
.
returncode
)
except
subprocess
.
TimeoutExpired
:
except
subprocess
.
TimeoutExpired
:
...
...
debexpo/tools/proc.py
View file @
e85d0d89
...
@@ -38,4 +38,7 @@ def debexpo_exec(command, args, **kwargs):
...
@@ -38,4 +38,7 @@ def debexpo_exec(command, args, **kwargs):
f
'
{
basename
(
command
).
replace
(
"-"
,
"_"
).
upper
()
}
'
,
f
'
{
basename
(
command
).
replace
(
"-"
,
"_"
).
upper
()
}
'
,
getattr
(
settings
,
'SUBPROCESS_TIMEOUT'
,
None
))
getattr
(
settings
,
'SUBPROCESS_TIMEOUT'
,
None
))
return
check_output
([
command
]
+
args
,
timeout
=
timeout
,
**
kwargs
)
return
check_output
([
command
]
+
args
,
timeout
=
timeout
,
text
=
True
,
**
kwargs
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment