Menu

#4 WinXP home path resolving error

open
nobody
None
5
2005-12-12
2005-12-12
Anonymous
No

On my WinXP box resolving path to home directory is not
working. I mean:

When I ran log4py-test.py i got an error not finding a
file:
F:\My Downloads\Programowanko\Skrypty\Python\biblioteki
mniej wazne\log4py-1.3>log4py-test.py
.

Here is a path-candidate :). It works for me.
class FileAppender:
def __init__(self, filename, rotation =
ROTATE_NONE):
""" **(private)** Class initalization &
customization. """

import string
#self.__FileAppender_filename = sub("\$HOME",
get_homedirectory(), filename)
self.__FileAppender_filename = string.
replace(filename,'$HOME',get_homedirectory() )

Thanks

-- Here is error report
F:\My Downloads\Programowanko\Skrypty\Python\biblioteki
mniej wazne\log4py-1.3>log4py-test.py
Settings from log4py.conf

12.12.2005 10:03:50.281 ERROR log4pytest [run] - error
12.12.2005 10:03:50.296 WARNING log4pytest [run] - warn
12.12.2005 10:03:50.296 INFO log4pytest [run] - info
12.12.2005 10:03:50.296 DEBUG log4pytest [run] - debug

Normal level - Long format (written to $HOME/log4py-
test.log)
Traceback (most recent call last):
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py-test.py", line 29, in ?
mytest.run()
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py-test.py", line 14, in run
self.log4py.error("error")
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py.py", line 349, in error
self.__Logger_showmessage(message, MSG_ERROR)
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py.py", line 524, in __Logger
_showmessage
target.writeline(line)
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py.py", line 593, in writelin
e
self.write("%s\n" % text)
File "F:\My
Downloads\Programowanko\Skrypty\Python\biblioteki mniej
wazne\log4py-1.3\log4py.py", line 587, in write
file = open(self.__FileAppender_filename, "a")
IOError: [Errno 2] No such file or directory: 'C:
\\Documents and Settings\teko/log4py-test.log'

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.