Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'PyUnicode_FromUnicode' is deprecated #260

Open
artemp opened this issue Nov 3, 2022 · 1 comment
Open

'PyUnicode_FromUnicode' is deprecated #260

artemp opened this issue Nov 3, 2022 · 1 comment
Assignees

Comments

@artemp
Copy link
Member

artemp commented Nov 3, 2022

src/python_grid_utils.cpp:108:26: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
                         PyUnicode_FromUnicode(line.get(), array_size))));
                         ^
/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/unicodeobject.h:600:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^
/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pyport.h:336:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
@artemp artemp self-assigned this Nov 3, 2022
@sebastic
Copy link
Contributor

As reported in Debian Bug #1055716, this now causes the build to fail:

python-mapnik ftbfs with Python 3.12:

[...]
src/python_grid_utils.cpp: In function ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&)’:
src/python_grid_utils.cpp:108:26: error: there are no arguments to ‘PyUnicode_FromUnicode’ that depend on a template parameter, so a declaration of ‘PyUnicode_FromUnicode’ must be available [-fpermissive]
  108 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      |                          ^~~~~~~~~~~~~~~~~~~~~
src/python_grid_utils.cpp:108:26: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
src/python_grid_utils.cpp: In function ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&, unsigned int)’:
src/python_grid_utils.cpp:171:26: error: there are no arguments to ‘PyUnicode_FromUnicode’ that depend on a template parameter, so a declaration of ‘PyUnicode_FromUnicode’ must be available [-fpermissive]
  171 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      |                          ^~~~~~~~~~~~~~~~~~~~~
src/python_grid_utils.cpp: In function ‘void mapnik::write_features(const T&, boost::python::dict&, const std::vector<typename T::lookup_type>&)’:
src/python_grid_utils.cpp:186:34: warning: declaration of ‘attributes’ shadows a global declaration [-Wshadow]
  186 |     std::set<std::string> const& attributes = grid_type.get_fields();
      |                                  ^~~~~~~~~~
In file included from /usr/include/mapnik/symbolizer_base.hpp:34, 
                 from /usr/include/mapnik/rule.hpp:28,
                 from /usr/include/mapnik/grid/grid_renderer.hpp:31,
                 from src/python_grid_utils.cpp:36:
/usr/include/mapnik/attribute.hpp:73:7: note: shadowed declaration is here
   73 | using attributes = std::unordered_map<std::string, value>;
      |       ^~~~~~~~~~
src/python_grid_utils.cpp: In function ‘boost::python::dict mapnik::grid_encode(const T&, const std::string&, bool, unsigned int)’:
src/python_grid_utils.cpp:263:43: warning: declaration of ‘grid’ shadows a global declaration [-Wshadow]
  263 | boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution)
      |                                  ~~~~~~~~~^~~~
In file included from /usr/include/mapnik/grid/grid_renderer.hpp:29:
/usr/include/mapnik/grid/grid.hpp:220:7: note: shadowed declaration is here
  220 | using grid = hit_grid<mapnik::value_integer_pixel>;
      |       ^~~~
src/python_grid_utils.cpp: In function ‘void mapnik::render_layer_for_grid(const Map&, grid&, unsigned int, const boost::python::list&, double, unsigned int, unsigned int)’:
src/python_grid_utils.cpp:282:50: warning: declaration of ‘grid’ shadows a global declaration [-Wshadow]
  282 |                                   mapnik::grid & grid,
      |                                   ~~~~~~~~~~~~~~~^~~~
/usr/include/mapnik/grid/grid.hpp:220:7: note: shadowed declaration is here
  220 | using grid = hit_grid<mapnik::value_integer_pixel>;
      |       ^~~~ 
src/python_grid_utils.cpp:315:27: warning: declaration of ‘attributes’ shadows a global declaration [-Wshadow]
  315 |     std::set<std::string> attributes = grid.get_fields();
      |                           ^~~~~~~~~~
/usr/include/mapnik/attribute.hpp:73:7: note: shadowed declaration is here
   73 | using attributes = std::unordered_map<std::string, value>;
      |       ^~~~~~~~~~
src/python_grid_utils.cpp: In instantiation of ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&, unsigned int) [with T = hit_grid<gray64s_t>; typename T::lookup_type = std::__cxx11::basic_string<char>]’: 
src/python_grid_utils.cpp:236:28:   required from ‘void mapnik::grid_encode_utf(const T&, boost::python::dict&, bool, unsigned int) [with T = hit_grid<gray64s_t>]’
src/python_grid_utils.cpp:267:27:   required from ‘boost::python::dict mapnik::grid_encode(const T&, const std::string&, bool, unsigned int) [with T = hit_grid<gray64s_t>; std::string = std::__cxx11::basic_string<char>]’
src/python_grid_utils.cpp:278:138:   required from here
src/python_grid_utils.cpp:171:47: error: ‘PyUnicode_FromUnicode’ was not declared in this scope; did you mean ‘PyUnicode_FromString’?
  171 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                          PyUnicode_FromString
src/python_grid_utils.cpp: In instantiation of ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&) [with T = hit_grid<gray64s_t>; typename T::lookup_type = std::__cxx11::basic_string<char>]’:
src/python_grid_utils.cpp:240:28:   required from ‘void mapnik::grid_encode_utf(const T&, boost::python::dict&, bool, unsigned int) [with T = hit_grid<gray64s_t>]’
src/python_grid_utils.cpp:267:27:   required from ‘boost::python::dict mapnik::grid_encode(const T&, const std::string&, bool, unsigned int) [with T = hit_grid<gray64s_t>; std::string = std::__cxx11::basic_string<char>]’
src/python_grid_utils.cpp:278:138:   required from here
src/python_grid_utils.cpp:108:47: error: ‘PyUnicode_FromUnicode’ was not declared in this scope; did you mean ‘PyUnicode_FromString’?
  108 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                          PyUnicode_FromString
src/python_grid_utils.cpp: In instantiation of ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&, unsigned int) [with T = hit_grid_view<image<gray64s_t> >; typename T::lookup_type = std::__cxx11::basic_string<char>]’:
src/python_grid_utils.cpp:236:28:   required from ‘void mapnik::grid_encode_utf(const T&, boost::python::dict&, bool, unsigned int) [with T = hit_grid_view<image<gray64s_t> >]’
src/python_grid_utils.cpp:267:27:   required from ‘boost::python::dict mapnik::grid_encode(const T&, const std::string&, bool, unsigned int) [with T = hit_grid_view<image<gray64s_t> >; std::string = std::__cxx11::basic_string<char>]’
src/python_grid_utils.cpp:279:143:   required from here
src/python_grid_utils.cpp:171:47: error: ‘PyUnicode_FromUnicode’ was not declared in this scope; did you mean ‘PyUnicode_FromString’?
  171 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                          PyUnicode_FromString
src/python_grid_utils.cpp: In instantiation of ‘void mapnik::grid2utf(const T&, boost::python::list&, std::vector<typename T::lookup_type>&) [with T = hit_grid_view<image<gray64s_t> >; typename T::lookup_type = std::__cxx11::basic_string<char>]’:
src/python_grid_utils.cpp:240:28:   required from ‘void mapnik::grid_encode_utf(const T&, boost::python::dict&, bool, unsigned int) [with T = hit_grid_view<image<gray64s_t> >]’
src/python_grid_utils.cpp:267:27:   required from ‘boost::python::dict mapnik::grid_encode(const T&, const std::string&, bool, unsigned int) [with T = hit_grid_view<image<gray64s_t> >; std::string = std::__cxx11::basic_string<char>]’
src/python_grid_utils.cpp:279:143:   required from here
src/python_grid_utils.cpp:108:47: error: ‘PyUnicode_FromUnicode’ was not declared in this scope; did you mean ‘PyUnicode_FromString’?
  108 |                          PyUnicode_FromUnicode(line.get(), array_size))));
      | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                          PyUnicode_FromString
error: command '/usr/bin/c++' failed with exit code 1
E: pybuild pybuild:395: build: plugin distutils failed with: exit code=1: /usr/bin/python3.12 setup.py build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants