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



6 years ago
4 years ago


(Reporter: emorley, Assigned: emorley)


Windows 8



(1 attachment)



6 years ago
From the README:

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

We should handle this properly :-)

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)

Comment 2

6 years ago
Oh and I filed 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.

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... :-)


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.

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+

Comment 7

5 years ago
Thank you :-)
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.