Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1310

String escaping issues in default parameter values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.1
    • 5.14.2
    • Shiboken
    • None
    • Linux Mint.
      clang version 8.0.1
      Target: x86_64-unknown-linux-gnu
    • Linux/X11
    • 7406fc4b6967cb32175752a2ae7934bd8b1f8200 (pyside/pyside-setup/5.15)

    Description

      I stumbled on this problem and I am not sure if it's a configuration issue, or some kind of translation that get's applied and causes issues with the shiboken generation process.

      1)  My original shared library compiles just file, and it contains this function declaration in one of the headers file.  This compiles just fine. :

      QVector<double> parseNumericalSequenceToVector(QString& inputLine, 
       QString regexPattern = "(?:^|,)(?=[^\"]|(\")?)\"?((?(1)[^\"]*|[^,\"]*))\"?(?=,|$)");
      

      This library build perfectly using qmake + make

       

      2) this is the problem: when I try to expose this to python, I build the bindings using shiboken.  The "cmake .." command runs just file (see attached CMakeLists.txt), but then when I invoke "make" I get these errors (it seems like that the generated bindings files are escaped again):

      $ make
      [ 7%] Automatic MOC and UIC for target myutils
      [ 7%] Built target myutils_autogen
      [ 35%] Built target myutils
      [ 42%] Automatic MOC and UIC for target MyUtils
      [ 50%] Built target MyUtils_autogen
      [ 57%] Building CXX object CMakeFiles/MyUtils.dir/MyUtils/textutils_textutils_wrapper.cpp.o
      /home/data/shared/c++/utils/libs/build/MyUtils/textutils_textutils_wrapper.cpp:1326:124: *error: stray ‘\’ in program*
       "MyUtils.textutils.TextUtils.parseNumericalSequenceToVector(inputLine:QString,regexPattern:QString=\"(?:^|,)(?=[^\\"]|(\\")?)\\"?((?(1)[^\\"]*|[^,\\"]*))\\"?(?=,|$)\")->QVector[double]",
       ^
      /home/data/shared/c++/utils/libs/build/MyUtils/textutils_textutils_wrapper.cpp:1326:125: error: stray ‘\’ in program
       "MyUtils.textutils.TextUtils.parseNumericalSequenceToVector(inputLine:QString,regexPattern:QString=\"(?:^|,)(?=[^\\"]|(\\")?)\\"?((?(1)[^\\"]*|[^,\\"]*))\\"?(?=,|$)\")->QVector[double]",
      

      Attachments

        1. bindings.xml
          0.3 kB
        2. CMakeLists.txt
          6 kB
        3. pyside1310_repro.diff
          1.0 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            alealo alex alongi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes