Giter Club home page Giter Club logo

Comments (4)

ZyX-I avatar ZyX-I commented on July 22, 2024

Please before posting such reports use either new patch (hope it gets applied soon) or change if exists('*pyeval') to if 0&&exists('*pyeval') in powerline/ext/vim/powerline.vim. There is exactly no way we can deduce what happens here without knowing either full environment (steps how to reproduce the problem starting from vim -u NONE is likely to be enough; using real full environment information will require too much effort to reproduce the problem if it is not obvious from the vim -u NONE steps) or the stack trace (printed with the patch or when using compatibility function: this is what I described in first sentence). I guess this information needs to be added to troubleshooting section.

In any case, even if there was stack trace, do post bug reports for any vim plugin that contain sentences like “When doing vim -u NONE --cmd 'python from powerline import …', vim displays errors”. “Error during startup” expressed here is almost never helpful (especially without good stack traces which are not available for pure VimL plugins; and for pyeval()): if this happened on developer’s machines they would have already known. If this did not happen, they begin to know nothing except that “it does not work on @trevor’s machine”.

The only thing I can currently suggest is doing mv ~/.config/powerline{.bak} (if ~/.config/powerline exists) and git reset --hard HEAD in powerline repository. If this helps your issue is not our issue, but issue with your configuration.

from powerline.

Lokaltog avatar Lokaltog commented on July 22, 2024

Please check out the solution in #37 as well. A recent change of some file locations may be the cause of this error, and a clean checkout could hopefully resolve your issue. I'll close this, please open a new issue with full error messages if you still experience any problems after trying the solution.

from powerline.

trevor avatar trevor commented on July 22, 2024

substituted for if 0&&exists('*pyeval')

Executing BufWinEnter Auto commands for "*"
autocommand call s:UpdateWindows()

Error detected while processing function <SNR>11_UpdateWindows..<SNR>11_pyeval:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 545, in uuid4
    import random
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom
Executing BufWinEnter Auto commands for "*"
autocommand call s:UpdateWindows()

function uuid4 in uuid.py:

def uuid4():
    """Generate a random UUID."""

    # When the system provides a version-4 UUID generator, use it.
    if _uuid_generate_random:
        _buffer = ctypes.create_string_buffer(16)
        _uuid_generate_random(_buffer)
        return UUID(bytes=_buffer.raw)

    # Otherwise, get randomness from urandom or the 'random' module.
    try:
        import os
        return UUID(bytes=os.urandom(16), version=4)
    except:
        import random
        bytes = [chr(random.randrange(256)) for i in range(16)]
        return UUID(bytes=bytes, version=4)

it appears to catching an exception when os.urandom(16) is run when originally called by s:pyeval('str(uuid.uuid4())'). issue isn't present in python repl.

from powerline.

trevor avatar trevor commented on July 22, 2024

this solved it python-mode/python-mode#87 (comment)

thanks

from powerline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.