Skip to content
Discussion options

You must be logged in to vote

Parsers have been deep copied since cmd2 2.5.0, but unfortunately this change is not mentioned in our CHANGELOG.

The context behind this change goes back to issue #1002.

I believe the reason it doesn't crash in 2.5.6 is the timing of when deep copies are made. Prior to 2.5.7, parsers were copied in cmd2.Cmd.__init__(). I assume you are adding the Device object to your parser after this method runs, so it wasn't present when the parser was deep copied.

On 2.5.7, we make the deep copy when the parser is first accessed via self._command_parsers. At this point, Device was present in the parser, and it crashed trying to deep copy it.

Does this description sound correct for what you're seeing?

S…

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@Sripadvallabh
Comment options

Answer selected by tleonhardt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@Sripadvallabh
Comment options

@Sripadvallabh
Comment options

@kmvanbrunt
Comment options

@Sripadvallabh
Comment options

@Sripadvallabh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants