Cant able to get/download file which having # symbol in filepath
code:
import webdav4 from webdav4.client import Client from webdav4.fsspec import WebdavFileSystem import httpx
timeout=httpx.Timeout(506060) client = Client("https://sddsaturn.ondemand.sas.com", auth=("USER", "PWD"),timeout=timeout)
try:
with io.BytesIO() as stream:
client.download_fileobj(source_folder_path, stream)
stream.seek(0)
except Exception as e: print(f"Failed to Get/Download file to: {stream} because {e}") logging.error(f"Failed to Get/Download file to: {stream} because {e}")
NEED HELP TO GET/DOWNLOAD FILES WITH # SYMBOL
You can format your code with triple backticks in Github Markdown to make it more readable.
But based on the issue title, I assume that you are running into an issue similar to the one I have and need to quote that symbol, i.e., replace # with urllib.parse.quote('#'), which results in %23.