4689: open browser opens an internal browser

tomin

What version are you running?

rbt --version
RBTools 0.7.11

What steps will reproduce the problem?

  1. rbt post -o
  2. or OPEN_BROWSER = False in .reviewboardrc

What is the expected output? What do you see instead?

It used to open a standard browser like Chrome before.
It shows a internal browser having login page

What operating system are you using?

On win7, babun

Attach the debug out from the command.

rbt post -o --debug                                                                                      /cygdrive/c/d322axgui
>>> RBTools 0.7.11
>>> Python 2.7.14 (default, Oct 31 2017, 21:15:21)
[GCC 6.4.0]
>>> Running on CYGWIN_NT-6.1-WOW-2.10.0-0.325-5-3-i686-32bit
>>> Home = /home/steven
>>> Current directory = /cygdrive/c/..
>>> Command line: rbt post -o --debug
>>> Running: tf vc help
>>> Checking for a Subversion repository...
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> repository info: Path: svn+ssh:/..., Base path: .., Supports changesets: False
>>> Making HTTP GET request to https://reviewboard:1443/api/
>>> Making HTTP GET request to https://reviewboard:1443/api/repositories/?tool=Subversion
>>> Cached response for HTTP GET https://reviewboard:1443/api/repositories/?tool=Subversion expired and was modified
>>> Making HTTP GET request to https://reviewboard:1443/api/repositories/1/info/
>>> Cached response for HTTP GET https://reviewboard:1443/api/repositories/1/info/ expired and was modified
>>> repository info: Path: svn+ssh://readonly@svn/ax, Base path: .., Supports changesets: False
>>> Running: svn --non-interactive info
>>> Running: diff --version
>>> Running: svn --non-interactive --version -q
>>> repository info: Path: svn+ssh://.., Base path: .., Supports changesets: False
>>> Running: svn --non-interactive status -q --ignore-externals
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE
>>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry -r BASE --no-diff-deleted
>>> Running: svn --non-interactive info static/javascript/main.js
>>> Running: svn --non-interactive info static/javascript/main.js
>>> Running: svn --non-interactive info static/javascript/main.js
>>> Generated diff size: 1752 bytes
>>> Making HTTP GET request to https://reviewboard:1443/api/validation/diffs/
>>> Cached response for HTTP GET https://reviewboard:1443/api/validation/diffs/ expired and was modified
>>> Making HTTP POST request to https://reviewboard:1443/api/validation/diffs/
>>> Making HTTP GET request to https://reviewboard:1443/api/review-requests/?only-links=create&only-fields=
>> Making HTTP PUT request to https://reviewboard:1443/api/review-requests/156066/draft/
Review request #156066 posted.

Please provide any additional information below.

It used to work with old version and I like it.

chipx86
#1 chipx86

We use Python's built-in support (the webbrowser module) for opening URLs. It runs through a series of checks, trying to find the right browser to open and trying to open a page in it. If it fails to do this, it falls back to the next available browser in the sequence. The one you're seeing is one of the fallbacks.

We have no control over this logic, and if it's getting all the way down to this browser, then it's most likely that the environment you're running it in doesn't have access to your web browser for some reason. If you're SSH'd in to a remote system, or running this from the Windows for Linux Subsystem, these may be the causes. If on WSL, it's going to be looking for a Linux desktop environment, which you won't have, and that'd be why it's falling back on the console web browsers. It won't be identifying as Windows and won't be seeing your browsers.

If you're able to invoke the browser you want from the same terminal you're running rbt in, then one option is to set the BROWSER environment variable to the command needed to launch a page in a browser. This will instruct Python to execute that command when we attempt to open in a browser.

See https://docs.python.org/2/library/webbrowser.html

  • -open browser opens an internal browser
    +open browser opens an internal browser
david
#2 david
  • -New
    +ThirdParty