[Tutor] Type Error

Zachary Ware zachary.ware+pytut at gmail.com
Mon Sep 14 16:40:33 CEST 2015


On Mon, Sep 14, 2015 at 9:29 AM, richard kappler <richkappler at gmail.com> wrote:
> everything works except the os.remove(file) which gives the following error:
>
> Traceback (most recent call last):
>   File "DataFeedBatch.py", line 104, in <module>
>      os.remove(file)
> TypeError: coercing to Unicode: need string or buffer, file found
>
> I don't understand the error

os.remove() expects a filename, and you're passing it a 'file' object.

-- 
Zach


More information about the Tutor mailing list