Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOError: [Errno 20] Not a directory: #113

Closed
yurkomik opened this issue May 3, 2013 · 5 comments
Closed

IOError: [Errno 20] Not a directory: #113

yurkomik opened this issue May 3, 2013 · 5 comments

Comments

@yurkomik
Copy link

yurkomik commented May 3, 2013

My program works ok on ubuntu linux, but on android I get this strange error.
I/python ( 2813): IOError: [Errno 20] Not a directory: '/data/data/ez.tools.xyzcontroller.app/files/lib/python27.zip/logs/program.log'

AppFolder/logs/program.log' is file where logs have to be written and for sure it's not a directory.
the error is persistent after few compilations with differend cython and ndk versions :(
Any ideas what can cause the problem? Thanks for any help..

here is full output:

I/ActivityManager( 266): Start proc ez.tools.xyzcontroller.app:python for activity ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity: pid=2813 uid=10113 gids={1015, 1028}
I/dalvikvm( 2813): Turning on JNI app bug workarounds for target SDK version 8...
V/TabletStatusBar( 363): setLightsOn(true)
E/Trace ( 2813): error opening trace file: No such file or directory (2)
V/python ( 2813): metadata fullscreen is1
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl.so 0x4237b300
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_image.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_image.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libsdl_image.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_ttf.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_ttf.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libsdl_ttf.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_mixer.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_mixer.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libsdl_mixer.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libpython2.7.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libpython2.7.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libpython2.7.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libapplication.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libapplication.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libapplication.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_main.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsdl_main.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libsdl_main.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_io.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_io.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_io.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/unicodedata.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/unicodedata.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/unicodedata.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/lib/libsqlite3.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/lib/libsqlite3.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/lib/libsqlite3.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_sqlite3.so 0x4237b300
D/dalvikvm( 2813): Added shared lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_sqlite3.so 0x4237b300
D/dalvikvm( 2813): No JNI_OnLoad found in /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_sqlite3.so 0x4237b300, skipping init
D/dalvikvm( 2813): Trying to load lib /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload/_imaging.so 0x4237b300
I/python ( 2813): starting audio thread
I/SDLSurface( 2813): surfaceCreated() is not handled :|
D/libEGL ( 2813): loaded /system/lib/egl/libEGL_mali.so
D/libEGL ( 2813): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL ( 2813): loaded /system/lib/egl/libGLESv2_mali.so
W/SDLSurface( 2813): Choose egl configuration
I/SDLSurface( 2813): Try to use graphics config R8G8B8A8S8
W/SDLSurface( 2813): Create egl context
W/SDLSurface( 2813): Create egl surface
W/SDLSurface( 2813): Done
D/dalvikvm( 2813): GC_FOR_ALLOC freed 85K, 8% free 6053K/6531K, paused 18ms, total 19ms
I/ActivityManager( 266): Displayed ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity: +334ms
I/dalvikvm-heap( 2813): Grow heap (frag case) to 6.692MB for 524304-byte allocation
V/TabletStatusBar( 363): setLightsOn(true)
D/dalvikvm( 2813): GC_CONCURRENT freed 1K, 8% free 6563K/7111K, paused 24ms+23ms, total 59ms
D/dalvikvm( 2813): GC_FOR_ALLOC freed <1K, 8% free 6563K/7111K, paused 15ms, total 15ms
I/dalvikvm-heap( 2813): Grow heap (frag case) to 7.191MB for 524304-byte allocation
D/dalvikvm( 2813): WAIT_FOR_CONCURRENT_GC blocked 65ms
D/dalvikvm( 2813): GC_FOR_ALLOC freed 0K, 8% free 7075K/7687K, paused 26ms, total 26ms
D/dalvikvm( 2813): WAIT_FOR_CONCURRENT_GC blocked 89ms
D/dalvikvm( 2813): GC_CONCURRENT freed 1K, 8% free 7080K/7687K, paused 12ms+13ms, total 59ms
I/libSDL ( 2813): Physical screen resolution is 1280x672
I/python ( 2813): Initialize Python for Android
I/ActivityManager( 266): No longer want larry.zou.colorfullife (pid 2015): hidden #16
I/python ( 2813): ['/data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/site-packages', '/data/data/ez.tools.xyzcontroller.app/files/lib/site-python']
I/python ( 2813): Android path ['/data/data/ez.tools.xyzcontroller.app/files/lib/python27.zip', '/data/data/ez.tools.xyzcontroller.app/files/lib/python2.7', '/data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/lib-dynload', '/data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/site-packages', '/mnt/sdcard/ez.tools.xyzcontroller.app']
I/python ( 2813): Android kivy bootstrap done. name is main
I/python ( 2813): Run user program, change dir and execute main.py
I/python ( 2813): [ [1;32mINFO [0m ] Kivy v1.6.1-dev
I/python ( 2813): [ [1;32mINFO [0m ] [Logger ] Record log in /mnt/sdcard/ez.tools.xyzcontroller.app/.kivy/logs/kivy_13-05-03_4.txt
I/python ( 2813): [ [1;32mINFO [0m ] [Factory ] 140 symbols loaded
D/dalvikvm( 648): GC_CONCURRENT freed 264K, 12% free 6373K/7175K, paused 12ms+3ms, total 60ms
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.image> with limit=None, timeout=60s
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
I/python ( 2813): /data/data/ez.tools.xyzcontroller.app/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:11: RuntimeWarning: import cdrom: No module named cdrom
I/python ( 2813): (ImportError: No module named cdrom)
I/python ( 2813): [ [1;32mINFO [0m ] [Image ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.shader> with limit=1000, timeout=3600s
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
I/python ( 2813): [ [1;36mDEBUG [0m ] [Audio ] register SoundPygame
I/python ( 2813): [ [1;32mINFO [0m ] [Audio ] Providers: audio_pygame (audio_gstreamer, audio_sdl ignored)
I/python ( 2813): [ [1;32mINFO [0m ] [Text ] Provider: pygame
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <kv.loader> with limit=500, timeout=60s
I/python ( 2813): [ [1;32mINFO [0m ] [Loader ] using a thread pool of 2 workers
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <textinput.label> with limit=None, timeout=60.0s
I/python ( 2813): [ [1;36mDEBUG [0m ] [Cache ] register <textinput.width> with limit=None, timeout=60.0s
I/python ( 2813): Traceback (most recent call last):
I/python ( 2813): File "/home/yurij/Dropbox/Google Drive/Ez/Git/xyzcontroller/newest/mainApp/main.py", line 28, in
I/python ( 2813): File "/home/yurij/Dropbox/Google Drive/Ez/Git/xyzcontroller/newest/mainApp/controllers.py", line 11, in
I/python ( 2813): File "/home/yurij/Dropbox/Google Drive/Ez/Git/xyzcontroller/newest/mainApp/loggers.py", line 132, in
I/python ( 2813): File "/home/yurij/Dropbox/Google Drive/Ez/Git/xyzcontroller/newest/mainApp/loggers.py", line 41, in init
I/python ( 2813): File "/home/yurij/python-for-android/python-for-android/python-for-android/build/python-install/lib/python2.7/logging/handlers.py", line 171, in init
I/python ( 2813): File "/home/yurij/python-for-android/python-for-android/python-for-android/build/python-install/lib/python2.7/logging/handlers.py", line 65, in init
I/python ( 2813): File "/home/yurij/python-for-android/python-for-android/python-for-android/build/python-install/lib/python2.7/logging/init.py", line 893, in init
I/python ( 2813): File "/home/yurij/python-for-android/python-for-android/python-for-android/build/python-install/lib/python2.7/logging/init.py", line 912, in _open
I/python ( 2813): IOError: [Errno 20] Not a directory: '/data/data/ez.tools.xyzcontroller.app/files/lib/python27.zip/logs/program.log'
I/python ( 2813): Python for android ended.
I/AndroidRuntime( 2813): VM exiting with result code 0, cleanup skipped.
W/InputDispatcher( 266): channel '4266ba98 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
E/InputDispatcher( 266): channel '4266ba98 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
W/InputDispatcher( 266): Attempted to unregister already unregistered input channel '4266ba98 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity (server)'
I/WindowState( 266): WIN DEATH: Window{4266ba98 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity paused=false}
I/ActivityManager( 266): Process ez.tools.xyzcontroller.app:python (pid 2813) has died.
W/WindowManager( 266): Force-removing child win Window{427d6a30 SurfaceView paused=false} from container Window{4266ba98 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity paused=false}
W/ActivityManager( 266): Force removing ActivityRecord{428c3d10 ez.tools.xyzcontroller.app/org.renpy.android.PythonActivity}: app died, no saved state
D/dpt ( 266): setPerformanceMode: 2 ;value: 133

@tito
Copy link
Member

tito commented May 3, 2013

You are trying to open a logfile (program.log) in a wrong directory:

/data/data/ez.tools.xyzcontroller.app/files/lib/**python27.zip**/logs/program.log'
-> python27.zip is not a directory, but a real zipfile :)

You could use App.get_user_dir: http://kivy.org/docs/api-kivy.app.html#kivy.app.App.user_data_dir

@tito tito closed this as completed May 3, 2013
@yurkomik
Copy link
Author

yurkomik commented May 3, 2013

THANK'S.
I used "logfile = sys.path[0]+'/logs/program.log'" in my code. Somehow it decided to put it inside zip )))

@yurkomik
Copy link
Author

yurkomik commented May 3, 2013

Hm..I still have small error: logfile = App.user_data_dir+'/logs/program.log',
TypeError: unsupported operand type(s) for +: 'property' and 'str'
App.user_data_dir returns property object at 0xa1646e4 not path..
how to retrive path from this property object?

@tito
Copy link
Member

tito commented May 3, 2013

App is the class, you need the class instance. Use self if you are in your app class build() method, or use App.get_running_app().user_data_dir.

@yurkomik
Copy link
Author

yurkomik commented May 3, 2013

Can I use this method inside loggers.py? I get "'NoneType' object has no attribute 'user_data_dir'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants