Skip to content

changed dict.iteritems() to dict.items() (for making it Py3 compatible) - #158

Closed
pratik0316 wants to merge 1 commit into
aboutcode-org:developfrom
pratik0316:changing_Some_Functions_For_Py3
Closed

changed dict.iteritems() to dict.items() (for making it Py3 compatible)#158
pratik0316 wants to merge 1 commit into
aboutcode-org:developfrom
pratik0316:changing_Some_Functions_For_Py3

Conversation

@pratik0316

Copy link
Copy Markdown
Collaborator

In this PR I changed .iteritems() to .items() and changed the the file opening mode to w instead of wb in cli.py.
I did this changes because
1.Python3 removed the dict.iteritems() to dict.items() references

2.I made the 2nd change i.e. changed the file mode from wb to was because in Py 3, with wb file mode the only serializable objects can be written , but actually we are writing str objects, Now this changed could also be done , by changing every str objects to bytes stream , which would be a lot more messy.So I changed the opening file mode to w which can take str objects for write operation.

The references I took for this is a Medium blog: link

Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
@pratik0316
pratik0316 force-pushed the changing_Some_Functions_For_Py3 branch from 26053e0 to cb6b525 Compare April 14, 2020 20:59
@pratik0316

Copy link
Copy Markdown
Collaborator Author

@MaJuRG , some errors are faced when we don not have these changes and configuring with Py3

@pratik0316 pratik0316 changed the title changed dict.iteritems() to dict.items() changed dict.iteritems() to dict.items() (for making it Py3 compatible) Apr 18, 2020
@steven-esser

Copy link
Copy Markdown
Contributor

#162 merged, which has this fix. Thanks!

@pratik0316

Copy link
Copy Markdown
Collaborator Author

okay :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants