[reportlab-users] Puzzling Error
Andy Robinson
reportlab-users@reportlab.com
Wed, 6 Nov 2002 08:11:03 -0000
> Hmm, wouldn't it be better to just test for the needed file
> methods and if
> they aren't there assume it is a file name?
>
> Something like:
>
> if hasattr(filename, 'write'):
> myfile = 0
> f = filename # A file-like ob
> else:
> myfile = 1
> f = open(str(filename), 'wb')
>
I think this is better. Maybe someone wants a genuine
Unicode filename one day.
> another pattern I have used for getting around supporting
> non-unicode pythons
> is something like:
That's good, we could work with that.
I'll try to work these in; we're aiming for a release next week.
- Andy