Skip to content

Commit

Permalink
fix: fix cannot read bruker in case of not ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Le committed Oct 25, 2023
1 parent 7202b29 commit 617369a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nmrglue/fileio/bruker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,12 @@ def read_jcamp(filename, encoding=locale.getpreferredencoding()):
with io.open(filename, 'r', encoding=encoding) as f:
while True: # loop until end of file is found

line = f.readline().rstrip() # read a line
try:
line = f.readline().rstrip() # read a line
except Exception as e:
warn("Unable read line, leave it as a comment")
line = "$$"

if line == '': # end of file found
break

Expand Down

0 comments on commit 617369a

Please sign in to comment.