myint / scspell

Spell checker for source code
https://pypi.python.org/pypi/scspell3k
GNU General Public License v2.0
90 stars 16 forks source link

python2 set-dictionary issue #25

Open tomleo opened 6 years ago

tomleo commented 6 years ago
tom@computer:~/$ scspell --set-dictionary=/home/tom/Dropbox/work/data/spelling.txt
Traceback (most recent call last):
  File "/home/tom/hacking/energysage/env/bin/scspell", line 11, in <module>
    sys.exit(main())
  File "/home/tom/hacking/energysage/env/local/lib/python2.7/site-packages/scspell/__init__.py", line 899, in main
    set_dictionary(args.dictionary)
  File "/home/tom/hacking/energysage/env/local/lib/python2.7/site-packages/scspell/__init__.py", line 648, in set_dictionary
    config.write(f)
  File "/usr/lib/python2.7/ConfigParser.py", line 414, in write
    fp.write("\n")
TypeError: write() argument 1 must be unicode, not str
tom@computer:~/$ Python 2.7.13
tom@computer:~/$ pip freeze | grep -i scspell
scspell3k==2.1
kkmuffme commented 6 years ago

having the same issue

Traceback (most recent call last):
  File "/usr/bin/scspell", line 9, in <module>
    load_entry_point('scspell3k==2.1', 'console_scripts', 'scspell')()
  File "/usr/lib/python2.7/site-packages/scspell/__init__.py", line 899, in main
    set_dictionary(args.dictionary)
  File "/usr/lib/python2.7/site-packages/scspell/__init__.py", line 648, in set_dictionary
    config.write(f)
  File "/usr/lib64/python2.7/ConfigParser.py", line 414, in write
    fp.write("\n")
TypeError: must be unicode, not str
giosad commented 5 years ago

fixed here: https://github.com/giosad/scspell/tree/feature/config_parser_issue_py2 I just used the https://pypi.org/project/configparser/ and made minimal modifications to make the scspell to work with it.

I don't know to how to specify the dependency for pip for python 2 only through.