From b37f12f17a7c5bd376ae895451ee683fbdb5ceeb Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 8 Sep 2019 19:04:47 +0200 Subject: [PATCH 1/6] Update supported Python versions, fix #43 --- .travis.yml | 1 + setup.py | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6dfaa57..688e362 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ python: - 3.4 - 3.5 - 3.6 + - 3.7 env: - TOXENV=test diff --git a/setup.py b/setup.py index e0eaca0..adbf232 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', ], python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', From 866a27e9054a153d560ad0706da5ab0f0b19d8a2 Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Fri, 6 Mar 2020 10:59:20 +0100 Subject: [PATCH 2/6] Do not use deprecated template variable in tempfile module Use gettempprefix() instead, as suggested by the documentation. --- atomicwrites/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomicwrites/__init__.py b/atomicwrites/__init__.py index cfa5c29..b342db6 100644 --- a/atomicwrites/__init__.py +++ b/atomicwrites/__init__.py @@ -165,7 +165,7 @@ def _open(self, get_fileobject): except Exception: pass - def get_fileobject(self, suffix="", prefix=tempfile.template, dir=None, + def get_fileobject(self, suffix="", prefix=tempfile.gettempprefix(), dir=None, **kwargs): '''Return the temporary file to use.''' if dir is None: From 7930174f1a46961045b5bb0beba6b009f30c9dd9 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 15 Mar 2020 18:05:43 +0100 Subject: [PATCH 3/6] fix: Styling --- atomicwrites/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomicwrites/__init__.py b/atomicwrites/__init__.py index b342db6..1859e83 100644 --- a/atomicwrites/__init__.py +++ b/atomicwrites/__init__.py @@ -165,8 +165,8 @@ def _open(self, get_fileobject): except Exception: pass - def get_fileobject(self, suffix="", prefix=tempfile.gettempprefix(), dir=None, - **kwargs): + def get_fileobject(self, suffix="", prefix=tempfile.gettempprefix(), + dir=None, **kwargs): '''Return the temporary file to use.''' if dir is None: dir = os.path.normpath(os.path.dirname(self._path)) From 55eed75c5d1337380314d03098703289e511af29 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 15 Mar 2020 18:19:38 +0100 Subject: [PATCH 4/6] remove broken osx build i know from experience with another package that this is not worth my time --- .travis.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 688e362..715ac80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,17 +15,6 @@ env: matrix: include: - - # The OS X VM doesn't have any Python support at all - # See https://github.com/travis-ci/travis-ci/issues/2312 - os: osx - language: generic - env: TOXENV=test - before_install: - - brew update - - brew upgrade python - - python3 -m pip install --user virtualenv - - /Users/travis/Library/Python/3.7/bin/virtualenv $HOME/osx-py - - source $HOME/osx-py/bin/activate - python: 2.7 env: TOXENV=stylecheck - python: 3.6 From 2a91f2ef3e85b6a6c4dca3209a02eaba9b003059 Mon Sep 17 00:00:00 2001 From: Lovecraftian Horror Date: Tue, 28 Apr 2020 09:55:25 -0400 Subject: [PATCH 5/6] Use fspath to ensure path is str or bytes --- atomicwrites/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atomicwrites/__init__.py b/atomicwrites/__init__.py index 1859e83..5592ec4 100644 --- a/atomicwrites/__init__.py +++ b/atomicwrites/__init__.py @@ -9,6 +9,12 @@ except ImportError: fcntl = None +# `fspath` was added in Python 3.6 +try: + from os import fspath +except ImportError: + fspath = None + __version__ = '1.3.0' @@ -137,6 +143,10 @@ def __init__(self, path, mode=DEFAULT_MODE, overwrite=False, if 'w' not in mode: raise ValueError('AtomicWriters can only be written to.') + # Attempt to convert `path` to `str` or `bytes` + if fspath is not None: + path = fspath(path) + self._path = path self._mode = mode self._overwrite = overwrite From e4659baef70d0e24ec6fd981510268d59e66deaf Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Tue, 28 Apr 2020 23:39:47 +0200 Subject: [PATCH 6/6] Version 1.4.0 --- atomicwrites/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atomicwrites/__init__.py b/atomicwrites/__init__.py index 5592ec4..623826e 100644 --- a/atomicwrites/__init__.py +++ b/atomicwrites/__init__.py @@ -15,7 +15,7 @@ except ImportError: fspath = None -__version__ = '1.3.0' +__version__ = '1.4.0' PY2 = sys.version_info[0] == 2