8000 Resolve daemon warnings for threading methods by emmanuel-ferdman · Pull Request #7532 · freedomofpress/securedrop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Resolve daemon warnings for threading methods #7532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions securedrop/pretty_bad_protocol/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _homedir_setter(self, directory): # type: ignore[no-untyped-def]
If unspecified, use $HOME/.config/python-gnupg. If specified, ensure
that the ``directory`` does not contain various shell escape
characters. If ``directory`` is not found, it will be automatically
created. Lastly, the ``direcory`` will be checked that the EUID has
created. Lastly, the ``directory`` will be checked that the EUID has
read and write permissions for it.

:param str directory: A relative or absolute path to the directory to
Expand Down Expand Up @@ -491,7 +491,7 @@ def _check_sane_and_get_gpg_version(self): # type: ignore[no-untyped-def]
except OSError:
log.error(
"Could neither invoke nor terminate a gpg process... "
"Are you sure you specified the corrent (and full) "
"Are you sure you specified the correct (and full) "
"path to the gpg binary?"
)

Expand Down Expand Up @@ -728,13 +728,13 @@ def _collect_output(self, process, result, writer=None, stdin=None): # type: ig
"""
stderr = codecs.getreader(self._encoding)(process.stderr)
rr = threading.Thread(target=self._read_response, args=(stderr, result))
rr.setDaemon(True)
rr.daemon = True
log.debug("stderr reader: %r", rr)
rr.start()

stdout = process.stdout
dr = threading.Thread(target=self._read_data, args=(stdout, result))
dr.setDaemon(True)
dr.daemon = True
log.debug("stdout reader: %r", dr)
dr.start()

Expand Down
6 changes: 3 additions & 3 deletions securedrop/pretty_bad_protocol/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _copy_data(instream, outstream): # type: ignore[no-untyped-def]
except TypeError as te:
# XXX FIXME This appears to happen because
# _threaded_copy_data() sometimes passes the `outstream` as an
# object with type <_io.BufferredWriter> and at other times
# object with type <_io.BufferedWriter> and at other times
# with type <encodings.utf_8.StreamWriter>. We hit the
# following error when the `outstream` has type
# <encodings.utf_8.StreamWriter>.
Expand Down Expand Up @@ -393,7 +393,7 @@ def _threaded_copy_data(instream, outstream): # type: ignore[no-untyped-def]
:param file outstream: The file descriptor of a tmpfile to write to.
"""
copy_thread = threading.Thread(target=_copy_data, args=(instream, outstream))
copy_thread.setDaemon(True)
copy_thread.daemon = True
log.debug("%r, %r, %r", copy_thread, instream, outstream)
copy_thread.start()
return copy_thread
Expand All @@ -406,7 +406,7 @@ def _which(executable, flags=os.X_OK, abspath_only=False, disallow_symlinks=Fals

On newer versions of MS-Windows, the PATHEXT environment variable will be
set to the list of file extensions for files considered executable. This
will normally include things like ".EXE". This fuction will also find files
will normally include things like ".EXE". This function will also find files
with the given name ending with any of these extensions.

On MS-Windows the only flag that has any meaning is os.F_OK. Any other
Expand Down
Loading
0