Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
bd80869d
Commit
bd80869d
authored
Sep 26, 2008
by
Benji York
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a small bug in the file locking error logging
parent
edbbc85d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
NEWS.txt
NEWS.txt
+3
-0
src/ZODB/lock_file.py
src/ZODB/lock_file.py
+3
-1
src/ZODB/lock_file.txt
src/ZODB/lock_file.txt
+7
-1
No files found.
NEWS.txt
View file @
bd80869d
...
@@ -4,6 +4,9 @@ Whats new in ZODB 3.8.1
...
@@ -4,6 +4,9 @@ Whats new in ZODB 3.8.1
Bugs Fixed:
Bugs Fixed:
- (beta 9) An exception would be raised when an error occured attempting to
lock a file and logging of said error was enabled.
- (beta 9) Fixed a bug to allow opening of deep-copied blobs.
- (beta 9) Fixed a bug to allow opening of deep-copied blobs.
- (beta 9) Fixed bug #189542 by prepending the module to an undefined name.
- (beta 9) Fixed bug #189542 by prepending the module to an undefined name.
...
...
src/ZODB/lock_file.py
View file @
bd80869d
...
@@ -82,7 +82,9 @@ class LockFile:
...
@@ -82,7 +82,9 @@ class LockFile:
fp
.
seek
(
1
)
fp
.
seek
(
1
)
pid
=
fp
.
read
().
strip
()[:
20
]
pid
=
fp
.
read
().
strip
()[:
20
]
fp
.
close
()
fp
.
close
()
logger
.
exception
(
"Error locking file"
,
path
,
pid
)
if
not
pid
:
pid
=
'UNKNOWN'
logger
.
exception
(
"Error locking file %s; pid=%s"
,
path
,
pid
)
raise
raise
self
.
_fp
=
fp
self
.
_fp
=
fp
...
...
src/ZODB/lock_file.txt
View file @
bd80869d
...
@@ -9,14 +9,20 @@ LockFile object with a file name:
...
@@ -9,14 +9,20 @@ LockFile object with a file name:
>>> import ZODB.lock_file
>>> import ZODB.lock_file
>>> lock = ZODB.lock_file.LockFile('lock')
>>> lock = ZODB.lock_file.LockFile('lock')
If we try to lock the same name, we'll get a lock error:
If we try to lock the same name, we'll get a lock error
and it will be logged
:
>>> import ZODB.tests.loggingsupport
>>> handler = ZODB.tests.loggingsupport.InstalledHandler('ZODB.lock_file')
>>> try:
>>> try:
... ZODB.lock_file.LockFile('lock')
... ZODB.lock_file.LockFile('lock')
... except ZODB.lock_file.LockError:
... except ZODB.lock_file.LockError:
... print "Can't lock file"
... print "Can't lock file"
Can't lock file
Can't lock file
>>> for record in handler.records:
... print record.levelname, record.getMessage()
ERROR Error locking file lock; pid=UNKNOWN
To release the lock, use it's close method:
To release the lock, use it's close method:
>>> lock.close()
>>> lock.close()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment