Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OneTime source code compatible with both Python3 and Python2. #4

Closed
kfogel opened this issue Sep 28, 2013 · 2 comments
Closed
Assignees

Comments

@kfogel
Copy link
Owner

kfogel commented Sep 28, 2013

Currently, OneTime is written for Python2 (working with at least 2.7 and 2.6). Ideally, it would be 3.x compatible as well. It's a small and simple enough script that maintaining 2.x and 3.x compatibility simultaneously should be doable. See http://python3porting.com/noconv.html for some advice.

@ghost ghost assigned kfogel Sep 28, 2013
@kfogel
Copy link
Owner Author

kfogel commented Sep 28, 2013

Work for this is happening on the issue-4 branch.

kfogel added a commit that referenced this issue Sep 28, 2013
* onetime
  (__doc__): Remove newline at the end.
  (Configuration.show_pad_records, main): Update print() calls.
kfogel added a commit that referenced this issue Sep 28, 2013
* onetime: Remove the block that defined True and False if they
    weren't already defined.  It's not necessary to support Pythons
    that old, and its try/except syntax is unidiomatic now anyway.
kfogel added a commit that referenced this issue Sep 28, 2013
* onetime
  (Configuration._parse_pad_records_file, Configuration.register):
    Ask if key is in dict in an way that works for Python 2 and 3.
kfogel added a commit that referenced this issue Oct 11, 2013
This doesn't get all the way to full bidirectional compatibility, but
it's progress toward that goal.  Run 'make check' to see what's next.

* onetime: Add 2 vs 3 conditional block at top.
  (btos): New utility function, defined in above block.
  (Pad.convert, Pad._make_fuzz): Handle string vs int manually.
  (main): Use binary_stdout.  Encode headers and footer before writing
    them.  Use new btos() helper where necessary.
@kfogel
Copy link
Owner Author

kfogel commented Jan 10, 2014

This may or may not be worth the effort. Currently OneTime is in 2.0-beta3 using Python 2.6.x, with no 3.0 compatibility. If anyone decides to make it be compatible with 2.x and 3.x simultaneously, the issue-4 branch is probably the place to start, but I'm closing this issue for now as "WONTFIX".

@kfogel kfogel closed this as completed Jan 10, 2014
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

No branches or pull requests

1 participant