qpython-android / qpython

QPython is an Android Python engine primarily designed for Python and AI learners. It offers a range of impressive features to enhance Python programming experience.
https://www.qpython.org
1.07k stars 194 forks source link

IOError:[Errno 30] Read-only file system #117

Closed danielrosero closed 6 years ago

danielrosero commented 6 years ago

Got this permission problem trying to run instabot example.

The weird thing is that I don't have any problem doing the same with the published apk.

Any clue on what I'm doing wrong? Thanks in advance.

"/storage/emulated/0/qpython/scripts/scripts/example.py" && exit      <
Traceback (most recent call last):
  File "/storage/emulated/0/qpython/scripts/scripts/example.py", line 6, in <module>
    from src import InstaBot
  File "/storage/emulated/0/qpython/scripts/scripts/src/__init__.py", line 1, in <module>
    from .instabot import InstaBot
  File "/storage/emulated/0/qpython/scripts/scripts/src/instabot.py", line 24, in <module>
    class InstaBot:
  File "/storage/emulated/0/qpython/scripts/scripts/src/instabot.py", line 101, in InstaBot
    logging.basicConfig(filename='errors.log', level=logging.INFO)
  File "/QPython/QPython2-core/build/python-install/lib/python2.7/logging/__init__.py", line 1511, in basicConfig
  File "/QPython/QPython2-core/build/python-install/lib/python2.7/logging/__init__.py", line 893, in __init__
  File "/QPython/QPython2-core/build/python-install/lib/python2.7/logging/__init__.py", line 912, in _open
IOError: [Errno 30] Read-only file system: '/errors.log'
1|lux:/ $
clach04 commented 6 years ago

I'm not familar with this code but I can see its attemping to write to the root directory to a file called errors.log, under Android that location is read only (as per the error message).

With my scripts under Android I've had to put explicit full paths (usually to /sdcard, due to issue #131 ) as CWD/PWD often isn't set.

danielrosero commented 6 years ago

I'm sorry, I solved this before... totally forgot about this open issue.

It's exactly what you said, its all about the path, it was trying to create the log in the home root directory.