Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > bsddb read-only requires rw access to close?

Reply
Thread Tools

bsddb read-only requires rw access to close?

 
 
Harry Pehkonen
Guest
Posts: n/a
 
      08-29-2003
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.
 
Reply With Quote
 
 
 
 
Martin v. =?iso-8859-15?q?L=F6wis?=
Guest
Posts: n/a
 
      08-31-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (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

 
Reply With Quote
 
 
 
 
=?UTF-8?B?0LTQsNC80ZjQsNC9INCzLg==?=
Guest
Posts: n/a
 
      09-01-2003

>> Is this a bug?

>
> Yes.


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

--
Дамјан (jabberID:(E-Mail Removed))

A: Because it reverses the logical flow of converstion.
Q: Why is top posting frowned upon?
 
Reply With Quote
 
Skip Montanaro
Guest
Posts: n/a
 
      09-01-2003

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: slicing a bsddb table, eg. for rec in bsddb["AArdvark":"zebra"]:print rec Skip Montanaro Python 1 06-26-2005 08:49 PM
slicing a bsddb table, eg. for rec in bsddb["AArdvark":"zebra"]:print rec Neville C. Dempsey Python 0 06-12-2005 06:22 PM
bsddb built for concurrent access (rh9) Sergey Schetinin Python 0 11-17-2004 01:37 PM
bsddb.btopen() Anthony McDonald Python 0 08-13-2003 10:38 AM
problems importing "bsddb" John D. Python 0 08-12-2003 08:59 PM



Advertisments