Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ad2dc3fc
Commit
ad2dc3fc
authored
Sep 14, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the warning about transporting marshals across boxes with different
ideas about sizeof(long).
parent
c785f484
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
Doc/lib/libmarshal.tex
Doc/lib/libmarshal.tex
+8
-13
No files found.
Doc/lib/libmarshal.tex
View file @
ad2dc3fc
...
@@ -39,19 +39,14 @@ therein are themselves supported; and recursive lists and dictionaries
...
@@ -39,19 +39,14 @@ therein are themselves supported; and recursive lists and dictionaries
should not be written (they will cause infinite loops).
should not be written (they will cause infinite loops).
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
32 bits (such as the DEC Alpha), it
32 bits (such as the DEC Alpha), it is possible to create plain Python
is possible to create plain Python integers that are longer than 32
integers that are longer than 32 bits.
bits. Since the current
\module
{
marshal
}
module uses 32 bits to
If such an integer is marshaled and read back in on a machine where
transfer plain Python integers, such values are silently truncated.
C's
\code
{
long int
}
type has only 32 bits, a Python long integer object
This particularly affects the use of very long integer literals in
is returned instead. While of a different type, the numeric value is
Python modules --- these will be accepted by the parser on such
the same. (This behavior is new in Python 2.2. In earlier versions,
machines, but will be silently be truncated when the module is read
all but the least-significant 32 bits of the value were lost, and a
from the
\file
{
.pyc
}
instead.
\footnote
{
warning message was printed.)
A solution would be to refuse such literals in the parser,
since they are inherently non-portable. Another solution would be to
let the
\module
{
marshal
}
module raise an exception when an integer
value would be truncated. At least one of these solutions will be
implemented in a future version.
}
There are functions that read/write files as well as functions
There are functions that read/write files as well as functions
operating on strings.
operating on strings.
...
...
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