4177e03c2d68de768296f3d335bb44a43542e799
A long time ago, in a commit far far away: 65a3751613,
we introduced a mechanism to support the "import emulator" feature[^1] of
cPython. It's used by some C native modules to trigger an on-the-spot
module import during a low-level function call.
Some of the modules that do this are `datetime` and `time`:
- https://github.com/python/cpython/blob/b6535ea7ecf40c51a9a13089d961c29abeaffa5e/Modules/timemodule.c#L892
- https://github.com/python/cpython/blob/b6535ea7ecf40c51a9a13089d961c29abeaffa5e/Modules/_datetimemodule.c#L1654
Those `PyImport_ImportModuleNoBlock()` calls were initially understood as real
calls that needed to return the imported module. But the actual return value is
never used by PyImport_Import. As long as the call succeeds, it is
sufficient that the modules are imported and present in `sys.modules`
afterwards:
https://github.com/python/cpython/blob/b6535ea7ecf40c51a9a13089d961c29abeaffa5e/Python/import.c#L1825-L1834
In order to avoid randomizing the order of module imports, which can cause
unpredictable behavior depending on the timing of those "emulated imports",
it's simpler to provide a "no-op" import function, and ensure that all the
allowed modules are imported in advance, when the server starts.
This is what this commit does. For good measure, it will raise an error
if the module being imported is not already imported, which means it was
not one of the expected/allowed modules. In that case, it's sufficient
to pre-import the module.
[^1]: https://github.com/python/cpython/blob/b6535ea7ecf40c51a9a13089d961c29abeaffa5e/Python/import.c#L1756-L1766
opw-3721469
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%