[ 
https://issues.apache.org/jira/browse/ARROW-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16372059#comment-16372059
 ] 

ASF GitHub Bot commented on ARROW-2131:
---------------------------------------

pitrou commented on a change in pull request #1640: ARROW-2131: [Python] 
Prepend module path to PYTHONPATH when spawning subprocess
URL: https://github.com/apache/arrow/pull/1640#discussion_r169786220
 
 

 ##########
 File path: python/pyarrow/tests/test_serialization.py
 ##########
 @@ -580,6 +580,21 @@ def deserialize_regex(serialized, q):
     p.join()
 
 
+def _get_modified_env_with_pythonpath():
+    # Prepend pyarrow root directory to PYTHONPATH
+    env = os.environ.copy()
+    existing_pythonpath = env.get('PYTHONPATH', '')
+    if sys.platform == 'win32':
+        sep = ';'
+    else:
+        sep = ':'
+
+    module_path, _ = os.path.split(pa.__path__[0])
 
 Review comment:
   `os.path.abspath(os.path.dirname(pa.__file__))`, no?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Python] Serialization test fails on Windows when library has been built in 
> place / not installed
> -------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-2131
>                 URL: https://issues.apache.org/jira/browse/ARROW-2131
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> I am not sure why this doesn't come up in Appveyor:
> {code}
> ================================== FAILURES 
> ===================================
> ________________ test_deserialize_buffer_in_different_process 
> _________________
>     def test_deserialize_buffer_in_different_process():
>         import tempfile
>         import subprocess
>         f = tempfile.NamedTemporaryFile(delete=False)
>         b = pa.serialize(pa.frombuffer(b'hello')).to_buffer()
>         f.write(b.to_pybytes())
>         f.close()
>         dir_path = os.path.dirname(os.path.realpath(__file__))
>         python_file = os.path.join(dir_path, 'deserialize_buffer.py')
> >       subprocess.check_call([sys.executable, python_file, f.name])
> pyarrow\tests\test_serialization.py:596:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _
> popenargs = (['C:\\Miniconda3\\envs\\pyarrow-dev\\python.exe', 
> 'C:\\Users\\wesm\\code\\arrow\\python\\pyarrow\\tests\\deserialize_buffer.py',
>  'C:\\Users\\wesm\\AppData\\Local\\Temp\\tmp1gi__att'],)
> kwargs = {}, retcode = 1
> cmd = ['C:\\Miniconda3\\envs\\pyarrow-dev\\python.exe', 
> 'C:\\Users\\wesm\\code\\arrow\\python\\pyarrow\\tests\\deserialize_buffer.py',
>  'C:\\Users\\wesm\\AppData\\Local\\Temp\\tmp1gi__att']
>     def check_call(*popenargs, **kwargs):
>         """Run command with arguments.  Wait for command to complete.  If
>         the exit code was zero then return, otherwise raise
>         CalledProcessError.  The CalledProcessError object will have the
>         return code in the returncode attribute.
>         The arguments are the same as for the call function.  Example:
>         check_call(["ls", "-l"])
>         """
>         retcode = call(*popenargs, **kwargs)
>         if retcode:
>             cmd = kwargs.get("args")
>             if cmd is None:
>                 cmd = popenargs[0]
> >           raise CalledProcessError(retcode, cmd)
> E           subprocess.CalledProcessError: Command 
> '['C:\\Miniconda3\\envs\\pyarrow-dev\\python.exe', 
> 'C:\\Users\\wesm\\code\\arrow\\python\\pyarrow\\tests\\deserialize_buffer.py',
>  'C:\\Users\\wesm\\AppData\\Local\\Temp\\tmp1gi__att']' returned non-zero 
> exit status 1.
> C:\Miniconda3\envs\pyarrow-dev\lib\subprocess.py:291: CalledProcessError
> ---------------------------- Captured stderr call 
> -----------------------------
> Traceback (most recent call last):
>   File "C:\Users\wesm\code\arrow\python\pyarrow\tests\deserialize_buffer.py", 
> line 22, in <module>
>     import pyarrow as pa
> ModuleNotFoundError: No module named 'pyarrow'
> =============== 1 failed, 15 passed, 4 skipped in 0.40 seconds 
> ================
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to