In the future, please make sure to show a proper minimal, reproducible example when asking questions about programming anywhere online. That will make it easier to understand the problem, and ensure that there hasn’t been some unrelated problem (e.g. forgetting to save changes to a file before running it). The code that you show in the first question can’t possibly be right, because a path like “C:\Users\tech_worker\segismundo.txt” will not work - the quotes are wrong, and the backslashes are not escaped. Although I think both of these happen simply because you have not properly formatted the code, as described in the pinned thread.
As you found, the problem was with specifying the encoding for the open call, but your original code shows that being done properly - so that can’t be what actually went wrong. It’s important to be able to reproduce problems in order to talk about them properly.
Note that on many (all?) *nix systems, (and some recent Windows as well), utf-8 is the default encoding, so a LOT of people will omit it and it will work fine, and then someone else gets bitten
This is because Python uses the system default encoding, (locale.getpreferredencoding(False)), and Windows systems often had other encodings – IIUC, Windows is moving teh utf-8, but I"msure this will be an issue for a long time.
Python itself is moving to make utf-8 the default, but I have no idea when that might happen – it could break a fair bit of code in Windows machines