ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
3 stars 3 forks source link

Make the recently added compat module standalone. #74

Closed albu-diku closed 1 week ago

albu-diku commented 1 week ago

Work since the introduction of ensure_native_string() has shown that being able to make use the function is limited by its inclusion of the base package. Allow the function to be used everywhere by using only the Python standard library for its operation.

This sidesteps any potential for circular imports and ensures well tested string conversion is available for the definition of e.g. base itself.

jonasbardino commented 1 week ago

Thanks @albu-diku. Merged through svn with minor adjustments. Mainly added a few docstrings/comment and copied our explanation for going against PEP8 in the use of type comparisons instead of isinstance in unicode string detection. It originates from the similar helper in mig.shared.base and basically boils down to compatibility issues across python versions with future and futurize in the mix.