JiekaiLab / scTE

MIT License
97 stars 27 forks source link

Remove "U" mode from open() #54

Closed olivertam closed 1 year ago

olivertam commented 1 year ago

Hi,

I encountered the following error when running scTE in Python 3.11:

ValueError: invalid mode: 'rU'

This appears to be related to the open() function, where the U (universal newline) mode was deprecated since Python 3.3, and throws an error in Python 3.11 (I did not test earlier versions).

Do you think it's a good idea to remove the U from the various open() functions in the following locations: https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/bin/scTE_build#L110 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/bin/scTE_build#L156 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/scTE/annotation.py#L41 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/scTE/base.py#L113 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/scTE/base.py#L122 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/scTE/base.py#L132 https://github.com/JiekaiLab/scTE/blob/d9a300ed4428fe395fe0f13fd86fb158b88dd528/scTE/base.py#L141

Thanks.

jphe commented 1 year ago

It works in my PC with Python 3.10

and yes, I think you can remove the 'U' from the various open() functions.

olivertam commented 1 year ago

Thanks.