5

When I'm running print(cursor.fetchone()) (pyodbc package) I have the following warning:

main.py:33: DeprecationWarning: PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead

Is that normal ? The datatype I'm trying to fetch is the following: enter image description here

I'm using Python 3.10.2 and MSSQL.

Thanks!

  • Sounds like you're making a bug report. You should be posting that on PyODBC's github. – Thom A Feb 10 '22 at 14:55
  • 1
    https://github.com/mkleehammer/pyodbc/pull/1002 – Gord Thompson Feb 10 '22 at 16:30
  • @GordThompson I tried reading the post but I don't understand anything they say. Could you explain the way to fix it? I'm not sure I understand. Sorry if it's quite a naive question, I'm pretty new to coding! – FluidMechanics Potential Flows Feb 10 '22 at 18:19
  • 2
    The link above is a GitHub Pull Request (PR). It indicates that the issue is known and someone has proposed a fix. If the PR is accepted then the change will be merged into the code base and be included in the next release of the package. In the meantime, you could tell your code to suppress such warnings using the techniques in the answers to [this question](https://stackoverflow.com/q/14463277/2144390). And if you want to indicate that the change is of interest to you then consider logging into GitHub and giving the PR a "thumbs up". – Gord Thompson Feb 10 '22 at 19:04
  • 1
    https://github.com/mkleehammer/pyodbc/issues/998#issuecomment-1035368786 – Gord Thompson Feb 10 '22 at 19:15
  • I have a similar issue when trying to display/print DF's, like [here](https://stackoverflow.com/questions/72123992/panda-df-not-showing-all-rows-after-loading-from-ms-sql). This warning pops up and the printing is truncated without any further error message. The error seem buffered (or the DF is) so it's not clear at which point it happens. – not2qubit May 05 '22 at 09:51

0 Answers0