{"action":"closed","issue":{"url":"https://api.github.com/repos/oracle/python-cx_Oracle/issues/171","repository_url":"https://api.github.com/repos/oracle/python-cx_Oracle","labels_url":"https://api.github.com/repos/oracle/python-cx_Oracle/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/oracle/python-cx_Oracle/issues/171/comments","events_url":"https://api.github.com/repos/oracle/python-cx_Oracle/issues/171/events","html_url":"https://github.com/oracle/python-cx_Oracle/issues/171","id":316555611,"number":171,"title":"cx_Oracle.NotSupportedError: Python value of type WindowsPath not supported","user":{"login":"Rakin061","id":27331118,"avatar_url":"https://avatars0.githubusercontent.com/u/27331118?v=4","gravatar_id":"","url":"https://api.github.com/users/Rakin061","html_url":"https://github.com/Rakin061","followers_url":"https://api.github.com/users/Rakin061/followers","following_url":"https://api.github.com/users/Rakin061/following{/other_user}","gists_url":"https://api.github.com/users/Rakin061/gists{/gist_id}","starred_url":"https://api.github.com/users/Rakin061/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rakin061/subscriptions","organizations_url":"https://api.github.com/users/Rakin061/orgs","repos_url":"https://api.github.com/users/Rakin061/repos","events_url":"https://api.github.com/users/Rakin061/events{/privacy}","received_events_url":"https://api.github.com/users/Rakin061/received_events","type":"User","site_admin":false},"labels":[{"id":554858896,"url":"https://api.github.com/repos/oracle/python-cx_Oracle/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-22T07:16:22Z","updated_at":"2018-04-26T08:10:49Z","closed_at":"2018-04-26T08:10:49Z","author_association":"NONE","body":"Hello, \r\n\r\nI am using cx_Oracle to insert binary files from a directory as BLOB in a column of a table.\r\n\r\nSo, I am intended to use the PATH module of python3 and then insert the binary file by fetching the file using WindowsPath\r\n\r\n## Configurations:-\r\n\r\n> 1.  Python Version:  3.6.3    64-bit  \r\n> 2.  cx_Oracle version:  6.2.1\r\n> 3.  Instant client_11_2\r\n> 4.  Oracle Database: 11g\r\n> 5.  OS: Windows10\r\n> 6.  Compiler: Pycharm Community Editiron 2017\r\n\r\n\r\nHere's the cdoe:-\r\n\r\n```\r\nimport sys\r\nimport cx_Oracle\r\n\r\nfrom pathlib import Path\r\n\r\nusername = 'EWORDPR'\r\npassword = 'EWORDPR'\r\ndatabaseName = \"10.11.201.161:1521/ORCL\"\r\n\r\nconnection = cx_Oracle.connect (username,password,databaseName) # Connection Established\r\n\r\ncursor=connection.cursor()\r\n\r\nmy_file = Path(\"22 Apr 2018.txt\")\r\nprint(\"File exists:\",my_file.is_file()) #File Exists: True\r\n\r\nrows = [ ('01787440110', 'Rakin','22-04-2017', my_file )]\r\ncursor.executemany('insert into CHAT_HISTORY(MOBILE_NUMBER,USER_NAME,CHAT_DATE,USER_TRANSCRIPTS) values (:1, :2, :3, :4)', rows)\r\n\r\nconnection.commit()\r\n\r\ncursor.close()\r\n\r\nconnection.close()\r\n```\r\nThen, I am getting the following errors:-\r\n\r\n`Traceback (most recent call last): File \"F:/Python with ORACLE/orapy.py\", line 53, in print(cursor.executemany('insert into CHAT_HISTORY(MOBILE_NUMBER,USER_NAME,CHAT_DATE,USER_TRANSCRIPTS) values (:1, :2, :3, :4)', rows)) \r\ncx_Oracle.NotSupportedError: Python value of type WindowsPath not supported.`\r\n\r\nIs there any way to export binary files from a directory and then directly insert the file in as BLOB  using cx_Oracle ?? \r\n\r\n\r\n"}}
{"actor":{"display_login":"Rakin061"}}