You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is with a dev checkout of Spyder, testing on Python 3 (3.2 on this machine, but I'll take an educated guess that it would be the same in 3.3)
What steps will reproduce the problem?
Start Spyder, and leave it running. Ensure single instance mode is on.
From a separate terminal, run 'spyder some_file.py' What is the expected output? What do you see instead? The file should be opened in the existing Spyder window. Instead I get a traceback:
Traceback (most recent call last):
File "/usr/local/bin/spyder", line 3, in
start_app.main()
File "/usr/local/lib/python3.2/dist-packages/spyderlib/start_app.py", line 81, in main
send_args_to_spyder(args)
File "/usr/local/lib/python3.2/dist-packages/spyderlib/start_app.py", line 34, in send_args_to_spyder
client.send(osp.abspath(arg))
TypeError: 'str' does not support the buffer interface
It's trying to send a unicode str object through a raw socket. It's simple enough to encode it to bytes, but it needs some care with encoding and decoding at the other end to ensure that filenames with non-ascii characters can be opened.
I think this patch should work. I've tested it on Python 3.3 and 2.7, opening files with non-ascii characters in the name both while launching Spyder and by sending the arguments across to a single-instance Spyder process. It could do with testing on Windows, but I believe it should work there too.
I'm about to apply your patch to default branch (successfully tested on Windows 8 with both Python 2.7 and Python 3.3). Thanks a lot for taking the time to test this.
I've made a modification regarding the changes in spyder.py: I'm using the "to_unicode_from_fs" function from spyderlib.utils.encoding which was doing exactly the same as you wrote initially around line 1750.
From tak...@gmail.com on 2013-07-05T17:35:26Z
This is with a dev checkout of Spyder, testing on Python 3 (3.2 on this machine, but I'll take an educated guess that it would be the same in 3.3)
What steps will reproduce the problem?
Traceback (most recent call last):
File "/usr/local/bin/spyder", line 3, in
start_app.main()
File "/usr/local/lib/python3.2/dist-packages/spyderlib/start_app.py", line 81, in main
send_args_to_spyder(args)
File "/usr/local/lib/python3.2/dist-packages/spyderlib/start_app.py", line 34, in send_args_to_spyder
client.send(osp.abspath(arg))
TypeError: 'str' does not support the buffer interface
It's trying to send a unicode str object through a raw socket. It's simple enough to encode it to bytes, but it needs some care with encoding and decoding at the other end to ensure that filenames with non-ascii characters can be opened.
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1479
The text was updated successfully, but these errors were encountered: