I've found a simple fix for the issue.

--------
After line 901, add line (properly indented):
readfile = True

After line 905, add line (properly indented):
readfile = False

Alter line 1003 to say (properly indented):
if lextab and optimize and not readfile:
---------

I'd submit a patch but the developer doesn't seem that active.

On Aug 26, 4:08 pm, Pavel Panchekha <[email protected]> wrote:
> Hmm, after taking a while to look through all of these, none actually
> address the fundamental issue I'm talking about.
> It's not that I need help writing out the tables, that's fine. I just
> need to stop lex.py from trying to write the lextab file, even in
> optimize mode.
>
> On Aug 20, 2:03 am, "D.Hendriks (Dennis)" <[email protected]> wrote:
>
> > Hello Pavel,
>
> > A quick search resulted in these earlier discussions, which may be of
> > interest to you:
>
> >http://groups.google.com/group/ply-hack/browse_frm/thread/a799e10f9c2...
>
> > These earlier discussions deal among others with disabling table files
> > alltogether.
>
> > The last one is an earlier post that I once posted. It is about
> > PlyWrapper, a wrapper around Ply that takes care of table files and has
> > functionality for generating them on command, which I use in my project
> > to write tables during installation, at which time the appropriate
> > rights are available.
>
> > Best,
> > Dennis
>
> > Pavel Panchekha wrote:
> > > Both the parser and the lexer attempt to write out parse tables each
> > > time they are run, if they have been told to do so.
>
> > > If an application that uses ply is installed in an area only root can
> > > write to, this will cause the application to crash.
>
> > > I'm currently using the following hacky fix:
>
> > > Wrap line 176 in lex.py with
>
> > >   try:
> > >     # line 176
> > >   except IOError:
> > >     pass
>
> > > Wrap line 2549 in yacc.py with
>
> > >   try:
> > >     # line 2549
> > >   except IOError:
> > >     pass
>
> > > This removed annoying error messages and program crashes.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ply-hack" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ply-hack?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to