Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
solved conflict
  • Loading branch information
ralsina committed Aug 5, 2015
2 parents ab3a8e9 + 046bc8f commit 4a5a677
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -10,6 +10,7 @@ Bugfixes
--------

* Handle special characters in URLs in nikola auto (Issue #1925)
* Avoid Broken Pipe error in nikola auto (Issue #1906)
* "nikola auto" serving implicit index.html with wrong mime type (Issue #1921)
* Handle non-integer shutter speeds and other variables in WordPress
importer (Issue #1917)
Expand All @@ -29,6 +30,7 @@ Features
Bugfixes
--------

* Don't auto-rebuild on changes to ".foo" or "foo~" or changes in folders.
* Don't assume things are HTML in auto mode (Issue #1915)
* Don’t rebuild Atom syndication files unnecessarily often
* Include .php files in sitemaps
Expand Down
22 changes: 21 additions & 1 deletion nikola/plugins/command/auto/__init__.py
Expand Up @@ -33,6 +33,7 @@
import os
import re
import subprocess
import sys
import time
try:
from urlparse import urlparse
Expand All @@ -46,7 +47,7 @@
from blinker import signal
try:
from ws4py.websocket import WebSocket
from ws4py.server.wsgirefserver import WSGIServer, WebSocketWSGIRequestHandler
from ws4py.server.wsgirefserver import WSGIServer, WebSocketWSGIRequestHandler, WebSocketWSGIHandler
from ws4py.server.wsgiutils import WebSocketWSGIApplication
from ws4py.messaging import TextMessage
except ImportError:
Expand Down Expand Up @@ -419,3 +420,22 @@ def on_any_event(self, event):
"""Call the provided function on any event."""
if event._src_path == self.configuration_filename:
self.function(event)


# Monkeypatch to hide Broken Pipe Errors

f = WebSocketWSGIHandler.finish_response

if sys.version_info[0] == 3:
EX = BrokenPipeError # NOQA
else:
EX = IOError


def finish_response(self):
try:
f(self)
except EX: # Client closed the connection, not a real error
pass

WebSocketWSGIHandler.finish_response = finish_response

0 comments on commit 4a5a677

Please sign in to comment.