neulab/tldr huggingface dataset:
To help with this, the certbot.compat.os module wraps the standard os module, and forbids usage of methods that lack support for these Windows security features.
As a developer, when working on Certbot or its plugins, you must use certbot.compat.os in every place you would need os (eg. from certbot.compat import os instead of import os). Otherwise the tests will fail when your PR is submitted.
Mypy type annotations Certbot uses the mypy static type checker. Python 3 natively supports official type annotations, which can then be tested for consistency using mypy. Python 2 doesn’t, but type annotations can be added in comments. Mypy does some type checks even without type annotations; we can find bugs in Certbot even without a fully annotated codebase.
Certbot supports both Python 2 and 3, so we’re using Python 2-style annotations.
Zulip wrote a great guide to using mypy. It’s useful, but you don’t have to read the whole thing to start contributing to Certbot.
To run mypy on Certbot, use tox -e mypy on a machine that has Python 3 installed.
Note that instead of just importing typing, due to packaging issues, in Certbot we import from acme.magic_typing and have to add some comments for pylint like this:
from acme.magic_typing import Dict
Also note that OpenSSL, which we rely on, has type definitions for crypto but not SSL. We use both.  Those imports should look like this:
from OpenSSL import crypto from OpenSSL import SSL # type: ignore # https://github.com/python/typeshed/issues/2052
Submitting a pull request Steps:
1. Write your code! When doing this, you should add mypy type annotations for any functions you add or modify. You can check that you've done this correctly by running tox -e mypy on a machine that has Python 3 installed.
2. Make sure your environment is set up properly and that you're in your virtualenv. You can do this by following the instructions in the Getting Started section.
3. Run tox -e lint to check for pylint errors. Fix any errors.
4. Run tox --skip-missing-interpreters to run the entire test suite including coverage. The --skip-missing-interpreters argument ignores missing versions of Python needed for running the tests. Fix any errors.
5. Submit the PR. Once your PR is open, please do not force push to the branch containing your pull request to squash or amend commits. We use squash merges on PRs and rewriting commits makes changes harder to track between reviews.
6. Did your tests pass on Azure Pipelines? If they didn't, fix any errors.
Asking for help If you have any questions while working on a Certbot issue, don't hesitate to ask for help! You can do this in the Certbot channel in EFF's Mattermost instance for its open source projects as described below.
You can get involved with several of EFF's software projects such as Certbot at the EFF Open Source Contributor Chat Platform.  By signing up for the EFF Open Source Contributor Chat Platform, you consent to share your personal information with the Electronic Frontier Foundation, which is the operator and data controller for this platform. The channels will be available both to EFF, and to other users of EFFOSCCP, who may use or disclose information in these channels outside of EFFOSCCP. EFF will use your information, according to the Privacy Policy, to further the mission of EFF, including hosting and moderating the discussions on this platform.
Use of EFFOSCCP is subject to the EFF Code of Conduct. When investigating an alleged Code of Conduct violation, EFF may review discussion channels or direct messages.
Building the Certbot and DNS plugin snaps Instructions for how to manually build and run the Certbot snap and the externally snapped DNS plugins that the Certbot project supplies are located in the README file at https://github.com/certbot/certbot/tree/master/tools/snap.
Updating certbot-auto and letsencrypt-auto NOTE: We are currently only accepting changes to certbot-auto that fix regressions on platforms where certbot-auto is the recommended installation method at https://certbot.eff.org/instructions. If you are unsure if a change you want to make qualifies, don't hesitate to ask for help!
Updating the scripts Developers should not modify the certbot-auto and letsencrypt-auto files in the root directory of the repository.  Rather, modify the letsencrypt-auto.template and associated platform-specific shell scripts in the letsencrypt-auto-source and letsencrypt-auto-source/pieces/bootstrappers directory, respectively.
Building letsencrypt-auto-source/letsencrypt-auto Once changes to any of the aforementioned files have been made, the letsencrypt-auto-source/letsencrypt-auto script should be updated.  In lieu of manually updating this script, run the build script, which lives at letsencrypt-auto-source/build.py:
python letsencrypt-auto-source/build.py
Running build.py will update the letsencrypt-auto-source/letsencrypt-auto script.  Note that the certbot-auto and letsencrypt-auto scripts in the root directory of the repository will remain unchanged after this script is run.  Your changes will be propagated to these files during the next release of Certbot.
Opening a PR When opening a PR, ensure that the following files are committed:
1. letsencrypt-auto-source/letsencrypt-auto.template and letsencrypt-auto-source/pieces/bootstrappers/*
2. letsencrypt-auto-source/letsencrypt-auto (generated by build.py)
It might also be a good idea to double check that no changes were inadvertently made to the certbot-auto or letsencrypt-auto scripts in the root of the repository.  These scripts will be updated by the core developers during the next release.
Updating the documentation Many of the packages in the Certbot repository have documentation in a docs/ directory. This directory is located under the top level directory for the package. For instance, Certbot's documentation is under certbot/docs.
To build the documentation of a package, make sure you have followed the instructions to set up a local copy of Certbot including activating the virtual environment. After that, cd to the docs directory you want to build and run the command:
make clean html
This would generate the HTML documentation in _build/html in your current docs/ directory.
Running the client with Docker You can use Docker Compose to quickly set up an environment for running and testing Certbot. To install Docker Compose, follow the instructions at https://docs.docker.com/compose/install/.
NOTE: Linux users can simply run pip install docker-compose to get Docker Compose after installing Docker Engine and activating your shell as described in the Getting Started section.
Now you can develop on your host machine, but run Certbot and test your changes in Docker. When using docker-compose make sure you are inside your clone of the Certbot repository. As an example, you can run the following command to check for linting errors:
docker-compose run --rm --service-ports development bash -c 'tox -e lint'
You can also leave a terminal open running a shell in the Docker container and modify Certbot code in another window. The Certbot repo on your host machine is mounted inside of the container so any changes you make immediately take effect. To do this, run:
docker-compose run --rm --service-ports development bash
Now running the check for linting errors described above is as easy as:
tox -e lint
Releases We release packages and upload them to PyPI (wheels and source tarballs).
• https://pypi.python.org/pypi/acme
• https://pypi.python.org/pypi/certbot
• https://pypi.python.org/pypi/certbot-apache
• https://pypi.python.org/pypi/certbot-nginx
• https://pypi.python.org/pypi/certbot-dns-cloudflare
• https://pypi.python.org/pypi/certbot-dns-cloudxns
• https://pypi.python.org/pypi/certbot-dns-digitalocean
• https://pypi.python.org/pypi/certbot-dns-dnsimple
• https://pypi.python.org/pypi/certbot-dns-dnsmadeeasy
• https://pypi.python.org/pypi/certbot-dns-google
• https://pypi.python.org/pypi/certbot-dns-linode
• https://pypi.python.org/pypi/certbot-dns-luadns
• https://pypi.python.org/pypi/certbot-dns-nsone
• https://pypi.python.org/pypi/certbot-dns-ovh
• https://pypi.python.org/pypi/certbot-dns-rfc2136
• https://pypi.python.org/pypi/certbot-dns-route53
The following scripts are used in the process:
• https://github.com/certbot/certbot/blob/master/tools/release.sh
We use git tags to identify releases, using Semantic Versioning. For example: v0.11.1.
Our packages are cryptographically signed and their signature can be verified using the PGP key A2CFB51FA275A7286234E7B24D17C995CD9775F2. This key can be found on major key servers and at https://dl.eff.org/certbot.pub.
Notes for package maintainers 0.  Please use our tagged releases, not master!
1.  Do not package certbot-compatibility-test as it's only used internally.
2.  To run tests on our packages, you should use pytest by running the command python -m pytest. Running pytest directly may not work because PYTHONPATH is not handled the same way and local modules may not be found by the test runner.
3.  If you'd like to include automated renewal in your package:
• certbot renew -q should be added to crontab or systemd timer.
• A random per-machine time offset should be included to avoid having a large number of your clients hit Let's Encrypt's servers simultaneously.
• --preconfigured-renewal should be included on the CLI or in cli.ini for all invocations of Certbot, so that it can adjust its interactive output regarding automated renewal (Certbot >= 1.9.0).
4. jws is an internal script for acme module and it doesn't have to be packaged - it's mostly for debugging: you can use it as echo foo | jws sign | jws verify.
5. Do get in touch with us. We are happy to make any changes that will make packaging easier. If you need to apply some patches don't do it downstream - make a PR here.
All Certbot components including acme, Certbot, and non-third party plugins follow Semantic Versioning both for its Python API and for the application itself. This means that we will not change behavior in a backwards incompatible way except in a new major version of the project.
NOTE: None of this applies to the behavior of Certbot distribution mechanisms such as certbot-auto or OS packages whose behavior may change at any time. Semantic versioning only applies to the common Certbot components that are installed by various distribution methods.
For Certbot as an application, the command line interface and non-interactive behavior can be considered stable with two exceptions. The first is that no aspects of Certbot's console or log output should be considered stable and it may change at any time. The second is that Certbot's behavior should only be considered stable with certain files but not all. Files with which users should expect Certbot to maintain its current behavior with are:
• /etc/letsencrypt/live/<domain>/{cert,chain,fullchain,privkey}.pem where <domain> is the name given to --cert-name. If --cert-name is not set by the user, it is the first domain given to --domains.
• CLI configuration files
• Hook directories in /etc/letsencrypt/renewal-hooks
Certbot's behavior with other files may change at any point.
Another area where Certbot should not be considered stable is its behavior when not run in non-interactive mode which also may change at any point.
In general, if we're making a change that we expect will break some users, we will bump the major version and will have warned about it in a prior release when possible. For our Python API, we will issue warnings using Python's warning module. For application level changes, we will print and log warning messages.
Documentation: https://certbot.eff.org/docs
certbot package Certbot client.
Subpackages certbot.compat package Compatibility layer to run certbot both on Linux and Windows.
This package contains all logic that needs to be implemented specifically for Linux and for Windows.  Then the rest of certbot code relies on this module to be platform agnostic.
Submodules certbot.compat.filesystem module Compat module to handle files security on Windows and Linux
certbot.compat.filesystem.chmod(file_path, mode) Apply a POSIX mode on given file_path:
• for Linux, the POSIX mode will be directly applied using chmod,
• for Windows, the POSIX mode will be translated into a Windows DACL that make sense for Certbot context, and applied to the file using kernel calls.
The definition of the Windows DACL that correspond to a POSIX mode, in the context of Certbot, is explained at https://github.com/certbot/certbot/issues/6356 and is implemented by the method _generate_windows_flags().
• file_path (str) -- Path of the file
• mode (int) -- POSIX mode to apply
certbot.compat.filesystem.umask(mask) Set the current numeric umask and return the previous umask. On Linux, the built-in umask method is used. On Windows, our Certbot-side implementation is used.
Parameters mask (int) -- The user file-creation mode mask to apply.
Return type int
Returns The previous umask value.
certbot.compat.filesystem.copy_ownership_and_apply_mode(src, dst, mode, copy_user, copy_group) Copy ownership (user and optionally group on Linux) from the source to the destination, then apply given mode in compatible way for Linux and Windows.  This replaces the os.chown command.
• src (str) -- Path of the source file
• dst (str) -- Path of the destination file
• mode (int) -- Permission mode to apply on the destination file
• copy_user (bool) -- Copy user if True
• copy_group (bool) -- Copy group if True on Linux (has no effect on Windows)
certbot.compat.filesystem.copy_ownership_and_mode(src, dst, copy_user=True, copy_group=True) Copy ownership (user and optionally group on Linux) and mode/DACL from the source to the destination.
certbot.compat.filesystem.check_mode(file_path, mode) Check if the given mode matches the permissions of the given file. On Linux, will make a direct comparison, on Windows, mode will be compared against the security model.
• mode (int) -- POSIX mode to test
Return type bool
Returns True if the POSIX mode matches the file permissions
certbot.compat.filesystem.check_owner(file_path) Check if given file is owned by current user.
Parameters file_path (str) -- File path to check
Returns True if given file is owned by current user, False otherwise.
certbot.compat.filesystem.check_permissions(file_path, mode) Check if given file has the given mode and is owned by current user.
• file_path (str) -- File path to check
• mode (int) -- POSIX mode to check
Returns True if file has correct mode and owner, False otherwise.
certbot.compat.filesystem.open(file_path, flags, mode=511) Wrapper of original os.open function, that will ensure on Windows that given mode is correctly applied.
• file_path (str) -- The file path to open
• flags (int) -- Flags to apply on file while opened
• mode (int) -- POSIX mode to apply on file when opened, Python defaults will be applied if None
Returns the file descriptor to the opened file
Raise  OSError(errno.EEXIST) if the file already exists and os.O_CREAT & os.O_EXCL are set, OSError(errno.EACCES) on Windows if the file already exists and is a directory, and os.O_CREAT is set.
certbot.compat.filesystem.makedirs(file_path, mode=511) Rewrite of original os.makedirs function, that will ensure on Windows that given mode is correctly applied.
• mode (int) -- POSIX mode to apply on leaf directory when created, Python defaults will be applied if None
certbot.compat.filesystem.mkdir(file_path, mode=511) Rewrite of original os.mkdir function, that will ensure on Windows that given mode is correctly applied.
• mode (int) -- POSIX mode to apply on directory when created, Python defaults will be applied if None
certbot.compat.filesystem.replace(src, dst) Rename a file to a destination path and handles situations where the destination exists.
• src (str) -- The current file path.
• dst (str) -- The new file path.
certbot.compat.filesystem.realpath(file_path) Find the real path for the given path. This method resolves symlinks, including recursive symlinks, and is protected against symlinks that creates an infinite loop.
Parameters file_path (str) -- The path to resolve
Returns The real path for the given path
Return type str
certbot.compat.filesystem.is_executable(path) Is path an executable file?
Parameters path (str) -- path to test
Returns True if path is an executable file
certbot.compat.filesystem.has_world_permissions(path) Check if everybody/world has any right (read/write/execute) on a file given its path.
Returns True if everybody/world has any right to the file
certbot.compat.filesystem.compute_private_key_mode(old_key, base_mode) Calculate the POSIX mode to apply to a private key given the previous private key.
• old_key (str) -- path to the previous private key
• base_mode (int) -- the minimum modes to apply to a private key
Returns the POSIX mode to apply
certbot.compat.filesystem.has_same_ownership(path1, path2) Return True if the ownership of two files given their respective path is the same.  On Windows, ownership is checked against owner only, since files do not have a group owner.
• path1 (str) -- path to the first file
• path2 (str) -- path to the second file
Returns True if both files have the same ownership, False otherwise
certbot.compat.filesystem.has_min_permissions(path, min_mode) Check if a file given its path has at least the permissions defined by the given minimal mode.  On Windows, group permissions are ignored since files do not have a group owner.
• path (str) -- path to the file to check
• min_mode (int) -- the minimal permissions expected
Returns True if the file matches the minimal permissions expectations, False otherwise
certbot.compat.misc module This compat module handles various platform specific calls that do not fall into one particular category.
certbot.compat.misc.raise_for_non_administrative_windows_rights() On Windows, raise if current shell does not have the administrative rights.  Do nothing on Linux.
Raises errors.Error -- If the current shell does not have administrative rights on Windows.
certbot.compat.misc.readline_with_timeout(timeout, prompt) Read user input to return the first line entered, or raise after specified timeout.
• timeout (float) -- The timeout in seconds given to the user.
• prompt (str) -- The prompt message to display to the user.
Returns The first line entered by the user.
certbot.compat.misc.get_default_folder(folder_type) Return the relevant default folder for the current OS
Parameters folder_type (str) -- The type of folder to retrieve (config, work or logs)
Returns The relevant default folder.
certbot.compat.misc.underscores_for_unsupported_characters_in_path(path) Replace unsupported characters in path for current OS by underscores.  :param str path: the path to normalize :return: the normalized path :rtype: str
certbot.compat.misc.execute_command(cmd_name, shell_cmd, env=None)
Run a command:
• on Linux command will be run by the standard shell selected with Popen(shell=True)
• on Windows command will be run in a Powershell shell
• cmd_name (str) -- the user facing name of the hook being run
• shell_cmd (str) -- shell command to execute
• env (dict) -- environ to pass into Popen
Returns tuple (str stderr, str stdout)
certbot.compat.os module This compat modules is a wrapper of the core os module that forbids usage of specific operations (e.g. chown, chmod, getuid) that would be harmful to the Windows file security model of Certbot.  This module is intended to replace standard os module throughout certbot projects (except acme).
This module has the same API as the os module in the Python standard library except for the functions defined below.
certbot.compat.os.fsencode(filename) Encode filename (an os.PathLike, bytes, or str) to the filesystem encoding with 'surrogateescape' error handler, return bytes unchanged.  On Windows, use 'strict' error handler if the file system encoding is 'mbcs' (which is the default encoding).
certbot.compat.os.fsdecode(filename) Decode filename (an os.PathLike, bytes, or str) from the filesystem encoding with 'surrogateescape' error handler, return str unchanged. On Windows, use 'strict' error handler if the file system encoding is 'mbcs' (which is the default encoding).
certbot.compat.os.get_exec_path(env=None) Returns the sequence of directories that will be searched for the named executable (similar to a shell) when launching a process.
env must be an environment variable dict or None.  If env is None, os.environ will be used.
certbot.compat.os.fdopen(fd, *args, **kwargs)
certbot.compat.os.popen(cmd, mode='r', buffering=- 1)
class certbot.compat.os.DirEntry Bases: object
inode() Return inode of the entry; cached per entry.
is_dir(*, follow_symlinks=True) Return True if the entry is a directory; cached per entry.
is_file(*, follow_symlinks=True) Return True if the entry is a file; cached per entry.
is_symlink() Return True if the entry is a symbolic link; cached per entry.
name   the entry's base filename, relative to scandir() "path" argument
path   the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)
stat(*, follow_symlinks=True) Return stat_result object for the entry; cached per entry.
certbot.compat.os.WCOREDUMP(status, /) Return True if the process returning status was dumped to a core file.
certbot.compat.os.WEXITSTATUS(status) Return the process return code from status.
certbot.compat.os.WIFCONTINUED(status) Return True if a particular process was continued from a job control stop.
Return True if the process returning status was continued from a job control stop.
certbot.compat.os.WIFEXITED(status) Return True if the process returning status exited via the exit() system call.
certbot.compat.os.WIFSIGNALED(status) Return True if the process returning status was terminated by a signal.
certbot.compat.os.WIFSTOPPED(status) Return True if the process returning status was stopped.
certbot.compat.os.WSTOPSIG(status) Return the signal that stopped the process that provided the status value.
certbot.compat.os.WTERMSIG(status) Return the signal that terminated the process that provided the status value.
certbot.compat.os.abort() Abort the interpreter immediately.
This function 'dumps core' or otherwise fails in the hardest way possible on the hosting operating system.  This function never returns.
certbot.compat.os.access(*unused_args, **unused_kwargs) Method os.access() is forbidden
certbot.compat.os.chdir(path) Change the current working directory to the specified path.
path may always be specified as a string.  On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception.
certbot.compat.os.chflags(path, flags, follow_symlinks=True) Set file flags.
If follow_symlinks is False, and the last element of the path is a symbolic link, chflags will change flags on the symbolic link itself instead of the file the link points to.
follow_symlinks may not be implemented on your platform.  If it is unavailable, using it will raise a NotImplementedError.
certbot.compat.os.chmod(*unused_args, **unused_kwargs) Method os.chmod() is forbidden
certbot.compat.os.chown(*unused_args, **unused_kwargs) Method os.chown() is forbidden
certbot.compat.os.chroot(path) Change root directory to path.
certbot.compat.os.close(fd) Close a file descriptor.
certbot.compat.os.closerange(fd_low, fd_high, /) Closes all file descriptors in [fd_low, fd_high), ignoring errors.
certbot.compat.os.confstr(name, /) Return a string-valued system configuration variable.
certbot.compat.os.cpu_count() Return the number of CPUs in the system; return None if indeterminable.
This number is not equivalent to the number of CPUs the current process can use.  The number of usable CPUs can be obtained with len(os.sched_getaffinity(0))
certbot.compat.os.ctermid() Return the name of the controlling terminal for this process.
certbot.compat.os.device_encoding(fd) Return a string describing the encoding of a terminal's file descriptor.
The file descriptor must be attached to a terminal.  If the device is not a terminal, return None.
certbot.compat.os.dup(fd, /) Return a duplicate of a file descriptor.
certbot.compat.os.dup2(fd, fd2, inheritable=True) Duplicate file descriptor.
certbot.compat.os.error alias of builtins.OSError
certbot.compat.os.execv(path, argv, /) Execute an executable path with arguments, replacing current process.
path   Path of executable file.
argv   Tuple or list of strings.
certbot.compat.os.execve(path, argv, env) Execute an executable path with arguments, replacing current process.
env    Dictionary of strings mapping to strings.
certbot.compat.os.fchdir(fd) Change to the directory of the given file descriptor.
fd must be opened on a directory, not a file.  Equivalent to os.chdir(fd).
certbot.compat.os.fchmod(fd, mode) Change the access permissions of the file given by file descriptor fd.
Equivalent to os.chmod(fd, mode).
certbot.compat.os.fchown(fd, uid, gid) Change the owner and group id of the file specified by file descriptor.
Equivalent to os.chown(fd, uid, gid).
certbot.compat.os.fdatasync(fd) Force write of fd to disk without forcing update of metadata.
certbot.compat.os.fork() Fork a child process.
Return 0 to child process and PID of child to parent process.
certbot.compat.os.forkpty() Fork a new process with a new pseudo-terminal as controlling tty.
Returns a tuple of (pid, master_fd).  Like fork(), return pid of 0 to the child process, and pid of child to the parent process.  To both, return fd of newly opened pseudo-terminal.
certbot.compat.os.fpathconf(fd, name, /) Return the configuration limit name for the file descriptor fd.
If there is no limit, return -1.
certbot.compat.os.fspath(path) Return the file system path representation of the object.
If the object is str or bytes, then allow it to pass through as-is. If the object defines __fspath__(), then return the result of that method. All other types raise a TypeError.
certbot.compat.os.fstat(*unused_args, **unused_kwargs) Method os.stat() is forbidden
certbot.compat.os.fstatvfs(fd, /) Perform an fstatvfs system call on the given fd.
Equivalent to statvfs(fd).
certbot.compat.os.fsync(fd) Force write of fd to disk.
certbot.compat.os.ftruncate(fd, length, /) Truncate a file, specified by file descriptor, to a specific length.
certbot.compat.os.get_blocking(fd) -> bool Get the blocking mode of the file descriptor: False if the O_NONBLOCK flag is set, True if the flag is cleared.
certbot.compat.os.get_inheritable(fd, /) Get the close-on-exe flag of the specified file descriptor.
certbot.compat.os.get_terminal_size() Return the size of the terminal window as (columns, lines).
The optional argument fd (default standard output) specifies which file descriptor should be queried.
If the file descriptor is not connected to a terminal, an OSError is thrown.
This function will only be defined if an implementation is available for this system.
shutil.get_terminal_size is the high-level function which should normally be used, os.get_terminal_size is the low-level implementation.
certbot.compat.os.getcwd() Return a unicode string representing the current working directory.
certbot.compat.os.getcwdb() Return a bytes string representing the current working directory.
certbot.compat.os.getegid() Return the current process's effective group id.
certbot.compat.os.geteuid() Return the current process's effective user id.
certbot.compat.os.getgid() Return the current process's group id.
certbot.compat.os.getgrouplist(user, group) -> list of groups to which a user belongs Returns a list of groups to which a user belongs. user: username to lookup group: base group id of the user
certbot.compat.os.getgroups() Return list of supplemental group IDs for the process.
certbot.compat.os.getloadavg() Return average recent system load information.
Return the number of processes in the system run queue averaged over the last 1, 5, and 15 minutes as a tuple of three floats. Raises OSError if the load average was unobtainable.
certbot.compat.os.getlogin() Return the actual login name.
certbot.compat.os.getpgid(pid) Call the system call getpgid(), and return the result.
certbot.compat.os.getpgrp() Return the current process group id.
certbot.compat.os.getpid() Return the current process id.
certbot.compat.os.getppid() Return the parent's process id.
If the parent process has already exited, Windows machines will still return its id; others systems will return the id of the 'init' process (1).
certbot.compat.os.getpriority(which, who) Return program scheduling priority.
certbot.compat.os.getresgid() Return a tuple of the current process's real, effective, and saved group ids.
certbot.compat.os.getresuid() Return a tuple of the current process's real, effective, and saved user ids.
certbot.compat.os.getsid(pid, /) Call the system call getsid(pid) and return the result.
certbot.compat.os.getuid() Return the current process's user id.
certbot.compat.os.initgroups(username, gid) -> None Call the system initgroups() to initialize the group access list with all of the groups of which the specified username is a member, plus the specified group id.
certbot.compat.os.isatty(fd, /) Return True if the fd is connected to a terminal.
Return True if the file descriptor is an open file descriptor connected to the slave end of a terminal.
certbot.compat.os.kill(pid, signal, /) Kill a process with a signal.
certbot.compat.os.killpg(pgid, signal, /) Kill a process group with a signal.
certbot.compat.os.lchflags(path, flags) Set file flags.
This function will not follow symbolic links.  Equivalent to chflags(path, flags, follow_symlinks=False).
certbot.compat.os.lchmod(path, mode) Change the access permissions of a file, without following symbolic links.
If path is a symlink, this affects the link itself rather than the target.  Equivalent to chmod(path, mode, follow_symlinks=False)."
certbot.compat.os.lchown(path, uid, gid) Change the owner and group id of path to the numeric uid and gid.
This function will not follow symbolic links.  Equivalent to os.chown(path, uid, gid, follow_symlinks=False).
certbot.compat.os.link(src, dst, *, src_dir_fd=None, dst_dir_fd=None, follow_symlinks=True) Create a hard link to a file.
If either src_dir_fd or dst_dir_fd is not None, it should be a file descriptor open to a directory, and the respective path string (src or dst) should be relative; the path will then be relative to that directory.
If follow_symlinks is False, and the last element of src is a symbolic link, link will create a link to the symbolic link itself instead of the file the link points to.
src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your platform.  If they are unavailable, using them will raise a NotImplementedError.
certbot.compat.os.listdir(path=None) Return a list containing the names of the files in the directory.
path can be specified as either str, bytes, or a path-like object. If path is bytes, the filenames returned will also be bytes; in all other circumstances the filenames returned will be str.
If path is None, uses the path='.'.  On some platforms, path may also be specified as an open file descriptor; the file descriptor must refer to a directory.  If this functionality is unavailable, using it raises NotImplementedError.
The list is in arbitrary order.  It does not include the special entries '.' and '..' even if they are present in the directory.
certbot.compat.os.lockf(fd, command, length, /) Apply, test or remove a POSIX lock on an open file descriptor.
fd     An open file descriptor.
command One of F_LOCK, F_TLOCK, F_ULOCK or F_TEST.
length The number of bytes to lock, starting at the current position.
certbot.compat.os.lseek(fd, position, how, /) Set the position of a file descriptor.  Return the new position.
Return the new cursor position in number of bytes relative to the beginning of the file.
certbot.compat.os.lstat(path, *, dir_fd=None) Perform a stat system call on the given path, without following symbolic links.
Like stat(), but do not follow symbolic links.  Equivalent to stat(path, follow_symlinks=False).
certbot.compat.os.major(device, /) Extracts a device major number from a raw device number.
certbot.compat.os.makedev(major, minor, /) Composes a raw device number from the major and minor device numbers.
certbot.compat.os.minor(device, /) Extracts a device minor number from a raw device number.
certbot.compat.os.mkdir(*unused_args, **unused_kwargs) Method os.mkdir() is forbidden
certbot.compat.os.mkfifo(path, mode=438, *, dir_fd=None) Create a "fifo" (a POSIX named pipe).
If dir_fd is not None, it should be a file descriptor open to a directory, and path should be relative; path will then be relative to that directory.
dir_fd may not be implemented on your platform. If it is unavailable, using it will raise a NotImplementedError.
certbot.compat.os.mknod(path, mode=384, device=0, *, dir_fd=None) Create a node in the file system.
Create a node in the file system (file, device special file or named pipe) at path.  mode specifies both the permissions to use and the type of node to be created, being combined (bitwise OR) with one of S_IFREG, S_IFCHR, S_IFBLK, and S_IFIFO.  If S_IFCHR or S_IFBLK is set on mode, device defines the newly created device special file (probably using os.makedev()).  Otherwise device is ignored.
certbot.compat.os.nice(increment, /) Add increment to the priority of process and return the new priority.
certbot.compat.os.open(*unused_args, **unused_kwargs) Method os.open() is forbidden
certbot.compat.os.openpty() Open a pseudo-terminal.
Return a tuple of (master_fd, slave_fd) containing open file descriptors for both the master and slave ends.
certbot.compat.os.pathconf(path, name) Return the configuration limit name for the file or directory path.
If there is no limit, return -1.  On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception.
certbot.compat.os.pipe() Create a pipe.
Returns a tuple of two file descriptors: (read_fd, write_fd)
certbot.compat.os.pipe2(flags, /) Create a pipe with flags set atomically.
flags can be constructed by ORing together one or more of these values: O_NONBLOCK, O_CLOEXEC.
certbot.compat.os.posix_fadvise(fd, offset, length, advice, /) Announce an intention to access data in a specific pattern.
Announce an intention to access data in a specific pattern, thus allowing the kernel to make optimizations.  The advice applies to the region of the file specified by fd starting at offset and continuing for length bytes.  advice is one of POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL, POSIX_FADV_RANDOM, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED, or POSIX_FADV_DONTNEED.
certbot.compat.os.posix_fallocate(fd, offset, length, /) Ensure a file has allocated at least a particular number of bytes on disk.
Ensure that the file specified by fd encompasses a range of bytes starting at offset bytes from the beginning and continuing for length bytes.
certbot.compat.os.pread(fd, length, offset, /) Read a number of bytes from a file descriptor starting at a particular offset.
Read length bytes from file descriptor fd, starting at offset bytes from the beginning of the file.  The file offset remains unchanged.
certbot.compat.os.preadv(fd, buffers, offset, flags=0, /) Reads from a file descriptor into a number of mutable bytes-like objects.
Combines the functionality of readv() and pread(). As readv(), it will transfer data into each buffer until it is full and then move on to the next buffer in the sequence to hold the rest of the data. Its fourth argument, specifies the file offset at which the input operation is to be performed. It will return the total number of bytes read (which can be less than the total capacity of all the objects).
The flags argument contains a bitwise OR of zero or more of the following flags:
• RWF_HIPRI
• RWF_NOWAIT
Using non-zero flags requires Linux 4.6 or newer.
certbot.compat.os.putenv(name, value, /) Change or add an environment variable.
certbot.compat.os.pwrite(fd, buffer, offset, /) Write bytes to a file descriptor starting at a particular offset.
Write buffer to fd, starting at offset bytes from the beginning of the file.  Returns the number of bytes writte.  Does not change the current file offset.
certbot.compat.os.pwritev(fd, buffers, offset, flags=0, /) Writes the contents of bytes-like objects to a file descriptor at a given offset.
Combines the functionality of writev() and pwrite(). All buffers must be a sequence of bytes-like objects. Buffers are processed in array order. Entire contents of first buffer is written before proceeding to second, and so on. The operating system may set a limit (sysconf() value SC_IOV_MAX) on the number of buffers that can be used.  This function writes the contents of each object to the file descriptor and returns the total number of bytes written.
• RWF_DSYNC
• RWF_SYNC
Using non-zero flags requires Linux 4.7 or newer.
certbot.compat.os.read(fd, length, /) Read from a file descriptor.  Returns a bytes object.
certbot.compat.os.readlink(path, *, dir_fd=None) -> path Return a string representing the path to which the symbolic link points.
certbot.compat.os.readv(fd, buffers, /) Read from a file descriptor fd into an iterable of buffers.
The buffers should be mutable buffers accepting bytes.  readv will transfer data into each buffer until it is full and then move on to the next buffer in the sequence to hold the rest of the data.
readv returns the total number of bytes read, which may be less than the total capacity of all the buffers.
certbot.compat.os.register_at_fork(*, before=None, after_in_child=None, after_in_parent=None) Register callables to be called when forking a new process.
before A callable to be called in the parent before the fork() syscall.
after_in_child A callable to be called in the child after fork().
after_in_parent A callable to be called in the parent after fork().
'before' callbacks are called in reverse order.  'after_in_child' and 'after_in_parent' callbacks are called in order.
certbot.compat.os.remove(path, *, dir_fd=None) Remove a file (same as unlink()).
certbot.compat.os.rename(*unused_args, **unused_kwargs) Method os.rename() is forbidden
certbot.compat.os.replace(*unused_args, **unused_kwargs) Method os.replace() is forbidden
certbot.compat.os.rmdir(path, *, dir_fd=None) Remove a directory.
certbot.compat.os.scandir(path=None) Return an iterator of DirEntry objects for given path.
path can be specified as either str, bytes, or a path-like object. If path is bytes, the names of yielded DirEntry objects will also be bytes; in all other circumstances they will be str.
If path is None, uses the path='.'.
certbot.compat.os.sched_get_priority_max(policy) Get the maximum scheduling priority for policy.
certbot.compat.os.sched_get_priority_min(policy) Get the minimum scheduling priority for policy.
certbot.compat.os.sched_getparam(pid, /) Returns scheduling parameters for the process identified by pid.
If pid is 0, returns parameters for the calling process.  Return value is an instance of sched_param.
certbot.compat.os.sched_getscheduler(pid, /) Get the scheduling policy for the process identifiedy by pid.
Passing 0 for pid returns the scheduling policy for the calling process.
class certbot.compat.os.sched_param(sched_priority) Bases: tuple
Current has only one field: sched_priority");
sched_priority A scheduling parameter.
n_fields = 1
n_sequence_fields = 1
n_unnamed_fields = 0
sched_priority the scheduling priority
certbot.compat.os.sched_rr_get_interval(pid, /) Return the round-robin quantum for the process identified by pid, in seconds.
Value returned is a float.
certbot.compat.os.sched_setparam(pid, param, /) Set scheduling parameters for the process identified by pid.
If pid is 0, sets parameters for the calling process.  param should be an instance of sched_param.
certbot.compat.os.sched_setscheduler(pid, policy, param, /) Set the scheduling policy for the process identified by pid.
If pid is 0, the calling process is changed.  param is an instance of sched_param.
certbot.compat.os.sched_yield() Voluntarily relinquish the CPU.
certbot.compat.os.sendfile(out, in, offset, count) -> byteswritten
sendfile(out, in, offset, count[, headers][, trailers], flags=0) -> byteswritten
Copy count bytes from file descriptor in to file descriptor out.
certbot.compat.os.set_blocking(fd, blocking) Set the blocking mode of the specified file descriptor.  Set the O_NONBLOCK flag if blocking is False, clear the O_NONBLOCK flag otherwise.
certbot.compat.os.set_inheritable(fd, inheritable, /) Set the inheritable flag of the specified file descriptor.
certbot.compat.os.setegid(egid, /) Set the current process's effective group id.
certbot.compat.os.seteuid(euid, /) Set the current process's effective user id.
certbot.compat.os.setgid(gid, /) Set the current process's group id.
certbot.compat.os.setgroups(groups, /) Set the groups of the current process to list.
certbot.compat.os.setpgid(pid, pgrp, /) Call the system call setpgid(pid, pgrp).
certbot.compat.os.setpgrp() Make the current process the leader of its process group.
certbot.compat.os.setpriority(which, who, priority) Set program scheduling priority.
certbot.compat.os.setregid(rgid, egid, /) Set the current process's real and effective group ids.
certbot.compat.os.setresgid(rgid, egid, sgid, /) Set the current process's real, effective, and saved group ids.
certbot.compat.os.setresuid(ruid, euid, suid, /) Set the current process's real, effective, and saved user ids.
certbot.compat.os.setreuid(ruid, euid, /) Set the current process's real and effective user ids.
certbot.compat.os.setsid() Call the system call setsid().
certbot.compat.os.setuid(uid, /) Set the current process's user id.
certbot.compat.os.stat(*unused_args, **unused_kwargs) Method os.stat() is forbidden
class certbot.compat.os.stat_result(iterable=(), /) Bases: tuple
stat_result: Result from stat, fstat, or lstat.
This object may be accessed either as a tuple of (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.
Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev, or st_flags, they are available as attributes only.
See os.stat for more information.
n_fields = 22
n_sequence_fields = 10
n_unnamed_fields = 3
st_atime time of last access
st_atime_ns time of last access in nanoseconds
st_birthtime time of creation
st_blksize blocksize for filesystem I/O
st_blocks number of blocks allocated
st_ctime time of last change
st_ctime_ns time of last change in nanoseconds
st_dev device
st_flags user defined flags for file
st_gen generation number
st_gid group ID of owner
st_ino inode
st_mode protection bits
st_mtime time of last modification
st_mtime_ns time of last modification in nanoseconds
st_nlink number of hard links
st_rdev device type (if inode device)
st_size total size, in bytes
st_uid user ID of owner
certbot.compat.os.statvfs(path) Perform a statvfs system call on the given path.
class certbot.compat.os.statvfs_result(iterable=(), /) Bases: tuple
statvfs_result: Result from statvfs or fstatvfs.
This object may be accessed either as a tuple of (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax),
or via the attributes f_bsize, f_frsize, f_blocks, f_bfree, and so on.
See os.statvfs for more information.
f_bavail
f_bfree
f_blocks
f_bsize
f_favail
f_ffree
f_files
f_flag
f_frsize
f_fsid
f_namemax
n_fields = 11
certbot.compat.os.strerror(code, /) Translate an error code to a message string.
certbot.compat.os.symlink(src, dst, target_is_directory=False, *, dir_fd=None) Create a symbolic link pointing to src named dst.
target_is_directory is required on Windows if the target is to be interpreted as a directory.  (On Windows, symlink requires Windows 6.0 or greater, and raises a NotImplementedError otherwise.)  target_is_directory is ignored on non-Windows platforms.
certbot.compat.os.sync() Force write of everything to disk.
certbot.compat.os.sysconf(name, /) Return an integer-valued system configuration variable.
certbot.compat.os.system(command) Execute the command in a subshell.
certbot.compat.os.tcgetpgrp(fd, /) Return the process group associated with the terminal specified by fd.
certbot.compat.os.tcsetpgrp(fd, pgid, /) Set the process group associated with the terminal specified by fd.
class certbot.compat.os.terminal_size(iterable=(), /) Bases: tuple
A tuple of (columns, lines) for holding terminal window size
columns width of the terminal window in characters
lines  height of the terminal window in characters
n_fields = 2
n_sequence_fields = 2
certbot.compat.os.times() Return a collection containing process timing information.
The object returned behaves like a named tuple with these fields: (utime, stime, cutime, cstime, elapsed_time)
All fields are floating point numbers.
class certbot.compat.os.times_result(iterable=(), /) Bases: tuple
times_result: Result from os.times().
This object may be accessed either as a tuple of (user, system, children_user, children_system, elapsed),
or via the attributes user, system, children_user, children_system, and elapsed.
See os.times for more information.
children_system system time of children
children_user user time of children
elapsed elapsed time since an arbitrary point in the past
n_fields = 5
n_sequence_fields = 5
system system time
user   user time
certbot.compat.os.truncate(path, length) Truncate a file, specified by path, to a specific length.
On some platforms, path may also be specified as an open file descriptor. If this functionality is unavailable, using it raises an exception.
certbot.compat.os.ttyname(fd, /) Return the name of the terminal device connected to 'fd'.
fd     Integer file descriptor handle.
certbot.compat.os.umask(*unused_args, **unused_kwargs) Method os.chmod() is forbidden
certbot.compat.os.uname() Return an object identifying the current operating system.
The object behaves like a named tuple with the following fields: (sysname, nodename, release, version, machine)
class certbot.compat.os.uname_result(iterable=(), /) Bases: tuple
uname_result: Result from os.uname().
This object may be accessed either as a tuple of (sysname, nodename, release, version, machine),
or via the attributes sysname, nodename, release, version, and machine.
See os.uname for more information.
machine hardware identifier
nodename name of machine on network (implementation-defined)
release operating system release
sysname operating system name
version operating system version
certbot.compat.os.unlink(path, *, dir_fd=None) Remove a file (same as remove()).
certbot.compat.os.unsetenv(name, /) Delete an environment variable.
certbot.compat.os.urandom(size, /) Return a bytes object containing random bytes suitable for cryptographic use.
certbot.compat.os.utime(path, times=None, *, ns=None, dir_fd=None, follow_symlinks=True) Set the access and modified time of path.
If times is not None, it must be a tuple (atime, mtime); atime and mtime should be expressed as float seconds since the epoch.
If ns is specified, it must be a tuple (atime_ns, mtime_ns); atime_ns and mtime_ns should be expressed as integer nanoseconds since the epoch.
If times is None and ns is unspecified, utime uses the current time.  Specifying tuples for both times and ns is an error.
If follow_symlinks is False, and the last element of the path is a symbolic link, utime will modify the symbolic link itself instead of the file the link points to.
It is an error to use dir_fd or follow_symlinks when specifying path as an open file descriptor.
dir_fd and follow_symlinks may not be available on your platform. If they are unavailable, using them will raise a NotImplementedError.
certbot.compat.os.wait() Wait for completion of a child process.
Returns a tuple of information about the child process: (pid, status)
certbot.compat.os.wait3(options) Wait for completion of a child process.
Returns a tuple of information about the child process: (pid, status, rusage)
certbot.compat.os.wait4(pid, options) Wait for completion of a specific child process.
certbot.compat.os.waitid(idtype, id, options, /) Returns the result of waiting for a process or processes.
idtype Must be one of be P_PID, P_PGID or P_ALL.
id     The id to wait on.
options Constructed from the ORing of one or more of WEXITED, WSTOPPED or WCONTINUED and additionally may be ORed with WNOHANG or WNOWAIT.
Returns either waitid_result or None if WNOHANG is specified and there are no children in a waitable state.
class certbot.compat.os.waitid_result(iterable=(), /) Bases: tuple
waitid_result: Result from waitid.
This object may be accessed either as a tuple of (si_pid, si_uid, si_signo, si_status, si_code),
or via the attributes si_pid, si_uid, and so on.
See os.waitid for more information.
si_code
si_pid
si_signo
si_status
si_uid