bzexport should output a clearer warning for sqlite3 import errors on Windows

RESOLVED FIXED

Status

RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Trunk
x86
Windows 8

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
From the README:
{
NOTE FOR WINDOWS USERS
----------------------

bzexport attempts to be clever and borrow your Bugzilla login cookies
from your Firefox profile. This does not work on the windows binary
releases of Mercurial, as shipped with MozillaBuild, so you'll need
to add your username and password to your .hgrc as described below.
(The technical reason is that the binary Mercurial releases use
py2exe to freeze a Python install into the hg binary, which leaves
out modules that aren't used, including the sqlite3 module which
bzexport needs to read cookies.sqlite.)
}

Example console output:
{
$ hg bzexport -e
Failed to get bugzilla login cookies from Firefox profile at C:\Users\Foo\AppData\Roaming\Mozilla\Firefox\Profiles/bar.default: No module named _sqlite3Warning: 'NoneType' object is not iterable
No bugzilla login cookies found in profile.
Enter username for https://bugzilla.mozilla.org/:
...
}

We should handle this properly :-)
(Assignee)

Comment 1

6 years ago
Created attachment 733414 [details] [diff] [review]
Patch v1

* Handles not being able to import sqlite3.
* Cleans up the way we call bzAuth().
* Misc other fixes.
Attachment #733414 - Flags: review?(ted)
(Assignee)

Comment 2

6 years ago
Oh and I filed https://bitbucket.org/tortoisehg/thg/issue/2519/please-add-sqlite3-to-tortoisehg-windows to see if we can get it added to TortoiseHg (judging from various bugs in mercurial's tracker, they seem to prefer people requesting modules be added to TortoiseHg, since it already ships with more than the stock selenic mercurial binary).
I guess, but I have no interest in shipping the TortoiseHg binary in Mozillabuild.
(Assignee)

Comment 4

6 years ago
I wasn't suggesting we did, I add TortoiseHg to my path, so use the hg binary it ships with day to day anyway. 

Anything's better than putting s-s bugzilla credentials in my hgrc... :-)
(In reply to Ed Morley [:edmorley UTC+1] from comment #4)
> Anything's better than putting s-s bugzilla credentials in my hgrc... :-)

Anything?

When I was debugging bzexport authentication problems before, I temporarily added an option to pass in the cookie. So I'd log into bugzilla, view cookies, and cut & paste.

It's better than putting a password into a text file, but painful enough that I'm not sure it's worth adding.

Otherwise, it'll prompt for a password, right? I figured that was the proper fallback. I've been tempted to remove the option of putting your password in ~/.hgrc entirely. It's so very wrong.
(Assignee)

Comment 6

6 years ago
The password prompt doesn't help me much, since I use random passwords & a third party password manager.

The other option is of course to add the ability to specify the cookie token in the hgrc and just update it every month or so.

However, let's see what comes of the filed TortoiseHg issue first perhaps. (And all of this is moot for the attached patch; since better messaging is at least a first good step).
Attachment #733414 - Flags: review?(ted) → review+
(Assignee)

Comment 7

5 years ago
Thank you :-)

http://hg.mozilla.org/users/tmielczarek_mozilla.com/bzexport/rev/6431c7633ac4
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Product: Other Applications → Developer Services
You need to log in before you can comment on or make changes to this bug.