Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538868 - app-portage/layman - layman-updater: TypeError: coercing to Unicode: need string or buffer, NoneType found
Summary: app-portage/layman - layman-updater: TypeError: coercing to Unicode: need str...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Layman Overlay Manager project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 22:53 UTC by Austin M. Matherne
Modified: 2016-05-10 04:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Austin M. Matherne 2015-02-04 22:53:44 UTC
I receive the below error when running layman-updater per the migration guide (https://wiki.gentoo.org/wiki/Project:Portage/Sync#Migration):

Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/layman-updater", line 30, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/layman/updater.py", line 88, in __call__
    elif not self.check_is_new():
  File "/usr/lib64/python2.7/site-packages/layman/updater.py", line 99, in check_is_new
    if not os.access(self.config[conf], os.F_OK):
TypeError: coercing to Unicode: need string or buffer, NoneType found
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2015-02-05 01:07:35 UTC
Please post your `emerge --info app-portage/layman' output in a comment.
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2015-02-05 01:55:41 UTC
Can you please attach a copy of your layman.cfg please.  It is easy enough to test for conf to not be None, but it should not have been None to begin with.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2015-02-05 02:17:30 UTC
Actually, no need for more info. I've traced the problem.

In the wiki I didn't put a space between them, the code was looking to 
split on ', ', not just ','.  No worries we're changing that to split on the ',' only and trim any spaces.
Comment 4 Michael Rowell 2015-02-05 04:42:19 UTC
... I am having a number of problems with this migration process pertaining to layman-updater. The first major issue is described by this bug. After that, however, are the following: 

layman-updater will crash with system default python at version 3.x instead of 2.x (forcing layman-updater to use 2.x would be superior); layman-updater will crash if the "/etc/portage/repos.conf" directory doesn't exist; if repos.conf directory DOES exist, layman-updater will crash after creating an empty repos.conf/layman.conf, and running layman-updater a second time after that will still leave an empty layman.conf, but with the apparently non-crashy output:

*   Automatic db rename: db already updated: /var/lib/layman/installed.xml

Additionally there are a number of typos in the wiki migration guide, and not much explanation as to why we need to migrate anything at all beyond an apparently new Portage plug-in system. Shall I create a multitude of new bugs for all these things, or can we just rename this one to "Horribly Broken layman-updater Makes Apparently Necessary Migration as Per News Item Extraordinarily Difficult and/or Painful"?

Either that or my Python is so broken as to provide proof of the existence of the Devil himself or something stupid like that.
Comment 5 Devan Franchini (RETIRED) gentoo-dev 2015-02-05 04:56:42 UTC
(In reply to Michael Rowell from comment #4)
> ... I am having a number of problems with this migration process pertaining
> to layman-updater. The first major issue is described by this bug. After
> that, however, are the following: 
> 
> layman-updater will crash with system default python at version 3.x instead
> of 2.x (forcing layman-updater to use 2.x would be superior); layman-updater
> will crash if the "/etc/portage/repos.conf" directory doesn't exist; if
> repos.conf directory DOES exist, layman-updater will crash after creating an
> empty repos.conf/layman.conf, and running layman-updater a second time after
> that will still leave an empty layman.conf, but with the apparently
> non-crashy output:
> 
> *   Automatic db rename: db already updated: /var/lib/layman/installed.xml
> 
> Additionally there are a number of typos in the wiki migration guide, and
> not much explanation as to why we need to migrate anything at all beyond an
> apparently new Portage plug-in system. Shall I create a multitude of new
> bugs for all these things, or can we just rename this one to "Horribly
> Broken layman-updater Makes Apparently Necessary Migration as Per News Item
> Extraordinarily Difficult and/or Painful"?
> 
> Either that or my Python is so broken as to provide proof of the existence
> of the Devil himself or something stupid like that.

Which version of layman are you using? If it's not the -9999 version then I suggest you stave off the migration until the next official release as the previous version still had some bugs in it with handling repos.conf (my own fault). If you ARE using the -9999 version, I suggest you re-emerge it as we've been pushing some fixes to the branch within these past few hours.
Comment 6 Michael Rowell 2015-02-05 06:44:03 UTC
(In reply to Devan Franchini from comment #5)
> (In reply to Michael Rowell from comment #4)
...
> 
> Which version of layman are you using? If it's not the -9999 version then I
> suggest you stave off the migration until the next official release as the
> previous version still had some bugs in it with handling repos.conf (my own
> fault). If you ARE using the -9999 version, I suggest you re-emerge it as
> we've been pushing some fixes to the branch within these past few hours.

2.2.0-r7. Guess I'll hold off for now. Someone pushed a news item a little early, eh? I see the wiki is getting updated with additional information, at least. Thanks for all your hard work.
Comment 7 Devan Franchini (RETIRED) gentoo-dev 2015-02-05 07:14:47 UTC
Expect to see a new release soon. It's mostly ready, we're just ironing out a few wrinkles haha
Comment 8 Brian Dolbec (RETIRED) gentoo-dev 2015-02-05 09:37:15 UTC
No, I don't think I pushed it out too soon.  It stopped getting feedback on the gentoo-dev mail list, the wiki had been reported as being nearly there.  But the only way to get all the wrinkles out is to give it more exposure, so more people can expose the weak spots.

When you know how it is suppose to be done, it is much harder to figure out how people that don't will screw up/misinterpret, ... ;)

So, I sent out the news item.  The first people that would work on it would be the ~arch users with a little more experience and daring.  That will get more wrinkles exposed and fixed, just like it has in this bug.  That is also one of main the reasons ~arch exists.  If I had released the package bumps today as well, THAT would have been premature and caused more grief.

Once things have settled down at this stage, I will release the actual versions of portage and layman that required the changes.  In the meantime, existing portage may just complain a bit about some extra settings in the repos.conf files.
Comment 9 Austin M. Matherne 2015-02-10 00:23:24 UTC
Trying this again with the updated guide (app-portage/layman-2.3.0 and sys-apps/portage-2.2.16), and I'm receiving a different error.

~ layman-updater -R
layman-updater -R usage: layman-updater [-h] [-H] [-c CONFIG] [--version]
layman-updater: error: unrecognized arguments: -R
Comment 10 Austin M. Matherne 2015-02-10 00:39:26 UTC
Scratch that. I misread my log file. I'm not on layman-2.3.0 yet. I'm having a compiling issue at the moment. I'll report back after I get that figured out.
Comment 11 Devan Franchini (RETIRED) gentoo-dev 2016-05-10 04:41:28 UTC
2.4.1 is out which resolves this issue, therefore, I'm resolving the bug.