Skip to content

Commit

Permalink
Fix #2940 -- don’t run Windows-specific auto code everywhere
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 1, 2018
1 parent d13b184 commit c7a556b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -28,6 +28,8 @@ Features
Bugfixes
--------

* Prevent crashes due to Windows-specific code in ``auto`` running on
all platforms (Issue #2940)
* Don’t run hyphenate on ``<pre>`` blocks (Issue #2939)
* Make errors in reST display in logs again
* Unquote paths given to ``link://`` magic URLs (Issue #2934)
Expand Down
6 changes: 5 additions & 1 deletion nikola/plugins/command/auto/__init__.py
Expand Up @@ -274,7 +274,11 @@ def run_nikola_build(self, event):
# Move events have a dest_path, some editors like gedit use a
# move on larger save operations for write protection
event_path = event.dest_path if hasattr(event, 'dest_path') else event.src_path
is_hidden = os.stat(event_path).st_file_attributes & stat.FILE_ATTRIBUTE_HIDDEN
if sys.platform == 'win32':
# Windows hidden files support
is_hidden = os.stat(event_path).st_file_attributes & stat.FILE_ATTRIBUTE_HIDDEN
else:
is_hidden = False
has_hidden_component = any(p.startswith('.') for p in event_path.split(os.sep))
if (is_hidden or has_hidden_component or
'__pycache__' in event_path or
Expand Down

0 comments on commit c7a556b

Please sign in to comment.