Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception from popen in python 3.5 #42

Open
bmerrison opened this issue Jun 7, 2019 · 1 comment
Open

Exception from popen in python 3.5 #42

bmerrison opened this issue Jun 7, 2019 · 1 comment

Comments

@bmerrison
Copy link

Trying to import pixiedust_node fails in Python 3.5, with the following error:

Pixiedust database opened successfully

Pixiedust version 1.1.17

Table USER_PREFERENCES created successfully
Table service_connections created successfully

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-4a0fd16c56d9> in <module>()
----> 1 import pixiedust_node

~/miniconda/envs/tmp/lib/python3.5/site-packages/pixiedust_node/__init__.py in <module>()
     60         # start up a Node.js sub-process running a REPL
     61         path = os.path.join(__path__[0], 'pixiedustNodeRepl.js')
---> 62         node = Node(path)
     63 
     64         # pass the node process to the Node magics

~/miniconda/envs/tmp/lib/python3.5/site-packages/pixiedust_node/node.py in __init__(self, path)
    208         # process that runs the Node.js code
    209         args = (self.node_path, path)
--> 210         self.ps = self.popen(args)
    211         #print ("Node process id", self.ps.pid)
    212 

TypeError: __init__() got an unexpected keyword argument 'encoding'

In the code, the encoding argument is passed to popen if the Python version is 3 or greater:

    if sys.version_info.major == 3:
        popen_kwargs['encoding'] = 'utf-8'

But the encoding argument was only added to popen in python 3.6 (see: https://docs.python.org/3.6/library/subprocess.html). I'm not sure if just changing the if to sys.version_info.major == 3 and sys.version_info.minor > 6 will fix the problem.

@JustinGOSSES
Copy link

I get identical error. Same Python version and Pixiedust version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants