python DisplayDict problems

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

python DisplayDict problems

Joel_Rivard

Good Morning,

 

I’m having some problems running the Display.Dict Python in SPSS 17.  A few weeks ago, I created an SPSS file using syntax and a data file and ran the standard script (see below) to create my dictionary.  Everything worked great.  I’ve now created another SPSS file using the same method as before, but when I run the standard script to create my dictionary, SPSS hangs up and closes unexpectedly.  I also sometimes get an error message in the output (see below).  Why would the script create my dictionary with some SPSS files but then hang up other times?  I’m using the latest DisplayDict.py and spssaux.py files from the web and the SPSS files aren’t on any network. I’ve applied the 2 hot fixes for 17, but have not installed the new patch (17.0.1).

 

Standard Script:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

 

Error Message:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "C:\Python25\lib\site-packages\DisplayDict.py", line 185, in dictionary

    xml.sax.parseString(spss.GetXmlUtf16(tag).encode("utf-16"), handler)

  File "C:\Python25\Lib\xml\sax\__init__.py", line 49, in parseString

    parser.parse(inpsrc)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 107, in parse

    xmlreader.IncrementalParser.parse(self, source)

  File "C:\Python25\Lib\xml\sax\xmlreader.py", line 123, in parse

    self.feed(buffer)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 211, in feed

    self._err_handler.fatalError(exc)

  File "C:\Python25\Lib\xml\sax\handler.py", line 38, in fatalError

    raise exception

xml.sax._exceptions.SAXParseException: <unknown>:1:51318: not well-formed (invalid token)

 

                         

Joël Rivard

GIS/Data Technician

Maps, Data & Government Information Centre

Carleton University Library

(613) 520-2600 ext.1685

[hidden email]

 

Reply | Threaded
Open this post in threaded view
|

Re: python DisplayDict problems

Peck, Jon

I would need to see the file to diagnose this.  If you want to send a non-confidential file to [hidden email], I'll take a look.  From the traceback, it looks like the xml representation of the variable dictionary is coming through to the DisplayDict module incorrectly.  There was a bug in that area that was fixed in 17.0.1.

 

However, in V17, you might prefer to use the new standard CODEBOOK command, which behaves quite similarly to the earlier command.

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joel_Rivard
Sent: Friday, January 30, 2009 8:44 AM
To: [hidden email]
Subject: [SPSSX-L] python DisplayDict problems

 

Good Morning,

 

I’m having some problems running the Display.Dict Python in SPSS 17.  A few weeks ago, I created an SPSS file using syntax and a data file and ran the standard script (see below) to create my dictionary.  Everything worked great.  I’ve now created another SPSS file using the same method as before, but when I run the standard script to create my dictionary, SPSS hangs up and closes unexpectedly.  I also sometimes get an error message in the output (see below).  Why would the script create my dictionary with some SPSS files but then hang up other times?  I’m using the latest DisplayDict.py and spssaux.py files from the web and the SPSS files aren’t on any network. I’ve applied the 2 hot fixes for 17, but have not installed the new patch (17.0.1).

 

Standard Script:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

 

Error Message:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "C:\Python25\lib\site-packages\DisplayDict.py", line 185, in dictionary

    xml.sax.parseString(spss.GetXmlUtf16(tag).encode("utf-16"), handler)

  File "C:\Python25\Lib\xml\sax\__init__.py", line 49, in parseString

    parser.parse(inpsrc)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 107, in parse

    xmlreader.IncrementalParser.parse(self, source)

  File "C:\Python25\Lib\xml\sax\xmlreader.py", line 123, in parse

    self.feed(buffer)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 211, in feed

    self._err_handler.fatalError(exc)

  File "C:\Python25\Lib\xml\sax\handler.py", line 38, in fatalError

    raise exception

xml.sax._exceptions.SAXParseException: <unknown>:1:51318: not well-formed (invalid token)

 

                         

Joël Rivard

GIS/Data Technician

Maps, Data & Government Information Centre

Carleton University Library

(613) 520-2600 ext.1685

[hidden email]

 

Reply | Threaded
Open this post in threaded view
|

Re: python DisplayDict problems

Joel_Rivard

Thanks for the response Jon,

 

I think I’ll try installing the patch first and then see what happens.  Hopefully that will fix things up with my problem.

 

As for the CODEBOOK command in SPSS 17, I have tried it but still much prefer the layout of the python generated dictionary.

Thanks,

Joel

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Peck, Jon
Sent: January 30, 2009 11:20 AM
To: [hidden email]
Subject: Re: python DisplayDict problems

 

I would need to see the file to diagnose this.  If you want to send a non-confidential file to [hidden email], I'll take a look.  From the traceback, it looks like the xml representation of the variable dictionary is coming through to the DisplayDict module incorrectly.  There was a bug in that area that was fixed in 17.0.1.

 

However, in V17, you might prefer to use the new standard CODEBOOK command, which behaves quite similarly to the earlier command.

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Joel_Rivard
Sent: Friday, January 30, 2009 8:44 AM
To: [hidden email]
Subject: [SPSSX-L] python DisplayDict problems

 

Good Morning,

 

I’m having some problems running the Display.Dict Python in SPSS 17.  A few weeks ago, I created an SPSS file using syntax and a data file and ran the standard script (see below) to create my dictionary.  Everything worked great.  I’ve now created another SPSS file using the same method as before, but when I run the standard script to create my dictionary, SPSS hangs up and closes unexpectedly.  I also sometimes get an error message in the output (see below).  Why would the script create my dictionary with some SPSS files but then hang up other times?  I’m using the latest DisplayDict.py and spssaux.py files from the web and the SPSS files aren’t on any network. I’ve applied the 2 hot fixes for 17, but have not installed the new patch (17.0.1).

 

Standard Script:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

 

Error Message:

begin program.

import spss, DisplayDict

DisplayDict.dictionary()

end program.

Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "C:\Python25\lib\site-packages\DisplayDict.py", line 185, in dictionary

    xml.sax.parseString(spss.GetXmlUtf16(tag).encode("utf-16"), handler)

  File "C:\Python25\Lib\xml\sax\__init__.py", line 49, in parseString

    parser.parse(inpsrc)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 107, in parse

    xmlreader.IncrementalParser.parse(self, source)

  File "C:\Python25\Lib\xml\sax\xmlreader.py", line 123, in parse

    self.feed(buffer)

  File "C:\Python25\Lib\xml\sax\expatreader.py", line 211, in feed

    self._err_handler.fatalError(exc)

  File "C:\Python25\Lib\xml\sax\handler.py", line 38, in fatalError

    raise exception

xml.sax._exceptions.SAXParseException: <unknown>:1:51318: not well-formed (invalid token)

 

                         

Joël Rivard

GIS/Data Technician

Maps, Data & Government Information Centre

Carleton University Library

(613) 520-2600 ext.1685

[hidden email]