OmegaK2 / PyPoE

Collection of Python Tools for Path of Exile
Other
239 stars 92 forks source link

Error with Divination Cards class. #106

Closed Ruba87 closed 4 years ago

Ruba87 commented 4 years ago
C:\Users\Ruba\PyPoE>pypoe_exporter wiki items item rowid -ft-c "Гадальные карты"
12:29:03 Reading .dat files...
12:29:15 c:\users\ruba\pypoe\PyPoE\poe\file\translations.py:1440:
TranslationWarning: Malformed quantifier string "1#" near index 446733 (parent ['local_flask_gain_X_charges_when_hit']). Assuming # instead.
12:29:18 c:\users\ruba\pypoe\PyPoE\poe\file\translations.py:1017:
UnknownIdentifierWarning: Uncaptured partial quantifier string "passive_hash 1"
12:29:32 Parsing...
12:29:32 Found 297 items. Removing disabled items...
12:29:32 297 items left for processing.
12:29:32 Loading additional files - this may take a while...
12:29:33 Processing item information...
12:29:43 Traceback (most recent call last):
  File "c:\users\ruba\pypoe\PyPoE\cli\core.py", line 145, in run
    code = args.func(args)
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\handler.py", line 265, in wrapper
    result = func(parser, pargs, *args, **kwargs)
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\parsers\item.py", line 2265, in by_rowid
    self.rr['BaseItemTypes.dat'][parsed_args.start:parsed_args.end],
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\parsers\item.py", line 2441, in _export
    if not f(self, infobox, base_item_type):
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\parsers\item.py", line 85, in func
    function(self, infobox, base_item_type, data)
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\parsers\item.py", line 1719, in _currency_extra
    text=infobox['description'],
  File "c:\users\ruba\pypoe\PyPoE\cli\exporter\wiki\parser.py", line 1341, in parse_and_handle_description_tags
    TagHandler(rr).tag_handlers).replace('\n', '<br>').replace('\r', '')
  File "c:\users\ruba\pypoe\PyPoE\poe\text.py", line 145, in handle_tags
    else item for item in self.children
  File "c:\users\ruba\pypoe\PyPoE\poe\text.py", line 145, in <listcomp>
    else item for item in self.children
  File "c:\users\ruba\pypoe\PyPoE\poe\text.py", line 145, in handle_tags
    else item for item in self.children
  File "c:\users\ruba\pypoe\PyPoE\poe\text.py", line 145, in <listcomp>
    else item for item in self.children
  File "c:\users\ruba\pypoe\PyPoE\poe\text.py", line 150, in handle_tags
    return handlers[self.id](hstr=out_str, parameter=self.parameter)
KeyError: 'enchanted'

-ft-c "Гадальные карты" is the Russian-language name of Divination Cards.

ww9 commented 4 years ago

Same here. Running pypoe_exporter wiki items item by_filter -wr -ft-c "Divination Card" -d "./exported_data/cards" returns an exception:

image

I've patched poe\text.py to ignore invalid handlers (but still warn about them). I'll subtmit a PR, 1 sec.

OmegaK2 commented 4 years ago

was fixed in 1dd4dfe306613d451795b94415efddde3025c88e