I opened an 8 MB file in Python, because I wanted to batch change various types of file names. I went through and loaded the file into a string and used the string method replace to replace everything. I then noticed that only half of the file was being replaced; as if Python wasn't fully opening the file.
Is there some kind of string size limit or max file size limit that I must play within the bounds of in Python?
Refer to the code in Python search and replace not replacing properly.
I have changed to the suggested code. The buffer is an 8 MB HTML file that is over 150k lines. The replacement code works perfectly; it's just that it's not replacing everything. Or for example one error that is a pain is:
When I'm attempting to replace the string ff10 to FF-10, it'll be changed to FF-010.