ok apparently it s because by default sudo doesnt set the home of the targetted user...<br><div class="gmail_quote"><br>so if I do <br> sudo -H -u autobzr sh -c "cd /home/autobzr/deployBZR/branch && bzr revno"<br>
<br>it works fine...<br>
but then I wonder why it used to work in 1.8...<br><br>Anyway problem solved ;-)<br><br>Cheers,<br><br>--<br>Alex<br><br><br><div class="gmail_quote">2008/10/31 John Arbash Meinel <span dir="ltr"><<a href="mailto:john@arbash-meinel.com" target="_blank">john@arbash-meinel.com</a>></span><div>
<div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><div></div><div><br>
Asmodehn Shade wrote:<br>
> Hi all,<br>
><br>
> just found a new / different behaviour in bzr 1.9<br>
><br>
> when doing a :<br>
><br>
> sudo -u autobzr sh -c "cd /home/autobzr/deployBZR/branch && bzr revno"<br>
><br>
> I get :<br>
><br>
> No handlers could be found for logger "bzr"<br>
> Traceback (most recent call last):<br>
> File "/usr/bin/bzr", line 129, in ?<br>
> bzrlib.trace.enable_default_logging()<br>
> File "/usr/lib/python2.4/site-packages/bzrlib/trace.py", line 253, in<br>
> enable_default_logging<br>
> bzr_log_file.write(start_time.encode('utf-8') + '\n')<br>
> AttributeError: 'NoneType' object has no attribute 'write'<br>
><br>
> this used to work on the previous version as far as I remember...<br>
><br>
> also<br>
><br>
> sudo -u autobzr -i<br>
> and then sh -c "cd /home/autobzr/deployBZR/branch&& bzr revno"<br>
><br>
> give the correct output : 45<br>
><br>
> I understand that "No handlers could be found for logger "bzr"" could be<br>
> a problem, but I am pretty sure it used to return the revno anyway<br>
> instead of<br>
> AttributeError: 'NoneType' object has no attribute 'write'<br>
><br>
> Any idea ? I can test a bit further if needed... let me know<br>
><br>
> Cheers,<br>
> --<br>
> Alex<br>
<br>
</div></div>It seems that we are failing to open the log file, which is causing the<br>
"No handlers could be found" problem.<br>
<br>
I didn't realize that _open_bzr_log could fail and return None, so I was<br>
unconditionally writing to the file. So a simple "if None" will probably<br>
be sufficient to handle some of that.<br>
<br>
I'll try to put something together, though understanding why we are<br>
failing to open the log file might be worth investigation.<br>
<br>
John<br>
=:_><br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (Cygwin)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
iEYEARECAAYFAkkLUNIACgkQJdeBCYSNAAOGWgCfU1+humFTRKL52uN22GQQn2Cw<br>
v4IAoKD87GAx2mFX+3a3MgTpFGSwDuSJ<br>
=+PVg<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div></div></div><br>
</div><br>