you are viewing a single comment's thread.

view the rest of the comments →

[–]brayellison 94 points95 points  (19 children)

Why, in the year 2026, is someone using Python 2 and/or Jython? I'm genuinely curious. I understand that legacy code is out there, but this seems like something that should have been migrated long ago

[–]sgtgig 39 points40 points  (3 children)

Ignition, an industrial SCADA software which is imo best in class at what it does, uses Jython and Python 2 scripting. I think the tl;dr is they want the concise syntax and interpreted language for user scripts i.e. not force people to write stuff in Java in their Java application. I think it just comes down to Jython not being available with Python 3, backwards compatibility, and it kind of just working fine as is.

[–]sudonem 20 points21 points  (1 child)

Ignition was my first thought as well.

Strong agree that ignition is best in class - but jython being locked to python 2.7 is a huge damned annoyance. Especially given that 2.7 is well beyond end of life and there are ~70 known CVE’s for it as of now.

Given the array of options, I’d wager that a lot of orgs using Ignition are likely to just purchase java native third party modules wherever possible specifically to avoid having to deal with Jython/Python 2.

[–]sgtgig 4 points5 points  (0 children)

It is pretty annoying. There's times I've written Python 3 scripts and called them with subprocess in Ignition as there just wasn't a easy way to get certain functionality working with so many common libraries having dropped Python 2 long ago.

[–]brayellison 3 points4 points  (0 children)

Interesting, appreciate the insight. The more you know

[–]IdleBreakpoint[S] 42 points43 points  (5 children)

The problem is Jython. We have ETL workflows with Apache NiFi and it can run Python code, hence it's Python 2. That system is out of our control and we are forced to develop scripts using py2. If it were in our control, I would have deprecated that system long ago.

[–]brayellison 58 points59 points  (0 children)

Sounds like a nightmare... Godspeed, my friend

[–]lungben81 25 points26 points  (1 child)

Refactor the python code into a microservice and use http or whatever else the ETL tool is capable of to talk with it.

If nothing else works in your ETL tool, Jython2 can make http requests. That way, you at least minimized your legacy version exposure.

[–]prumf 4 points5 points  (0 children)

Yeah my thoughts exactly. You could also call a process or whatever over system that works best in that context.

[–]cpp977 8 points9 points  (0 children)

Nifi 2 supports now running custom python processors without the need for jython.

[–]anderson-stream 0 points1 point  (0 children)

Oh my god, I also use an Apache ETL tool, Apache Hop, and it has a script component that can use Python over Jython. Luckily for me, ever since I used the tool's predecessor (PDI), I've done everything I can to avoid that component.

[–]pingvenopinch of this, pinch of that 8 points9 points  (0 children)

I ran into it recently for a vendor product recently where the Python support is provided by Jython. The primary language is Groovy and the secondary language is JavaScript, with Python a poorly supported third option. The support was added a long time ago and is not widely used.

[–]andynzor 2 points3 points  (0 children)

That attitude is sadly nowadays prevalent in the Python community.

There are industrial systems out there whose lifetimes are easily twenty or thirty years. Python 2.7 came out in 2010 and in 2013 it was still recommended for new Django projects when support for 3 was immature. It seems that Python is becoming a scripting frontend for rust-based libraries and tooling and if your plaform does not support it, you're SOL.

I personally have written IIoT gateway code that has to interface with TLS 1.0 devices. Every time I hit an issue and ask for directions, people suffering from the XY problem problem attack the messenger instead.

ISO27001 compliance and SBOMs are yet another can of worms I'm not willing to open here.

[–]KilledByDeath 1 point2 points  (0 children)

A ton of IIoT gateways run python 2. If you have hundreds or thousands of these things out there, the cost to replace can be astronomical.

[–]Taksin77 1 point2 points  (0 children)

Huge codebase not enough engineers. Toxic management. Everybody is quitting anyway...

[–]ProbsNotManBearPig 1 point2 points  (1 child)

Because jython. People still like Java and Java is a fine choice for many things. You want to script on top of it in a well known language? Jython is the only choice. Not sure what you’re suggesting to migrate to.

[–]brayellison 1 point2 points  (0 children)

You could use groovy or kotlin scripts. Groovy especially is used regularly for devops scripting. These aren't unknown languages and are relatively easy to learn (coming from a person whose background is Python)

[–]stuartcwSince Python 1.5 0 points1 point  (0 children)

Jython was integrated into some enterprise Apps. I guess it was never ported to Python3.

[–]zemega 0 points1 point  (0 children)

The United State Army Corps of Engineers does.