473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

bsddb read-only requires rw access to close?

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.
Jul 18 '05 #1
3 2664
ha************@hotpop.com (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

Jul 18 '05 #2
Is this a bug?


Yes.


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

--
Дамјан (jabberID:da****@bagra.net.mk)

A: Because it reverses the logical flow of converstion.
Q: Why is top posting frowned upon?
Jul 18 '05 #3

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

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John D. | last post by:
We are using OpenBSD latest release of Python (2.3), and want to use the "bsddb" module. Our python release has a directory called "bsddb", but when we try and import it, it says >>> import...
0
by: Anthony McDonald | last post by:
PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About PythonWin' for further copyright information. >>>...
6
by: Dfenestr8 | last post by:
I started off trying to use bsddb with my standard mandrake 9 python 2.2.1 package. The shell reported back no such module. Strange, thinks I. I thought it was standard in the package, it was when...
4
by: Michele Simionato | last post by:
I was browsing through the source tree of Python 2.4b2 and in Lib/bsddb/test I found a lot of interesting stuff. It seems that the support for the bsd database is much better than documented in the...
0
by: jalil | last post by:
I am using Python 2.4 and get this exception when running my mod_python application. This used to work in my older environment. Any ideas on how I can debug this issue? -Jalil Mod_python...
0
by: Neville C. Dempsey | last post by:
#!/bin/env python import bsddb test=bsddb.btopen("test.tbl") for m in "JFMATQPHSOND": test="Profit for month "+m+" $1B" def subyear_report(record_selection): for data in...
0
by: Barry | last post by:
I have python2.4.1 installed on two machines: -- one is Fedora core 1, where the bsddb module works fine -- one is Redhat ES 3.0, and I installed mysql 4.1 (and mysql-python2.1) after putting the...
1
by: leasun | last post by:
Anybody knows which version bsddb is released with py2.3 and py2.4? Thanks.
0
by: Yi Qiang | last post by:
Hi guys, I am trying to compile python 2.5 on my OSX machine so it includes the bsddb module. Currently, when I type 'import bsddb' I get the following traceback: ...
2
by: cocobear | last post by:
How to deal with multiple databases in an file. I want to get the content of several databases. it's the code I wrote: $ python Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11) on linux2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.