pythonbrew icon indicating copy to clipboard operation
pythonbrew copied to clipboard

update to 1.2 fails on OS X 10.7.3

Open socketbox opened this issue 13 years ago • 4 comments

I'm having difficulty updating pythonbrew 1.1 to 1.2. Here's the error I received:

sb [ ~ ]$ pythonbrew update
Traceback (most recent call last):
  File "/Users/sb/.pythonbrew/scripts/pythonbrew_main.py", line 3, in <module>
    pythonbrew.main()
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/__init__.py", line 27, in main
    command.run(args[1:])
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/basecommand.py", line 21, in run
    self.run_command(options, args)
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/commands/update.py", line 52, in run_command
    self._update_pythonbrew(options, args)
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/commands/update.py", line 91, in _update_pythonbrew
    if not is_gzip(content_type, Link(download_url).filename):
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/util.py", line 60, in is_gzip
    or tarfile.is_tarfile(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2583, in is_tarfile
    t = open(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1658, in open
    return func(name, "r", fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1720, in gzopen
    fileobj = bltn_open(name, mode + "b")
IOError: [Errno 2] No such file or directory: u'pythonbrew-1.2.tar.gz'

I thought this might be related to the default system installation of Python 2.7 in OS X based upon what I read here so I installed 2.7.3 from the python.org site, and ran the update script to update my path.

After verifying that python version 2.7.3 was called by default in the shell, i ran pythonbrew update again. However, pythonbrew persists in using the interpreter under /System. Despite having looked at the code under ~/.pythonbrew, I'm unable to determine how to change this behavior.

socketbox avatar Apr 15 '12 20:04 socketbox

On Linux, too. It seems like it tries to check if the file is a tarfile before downloading it. (That's because first test on content_type is failing)

anisse avatar Apr 16 '12 07:04 anisse

I'm not sure if it is equivalent, but I was able to do a pythonbrew update --master to update via git. It now reports version 1.2, though I'm not sure if the master branch here on github tracks the release versions exactly or not.

dahjelle avatar Apr 16 '12 21:04 dahjelle

@dahjelle : it's not the same. In one case a tar.gz archive is downloaded, in the other, it's over git.

anisse avatar Apr 17 '12 06:04 anisse

Results in the same error. Using the --master flag seems to help, oddly. Though that, too, seems buggy.

sb [ ~/foo ]$ pythonbrew update
Traceback (most recent call last):
  File "/Users/sb/.pythonbrew/scripts/pythonbrew_main.py", line 3, in <module>
    pythonbrew.main()
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/__init__.py", line 27, in main
    command.run(args[1:])
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/basecommand.py", line 21, in run
    self.run_command(options, args)
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/commands/update.py", line 52, in run_command
    self._update_pythonbrew(options, args)
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/commands/update.py", line 91, in _update_pythonbrew
    if not is_gzip(content_type, Link(download_url).filename):
  File "/Users/sb/.pythonbrew/scripts/pythonbrew/util.py", line 60, in is_gzip
    or tarfile.is_tarfile(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2583, in is_tarfile
    t = open(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1658, in open
    return func(name, "r", fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1720, in gzopen
    fileobj = bltn_open(name, mode + "b")
IOError: [Errno 2] No such file or directory: u'pythonbrew-1.3.tar.gz'
sb [ ~/foo ]$ pythonbrew --version
1.1
sb [ ~/foo ]$ pythonbrew update --master
Downloading pythonbrew-master.tgz as /Users/sb/.pythonbrew/dists/pythonbrew-master.tgz
######################################################################## 100.0%
Extracting pythonbrew-master.tgz into /Users/sb/.pythonbrew/build/pythonbrew-master
Installing /Users/sb/.pythonbrew/build/pythonbrew-master into /Users/sb/.pythonbrew
The pythonbrew has been updated.
/Users/sb/.pythonbrew/bin/pythonbrew: line 3: unexpected EOF while looking for matching `"'
/Users/sb/.pythonbrew/bin/pythonbrew: line 4: syntax error: unexpected end of file
sb [ ~/.virtualenvs/tagonomy ]$ pythonbrew --version
1.3

socketbox avatar Apr 21 '12 14:04 socketbox