Skip to content

Commit 797efbe

Browse files
authored
Merge pull request #11 from pylhc/fix_ascii_identification
Fix ascii identification
2 parents 72511fc + fe58a09 commit 797efbe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

turn_by_turn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__title__ = "turn_by_turn"
66
__description__ = "Read and write turn-by-turn measurement files from different particle accelerator formats."
77
__url__ = "https://github.com/pylhc/turn_by_turn"
8-
__version__ = "0.4.0"
8+
__version__ = "0.4.1"
99
__author__ = "pylhc"
1010
__author_email__ = "pylhc@github.com"
1111
__license__ = "MIT"

turn_by_turn/ascii.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def is_ascii_file(file_path: Union[str, Path]) -> bool:
4747
# skip empty lines
4848
if line.strip() == "":
4949
continue
50-
return line.strip().startswith(f"#{ASCII_ID}") # see _write_header
50+
# return line.strip().startswith(f"#{ASCII_ID}") # see _write_header
51+
return line.strip().startswith(ASCII_COMMENT) # e.g. PS does not follow the rules
5152
except UnicodeDecodeError:
5253
return False
5354
return False

0 commit comments

Comments
 (0)