SendCode icon indicating copy to clipboard operation
SendCode copied to clipboard

R-Box: Send current line/selection -> SendCode: int too long to convert

Open taqtiqa-mark opened this issue 6 years ago • 11 comments

Hi Thanks for all your effort on these packages.

Details: Using SublimeText 3 (build 3143) Platform Windows 7 64bit RGui.exe: /cygdrive/c/Users/\<snip\>/AppData/Roaming/R/R-3.4.1/bin/x64/Rgui.exe

Note The error is not raised when using RGui.exe: /cygdrive/c/Users/\<snip\>/AppData/Roaming/R/R-3.4.1/bin/i386/Rgui.exe

Action: Submitting an R command via R-Box provokes the following error from SendCode.

Result:

Traceback (most recent call last):
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\send_code.py", line 79, in <lambda>
    sublime.set_timeout_async(lambda: sender.send_text(cmd))
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\text_sender\sender.py", line 125, in send_text
    self.send_to_r(cmd)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\text_sender\sender.py", line 134, in send_to_r
    send_to_r(cmd)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\text_sender\r\__init__.py", line 23, in send_to_r
    winauto.paste_to_rgui(rid)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\text_sender\winauto.py", line 150, in paste_to_rgui
    pasteid = get_menu_item_info(submenu, 1).wID
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\text_sender\winauto.py", line 48, in get_menu_item_info
    ret = GetMenuItemInfo(menu, index, True, ctypes.byref(info))
ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert

taqtiqa-mark avatar Sep 18 '17 01:09 taqtiqa-mark

Is your sublime text also 64 bit?

randy3k avatar Sep 18 '17 01:09 randy3k

Thanks for looking into this issue.

Yes ST is 64 bit, but nothing in the ST help indicates that. I know because I downloaded and install the portable ZIP archive for updates.

taqtiqa-mark avatar Sep 18 '17 02:09 taqtiqa-mark

Can you try the current master to check if it fixes the issue or not?

randy3k avatar Sep 18 '17 02:09 randy3k

Thanks for the quick response. I've downloaded master 7c8a27b and unzipped this into the packages folder. After a restart of ST# the ctl+enter functionality works :)

Many thanks again.

taqtiqa-mark avatar Sep 24 '17 21:09 taqtiqa-mark

I'm running into this issue again. I note the line numbers are +1 compared to the original report.

Only points of difference on the system are:

  • upgraded R to 3.4.3
  • launched R from DOS cmd.exe
reloading plugin SublimeLinter-contrib-lintr.linter
SublimeLinter: lintr linter loaded 
reloading plugin SublimeLinter-ruby.linter
SublimeLinter: ruby linter loaded 
reloading plugin WordCount.WordCount
reloading plugin knitr.chunksend
reloading plugin SendCode.choose_prog
reloading plugin SendCode.send_code
reloading plugin SendCode.settings
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
plugins loaded
reloading settings Packages/User/Package Syncing.sublime-settings
Traceback (most recent call last):
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\send_code.py", line 88, in <lambda>
    sublime.set_timeout_async(lambda: sender.send_text(cmd))
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\sender.py", line 125, in send_text
    self.send_to_r(cmd)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\sender.py", line 134, in send_to_r
    send_to_r(cmd)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\r\__init__.py", line 23, in send_to_r
    winauto.paste_to_rgui(rid)
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\winauto.py", line 157, in paste_to_rgui
    pasteid = get_menu_item_info(submenu, 1).wID
  File "C:\Users\<>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\winauto.py", line 49, in get_menu_item_info
    ret = GetMenuItemInfo(menu, c_long(index), True, ctypes.byref(info))
ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert
Package Control: No updated packages

Appreciate any help or fix.

taqtiqa-mark avatar Dec 21 '17 03:12 taqtiqa-mark

Sendcode does not support cmd.exe. Try Cmder or Conemu instead.

randy3k avatar Dec 21 '17 03:12 randy3k

Ouch, the problem with cmder is that I get path errors from R in some unpredictable circumstances. Will switch.

Any chance baun (bash) will be supported?

taqtiqa-mark avatar Dec 21 '17 04:12 taqtiqa-mark

I am not sure what unpredictable circumstances you encountered, but in general, Cmder is favorable over the last-century-outdated-featureless cmd.exe.

randy3k avatar Dec 21 '17 05:12 randy3k

Agreed... Your speaking to an Linux refugee ;)

taqtiqa-mark avatar Dec 21 '17 05:12 taqtiqa-mark

Hi, I ran into this issues again. This time after restarting an R session.

R: /cygdrive/c/Users/<redacted>/AppData/Roaming/R/R-3.4.3/bin/i386/Rgui

Sequence of events:

  1. Launch Rgui from Cmder.
  2. Long running R session. Send Code works fine.
  3. R runs out of memory (cannot allocate memory block of size N Gb)
  4. Quit R session. Restart R from same Cmder window.
  5. Send Code works fine
  6. Repeat several times, approx. 4 times from memory.
  7. After restarting SendCode no longer works and the error below is reported

Let me know if you want this opened as a separate issue.

Traceback (most recent call last):
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\send_code.py", line 88, in <lambda>
    sublime.set_timeout_async(lambda: sender.send_text(cmd))
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\sender.py", line 125, in send_text
    self.send_to_r(cmd)
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\sender.py", line 134, in send_to_r
    send_to_r(cmd)
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\r\__init__.py", line 23, in send_to_r
    winauto.paste_to_rgui(rid)
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\winauto.py", line 157, in paste_to_rgui
    pasteid = get_menu_item_info(submenu, 1).wID
  File "C:\Users\<redacted>\AppData\Roaming\SublimeText3\Data\Packages\SendCode\code_sender\winauto.py", line 49, in get_menu_item_info
    ret = GetMenuItemInfo(menu, c_long(index), True, ctypes.byref(info))
ctypes.ArgumentError: argument 1: <class 'OverflowError'>: int too long to convert

taqtiqa-mark avatar Jan 30 '18 23:01 taqtiqa-mark

Cloud you try it on the 64bit R GUI?

randy3k avatar Jan 30 '18 23:01 randy3k