Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2155256 - pyodbc fails to build with Python 3.12: error: PyUnicode_FromUnicode was not declared in this scope
Summary: pyodbc fails to build with Python 3.12: error: PyUnicode_FromUnicode was not ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pyodbc
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondřej Sloup
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException
: 2220088 (view as bug list)
Depends On:
Blocks: F39FTBFS F39FailsToInstall PYTHON3.12 F39BetaFreezeException 2220062 2220522 2220523
TreeView+ depends on / blocked
 
Reported: 2022-12-20 14:20 UTC by Tomáš Hrnčiar
Modified: 2023-08-31 02:57 UTC (History)
10 users (show)

Fixed In Version: pyodbc-5.0.0~b1-2.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-31 02:57:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github mkleehammer pyodbc issues 917 0 None open Deprecated PyUnicode functions that must be updated 2023-07-10 21:41:12 UTC

Description Tomáš Hrnčiar 2022-12-20 14:20:43 UTC
pyodbc fails to build with Python 3.12.0a3.

src/pyodbccompat.h: In function ‘PyObject* Text_New(Py_ssize_t)’:
src/pyodbccompat.h:75:12: error: ‘PyUnicode_FromUnicode’ was not declared in this scope; did you mean ‘PyUnicode_FromString’?
   75 |     return PyUnicode_FromUnicode(0, length);
      |            ^~~~~~~~~~~~~~~~~~~~~
      |            PyUnicode_FromString
src/pyodbccompat.h: In function ‘Py_UNICODE* Text_Buffer(PyObject*)’:
src/pyodbccompat.h:86:12: error: ‘PyUnicode_AS_UNICODE’ was not declared in this scope; did you mean ‘PyUnicode_AsUCS4’?
   86 |     return PyUnicode_AS_UNICODE(o);
      |            ^~~~~~~~~~~~~~~~~~~~
      |            PyUnicode_AsUCS4
src/pyodbccompat.h: In function ‘Py_ssize_t Text_Size(PyObject*)’:
src/pyodbccompat.h:126:40: error: ‘PyUnicode_GET_SIZE’ was not declared in this scope; did you mean ‘PyDict_GET_SIZE’?
  126 |     return (o && PyUnicode_Check(o)) ? PyUnicode_GET_SIZE(o) : 0;
      |                                        ^~~~~~~~~~~~~~~~~~
      |                                        PyDict_GET_SIZE
src/pyodbccompat.h: In function ‘Py_ssize_t TextCopyToUnicode(Py_UNICODE*, PyObject*)’:
src/pyodbccompat.h:146:26: error: ‘PyUnicode_GET_SIZE’ was not declared in this scope; did you mean ‘PyDict_GET_SIZE’?
  146 |         Py_ssize_t cch = PyUnicode_GET_SIZE(o);
      |                          ^~~~~~~~~~~~~~~~~~
      |                          PyDict_GET_SIZE
src/pyodbccompat.h:147:24: error: ‘PyUnicode_AS_UNICODE’ was not declared in this scope; did you mean ‘PyUnicode_AsUCS4’?
  147 |         memcpy(buffer, PyUnicode_AS_UNICODE(o), cch * sizeof(Py_UNICODE));
      |                        ^~~~~~~~~~~~~~~~~~~~
      |                        PyUnicode_AsUCS4

Leagcy Unicode APIs has been removed. See PEP 623 for detail.
        PyUnicode_WCHAR_KIND
        PyUnicode_AS_UNICODE()
        PyUnicode_AsUnicode()
        PyUnicode_AsUnicodeAndSize()
        PyUnicode_AS_DATA()
        PyUnicode_FromUnicode()
        PyUnicode_GET_SIZE()
        PyUnicode_GetSize()
        PyUnicode_GET_DATA_SIZE()

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05129554-pyodbc/

For all our attempts to build pyodbc with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/pyodbc/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2023-02-07 15:03:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Miro Hrončok 2023-07-10 21:39:11 UTC
*** Bug 2220088 has been marked as a duplicate of this bug. ***

Comment 3 Filip Januš 2023-07-11 06:49:55 UTC
It's a known issue and upstream seems to be working on it.
https://github.com/mkleehammer/pyodbc/issues/917

Comment 4 Orion Poplawski 2023-07-18 02:04:52 UTC
I'm not sure how much upstream is really working on it.  I've asked for a status update.

Comment 5 Fedora Fails To Install 2023-07-19 04:52:40 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on devel.org if you are unsure how to fix this bug.

Comment 6 Fedora Release Engineering 2023-08-16 07:06:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 7 Fedora Fails To Install 2023-08-28 10:36:32 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 40.

Thanks for taking care of it!

Comment 8 Miro Hrončok 2023-08-28 10:42:26 UTC
Could you please backport https://src.fedoraproject.org/rpms/pyodbc/c/1b25110f2aea731861eaaf537c13e0bbe20c0958?branch=rawhide to Fedora 39?

Comment 9 Miro Hrončok 2023-08-28 10:51:34 UTC
But see https://src.fedoraproject.org/rpms/pyodbc/pull-request/7

Comment 10 Fedora Update System 2023-08-28 14:05:13 UTC
FEDORA-2023-028aa659e3 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-028aa659e3

Comment 11 Ondřej Sloup 2023-08-28 14:11:33 UTC
The PR is merged; I also added PR for hot fixing the user directory as intended by upstream, which is merged and built as well.
Created PR for F39 sync (https://src.fedoraproject.org/rpms/pyodbc/pull-request/8#) is also merged and built.

https://bodhi.fedoraproject.org/updates/FEDORA-2023-9b95dd4efc
https://bodhi.fedoraproject.org/updates/FEDORA-2023-028aa659e3

Thank you

Comment 12 Geoffrey Marr 2023-08-28 19:43:28 UTC
Discussed during the 2023-08-28 blocker review meeting: [0]

The decision to classify this bug as an "AcceptedFreezeException (Beta)" was made as it is a noticeable issue that cannot be fixed with an update.

[0] https://meetbot.fedoraproject.org/fedora-blocker-review/2023-08-28/f39-blocker-review.2023-08-28-16.07.txt

Comment 13 Fedora Update System 2023-08-29 01:24:58 UTC
FEDORA-2023-028aa659e3 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-028aa659e3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-028aa659e3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2023-08-31 02:57:58 UTC
FEDORA-2023-028aa659e3 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.