Skip to content

Commit

Permalink
explictly encode filenames for windows in case there are unicode chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Aune committed Jul 26, 2024
1 parent 562403d commit ddc327c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.6.6.0
4.6.6.1
16 changes: 8 additions & 8 deletions hstk/hscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
# Windows compatability stuff
if platform.system().startswith('Windows') or platform.system().startswith('CYGWIN'):
WINDOWS = True
WIN_PADDING = '\0'*50
WIN_PADDING = b'\0'*50
else:
WINDOWS = False
WIN_PADDING = ''
WIN_PADDING = b''


# Helper object for containing global settings to be passed with context
Expand Down Expand Up @@ -235,21 +235,21 @@ def run_cmd(self, fname):
work_id = hex(random.randint(0,99999999))
if fname.is_dir():
gw = fname
cmd = './'
cmd = b'./'
else:
gw = fname.parent
cmd = './' + fname.name
cmd = b'./' + fname.name.encode()
gw = gw / f'.fs_command_gateway {work_id}'

# First open, send the command
vnprint(f'open( {gw} )')
if self.dry_run:
fd = io.StringIO()
else:
fd = gw.open('w')
fd = gw.open('wb')

try:
cmd += self.shadgen(**self.kwargs)
cmd += self.shadgen(**self.kwargs).encode()
except ValueError as e:
if ( ('value' not in self.kwargs)
or ('value' in self.kwargs and (not self.kwargs['value'])) ):
Expand Down Expand Up @@ -558,7 +558,7 @@ def tag():

rekognition_tag_short_help = "[sub] inode metadata: schema no, value yes"
rekognition_tag_help = """
rekognition_tag
rekognition_tag
sub commands are used to view metadata added to an object by AWS's
rekognition service. Contact support for details on how to configure
rekognition.
Expand Down Expand Up @@ -1816,7 +1816,7 @@ def keep_on_site():
cli.add_command(keep_on_site)

# only good for single share, but get new invocation for each path
_GNS_PARTICIPANT_SITE_NAMES_CACHE=None
_GNS_PARTICIPANT_SITE_NAMES_CACHE=None
@click.pass_context
def _gns_participant_site_names(ctx, pathnames=['.'], force=False, **kwargs):
global _GNS_PARTICIPANT_SITE_NAMES_CACHE
Expand Down

0 comments on commit ddc327c

Please sign in to comment.