{'fraction_non_alphanumeric': 0.016926201760324982, 'fraction_numerical': 0.002031144211238998, 'mean_word_length': 5.2100840336134455, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
PyReload: Dynamic Updating of Python Programs by Reloading

Dynamic Software Updating (DSU) is a promising technique for updating running software systems without incurring downtime. It is particularly useful to those systems which need to provide 24x7 services. Many efforts have been made to dynamic updating of the programs developed in mainstreaming languages such as C and Java. With the popularity of Python, many software servers are developed using Python and therefore they are desired to be dynamically updatable. However, there are few studies on dynamic updating of Python. To our knowledge, there exists only one updating approach for Python programs. The approach requires a dedicated Python interpreter in order to manipulate threads for updating, and consequently, it cannot be directly applied to mainstreaming Python interpreters. In this paper, we propose a novel dynamic updating approach to Python based on the built-in reloading mechanism that is supported by most of Python interpreters. Our approach is generic in that it is applicable to ordinary Python interpreters without any change to them. We implement a prototype called PyReload based on the proposed approach. PyReload is compatible with several mainstreaming Python interpreters such as CPython, Pypy and Jython. A case study is conducted to show the usage of PyReload. For performance, experimental results show that PyReload needs a shorter time for updating than the existing approach does.