[ https://issues.apache.org/jira/browse/ARROW-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17661581#comment-17661581 ]
Rok Mihevc commented on ARROW-4559: ----------------------------------- This issue has been migrated to [issue #21106|https://github.com/apache/arrow/issues/21106] on GitHub. Please see the [migration documentation|https://github.com/apache/arrow/issues/14542] for further details. > [Python] pyarrow can't read/write filenames with special characters > ------------------------------------------------------------------- > > Key: ARROW-4559 > URL: https://issues.apache.org/jira/browse/ARROW-4559 > Project: Apache Arrow > Issue Type: Bug > Components: Python > Affects Versions: 0.12.0 > Environment: $ python3 --version > Python 3.6.6 > $ pip3 freeze | grep -Ei 'pyarrow|pandas' > pandas==0.24.1 > pyarrow==0.12.0 > Reporter: Jean-Christophe Petkovich > Assignee: Antoine Pitrou > Priority: Major > Labels: pull-request-available > Fix For: 0.13.0 > > Time Spent: 20m > Remaining Estimate: 0h > > When writing or reading files to or from paths that have special characters > in them, (e.g., "#"), pyarrow returns an error: > {code:python} > OSError: Passed non-file path... > {code} > This is a consequence of the following line: > https://github.com/apache/arrow/blob/master/python/pyarrow/filesystem.py#L416 > File-paths will be parsed as URIs, which will give strange results for > filepaths like: "bad # actor.parquet": > ParseResult(scheme='', netloc='', path='/tmp/bad ', params='', query='', > fragment='actor.parquet') > This is trivial to reproduce with the following code which uses the > `pd.to_parquet` and `pd.read_parquet` interfaces: > {code:python} > import pandas as pd > x = pd.DataFrame({"a": [1,2,3]}) > x.to_parquet("bad # actor.parquet") > x.read_parquet("bad # actor.parquet") > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)