mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
57 lines
No EOL
4.9 KiB
JSON
57 lines
No EOL
4.9 KiB
JSON
{
|
||
"timestamp": "2026-03-16T11:59:54.977272Z",
|
||
"current_node": "setup",
|
||
"completed_nodes": [
|
||
"start",
|
||
"setup"
|
||
],
|
||
"node_retries": {
|
||
"setup": 1,
|
||
"start": 1
|
||
},
|
||
"context_values": {
|
||
"command.stderr": "",
|
||
"graph.rankdir": "LR",
|
||
"command.output": "fatal: destination path '.' already exists and is not an empty directory.\n",
|
||
"thread.start.current_node": "setup",
|
||
"outcome": "fail",
|
||
"current.preamble": "Goal: HttpResponse doesn't handle memoryview objects\nDescription\n\t\nI am trying to write a BinaryField retrieved from the database into a HttpResponse. When the database is Sqlite this works correctly, but Postgresql returns the contents of the field as a memoryview object and it seems like current Django doesn't like this combination:\nfrom django.http import HttpResponse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# String content\nresponse = HttpResponse(\"My Content\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\nresponse.content\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# Out: b'My Content'\n# This is correct\n# Bytes content\nresponse = HttpResponse(b\"My Content\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \nresponse.content\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# Out: b'My Content'\n# This is also correct\n# memoryview content\nresponse = HttpResponse(memoryview(b\"My Content\"))\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \nresponse.content\n# Out: b'<memory at 0x7fcc47ab2648>'\n# This is not correct, I am expecting b'My Content'\n\n\n\n## Additional Context\n\nI guess HttpResponseBase.make_bytes could be adapted to deal with memoryview objects by casting them to bytes. In all cases simply wrapping the memoryview in bytes works as a workaround HttpResponse(bytes(model.binary_field)).\nThe fact make_bytes would still use force_bytes if da56e1bac6449daef9aeab8d076d2594d9fd5b44 didn't refactor it and that d680a3f4477056c69629b0421db4bb254b8c69d0 added memoryview support to force_bytes strengthen my assumption that make_bytes should be adjusted as well.\nI'll try to work on this.\n",
|
||
"internal.retry_count.setup": 1,
|
||
"internal.thread_id": "start",
|
||
"internal.fidelity": "compact",
|
||
"internal.run_id": "01KKV88GXN6R8JTAX6N2MP5YET",
|
||
"failure_signature": "setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.",
|
||
"internal.node_visit_count": 1,
|
||
"graph.goal": "HttpResponse doesn't handle memoryview objects\nDescription\n\t\nI am trying to write a BinaryField retrieved from the database into a HttpResponse. When the database is Sqlite this works correctly, but Postgresql returns the contents of the field as a memoryview object and it seems like current Django doesn't like this combination:\nfrom django.http import HttpResponse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# String content\nresponse = HttpResponse(\"My Content\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\nresponse.content\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# Out: b'My Content'\n# This is correct\n# Bytes content\nresponse = HttpResponse(b\"My Content\")\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \nresponse.content\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n# Out: b'My Content'\n# This is also correct\n# memoryview content\nresponse = HttpResponse(memoryview(b\"My Content\"))\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \nresponse.content\n# Out: b'<memory at 0x7fcc47ab2648>'\n# This is not correct, I am expecting b'My Content'\n\n\n\n## Additional Context\n\nI guess HttpResponseBase.make_bytes could be adapted to deal with memoryview objects by casting them to bytes. In all cases simply wrapping the memoryview in bytes works as a workaround HttpResponse(bytes(model.binary_field)).\nThe fact make_bytes would still use force_bytes if da56e1bac6449daef9aeab8d076d2594d9fd5b44 didn't refactor it and that d680a3f4477056c69629b0421db4bb254b8c69d0 added memoryview support to force_bytes strengthen my assumption that make_bytes should be adjusted as well.\nI'll try to work on this.",
|
||
"failure_class": "deterministic",
|
||
"current_node": "setup",
|
||
"internal.retry_count.start": 1
|
||
},
|
||
"logs": [],
|
||
"node_outcomes": {
|
||
"start": {
|
||
"status": "success",
|
||
"duration_ms": 0
|
||
},
|
||
"setup": {
|
||
"status": "fail",
|
||
"context_updates": {
|
||
"command.output": "fatal: destination path '.' already exists and is not an empty directory.\n",
|
||
"command.stderr": ""
|
||
},
|
||
"failure": {
|
||
"message": "Script failed with exit code: 128\n\n## stdout\nfatal: destination path '.' already exists and is not an empty directory.\n",
|
||
"failure_class": "deterministic"
|
||
},
|
||
"duration_ms": 46
|
||
}
|
||
},
|
||
"next_node_id": "solve",
|
||
"loop_failure_signatures": {
|
||
"setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.": 1
|
||
},
|
||
"node_visits": {
|
||
"setup": 1,
|
||
"start": 1
|
||
}
|
||
} |