Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ValueError: invalid mode: 'rU' with python3.11 #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emollier
Copy link

Since python3, the universal newline mode 'U' has no effects. Since python3.11, that mode is obsolete and its use raises:

Command: scoary.py -g scoary/exampledata/Gene_presence_absence.csv -t scoary/exa
mpledata/Tetracycline_resistance.csv -o Test1 --no-time
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/scoary.py", line 25, in <module>
    methods.main()
  File "/<<PKGBUILDDIR>>/scoary/methods.py", line 184, in main
    with open(args.genes, "rU") as genes, \
         ^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU'

Note this patch suppresses various references to the 'U' mode in calls to the "open" function, which most likely breaks compatibility of Scoary with python2. Given that this interpreter version is out of maintenance since 2020, it should not be too problematic.

Since python3, the universal newline mode 'U' has no effects.
Since python3.11, that mode is obsolete and its use raises:

	Command: scoary.py -g scoary/exampledata/Gene_presence_absence.csv -t scoary/exa
	mpledata/Tetracycline_resistance.csv -o Test1 --no-time
	Traceback (most recent call last):
	  File "/<<PKGBUILDDIR>>/scoary.py", line 25, in <module>
	    methods.main()
	  File "/<<PKGBUILDDIR>>/scoary/methods.py", line 184, in main
	    with open(args.genes, "rU") as genes, \
	         ^^^^^^^^^^^^^^^^^^^^^^
	ValueError: invalid mode: 'rU'

Note this patch suppresses various references to the 'U' mode in calls
to the "open" function, which most likely breaks compatibility of
Scoary with python2.  Given that this interpreter version is out of
maintenance since 2020, it should not be too problematic.
@dr-joe-wirth
Copy link

Thanks for this. Hopefully this will be merged in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants