Error-catching in Clothes Listing

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

Error-catching in Clothes Listing

Postby MTKnife » Fri Dec 10, 2021 6:32 pm

I spent like an hour and a half trying to fix this last night, thinking it was because I changed the location of the "Documents" directory...before thinking to check the log.

This asset causes an encoding error:
http://www.makehumancommunity.org/cloth ... t_t01.html

I don't see any weird characters in the MHCLO or MHMAT files, at least not in the initial, text parts, but there's something there, and the asset should probably be taken down. Note that it's entirely possible that this is a Windows-only problem, since Windows doesn't play nicely with Unicode.

However, the asset isn't why I'm posting here in "Bugs": the error is being caught, thus preventing the app from crashing (Makehuman is quite good about error-catching), but it's being caught at the level of the entire listing, not the individual item of clothing. The result is that, in the "Clothes" tab, the app displays all the assets it loads before hitting the bad one, and then stops loading, leaving a partial listing. It would be better to catch the error at the level of the asset in question, and skip that one (while putting up a warning).
MTKnife
 
Posts: 311
Joined: Tue Sep 01, 2015 5:22 am

Re: Error-catching in Clothes Listing

Postby Ricardo2020 » Sat Dec 11, 2021 5:31 am

I have also seen this during my sessions as well. Perhaps there is a solution, but I was unable to find it.

The workaround is to remove the defective asset from the program directory. Typically, in Windows this will be inside the Documents folder. In Linux, it can be found in Home. Either way, the file will be in the Data folder within the MakeHuman folder inside whatever folder containing said asset. Send the asset folder to the recycle bin or put it in a holding folder so that you can dissect and troubleshoot the contents.

I feel it is better to try and find out what causes MakeHuman to burp on an asset rather than taking it down outright. Finding the solution could then be sent to the author of said asset so they can correct the files and repost them as an edit session from within their own logged in channel. I would want this pertaining to anything I post here which might cause a problem. Rather than take my stuff down due to a malfunction, I would want to fix it.

Has anyone else seen this problem mentioned in the post above? If so, tell us what your solution was. I am using the holding pattern method wherein I take it out of the data folder and put it in a holding folder outside the MakeHuan directory. This seems to solve the listing issue mentioned. Kind of like killing a fly with an atom bomb, since I do not know wnat caused the asset to malfunction.
Paddle faster. I hear charango music!
User avatar
Ricardo2020
 
Posts: 130
Joined: Sat Apr 18, 2020 4:17 pm
Location: Tennessee

Re: Error-catching in Clothes Listing

Postby joepal » Tue Dec 14, 2021 9:26 am

Initial research shows that the asset works fine on linux. I'll try to set up a windows development environment to figure out what goes wrong.

Also, the asset does not contain any unicode characters. The MHMAT file is plain ASCII, while the MHCLO file is ISO-8859-1.

If you delete the line that starts with "# description: " in the mhclo file, does the error go away?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Error-catching in Clothes Listing

Postby joepal » Tue Dec 14, 2021 1:15 pm

Unfortunately, the asset works fine for me in windows too.

Can you attach a log where a crash or similar is visible?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Error-catching in Clothes Listing

Postby tomcat » Tue Dec 14, 2021 8:35 pm

I get the same error:
Code: Select all
Exception during event onShow
Traceback (most recent call last):
  File "./core\events3d.py", line 211, in callEvent
    method(event)
  File "E:\makehuman-community\makehuman\plugins\3_libraries_clothes_chooser.py", line 146, in onShow
    super(ClothesTaskView, self).onShow(event)
  File "./apps/gui\proxychooser.py", line 473, in onShow
    self.filechooser.refresh()
  File "./lib\filechooser.py", line 894, in refresh
    super(ListFileChooser, self).refresh()
  File "./lib\filechooser.py", line 580, in refresh
    self.loadHandler.refresh(files)
  File "./lib\filechooser.py", line 459, in refresh
    tags = self.library.getTags(filename = file)
  File "./apps/gui\proxychooser.py", line 646, in getTags
    return filecache.MetadataCacher.getTags(self, filename)
  File "./lib\filecache.py", line 264, in getTags
    metadata = self.getMetadata(filename)
  File "./lib\filecache.py", line 240, in getMetadata
    self.updateFileCache(self.getSearchPaths() + [os.path.dirname(fileId)], self.getFileExtensions(), False)
  File "./lib\filecache.py", line 299, in updateFileCache
    self._filecache.update(search_paths, file_extensions, self._get_metadata_callback, remove_old_entries)
  File "./lib\filecache.py", line 152, in update
    self._cache[fileId] = (mtime,) + getMetadata(filepath)
  File "./lib\filecache.py", line 190, in _get_metadata_callback
    return self.getMetadataImpl(self.getMetadataFile(filename))
  File "./apps/gui\proxychooser.py", line 175, in getMetadataImpl
    return proxy.peekMetadata(filename, self.getProxyType())
  File "./shared\proxy.py", line 1025, in peekMetadata
    for line in fp:
  File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\codecs.py", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 187: invalid continuation byte

Win 7. DecodeError …but I don't have a D: drive.
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 336
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: Error-catching in Clothes Listing

Postby joepal » Thu Dec 16, 2021 3:23 pm

That's very odd. But at least I can add a try/catch block around that specific location in order to avoid having it influence the rest of the assets.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Error-catching in Clothes Listing

Postby joepal » Thu Dec 16, 2021 3:45 pm

Potential "fix" in https://github.com/makehumancommunity/m ... 254f96d44c ... It isn't really a fix though, just a last-resort fallback to avoid having the entire list getting ruined by a broken asset.

But reading the code further down in the stack, I don't really see how the error could arise in the first place. Also, the line indicated in the stack trace is off by one compared with the current master. On what version of MH does the problem arise?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Error-catching in Clothes Listing

Postby tomcat » Thu Dec 16, 2021 4:39 pm

joepal wrote:On what version of MH does the problem arise?
Bug in 1.2.0 final (HEAD:c28443c2). In version 20211206 alpha (HEAD:1944525e) everything works fine and Jacket is displayed and put on correctly.

Potential "fix"...

Yep, everything works with this version. Well thank you!
Foreigners' reactions to Russian "Bird's Milk" candies
— Are your birds being milked?
— In Russia everyone is milked. Here even the zucchini is used to make caviar.
User avatar
tomcat
 
Posts: 336
Joined: Sun Sep 27, 2015 7:53 pm
Location: Moscow (Orcish Stan), The Aggressive Evil Empire

Re: Error-catching in Clothes Listing

Postby punkduck » Sat Dec 18, 2021 4:54 pm

oooops sorry wasn't here for a few days.

Yes woodcat. Flute was the first who had the problem, then Ricardo. Furthermore it depended if the object was an mhclo or a compiled mhpxy file already. Old MakeHuman was able to read it, new one not. So if an mhpxy was migrated the comment was not used and new one worked fine.

It was the Jacket01 (or similar) and it was an é in a comment .. I did the fix and the fix was simply ignoring coding-errors while reading lines ;)
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany


Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 1 guest