Skip to content

Errors with example calling Python from .NET #249

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

Closed
brenzo90 opened this issue Aug 22, 2016 · 14 comments · Fixed by #427
Closed

Errors with example calling Python from .NET #249

brenzo90 opened this issue Aug 22, 2016 · 14 comments · Fixed by #427
Assignees
Milestone

Comments

@brenzo90
Copy link

brenzo90 commented Aug 22, 2016

When trying to run the numpy example from the Readme file I see the following error:
TypeError : long() argument must be a string or a number, not '0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'

This seems to be cause by the Py.kw function call. However, the numpy.array does not seem to be working properly. The console output looks like this:

image

This is from using the latest master branch and Python 2.7. Has the array handling changed recently?

@den-run-ai
Copy link
Contributor

den-run-ai commented Aug 23, 2016

@ShoTskii I found the version that was working. It actually took me few hours! This used to work in 2013:

fkarb/pythonnet_old@1cfd7e2

It looks like this was originally implemented by @patstew and then merged by @tonyroberts. (f3ff88d)

If you are willing to write tests (preferrably without numpy dependency, just using built-in array.array), or find exactly which version broke this (somewhere around 2013-2014), then please let me know, so that we can assist you, since I consider this feature pretty important.

image

@den-run-ai den-run-ai added the bug label Aug 23, 2016
@patstew
Copy link
Contributor

patstew commented Aug 23, 2016

There is a marginally less ancient branch that worked (as far as I remember) here: https://github.com/patstew/pythonnet
I'm not sure when it broke, I don't use .net anymore.

@den-run-ai
Copy link
Contributor

den-run-ai commented Aug 23, 2016

@patstew can you also explain why arithmetic is implemented like this?

Mathematical operations involving python and literal/managed types must have the python object first, eg np.pi2 works, 2np.pi doesn't

@patstew
Copy link
Contributor

patstew commented Aug 23, 2016

It's been a while, but as far as I remember it's a limitation of Microsoft's DynamicObject API. They only override the operations for TryBinaryOperation where the DynamicObject is first. I believe you could fix it by using the lower-level DynamicMetaObject, but using that API requires a load more code.
You can always explicitly convert the right operand if you need to do a divide or shift or something else that doesn't easily swap.
The relevant stuff that I wrote is here: patstew@0bd8c47

@den-run-ai
Copy link
Contributor

den-run-ai commented Aug 23, 2016

Oh, I see that this is DLR limitation, and confirmed by MS team. The
suggestion in this thread is to implement dynamic operators (-, +, *, etc.)
for arbitrary order to work:

http://stackoverflow.com/questions/2075649/dynamicobject-implicit-casting

Here is the issue I was getting before for exactly this reason:

#86

On Tue, Aug 23, 2016 at 12:17 PM, patstew notifications@github.com wrote:

It's been a while, but as far as I remember it's a limitation of
Microsoft's DynamicObject API. They only override the operations for
TryBinaryOperation where the DynamicObject is first. I believe you could
fix it by using the lower-level DynamicMetaObject, but using that API
requires a load more code. I think.
The relevant stuff that I wrote is here: patstew/pythonnet@0bd8c47
patstew@0bd8c47


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#249 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHgZ5Q8rBS_NwWml2PJEahiFnGrGgGLUks5qiysdgaJpZM4JqZjA
.

@den-run-ai den-run-ai self-assigned this Aug 24, 2016
@den-run-ai den-run-ai added this to the 2.2.0 milestone Aug 24, 2016
@brenzo90
Copy link
Author

@denfromufa it looks like you may be looking in to this already. I can try to narrow down where this broke. I agree it is an important feature. I can't commit to when I will be able to start looking at this however. Hopefully soon.

@Thraka
Copy link

Thraka commented Aug 31, 2016

Does this prevent normal implicit operator declarations from working? Using two pure .NET objects through python I'm getting a cast error. The equivalent code in .NET would work fine (when it goes through the implicit operator)

@den-run-ai
Copy link
Contributor

I believe implicit operator does not work and please open a separate issue
for this, since it is not related to this issue. In IronPython a special
conversion function is provided due to this limitation:

http://www.voidspace.org.uk/ironpython/dark-corners.shtml#implicit-conversion

On Tue, Aug 30, 2016 at 11:05 PM, Andy De George notifications@github.com
wrote:

Does this prevent normal implicit operator declarations from working?
Using two pure .NET objects through python I'm getting a cast error. The
equivalent code in .NET would work fine (when it goes through the implicit
operator)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#249 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHgZ5Q2DVj1v7SnMmqb9bRXurMDnNXczks5qlP2QgaJpZM4JqZjA
.

den-run-ai pushed a commit that referenced this issue Sep 9, 2016
@den-run-ai den-run-ai modified the milestones: 2.3.0, 2.2.0 Feb 2, 2017
@vmuriart
Copy link
Contributor

vmuriart commented Feb 17, 2017

@denfromufa I found out today that numpy is pre-installed in Travis build workers. We could use those if we ever get the embedded tests running.

@vmuriart
Copy link
Contributor

vmuriart commented Mar 7, 2017

Looks like this broke during the Develop/Py3 branch merges. 26cc77b.

Correction, post merge it worked until two commits later, eb825df broke it. That commit was trying to replicate this one 471673a.

Reverting eb825df fixes the issue, but breaks many things within python tests.

@vmuriart vmuriart modified the milestones: 2.4.0, 2.3.0 Mar 8, 2017
@vmuriart
Copy link
Contributor

vmuriart commented Mar 8, 2017

I got this issue fixed, I'll merge in the fix after v2.3.0 release

@den-run-ai
Copy link
Contributor

@vmuriart this is great! @JimSEOW was looking for this fix:

ncgeib/PythonInterface#2 (comment)

@vmuriart
Copy link
Contributor

vmuriart commented Mar 8, 2017

It requires some changes to the converter thats why I'm holding it off till next release since we already have a couple changes to converter/method override on this release.

vmuriart added a commit to vmuriart/pythonnet that referenced this issue Mar 11, 2017
Generic Lists were falling through and being classified as `typecode.Object`
To solve this, adding a specific processing branch for `Generic Lists` only
to avoid breaking the changes from 471673a

Closes pythonnet#249
@vmuriart
Copy link
Contributor

#427 will fix this in case anyone wants to review

vmuriart added a commit that referenced this issue Mar 14, 2017
* Fix numpy array and README example

Generic Lists were falling through and being classified as `typecode.Object`
To solve this, adding a specific processing branch for `Generic Lists` only
to avoid breaking the changes from 471673a

Closes #249

* Update syntax
yagweb pushed a commit to yagweb/pythonnet that referenced this issue Apr 7, 2017
* Fix numpy array and README example

Generic Lists were falling through and being classified as `typecode.Object`
To solve this, adding a specific processing branch for `Generic Lists` only
to avoid breaking the changes from 471673a

Closes pythonnet#249

* Update syntax
AlexCatarino added a commit to QuantConnect/pythonnet that referenced this issue Jun 1, 2017
* Sanitize how to run tests

* Remove unsupported entry points
* Adds reference to Python.Test by default for all tests
* Remove redundant add_reference
* Avoid some implicit AddReferences that were being done

Not all tests added reference to Python.Test consistently. Solve this by making `run_test` the only supported method.

* Remove dependency on six

Remove six.u(...), six.b(...)

Not needed since dropped older python versions

* Clean-up imports

- Fix py2/py3 range/zip behavior
  - Ensure same functions being used
- Fix Exception/System.Exception name clashes

* Fix nameclash object

* Refactor utility functions

* Rename tests

* Refactor assertRaises

test_exceptions: Add exc_info test & fix Exception nameclash

* Format for pep8 and linters

Fix max min nameclash

* Fix tests comparison to None, True, False, isinstance

- Replace type(()) with tuple to clarify intent

* Rename test fixtures

Can mess with test discovery

* Remove unused `using` from testing and format

* Use unittest.skip(...)

* Cleanup testing format

* XML Docs on test fixtures

* Update CHANGELOG

* Implement Py.SetArgv.

* Add a `Py.Throw` function.

Checks whether an error occurred and in case it has throws a
PythonException.

* Add overload for Initialize to pass specific args.

* Allow the engine to be initialized as a Disposable.

* Use Py.Throw in a few more places.

In particular in Py.Import.

* Add PY3.7 to travis with allow_failure

* Format & Whitespace

*.cs linelength 120
Allman

* Update CHANGELOG

* Change applicable comments to xml-docs

* Update API website on docs & fix section headers

Runtime.cs section headers got changed to docs.

* Alias root.pyHandle to py_clr_module

* Syntax cleanup

* Simple classes cleanup (pythonnet#348)

* Standarize properties used across projects

Console had it owns set of properties going on

* Add pyproj from @denfromufa

Corrected the configs, won't interfere with users without PTVS

* Consolidate output paths

http://stackoverflow.com/questions/30191387/what-are-the-consequences-of-setting-same-output-path-for-all-configurations

* Fix clrmodule config mismapping

* Add PY3 project/sln configs

* Update test PyImport path

Changed when consolidate output paths

* Update runtime.csproj

* Documentation clean-up

* Downgrade to nunit2

* Syntax cleanup

* Update CHANGELOG

* Clarify pynetinit.c, runtime build directives

pynetinit.c:
Clarifiy its intent is for PY3

runtime.cs
Remove unnecessary check for System.Text
Simplifies import section

* Whitespace converter.cs

* Propercase AssemblyInfo

* Refactor nativemethods

* Rename `is32bit` to `Is32Bit` for naming consistency

* Replace UCS2/UCS4 build directive with Runtime.UCS

* Add IsPython2 and IsPython3

* Cleanup runtime config

* Remove extra properties/Organize properties

* Refactor property conditions

* Order Runtime.csproj configuration

To make it easier to verify everything is setup correctly
Simplified the Mono.Unix include condition

* Add pylong lost unit test

Wasn't being referenced in the project

* Replace #if DEBUG with conditional attribute

* Fix and disable StrongNameSigning

It works better if they key is in the right folder and its being referenced when signing.
It breaks InternalsVisibleTo though, disabling till have time to look into it. (not that it was actually enabled)

* Fix debug statement & rename debugprint

* Document nPython/Console usage

Closes pythonnet#358

* Quiet Test Fixture build warnings about unused events.

They will be used (or attempted to be used) from Python.

* Mono dependency removed from Linux build.

* Remove mono dependency from PY2 as well.

* Replace bufLength with size

* Remove arch .il files

* Update CHANGELOG

* Remove Mono.Unix reference from project

Remove duplicate property in Python.Test

* Clean-up deprWarning

* Clean-up attribute names and paranthesis

* Use explicit accessors

* Clean-up code-style

Remove redundant parenthesis, enforce brackets, use keywork types.

* Remove obsoleted & Unenforced PermissionSet

See: http://stackoverflow.com/questions/11625447/securityaction-requestminimum-is-obsolete-in-net-4-0

* Add expire to license shield

Github Cache issue

github/markup#224

* Remove usage of #region

It hides away the code in Visual Studio

* Turn on NUNIT exit code

* Fix GC on PyObject during Finalizing

Similar to how `PythonDerivedType` finalizes.

Closes pythonnet#364
Possibly related to pythonnet#245

* Update CHANGELOG

* Add sys.args tests (pythonnet#301)

* Use NUnit from Nuget to ensure right version.

* Simplify Embedded tests & Add new tests (pythonnet#369)

* Add Tuple tests

* Update AppVeyor comments and show when tests start.

* Rename InitializeTest to pyinitialize

Keep consistent with other test classes.

* Simplify embed_tests

Since the previous bug involving initialize/finalize have been solved,
we can confidently upgrade these test to use simpler format.

Also Remove Assert fail messages
NUnit already says the name of which test failed.

* Add e-mail to remove setup.py warnings

* Update NUnit syntax

Use xUnit2 and nUnit3 friendly syntax

* Use string interpolation

Removed extra newline at beginning from deprecation warning message

* Replace PyString_FromStringAndSize usage to PyString_FromString

* Fix xml-docs build warnings

* Refactor AppVeyor/Travis embedded test_runner

Make it easier to diff and upgrade versions by
breaking into multiple lines and using path completion

Powershell continuation: http://stackoverflow.com/a/2608186/5208670
Powershell options splatting: http://stackoverflow.com/a/24313253/5208670

* Add pytest to CI

pytest on travis initially required `sudo=required` otherwise failed.
Without the sudo flag pytest wasn't being upgraded. Needed to force
upgrade.

pytest-dev/pytest#2240

* Convert unittest to pytest

Needs local imports to work.
Conversion done with unittests2pytests and a couple regex

* Add setup.cfg

Control settings for some add-ons like pytest

* Simpler tox

* Upgrade NUnit to 3.6

* Fix coverage w NUnit3; add OpenCover filter

NUnit3/OpenCover behavior changed.
Filter removes coverage from Embedded test files by
focusing only on types of Python.Runtime.*

* Remove check-manifest

* Add overload tests from pythonnet#131

* Refactor converter.cs & methodbind*.cs (pythonnet#375)

* Cleanup/Comment Python.Runtime.dll.config & travis

We don't need the `*.dll` variant since we don't call for those
in `runtime.cs`

Enable embedded tests on travis

* Add LD_LIBRARY_PATH to travis env

Find dlls for embedded tests on PY3

* Find dll for PY2 travis embedded tests

Copy Python.Runtime.dll.config to embedded tests bin output

* Generalize LD_LIBRARY_PATH

Avoid having to manually update python/travis versions

* Add GetPrecedence reference

* Use builtin miniconda

* Update version (pythonnet#379)

* Update setup.py

* Update clr.py

* StackOverflow/Slack shields (pythonnet#384)

Add StackExchange and Slack shields

Shields got too long for a single line, had to break them up into two lines.
One for build/quality status, the other for social/info.

Add regression number to disabled code.

* Slack integration for Travis and Appveyor (pythonnet#386)

* Add Slack integration for Travis

* Use encrypted string for Travis.

* Add hook for Appveyor.

* Simplify LD_LIBRARY_PATH on Travis

Based from: http://stackoverflow.com/a/24115039/5208670
Moved to own section to separate as a prep-enviroment step

* Rename NUnit vars to generic names

Makes it easier to switch test-runners in the future.
Note the if section is being skipped for NUnit3, but leaving it
in case needed to rollback to NUnit2, or upgrade to XUnit

* Remove python test STDERR redirect

Pytest doesn't need stderr redirect. It behaves

* Clean-up AppVeyor build recipe

Conda automatically updates when doing install. To disable its autoupdate add

    conda config --set auto_update_conda False

* Add requirements.txt and pytest options

Pytest options provide summary for skipped/xfailed tests
and adds color on appveyor

* Quiet sdist output & update comments on AppVeyor

* Add pytest header info & remove unused fixtures

Fixtures came from a different project and I forgot to delete them.
Add custom header to gather environment info with test results.

Remove testdir from pythonpath. pytest handles this on conftest.py

* Move Conda env to PowerShell recipe script

PY_VER removes the `.` it is used on appveyor_build_recipe.ps1

* Use Codecov report flags

Upgrade to Codecov v2.0.6, didn't get released to PyPi.

* Clean-up CI configs

* Update CHANGELOG

* Pass arbitrary .NET object as value of an attr of PyObject by dyn type(pythonnet#373)

* Add Coverity badge

* Clean-up CHANGELOG

* Standardize Python.Test fixture location

Ensures that Python.Test is output to same location on both Linux and Windows
as part of build.

.gitkeep to be ensure folder is part of version control.
Can be removed if any file is added to it.

* Add unittest for Overflow/across AppDomains Exceptions reproduction (pythonnet#393)

First exception shows issue from pythonnet#376

* Re-order Initialize tests

* Add documentation and ref to ReInitialize test

* Split and re-order TestPyTupleIsTupleType test

* Skip PyTuple test with AppDomain issue

This skip removes the issue from all PY3 on Travis/AppVeyor.
PY27 still has issue randomly on both Travis/AppVeyor x86, x64,.

* Clean-up embedded tests

Clean-up embedded tests comments and variable types

Remove TestFixture attribute. Optional since NUnit 2.5

https://nunit.org/index.php?p=testFixture&r=2.6.4

* Fix conda build log stderr->stdout

Recent conda-build update added a new log output to log:info.
Powershell interprets this as an ERROR since its on STDERR.

Prevent accidental auto-update & display INFO before building.
Would have made debugging this psudo-error easier.

* Quiet AppVeyor pip/nuget installs

Reduce verbosity to make relevant information easier to find.
Errors and Warnings are still displayed.

Travis doesn't need this since they have log folding.

* Allow private env:var to force conda build

To trigger conda build, just add/update private env:vars FORCE_CONDA_BUILD
on link below. Easier to debug and no need to edit appveyor yml/ps1

https://ci.appveyor.com/project/USER_NAME/pythonnet/settings/environment

* Update AUTHORS

Add names to a few more contributors

* Rename TearDown to Dispose

Easier for future possible migration to other frameworks

* Relocate Embedded tests fixtures

Each test type should contain its own fixtures.
Reduces weird dependency of each testing framework

* Update LICENSE year & include in recipe

* Update conda-recipe version

Get it from recipe file instead of git-tag.

* Add SharedAssemblyInfo & Update Assembly version

Reset version back down to v2.x from v4.0.0.2

See link below for Semanctic Versioning & .NET
https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/

* Add .bumpversion

Configuration based from gh:bumpversion:issues:77#issuecomment-130696156

Usage:
bumpversion major -> increases major and adds `dev` if not present
bumpversion minor -> increases minor and adds `dev` if not present
bumpversion release -> drop the `dev` portion

* Add object overload test

* Add object type to methodbind

* Add more object overload method tests

* Update CHANGELOG

* Enable embedded_tests to Travis w. conditional filters

Add conditional class skip to pytuple for Travis/PY27
Add individual filters to other tests as needed

https://www.amido.com/code/conditional-ignore-nunit-and-the-ability-to-conditionally-ignore-a-test/
http://stackoverflow.com/a/16075029/5208670

* Split blank DefineConstants on `*.csproj`

Visual Studio by default wants to split these.
Any time the csproj is update (new test for example) it splits them.
Splitting them now to not worry about them when reviewing pull_requests.

* Update CHANGELOG

* Fix PythonException GC (pythonnet#400)

Since PythonException doesn't inherit from PyObject, need to reapply
the same fix as from gh:365.

Seen mostly on PY27/Travis on PyTuple tests.
Enable PyTuple tests for PY27/Travis

* Add Eval(...) and Exec(...)

* Keep RunString Public. Fix Assert.AreEqual order

-  Deprecation/Removal should be a separate issue/pr
-  In NUnit/XUnit, expected is the first argument, actual is second. Opposite to how Python does it

* Update CHANGELOG

* Clarify MashalAs on runtime.cs

- Shorten MarshalAsAttribute name
- Put MashalAs'ed argument on own-line
- Flip IF comparison

* Fix runtime Initialize dll nameclash

Looks like dllLocal never changes from IntPtr.Zero

* Update test_sysargv

Previous version didn't test correctly

* Fix the issue of sys.argv being cleared on import clr.

Closes pythonnet#404.

* improve tests.pyproj for intellisense and running tests (pythonnet#395)

* Update tests.pyproj

* Update folder structure

After pytest folders were flatten.
Add code in fixture
Upstream PyImportTest was moved to within Embedded Tests
Add pyproj to editorconfig

* Add case-sensitivity tests

closes #81

* Added branching for ldd command in OSX (pythonnet#406)

* Minor style clean-up runtime/pythonengine

Add missing brackets
Organize using/remove unused
Align arguments

* Fix Py_Main/PySys_SetArgvEx(...) UCS4/PY3 no mem

Based on @dmitriyse work on:
dmitriyse@8a70f09

* Update CHANGELOG, remove extra MarshalAs

* Move PythonBuildDir when not defined

Keep root of solution clean
and out of the way from being imported because its on the `cwd`.

* Update ARCH check

Use sys for x86/x64  check

* Enable TestPyTupleInvalidAppend test

`AppDomain unload` was solved by pythonnet#400.
Closes pythonnet#397.

Possibly also solved pythonnet#245.

* Add tests/refactor existing

* Set language version to 6

Prevent accidental introduction of csharp 7 features.

* Add ICustomMarshaler StrMarshaler

Useful resources
https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.icustommarshaler(v=vs.110).aspx
https://limbioliong.wordpress.com/2013/11/03/understanding-custom-marshaling-part-1/
https://github.com/mono/mono/blob/master/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs
http://stackoverflow.com/a/33514037/5208670

* Add ICustomMarshaler StrArrayMarshaler

* Refactor Marshals

* Add ICustomMarshaler Utf8Marshaler

Refactor PyString_FromStringAndSize
Link explains why `MarshalAs(UnmanagedType.LPWStr)` or `CharSet.Unicode` don't work

http://stackoverflow.com/a/25128147/5208670

* Match PyUnicode_AsUnicode signature in UCS2/UCS4

* Refactor GetManagedString

* Remove internal PyUnicode_AS_UNICODE

Its redundant with PyUnicode_AsUnicode now that the signature
is fixed between UCS2/UCS4.

Apply char conversion that work on both UCS2/UCS4

* Refactor Encoding check

This won't change during runtime.

* Remove ExactSpelling

Not needed as Python doesn't define character specific functions

https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.exactspelling(v=vs.110).aspx

* Remove CharSet.Ansi

Its default charset used

https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.charset(v=vs.110).aspx#Anchor_1

* Remove CharSet.Unicode where not needed

CharSet.Unicode is only needed when args are string type.

https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.charset(v=vs.110).aspx

* Remove CallingConvention

* Rename Runtime field `dll` to `PythonDll`

Add remove full qualification

* Remove unneeded unsafe keyword

* Update CHANGELOG

* Add Runtime.CheckExceptionOccurred(...)

Helps refactor exceptions checks

* Replace Py.Throw with Runtime.CheckExceptionOccurred

* Whitespace clean-up Runtime

* Apply consistent name qualification to runtime.cs

* Unify PY3 UCS2/UCS4 unicode methods

CustomMarshal implementation deals w UCS2/4 differences

* Unify PY2 UCS2/UCS4 unicode methods

PyUnicodeEntryPoint is not used for PY3
since it was unified by PEP393.

It could be defined as "PyUnicode_" for PY3 and further unify the code
between PY2/PY3. Not implementing since not all PY3 methods exist in PY2

* Rename internal methods to proper Python API name

- PyUnicode_FromKindAndString to PyUnicode_FromKindAndData
- PyString_AS_STRING to PyString_AsString

* Fix PY27 dll mapping in Linux/macOS

On 5062377 this was fixed for PY3
but left unchanged for PY2.

On linux/macOS the library is aliased `python2.7` while in windows its `python 27`.
Since internally it wasn't mapped to the correct library in Linux/macOS, we had to
remap it again using the dll.config file.

Closes pythonnet#120

* Refactor runtime's dllBase

As long as the API doesn't change on new python minor releases,
all changes needed for new minor versions is isolated to a small
section of code.

* Style clean-up runtime.cs

* Temporary disable Codecov flags

Codecov added a limit of 20 uploads due to current on-going bug
https://docs.codecov.io/blog/week-8-2017

Also fixed flags casing, documentations says has to be lowercase.

* Fix test_multiple_calls_to_initialize

Exception check didn't upgrade syntax from unittests.
Didn't cause issues because test was passing.

* Fix PythonEngine.Version

Add TestPythonEngineProperties.
Ensure PythonEngine properties are working correctly.
Currently only work on 32bit machines.

Closes pythonnet#413

* Add PYTHONPATH/PYTHONHOME default value tests

Current tests crash on 64bit python on windows, and results
get truncated on Linux.

When working, PYTHONHOME should match ENV VAR if set.
AppVeyor has been updated to test against not blank

* Fix get PYTHONHOME/PYTHONPATH marshal

Unlike pythonnet#413, the return type changes between PY2/PY3.
Extended Custom Marshaler to convert IntPtr to Unicode String

* Rename internal StrMarshaler to UcsMarshaler

To clarify that this is meant to be applied on Unicode type IntPtr and not strings like ones.
Made Marshalers internal, don't see a reason to expose it.

* Unset PYTHONHOME in AppVeyor

Its messing with `conda` causing it to fail to start.
Tests in the `pr` pythonnet#415 make this unnecessary.

* Update conda

Update to using conda based on PY36.
Remove reference to deleted `dll.config` file

* Fix PythonEngine PYTHONHOME setter

Keep memory reference & fix PY3 marshal

* Fix set PythonPath, set ProgramName

Note on PythonPath. Its actually mapping to `Py_SetPath` which is
very different from PYTHONPATH env var. There is no test on it
because it should be set to real paths with libraries. Otherwise it
crashes.

2nd Note. `Py_SetPath` doesn't exist on PY27.

* Deprecate public RunString

Had to remove defaults to disambiguate call on `internal RunString`.
Can re-add after removing `public RunString`

Closes pythonnet#401

* Combine Py_DEBUG and PYTHON_WITH_PYDEBUG flags

They both refer to the PyDebug builds but were added at different times.

Closes pythonnet#362

* Remove PYTHON_WITH_WIDE_UNICODE flag

ABIFlags were introduced in PY32, and --with_wide_unicode was removed in PY33.

https://docs.python.org/3/whatsnew/3.3.html#functionality

Closes pythonnet#417

* Refactor PY2/PY3 Marshal in/out String/Unicode

* Refactor runtime.cs

* Fix Py_SetPath not available in PY2

Closes pythonnet#418

* Calculate Runtime fields before Initialization

* Add timing to detect slow tests on pytest

* Rename test classes/files

Make it easier to distinguish if editor tab refers to class or test.

* Add PyTuple Ctor tests

* Define and document Py_IncRef/Py_DecRef

* Add Tests

* Refactor Exception checking on tested classes

* Clean-up Embedded tests

* Add PyList tests

* Add test for pyscript global variable casting

Test for pythonnet#420

* Clean-up README.md example

* Fix typo in README

* Update CHANGELOG.md

* Bump version: 2.3.0.dev1 → 2.3.0 release

* Bump version: 2.3.0.→ 2.4.0.dev0

Can't start at dev1 as bumpversion breaks if we add a minimum start version for dev.

* Build conda recipe on new tags

Ensure that new binaries are generated for releases which are usually not from pull_requests.

Using APPVEYOR_REPO_TAG_NAME because yields shorter syntax
because it's undefined (ie false) when not a tag
and APPVEYOR_REPO_TAG has to be compared to lowercase `true` instead
of `True` like everything else.

Definitions:
APPVEYOR_REPO_TAG_NAME - contains tag name for builds started by tag; otherwise this variable is undefined;
APPVEYOR_REPO_TAG - true if build has started by pushed tag; otherwise false;

https://www.appveyor.com/docs/environment-variables/

* Fix numpy array and README example (pythonnet#427)

* Fix numpy array and README example

Generic Lists were falling through and being classified as `typecode.Object`
To solve this, adding a specific processing branch for `Generic Lists` only
to avoid breaking the changes from 471673a

Closes pythonnet#249

* Update syntax

* Msbuild15 patch (pythonnet#435)

* Update AUTHORS.md

* Update CHANGELOG.md

* Update setup.py

* Update bld.bat

* Create .mention-bot

* WPF DynamicGrid python and XAML layout files (pythonnet#280)

* Support clr.GetClrType() - as in IronPython (pythonnet#433)

* Support clr.GetClrType() - as in IronPython

Implements pythonnet#432

* Tests for clr.GetClrType()

* clr.GetClrType test: ensure bad type raises ArgumentException

* clr.GetClrType - added xml doc comment, updated AUTHORS.md and CHANGELOG.md

* Simplified implementation of clr.GetClrType (taken from IronPython)

* Update .mention-bot

* Update .mention-bot

* Re-add CallingConvention

Closes pythonnet#448

* Allow passing None for nullable args (pythonnet#460)

* Updated CHANGELOG and AUTHORS (pythonnet#462)

* Fixing Travis CI for mono 5.0 (pythonnet#471)

* Fixing setup.py with mono 5.0

* Go back to xbuild

* Trying to figure out the error cause. Apparently xbuild cannot process the Copy section of the pdb file in the projects.

I have commented them out for now, but this is not a real soltion since they are needed in debug versions. Just to se if it fixes the CI.

* Implement named arguments and With semantics in C# embedding side (pythonnet#461)

* Added python "with" construction

* Added some unit tests for new With method

* Renamed With tests for easier grouping

* Support for named arguments to invoke python methods

* Named argument tests cosmetic changed

* Fixed failing test in python 2.7

* Reset line endings in csproj to LF

* Implements Decimal and Datetime support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants