Documentation incorrectly implies acquire() is in the public API

Bug #838338 reported by Johan Hake
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flufl.lock
Fix Released
Low
Barry Warsaw

Bug Description

When acquire is used without the lifetime argument it fails. The signature comes with a default argument of None. None breaks the code with the following error:

AttributeError: 'NoneType' object has no attribute 'seconds'

Revision history for this message
Barry Warsaw (barry) wrote :

Ah, you're talking about the flufl.lock.tests.subproc.acquire() function? That's really just a unit test support function, and not part of the public interface for the library.

If so, then the documentation should make that clearer, probably by including some text and renaming the function to start with a leading underscore.

Changed in flufl.lock:
status: New → Incomplete
Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 838338] Re: acquire without lifetime argument fails

Ok!

Thanks for the explaination. It was not totally clear, as you show how to use
acquire in the documentation page.

Anyhow, thanks for a much needed library. I just added support for flufl.lock
in instant:

  https://launchpad.net/instant

a C/C++ JIT wrapper for Python, which uses SWIG. Instant have for a long time
been using a NFS unsafe file locking mechanism, which caused all kind of
havocs...

I probably have to update how we use it with the knowledge I got here though
;)

Johan

On Wednesday August 31 2011 16:38:39 Barry Warsaw wrote:
> Ah, you're talking about the flufl.lock.tests.subproc.acquire()
> function? That's really just a unit test support function, and not part
> of the public interface for the library.
>
> If so, then the documentation should make that clearer, probably by
> including some text and renaming the function to start with a leading
> underscore.
>
> ** Changed in: flufl.lock
> Status: New => Incomplete

Revision history for this message
Barry Warsaw (barry) wrote :

On Aug 31, 2011, at 11:55 PM, Johan Hake wrote:

>a C/C++ JIT wrapper for Python, which uses SWIG. Instant have for a long time
>been using a NFS unsafe file locking mechanism, which caused all kind of
>havocs...

Neat project!

>I probably have to update how we use it with the knowledge I got here though
>;)

I've re-targeted the bug to make it clear that the documentation is
misleading, and will fix that in the next release. In the meantime, if you
have any further questions about how to use the library or how it can best be
utilized by instant, don't hesitate to ask!

summary: - acquire without lifetime argument fails
+ Documentation incorrectly implies acquire() is in the public API
Changed in flufl.lock:
status: Incomplete → Confirmed
importance: Undecided → Low
assignee: nobody → Barry Warsaw (barry)
Revision history for this message
Johan Hake (johan-hake) wrote :

On Wednesday August 31 2011 17:45:20 Barry Warsaw wrote:
> On Aug 31, 2011, at 11:55 PM, Johan Hake wrote:
> >a C/C++ JIT wrapper for Python, which uses SWIG. Instant have for a long
> >time been using a NFS unsafe file locking mechanism, which caused all
> >kind of havocs...
>
> Neat project!

Thanks! It is part of the fenicsproject.org, where it handles automatic
wrapping of JIT generated C++ code. The code is used to solve PDEs using the
finite element method.

> >I probably have to update how we use it with the knowledge I got here
> >though ;)
>
> I've re-targeted the bug to make it clear that the documentation is
> misleading, and will fix that in the next release. In the meantime, if you
> have any further questions about how to use the library or how it can best
> be utilized by instant, don't hesitate to ask!

I will definately ask questions, but that on the correct place :)

Johan

Barry Warsaw (barry)
Changed in flufl.lock:
milestone: none → 2.2
status: Confirmed → Fix Committed
Barry Warsaw (barry)
Changed in flufl.lock:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.