Reham1 / python-for-android

Automatically exported from code.google.com/p/python-for-android
Apache License 2.0
0 stars 0 forks source link

dumbdbm module fails to set file mode #71

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Create a database with the dumbdbm module - e.g. called by the anydbm module

What is the expected output? What do you see instead?
Fails in _chmod with a OSError: [Error 1] Operation not permitted, ...
See attached screenshot

What version of the product are you using? On what operating system?
py4a v5, sl4a v6, Android 4.2.2 Nexus 7 (not rooted)

Please provide any additional information below.

I'm customising uploadr from here:
https://github.com/ept/uploadr.py

It creates a database of images already uploaded using these modules:
uploadr > shelve > anydbm > dumbdbm

anydbm uses a database type depending on what modules are available. On sl4a 
the only option is dumbdbm, but dumbdbm fails.

I got it working on py4a by changing the mode in dumbdb as follows:
change
def open(file, flag=None, mode=0666):
to
def open(file, flag=None, mode="w"): 

I did this by replacing all modules down the chain with modded versions - eg 
import shelve_mod as shelve, etc...

It seems that the default octal 666 permission doesn't workin sl4a

Original issue reported on code.google.com by David.J....@gmail.com on 6 Mar 2013 at 10:08

Attachments: