Dec-01-2016, 11:18 PM
Let's start by thinking about files in general.
This script you wrote, is a plain text file. You can open it in notepad, and it'll look the same.
An iso file is not plain text. It contains many characters that you can't pronounce (...or draw), in order to compress itself to something small, instead of restricting itself to just what makes sense when you look at it.
Python tries to be very helpful and friendly. When you tell it to open a file, it tries to parse that file so it's easy to work with in your script. The error you're getting is because iso files contain nonsense characters, which python can't understand. The way around that, is to give python hints about what it should expect to see when it starts looking in that file.
For your code, that means we're talking about line 15: "f = open(pathfile)". If you change that line to what snippsat suggested, so it looks like this: "f = open(pathfile, encoding="utf8")", and change nothing else about your script at all, do you still get an error?
This script you wrote, is a plain text file. You can open it in notepad, and it'll look the same.
An iso file is not plain text. It contains many characters that you can't pronounce (...or draw), in order to compress itself to something small, instead of restricting itself to just what makes sense when you look at it.
Python tries to be very helpful and friendly. When you tell it to open a file, it tries to parse that file so it's easy to work with in your script. The error you're getting is because iso files contain nonsense characters, which python can't understand. The way around that, is to give python hints about what it should expect to see when it starts looking in that file.
For your code, that means we're talking about line 15: "f = open(pathfile)". If you change that line to what snippsat suggested, so it looks like this: "f = open(pathfile, encoding="utf8")", and change nothing else about your script at all, do you still get an error?