Spyder: "TypeError: not enough arguments for format string" when starting Spyder in Portuguese

Created on 24 Mar 2020  Â·  15Comments  Â·  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [ ] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ ] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [ ] Restarted Spyder

    • [x] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [ ] Tried the other applicable steps from the Troubleshooting Guide

  • [x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

What steps reproduce the problem?

  1. Update spyder to 4.11


    1. 3.

What is the expected output? What do you see instead?

Spyder crashes before launch

Paste Traceback/Error Below (if applicable)


Traceback (most recent call last):
  File "/home/cristiana/anaconda3/envs/fintools/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/app/start.py", line 205, in main
    mainwindow.main()
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 3700, in main
    mainwindow = run_spyder(app, options, args)
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 3556, in run_spyder
    main.setup()
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 1217, in setup
    self.apply_shortcuts()
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/app/mainwindow.py", line 3207, in apply_shortcuts
    self.help.show_intro_message()
  File "/home/cristiana/anaconda3/envs/fintools/lib/python3.8/site-packages/spyder/plugins/help/plugin.py", line 455, in show_intro_message
    intro_message = (intro_message_eq + intro_message_common) % (
TypeError: not enough arguments for format string


Versions

  • Spyder version: 4.1.1-py38_1
  • Python version: 3.8
  • Qt version:
  • PyQt version:
  • Operating System name/version:

Dependencies

After reading some other issues, I found out that

spyder --reset

has solved the problem. But I am reporting the error anyway.

Thanks

Main Window Bug

Most helpful comment

In addition, as experience, I have tried the file pt_BR spyder.mo from earlier release 3.3.6 (from zip source) in 4.1.1 Win64 10 release. This time spyder 4.1.1 started up without any crash with file spyder.mo from spyder 3.3.6 release. I made only a test, it is not a solution.

PS: I speak brazilian portuguese too.

All 15 comments

@Cristianasp could you install for python 3.7 and check if the error persists?

Whenever I deleted a block of code, my IDE crashed too.

@yomoko, please don't step into other people issues. That has nothing to do with this, so I'm going to hide your comment.

@steff456, please take a look at this one. I think this happens when there's no shortcut to show help, i.e. instead of Ctrl+I people has nothing in preferences for it.

@steff456 @ccordoba12 seems like this related with:

  • Not having a shortcut for inspect object (for the Editor and the Console) -> Ctrl+I
  • Having the Help plugin in plain text mode

However, I not able to reproduce this since on Windows the Help plugin always shows the rich mode version even when I set rich_mode = False in the spyder.ini config file

Forgot to mention that I got this error on Ubuntu.

Em qui, 26 de mar de 2020 00:37, Daniel Althviz Moré <
[email protected]> escreveu:

@steff456 https://github.com/steff456 @ccordoba12
https://github.com/ccordoba12 seems like this related with:

  • Not having a shortcut for inspect object (for the Editor and the
    Console) -> Ctrl+I
  • Having the Help plugin in plain text mode

However, I not able to reproduce this since on Windows the Help plugin
always shows the rich mode version even when I set rich_mode = False in
the spyder.ini config file

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/spyder-ide/spyder/issues/11953#issuecomment-604210005,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHDBTAR23FAVNWKYLFMKM5DRJLEWVANCNFSM4LSSBFFQ
.

Thanks @Cristianasp! I use Kubuntu, so I'll try to reproduce it.

Gretings, I have the same issue only in portuguese, exactly in the plugin.py file
File ...."plugin.py", line 455, in show_intro_message
intro_message = (intro_message_eq + intro_message_common) % (
TypeError: not enough arguments for format string

I also tried other languages (English, French and Spanish) only potuguese presented the related issue.

After reset, spyder --reset, has partially resolved the issue.

I find issue here:
%HOME%Anaconda3Libsite-packagesspyderlocalept_BRLC_MESSAGES file spyder.mo won't let spyder start in Brazilian Portuguese! At least in Windows 10 64.

Thanks @cpkc for the help finding out the cause of this! Probably the translation string in Portuguese has more % characters than the parameters that are actually passed!

@cpkc, thanks a lot for finding the problem!!

@steff456, now you know how to fix this one.

Interesting... My spyder language is English but it happens that I speak brazilian portuguese so it should be somewhere in the code of some configuration files!

In addition, as experience, I have tried the file pt_BR spyder.mo from earlier release 3.3.6 (from zip source) in 4.1.1 Win64 10 release. This time spyder 4.1.1 started up without any crash with file spyder.mo from spyder 3.3.6 release. I made only a test, it is not a solution.

PS: I speak brazilian portuguese too.

@cpkc, thanks a lot for finding the problem!!

@steff456, now you know how to fix this one.

Dears @ccordoba12, @dalthviz and @Cristianasp

I think I found a solution (or the solution), line 3344 %HOME%Anaconda3Libsite-packagesspyderlocalept_BRLC_MESSAGESspyder.po :

"#: spyder/plugins/help/plugin.py:410
msgid "Here you can get help of any object by pressing %s in front of it, either on the Editor or the Console.%s"
msgstr "Aqui você pode obter ajuda de qualquer objeto pressionando %s na frente dele no Editor, ou %s na frente dele no Console.%s"" there is an extra %s beetween the words "ou" and "na". I have tried on a VM XUbuntu and msgfmt to compile .po file, worked fine as well.

@cpkc, that's great!! I can understand the source of the problem now: it seems the Portuguese translator copied the translated string from spyder/plugins/help/plugin.py:414 to spyder/plugins/help/plugin.py:410, without noticing that the one in line 414 has an extra %s.

I did the fix myself here:

https://github.com/spyder-ide/spyder/blob/8a2cdde1795bbd87664489f1954ed2748729b3dc/spyder/locale/pt_BR/LC_MESSAGES/spyder.po#L3396-L3398

and it'll be part of our next version (4.1.3), to be released at the end of the month.

Thanks a lot @Cristianasp for reporting and @cpkc for finding the cause!!

Was this page helpful?
0 / 5 - 0 ratings