Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62368 > unrolled thread

Unpacking the structures

Started bysmilesonisamal@gmail.com
First post2013-12-18 20:32 -0800
Last post2013-12-18 22:15 -0800
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Unpacking the structures smilesonisamal@gmail.com - 2013-12-18 20:32 -0800
    Re: Unpacking the structures Dan Stromberg <drsalists@gmail.com> - 2013-12-18 22:15 -0800

#62368 — Unpacking the structures

Fromsmilesonisamal@gmail.com
Date2013-12-18 20:32 -0800
SubjectUnpacking the structures
Message-ID<90e2b0ab-700a-4fe9-bc08-fa8fc21e292f@googlegroups.com>
Hi all,
   While performing the packing/unpacking of xdr structures of rpc I get an error as following.


x = struct.unpack('>L', data)[0] struct.error: unpack requires a string argument of length 4.
  
Can anybody help me in this regard?

I checked the following link:
http://docs.python.org/2/library/xdrlib.html
But there is no way to packing/unpacking the structure data type.

Regards
Pradeep

[toc] | [next] | [standalone]


#62377

FromDan Stromberg <drsalists@gmail.com>
Date2013-12-18 22:15 -0800
Message-ID<mailman.4401.1387433761.18130.python-list@python.org>
In reply to#62368
On Wed, Dec 18, 2013 at 8:32 PM,  <smilesonisamal@gmail.com> wrote:
>
> Hi all,
>    While performing the packing/unpacking of xdr structures of rpc I get an error as following.
>
>
> x = struct.unpack('>L', data)[0] struct.error: unpack requires a string argument of length 4.
>
> Can anybody help me in this regard?

What does print(len(data)) say?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web