Error when trying to run `bzr cdiff`

Bug #625584 reported by Drew Stephens
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Pager Plugin
Triaged
Low
Unassigned
BzrTools
Triaged
Low
Unassigned

Bug Description

Running `bzr cdiff` on my Mac (10.6.4) with Python 2.6.5, bzr 2.1.2.

Environment:
declare -x BROWSER="firefox"
declare -x CC="gcc"
declare -x EDITOR="vi"
declare -x FIGNORE=".svn"
declare -x HISTFILESIZE="500000"
declare -x HISTIGNORE="&:ls:ll:la:lh:sl"
declare -x HISTSIZE="100000"
declare -x HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S - "
declare -x HOME="/Users/dinomite"
declare -x HOST_COLOR="\\[\\033[1;35m\\]"
declare -x LANGUAGE="en_US.UTF-8"
declare -x LC_ALL="en_US.UTF-8"
declare -x LOGNAME="dinomite"
declare -x LSCOLORS="ExFxCxDxBxegedabagacad"
declare -x LS_OPTIONS="-G"
declare -x MAIL="/var/mail/dinomite"
declare -x OLDPWD="/Users/dinomite/sandbox/genius-oss/Utility"
declare -x PAGER="less"
declare -x PATH="/Users/dinomite/.gem/ruby/1.8/bin:.:/Users/dinomite/bin:/usr/games:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/bin:/opt/local/bin:/opt/local/sbin:/usr/lib/mpich/bin:/opt/cxoffice/bin:/opt/CollabNet_Subversion/bin:/Users/dinomite/.gem/ruby/1.8/bin:.:/Users/dinomite/bin:/usr/games:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/games/bin:/opt/local/bin:/opt/local/sbin:/usr/lib/mpich/bin:/opt/cxoffice/bin:/opt/CollabNet_Subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
declare -x PWD="/Users/dinomite/sandbox/genius-oss"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AUTH_SOCK="/tmp/ssh-GjPSdiDLE1/agent.17068"
declare -x SSH_CLIENT="64.244.66.2 41339 22"
declare -x SSH_CONNECTION="64.244.66.2 41339 192.168.1.100 22"
declare -x SSH_TTY="/dev/ttys015"
declare -x TERM="xterm-color"
declare -x USER="dinomite"

Traceback:
bzr: ERROR: exceptions.AttributeError: 'DiffWriter' object has no attribute 'isatty'

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bzrtools/command.py", line 13, in run_argv_aliases
    commands.Command.run_argv_aliases(self, argv, alias_argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bzrtools/command_classes.py", line 526, in run
    colordiff(color, check_style, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bzrtools/colordiff.py", line 203, in colordiff
    get_cmd_object('diff').run(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/pager/__init__.py", line 48, in run
    setup_pager()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/pager/__init__.py", line 12, in setup_pager
    if not sys.stdout.isatty() or not hasattr(os, 'fork'):
AttributeError: 'DiffWriter' object has no attribute 'isatty'

bzr 2.1.2 on python 2.6.5 (Darwin-10.4.0-i386-64bit)
arguments: ['/opt/local/bin/bzr', 'cdiff']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/bzrtools [2.1.0]
  launchpad /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/launchpad [2.1.2]
  netrc_credential_store /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.1.2]
  news_merge /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/news_merge [2.1.2]
  pager /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/plugins/pager [unknown]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Revision history for this message
John A Meinel (jameinel) wrote :

You can argue a bit about the fix, but we are asking the 'to_file' that bzrtools is passing in whether it 'isatty' but it doesn't have that attribute.

You can fix some of it in bzr by checking 'getattr(..., 'isatty', None)' but you can also have bzrtools pass in an object that implements isatty.

affects: bzr → bzrtools
Revision history for this message
Aaron Bentley (abentley) wrote :

This looks like it's being caused by the pager plugin. I think it makes the most sense to fix it there, instead of adding a requirement that everything passed in as to_file handle isatty.

Changed in bzrtools:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Drew Stephens (dinomite) wrote :

I can confirm that moving the pager plugin fixes the issue.

Jelmer Vernooij (jelmer)
Changed in bzr-pager:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.