Skip to content

Commit c13f261

Browse files
committed
Don't try to read the entire file for GetFileJob
Since open() returns a BytesIO when we pass "rb", no need to read the whole thing out then re-wrap it in a BytesIO.
1 parent 4b6be24 commit c13f261

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mqterm/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class GetFileJob(Job):
9292
argc = 1
9393

9494
def output(self):
95-
return BytesIO(open(self.args[0], "rb").read())
95+
return open(self.args[0], "rb")
9696

9797

9898
class WhoAmIJob(Job):

tests/e2e/e2e_file_ops.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
# Set up logging; pass LOG_LEVEL=DEBUG if needed for local testing
1616
logger = logging.getLogger()
1717
logger.setLevel(getattr(logging, os.getenv("LOG_LEVEL", "WARNING").upper()))
18-
formatter = logging.Formatter(
19-
"%(asctime)s.%(msecs)d - %(levelname)s - %(name)s - %(message)s"
20-
)
18+
format_str = "%(asctime)s.%(msecs)03.0f - %(levelname)s - %(name)s - %(message)s"
19+
formatter = logging.Formatter(format_str)
2120
handler = logging.StreamHandler(sys.stdout)
2221
handler.setFormatter(formatter)
2322
logger.handlers = []

0 commit comments

Comments
 (0)