[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Anyway, I'm now closing the issue as invalid. -- status: open -> closed ___ Python tracker ___ ___ P

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The time of line 7 was much greater than line 13. Well, yes, reading 70 MB is much longer than reading a single byte :-) > I feel that the underlying system call takes the size argument Indeed it does. It would be totally inefficient if it didn't. > so I gu

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: Thanks for letting me know about the optimization. I trusted you that the system call is made once, though I looked up code to see if size of the read in buffer is being passed to the C routine. I should apologize though for raising this issue - since it is in

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Bytes objects are immutable, so trying to "copy" them doesn't copy anything actually (it's an optimization): >>> b = b"x" *10 >>> id(b) 139720033059920 >>> b2 = b[:] >>> id(b2) 139720033059920 FileIO.read() only calls the underlying read() once, you can check

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: Sorry, typo in the last post - I meant "in memory - memory copy" not "in place memory copy". -- ___ Python tracker ___ _

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: I did the following to understand time taken for in memory copy: 1>>> fl = io.FileIO('c:/temp9/Capability/Analyzing Data.mp4', 'rb') 2>>> byt = fl.read(70934549) 3>>> byt2 = None 4>>> byt2 = byt[:] 5>>> fl.close() 6>>> fl = io.FileIO('c:/temp9/Capability/Analyzing

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If only one system call is being made, then I think that > fl.read(256) and fl.read(70934549) should take same amount of time to > complete - assuming disk I/O is the time consuming factor in this > operation (as compared to memory processing). What do you me

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: @Antoine It worked. I was wrong to say read1() was not implemented. Sorry. But please do consider other issues. -- ___ Python tracker ___ _

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: @Antoine - wait I will do it -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: Please consider following before making a decision: >> io.FileIO does not implements single OS system call on read() - instead >> reads a file until EOF i.e. ignores the arguments supplied to read() >Your experiments show otherwise, the argument supplied to rea

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: You called read1() on fl (a FileIO object) and not cfl (a BufferedReader object). Your fault for choosing confusing variable names :-) >>> len(fl.read1(70934549)) Traceback (most recent call last): File "", line 1, in len(fl.read1(70934549)) AttributeErr

[issue17440] Some IO related problems on x86 windows

2013-03-17 Thread Gurmeet Singh
Gurmeet Singh added the comment: Please consider following before making a decision: __ > io.BufferedReader does not implement read1 (the last lines of trace > below) >It does. You made a mistake in your experiment (you called read1() on a FileIO >object, not a BufferedReader object).

[issue17440] Some IO related problems on x86 windows

2013-03-16 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- resolution: -> invalid status: open -> pending ___ Python tracker ___ ___ Python-bugs-list maili

[issue17440] Some IO related problems on x86 windows

2013-03-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: > 1. The read mode is not the default mode as mentioned in the > docs.python.org. It is. If you don't mention a mode, the mode is "r" by default. But if you mention a mode, then you are required to specify one of "r", "w", "a". > io.BufferedReader does not imp

[issue17440] Some IO related problems on x86 windows

2013-03-16 Thread Gurmeet Singh
New submission from Gurmeet Singh: 1. The read mode is not the default mode as mentioned in the docs.python.org. In particular see the first Traceback below - "b" does not work (as it does in C though) and you are forced to use "rb" instead. 2. io.BufferedReader does not implement read1 (the

[issue17440] Some IO related problems on x86 windows

2013-03-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +IO nosy: +benjamin.peterson, hynek, pitrou, stutzbach ___ Python tracker ___ ___ Python-