Odoo Help


This community 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.


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

Nehemias Herrera
on 1/28/15, 6:25 PM 1,479 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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