5 months agoRemove compatibility with old recommonmark versions master
Iustin Pop [Sun, 29 Nov 2020 19:50:06 +0000 (20:50 +0100)]
Remove compatibility with old recommonmark versions

It's hard trying to keep compatibility with both very old (<1.8),
old (1.8) and modern (Sphinx), while also supporting old recommonmark;
recommonmark 0.5 was released in January 2019.

So let's drop the old support and just keep support for Sphinx 1.8 and
3.0+, and more modern recommonmark.

5 months agoRelease version 0.7.2 v0.7.2
Iustin Pop [Sun, 29 Nov 2020 19:19:04 +0000 (20:19 +0100)]
Release version 0.7.2

5 months agoAdd recommonmark to sphinx extensions
Iustin Pop [Sun, 29 Nov 2020 19:38:33 +0000 (20:38 +0100)]
Add recommonmark to sphinx extensions

With Sphinx 3.0+, the old way of enabling markdown is completely
broken, so without this the documentation is not really working…

5 months agoRun Python 3.9 tests too
Iustin Pop [Sun, 29 Nov 2020 12:09:14 +0000 (13:09 +0100)]
Run Python 3.9 tests too

Both locally and on travis.

5 months ago[Fixed] typo in
Anubhav Choudhary [Fri, 9 Oct 2020 04:55:00 +0000 (10:25 +0530)]
[Fixed] typo in

`sudo install python3-pyxattr` changed to `sudo apt install python3-pyxattr`

17 months agoFix travis config after tests rename
Iustin Pop [Tue, 26 Nov 2019 21:28:48 +0000 (22:28 +0100)]
Fix travis config after tests rename

17 months agoRename test/ → tests/
Iustin Pop [Tue, 26 Nov 2019 21:17:09 +0000 (22:17 +0100)]
Rename test/ → tests/

More consistency between my packages

17 months agoAdd unreleased changelog
Iustin Pop [Tue, 26 Nov 2019 21:14:55 +0000 (22:14 +0100)]
Add unreleased changelog

17 months agoRework and expand the mixed access test
Iustin Pop [Tue, 26 Nov 2019 21:13:24 +0000 (22:13 +0100)]
Rework and expand the mixed access test

This is more of a kernel xattr test, not the library, but good
enough to guarantee mixed access from Python.

17 months add one more classifier topic
Iustin Pop [Tue, 26 Nov 2019 20:49:51 +0000 (21:49 +0100)] add one more classifier topic

17 months agoTests: ensure resources as closed in subject tests
Iustin Pop [Tue, 26 Nov 2019 20:48:28 +0000 (21:48 +0100)]
Tests: ensure resources as closed in subject tests

A bit of boilerplate, but gets rid of the leaking FD problem.

17 months agoBump version for 0.7.1 release… v0.7.1
Iustin Pop [Tue, 26 Nov 2019 03:37:33 +0000 (04:37 +0100)]
Bump version for 0.7.1 release…

17 months agoOops, fix bug tracker link
Iustin Pop [Tue, 26 Nov 2019 03:35:22 +0000 (04:35 +0100)]
Oops, fix bug tracker link

17 months agoBump version numbers for new release v0.7.0
Iustin Pop [Tue, 26 Nov 2019 03:29:12 +0000 (04:29 +0100)]
Bump version numbers for new release

No sense in waiting more, this is good conversion to Python 3 +
feature request + a bug fix.

17 months agoSwitch coverage badge to codecov
Iustin Pop [Tue, 26 Nov 2019 03:26:23 +0000 (04:26 +0100)]
Switch coverage badge to codecov

Still issues with merging reports in coveralls.

17 months agoCheck return value from PyList_Append
Iustin Pop [Tue, 26 Nov 2019 03:18:35 +0000 (04:18 +0100)]
Check return value from PyList_Append

This fixes the correctness aspect of #17, although not the entire

17 months agoExpand configuration
Iustin Pop [Tue, 26 Nov 2019 03:05:42 +0000 (04:05 +0100)]
Expand configuration

The current pypi project page is somewhat bare… and can't
extract metadata from it.

17 months agoRun tests on file io streams as well
Iustin Pop [Tue, 26 Nov 2019 03:05:26 +0000 (04:05 +0100)]
Run tests on file io streams as well

17 months agoAdd support for Path-like objects in Python 3.6+
Iustin Pop [Tue, 26 Nov 2019 02:36:40 +0000 (03:36 +0100)]
Add support for Path-like objects in Python 3.6+

This is done by switching to PyUnicode_FSConverter (3.1+), which
supports it. The convert_obj() function is now much simpler, which is
a bonus.

Expand tests to check behaviour with path objects, and skip those on
Python 3.6.

Closes #20.

17 months agoStart updating NEWS for upcoming release
Iustin Pop [Tue, 26 Nov 2019 02:34:06 +0000 (03:34 +0100)]
Start updating NEWS for upcoming release

Otherwise I forget what's in :)

17 months agoSwitch namespace_none test to check all calls
Iustin Pop [Tue, 26 Nov 2019 02:24:42 +0000 (03:24 +0100)]
Switch namespace_none test to check all calls

Instead of all input parameter types for one call. This is better
since more calls are checked, and the parameter type checking is not
the goal of this test.

17 months agoTravis: cache codecov as well
Iustin Pop [Mon, 25 Nov 2019 04:35:17 +0000 (05:35 +0100)]
Travis: cache codecov as well

Since it's anyway installed.

17 months agoRun name tests as (encoded) bytes too
Iustin Pop [Mon, 25 Nov 2019 04:19:32 +0000 (05:19 +0100)]
Run name tests as (encoded) bytes too

17 months agoTests: remove_on_missing applies to symlinks as well
Iustin Pop [Mon, 25 Nov 2019 04:12:45 +0000 (05:12 +0100)]
Tests: remove_on_missing applies to symlinks as well

17 months agoTests: small py3 cleanup
Iustin Pop [Mon, 25 Nov 2019 04:12:25 +0000 (05:12 +0100)]
Tests: small py3 cleanup

17 months agoRemove support for Python 2 in the extension module
Iustin Pop [Mon, 25 Nov 2019 04:04:20 +0000 (05:04 +0100)]
Remove support for Python 2 in the extension module

Simplifies a bit the code, but not much (yet?).

17 months agoDisable MacOS builds
Iustin Pop [Mon, 25 Nov 2019 04:00:52 +0000 (05:00 +0100)]
Disable MacOS builds

Apparently Python is not actually supported, so the Python 2 builds
were working by accident. Sigh sigh sigh…

17 months agoMakefile: add a simpler test target
Iustin Pop [Mon, 25 Nov 2019 03:56:19 +0000 (04:56 +0100)]
Makefile: add a simpler test target

17 months agoSplit the other monolitic test function
Iustin Pop [Mon, 25 Nov 2019 03:47:18 +0000 (04:47 +0100)]
Split the other monolitic test function

Yay, cleaner now. But lots of many test invocations :)

17 months agoSplit the monolithic ListSetGetDeprecated test
Iustin Pop [Mon, 25 Nov 2019 03:43:48 +0000 (04:43 +0100)]
Split the monolithic ListSetGetDeprecated test

The failure modes are better tested separately, and leave this main
test as set-get-remove simple test.

17 months agoIntroduce an any_subject fixture which includes symlinks
Iustin Pop [Mon, 25 Nov 2019 03:38:59 +0000 (04:38 +0100)]
Introduce an any_subject fixture which includes symlinks

Only symlink creation fails for user attributes on symlinks, so tests
which only list/get do work. This allows removing explicit tests for

17 months agoAdd explicit test for symlink creation failure
Iustin Pop [Mon, 25 Nov 2019 03:35:32 +0000 (04:35 +0100)]
Add explicit test for symlink creation failure

17 months agoDon't compute coverage for external files
Iustin Pop [Mon, 25 Nov 2019 03:34:59 +0000 (04:34 +0100)]
Don't compute coverage for external files

Usually includes are caught here.

17 months agoReduce manyops count
Iustin Pop [Mon, 25 Nov 2019 03:24:57 +0000 (04:24 +0100)]
Reduce manyops count

We test more (object types), so let's reduce the call count for
each. Too slow otherwise.

17 months agoConvert test suite to pytest
Iustin Pop [Mon, 25 Nov 2019 03:22:15 +0000 (04:22 +0100)]
Convert test suite to pytest

Much more parametrisation, which means:

- more test cases covered (testing more/all object types in most
- more granular tests, which should help diagnose of failures

17 months agotests: stop trying to set user attributes on symlinks
Iustin Pop [Mon, 25 Nov 2019 02:07:51 +0000 (03:07 +0100)]
tests: stop trying to set user attributes on symlinks

According to xattr(7), by design setting/modifying user attributes on
symlinks is not allowed, due to the way access control works, so stop
trying to test it.

17 months agoStop supporting Python 2
Iustin Pop [Mon, 25 Nov 2019 01:03:38 +0000 (02:03 +0100)]
Stop supporting Python 2

Bump minimum Python version to 3.4, which covers e.g. in Debian even
old-old-stable (Jessie), which is good enough.

This will allow code simplification and supporting new
features (e.g. to implement #20).

17 months agotests: move helper function outside the test class
Iustin Pop [Mon, 25 Nov 2019 00:37:05 +0000 (01:37 +0100)]
tests: move helper function outside the test class

Not sure why these were there in the first place…

17 months agotests: move constants outside the class
Iustin Pop [Mon, 25 Nov 2019 00:26:49 +0000 (01:26 +0100)]
tests: move constants outside the class

In preparation for pytest conversion.

17 months agoTravis: remove hack for Python 3.7 test
Iustin Pop [Sun, 24 Nov 2019 14:41:02 +0000 (15:41 +0100)]
Travis: remove hack for Python 3.7 test

Current config was testing 3.7 twice :/

17 months agoOnly export COVERALLS_PARALLEL in coveralls upload
Iustin Pop [Sun, 24 Nov 2019 13:54:56 +0000 (14:54 +0100)]
Only export COVERALLS_PARALLEL in coveralls upload

Having it shown as per-job env makes things more confusing.

17 months agoTravis: test on py3.7 and 3.8 too
Iustin Pop [Sun, 24 Nov 2019 13:53:57 +0000 (14:53 +0100)]
Travis: test on py3.7 and 3.8 too

17 months agoAlso export coverage results to codecov
Iustin Pop [Sun, 24 Nov 2019 13:53:12 +0000 (14:53 +0100)]
Also export coverage results to codecov

Will have to decide which to keep, but codecov at least supports
partial line coverage (while missing nicer overall dashboard :/).

17 months agoAdd a distcheck Makefile target
Iustin Pop [Sat, 23 Nov 2019 21:34:29 +0000 (22:34 +0100)]
Add a distcheck Makefile target

Too bad setuptools doesn't have it built-in…

17 months agoSwitch README file to Markdown and expand it
Iustin Pop [Sat, 23 Nov 2019 21:33:36 +0000 (22:33 +0100)]
Switch README file to Markdown and expand it

Let's get a bit more up with the times.

17 months agoFix a docstring formatting issue
Iustin Pop [Sat, 23 Nov 2019 20:53:37 +0000 (21:53 +0100)]
Fix a docstring formatting issue

This resulted in Sphinx altering the layout significantly.

17 months agoSwitch build system to Python 3
Iustin Pop [Sat, 23 Nov 2019 20:08:17 +0000 (21:08 +0100)]
Switch build system to Python 3

But still allow easy override (make ... PYTHON=python2).

17 months agoUpdate Travis config to export coverage information
Iustin Pop [Fri, 22 Nov 2019 23:00:48 +0000 (00:00 +0100)]
Update Travis config to export coverage information

Also enable newer Python (3.7, so not so new) under Linux.

18 months agoTravis: remove obsolete python versions
Iustin Pop [Sun, 13 Oct 2019 15:57:04 +0000 (17:57 +0200)]
Travis: remove obsolete python versions

Some of them, at least.

2 years agoTravis: remove "sudo:false"
Iustin Pop [Sat, 2 Mar 2019 20:14:41 +0000 (21:14 +0100)]
Travis: remove "sudo:false"

Per the deprecation of container-based
builds (,
remove the sudo:false setting.

2 years agoTravis: add python 3.5 and 3.6 to build matrix pyxattr-v0.6.1
Iustin Pop [Tue, 24 Jul 2018 21:45:55 +0000 (23:45 +0200)]
Travis: add python 3.5 and 3.6 to build matrix

Tests pass locally, so all seems good.

2 years agoTravis: remove python 3.2 from build list
Iustin Pop [Tue, 24 Jul 2018 21:39:00 +0000 (23:39 +0200)]
Travis: remove python 3.2 from build list

It seems the setuptools libraries that are installed in the travis
environments don't support anymore 3.2, which causes the builds to be
wrongly marked as failed.

2 years agoFurther test suite fixes to symlink ops
Iustin Pop [Tue, 24 Jul 2018 21:38:15 +0000 (23:38 +0200)]
Further test suite fixes to symlink ops

I forgot about the deprecated ones…

2 years agoUpdate NEWS for proper contents of 0.6.1 release
Iustin Pop [Tue, 24 Jul 2018 21:34:22 +0000 (23:34 +0200)]
Update NEWS for proper contents of 0.6.1 release

2 years agoTravis build: remove dependency on libattr-dev
Iustin Pop [Tue, 24 Jul 2018 21:24:09 +0000 (23:24 +0200)]
Travis build: remove dependency on libattr-dev

One more cleanup as part of the migration to the glibc header.

2 years agoFix nofollow not work in MAC
adamlin [Mon, 20 Mar 2017 10:19:25 +0000 (18:19 +0800)]
Fix nofollow not work in MAC

2 years agoTests: fix symlink testing
Iustin Pop [Tue, 24 Jul 2018 21:20:53 +0000 (23:20 +0200)]
Tests: fix symlink testing

On Linux, non-root users are not allowed to set extended attributes,
so normal testing has hidden this. A fix to the Mac OS support
proposed in #14 uncovered this problem, which led to investigation and
this fix.

Manual testing on Linux with root and namespace=trusted now passes the

2 years agoTests: introduce an alias for NS_USER
Iustin Pop [Tue, 24 Jul 2018 21:14:37 +0000 (23:14 +0200)]
Tests: introduce an alias for NS_USER

Using NS_USER directly makes it hard to change it for a one-off manual
test, so let's virtualise it, and additionally allow overriding from
the command line.

2 years agoRelease GIL when do I/O operations
xwhuang [Fri, 9 Mar 2018 01:56:16 +0000 (09:56 +0800)]
Release GIL when do I/O operations

Release GIL in _list_obj, _get_obj, _set_obj, and _remove_obj. These
functions do I/O operations which take long time. We should release
GIL to allow other threads work.

2 years agoFurther improvements to benchmark code
Iustin Pop [Tue, 24 Jul 2018 20:36:23 +0000 (22:36 +0200)]
Further improvements to benchmark code

2 years agoMakefile: move list of python versions to a variable
Iustin Pop [Tue, 24 Jul 2018 20:29:07 +0000 (22:29 +0200)]
Makefile: move list of python versions to a variable

This way, it can be overridden from the command line, to allow a more
targeted test/benchmark.

2 years agoAdd a mini-benchmark suite
Iustin Pop [Tue, 24 Jul 2018 20:17:02 +0000 (22:17 +0200)]
Add a mini-benchmark suite

This will make it easy to see the impact of changes, for example the
one proposed in #16.

2 years agoBump version to 0.6.1
Iustin Pop [Tue, 24 Jul 2018 19:54:53 +0000 (21:54 +0200)]
Bump version to 0.6.1

Also switch downloads repository to HTTPS.

2 years agoRemove use of and mentions of the attr library
Iustin Pop [Tue, 24 Jul 2018 19:46:48 +0000 (21:46 +0200)]
Remove use of and mentions of the attr library

Commit a799657 removed its use, so let's drop the mention and the
linking against it.

2 years agoxattr.c: There is no more attr/xattr.h with >=attr-2.4.48
Lars Wendler [Wed, 10 Jan 2018 10:45:35 +0000 (11:45 +0100)]
xattr.c: There is no more attr/xattr.h with >=attr-2.4.48

See also:

4 years agoVersion bump for releasing 0.6.0 pyxattr-v0.6.0
Iustin Pop [Mon, 23 Jan 2017 21:38:35 +0000 (22:38 +0100)]
Version bump for releasing 0.6.0

Signed-off-by: Iustin Pop <>
4 years agoExpand the testing of invalid arguments
Iustin Pop [Mon, 14 Nov 2016 21:02:25 +0000 (22:02 +0100)]
Expand the testing of invalid arguments

This is not significant advantage, but it does increase coverage. And
any coverage (even if not testing the logic too much) is better than
no coverage.

4 years agoTest writing large values
Iustin Pop [Sun, 13 Nov 2016 23:57:35 +0000 (00:57 +0100)]
Test writing large values

This exercises one more code path.

4 years agoAlso run tests using python-dbg
Iustin Pop [Sun, 13 Nov 2016 23:55:28 +0000 (00:55 +0100)]
Also run tests using python-dbg

4 years agoAdd a makefile coverage target
Iustin Pop [Tue, 25 Oct 2016 23:27:54 +0000 (01:27 +0200)]
Add a makefile coverage target

And expand a tiny bit the test suite to exercise one more error
path. Current coverage is not bad, ~87% lines coverage. For some
reason, no branch coverage is available :/

4 years agoRework getting and listing attributes
Iustin Pop [Tue, 25 Oct 2016 22:34:07 +0000 (00:34 +0200)]
Rework getting and listing attributes

Currently, getting and listing attributes is inconsistent in how it
deals with allocating memory for the data returned by the syscall:

- in most cases, we ask the kernel for the value, allocate memory,
  then retrieve the value; if the value changed (increased) in the
  meantime, this will lead to what should be preventable failures
- in the single case of getall, there is a loop for getting the
  individual values, but not for initially get the list of values

Hence the bug report #12. This rather large change refactors a lot of
the code:

- doing a get/list is abstracted away into a helper function that
  always does retries until we can read the value or fail with a
  different error than ERANGE; this helper deal with all allocations
  and resize operations.
- this means most of the single get/list operations are heavily
- and also means that we can always start optimistically with an
  initial buffer size (currently set to 1K), instead of asking the
  kernel first: this saves one out of two syscalls in the case the
  value will indeed be smaller, but adds one extra syscall (the failed
  initial read) in the case it's not.

The optimisation is a double-edged sword: for small attributes, it
will be a win (e.g. the test suite is ~5% faster now), but for large
attribute/lists, it will be potentially slower (50% more
syscalls). Not sure how to nicely deal with this; it would be good to
have a keyword argument maybe? Or build flag? Left for future

Closes #12.

4 years agoA few small improvements to the test suite
Iustin Pop [Tue, 25 Oct 2016 21:59:02 +0000 (23:59 +0200)]
A few small improvements to the test suite

Especially testing empty attribute value and ensuring not found
attribute raises an exception.

4 years agoInitialise target_t members on error paths
Iustin Pop [Sun, 23 Oct 2016 10:49:42 +0000 (12:49 +0200)]
Initialise target_t members on error paths

This is a no-op from the point of view of the actual code flow, but
not doing so can trigger false positives in some versions of GCC (4.9
from Jessie) at high optimisation levels (-O3). For an interesting
discussion of why this happens at `-O3` vs. at `-O2`, see

Closes #13.

4 years agoSpelling fix in documentation
Iustin Pop [Mon, 23 May 2016 10:14:33 +0000 (12:14 +0200)]
Spelling fix in documentation

4 years agoFix name space information in documentation
Iustin Pop [Mon, 23 May 2016 10:13:48 +0000 (12:13 +0200)]
Fix name space information in documentation

Closes #11.

5 years agoRevert "Add build status badge to README"
Iustin Pop [Mon, 2 May 2016 20:53:00 +0000 (22:53 +0200)]
Revert "Add build status badge to README"

This reverts commit de9bc00d145874b5a7a63ef382de215b735e8961. First,
it was markdown and README is rst, but that's not the point: sphinx
wants to warn about 'non-local image in URI', and the silencing of
this is only present in 1.4 and later, so for now just revert.

5 years agoAdd build status badge to README
Iustin Pop [Mon, 2 May 2016 20:41:37 +0000 (22:41 +0200)]
Add build status badge to README

5 years agoMark OSX build non-experimental
Iustin Pop [Sun, 1 May 2016 02:59:51 +0000 (04:59 +0200)]
Mark OSX build non-experimental

Also override Python list, since we only care about system python (OSX
doesn't support yet multiple Python versions), and the current state
shows a strange build summary (one build with N python versions).

5 years agoFix tabs in travis config
Iustin Pop [Sun, 1 May 2016 02:53:22 +0000 (04:53 +0200)]
Fix tabs in travis config

5 years agoTry to enable OSX builds in travis configuration
Iustin Pop [Sun, 1 May 2016 02:50:30 +0000 (04:50 +0200)]
Try to enable OSX builds in travis configuration

Based on recent patch, the test suite should pass, so let's try to
enable it.

5 years agoMerge pull request #9 from ahknight/osx-support
Iustin Pop [Sun, 1 May 2016 02:46:32 +0000 (04:46 +0200)]
Merge pull request #9 from ahknight/osx-support

Added support for OS X's slightly different xattr calls.

5 years agoAdded support for OS X's slightly different xattr calls.
Adam Knight [Sat, 9 Apr 2016 20:38:22 +0000 (15:38 -0500)]
Added support for OS X's slightly different xattr calls.

5 years agoBump version to 0.5.6 pyxattr-v0.5.6
Iustin Pop [Sat, 9 Apr 2016 15:26:49 +0000 (17:26 +0200)]
Bump version to 0.5.6

Pending commits fix compilation issues due to sign-compare, let's make
a very much overdue release.

6 years agoFix building on systems which don't have ENODATA
Iustin Pop [Wed, 12 Aug 2009 19:58:36 +0000 (21:58 +0200)]
Fix building on systems which don't have ENODATA

This patch (a modified form of the original patch from Cyril Brulebois
<>) fixes building on systems which don't have ENODATA
(e.g.  GNU/kFreeBSD).

6 years agoFix potential name truncation in merge_ns()
Iustin Pop [Fri, 1 May 2015 23:25:51 +0000 (01:25 +0200)]
Fix potential name truncation in merge_ns()

It seems I misread the snprintf man page: a return value of exactly
the buffer size means truncation has occurred, so we need to fix the
operator (`>` → `≥`).

Additionally, improve slightly the error message raised in such a
case; this shouldn't ever happen.

6 years agotravis-ci: less build log noise
Iustin Pop [Fri, 1 May 2015 23:01:18 +0000 (01:01 +0200)]
travis-ci: less build log noise

Surprisingly, the integration works! But we can reduce some noise in
the build log:

- be explicit that we don't require sudo (silences YELLOW! notice)
- override install since we don't require/use pip requirements

6 years agoAlways enable -Wsign-compare
Iustin Pop [Fri, 1 May 2015 23:20:52 +0000 (01:20 +0200)]
Always enable -Wsign-compare

The code is clean, and this is an important warning (due to extensive
use of both signed and unsigned integers), so let's enable it.

6 years agoFix sign-compare warning in merge_ns()
Iustin Pop [Fri, 1 May 2015 23:17:37 +0000 (01:17 +0200)]
Fix sign-compare warning in merge_ns()

Thanks to travis-ci - the code does what seems an unsafe sign compare,
but actually it is a valid comparison (we test/handle the `< 0` case
as well, which is the only way the comparison could be invalid). To
silence this, do an explicit (safe) cast.

6 years agoAdd a .travis.yml file
Iustin Pop [Fri, 1 May 2015 22:58:25 +0000 (00:58 +0200)]
Add a .travis.yml file

Not sure if the travis-ci environment supports C extension modules or
attributes on filesystems, but let's try.

6 years agoRename README→README.rst pyxattr-v0.5.5
Iustin Pop [Fri, 1 May 2015 19:41:36 +0000 (21:41 +0200)]

Should trigger better formatting, e.g. in github project page.

6 years agoBump version to 0.5.5 for a new release
Iustin Pop [Fri, 1 May 2015 19:40:38 +0000 (21:40 +0200)]
Bump version to 0.5.5 for a new release

6 years agoAdd release dates to NEWS file
Iustin Pop [Fri, 1 May 2015 18:31:39 +0000 (20:31 +0200)]
Add release dates to NEWS file

6 years agoMake the code -Wconversion ready: explicit casts only
Iustin Pop [Fri, 1 May 2015 01:00:35 +0000 (03:00 +0200)]
Make the code -Wconversion ready: explicit casts only

This patch, while adding lots of extra boilerplate, converts all code
to explicit casts only; it now builds with `-Wconversion` cleanly,
although that's a bit too strong to turn on by default (for now).

6 years agoFix a few int/size_t conversion issues
Iustin Pop [Thu, 30 Apr 2015 23:02:59 +0000 (01:02 +0200)]
Fix a few int/size_t conversion issues

From the
'#'-variats of parsing (s#, et#, etc.) take a size_t if
PY_SSIZE_T_CLEAN is defined (which the code does). On some
architectures (little-endian only?) this doesn't seem to be a problem,
but on PPC this is a failure in unit tests (at least yay).

The patch changes the type of bufsize to Py_ssize_t, and does an
explicit cast to size_t with underflow check in order to make the code
safer (assuming this is the right thing to do). This should result in
no unexpected conversion issues.

6 years agoImprove error checking in get_all()
Iustin Pop [Thu, 30 Apr 2015 22:52:52 +0000 (00:52 +0200)]
Improve error checking in get_all()

After getting a too big value via ERANGE, making the call with the
proper length could still fail due to other issues, and this check is
missing. A negative value here would be changed into something weird
in the realloc call (which takes size_t), so the error reporting would
be bogus.

6 years agoStyle change: name all jump labels uniformly
Iustin Pop [Thu, 30 Apr 2015 22:48:35 +0000 (00:48 +0200)]
Style change: name all jump labels uniformly

6 years agoFix memory leak on get_all OutOfMemory handling path
Iustin Pop [Thu, 30 Apr 2015 22:43:16 +0000 (00:43 +0200)]
Fix memory leak on get_all OutOfMemory handling path

It's unlikely that the situation is recoverable when failing to
allocate memory, but the current code is clearly buggy: PyMem_Realloc
doesn't clobber the existing buffer on failure, so not deallocating it
will result in a leak.

6 years agoUpdate my email address pyxattr-v0.5.4
Iustin Pop [Thu, 30 Apr 2015 15:32:50 +0000 (17:32 +0200)]
Update my email address

6 years agoBump upper python version test in Makefile
Iustin Pop [Thu, 30 Apr 2015 15:31:18 +0000 (17:31 +0200)]
Bump upper python version test in Makefile

6 years agoBump version for 0.5.4 release
Iustin Pop [Thu, 30 Apr 2015 15:29:37 +0000 (17:29 +0200)]
Bump version for 0.5.4 release