Skip to content

Commit

Permalink
Merge pull request #16 from cdsontag/cds_dev
Browse files Browse the repository at this point in the history
for #11; be more forgiving with bad data (non-ascii)
  • Loading branch information
cdsontag committed Jan 4, 2017
2 parents f55efe9 + 7b013a5 commit 67b46f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/stsci/tools/capable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import os, sys
PY3K = sys.version_info[0] > 2
descrip = "basic capabilities file, last edited: 28 Nov 2016"
descrip = "basic capabilities file, last edited: 4 Jan 2017"

def is_darwin_and_x():
""" Convenience function. Returns True if is an X11-linked Python/tkinter
Expand Down
4 changes: 2 additions & 2 deletions lib/stsci/tools/irafutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def read(self, file, nbytes):
while nbytes>0:
snew = os.read(fd, nbytes) # returns bytes in PY3K
if snew:
if PY3K: snew = snew.decode('ascii')
if PY3K: snew = snew.decode('ascii','replace')
s.append(snew)
nbytes -= len(snew)
else:
Expand All @@ -499,7 +499,7 @@ def _read(self, fd, mask):
# it actually requests more data
if select.select([fd],[],[],0)[0]:
snew = os.read(fd, self.nbytes) # returns bytes in PY3K
if PY3K: snew = snew.decode('ascii')
if PY3K: snew = snew.decode('ascii','replace')
self.value.append(snew)
self.nbytes -= len(snew)
else:
Expand Down

0 comments on commit 67b46f8

Please sign in to comment.