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

Throw descriptive error message for linked views on Windows. #236

Merged
merged 2 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Changed

- Implemented ``Project.__contains__`` check in constant time.

Fixed
+++++

- Attempting to create a linked view for a Project on Windows now raises an informative error message.

Removed
+++++++

Expand Down
7 changes: 7 additions & 0 deletions signac/contrib/linked_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import errno
import logging
import sys
from itertools import chain

logger = logging.getLogger(__name__)
Expand All @@ -13,6 +14,12 @@ def create_linked_view(project, prefix=None, job_ids=None, index=None, path=None
"""Create or update a persistent linked view of the selected data space."""
from .import_export import _make_path_function
from .import_export import _check_directory_structure_validity

# Windows does not support the creation of symbolic links.
if sys.platform == 'win32':
raise OSError("signac cannot create linked views on Windows, because "
"symbolic links are not supported by the platform.")

if prefix is None:
prefix = 'view'

Expand Down