python - gmailR错误 "Only AF_INET sockets are currently supported on jython"

标签 python r sockets notifications

我一直在 R 中使用 gmailR 从 R 发送电子邮件,没有出现任何问题,但自一周以来它一直出现故障。有时它有效,但大多数时候无效。顺便说一句,这是来自 github 的 Trinker 包(而不是 CRAN gmailr!):https://github.com/trinker/gmailR

这是我的脚本:

library(gmailR)
chartime <- as.character(Sys.time())
email_test <- function(chartime){
  gmail("sjorsvanheuveln@gmail.com", password="************", subject = "Test No New Projects",
        message = paste("Testing time at",chartime), from = "sjorsvanheuveln@gmail.com",
        attachment = NULL, server = "smtp.gmail.com:587", username = "sjorsvanheuveln@gmail.com",
        confirmBeforeSend = FALSE, clear.username = FALSE)}
email_test(chartime)

这是错误:

Error in jython.exec(rJython, mail) : 
  Only AF_INET sockets are currently supported on jython 
7 stop(python.exception) 
6 jython.exec(rJython, mail) 
5 email.helper(to = list(to[i]), from = list(from), subject = subject, 
    message = message, attachment = atts[[i]], username = username, 
    password = password, server = server, confirmBeforeSend = confirmBeforeSend) 
4 FUN(1L[[1L]], ...) 
3 lapply(seq_along(to), function(i) {
    email.helper(to = list(to[i]), from = list(from), subject = subject, 
        message = message, attachment = atts[[i]], username = username, 
        password = password, server = server, confirmBeforeSend = confirmBeforeSend) ... 
2 gmail("sjorsvanheuveln@gmail.com", password = "**********", subject = "Test No New Projects", 
    message = paste("Testing time at", chartime), from = "sjorsvanheuveln@gmail.com", 
    attachment = NULL, server = "smtp.gmail.com:587", username = "sjorsvanheuveln@gmail.com", 
    confirmBeforeSend = FALSE, clear.username = FALSE) 
1 email_test(chartime) 

这是我的 session 信息:

   R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)

locale:
[1] nl_NL.UTF-8/nl_NL.UTF-8/nl_NL.UTF-8/C/nl_NL.UTF-8/nl_NL.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gmailR_1.0    rJython_0.0-4 rjson_0.2.15  rJava_0.9-7  

loaded via a namespace (and not attached):
[1] tools_3.1.3  XML_3.98-1.3

我该如何解决这个问题?

最佳答案

不支持 AF_INET6 已修复 Jython 2.5.2,请参阅 http://bugs.jython.org/issue1210 (您的问题出现在不同的路由器上这一事实非常表明它是 IPv4 与 IPv6 的问题。)但是,rJython 捆绑了旧版本的 Jython jar。也许可以升级,即使不升级到 2.7?

为此联系 rJython 包的维护者可能是值得的。

关于python - gmailR错误 "Only AF_INET sockets are currently supported on jython",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32569546/

相关文章:

Python加载带有UTF-8 BOM header 的json文件

r - 增加接近于零的值的色标分辨率

r - 合并/合并具有相同名称但数据不完整的列

c - 供客户端连接的多个套接字

express - SvelteKit:禁止跨站点 POST 表单提交

python:正则表达式匹配字符串且仅匹配字符串

python - 使用 Eigen 库在 C++ 中计算多项式的根

python - 找不到 libavformat.so

mysql - R ODBC MySQL 连接示例

javascript - 路由中具有变量/id的Socket.io命名空间