Linux to Windows porting question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SHELTRAW, DANIEL

    #1

    Linux to Windows porting question

    Hello Pyhton Listees

    I am trying to port some code to Windows that works fine under Linux. The offending line
    is:

    blk = fromstring(f_fi d.read(BLOCK_LE N), num_type).bytes wapped().astype (Float32).tostr ing()

    The error I get is:

    ValueError: string size must be a multiple of element size

    Does anyone have an idea where the problem might be? BLOCK_LEN is specified in bytes
    and num_type is Int32.

    Thanks,
    Daniel
  • Peter Otten

    #2
    Re: Linux to Windows porting question

    SHELTRAW, DANIEL wrote:
    [color=blue]
    > I am trying to port some code to Windows that works fine under Linux. The
    > offending line is:
    >
    > blk = fromstring(f_fi d.read(BLOCK_LE N),
    > num_type).bytes wapped().astype (Float32).tostr ing()
    >
    > The error I get is:
    >
    > ValueError: string size must be a multiple of element size
    >
    > Does anyone have an idea where the problem might be? BLOCK_LEN is
    > specified in bytes and num_type is Int32.[/color]

    Is the file f_fid opened in binary mode?

    Peter

    Comment

    Working...