Title: Still cannot create Nullable
Open Graph Title: Still cannot create Nullable
X Title: Still cannot create Nullable
Description: Environment Pythonnet version: 2.5.2 Python version: 3.8.7 Operating System: Windows 10 .NET Runtime: Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk...
Open Graph Description: Environment Pythonnet version: 2.5.2 Python version: 3.8.7 Operating System: Windows 10 .NET Runtime: Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x6...
X Description: Environment Pythonnet version: 2.5.2 Python version: 3.8.7 Operating System: Windows 10 .NET Runtime: Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x6...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1693
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Still cannot create Nullable\u003cT\u003e(None)","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.5.2\r\n- Python version: 3.8.7\r\n- Operating System: Windows 10\r\n- .NET Runtime: \r\n Runtime Environment:\r\n OS Name: Windows\r\n OS Version: 10.0.19044\r\n OS Platform: Windows\r\n RID: win10-x64\r\n Base Path: C:\\Program Files\\dotnet\\sdk\\6.0.101\\\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\n\r\n I was trying to invoke a C# function with an argument of type Nullable\u003cT\u003e. Python.NET reported that it could find no function matching the arguments. Eventually, I tried to test the fix for issue #460.\r\n\r\n- What commands did you run to trigger this issue? If you can provide a\r\n [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)\r\n this will help us understand the issue.\r\n\r\n```ipython\r\nPython 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)]\r\nType 'copyright', 'credits' or 'license' for more information\r\nIPython 7.28.0 -- An enhanced Interactive Python. Type '?' for help.\r\n\r\n[ins] In [1]: import clr\r\n\r\n[ins] In [2]: from System import (UInt32, Nullable)\r\n\r\n[ins] In [3]: Nullable[UInt32](3)\r\nOut[3]: \u003cSystem.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] object at 0x0000020A6AF106D0\u003e\r\n\r\n[ins] In [4]: Nullable[UInt32](None)\r\n---------------------------------------------------------------------------\r\nTypeError Traceback (most recent call last)\r\n\u003cipython-input-4-b1659b301f87\u003e in \u003cmodule\u003e\r\n----\u003e 1 Nullable[UInt32](None)\r\n\r\nTypeError: No constructor matches given arguments: (\u003cclass 'NoneType'\u003e)\r\n```\r\n\r\n- If there was a crash, please include the traceback here.\r\n\r\nI also tried testing against pythonnet 3.0.0.a2. I see the following stack trace.\r\n\r\n```ipython \r\nPython 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] \r\nType 'copyright', 'credits' or 'license' for more information \r\nIPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help. \r\n \r\n[ins] In [1]: import clr \r\n \r\n[ins] In [2]: from System import DateTime, Double, Guid, Nullable, String, UInt32 \r\n \r\n[ins] In [3]: Nullable[Double](None) \r\nPython.Runtime.PythonException: 'NoneType' value cannot be converted to System.Double \r\n \r\n \r\nThe above exception was the direct cause of the following exception: \r\n \r\nSystem.ArgumentException: 'NoneType' value cannot be converted to System.Double in method Void .ctor(Double) ---\u003e Python.Runtime.PythonException: \r\n'NoneType' value cannot be converted to System.Double \r\n \r\n --- End of inner exception stack trace --- \r\n \r\nThe above exception was the direct cause of the following exception: \r\n \r\nSystem.AggregateException: One or more errors occurred. ---\u003e System.ArgumentException: 'NoneType' value cannot be converted to System.Double in me\r\nthod Void .ctor(Double) ---\u003e Python.Runtime.PythonException: 'NoneType' value cannot be converted to System.Double \r\n \r\n \r\n --- End of inner exception stack trace --- \r\n --- End of inner exception stack trace --- \r\n---\u003e (Inner Exception #0) System.ArgumentException: 'NoneType' value cannot be converted to System.Double in method Void .ctor(Double) ---\u003e Python\r\n.Runtime.PythonException: 'NoneType' value cannot be converted to System.Double \r\n \r\n --- End of inner exception stack trace ---\u003c--- \r\n \r\n \r\nThe above exception was the direct cause of the following exception: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 3251, in run_code \r\n \r\n exec(code_obj, self.user_global_ns, self.user_ns) \r\n File \"\u003cipython-input-3-3b78c20f70fb\u003e\", line 1, in \u003cmodule\u003e \r\n Nullable[Double](None) \r\nTypeError: No constructor matches given arguments: (\u003cclass 'NoneType'\u003e) \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1934, in showtraceback \r\n \r\n stb = value._render_traceback_() \r\nAttributeError: 'TypeError' object has no attribute '_render_traceback_' \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 3191, in run_ast_nodes \r\n \r\n if await self.run_code(code, result, async_=asy): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 3268, in run_code \r\n \r\n self.showtraceback(running_compiled_code=True) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1936, in showtraceback \r\n \r\n stb = self.InteractiveTB.structured_traceback(etype, \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 1105, \r\nin structured_traceback \r\n \r\n return FormattedTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 999, i\r\nn structured_traceback \r\n \r\n return VerboseTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 871, i\r\nn structured_traceback \r\n \r\n formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context, \r\n \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 775, i\r\nn format_exception_as_a_whole \r\n \r\n assert etb is not None \r\nAssertionError \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1934, in showtraceback \r\n \r\n stb = value._render_traceback_() \r\nAttributeError: 'AssertionError' object has no attribute '_render_traceback_' \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 2814, in _run_cell \r\n \r\n return runner(coro) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\async_helpers.py\", line \r\n129, in _pseudo_sync_runner \r\n \r\n coro.send(None) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 3012, in run_cell_async \r\n \r\n has_raised = await self.run_ast_nodes(code_ast.body, cell_name, \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 3210, in run_ast_nodes \r\n \r\n self.showtraceback() \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1936, in showtraceback \r\n \r\n stb = self.InteractiveTB.structured_traceback(etype, \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 1105, \r\nin structured_traceback \r\n \r\n return FormattedTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 999, i\r\nn structured_traceback \r\n \r\n return VerboseTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 871, i\r\nn structured_traceback \r\n \r\n formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context, \r\n \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 775, i\r\nn format_exception_as_a_whole \r\n \r\n assert etb is not None \r\nAssertionError \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1934, in showtraceback \r\n \r\n stb = value._render_traceback_() \r\nAttributeError: 'AssertionError' object has no attribute '_render_traceback_' \r\n \r\nDuring handling of the above exception, another exception occurred: \r\n \r\nTraceback (most recent call last): \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\Programs\\Python\\Python38\\lib\\runpy.py\", line 194, in _run_module_as_main \r\n \r\n return _run_code(code, main_globals, None, \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\Programs\\Python\\Python38\\lib\\runpy.py\", line 87, in _run_code \r\n \r\n exec(code, run_globals) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\Scripts\\ipython.exe\\__main__.py\", line 7, in \u003cmodule\u003e \r\n \r\n sys.exit(start_ipython()) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\__init__.py\", line 123, in st\r\nart_ipython \r\n return launch_new_instance(argv=argv, **kwargs) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\traitlets\\config\\application.py\", lin\r\ne 846, in launch_instance \r\n \r\n app.start() \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\terminal\\ipapp.py\", line 316,\r\n in start \r\n self.shell.mainloop() \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\terminal\\interactiveshell.py\"\r\n, line 611, in mainloop \r\n \r\n self.interact() \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\terminal\\interactiveshell.py\"\r\n, line 604, in interact \r\n \r\n self.run_cell(code, store_history=True) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 2768, in run_cell \r\n \r\n result = self._run_cell( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 2819, in _run_cell \r\n \r\n self.showtraceback(running_compiled_code=True) \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", li\r\nne 1936, in showtraceback \r\n \r\n stb = self.InteractiveTB.structured_traceback(etype, \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 1105, \r\nin structured_traceback \r\n \r\n return FormattedTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 999, i\r\nn structured_traceback \r\n \r\n return VerboseTB.structured_traceback( \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 871, i\r\nn structured_traceback \r\n \r\n formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context, \r\n \r\n File \"C:\\Users\\larry.jones\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\libpy-QVeQv1xn-py3.8\\lib\\site-packages\\IPython\\core\\ultratb.py\", line 775, i\r\nn format_exception_as_a_whole \r\n \r\n assert etb is not None \r\nAssertionError \r\n \r\nIf you suspect this is an IPython 8.0.1 bug, please report it at: \r\n https://github.com/ipython/ipython/issues \r\nor send an email to the mailing list at ipython-dev@python.org \r\n \r\nYou can print a more detailed traceback right now with \"%tb\", or use \"%debug\" \r\nto interactively debug it. \r\n \r\nExtra-detailed tracebacks for bug-reporting purposes can be enabled via: \r\n %config Application.verbose_crash=True \r\n \r\n\r\n```","author":{"url":"https://github.com/mrwizard82d1","@type":"Person","name":"mrwizard82d1"},"datePublished":"2022-02-09T01:52:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1693/pythonnet/issues/1693"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4cf343c1-697f-301f-8608-614888451a5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B336:36B19:B1812D:F88372:6970B8D7 |
| html-safe-nonce | ba4b9c311dbbaefda5f9398103e25cf5aa7a2565624bca5178c9ce5becb208ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzM2OjM2QjE5OkIxODEyRDpGODgzNzI6Njk3MEI4RDciLCJ2aXNpdG9yX2lkIjoiNzA1MDMyODkyODU3NjEyNTE0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6a0a0e4a70c8db1afc227614b62bec1b070c72775b79d9a069d2ffd032e2f5dc |
| hovercard-subject-tag | issue:1127953756 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/1693/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f39e82cf042e03f0e315edaca913256147449e90c3863430db5d18a642a014e/pythonnet/pythonnet/issues/1693 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f39e82cf042e03f0e315edaca913256147449e90c3863430db5d18a642a014e/pythonnet/pythonnet/issues/1693 |
| og:image:alt | Environment Pythonnet version: 2.5.2 Python version: 3.8.7 Operating System: Windows 10 .NET Runtime: Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x6... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mrwizard82d1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84d9d5bf3b01412ea10f7c2429cbfc735ccce9ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width