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

Initialization fails if get_home() returns None #2614

Closed
sellonen opened this issue Nov 25, 2013 · 5 comments
Closed

Initialization fails if get_home() returns None #2614

sellonen opened this issue Nov 25, 2013 · 5 comments

Comments

@sellonen
Copy link

os.path.join(get_home(), 'SOMESTRING') 

is called a number of times in the init().py of matplotlib. The function join cannot handle None-type objects, yet the function get_home() sometimes returns None.

I ran into this issue while building a web application, and I had to resort to tweaking the default return value of the get_home() function.

@mdboom
Copy link
Member

mdboom commented Nov 25, 2013

What version of matplotlib are you using? I don't believe this is the case any longer.

@sellonen
Copy link
Author

Thanks for your quick reply! Here is the line returning None

https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/__init__.py#L503

And here a join is attempted

https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/__init__.py#L540

I know it's a bit peculiar installation, as none of the environment variables HOME, USERPROFILE, or TMP was defined, but it resulted directly from installing nginx from Ubuntu packages and uwsgi and matplotlib by pip, so I think I will run into this in the future as well.

@sellonen
Copy link
Author

Woah sorry there is a check there before the second line, whereas in my code there was not.

@sellonen
Copy link
Author

My version was 1.3.1.

@mdboom
Copy link
Member

mdboom commented Nov 26, 2013

Sorry, my fault for not remembering that that fix hadn't made it into a release yet. This is already fixed on the maintenance branch, however, so it will make it into the next bugfix release. You may want to run the v1.3.x branch from git if this is an issue for you -- it is not terribly different from 1.3.1 and only contains bugfixes since then.

I'm closing this as already fixed. Thanks for the report.

@mdboom mdboom closed this as completed Nov 26, 2013
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

2 participants