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 IOError with livereload + custom config file #735

Closed
wants to merge 1 commit into from

Conversation

@vi4m
Copy link

@vi4m vi4m commented Sep 26, 2015

When using livereload with custom config file, after first refresh you got IOError.

Steps to reproduce:

mkdocs serve --config-file=mkdocs-local.yml --livereload

after first refresh you get IOError (end of stream).

That's because closed descriptor was reused by load_config(), but not reinitialized properly, resulting in
stream IO Error (end of file). Proposed fix is - to reinitialize closed file description again every time livereload happens.

When using livereload with custom config file, after
first refresh you got IOError. That's because
closed descriptor was reused by load_config()
bot not reinitialized properly, effecting in
stream IO Error (end of file). Fix is to reinitialize
closed file description again every time livereload happens.
@vi4m
Copy link
Author

@vi4m vi4m commented Sep 29, 2015

Any news about it?

@d0ugal
Copy link
Member

@d0ugal d0ugal commented Sep 29, 2015

This change looks good, I've not had a chance to test it. A unit test would help to verify this behaviour and get it merged sooner.

I am very busy at the moment due to life, I am unlikely to be active in MkDocs for around a month.

@robodude666
Copy link

@robodude666 robodude666 commented Oct 15, 2015

Looks like this patch makes the assumption that the config file still exists on reload.

@waylan
Copy link
Member

@waylan waylan commented Oct 15, 2015

@robodude666 makes a good point. That change which prompts the autoreload could be a change to the config file. If a user inadvertently deleted the config file, they should get the same clean error message on a reload as they would get on the initial load. That doesn't happen with the current patch.

@chris-hailstorm

This comment has been minimized.

Copy link

@chris-hailstorm chris-hailstorm commented on f6a8edf Jan 14, 2016

This fix worked for me.

@d0ugal
Copy link
Member

@d0ugal d0ugal commented Mar 3, 2016

I think we should take into account the problem @robodude666 spotted. Otherwise happy to accept this.

waylan added a commit to waylan/mkdocs that referenced this pull request Apr 4, 2016
Refactored fix supplied in mkdocs#735 and added tests.
@waylan
Copy link
Member

@waylan waylan commented Apr 5, 2016

Fixed in #883.

@waylan waylan closed this Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants