def TSKVolumeGetBytesPerSector(tsk_volume):
    """Retrieves the number of bytes per sector from a TSK volume object.

  Args:
    tsk_volume (pytsk3.Volume_Info): TSK volume information.

  Returns:
    int: number of bytes per sector or 512 by default.
  """
    if hasattr(tsk_volume, 'info') and tsk_volume.info is not None:
        block_size = getattr(tsk_volume.info, 'block_size', 512)
    else:
        block_size = 512
    return block_size
