Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp file handling #9

Open
brianray opened this issue Dec 7, 2015 · 0 comments
Open

temp file handling #9

brianray opened this issue Dec 7, 2015 · 0 comments

Comments

@brianray
Copy link

brianray commented Dec 7, 2015

Noticed when my installation tried to write to /usr/local/lib/python2.7/dist-packages/stat_parser/temp


Building the Grammar Model
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-29f6a952f468> in <module>()
      4 os.environ['DISPLAY'] = 'localhost:10.0'
      5 sent = "Each of us is full of shit in our own special way"
----> 6 parser = Parser()
      7 parser.parse(sent)
      8 tree = parser.parse(sent) # returns nltk Tree instance

/usr/local/lib/python2.7/dist-packages/stat_parser/parser.pyc in __init__(self, pcfg)
     78     def __init__(self, pcfg=None):
     79         if pcfg is None:
---> 80             pcfg = build_model()
     81 
     82         self.pcfg = pcfg

/usr/local/lib/python2.7/dist-packages/stat_parser/learn.pyc in build_model()
     26 
     27         if not exists(TEMP_DIR):
---> 28             makedirs(TEMP_DIR)
     29 
     30         # Normalise the treebanks

/usr/lib/python2.7/os.pyc in makedirs(name, mode)
    155         if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
    156             return
--> 157     mkdir(name, mode)
    158 
    159 def removedirs(name):

OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/stat_parser/temp'

Wouldn't it be better to use a https://docs.python.org/2/library/tempfile.html or something else?

Fixed by manually creating that file and chmod'ing it as work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant