Opened 3 years ago

Closed 2 years ago

#6910 enhancement closed wontfix (wontfix)

Porting twisted.persisted.sob to python3

Reported by: realcr Owned by: realcr
Priority: normal Milestone: Python-3.x
Component: core Keywords:
Cc: Branch:


Porting syntax to work with python2.7 and python3.3.

Attachments (1)

persisted_sob_py3.patch (2.0 KB) - added by realcr 3 years ago.
Porting sob to support python3.3 syntax.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by realcr

Porting sob to support python3.3 syntax.

comment:1 Changed 3 years ago by realcr

In persisted_sob_py3.patch:

  • Using NativeStringIO instead of StringIO.
  • fixes for exec syntax. (Using braces now).
  • implementer instead of implements, regarding zope interfaces.

comment:2 Changed 3 years ago by exarkun

  • Keywords python3 review removed
  • Owner set to realcr

Thanks. There are some coding standard mistakes in this patch. For example, "from foo import bar,baz" should be written as "from foo import bar, baz". You can use twistedchecker to point out some of these. For the rest, you may just have to read the coding standard document. :)

Also, since you ported a module to Python 3, you have to add it and its test module to to mark it as ported.

comment:3 Changed 3 years ago by Julian

The sentiments in #3843 may apply, it's probably worth figuring out whether or not the two functions that seem to use this module in really need to support that going forward?

comment:4 Changed 2 years ago by exarkun

#7437 was a duplicate of this.

comment:5 Changed 2 years ago by exarkun

  • Resolution set to wontfix
  • Status changed from new to closed uses sob.IPersistable. convertStyle is only used by tapconvert which is itself deprecated (too bad the support code for it wasn't deprecated at the same time).

twisted.application.service.Application uses sob.Persistent. It does this to give the resulting "application" object an IPersistable component. This isn't an important part of the application object anymore - we don't encourage people to go around persisting these anymore and twistd will no longer do so. The functionality is not exactly deprecated yet and I'm not sure how you deprecate one component of a componentized... Deprecating IPersistable would prevent anyone from adapting the object to that interface without getting a deprecation warning, though.

twisted.application.service.loadApplication uses sob.loadValueFromFile and sob.load. Only the former is really useful anymore - that's what loads tac files. Deprecating sob.load and the twistd options that support other application definition formats would deal with this sob.load usage. Then sob.loadValueFromFile could probably move into twisted.application so that we can keep loading tac files (it has little or nothing to do with persistence anyway, a tac file is not a persistence artifact, it's source code).

This addresses all of the dependencies of twisted.application on twisted.persisted.

Note: See TracTickets for help on using tickets.