> > I think instead of the hard way sketched out above it will be sufficient to > specify the error handler when opening the destination file > > shf = open(bashfilename, 'w', errors="surrogateescape") This seems to fix everything! I tried with a small test set and it worked.
> > but I have not tried it myself. Also, some bytes may need to be escaped, > either to be understood by the shell, or to address security concerns: > Since I am puting the file names between "", the only char that needs to be escaped is the " itself. I'm gonna try with the real thing. Thank you very much for the fixing and for everything I have learned here. -- https://mail.python.org/mailman/listinfo/python-list