Odoo Help


IOError: [Errno 13] Permission denied: 'parser.out'

Nehemias Herrera
on 1/28/15, 6:25 PM 2,546 views

I am trying to use the python libraries mechanize (http://wwwsearch.sourceforge.net/mechanize/) and PLY (Python Lex-Yacc, http://www.dabeaz.com/ply/) in my model when an onchange event gets fired, mechanize fetchs some html documents that PLY parses afterwards, but I am getting the following error from PLY

Traceback (most recent call last): File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 500, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 517, in dispatch result = self._call_function(**self.params) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 283, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 280, in checked_call return self.endpoint(*a, **kw) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 733, in __call__ return self.method(*args, **kw) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/http.py", line 376, in response_wrap response = f(*args, **kw) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/addons/web/controllers/main.py", line 948, in call_kw return self._call_kw(model, method, args, kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/addons/web/controllers/main.py", line 940, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/api.py", line 360, in old_api result = method(recs, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/models.py", line 5727, in onchange record._onchange_eval(name, field_onchange[name], result) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/models.py", line 5661, in _onchange_eval method_res = getattr(self._model, method)(*args) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/api.py", line 237, in wrapper return old_api(self, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/api.py", line 360, in old_api result = method(recs, *args, **kwargs) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/addons/uccart/ticos/ticos.py", line 224, in onchange_cedula p = obtenerPersona(str(cedula)) File "/opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/addons/uccart/ticos/ticos.py", line 196, in obtenerPersona yacc.yacc() File "/opt/bitnami/python/lib/python2.7/site-packages/ply-3.4-py2.7.egg/ply/yacc.py", line 3091, in yacc debuglog = PlyLogger(open(debugfile,"w")) IOError: [Errno 13] Permission denied: 'parser.out'

Which I believe is due to my non-root user not beign able to write to the parser.out file, my question then would be, how can I solve this ? mechanize's code gets executed succesfully but PLY's isnt.

My model:

# -*- coding: utf-8 -*-
from openerp import fields
from openerp import models
from openerp import api

import ply.lex as lex
import ply.yacc as yacc
import mechanize, re, sys

from collections import namedtuple
Persona = namedtuple("Persona", "nombre_completo numero_de_cedula nombre_del_padre numero_de_cedula_del_padre nombre_de_la_madre numero_de_cedula_de_la_madre")

def consulta_cedula(cedula):

    b = mechanize.Browser()
    ... do something with mechanize and return it

def obtenerPersona(cedula):

    ... do something with PLY and return it

class Ticos (models.Model):
    _name = 'ticos'

    cedula = fields.Integer(string='Número de cédula', required=True)
    name = fields.Char(string='Nombre')

    def onchange_cedula(self, cedula):
        nombre = 'Identificación Inválida'
        if(len(str(cedula)) == 9):
            codigoHTML = consulta_cedula(str(cedula))
            p = obtenerPersona(codigoHTML)
            nombre = p.nombre_completo
        return {'value': {'name': nombre}}

is the user the odoo-server is running, also the owner of the files?

Martin Temmink
on 1/30/15, 7:22 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/28/15, 6:25 PM
Seen: 2546 times
Last updated: 3/16/15, 8:10 AM