Hello community,
here is the log from the commit of package python-atomicwrites for
openSUSE:Factory checked in at 2019-03-04 09:10:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-atomicwrites (Old)
and /work/SRC/openSUSE:Factory/.python-atomicwrites.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-atomicwrites"
Mon Mar 4 09:10:47 2019 rev:5 rq:680436 version:1.3.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-atomicwrites/python-atomicwrites-doc.changes
2018-07-21 10:09:02.527186929 +0200
+++
/work/SRC/openSUSE:Factory/.python-atomicwrites.new.28833/python-atomicwrites-doc.changes
2019-03-04 09:10:48.920703501 +0100
@@ -1,0 +2,8 @@
+Fri Mar 1 09:59:54 UTC 2019 - Ondřej Súkup <[email protected]>
+
+- update to 1.3.0
+ * Restore ability to use tempfile kwargs other than dir
+ * Avoid API breakage under Python 2
+ * Passes kwargs through AtomicWriter to tempfile.NamedTemporaryFile
+
+-------------------------------------------------------------------
python-atomicwrites.changes: same change
Old:
----
atomicwrites-1.1.5.tar.gz
New:
----
atomicwrites-1.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-atomicwrites-doc.spec ++++++
--- /var/tmp/diff_new_pack.oKIzIi/_old 2019-03-04 09:10:49.800703354 +0100
+++ /var/tmp/diff_new_pack.oKIzIi/_new 2019-03-04 09:10:49.800703354 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-atomicwrites-doc
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-atomicwrites-doc
-Version: 1.1.5
+Version: 1.3.0
Release: 0
Summary: Documentation for the Python atomic write support
License: MIT
python-atomicwrites.spec: same change
++++++ atomicwrites-1.1.5.tar.gz -> atomicwrites-1.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/MANIFEST.in
new/atomicwrites-1.3.0/MANIFEST.in
--- old/atomicwrites-1.1.5/MANIFEST.in 2015-01-29 11:58:30.000000000 +0100
+++ new/atomicwrites-1.3.0/MANIFEST.in 2018-08-30 21:25:49.000000000 +0200
@@ -3,4 +3,6 @@
recursive-include docs *
recursive-include tests *
+
prune docs/_build
+global-exclude *.py[cdo] __pycache__ *.so *.pyd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/PKG-INFO
new/atomicwrites-1.3.0/PKG-INFO
--- old/atomicwrites-1.1.5/PKG-INFO 2016-08-14 14:56:27.000000000 +0200
+++ new/atomicwrites-1.3.0/PKG-INFO 2019-02-01 11:38:11.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.2
Name: atomicwrites
-Version: 1.1.5
+Version: 1.3.0
Summary: Atomic file writes.
Home-page: https://github.com/untitaker/python-atomicwrites
Author: Markus Unterwaditzer
@@ -35,7 +35,28 @@
controlled with the ``overwrite`` parameter.
- Windows support, although not well-tested. The MSDN resources are
not very
- explicit about which operations are atomic.
+ explicit about which operations are atomic. I'm basing my
assumptions off `a
+ comment
+
<https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/449bb49d-8acc-48dc-a46f-0760ceddbfc3/movefileexmovefilereplaceexisting-ntfs-same-volume-atomic?forum=windowssdk#a239bc26-eaf0-4920-9f21-440bd2be9cc8>`_
+ by `Doug Crook
+ <https://social.msdn.microsoft.com/Profile/doug%20e.%20cook>`_, who
appears
+ to be a Microsoft employee:
+
+ FAQ: Is MoveFileEx atomic
+ Frequently asked question: Is MoveFileEx atomic if the existing
and new
+ files are both on the same drive?
+
+ The simple answer is "usually, but in some cases it will
silently fall-back
+ to a non-atomic method, so don't count on it".
+
+ The implementation of MoveFileEx looks something like this: [...]
+
+ The problem is if the rename fails, you might end up with a
CopyFile, which
+ is definitely not atomic.
+
+ If you really need atomic-or-nothing, you can try calling
+ NtSetInformationFile, which is unsupported but is much more
likely to be
+ atomic.
- Simple high-level API that wraps a very flexible class-based API.
@@ -110,3 +131,12 @@
Licensed under the MIT, see ``LICENSE``.
Platform: UNKNOWN
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/README.rst
new/atomicwrites-1.3.0/README.rst
--- old/atomicwrites-1.1.5/README.rst 2016-07-27 00:23:00.000000000 +0200
+++ new/atomicwrites-1.3.0/README.rst 2018-08-24 20:00:55.000000000 +0200
@@ -27,7 +27,28 @@
controlled with the ``overwrite`` parameter.
- Windows support, although not well-tested. The MSDN resources are not very
- explicit about which operations are atomic.
+ explicit about which operations are atomic. I'm basing my assumptions off `a
+ comment
+
<https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/449bb49d-8acc-48dc-a46f-0760ceddbfc3/movefileexmovefilereplaceexisting-ntfs-same-volume-atomic?forum=windowssdk#a239bc26-eaf0-4920-9f21-440bd2be9cc8>`_
+ by `Doug Crook
+ <https://social.msdn.microsoft.com/Profile/doug%20e.%20cook>`_, who appears
+ to be a Microsoft employee:
+
+ FAQ: Is MoveFileEx atomic
+ Frequently asked question: Is MoveFileEx atomic if the existing and new
+ files are both on the same drive?
+
+ The simple answer is "usually, but in some cases it will silently
fall-back
+ to a non-atomic method, so don't count on it".
+
+ The implementation of MoveFileEx looks something like this: [...]
+
+ The problem is if the rename fails, you might end up with a CopyFile,
which
+ is definitely not atomic.
+
+ If you really need atomic-or-nothing, you can try calling
+ NtSetInformationFile, which is unsupported but is much more likely to be
+ atomic.
- Simple high-level API that wraps a very flexible class-based API.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/atomicwrites/__init__.py
new/atomicwrites-1.3.0/atomicwrites/__init__.py
--- old/atomicwrites-1.1.5/atomicwrites/__init__.py 2016-08-14
14:52:17.000000000 +0200
+++ new/atomicwrites-1.3.0/atomicwrites/__init__.py 2019-02-01
11:37:52.000000000 +0100
@@ -1,4 +1,5 @@
import contextlib
+import io
import os
import sys
import tempfile
@@ -8,7 +9,7 @@
except ImportError:
fcntl = None
-__version__ = '1.1.5'
+__version__ = '1.3.0'
PY2 = sys.version_info[0] == 2
@@ -22,6 +23,9 @@
return x
+DEFAULT_MODE = "wb" if PY2 else "w"
+
+
_proper_fsync = os.fsync
@@ -109,7 +113,8 @@
f.write(...)
:param path: The destination filepath. May or may not exist.
- :param mode: The filemode for the temporary file.
+ :param mode: The filemode for the temporary file. This defaults to `wb` in
+ Python 2 and `w` in Python 3.
:param overwrite: If set to false, an error is raised if ``path`` exists.
Errors are only raised after the file has been written to. Either way,
the operation is atomic.
@@ -118,7 +123,8 @@
subclass.
'''
- def __init__(self, path, mode='w', overwrite=False):
+ def __init__(self, path, mode=DEFAULT_MODE, overwrite=False,
+ **open_kwargs):
if 'a' in mode:
raise ValueError(
'Appending to an existing file is not supported, because that '
@@ -134,6 +140,7 @@
self._path = path
self._mode = mode
self._overwrite = overwrite
+ self._open_kwargs = open_kwargs
def open(self):
'''
@@ -146,7 +153,7 @@
f = None # make sure f exists even if get_fileobject() fails
try:
success = False
- with get_fileobject() as f:
+ with get_fileobject(**self._open_kwargs) as f:
yield f
self.sync(f)
self.commit(f)
@@ -158,12 +165,20 @@
except Exception:
pass
- def get_fileobject(self, dir=None, **kwargs):
+ def get_fileobject(self, suffix="", prefix=tempfile.template, dir=None,
+ **kwargs):
'''Return the temporary file to use.'''
if dir is None:
dir = os.path.normpath(os.path.dirname(self._path))
- return tempfile.NamedTemporaryFile(mode=self._mode, dir=dir,
- delete=False, **kwargs)
+ descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
+ dir=dir)
+ # io.open() will take either the descriptor or the name, but we need
+ # the name later for commit()/replace_atomic() and couldn't find a way
+ # to get the filename from the descriptor.
+ os.close(descriptor)
+ kwargs['mode'] = self._mode
+ kwargs['file'] = name
+ return io.open(**kwargs)
def sync(self, f):
'''responsible for clearing as many file caches as possible before
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/atomicwrites.egg-info/PKG-INFO
new/atomicwrites-1.3.0/atomicwrites.egg-info/PKG-INFO
--- old/atomicwrites-1.1.5/atomicwrites.egg-info/PKG-INFO 2016-08-14
14:56:26.000000000 +0200
+++ new/atomicwrites-1.3.0/atomicwrites.egg-info/PKG-INFO 2019-02-01
11:38:11.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.2
Name: atomicwrites
-Version: 1.1.5
+Version: 1.3.0
Summary: Atomic file writes.
Home-page: https://github.com/untitaker/python-atomicwrites
Author: Markus Unterwaditzer
@@ -35,7 +35,28 @@
controlled with the ``overwrite`` parameter.
- Windows support, although not well-tested. The MSDN resources are
not very
- explicit about which operations are atomic.
+ explicit about which operations are atomic. I'm basing my
assumptions off `a
+ comment
+
<https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/449bb49d-8acc-48dc-a46f-0760ceddbfc3/movefileexmovefilereplaceexisting-ntfs-same-volume-atomic?forum=windowssdk#a239bc26-eaf0-4920-9f21-440bd2be9cc8>`_
+ by `Doug Crook
+ <https://social.msdn.microsoft.com/Profile/doug%20e.%20cook>`_, who
appears
+ to be a Microsoft employee:
+
+ FAQ: Is MoveFileEx atomic
+ Frequently asked question: Is MoveFileEx atomic if the existing
and new
+ files are both on the same drive?
+
+ The simple answer is "usually, but in some cases it will
silently fall-back
+ to a non-atomic method, so don't count on it".
+
+ The implementation of MoveFileEx looks something like this: [...]
+
+ The problem is if the rename fails, you might end up with a
CopyFile, which
+ is definitely not atomic.
+
+ If you really need atomic-or-nothing, you can try calling
+ NtSetInformationFile, which is unsupported but is much more
likely to be
+ atomic.
- Simple high-level API that wraps a very flexible class-based API.
@@ -110,3 +131,12 @@
Licensed under the MIT, see ``LICENSE``.
Platform: UNKNOWN
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/atomicwrites.egg-info/SOURCES.txt
new/atomicwrites-1.3.0/atomicwrites.egg-info/SOURCES.txt
--- old/atomicwrites-1.1.5/atomicwrites.egg-info/SOURCES.txt 2016-08-14
14:56:27.000000000 +0200
+++ new/atomicwrites-1.3.0/atomicwrites.egg-info/SOURCES.txt 2019-02-01
11:38:11.000000000 +0100
@@ -12,8 +12,4 @@
docs/conf.py
docs/index.rst
docs/make.bat
-docs/__pycache__/conf.cpython-34.pyc
-tests/test_atomicwrites.py
-tests/__pycache__/test_atomicwrites.cpython-26-PYTEST.pyc
-tests/__pycache__/test_atomicwrites.cpython-27-PYTEST.pyc
-tests/__pycache__/test_atomicwrites.cpython-34-PYTEST.pyc
\ No newline at end of file
+tests/test_atomicwrites.py
\ No newline at end of file
Binary files old/atomicwrites-1.1.5/docs/__pycache__/conf.cpython-34.pyc and
new/atomicwrites-1.3.0/docs/__pycache__/conf.cpython-34.pyc differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/docs/conf.py
new/atomicwrites-1.3.0/docs/conf.py
--- old/atomicwrites-1.1.5/docs/conf.py 2016-07-26 21:45:03.000000000 +0200
+++ new/atomicwrites-1.3.0/docs/conf.py 2018-08-24 20:00:55.000000000 +0200
@@ -2,6 +2,7 @@
import os
import sys
+
import pkg_resources
extensions = [
@@ -21,7 +22,7 @@
# General information about the project.
project = 'atomicwrites'
-copyright = '2015, Markus Unterwaditzer'
+copyright = '2015-2017, Markus Unterwaditzer'
try:
# The full version, including alpha/beta/rc tags.
@@ -59,7 +60,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+# html_static_path = ['_static']
# Output file base name for HTML help builder.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/setup.cfg
new/atomicwrites-1.3.0/setup.cfg
--- old/atomicwrites-1.1.5/setup.cfg 2016-08-14 14:56:27.000000000 +0200
+++ new/atomicwrites-1.3.0/setup.cfg 2019-02-01 11:38:11.000000000 +0100
@@ -2,7 +2,6 @@
universal = 1
[egg_info]
-tag_date = 0
-tag_svn_revision = 0
tag_build =
+tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/setup.py
new/atomicwrites-1.3.0/setup.py
--- old/atomicwrites-1.1.5/setup.py 2016-07-26 20:35:47.000000000 +0200
+++ new/atomicwrites-1.3.0/setup.py 2018-08-24 20:00:55.000000000 +0200
@@ -24,4 +24,15 @@
long_description=open('README.rst').read(),
packages=find_packages(exclude=['tests.*', 'tests']),
include_package_data=True,
+ classifiers=[
+ 'License :: OSI Approved :: MIT License',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ ],
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
)
Binary files
old/atomicwrites-1.1.5/tests/__pycache__/test_atomicwrites.cpython-26-PYTEST.pyc
and
new/atomicwrites-1.3.0/tests/__pycache__/test_atomicwrites.cpython-26-PYTEST.pyc
differ
Binary files
old/atomicwrites-1.1.5/tests/__pycache__/test_atomicwrites.cpython-27-PYTEST.pyc
and
new/atomicwrites-1.3.0/tests/__pycache__/test_atomicwrites.cpython-27-PYTEST.pyc
differ
Binary files
old/atomicwrites-1.1.5/tests/__pycache__/test_atomicwrites.cpython-34-PYTEST.pyc
and
new/atomicwrites-1.3.0/tests/__pycache__/test_atomicwrites.cpython-34-PYTEST.pyc
differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/atomicwrites-1.1.5/tests/test_atomicwrites.py
new/atomicwrites-1.3.0/tests/test_atomicwrites.py
--- old/atomicwrites-1.1.5/tests/test_atomicwrites.py 2016-08-14
14:28:10.000000000 +0200
+++ new/atomicwrites-1.3.0/tests/test_atomicwrites.py 2018-08-24
20:12:43.000000000 +0200
@@ -59,11 +59,13 @@
def test_open_reraise(tmpdir):
fname = tmpdir.join('ha')
with pytest.raises(AssertionError):
- with atomic_write(str(fname), overwrite=False) as f:
- # Mess with f, so rollback will trigger an OSError. We're testing
- # that the initial AssertionError triggered below is propagated up
- # the stack, not the second exception triggered during rollback.
- f.name = "asdf"
+ aw = atomic_write(str(fname), overwrite=False)
+ with aw:
+ # Mess with internals, so commit will trigger a ValueError. We're
+ # testing that the initial AssertionError triggered below is
+ # propagated up the stack, not the second exception triggered
+ # during commit.
+ aw.rollback = lambda: 1 / 0
# Now trigger our own exception.
assert False, "Intentional failure for testing purposes"