UpMapleUp's blog

By UpMapleUp, history, 3 years ago, In English

I maintain a code template like many others do. In the code template, there are some code pieces that I would like to conditionally run in my local PC environment, but not run in Codeforces environment. I use the standard library utility platform.node() to distinguish between two environments.

Surprisingly, calling platform.node() in Codeforces Python 3.9.1 will crash the program, and totally no language-level exception is raised during the crash.

In contrast, calling platform.node() in Codeforces PyPy 7.3.0 yields correct result, and no crash happens.

I wonder how that happens. Perhaps something related to failure of syscall in the virtual machine dedicated to run Python program?

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it