Ticket #26 (closed defect: wontfix)
error when openening mvs file for writing
| Reported by: | ftputiluser | Owned by: | schwa |
|---|---|---|---|
| Priority: | minor | Milestone: | never |
| Component: | Library | Version: | 2.2.3 |
| Keywords: | mvs, root directory, absolute path, stat cache | Cc: |
Description (last modified by schwa) (diff)
When trying to open a file on a mvs-host for writing with the following commands
>>> from ftputil import *
>>> datei = FTPHost("hostname", "username", "password").open("versuch", "w")
I get the following traceback:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
datei = FTPHost("hostname", "username", "password").open("versuch", "w")
File "C:\Program Files\Python25\lib\site-packages\ftputil\ftputil.py", line 230, in open
return self.file(path, mode)
File "C:\Program Files\Python25\lib\site-packages\ftputil\ftputil.py", line 225, in file
self.stat_cache.invalidate(effective_path)
File "C:\Program Files\Python25\Lib\site-packages\ftputil\ftp_stat_cache.py", line 128, in invalidate
assert path.startswith("/"), "%s must be an absolute path" % path
AssertionError: 'username.'/versuch must be an absolute path
There is no problem to open a (existing) file with the above commandline for reading. The problem seems to be the naming convention on mvs systems where no root directory called / exists. There ist an ugly workaround for this problem:
datei = FTPHost("hostname", "username", "password").open("/'username.versuch'", "w")
forces the / to be the first character of the filename which is required by ftp_stat_cache.py.
Change History
Note: See
TracTickets for help on using
tickets.
