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
3ca1aa5e
Commit
3ca1aa5e
authored
May 05, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetic changes from 1.5.1 plus change to format used to
non-binary pickle floats.
parent
d80cd1df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
lib/Components/cPickle/cPickle.c
lib/Components/cPickle/cPickle.c
+17
-17
No files found.
lib/Components/cPickle/cPickle.c
View file @
3ca1aa5e
/*
$Id: cPickle.c,v 1.5
0 1998/03/25 12:39:28
jim Exp $
$Id: cPickle.c,v 1.5
1 1998/05/05 14:56:54
jim Exp $
Copyright
...
...
@@ -55,7 +55,7 @@
static
char
cPickle_module_documentation
[]
=
"C implementation and optimization of the Python pickle module
\n
"
"
\n
"
"$Id: cPickle.c,v 1.5
0 1998/03/25 12:39:28
jim Exp $
\n
"
"$Id: cPickle.c,v 1.5
1 1998/05/05 14:56:54
jim Exp $
\n
"
;
#include "Python.h"
...
...
@@ -195,15 +195,14 @@ cPickle_PyMapping_HasKey(PyObject *o, PyObject *key) {
return
0
;
}
#define PyErr_Format PyErr_JFFormat
static
PyObject
*
#ifdef HAVE_STDARG_PROTOTYPES
/* VARARGS 2 */
PyErr_
Format
(
PyObject
*
ErrType
,
char
*
stringformat
,
char
*
format
,
...)
{
cPickle_Err
Format
(
PyObject
*
ErrType
,
char
*
stringformat
,
char
*
format
,
...)
{
#else
/* VARARGS */
PyErr_
Format
(
va_alist
)
va_dcl
{
cPickle_Err
Format
(
va_alist
)
va_dcl
{
#endif
va_list
va
;
PyObject
*
args
=
0
,
*
retval
=
0
;
...
...
@@ -721,7 +720,7 @@ whichmodule(PyObject *class_map, PyObject *global, PyObject *global_name) {
/*
if (!j) {
PyErr_
Format(PicklingError, "Could not find module for %s.",
cPickle_Err
Format(PicklingError, "Could not find module for %s.",
"O", global_name);
return NULL;
}
...
...
@@ -923,7 +922,7 @@ save_float(Picklerobject *self, PyObject *args) {
{
char
c_str
[
250
];
c_str
[
0
]
=
FLOAT
;
sprintf
(
c_str
+
1
,
"%.1
2
g
\n
"
,
x
);
sprintf
(
c_str
+
1
,
"%.1
7
g
\n
"
,
x
);
if
((
*
self
->
write_func
)(
self
,
c_str
,
strlen
(
c_str
))
<
0
)
return
-
1
;
...
...
@@ -1638,7 +1637,7 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
}
if
(
!
PyTuple_Check
(
t
))
{
PyErr_
Format
(
PicklingError
,
"Value returned by %s must "
cPickle_Err
Format
(
PicklingError
,
"Value returned by %s must "
"be a tuple"
,
"O"
,
__reduce__
);
goto
finally
;
}
...
...
@@ -1646,7 +1645,7 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
size
=
PyTuple_Size
(
t
);
if
((
size
!=
3
)
&&
(
size
!=
2
))
{
PyErr_
Format
(
PicklingError
,
"tuple returned by %s must "
cPickle_Err
Format
(
PicklingError
,
"tuple returned by %s must "
"contain only two or three elements"
,
"O"
,
__reduce__
);
goto
finally
;
}
...
...
@@ -1660,7 +1659,7 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
}
UNLESS
(
PyTuple_Check
(
arg_tup
)
||
arg_tup
==
Py_None
)
{
PyErr_
Format
(
PicklingError
,
"Second element of tuple "
cPickle_Err
Format
(
PicklingError
,
"Second element of tuple "
"returned by %s must be a tuple"
,
"O"
,
__reduce__
);
goto
finally
;
}
...
...
@@ -1676,7 +1675,7 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
}
*/
PyErr_
Format
(
PicklingError
,
"Cannot pickle %s objects."
,
cPickle_Err
Format
(
PicklingError
,
"Cannot pickle %s objects."
,
"O"
,
(
PyObject
*
)
type
);
finally:
...
...
@@ -2568,7 +2567,8 @@ Instance_New(PyObject *cls, PyObject *args) {
if
(
!
has_key
)
if
(
!
(
safe
=
PyObject_GetAttr
(
cls
,
__safe_for_unpickling___str
))
||
!
PyObject_IsTrue
(
safe
))
{
PyErr_Format
(
UnpicklingError
,
"%s is not safe for unpickling"
,
"O"
,
cls
);
cPickle_ErrFormat
(
UnpicklingError
,
"%s is not safe for unpickling"
,
"O"
,
cls
);
Py_XDECREF
(
safe
);
return
NULL
;
}
...
...
@@ -3527,7 +3527,7 @@ load(Unpicklerobject *self) {
continue
;
default:
PyErr_
Format
(
UnpicklingError
,
"invalid load key, '%s'."
,
cPickle_Err
Format
(
UnpicklingError
,
"invalid load key, '%s'."
,
"c"
,
s
[
0
]);
goto
err
;
}
...
...
@@ -3824,7 +3824,7 @@ noload(Unpicklerobject *self) {
continue
;
default:
PyErr_
Format
(
UnpicklingError
,
"invalid load key, '%s'."
,
cPickle_Err
Format
(
UnpicklingError
,
"invalid load key, '%s'."
,
"c"
,
s
[
0
]);
goto
err
;
}
...
...
@@ -3907,8 +3907,8 @@ newUnpicklerobject(PyObject *f) {
self
->
marks_size
=
0
;
self
->
buf_size
=
0
;
self
->
read
=
NULL
;
self
->
readline
=
NULL
;
self
->
class_map
=
NULL
;
self
->
readline
=
NULL
;
self
->
class_map
=
NULL
;
UNLESS
(
self
->
memo
=
PyDict_New
())
{
Py_XDECREF
((
PyObject
*
)
self
);
...
...
@@ -4308,7 +4308,7 @@ init_stuff(PyObject *module, PyObject *module_dict) {
void
initcPickle
()
{
PyObject
*
m
,
*
d
,
*
v
;
char
*
rev
=
"$Revision: 1.5
0
$"
;
char
*
rev
=
"$Revision: 1.5
1
$"
;
PyObject
*
format_version
;
PyObject
*
compatible_formats
;
...
...
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