[Pkg-privacy-commits] [torbrowser-launcher] 29/59: Split print calls on newlines

Roger Shimizu rogershimizu at gmail.com
Mon Jan 29 13:43:58 UTC 2018


This is an automated email from the git hooks/post-receive script.

rosh pushed a commit to branch debian/sid
in repository torbrowser-launcher.

commit 469331e5692d4554d1ff696576cdfe6aaaf7e99a
Author: Karl-Johan Karlsson <creideiki at ferretporn.se>
Date:   Sat Dec 16 12:52:00 2017 +0100

    Split print calls on newlines
    
    If torbrowser-launcher cannot write to stdout, e.g. because it was
    started in the background and the controlling terminal has been closed
    or because it was started from a desktop environment launcher whose
    stdout has been closed, it crashes after updating the GnuPG key.
    
    This is due to print() crashing the program if stdout isn't writeable
    and the string to print contains a newline.
    
    To work around the problem, split the strings containing newlines into
    several calls to print().
    
    See also the upstream bug at https://bugs.python.org/issue32345
    
    Closes #298
---
 torbrowser_launcher/common.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py
index f260058..453343a 100644
--- a/torbrowser_launcher/common.py
+++ b/torbrowser_launcher/common.py
@@ -226,9 +226,11 @@ class Common:
             if match and match.group(2) == 'IMPORT_OK':
                 fingerprint = str(match.group(4))
                 if match.group(3) == '0':
-                    print('Keyring refreshed successfully...\n  No key updates for key: ' + fingerprint)
+                    print('Keyring refreshed successfully...')
+                    print('  No key updates for key: ' + fingerprint)
                 elif match.group(3) == '4':
-                    print('Keyring refreshed successfully...\n  New signatures for key: ' + fingerprint)
+                    print('Keyring refreshed successfully...')
+                    print('  New signatures for key: ' + fingerprint)
                 else:
                     print('Keyring refreshed successfully...')
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list