Changing strings in files

Chris Angelico rosuav at gmail.com
Tue Nov 10 19:07:58 EST 2020


On Wed, Nov 11, 2020 at 10:00 AM Cameron Simpson <cs at cskk.id.au> wrote:
>
> On 11Nov2020 07:30, Chris Angelico <rosuav at gmail.com> wrote:
> >If the script's assuming it'll mostly work on small text files, it
> >might be very annoying to suddenly read in a 4GB blob of video file
> >just to find out that it's not text.
>
> You can abort as soon as the decode fails. Which will usually be pretty
> early for video.
>
Only if you haven't already read it from the file system, which is the
point of the early abort :)

ChrisA


More information about the Python-list mailing list