]> git.k1024.org Git - pyxattr.git/log
pyxattr.git
5 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.

5 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.

5 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.

5 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:
http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38

7 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 <iustin@k1024.org>
7 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.

7 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.

7 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

7 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 :/

7 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
  simplified
- 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
enhancements.

Closes #12.

7 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.

7 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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165.

Closes #13.

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

7 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.

7 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.

7 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

7 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).

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

7 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.

7 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.

8 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.

8 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.

8 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
<kibi@debian.org>) fixes building on systems which don't have ENODATA
(e.g.  GNU/kFreeBSD).

8 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.

8 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

8 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.

8 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.

8 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.

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

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

8 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

8 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

8 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).

8 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 https://bugzilla.redhat.com/show_bug.cgi?id=1127310: 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.

8 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.

8 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

8 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.

8 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

8 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

8 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

8 years agoRemove all .so files on make clean
Iustin Pop [Thu, 30 Apr 2015 11:40:25 +0000 (13:40 +0200)]
Remove all .so files on make clean

8 years agoUpdate copyright year
Iustin Pop [Thu, 30 Apr 2015 11:39:20 +0000 (13:39 +0200)]
Update copyright year

Sigh, boring.

8 years agoFix memory leaks in get() failure handling path
Iustin Pop [Thu, 30 Apr 2015 11:31:06 +0000 (13:31 +0200)]
Fix memory leaks in get() failure handling path

The freeing memory labels were used wrongly; easily reproducible by
simulating failures in a loop.

9 years agoUpdate changelog and bump version for 0.5.3 pyxattr-v0.5.3
Iustin Pop [Fri, 23 May 2014 15:42:04 +0000 (17:42 +0200)]
Update changelog and bump version for 0.5.3

9 years agoAdd helpers to test suite for easier checking
Iustin Pop [Fri, 23 May 2014 15:36:44 +0000 (17:36 +0200)]
Add helpers to test suite for easier checking

Since the _ignore/_ignore_tuples methods are always called with
assertEqual, let's add two wrappers to simplify the code a bit.

9 years agoMake the environment variable TEST_DIR match the python var
Iustin Pop [Fri, 23 May 2014 11:10:34 +0000 (13:10 +0200)]
Make the environment variable TEST_DIR match the python var

Having things inconsistent just leads to confusion.

9 years agoMerge pull request #3 from jborg/surrogateescape
Iustin Pop [Fri, 23 May 2014 10:57:44 +0000 (12:57 +0200)]
Merge pull request #3 from jborg/surrogateescape

Use "surrogateescape" error handler when encoding unicode paths.

9 years agoMerge pull request #4 from edelkind/master
Iustin Pop [Fri, 23 May 2014 10:49:21 +0000 (12:49 +0200)]
Merge pull request #4 from edelkind/master

Better handling of files without xattrs

9 years agoMerge pull request #5 from quantheory/master
Iustin Pop [Fri, 23 May 2014 10:41:01 +0000 (12:41 +0200)]
Merge pull request #5 from quantheory/master

Add workaround for tests on SELinux systems.

10 years agoFix tests when tmp files have attributes.
Sean Patrick Santos [Sun, 9 Mar 2014 02:17:26 +0000 (19:17 -0700)]
Fix tests when tmp files have attributes.

SELinux systems may have the security.selinux attribute defined for
temporary files upon creation. This can cause problems for the tests,
which assumed that new files have no attributes. Similar problems can
arise in other cases where temporary files created by python start out
with attributes.

To work around this, a comma-separated list of attributes to ignore can
be specified in the environment variable "TEST_IGNORE_XATTRS". Any
attributes specified in this way will be filtered out by tests.

10 years agoBetter handling of files without xattrs
ari edelkind [Tue, 17 Sep 2013 18:20:33 +0000 (14:20 -0400)]
Better handling of files without xattrs

Return an empty list immediately if a file has no xattrs (as most would
not on most systems).  The number of system calls for files with no
extended attributes is reduced by (at least) half.

10 years agoUse "surrogateescape" error handler when encoding unicode paths.
Jonas Borgström [Thu, 13 Jun 2013 20:17:32 +0000 (22:17 +0200)]
Use "surrogateescape" error handler when encoding unicode paths.

On Python 3 functions like os.listdir() always returns unicode
paths. "invalid" byte paths are decoded using the "surrogateescape" error
handler which must also be used when decoding.
See os.fsencodefs() and os.fsdecode().

11 years agoUpdate docs for the 0.5.2 release pyxattr-v0.5.2
Iustin Pop [Thu, 3 Jan 2013 21:27:40 +0000 (22:27 +0100)]
Update docs for the 0.5.2 release

Of course I forgot this, and as github has also deprecated downloads,
we should switch to something else…

11 years agoBump version and update NEWS for the 0.5.2 release
Iustin Pop [Thu, 3 Jan 2013 20:45:14 +0000 (21:45 +0100)]
Bump version and update NEWS for the 0.5.2 release

All tests pass, let's release!

11 years agoFix string/unicode buffer size parsing
Iustin Pop [Thu, 3 Jan 2013 20:36:36 +0000 (21:36 +0100)]
Fix string/unicode buffer size parsing

It seems that CPython allows passing "wrong" pointers for et#
(Py_ssize_t instead of int), but PyPy has problems with this, and
wrongly casts the pointers, leading to unsigned/signed conversion
failures.

This bug was introduced in commits 433c5852 and 8aa6fd81; I'm no
longer sure why bufsize was changed from int to Py_ssize_t as well,
but passing an int value to a C function expecting an ssize_t should
be safe as the compiler should do the required conversions behind the
scenes (as long as it has correct information about the types).

Closes gh-1.

11 years agoEnable testing with python 3.3 and pypy as well
Iustin Pop [Thu, 3 Jan 2013 20:35:44 +0000 (21:35 +0100)]
Enable testing with python 3.3 and pypy as well

The pypy test is not versioned, since Debian only provides a single
pypy binary, so I don't have an environment with multiple pypy
installations.

11 years agoEnable compiler warnings
Iustin Pop [Thu, 3 Jan 2013 20:27:03 +0000 (21:27 +0100)]
Enable compiler warnings

`-Wall -Werror` should make compiler warnings much more obvious,
hopefully catching more latent bugs.

11 years agoMake setup.py behave nicely without setuptools
Iustin Pop [Thu, 3 Jan 2013 20:26:15 +0000 (21:26 +0100)]
Make setup.py behave nicely without setuptools

Currently, it would fail hard, whereas we can at least build the
extension (even though the testsuite will not work) when setuptools is
missing.

11 years agoPython 2.5 can't parse byte literals, so use bytes() instead.
Mike Gilbert [Fri, 21 Dec 2012 21:33:18 +0000 (16:33 -0500)]
Python 2.5 can't parse byte literals, so use bytes() instead.

11 years agoFix title in index page
Iustin Pop [Tue, 15 May 2012 23:48:26 +0000 (01:48 +0200)]
Fix title in index page

11 years agoClarify the namespace type under Py3 pyxattr-v0.5.1
Iustin Pop [Tue, 15 May 2012 23:34:42 +0000 (01:34 +0200)]
Clarify the namespace type under Py3

11 years agoUpdate NEWS file for the 0.5.1 release
Iustin Pop [Tue, 15 May 2012 23:23:20 +0000 (01:23 +0200)]
Update NEWS file for the 0.5.1 release

11 years agoComplete the change of namespace handling
Iustin Pop [Tue, 15 May 2012 23:19:58 +0000 (01:19 +0200)]
Complete the change of namespace handling

This disables None as a valid namespace under Python 2.x too; now only
an empty string is accepted.

The patch also documents the change.

11 years agoFix bug in get_all for empty namespace handling
Iustin Pop [Tue, 15 May 2012 23:11:13 +0000 (01:11 +0200)]
Fix bug in get_all for empty namespace handling

Also add an unit test for it.

11 years agoMore setup.py updates
Iustin Pop [Tue, 15 May 2012 22:58:24 +0000 (00:58 +0200)]
More setup.py updates

11 years agoAdd a download_url for pypi
Iustin Pop [Tue, 15 May 2012 22:46:42 +0000 (00:46 +0200)]
Add a download_url for pypi

11 years agoBump version number for new release
Iustin Pop [Tue, 15 May 2012 22:31:56 +0000 (00:31 +0200)]
Bump version number for new release

Also switch the homepage URL.

11 years agoUpdate gitignore file
Iustin Pop [Tue, 15 May 2012 22:25:12 +0000 (00:25 +0200)]
Update gitignore file

11 years agoMakefile improvements
Iustin Pop [Tue, 15 May 2012 22:23:43 +0000 (00:23 +0200)]
Makefile improvements

… and remove old run-tests file, obsoleted by the Makefile.

11 years agoUpdate manifest file
Iustin Pop [Tue, 15 May 2012 22:22:15 +0000 (00:22 +0200)]
Update manifest file

11 years agoUpdate README to include the old website info
Iustin Pop [Tue, 15 May 2012 22:16:03 +0000 (00:16 +0200)]
Update README to include the old website info

11 years agoConvert NEWS file
Iustin Pop [Tue, 15 May 2012 22:07:07 +0000 (00:07 +0200)]
Convert NEWS file

This allows it to be included in the doc nicely.

11 years agoSwitch documentation style to sphinx
Iustin Pop [Tue, 15 May 2012 22:03:47 +0000 (00:03 +0200)]
Switch documentation style to sphinx

Still work needed to transition this completely, but looks good so far.

11 years agoRename convertObj → convert_obj
Iustin Pop [Tue, 15 May 2012 20:03:55 +0000 (22:03 +0200)]
Rename convertObj → convert_obj

Makes the style more consistent with the rest of the file.

11 years agoFix two missing close() class in tests
Iustin Pop [Tue, 15 May 2012 20:01:53 +0000 (22:01 +0200)]
Fix two missing close() class in tests

Eliminates a warning during testing.

11 years agoRework parsing of the namespace argument
Iustin Pop [Tue, 15 May 2012 19:24:04 +0000 (21:24 +0200)]
Rework parsing of the namespace argument

In Python 3, we cannot accept (easily) bytes or None, so we have to
change how we accept the namespace argument.

Previously, if the argument was not passed or it was None, it was
considered missing. Since the None option is no longer possible, we
change it so that if not passed or passed as an empty string, it is
considered missing. This changes the behaviour somewhat, but I hope
that empty namespaces are not used (that's what I understand from
reading various pages on the internet).

11 years agoRemove use of deprecated fail* test functions
Iustin Pop [Tue, 15 May 2012 19:23:20 +0000 (21:23 +0200)]
Remove use of deprecated fail* test functions

11 years agoRework init sequence
Iustin Pop [Mon, 14 May 2012 22:38:56 +0000 (00:38 +0200)]
Rework init sequence

This makes it a bit more clean, and thus removes the last refcount
issue; however, the code itself is much uglier :(

11 years agoA few docstring fixes
Iustin Pop [Mon, 14 May 2012 22:23:12 +0000 (00:23 +0200)]
A few docstring fixes

11 years agoFix a (harmless) integer mismatch
Iustin Pop [Mon, 14 May 2012 22:20:35 +0000 (00:20 +0200)]
Fix a (harmless) integer mismatch

This is not critical, but let's not over-optimise and request a byte
when we store it anyway in an int…

11 years agoCheck merge_ns return value in all places
Iustin Pop [Mon, 14 May 2012 22:17:39 +0000 (00:17 +0200)]
Check merge_ns return value in all places

This eliminates another potential round of errors. Also add cpychecker
attribute for even less noise.

11 years agoRework merge_ns signature
Iustin Pop [Mon, 14 May 2012 22:12:30 +0000 (00:12 +0200)]
Rework merge_ns signature

This is also in order to clarify what is an "error" return for
cpychecker.

Note that most calls to this function do not have yet error checking,
will be fixed in separate patch.

11 years agoFix a case of missing exception on return NULL
Iustin Pop [Mon, 14 May 2012 22:04:54 +0000 (00:04 +0200)]
Fix a case of missing exception on return NULL

Now that the noise is gone, this is an actual error.

11 years agoRename a variable for more consistency
Iustin Pop [Mon, 14 May 2012 21:54:09 +0000 (23:54 +0200)]
Rename a variable for more consistency

At least, more consistency in the output of git grep convertObj :)

11 years agoMark convertObj as setting the exception on errors
Iustin Pop [Mon, 14 May 2012 21:53:40 +0000 (23:53 +0200)]
Mark convertObj as setting the exception on errors

This eliminates lots of clutter from the cpychecker output, yay!

11 years agoSwitch converObj to negative error return
Iustin Pop [Mon, 14 May 2012 21:48:12 +0000 (23:48 +0200)]
Switch converObj to negative error return

This will allow cpychecker to know that this function has set the
exception already, eliminating false positives.

11 years agoFix some const char* pointers
Iustin Pop [Mon, 14 May 2012 21:40:35 +0000 (23:40 +0200)]
Fix some const char* pointers

This reduces the warnings, and it's a good thing to do.

11 years agoSwitch to setuptools
Iustin Pop [Mon, 14 May 2012 20:50:43 +0000 (22:50 +0200)]
Switch to setuptools

For proper testsuite support.

11 years agoFix small typo
Iustin Pop [Mon, 14 May 2012 20:48:40 +0000 (22:48 +0200)]
Fix small typo

11 years agoFix some potential issues if PyBytes_FromString fails
Iustin Pop [Mon, 14 May 2012 20:37:56 +0000 (22:37 +0200)]
Fix some potential issues if PyBytes_FromString fails

This is unlikely, but if it happens it's ugly.

11 years agoFix bugs reported by cpychecker
Iustin Pop [Mon, 14 May 2012 20:32:07 +0000 (22:32 +0200)]
Fix bugs reported by cpychecker

Thanks to Dave Malcolm's cpychecker tool, this patch fixes a number of
serious issues. All issues that were not deemed false-positives were
fixed; some other issues in the same category that were found only by
a high number of refcount checks are also fixed (I should
split/simplify some parts of the code…).

14 years agoIncrease version to 0.5.0 v0.5.0
Iustin Pop [Sun, 27 Dec 2009 13:30:14 +0000 (14:30 +0100)]
Increase version to 0.5.0

14 years agoImprove the unittest runner
Iustin Pop [Sun, 27 Dec 2009 13:13:58 +0000 (14:13 +0100)]
Improve the unittest runner

This uses only existing python interpreters and does a cleanup before
building the unittest, to help with stale objects.

15 years agoFix a size_t/ssize_t mismatch
Iustin Pop [Sun, 14 Dec 2008 20:12:43 +0000 (21:12 +0100)]
Fix a size_t/ssize_t mismatch

ACL library functions return a ssize_t, so all variables that hold
return values from such return types must be ssize_t, otherwise
comparisons with -1 will fail.

15 years agoSmall style fixes
Iustin Pop [Sun, 14 Dec 2008 18:11:30 +0000 (19:11 +0100)]
Small style fixes

15 years agoAdd python 3 support
Iustin Pop [Sun, 14 Dec 2008 17:47:51 +0000 (18:47 +0100)]
Add python 3 support

This big patch does a few things (which are hard to split):
  - uniformize all function w.r.t. the error exit path (all functions
    now use only one exit point)
  - move from 's' to 'et' format in ParseArgs so that we can accept both
    binary and text, in both 2.x and 3.0
  - update the unittest for py3k

15 years agoInitialize local variables
Iustin Pop [Sun, 14 Dec 2008 17:46:01 +0000 (18:46 +0100)]
Initialize local variables

This patch prepares for the "et" format conversion by initializing the
local variables; it also adds a new "res" object for returns and adds a
few style fixes.

15 years agoAdd a new field to the target_t structure
Iustin Pop [Sun, 14 Dec 2008 17:41:34 +0000 (18:41 +0100)]
Add a new field to the target_t structure

The patch extends the target_t structure with a new PyObject field and
adds a cleanup function for it. This field is needed for properly
handling unicode input arguments with Py3K.

15 years agoMake the module setup py3k-compatible
Iustin Pop [Thu, 11 Dec 2008 09:16:55 +0000 (10:16 +0100)]
Make the module setup py3k-compatible

This patch converts the initialization of the module to work with both
2.x and 3.0.

15 years agoAdd script to run tests
Iustin Pop [Thu, 11 Dec 2008 09:12:54 +0000 (10:12 +0100)]
Add script to run tests

Since we don't have setuptools for now, we add a script to run tests and
modify the test script to work without setuptools.

15 years agoSwitch back to distutils
Iustin Pop [Thu, 11 Dec 2008 09:10:53 +0000 (10:10 +0100)]
Switch back to distutils

Python 3.0 doesn't yet have setuptools, so temporarily we switch back to
distutils.