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

Python 2.6 string format syntax errors in matplotlib 1.4.3 #5703

Closed
jayvdb opened this issue Dec 20, 2015 · 4 comments
Closed

Python 2.6 string format syntax errors in matplotlib 1.4.3 #5703

jayvdb opened this issue Dec 20, 2015 · 4 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Dec 20, 2015

There are quite a few Python 2.6 string format syntax errors in 1.4.3. I found them using https://github.com/xZise/flake8-string-format (and git grep {} due to xZise/flake8-string-format#10).

Some have already been fixed by @montefra in 1.5.x:

I've submitted two PRs to fix other related issues:

matplotlib 1.4.x supposedly supports Python 2.6, but the 1.4.3 release indicates that it is the last patch release, and there is no 1.4.x branch that I can submit PRs to.
Ironically, this means that 1.5.x supports Python 2.6 better than the 1.4.x series.

I've packaged five commits ready to be merged into 1.4.x, if desired.
https://github.com/jayvdb/matplotlib/tree/v1.4.3-py26-str.format

@tacaswell
Copy link
Member

Thanks for taking the time to look into this.

Unfortunately, we no longer support the 1.4.x series.

The 1.5 series does not 'officially' support 2.6, but we are still testing it against 2.6 and if you put in a PR to 1.5.x to fix these formatting issues I will merge it.

Going forward we will not support py2.6 at all (there is 2.6 incompatible code currently on both the 2.x and master branches).

@jayvdb
Copy link
Contributor Author

jayvdb commented Dec 21, 2015

@tacaswell, much appreciated, especially for backporting those changes to 1.5.x.

There are quite a few more uses of {} on the 1.5.x branch (see below). The py26 tests must not be covering those lines. Are you interested in having those fixed? I'll be happy to send through PRs for them.

Would you be interested in a patch that implements https://github.com/xZise/flake8-string-format checking on the 1.5.x branch, to catch possible string format 2.6 bugs early ?
If there is an aversion to using flake8, that checker can be run without flake8 already.

[v1.5.x]$ find . -name '*.py' | grep -v axes_zoom_effect | grep -v threading_test | xargs python3.4 -m flake8_string_format 
./examples/api/filled_step.py:45:42: P202 format call uses missing keyword ('h', 'v')
./lib/mpl_toolkits/axes_grid1/axes_rgb.py:207:30: P101 format string does contain unindexed parameters
./lib/matplotlib/figure.py:494:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:61:5: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:195:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:198:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:200:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:202:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:204:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_mathtext.py:208:10: P103 other string does contain unindexed parameters
./lib/matplotlib/tests/test_ticker.py:71:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/table.py:347:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/artist.py:999:26: P101 format string does contain unindexed parameters
./lib/matplotlib/ticker.py:831:17: P101 format string does contain unindexed parameters
./lib/matplotlib/ticker.py:834:21: P101 format string does contain unindexed parameters
./lib/matplotlib/ticker.py:836:21: P101 format string does contain unindexed parameters
./lib/matplotlib/ticker.py:839:21: P101 format string does contain unindexed parameters
./lib/matplotlib/ticker.py:841:21: P101 format string does contain unindexed parameters
./lib/matplotlib/afm.py:333:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/type1font.py:142:28: P103 other string does contain unindexed parameters
./lib/matplotlib/axes/_base.py:3596:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/mathtext.py:2222:35: P103 other string does contain unindexed parameters
./lib/matplotlib/patches.py:144:0: P102 docstring does contain unindexed parameters
./lib/matplotlib/lines.py:1050:35: P101 format string does contain unindexed parameters
./lib/matplotlib/dates.py:710:29: P103 other string does contain unindexed parameters
./versioneer.py:932:0: P103 other string does contain unindexed parameters

(many of those are false positives; I'll find a way to fix or whitelist those lines which are not actually a problem.)

It could also be useful on master, to catch problems like the first one in the list above, which is PR #5707.

@Zac-HD
Copy link
Contributor

Zac-HD commented Jan 8, 2018

Ping @tacaswell; this can probably be closed now.

@efiring
Copy link
Member

efiring commented Jan 8, 2018

Good point. Thank you.

@efiring efiring closed this as completed Jan 8, 2018
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

No branches or pull requests

4 participants