wuwuxin 29 Posted September 16, 2021 This is a weird problem that surfaced today after I updated Python4D to its latest. Delphi 10.4.2 A valid python source file, after loaded by Python4D, an extra character #1A will be append to it. Then next time the python source file is loaded by Python4D, it will complain invalid syntax at where the new char is appended (i.e, the end of the file). Anyone has encountered the issue? Share this post Link to post
pyscripter 740 Posted September 16, 2021 (edited) On 9/16/2021 at 2:53 PM, wuwuxin said: A valid python source file, after loaded by Python4D What does "loaded by Python4D" mean? On 9/16/2021 at 2:53 PM, wuwuxin said: #1A What kind of character is this? Do you mean $A (LF)? Edited September 16, 2021 by pyscripter Share this post Link to post
Attila Kovacs 649 Posted September 16, 2021 (edited) $1A is ctrl-z, it's the end-of-file marker Edited September 16, 2021 by Attila Kovacs Share this post Link to post
wuwuxin 29 Posted September 16, 2021 On 9/16/2021 at 3:14 PM, pyscripter said: What does "loaded by Python4D" mean? What kind of character is this? Do you mean $A (LF)? Thank you for the prompt attention, and sorry I should have be more clear - I meant by "VarPyth.Import(APySourceFile)" The character i meant is $1A Share this post Link to post
pyscripter 740 Posted September 16, 2021 VarPyth.Import just calls the Python function PyImport_Import which AFAIK does not modify files in any way. Share this post Link to post
wuwuxin 29 Posted September 16, 2021 On 9/16/2021 at 3:38 PM, pyscripter said: VarPyth.Import just calls the Python function PyImport_Import which AFAIK does not modify files in any way. Thank you. I am scratching my head - let me investigate at what point that this weird character $1A is added. Share this post Link to post