pydoc > xdrlib

πŸ“› NAME

xdrlib - Implements (a subset of) Sun XDR -- eXternal Data Representation.

πŸš€ Quick Reference

Use CaseCommandDescription
Create a Packerp = xdrlib.Packer()Initialize a new Packer object to serialize data
Pack an integerp.pack_int(42)Encode a 32-bit signed integer
Pack a stringp.pack_string(b"hello")Encode a variable-length opaque byte string
Pack an arrayp.pack_array(my_list, p.pack_int)Encode an array of items using a pack_item callback
Pack a floatp.pack_float(3.14)Encode a 32-bit IEEE float
Get serialized bufferdata = p.get_buffer()Retrieve the packed binary data
Create an Unpackeru = xdrlib.Unpacker(data)Initialize Unpacker with a buffer to deserialize
Unpack an integerval = u.unpack_int()Decode a 32-bit signed integer
Unpack a strings = u.unpack_string()Decode a variable-length byte string
Check if doneu.done()Returns True if entire buffer consumed
Handle errorsexcept xdrlib.Error as e:Catch all XDR-specific exceptions

πŸ“˜ MODULE REFERENCE

https://docs.python.org/3.10/library/xdrlib.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

πŸ“– DESCRIPTION

See: RFC 1014

πŸ—οΈ CLASSES

builtins.Exception(builtins.BaseException)
    Error
        ConversionError
builtins.object
    Packer
    Unpacker

⚠️ class ConversionError(Error)

Exception raised when XDR data cannot be converted.

Inherits all methods from Error and builtins.Exception. Key methods:

Also inherits from builtins.BaseException: with_traceback(tb), __cause__, __context__, __traceback__, args, and all standard exception methods.

❌ class Error(builtins.Exception)

Exception class for this module. Use:

except xdrlib.Error as var:
    # var has the Error instance for the exception

Public ivars: msg -- contains the message

πŸ“‹ Methods defined here:

🧬 Inherited from builtins.Exception / builtins.BaseException:

Data descriptors: __cause__, __context__, __dict__, __suppress_context__, __traceback__, args

🧰 class Packer(builtins.object)

Pack various data representations into a buffer.

πŸ“‹ Methods defined here:

πŸ“¦ class Unpacker(builtins.object)

Unpacks various data representations from the given buffer.

πŸ“‹ Methods defined here:

πŸ“‹ DATA

__all__ = ['Error', 'Packer', 'Unpacker', 'ConversionError']

πŸ“„ FILE

/usr/lib/python3.10/xdrlib.py

xdrlib
πŸ“› NAME πŸš€ Quick Reference πŸ“˜ MODULE REFERENCE πŸ“– DESCRIPTION πŸ—οΈ CLASSES
⚠️ class ConversionError(Error) ❌ class Error(builtins.Exception) 🧰 class Packer(builtins.object) πŸ“¦ class Unpacker(builtins.object)
πŸ“‹ DATA πŸ“„ FILE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 16:53 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^