clj-python / clj-python/libpython-clj

"auto flush" tty optionally

未关闭
#270 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Clojure
星标
1.2k
派生
74
PR 合并指标
30 天内没有已合并 PR

描述

The fix of #216 is not fully solving the issue.

using "libpythin-clj", there is so far no way to enforce "autoflush".
So when a third party python library does not explicitly flush, then we cannot force it.
And this can result in not seeing "debug outputs" on time for long running processes.
(in my tests they only came when the JVM proccess ends)

When using a normal "python" executable, there are some documented ways, but none of it is working with "libpython-clj".
(using "unbuffer" and similar tricks, like env varaibales: PYTHONUNBUFFERED=false)

On this branch https://github.com/behrica/libpython-clj/tree/auto-flush
I have a solution (so far hardcoded), which solves it.
It adds "flush" to each write.

This would need to be optional and configurable (eventually together with a way to configure as well the return value of "isatty" (which I did not need in my tests, false was working fine)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先将 auto-flush 分支与当前的 libpython-clj 实现进行比较,并检查 #216 的修复。定义应如何配置 autoflush,并通过一个使用第三方 Python 库进行写入的长时间运行进程进行验证;启用该选项后能够可靠地在每次写入时执行 flush,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
clojure, python
领域
backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。