pyfa-org / Pyfa

Python fitting assistant, cross-platform fitting tool for EVE Online
GNU General Public License v3.0
1.61k stars 408 forks source link

Import fitting xml and clipboard failing #2091

Closed LucidityCrash closed 4 years ago

LucidityCrash commented 4 years ago

Bug Report

As of release 2.14.1 I can't import EFT fittings from clipboard or import xml

Expected behavior:

Fit is imported.

Actual behavior:

Clipboard import just appears to do nothing, and leaves the following in the log : Import XML just hangs on the importing page with the progress bar just spinning and elapsed time sitting at 0. Have to kill task in Task Manager to exit.

[2019-11-17 11:57:37.624497] ERROR: gui.mainFrame: Attempt to import failed:

### Detailed steps to reproduce: either try and paste plain text fit or use import xml menu option - nothing fancy ### Fits involved in EFT format (Edit > To Clipboard > EFT): Can provide privately :) ### Release or development git branch? Please note the release version or commit hash: Release 2.14.1 and 2.14.2 ### Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10): Window 10 ### Other relevant information:
DarkFenX commented 4 years ago

Send the data to phoenix@mail.ru, will look into it.

DarkFenX commented 4 years ago

Your fit format is malformed. For cargo, it specifies amount of items as x 100 instead of x100, while EFT format almost had it as latter string. Pyfa fails to process them - and fails to process whole import. I guess i could change it to process such failures more gracefully and ignore such lines.

Where did you get this from?

DarkFenX commented 4 years ago

After changes in bec58a5772fdb48f532b68c5d407916543f82644 pyfa will process such errors more gracefully. Your EFT format now imports, just w/o cargo items.

XML import failure was pyfa's fault. It did not tolerate extra node attributes. Fixed in e649683a4d420b1187d6538ee58e2e0322c25f87

DarkFenX commented 4 years ago

Leaving it open until I found out what produces malformed EFT export.

LucidityCrash commented 4 years ago

That can't be the only problem as the XML fails to import too and they both work in version 2.14.0 and below

LucidityCrash commented 4 years ago

Found the issue with the xml <?xml version="1.0" ?> works <?xml version="1.0" encoding="UTF-8"?> doesn't

DarkFenX commented 4 years ago

The EFT format-related issue appeared due to fb48f2b5d4ee08bf53240894dc342ee89ac887cc, which implemented fix for Pasting malformed text into Additions panel does not cause an error message anymore. I do not want to dig into why this fix uncovered it, but the fix I implemented now looks appropriate.

XML pasted from buffer did not work exactly due to the issue you posted. It has been fixed already, as I mentioned. I checked EFT import from buffer (works, but does not import cargo or drones), XML import from buffer (works), XML import from file (works as well).

Both fixes will be available starting from the next release.

Still, any info on where you got this EFT formatted fit is appreciated.

LucidityCrash commented 4 years ago

Thanks for the quick fix ...

The broken EFT was from a custom page that shares fittings for our alliance ... there was a bug in it which introduced a space after the x. I believe I've got that bug resolved now. This tool is also generating the xml and I think I've found a way to stop it adding the encoding option to the header, just need to test it.