Merge lp:~vauxoo/openobject-server/trunk-bug1076541 into lp:openobject-server

Proposed by Nhomar - Vauxoo
Status: Needs review
Proposed branch: lp:~vauxoo/openobject-server/trunk-bug1076541
Merge into: lp:openobject-server
Diff against target: 26 lines (+5/-3)
1 file modified
openerp/tools/misc.py (+5/-3)
To merge this branch: bzr merge lp:~vauxoo/openobject-server/trunk-bug1076541
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Pending
Raphaël Valyi - http://www.akretion.com Pending
OpenERP R&D Team approve Pending
Review via email: mp+133564@code.launchpad.net

Commit message

Thanks to make mistakes we discover hidden bugs, i am fixing an old bug here related to bad manage of path without correct verifications.

Description of the change

Hello.

Reimplementation of a little feature that i think will bring more solid behaviour.

BUg #1076541 explain in what situation it was braking the server.

THanks.

To post a comment you must log in.
4549. By Nhomar - Vauxoo

[FIX] Secon part of the bug incorrect name passed to logger.

Unmerged revisions

4549. By Nhomar - Vauxoo

[FIX] Secon part of the bug incorrect name passed to logger.

4548. By Nhomar - Vauxoo

[REF] Implementing split based on os lib and not in string management

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/tools/misc.py'
2--- openerp/tools/misc.py 2012-10-24 16:15:27 +0000
3+++ openerp/tools/misc.py 2012-11-08 21:38:20 +0000
4@@ -141,9 +141,11 @@
5 # Is it below 'addons_path' or 'root_path'?
6 name = os.path.normcase(os.path.normpath(name))
7 for root in adps + [rtp]:
8- if name.startswith(root):
9+ abspathmodule = os.path.split(name)[0]
10+ abspath = os.path.split(abspathmodule)[0]
11+ if os.path.samefile(abspath,root):
12 base = root.rstrip(os.sep)
13- name = name[len(base) + 1:]
14+ name = os.path.relpath(name,abspath)
15 break
16 else:
17 # It is outside the OpenERP root: skip zipfile lookup.
18@@ -218,7 +220,7 @@
19 # Not found
20 if name.endswith('.rml'):
21 raise IOError('Report %r doesn\'t exist or deleted' % basename)
22- raise IOError('File not found: %s' % basename)
23+ raise IOError('File not found: %s' % name)
24
25
26 #----------------------------------------------------------