Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
46784659
Commit
46784659
authored
10 years ago
by
Olivier Dony
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] ir.attachment: include traceback when logging low-level filesystem errors
parent
bce4e227
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openerp/addons/base/ir/ir_attachment.py
+4
-4
4 additions, 4 deletions
openerp/addons/base/ir/ir_attachment.py
with
4 additions
and
4 deletions
openerp/addons/base/ir/ir_attachment.py
+
4
−
4
View file @
46784659
...
...
@@ -123,7 +123,7 @@ class ir_attachment(osv.osv):
else
:
r
=
open
(
full_path
,
'
rb
'
).
read
().
encode
(
'
base64
'
)
except
IOError
:
_logger
.
e
rror
(
"
_read_file reading %s
"
,
full_path
)
_logger
.
e
xception
(
"
_read_file reading %s
"
,
full_path
)
return
r
def
_file_write
(
self
,
cr
,
uid
,
value
):
...
...
@@ -134,7 +134,7 @@ class ir_attachment(osv.osv):
with
open
(
full_path
,
'
wb
'
)
as
fp
:
fp
.
write
(
bin_value
)
except
IOError
:
_logger
.
e
rror
(
"
_file_write writing %s
"
,
full_path
)
_logger
.
e
xception
(
"
_file_write writing %s
"
,
full_path
)
return
fname
def
_file_delete
(
self
,
cr
,
uid
,
fname
):
...
...
@@ -144,10 +144,10 @@ class ir_attachment(osv.osv):
try
:
os
.
unlink
(
full_path
)
except
OSError
:
_logger
.
e
rror
(
"
_file_delete could not unlink %s
"
,
full_path
)
_logger
.
e
xception
(
"
_file_delete could not unlink %s
"
,
full_path
)
except
IOError
:
# Harmless and needed for race conditions
_logger
.
e
rror
(
"
_file_delete could not unlink %s
"
,
full_path
)
_logger
.
e
xception
(
"
_file_delete could not unlink %s
"
,
full_path
)
def
_data_get
(
self
,
cr
,
uid
,
ids
,
name
,
arg
,
context
=
None
):
if
context
is
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment