Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: sscanf did not parse arguments in _tkagg.cpp #10486

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

Merged
merged 3 commits into from
Feb 17, 2018
Merged

BUG: sscanf did not parse arguments in _tkagg.cpp #10486

merged 3 commits into from
Feb 17, 2018

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Feb 15, 2018

PR Summary

Fix issue #10479 which was caused by a quirk (bug?) in the way sscanf works on MSVC (windows). It seems that additional values cannot be used after "%Iu" which scans into size_t

Also added line drawing in an interactive test

@QuLogic
Copy link
Member

QuLogic commented Feb 16, 2018

Does anyone know why we need to route through tk.call instead of the Python-C API? Then we wouldn't have to bother with this string parsing to transfer pointers.

@tacaswell
Copy link
Member

Thanks for the quick fix @mattip !

@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Feb 16, 2018
@tacaswell tacaswell modified the milestones: v2.2.1, v2.2.0 Feb 16, 2018
@tacaswell
Copy link
Member

@QuLogic My guess is that answer is lost to the sands of time and changing it is probably a bigger change than we want to fit in for 2.2.

Copy link
Member

@WeatherGod WeatherGod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is in the blitting code, which doesn't get a lot of attention. There has always been some weirdness with the image buffer and Tk because Tk does not provide a python API for passing it around.

Is this the only place where this is done? Have we looked at what is done elsewhere for the image buffer?

src/_tkagg.cpp Outdated
@@ -74,9 +74,9 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
return TCL_ERROR;
}
/* get buffer from str which is "ptr height width" */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want to update the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 816ffba

@mattip
Copy link
Contributor Author

mattip commented Feb 16, 2018

@tacaswell sorry for not properly testing

@QuLogic
Copy link
Member

QuLogic commented Feb 17, 2018

@ImportanceOfBeingErnest are you able to test this?

@ImportanceOfBeingErnest
Copy link
Member

@QuLogic If testing means building matplotlib from source, I'm affraid I can't do that currently.

@QuLogic QuLogic merged commit af4830e into matplotlib:master Feb 17, 2018
@QuLogic
Copy link
Member

QuLogic commented Feb 17, 2018

We can leave it for the next rc.

@afvincent
Copy link
Contributor

@QuLogic : (Could you) Run the test suite, @ImportanceOfBeingErnest .
@ImportanceOfBeingErnest : I’m sorry, @QuLogic . I’m afraid I can’t do that (currently).

(Sorry, I could not resist 🐑 . The exact reference is of course this one)

dstansby added a commit that referenced this pull request Feb 17, 2018
@anntzer anntzer mentioned this pull request Mar 5, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants