Fwd: bzr 1.9rc1 -> AttributeError: 'NoneType' object has no attribute 'write'
Asmodehn Shade
asmodehn at gmail.com
Sat Nov 1 13:27:45 GMT 2008
ok apparently it s because by default sudo doesnt set the home of the
targetted user...
so if I do
sudo -H -u autobzr sh -c "cd /home/autobzr/deployBZR/branch && bzr revno"
it works fine...
but then I wonder why it used to work in 1.8...
Anyway problem solved ;-)
Cheers,
--
Alex
2008/10/31 John Arbash Meinel <john at arbash-meinel.com>
-----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Asmodehn Shade wrote:
> > Hi all,
> >
> > just found a new / different behaviour in bzr 1.9
> >
> > when doing a :
> >
> > sudo -u autobzr sh -c "cd /home/autobzr/deployBZR/branch && bzr revno"
> >
> > I get :
> >
> > No handlers could be found for logger "bzr"
> > Traceback (most recent call last):
> > File "/usr/bin/bzr", line 129, in ?
> > bzrlib.trace.enable_default_logging()
> > File "/usr/lib/python2.4/site-packages/bzrlib/trace.py", line 253, in
> > enable_default_logging
> > bzr_log_file.write(start_time.encode('utf-8') + '\n')
> > AttributeError: 'NoneType' object has no attribute 'write'
> >
> > this used to work on the previous version as far as I remember...
> >
> > also
> >
> > sudo -u autobzr -i
> > and then sh -c "cd /home/autobzr/deployBZR/branch&& bzr revno"
> >
> > give the correct output : 45
> >
> > I understand that "No handlers could be found for logger "bzr"" could be
> > a problem, but I am pretty sure it used to return the revno anyway
> > instead of
> > AttributeError: 'NoneType' object has no attribute 'write'
> >
> > Any idea ? I can test a bit further if needed... let me know
> >
> > Cheers,
> > --
> > Alex
>
> It seems that we are failing to open the log file, which is causing the
> "No handlers could be found" problem.
>
> I didn't realize that _open_bzr_log could fail and return None, so I was
> unconditionally writing to the file. So a simple "if None" will probably
> be sufficient to handle some of that.
>
> I'll try to put something together, though understanding why we are
> failing to open the log file might be worth investigation.
>
> John
> =:_>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkkLUNIACgkQJdeBCYSNAAOGWgCfU1+humFTRKL52uN22GQQn2Cw
> v4IAoKD87GAx2mFX+3a3MgTpFGSwDuSJ
> =+PVg
> -----END PGP SIGNATURE-----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20081101/04925c35/attachment.htm
More information about the bazaar
mailing list