Open eberrippe opened 5 months ago
Hello! Sorry, I did not got were, why and what you are parsing? Most others (and me) are using Python 3 for many years (>10). And there is not problems with Python3 and switching from 2 to 3. (some types of vfx software switched from 2 to 3 recently)
Hi @timurhai, thanks for your response.
Just imagine, we would add a print(self.taskInfo["user_name"])
This would result in b"timurhai"
We ecounter the same issue in the parser.
Also if we would add a print(self.taskInfo["job_name"])
b"myTestJob"
We have this byte String interpretation since we use a python3x build with our renders.
Or is it only us?
Thanks Jan
We are still at CentOS linux 7 but will jump to Alamalinux We use AF version 3.3.0 It was submitted via our submitter using afanasy/python/af.py
Does it mean you dont have the same thing happening to you @lithorus ? Maybe it could be build related.
Let me rewind and rephrase what @eberrippe originally posted:
Before we compiled Afanasy 3.3.0 with Python 2.7 on CentOS 7. We had "normal" strings in the self.taskInfo
in events.py
{
"wdir":"/tmp",
"parser":"nuke",
"command_block":"nuke -F @#@-@#@/1 -V 2.nk\",
"command_task":"",
"capacity":4,
...
Now we started to compile afanasy 3.3.0 with Python 3.10 on CentOS 7. And when printing the self.taskInfo
in events.py
we get weird byte strings
like:
{
"wdir":"/tmp",
"parser":"b""nuke",
"command_block":"b""nuke -F @#@-@#@/1 -V 2.nk\"",
"command_task":"b""",
"capacity":4,
...
What Python versions are you guys using? I suppose you are not seeing this?
I was more interested in seeing some actual sample code. Is is submitted through within Nuke (and which version)?
We submit from within the DCC's with our own tools, which means it's a wide range of python versions. Also af.py
is pure python and doesn't depend on any specific version.
Try to describe exactly which steps the submission go through (and with code examples). To me it looks like you're generating something in python, but does the actual submission through a command line using eg. os.system()
. That might explain the double quoting.
Here is a very basic example you can try :
import af
job = af.Job("test job")
job.setProject("project")
job.setDepartment("department")
block = af.Block("test block")
block.setCommand("echo dummy job")
block.setNumeric(1, 1, 1)
job.blocks.append(block)
print(job.data)
job.send()
This will also print what is sent to the server.
Also, compiling it with python3 doesn't make it more compatible with DCCs running python3. It's only python3 in afrender's parsers and services, etc.
Hi @timurhai ,
We have updated our renders/servers to run with Python 3.10 instead of Python 2.7. Since this update, we've encountered an issue in the taskInfo within events/services/parsers where certain strings are being parsed as byte strings (e.g., b"hello world") instead of standard strings. This discrepancy is causing several issues in the system.
Could you modify these entries upstream to ensure they are correctly interpreted as regular strings?
Here are examples of entries that are currently being parsed as byte objects:
Thanks a lot!
Jan