Ticket #20 (closed defect: Invalid)

Opened 5 years ago

Mode parameter seems to be ignored

Reported by: thorstein Owned by: gh
Priority: medium Milestone:
Component: implementation Version: None
Severity: Bugs Keywords:
Cc:

Description

import sqlite
conn = sqlite.Connection('mydb', mode=0600)

> ls -l mydb
-rw-r--r--    1 thor     thor            0 Jun 11 14:21
mydb
>

No matter what I put for mode, the access permissions
for file 'mydb' are always -rw-r--r--. It doesn't
matter whether I populate the database, or if the file
exists before the connection is created.

Both sqlite and sqlite-python were downloaded today:

> cat sqlite/VERSION
2.8.3
>
...
> ls
pysqlite-0.4.3/
>

I run a recent Mandrake on an IBM T30 laptop:
> cat /etc/issue
Mandrake Linux release 9.1 (Bamboo) for i586
Kernel 2.4.21-0.13mdk on an i686 / \l
>

Change History

Changed 5 years ago by ghaering

Logged In: YES 
user_id=163326

Thanks for the report.

You're right: SQLite ignores the mode parameter.

See http://sqlite.org/c_interface.html
1.1 Opening a database

So it's not PySQLite's fault. Closing this.

FWIW you've got the meaning of the mode paramter wrong,
anyway ;-) The meaning is wether to open the database in
read-only mode or not. Anyway, look at the c_interface page
for details. HTH.

Changed 5 years ago by thorstein

Logged In: YES 
user_id=587322

Thank you for that, if its a problem with SQLite it is fair
enough to reject the report.

What confused me was the example with mode=077 at
http://pysqlite.sourceforge.net/documentation/pysqlite/node4.html.
(I still don't quite see how that would make sense... but
never mind :).)

Thanks for the quick response.
Thorstein
Note: See TracTickets for help on using tickets.