2d16a3a Protect against decoding errors with subprocess text mode

17 files Authored by adamwill a month ago, Committed by lsedlar a month ago,
    Protect against decoding errors with subprocess text mode
    
    All these are calling subprocess in 'text mode', where it will
    try to decode stdout/stderr using the default encoding (utf-8
    for us). If it doesn't decode, subprocess will raise an exception
    and kobo doesn't handle it, it just passes it along to us, so
    things blow up - see https://pagure.io/releng/issue/12474 . To
    avoid this, let's set `errors="replace"`, which tells the decoder
    to replace invalid data with ? characters. This way we should get
    as much of the output as can be read, and no crashes.
    
    We also replace `universal_newlines=True` with `text=True` as
    the latter is shorter, clearer, and what Python 3 subprocess
    wants us to use, it considers `universal_newlines` to just be
    a backwards-compatibility thing - "The universal_newlines argument
    is equivalent to text and is provided for backwards compatibility"
    
    Signed-off-by: Adam Williamson <awilliam@redhat.com>
    Merges: https://pagure.io/pungi/pull-request/1812
    
        
file modified
+3 -2
file modified
+2 -1
file modified
+4 -2
file modified
+8 -3
file modified
+4 -4
file modified
+2 -1
file modified
+3 -2
file modified
+2 -1
file modified
+4 -2
file modified
+44 -22
file modified
+2 -1
file modified
+4 -2
file modified
+1 -1
file modified
+1 -1
file modified
+40 -20