summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2016-02-28 10:59:24 -0800
committerBob Ippolito <bob@redivi.com>2016-02-28 10:59:24 -0800
commit70dbe7f3642f4fabec2ddfd51c76fc80f707c4fe (patch)
tree56f17f4f60e84140b0b9b4c421d15ff673bf1ada
parent66fa35f3609e4db59690319a945ff471a664da99 (diff)
downloadxattr-70dbe7f3642f4fabec2ddfd51c76fc80f707c4fe.tar.gz
v0.8.0
-rw-r--r--CHANGES.txt6
-rw-r--r--setup.py2
-rw-r--r--xattr/__init__.py2
-rw-r--r--xattr/tests/test_xattr.py23
4 files changed, 24 insertions, 9 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index a9686df..742f2ef 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,9 @@
+Version 0.8.0 released 2016-02-28
+
+* Use os.fsencode where available to better handle filesystem quirks related
+ to surrogates
+ https://github.com/xattr/xattr/pull/46
+
Version 0.7.9 released 2016-02-12
* Added xattr/tests/*.py to MANIFEST.in
diff --git a/setup.py b/setup.py
index 00d9706..202486b 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ class cffi_build(build):
self.distribution.ext_modules = [ffi.verifier.get_extension()]
build.finalize_options(self)
-VERSION = '0.7.9'
+VERSION = '0.8.0'
DESCRIPTION = "Python wrapper for extended filesystem attributes"
LONG_DESCRIPTION = """
Extended attributes extend the basic attributes of files and directories
diff --git a/xattr/__init__.py b/xattr/__init__.py
index c5e8433..dad8e5a 100644
--- a/xattr/__init__.py
+++ b/xattr/__init__.py
@@ -7,7 +7,7 @@ The xattr type wraps a path or file descriptor with a dict-like interface
that exposes these extended attributes.
"""
-__version__ = '0.7.9'
+__version__ = '0.8.0'
from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME,
diff --git a/xattr/tests/test_xattr.py b/xattr/tests/test_xattr.py
index 1e33fa0..548f735 100644
--- a/xattr/tests/test_xattr.py
+++ b/xattr/tests/test_xattr.py
@@ -1,6 +1,7 @@
import os
import sys
-from unittest import TestCase, SkipTest
+import unittest
+from unittest import TestCase
from tempfile import mkdtemp, NamedTemporaryFile
import xattr
@@ -88,12 +89,6 @@ class TestFile(TestCase, BaseTestXattr):
def tearDown(self):
self.tempfile.close()
-class TestFileWithSurrogates(TestFile):
- def setUp(self):
- if sys.platform != 'linux':
- raise SkipTest('Files with invalid encoded names are only supported under linux')
- self.tempfile = NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape'))
- self.tempfilename = self.tempfile.name
class TestDir(TestCase, BaseTestXattr):
def setUp(self):
@@ -102,3 +97,17 @@ class TestDir(TestCase, BaseTestXattr):
def tearDown(self):
os.rmdir(self.tempfile)
+
+
+try:
+ # SkipTest is only available in Python 2.7+
+ unittest.SkipTest
+except AttributeError:
+ pass
+else:
+ class TestFileWithSurrogates(TestFile):
+ def setUp(self):
+ if sys.platform != 'linux':
+ raise unittest.SkipTest('Files with invalid encoded names are only supported under linux')
+ self.tempfile = NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape'))
+ self.tempfilename = self.tempfile.name