bsddb read-only requires rw access to close?

Discussion in 'Python' started by Harry Pehkonen, Aug 29, 2003.

  1. Stats:
    Python2.3
    windows2000 professional

    If I have ``Full Control'' of a bsddb file, no problem:

    >>> import bsddb
    >>> a = bsddb.btopen("c:/sharedrw/db/npanxx2pseudo.db", "r")
    >>> a.close()
    >>>


    .... but if I change to read-only access (as in permissions on file):

    >>> a = bsddb.btopen("c:/sharedrw/db/npanxx2pseudo.db", "r")
    >>> a.close()


    Traceback (most recent call last):
    File "<pyshell#30>", line 1, in -toplevel-
    a.close()
    File "C:\Python23\lib\bsddb\__init__.py", line 101, in close
    v = self.db.close()
    DBPermissionsError: (1, 'Operation not permitted')

    Performing a close() with read/write access with file opened "r" does
    not change the last-modified time/date.

    Is this a bug?

    Thanks!
    Harry.
     
    Harry Pehkonen, Aug 29, 2003
    #1
    1. Advertising

  2. (Harry Pehkonen) writes:

    > Is this a bug?


    Yes.

    Without further investigation, it might be a bug in Python, _bsddb,
    Sleepycat BSDDB, or the operating system, though.

    Regards,
    Martin
     
    Martin v. =?iso-8859-15?q?L=F6wis?=, Aug 31, 2003
    #2
    1. Advertising


  3. >> Is this a bug?

    >
    > Yes.


    But since the DB is opened read-only, perhaps close() is not so important?!?

    --
    Дамјан (jabberID:)

    A: Because it reverses the logical flow of converstion.
    Q: Why is top posting frowned upon?
     
    =?UTF-8?B?0LTQsNC80ZjQsNC9INCzLg==?=, Sep 1, 2003
    #3
  4. Harry> ... but if I change to read-only access (as in permissions on file):

    >>>> a = bsddb.btopen("c:/sharedrw/db/npanxx2pseudo.db", "r")
    >>>> a.close()


    Harry> Traceback (most recent call last):
    Harry> File "<pyshell#30>", line 1, in -toplevel-
    Harry> a.close()
    Harry> File "C:\Python23\lib\bsddb\__init__.py", line 101, in close
    Harry> v = self.db.close()
    Harry> DBPermissionsError: (1, 'Operation not permitted')

    Harry> Performing a close() with read/write access with file opened "r" does
    Harry> not change the last-modified time/date.

    Harry> Is this a bug?

    Dunno. Works for me on Mac OS X:

    % python
    Python 2.4a0 (#77, Aug 11 2003, 11:19:14)
    [GCC 3.1 20020420 (prerelease)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import bsddb
    >>> db = bsddb.btopen("foo.bt", "c")
    >>> db['1'] = '1'
    >>> db.close()
    >>>

    % chmod 444 foo.bt
    % python
    Python 2.4a0 (#77, Aug 11 2003, 11:19:14)
    [GCC 3.1 20020420 (prerelease)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import bsddb
    >>> db = bsddb.btopen("foo.bt", "r")
    >>> db.close()
    >>>


    Skip
     
    Skip Montanaro, Sep 1, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. keithb
    Replies:
    2
    Views:
    8,021
    keithb
    Jun 7, 2006
  2. Sergey Schetinin

    bsddb built for concurrent access (rh9)

    Sergey Schetinin, Nov 17, 2004, in forum: Python
    Replies:
    0
    Views:
    337
    Sergey Schetinin
    Nov 17, 2004
  3. Neville C. Dempsey
    Replies:
    0
    Views:
    373
    Neville C. Dempsey
    Jun 12, 2005
  4. Skip Montanaro
    Replies:
    1
    Views:
    397
    Bengt Richter
    Jun 26, 2005
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    874
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page