2009-08-07, 10:20
Hi there
I have some problems dealing with file within XBMC.
Here is the simple test code used :
if the file doesn't exists, I got that:
And if it exists :
I sould add that it works perfectly outside of XBMC, with python 2.4.5
I really don't know in what direction looking.
Doesn't anybody can guide me ?
I have some problems dealing with file within XBMC.
Here is the simple test code used :
Code:
import os
f=open('C:\\test.txt','a+')
f.write("just writing something")
f.close()
if the file doesn't exists, I got that:
Code:
10:14:40 T:4544 M:2026455040 NOTICE: Traceback (most recent call last):
10:14:40 T:4544 M:2026450944 NOTICE: File "C:\Program Files\XBMC\scripts\amc2offline\default.py", line 3, in ?
10:14:40 T:4544 M:2026450944 NOTICE:
10:14:40 T:4544 M:2026450944 NOTICE: f=open('C:\\test.txt','a+')
10:14:40 T:4544 M:2026450944 NOTICE: IOError
10:14:40 T:4544 M:2026450944 NOTICE: :
10:14:40 T:4544 M:2026450944 NOTICE: invalid mode: a+
10:14:40 T:4544 M:2026450944 NOTICE:
10:14:40 T:4544 M:2026442752 ERROR: Scriptresult: Error
And if it exists :
Code:
10:17:23 T:3740 M:2022776832 DEBUG: XBPyThread::Process - The source file to load is special://home/scripts/amc2offline/default.py
10:17:23 T:3740 M:2022756352 DEBUG: XBPyThread::Process - Setting the Python path to C:\Program Files\XBMC\scripts\amc2offline;special://xbmc/system/python/python24.zlib;special://xbmc/system/python/DLLs;special://xbmc/system/python/Lib;special://xbmc/system/python/spyce
10:17:23 T:3740 M:2022756352 DEBUG: XBPyThread::Process - Entering source directory C:\Program Files\XBMC\scripts\amc2offline
10:17:23 T:3760 M:2022735872 DEBUG: CFileItemList::Sort, sorting took 0 millis
10:17:23 T:3740 M:2022727680 NOTICE: Traceback (most recent call last):
10:17:23 T:3740 M:2022731776 NOTICE: File "C:\Program Files\XBMC\scripts\amc2offline\default.py", line 4, in ?
10:17:23 T:3740 M:2022731776 NOTICE:
10:17:23 T:3740 M:2022731776 NOTICE: f.write("just writing something")
10:17:23 T:3740 M:2022731776 NOTICE: IOError
10:17:23 T:3740 M:2022731776 NOTICE: :
10:17:23 T:3740 M:2022731776 NOTICE: (0, 'Error')
10:17:23 T:3740 M:2022731776 NOTICE:
10:17:23 T:3740 M:2022731776 ERROR: Scriptresult: Error
I sould add that it works perfectly outside of XBMC, with python 2.4.5
I really don't know in what direction looking.
Doesn't anybody can guide me ?