bsddb read-only requires rw access to close?

H

Harry Pehkonen

Stats:
Python2.3
windows2000 professional

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

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

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

Martin v. =?iso-8859-15?q?L=F6wis?=

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
 
S

Skip Montanaro

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

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top