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

TypeError: can only concatenate str (not "type") to str instead of actual error #3102

Closed
aidin36 opened this issue Oct 25, 2018 · 6 comments · Fixed by #3159
Closed

TypeError: can only concatenate str (not "type") to str instead of actual error #3102

aidin36 opened this issue Oct 25, 2018 · 6 comments · Fixed by #3159
Assignees
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@aidin36
Copy link

aidin36 commented Oct 25, 2018

Issue description

In some cases, pipenv outputs TypeError: can only concatenate str (not "type") to str instead of the actual error (or after printing out the actual error). It faces an error while handling the actual error.

Steps to replicate

Set WORKON_HOME to somewhere that current user doesn't have permission for writing to. Example:

WORKON_HOME=/opt/ pipenv install


I encountered the issue on the latest source code from the Github.

@christonomous
Copy link

christonomous commented Oct 26, 2018

I get this error by starting pipenv shell. There actually two errors I found:

ModuleNotFoundError: No module named 'pkgutil'

and

TypeError: can only concatenate str (not "type") to str

directly after running pipenv shell

C:\Users\Me\git\pdf-organize-automation>pipenv shell
Creating a virtualenv for this project…
Pipfile: C:\Users\Me\git\pdf-organize-automation\Pipfile
Using c:\users\me\appdata\local\programs\python\python37\python.exe (3.7.0) to create virtualenv…

I am not sure, what I can do

@techalchemy
Copy link
Member

The issue is a problem with a dependency in pipenv. You can fix this by installing from the working update until the release is out: pip install git+https://github.com/pypa/pipenv.git@update-vendor#egg=pipenv

@jxltom
Copy link
Contributor

jxltom commented Nov 1, 2018

Hi @techalchemy Could you look at this issue again? I still get this issue when I installed latest master branch with commit e3ee806. Thanks.

✗ pipenv lock
Locking [dev-packages] dependencies...
✔ Success! Locking...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.10.14.dev0', 'console_scripts', 'pipenv')()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli/command.py", line 316, in lock
    pypi_mirror=state.pypi_mirror,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1082, in do_lock
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 403, in venv_resolve_deps
    return json.loads(c.out.split("RESULTS:")[1].strip())
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/delegator.py", line 133,in out
    self.__out = self._pexpect_out
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/delegator.py", line 117,in _pexpect_out
    result += self.subprocess.after
TypeError: cannot concatenate 'str' and 'type' objects

@techalchemy
Copy link
Member

Yikes. Any chance you can print or log the type? I’m guessing it’s an EOF still?

@jxltom
Copy link
Contributor

jxltom commented Nov 4, 2018

@techalchemy Hi, I found it is TIMEOUT. I made a PR #3159 for that.

@namanipradeep
Copy link

Hi ,

When I am trying to build pypika query for casting I am also getting same error, The code snippet will be(TypeError: can only concatenate str (not "type") to str)

col_name = 'fn.Cast(' + aliasName + '.' + columnNamevalue + ','+ SqlTypes +'.'+ castTypevalue+')'

Can any one help on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants