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
257fed3f
Commit
257fed3f
authored
Mar 02, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3.2: don't rely on binascii.unhexlify to convert under covers.
parent
fd0d2b04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
src/ZODB/blob.py
src/ZODB/blob.py
+1
-1
src/ZODB/utils.py
src/ZODB/utils.py
+3
-1
No files found.
src/ZODB/blob.py
View file @
257fed3f
...
...
@@ -557,7 +557,7 @@ class BushyLayout(object):
def
path_to_oid
(
self
,
path
):
if
self
.
blob_path_pattern
.
match
(
path
)
is
None
:
raise
ValueError
(
"Not a valid OID path: `%s`"
%
path
)
path
=
path
.
split
(
os
.
path
.
sep
)
path
=
[
bytes
(
x
,
'ascii'
)
for
x
in
path
.
split
(
os
.
path
.
sep
)]
# Each path segment stores a byte in hex representation. Turn it into
# an int and then get the character for our byte string.
oid
=
b''
.
join
(
binascii
.
unhexlify
(
byte
[
2
:])
for
byte
in
path
)
...
...
src/ZODB/utils.py
View file @
257fed3f
...
...
@@ -164,7 +164,9 @@ def oid_repr(oid):
return
repr
(
oid
)
def
repr_to_oid
(
repr
):
if
repr
.
startswith
(
"0x"
):
if
not
isinstance
(
repr
,
bytes
):
repr
=
bytes
(
repr
,
'ascii'
)
if
repr
.
startswith
(
b"0x"
):
repr
=
repr
[
2
:]
as_bin
=
unhexlify
(
repr
)
as_bin
=
b"
\
x00
"
*
(
8
-
len
(
as_bin
))
+
as_bin
...
...
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