Live data from Hacker News

Python 3.12.0 is to remove long-deprecated items

discuss.python.org

21–30 of 257 posts

Re: Python 3.12.0 is to remove long-deprecated items

#21
post #3
post #2

Breaking changes in Python releases are nothing new, that’s why none of my Python projects are using the latest version :shrug:

The title is referencing this line (not TFA's actual title): > In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2). I doubt your projects are using 3.1 or 3.2 (or older, except perhaps 2.7, but then you wouldn't care that 3.12 was removing something deprecated vs 3.11 which has it)?

Deprecated does not mean removed. They are still there, working fine, having no big reason to change them. I know it, as I just checked my and my workplaces code, and there are several usages of deprecated code. And we are on 3.9/3.10.

Re: Python 3.12.0 is to remove long-deprecated items

#22
post #10

While it's been coming for a long time, it's still frustrating to see the cgi module go. It's going to create a load of busy work to rewrite some low-traffic scripts. Modules being removed [edit: in 3.13]: https://docs.python.org/dev/whatsnew/3.12.html#pending-remov... Updating CGI scripts will be a bit fiddly: https://peps.python.org/pep-0594/#cgi

There is CGIHandler that ships with python. Not many examples that are simple, so...

  #!/usr/bin/env python
  from wsgiref.handlers import CGIHandler

  def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    return [
      b"foobar"
    ]

  if __name__ == '__main__':
    CGIHandler().run(app)

Re: Python 3.12.0 is to remove long-deprecated items

#24
post #22
post #10

While it's been coming for a long time, it's still frustrating to see the cgi module go. It's going to create a load of busy work to rewrite some low-traffic scripts. Modules being removed [edit: in 3.13]: https://docs.python.org/dev/whatsnew/3.12.html#pending-remov... Updating CGI scripts will be a bit fiddly: https://peps.python.org/pep-0594/#cgi

There is CGIHandler that ships with python. Not many examples that are simple, so... #!/usr/bin/env python from wsgiref.handlers import CGIHandler def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) return [ b" foo bar " ] if __name__ == '__main__': CGIHandler().run(app)

Thank you!

Re: Python 3.12.0 is to remove long-deprecated items

#25
post #19
post #10

While it's been coming for a long time, it's still frustrating to see the cgi module go. It's going to create a load of busy work to rewrite some low-traffic scripts. Modules being removed [edit: in 3.13]: https://docs.python.org/dev/whatsnew/3.12.html#pending-remov... Updating CGI scripts will be a bit fiddly: https://peps.python.org/pep-0594/#cgi

You linked to Python 3.13 removals. Python 3.12 removals are here: https://docs.python.org/dev/whatsnew/3.12.html#removed

Thanks. I did ctrl-f cgi as I knew its removal was coming and missed the heading. So one more point release of grace, but it's still coming soon.

Re: Python 3.12.0 is to remove long-deprecated items

#26
Don't think I was using any of these removed things, and it all sounds sensible looking at the fuller list at https://docs.python.org/dev/whatsnew/3.12.html#removed

> Remove the filename attribute of gzip.GzipFile, deprecated since Python 2.6, use the name attribute instead.

2.6 wow, that's some compatibility right there. About time that got removed then! Either that or undeprecate it, if it's fine to use. Any decision at this point is a good one.

Re: Python 3.12.0 is to remove long-deprecated items

#28

Earlier quoted context omitted.

The stdlib is linked to the version of the language, yes.

I wonder if there are languages (that have a stdlib) where that isn't the case

The c stdlib is more tightly coupled to the OS then any particular Compiler; and is not changed when you select a particular dialect (though the language standard dose specify what stdlib must support).

Re: Python 3.12.0 is to remove long-deprecated items

#29
post #27

This is a reminder that the excellent pyenv [0] project can help you manage all your Python versions. - Set global and per-project python versions - Not written in Python. - Shims your PATH - Linux, Mac, Windows [0]: https://github.com/pyenv/pyenv

Not really windows, WSL. There's windows fork recommended. Classic python splitting the ecosystem up. Why something like this isn't in go or rust that's actually cross platform capable just seems like excess effort.

Re: Python 3.12.0 is to remove long-deprecated items

#30
Is there a standard way a Python script can ask for an older version of the environment? If I could insert a few lines of code into the top of the WikidPad source, to specify an OLDER version of wxPython, for example... I'd be able to switch to Linux from Windows.

As it is now, there were breaking changes in wxPython (likely due to the culture of breaking working code extant in Python) which result in WikidPad being broken.

It seems to me that if the Python community continues in this direction, nothing will work more than 3 months after it's last github commit.

[edit/append] No, I'm not sure it's wxPython and not wxWindows that is the issue. I'll have to stuff my Linux boot SSD in, and then try to build WikidPad again to know for sure (it's been too long)

I didn't write WikidPad, it seems to have been last maintained about 2012, but I use it for my notes, etc. I really like it, but the breakage on the Linux side is a show stopper. It's really unfortunate that Linux doesn't have a stable API like Win32, and forces dependence on source code.

I'd consider installing an older version of Linux to force older python, wxPython, wxWindows, etc... and try to figure it from there... the last time I looked at it I got a wall of confusing errors, and couldn't patch it enough to get any functionality out of it.

Post reply on HN