Odd error

Joshua.R.English at gmail.com Joshua.R.English at gmail.com
Sat Mar 17 14:32:57 EDT 2007


I installed it using the regular download form python.org.  I went
back and did a lot of testing with the file, commenting out most of
it, seeing what would actually run, and it seems I had a normal
semantic error:

self.data(one).append(item)

and data is in fact a dictionary, not a callable object.  What gets me
is the massive red herring this error is.  I wasn't doing anything
with ntpath in the script.  The script selectively extracts
information from an XML file, that's all.

Thanks,

Josh

On Mar 17, 2:30 am, "John Machin" <sjmac... at lexicon.net> wrote:
>
> The following demonstrate the correct behaviour of ntpath.split():
>
> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.>>> import ntpath
> >>> ntpath.split('foo\\\\')
> ('foo', '')
> >>> ntpath.split('foo\\\\bar\\\\')
> ('foo\\\\bar', '')
> >>> ntpath.split('foo\\\\bar')
> ('foo', 'bar')
> >>> ntpath.split('foo\\bar')
> ('foo', 'bar')
> >>> ntpath.split('\\\\bar')
>
> ('\\\\', 'bar')
>
> I can't see how this error could arise from the line:
> while head2 and head2[-1] in '/\\':
> The only possible iterable is the constant '/\\' ...
>
> You may have a corrupt Python 2.5 installation; try the above tests;
> if one fails, delete any ntpath.pyc and/or ntpath.pyo and try again.
>
> I'm suspicious of the 'lib' directory name; standard Python
> installations on Windows call the directory 'Lib' AFAIK; how did you
> install Python?
>
> HTH,
> John





More information about the Python-list mailing list