{"action":"opened","issue":{"url":"https://api.github.com/repos/mshabunin/test2/issues/568","labels_url":"https://api.github.com/repos/mshabunin/test2/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/mshabunin/test2/issues/568/comments","events_url":"https://api.github.com/repos/mshabunin/test2/issues/568/events","html_url":"https://github.com/mshabunin/test2/issues/568","id":95457190,"number":568,"title":"Dependency on Python version and default encoding","user":{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars.githubusercontent.com/u/3304494?v=3","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mshabunin/test2/labels/affected:%20master","name":"affected: master","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/auto-transferred","name":"auto-transferred","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/category:%20matlab%20bindings","name":"category: matlab bindings","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test2/labels/priority:%20normal","name":"priority: normal","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-16T15:17:26Z","updated_at":"2015-07-16T15:17:26Z","closed_at":null,"body":"Transferred from http://code.opencv.org/issues/3854\r\n```\n|| Philippe FOUBERT on 2014-08-10 16:40\n|| Priority: Normal\n|| Affected: branch 'master' (3.0-dev)\n|| Category: matlab bindings\n|| Tracker: Bug\n|| Difficulty: \n|| PR: \n|| Platform: x64 / Windows\n```\n\nDependency on Python version and default encoding\n-----------\n```\nh1. Dependency on Python version\r\n\r\nI have Python 2.7.8 (the latest Python 2 release version) and Python 3.4.1 (the latest Python 3 release version) installed on my computer.\r\n\r\nThe \"@modules\\matlab\\CMakeLists.txt@\" file is using the \"@${PYTHON_DEFAULT_EXECUTABLE}@\" variable (which is initialized with \"@${PYTHON2_EXECUTABLE}@\" in \"@cmake\\OpenCVDetectPython.cmake@\") to launch the scripts \"@gen_matlab.py@\" and \"@cvmex.py@\" which are using the *\"@lstrip_blocks@\"* parameter which seems *not available in Python 2.7.8* :\r\n> @jtemplate    = Environment(loader=FileSystemLoader(template_dir), trim_blocks=True, lstrip_blocks=True)@\r\n\r\nIf the \"@${PYTHON_DEFAULT_EXECUTABLE}@\" variable is replaced by the \"@${PYTHON3_EXECUTABLE}@\" variable, the error disappears.\r\n\r\nh1. Dependency on unicode\r\n\r\nI am working on a 64 bits OS. On such an OS, the default encoding used by Python is unicode.\r\n=> in the \"@modules\\java\\generator\\rst_parser.py@\" script, I have had to add the encoding to the open function:\r\n> @df = open(doc, \"rt\" , encoding=\"utf_8\")@\r\na parameter which is not compatible with Python2...\r\n\r\nh1. Default Python executable\r\n\r\nSince the default Python executable is not only used in the Matlab binding module, i have chosen to write an issue instead of a PR...\n```\n\nHistory\n-------"}}