GithubHelp home page GithubHelp logo

Syntax Error about vcprompt HOT 9 CLOSED

djl avatar djl commented on August 29, 2024
Syntax Error

from vcprompt.

Comments (9)

djl avatar djl commented on August 29, 2024

I'm unable recreate this on any version of Python from 2.5.0 to the 2.7 alphas.

Which version of Python and vcprompt are you running?

from vcprompt.

wesbaker avatar wesbaker commented on August 29, 2024

Python 2.6.4 and I'm using this version of vcprompt (http://github.com/xvzf/vcprompt/raw/master/bin/vcprompt); just downloaded it today.

from vcprompt.

djl avatar djl commented on August 29, 2024

A few things to try:

  • Try to run it manually (i.e. python ~/bin/vcprompt)
  • Try adding the .py extension to the file and run it again

Failing those, how is your prompt configured?

from vcprompt.

wesbaker avatar wesbaker commented on August 29, 2024

Here's my config file. I've commented out the prompt with vcprompt for the moment, but it's still there. As a heads up, I'm using zsh.

autoload -U colors
colors
setopt prompt_subst
PROMPT='%{$fg[yellow]%}%n%{$reset_color%}:%~ %{$fg[green]%}→ %{$reset_color%}'
# PROMPT='%{$fg[yellow]%}%n%{$reset_color%}:%~ %{$fg[green]%}$(vcprompt)→ %{$reset_color%}'

# Set RPROMPT to have info show up on the right, too.

#############################
# Other Options

# setopt PRINT_EXIT_VALUE

setopt CORRECT
setopt CORRECTALL

setopt hist_ignore_dups     # ignore duplication command history list
setopt share_history        # share command history data
setopt HIST_IGNORE_SPACE
setopt APPEND_HISTORY # write history only when closing
setopt EXTENDED_HISTORY # add more info

# Other tabbing options
# setopt NO_AUTO_MENU
# setopt BASH_AUTO_LIST

#############################
# Variables

# Quote pasted URLs
autoload url-quote-magic
zle -N self-insert url-quote-magic

HISTFILE=~/.zsh_history
SAVEHIST=10000
HISTSIZE=10000

REPORTTIME=10 # Show elapsed time if command took more than X seconds
LISTMAX=0 # ask to complete if top of list would scroll off screen

# Load completions for Ruby, Git, etc.
autoload compinit
compinit

# Make CTRL-W delete after other chars, not just spaces
WORDCHARS=${WORDCHARS//[&=\/;\!#%\{]}

bindkey -e

from vcprompt.

djl avatar djl commented on August 29, 2024

Well, I'm stumped :(

I'm pretty sure it's not a problem with vcprompt. I've tested on OS X, Ubuntu and FreeBSD Python builds and it worked without issue.

Does Python still choke if you run a really simple script? Something like this should be enough:

#!/usr/bin/env python
from __future__ import with_statement
with open('/dev/null', 'w') as devnull:
    devnull.write('wtf is going on?')

If that doesn't work, then it may be a problem with your Python build but I have no idea what would cause it.

from vcprompt.

wesbaker avatar wesbaker commented on August 29, 2024

I'm getting a pretty strange error:

from: can't read /var/mail/__future__
test: 3: Syntax error: "(" unexpected

I'm going to try tinkering with my copy of Python.

from vcprompt.

djl avatar djl commented on August 29, 2024

Weird. It looks like vcprompt is being run as a shell script instead of a Python script.

If you run /usr/bin/env python does it drop you into a Python REPL?

from vcprompt.

wesbaker avatar wesbaker commented on August 29, 2024

Yeah, it seems to.

from vcprompt.

djl avatar djl commented on August 29, 2024

Crazy.

It's definitely not a syntax error in vcprompt (if it was, I'd also be seeing the error) but I'll leave this open for now.

The only thing I can think of now is that /usr/bin/env python isn't returning the correct Python interpreter.

Try hard-coding the path to your Python binary as the shebang line:

#!/path/to/bin/python

from vcprompt.

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.