[ZPT] External Method IOError problem ... is this wrong to do?

Steve Spicklemire steve@spvi.com
Thu, 9 Aug 2001 06:45:29 -0500


Hi Lynn,

	Can you post the whole traceback?

thanks,
-steve

On Wednesday, August 8, 2001, at 09:08 PM, waltonl wrote:

> I have an external method that get's called in my main zpt in which I
> use a  multiline string (enclosed in """'s) as a global variable and
> then I parse it line by line using
> StringIO - so the jist of the file contents and it's usage is something
> like this:
> ---------------
> global mainMenu = """
> lot's of lines of content.in here........
> that get parsed using StringIO
> .........
> etc
> """
>
> def buildMainMenu()
>     global mainMenu
>     menuTree = build3LevelMenuTree(mainMenu)
>     ...
>     etc
>
> def build3LevelMenuTree(menuStr):
>     menuTree = []
>     menufile = StringIO.StringIO(menuStr)
>     for line in menufile.readlines():
>           .... do some stuff in here that based on value of line appends
> different things to menuTree list
>    menufile.close()
>     return menuTree
> --------------------------------
> This external method is called from a
>
> Problem is that I'm experiencing an intermittent problem of getting Zope
> has encountered an error while publishing this resource.
>                Error Type: IOError
>                Error Value: [Errno 5] I/O error
>
> This is happening even when I'm the only one developing and testing so
> it doesn't seem like it would be a multithreaded/synchronization
> issue???
>
> Have I done something wrong in coding it this way? Should I be able to
> do something like this?
>
> Thanks,
> Lynn
>
>
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt