position information?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Baus
Sent: Thursday, November 16, 2006 12:36 AM
To: Discussion of IronPython
Subject: Re: [IronPython] fepy socket seek
> Solution: Check if stream is seekable in PythonBin
> Solution: Check if stream is seekable in PythonBinaryReader too. If
> it's not seekable, it doesn't make much sense to set Position "to
> synchronise" anyway.
I've been tracing this bug tonight, and I feel concerned about it. The
CRLF reader allows seeking even when the underlying stream doe
> When you write to file,
> 1. writer is checked for null. If it is, stream is not writable. Raise
> exception.
> 2. string is passed to the writer.
> 3. The writer does appropriate newline translation and write it.
> 4. The number of bytes written, after newline translation, is returned.
> 5. read
2006/11/16, Christopher Baus <[EMAIL PROTECTED]>:
> Good question. The seek must be in the binary write. I'm not calling it
> directly. Again, the error only occurs when the binary flag is set. Any
> write on a socket file with the binary flag set causes a seek error.
Let's see what's going on
> where's the seek ?
>
> the second argument to makefile is the requested buffer size.
>
Good question. The seek must be in the binary write. I'm not calling it
directly. Again, the error only occurs when the binary flag is set. Any
write on a socket file with the binary flag set causes a seek
Christopher Baus wrote:
> I found a problem with the fepy socket module. Seek operations aren't
> supported, but they are supported in CPython (not totally sure how they do
> that).
>
> Here's an example.
>
> import socket
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect(("baus
> Here's an example.
>
> import socket
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect(("baus.net", 80))
> file = s.makefile('wb', 1500)
> file.write("anything\r\n")
The problem only occurs with the binary mode set, which is very strange.
The following:
file = s.makefile('w',
I found a problem with the fepy socket module. Seek operations aren't
supported, but they are supported in CPython (not totally sure how they do
that).
Here's an example.
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("baus.net", 80))
file = s.makefile('wb', 1500)