Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete fittings after UnicodeEncodeError #356

Closed
rossos opened this issue Sep 22, 2015 · 2 comments
Closed

Cannot delete fittings after UnicodeEncodeError #356

rossos opened this issue Sep 22, 2015 · 2 comments

Comments

@rossos
Copy link

rossos commented Sep 22, 2015

I attempted to copy/paste a fitting into Pyfa from a website that (apparently) used Unicode encoding. A placeholder for the fitting (correct ship and fitting name) was created, but the tab itself was blank: no components displayed, nor even the headers such as "--- High Slots ---", etc.

Trying to delete these 'empty' fittings fails quietly: clicking the red 'minus' icon has no effect, as the fitting and its empty tab remain.

On closing Pyfa, I am directed to pyfa.exe.log where a few hundred lines of errors are given. One example is:

2015-09-22 16:01:52,809 STDERR                   ERROR    UnicodeEncodeError
2015-09-22 16:01:52,809 STDERR                   ERROR    :
2015-09-22 16:01:52,809 STDERR                   ERROR    'ascii' codec can't encode character u'\u0405' in position 7: ordinal not in range(128)
2015-09-22 16:01:53,670 STDERR                   ERROR    Traceback (most recent call last):
2015-09-22 16:01:53,670 STDERR                   ERROR      File "C:\pyfa\.\gui\sfBrowserItem.py", line 318, in OnLeftUp
2015-09-22 16:01:53,671 STDERR                   ERROR    btn.DoCallback()
2015-09-22 16:01:53,671 STDERR                   ERROR      File "C:\pyfa\.\gui\sfBrowserItem.py", line 49, in DoCallback
2015-09-22 16:01:53,671 STDERR                   ERROR    self.callback()
2015-09-22 16:01:53,673 STDERR                   ERROR      File "C:\pyfa\.\gui\shipBrowser.py", line 1644, in deleteBtnCB
2015-09-22 16:01:53,677 STDERR                   ERROR    self.deleteFit()
2015-09-22 16:01:53,678 STDERR                   ERROR      File "C:\pyfa\.\gui\shipBrowser.py", line 1653, in deleteFit
2015-09-22 16:01:53,684 STDERR                   ERROR    fit = sFit.getFit(self.fitID)
2015-09-22 16:01:53,684 STDERR                   ERROR      File "C:\pyfa\.\service\fit.py", line 248, in getFit
2015-09-22 16:01:53,686 STDERR                   ERROR    self.recalc(fit, withBoosters=True)
2015-09-22 16:01:53,686 STDERR                   ERROR      File "C:\pyfa\.\service\fit.py", line 979, in recalc
2015-09-22 16:01:53,690 STDERR                   ERROR    fit.calculateModifiedAttributes(withBoosters=withBoosters)
2015-09-22 16:01:53,690 STDERR                   ERROR      File "C:\pyfa\.\eos\saveddata\fit.py", line 428, in calculateModifiedAttributes
2015-09-22 16:01:53,691 STDERR                   ERROR    timer = Timer('Fit: {}, {}'.format(self.ID, self.name), logger)

On re-opening Pyfa I still cannot delete the bugged fittings, although I can create new ones and view other non-bugged ones just fine.

@blitzmann
Copy link
Collaborator

Can you link to where you got this fitting, or is it under a corp/alliance login? Are you using the wx3 release or the original release?

Also, please post the entire log here, or to Pastebin. I would like to see everywhere where these errors pop up.

I'm pretty sure this is simply because ('Fit: {}, {}'.format(self.ID, self.name), which tells us which fit we are calculating, does not accept unicode (which is probably in the fit's name). It would be an easy fix if this is the case, but again, I'd like to see the complete log.

@blitzmann
Copy link
Collaborator

I am pretty sure I've fixed this. The problem is that __repr__ expect a string, and we were trying to return unicode. The solution is a bit hackish, but I really didn't want to deal with python2's inicode stuff. It should work fine.

If you can test out the latest commit, feel free. Otherwise, this fix should be released next week. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants