-
Notifications
You must be signed in to change notification settings - Fork 34
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
IndexError: string index out of range #108
Comments
Few questions:
|
|
What was the search query that produced the error? |
Greek letters/words |
Can you give a specific instance of a query that raises error? Trying with Greek or Cyrillic or Kanji letters myself works successfully. |
First example: "νομιζω ειχα πεθάνει" |
Does the message itself display fine in chat history, the message that contains this text? Can you give the contents of the matching message? |
The message appears itself fine in the history but not when im trying to search the keywords. |
Can you give the contents of the matching message? |
no, can i help you differently? |
A round of 20 questions, then :)
|
everything is normal no big text in every line nothing special.. |
Can you respond to questions 1 and 4? |
|
Difficult to track this problem down without specific information.. Can you try the following:
dc = wx.MemoryDC()
dc.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL, faceName=conf.HistoryFontName))
width = page.html_searchall.Size.width * 5 // 9
from wx.lib.wordwrap import wordwrap And then see what are the results when you try invoking the following statement with different texts: wordwrap("YOURTEXT", width, dc) |
Is that correct? |
And now replace YOURTEXT with the contents of the message, whole and different parts of it, to see when and how the error occurs. |
Im not sure if i did it correctly. `2022-05-03 21:51:32.914 An unexpected error has occurred:
2022-05-03 21:52:23.848 An unexpected error has occurred:
|
You need to put the text in quotes, like wordwrap("ειχα", width, dc) |
@1337-537h Are you still interested in getting this resolved? |
sure but i can do nothing. |
Well, what were the results of trying #108 (comment) ? |
I think i did that when you told me and i reply you what happend. |
In #108 (comment) I gave further guidance on how to test the different parts of the problematic text. |
Can you identify a minimal text that raises this error, and that you are willing to share? |
I remember that happens when i search this word "ειχα" |
I think you misunderstood the guidance. After the wordwrap("ειχα", width, dc) Replacing |
same thing after that too. |
Ok, how about you try this:
wordwrap_original = wx.lib.wordwrap.wordwrap
def wordwrap_logged(text, width, dc, breakLongWords=True, margin=0):
try: return wordwrap_original(text, width, dc, breakLongWords, margin)
except Exception as e:
main.logger.info("ERROR WRAPPING %r: %s", text, e)
raise
wx.lib.wordwrap.wordwrap = wordwrap_logged And then try searching again with a text that raises error. This will print the exact problematic text to the Skyperious log window (menu Help -> Show log window). |
I didn't spot any difference.. |
You seemed to have missed pasting the last line: wx.lib.wordwrap.wordwrap = wordwrap_logged |
What you mean? In Python console i put:
|
Right, it's there, but it should be on a separate line - in the screenshot it has become part of the |
How do to that? |
Just copy-paste the blocks one by one, pressing Enter a few times in between. First: wordwrap_original = wx.lib.wordwrap.wordwrap Then: def wordwrap_logged(text, width, dc, breakLongWords=True, margin=0):
try: return wordwrap_original(text, width, dc, breakLongWords, margin)
except Exception as e:
main.logger.info("ERROR WRAPPING %r: %s", text, e)
raise And then: wx.lib.wordwrap.wordwrap = wordwrap_logged |
The trick was to press enter two times in the second command. |
Can you show a more complete screenshot of the log window? |
Ok, so the error information gets logged now. Can you show me the precise value that got ERROR WRAPPING? |
nooo.. its just a greek text.. is there any other way that can i help you? |
Is all of it Greek text? If not, you can replace Greek letters with X. |
Thats another greek word that popup the same error that i can share the screenshot. I search for the word "τεστ" (test in greek) |
Aha, got it. The problem comes up with text emoticons. Thank you, this gives me enough information to try fixing it. |
Good news finally. |
Should be fixed in the newly released v5.2 - can you confirm? |
Problem should be solved, no more feedback for 2 weeks - closing issue. |
Traceback (most recent call last):
File "skyperious\workers.py", line 276, in run
File "skyperious\skypedata.py", line 1849, in parse
File "skyperious\skypedata.py", line 2341, in dom_to_html
File "skyperious\workers.py", line 143, in
File "wx\lib\wordwrap.py", line 36, in wordwrap
IndexError: string index out of range
The text was updated successfully, but these errors were encountered: