@@ -203,7 +203,9 @@ async def download_file(
203203
204204 if success and options .verify_checksum and remote_checksum :
205205 # Verify local checksum
206- local_checksum = FileChecksum .compute (local_file , options .checksum_type )
206+ local_checksum = FileChecksum .compute (
207+ local_file , options .checksum_type
208+ )
207209
208210 if local_checksum .value != remote_checksum :
209211 self .logger .error (
@@ -389,6 +391,7 @@ def handle_closed() -> None:
389391
390392 # Set client info and attach to session
391393 from ..constants import CLIENT_VERSION
394+
392395 try :
393396 data_channel .set_client_info ("pyssm-client" , CLIENT_VERSION )
394397 except Exception :
@@ -472,7 +475,7 @@ async def _upload_base64(
472475 ) -> bool :
473476 """Upload file using base64 encoding via data channel with verification, move, and chmod."""
474477 temp_remote = f"{ remote_path } { options .temp_suffix } "
475-
478+
476479 # Clear any existing temp file
477480 clear_cmd = f"rm -f '{ temp_remote } '\n "
478481 await data_channel .send_input_data (clear_cmd .encode ())
@@ -482,19 +485,19 @@ async def _upload_base64(
482485 bytes_sent = 0
483486 file_size = local_file .stat ().st_size
484487
485- self .logger .info (
486- "Starting upload of %s (%s bytes)" , local_file , file_size
487- )
488+ self .logger .info ("Starting upload of %s (%s bytes)" , local_file , file_size )
488489
489490 with open (local_file , "rb" ) as f :
490491 while chunk := f .read (options .chunk_size ):
491492 # Encode chunk to base64
492- encoded_chunk = base64 .b64encode (chunk ).decode (' ascii' )
493-
493+ encoded_chunk = base64 .b64encode (chunk ).decode (" ascii" )
494+
494495 # Send chunk using simple append (no heredoc complexity)
495- append_cmd = f"echo -n '{ encoded_chunk } ' | base64 -d >> '{ temp_remote } '\n "
496+ append_cmd = (
497+ f"echo -n '{ encoded_chunk } ' | base64 -d >> '{ temp_remote } '\n "
498+ )
496499 await data_channel .send_input_data (append_cmd .encode ())
497-
500+
498501 bytes_sent += len (chunk )
499502
500503 # Progress callback
@@ -531,21 +534,22 @@ async def _upload_base64(
531534 file_size ,
532535 )
533536
534- self .logger .debug ("Upload completed: %s bytes sent to %s" , bytes_sent , temp_remote )
535-
537+ self .logger .debug (
538+ "Upload completed: %s bytes sent to %s" , bytes_sent , temp_remote
539+ )
540+
536541 # Move temp file to final location via data channel
537542 move_cmd = f"mv '{ temp_remote } ' '{ remote_path } '\n "
538543 await data_channel .send_input_data (move_cmd .encode ())
539544 await asyncio .sleep (0.2 )
540-
545+
541546 # Set file permissions to match local file
542547 local_mode = local_file .stat ().st_mode & 0o777
543548 chmod_cmd = f"chmod { local_mode :o} '{ remote_path } '\n "
544549 await data_channel .send_input_data (chmod_cmd .encode ())
545550 await asyncio .sleep (0.1 )
546-
547- return True
548551
552+ return True
549553
550554 async def _upload_raw (
551555 self ,
@@ -624,7 +628,10 @@ async def _wait_for_remote_size(
624628 last_size = 0
625629
626630 self .logger .debug (
627- "Remote file %s currently %s/%s bytes" , remote_path , last_size , expected_size
631+ "Remote file %s currently %s/%s bytes" ,
632+ remote_path ,
633+ last_size ,
634+ expected_size ,
628635 )
629636
630637 if last_size >= expected_size :
0 commit comments