shutil in python error

Bug #120690 reported by Alec Wright
2
Affects Status Importance Assigned to Milestone
python2.5 (Ubuntu)
Invalid
Undecided
Matthias Klose

Bug Description

Binary package hint: python2.5

When you use shutil.copyfileobj in python in ubuntu gutsy, it will fail and return an error.

Here is the script I used:
#!/usr/bin/python
import shutil
shutil.copyfileobj('/dev/zero','test','1024')

It returns this error:
alec@alecomp:~/Programming/xbyte$ ./xbyte
Traceback (most recent call last):
  File "./xbyte", line 3, in <module>
    shutil.copyfileobj('/dev/zero','test','1024')
  File "/usr/lib/python2.5/shutil.py", line 21, in copyfileobj
    buf = fsrc.read(length)
AttributeError: 'str' object has no attribute 'read'
alec@alecomp:~/Programming/xbyte$

Revision history for this message
Matthias Klose (doko) wrote :

invalid, please see the documentation for the types of all parameters.

Changed in python2.5:
assignee: nobody → doko
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.