Skip to content

Evaluation of Python Returning Nothing to the log buffer #725

Description

@thecontinium

Hi

I use conjure extensively for clojure and it works great - thanks very much !
I would also like to use it for python.
I am unfortunatley finding the python experience rather eratic.

e.g. simply evaluating

import dumpy as np

The first time evaluate the "form" nothing is returned to the log buffer.
If I evaluate again I receive "None"

I have pasted the full log file of this interaction at the bottom of this message.

On the first attempt the debug is showing the following which seems to be formatting for an out of None but nothing is returned to the log.

# debug: remote.stdio.on-message; receive chunk >>"None↵"<<
nil
# debug: M.format-msg: >> None↵<<
nil

on the second attempt

# debug: M.format-msg: >> None↵<<
nil
None
# debug: M.format-msg: >> None↵<<
nil

I'm not sure why there is a duplicate but even with the same input the message None sometimes get output and other times it doesn't.

Unfortunately this is just one example of this happening.
Here I evaluate a file with no output to the log even though it seems to be formatting messages.

# debug: M.format-msg: >> ![image](plots/figure_1.png)↵1↵2↵3↵4↵5↵6↵7↵8↵9↵<<
nil
# debug: remote.stdio.on-message; receive source >>out<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>"None↵"<<
nil
# debug: M.format-msg: >> None↵<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<

All help appreciated.

I'm using python 3.12.6

Cheers

# Sponsored by @frenchy64 ❤
# Starting Python client...
# debug: remote.stdio.next-in-queue; stdin:write next-msg.code >>"import base64↵exec(base64.b64decode('aW1wb3J0IHN5cwpkZWYgY29uanVyZV9mb3JtYXRfb3V0cHV0KHZhbCk6CiAgICBwcmludChyZXByKHZhbCkpCnN5cy5kaXNwbGF5aG9vayA9IGNvbmp1cmVfZm9ybWF0X291dHB1dAoKX19uYW1lX18gPSAnX19yZXBsX18n'))↵"<<
nil
# --------------------------------------------------------------------------------
# python3 -iq (started)
# debug: remote.stdio.on-message; receive source >>out<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>"None↵"<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> >>> "<<
nil
# debug: M.format-msg: >> <<
nil
# debug: M.form-node?: node:type = "import_statement"
nil
# debug: M.form-node?: node:parent = #<<node module>>
nil
# --------------------------------------------------------------------------------
# eval (current-form): import numpy as np
# debug: M.eval-str opts >> {:action↵ "eval"↵ :code↵ "import numpy as np"↵ :file-path↵ "/Users/ggg/dev/thecontinium/hhh/tes.py"↵ :node↵ #<<node import_statement>>↵ :on-result↵ #<function: 0x010460ef48>↵ :origin↵ "current-form"↵ :preview↵ "# eval (current-form): import numpy as np"↵ :range↵ {:end [2 17] :start [2 0]}}<<
nil
# debug: remote.stdio.next-in-queue; stdin:write next-msg.code >>"import base64↵exec(base64.b64decode('aW1wb3J0IG51bXB5IGFzIG5w'))↵"<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<
nil
# debug: M.format-msg: >> <<
nil
# debug: M.format-msg: >> <<
nil
# debug: remote.stdio.on-message; receive source >>out<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>"None↵"<<
nil
# debug: M.format-msg: >> None↵<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<
nil
# debug: M.format-msg: >> <<
nil
# debug: M.form-node?: node:type = "import_statement"
nil
# debug: M.form-node?: node:parent = #<<node module>>
nil
# --------------------------------------------------------------------------------
# eval (current-form): import numpy as np
# debug: M.eval-str opts >> {:action↵ "eval"↵ :code↵ "import numpy as np"↵ :file-path↵ "/Users/ggg/dev/thecontinium/hhh/tes.py"↵ :node↵ #<<node import_statement>>↵ :on-result↵ #<function: 0x0104ea39b8>↵ :origin↵ "current-form"↵ :preview↵ "# eval (current-form): import numpy as np"↵ :range↵ {:end [2 17] :start [2 0]}}<<
nil
# debug: remote.stdio.next-in-queue; stdin:write next-msg.code >>"import base64↵exec(base64.b64decode('aW1wb3J0IG51bXB5IGFzIG5w'))↵"<<
nil
# debug: remote.stdio.on-message; receive source >>out<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>"None↵"<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<
nil
# debug: M.format-msg: >> None↵<<
nil
None
# debug: M.format-msg: >> None↵<<
nil
# debug: remote.stdio.on-message; receive source >>err<<
nil
# debug: remote.stdio.on-message; receive err >>nil<<
nil
# debug: remote.stdio.on-message; receive chunk >>">>> "<<
nil
# debug: M.format-msg: >> <<
nil

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions