Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
74188108
Commit
74188108
authored
Jul 03, 2011
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused rPickly module
parent
360d8872
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
src/OFS/rPickle.py
src/OFS/rPickle.py
+0
-42
No files found.
src/OFS/rPickle.py
deleted
100644 → 0
View file @
360d8872
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Restricted unpickler
"""
import
pickle
reg
=
{}
class
Unpickler
(
pickle
.
Unpickler
):
def
find_class
(
self
,
module
,
name
):
try
:
return
reg
[(
module
,
name
)]
except
:
raise
SystemError
,
'Class not registered'
def
load_string
(
self
):
raise
pickle
.
UnpicklingError
,
'Bad pickle: Non binstring'
# Public interface
from
cStringIO
import
StringIO
def
loads
(
s
):
"""Unpickle a string"""
return
Unpickler
(
StringIO
(
s
)).
load
()
def
register
(
mod
,
cls
,
obj
):
"""Register a class"""
reg
[(
mod
,
cls
)]
=
obj
def
unregister
(
mod
,
cls
):
"""Unregister a class"""
del
reg
[(
mod
,
cls
)]
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