diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-05-26 12:19:42 -0700 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-05-26 12:19:42 -0700 |
commit | f60d1c6c6e9cabfd95c0fe3b9450c87d545ac5b3 (patch) | |
tree | 03244574fb82a5ef79b7c58caba46a51328ad51d /Lib/_pyio.py | |
parent | 177fe35798123c29eefe2da1b8dfc2263c5c86e8 (diff) | |
parent | 25ed18d3555c2ecdab81f04da042cb1ba5ce8fa9 (diff) | |
download | cpython-f60d1c6c6e9cabfd95c0fe3b9450c87d545ac5b3.tar.gz |
Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 313fadfcbe..404e0273ec 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -182,8 +182,8 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None, text = "t" in modes binary = "b" in modes if "U" in modes: - if creating or writing or appending: - raise ValueError("can't use U and writing mode at once") + if creating or writing or appending or updating: + raise ValueError("mode U cannot be combined with 'x', 'w', 'a', or '+'") import warnings warnings.warn("'U' mode is deprecated", DeprecationWarning, 2) @@ -1514,7 +1514,7 @@ class FileIO(RawIOBase): if self._fd >= 0 and self._closefd and not self.closed: import warnings warnings.warn('unclosed file %r' % (self,), ResourceWarning, - stacklevel=2) + stacklevel=2, source=self) self.close() def __getstate__(self): |