Skip to content
Open
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
2 changes: 1 addition & 1 deletion hm_gerber_ex/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


def read(filename, format=None):
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
data = f.read()
return loads(data, filename, format=format)

Expand Down
2 changes: 1 addition & 1 deletion hm_gerber_tool/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read(filename):
CncFile object representing the file, either GerberFile, ExcellonFile,
or IPCNetlist. Returns None if file is not of the proper type.
"""
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
try:
data = f.read()
return loads(data, filename)
Expand Down
6 changes: 3 additions & 3 deletions hm_gerber_tool/excellon.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def read(filename):

"""
# File object should use settings from source file by default.
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
data = f.read()
settings = FileSettings(**detect_excellon_format(data))
return ExcellonParser(settings).parse(filename)
Expand Down Expand Up @@ -433,7 +433,7 @@ def hole_count(self):
return len(self.hits)

def parse(self, filename):
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
data = f.read()
return self.parse_raw(data, filename)

Expand Down Expand Up @@ -832,7 +832,7 @@ def detect_excellon_format(data=None, filename=None):
if data is None and filename is None:
raise ValueError('Either data or filename arguments must be provided')
if data is None:
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
data = f.read()

# Check for obvious clues:
Expand Down
2 changes: 1 addition & 1 deletion hm_gerber_tool/ipc356.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def settings(self):
return FileSettings(units=self.units, angle_units=self.angle_units)

def parse(self, filename):
with open(filename, 'rU') as f:
with open(filename, 'r') as f:
data = f.read()
return self.parse_raw(data, filename)

Expand Down
2 changes: 1 addition & 1 deletion hm_gerber_tool/rs274x.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def __init__(self):

def parse(self, filename):
self.filename = filename
with open(filename, "rU") as fp:
with open(filename, "r") as fp:
data = fp.read()
return self.parse_raw(data, filename)

Expand Down