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

Python 3 Anaconda #122

Closed
wants to merge 54 commits into from
Closed

Commits on Jun 1, 2015

  1. Update makebumpver for python3 (#1014220)

    Popen returns bytes by default, use a helper method to turn on
    universal_newlines so that the return values are strings as expected.
    
    Update urllib interface for python3 changes.  proxy handling is done
    with a ProxyHandler which needs to be installed before opening the url.
    bcl authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    6431e8d View commit details
    Browse the repository at this point in the history
  2. Build the Anaconda widgets for Python 3 (#1014220)

    Or else there will be issues such as missing overrides.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    03be839 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    ed9198e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    9c84767 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    58d2083 View commit details
    Browse the repository at this point in the history
  6. Use the imp module directly (#1014220)

    Imputils does not publicly provide the imp module
    and also does not exist anymore in Python 3.
    Importing imp directly should work fine in both Python 2 and 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    a91d39d View commit details
    Browse the repository at this point in the history
  7. Remove imports from the __future__ (#1014220)

    Python 3 is the future.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    c71381a View commit details
    Browse the repository at this point in the history
  8. Change configparser and queue imports (#1014220)

    Queue has been renamed to queue and ConfigParser to
    configparser in Python 3.
    
    Also make sure that we don't shadow the queue module by renaming
    all "queue" variables to "queue_instance".
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    0ae58f4 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    f2ca5e3 View commit details
    Browse the repository at this point in the history
  10. Add a test for parse-kickstart (#1014220)

    The parse-kickstart script used for anaconda-dracut emits cmdline strings
    and creates ifcfg files for network settings. Test these to make sure
    they are working correctly.
    
    (cherry picked from commit 9546d9ede8754ab67bdbd3efd7d8c6bc2bf52ec3)
    bcl authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    badf291 View commit details
    Browse the repository at this point in the history
  11. Update python-deps for python3 (#1014220)

    python-deps should print the unique list of files
    
    Add site.py and sysconfig.py dependencies to python-deps
    
    Make sure to pick up any dependencies they have by running them through
    modulefinder.
    
    Add PYTHONHASHSEED to python-deps call
    
    When creating boot images dracut is run in a minimal chroot with no
    /dev/urandom, setting PYTHONHASHSEED lets python3 run without it. The
    seed is used for hashing object ids. It is not used for anything
    requiring security.
    bcl authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    a31442f View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    9dc0ab7 View commit details
    Browse the repository at this point in the history
  13. Update parse-kickstart for python3 (#1014220)

    Also Drop the unicode (c) from parse-kickstart
    
    It causes modulefinder to choke when reading the file. Arguably a bug
    with modulefinder, but it solves things for now.
    bcl authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    289d0c0 View commit details
    Browse the repository at this point in the history
  14. Open the VNC password file for binary writing (#1014220)

    The vncpasswd utility returns binary output.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    459b5c2 View commit details
    Browse the repository at this point in the history
  15. Copy the full SHA
    365920e View commit details
    Browse the repository at this point in the history
  16. Handle subprocess returning bytes (#1014220)

    The subprocess module returns bytes in Python 3,
    so we need to (try) decoding the output (as utf-8)
    for functions that expect text string output and
    there is now a execWithCaptureBinary for forwarding
    binary output when running commands.
    
    We also need to make sure that the output is "printable"
    when binary output logging to the program.log is enabled.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    f0fdaf0 View commit details
    Browse the repository at this point in the history
  17. Return a string when calling a program (#1014220)

    In the places where Anaconda expects the program to returna string.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    0e2327b View commit details
    Browse the repository at this point in the history
  18. Fix ASCII conversion tests (#1014220)

    The when the correct Unicode normalisation method has been set
    (NFKD), we need to replace the old bogus values with correct ones
    in the ASCII conversion tests.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    cc6ef52 View commit details
    Browse the repository at this point in the history
  19. Remove "is Unicode" tests (#1014220)

    All strings are Unicode strings in Python, so remove
    tests that check if a string is Unicode or not.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    776ba23 View commit details
    Browse the repository at this point in the history
  20. Make ASCII conversions Python compatible (#1014220)

    Also fix the normalisation method string - it should be
    "NFKD", not "NKFD".
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    5cb6e4b View commit details
    Browse the repository at this point in the history
  21. Remove sitecustomize (#1014220)

    It was used to force utf-8 as default encoding,
    which is no longer needed in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    a7bcd5a View commit details
    Browse the repository at this point in the history
  22. Handle modules requiring different string types in Python 3 (#1014220)

    The os.write() function works with bytes, as does the IP address
    unpacking function.
    
    But ProxyString needs a string to prevent various (often cryptic)
    issues with quote/unquote expecting/returning str/bytes instances.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    0582c99 View commit details
    Browse the repository at this point in the history
  23. Add and use function that makes sure we work with strings (#1014220)

    This is useful in many places where we are never sure if we get str or bytes and
    we need/want to work with str objects.
    
    Also remove one related (previously) unused import and obsolete comment
    & needless encoding.
    vpodzime authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    0f69039 View commit details
    Browse the repository at this point in the history
  24. Handle modules returning bytes in Python 3 (#1014220)

    For example rpm and vncconfig.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    3660bee View commit details
    Browse the repository at this point in the history
  25. Addapt to string type changes (#1014220)

    StringTypes is now str, UnicodeType is also str and StringType is bytes.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    ab15f1c View commit details
    Browse the repository at this point in the history
  26. Don't use exceptions' message attribute (#1014220)

    In Python 3 exceptions don't (necessarily) have the 'message' attribute. Just
    use the str(e) call instead.
    vpodzime authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    be5651d View commit details
    Browse the repository at this point in the history
  27. Don't depend on side effects of map() (#1141242)

    In Python 2 calling map() returned a list, which had the
    side effect of running the given function on all items in the
    provided iterable, even if the result of the map() call was
    not used.
    
    On the other hand in Python 3 map() returns an iterator
    and the mapped function is not applied on the iterable until
    items are yielded from the iterator.
    
    In short any map() usage that does not use the iterable
    **does nothing** in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    5dea205 View commit details
    Browse the repository at this point in the history
  28. Do not run repo attrs' checks if they are not set up yet (#1014220)

    During population/refresh of the spoke checks may not be set up yet when widgets
    change their state.
    vpodzime authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    2c494ca View commit details
    Browse the repository at this point in the history
  29. Do not use pykickstart's RepoData as a key in a dict (#1014220)

    In Python 3 it is not hashable and it was never meant to be on Python 2 neither.
    vpodzime authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    116692d View commit details
    Browse the repository at this point in the history
  30. Do not open tty5 for writing in the "a" mode (#1014220)

    This results in seek errors in Python 3. Use "wb" instead with the same result
    in this case.
    vpodzime authored and M4rtinK committed Jun 1, 2015
    Copy the full SHA
    08a6606 View commit details
    Browse the repository at this point in the history
  31. Make gettext usage Python 3 compatible (#1014220)

    And persuade it to return strings, not bytes.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    3ba2087 View commit details
    Browse the repository at this point in the history
  32. Replace list comprehension with for at class level

    Access to class level variables from list comprehension no longer
    works in Python 3, so replace it with a for cycle.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    00cfa83 View commit details
    Browse the repository at this point in the history
  33. Rename the warnings spoke to warnings_spoke (#1014220)

    It was shadowing the Python standard library warnings module.
    The py-compile script used by autotools to generate bytecode for
    Python modules is stupid enough to *prepend* its PWD to PYTHONPATH
    and because of that it trying to import the warnings spoke in place of the
    warnings module, breaking the Anaconda package build.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    d3f87a6 View commit details
    Browse the repository at this point in the history
  34. Copy the full SHA
    9e3d77d View commit details
    Browse the repository at this point in the history
  35. Python 3 temp files no longer reflect external changes (#1014220)

    So if we modify the named tempfile externally, we need to also
    externally open it to get the externally added content.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    fe965c3 View commit details
    Browse the repository at this point in the history
  36. Set a correct mode for the tempfile (#1014220)

    We should open temporary files in text mode if we want to write
    text strings into them or get text back - tempfiles use the binary
    mode by default in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    c2dbd12 View commit details
    Browse the repository at this point in the history
  37. Make isys Python 3 compatible (#1014220)

    The Python 3 C extension API has a revamped module initialization
    code and also some of the autotools Python stuff needed to be changed.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    1b18fda View commit details
    Browse the repository at this point in the history
  38. Python 3 no longer does tuple parameter unpacking (#1014220)

    Both in functions and in lambdas - Python 3 lambda will not unpack
    the tuple into named arguments. Instead, each argument will need to be
    referenced by its positional index.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    3000c29 View commit details
    Browse the repository at this point in the history
  39. Copy the full SHA
    db7ceb7 View commit details
    Browse the repository at this point in the history
  40. Copy the full SHA
    233508f View commit details
    Browse the repository at this point in the history
  41. Make iterators and their usage Python 3 compatible (#1014220)

    Various issues such as:
    - iterators need to be converted to lists before joining to a single list
    - iterator need to be converted to a list before doing indexed access or
      using other list specific API on it
    - trying to add a dict_values to a list
    - adding lists and dict_values together
     - use chaining in the above two cases
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    470af53 View commit details
    Browse the repository at this point in the history
  42. Copy the full SHA
    ee0c839 View commit details
    Browse the repository at this point in the history
  43. Copy the full SHA
    8598332 View commit details
    Browse the repository at this point in the history
  44. Don't try to decode strings (#1014220)

    Strings are Unicode by default in Python 3 and don't need to be decoded.
    
    Also don't do needless encoding and decoding in general.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    0a691f8 View commit details
    Browse the repository at this point in the history
  45. Handle urllib split (#1014220)

    Urllib functionality has been split into a number of submodules in
    Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    93be393 View commit details
    Browse the repository at this point in the history
  46. Avoid comparing None to an integer (#1141242)

    None to int comparison became an illegal operation in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    f73bac9 View commit details
    Browse the repository at this point in the history
  47. Don't apply numeric comparison on None (#1141242)

    While Python 2 tolerates numeric comparisons between
    None and integers (like for example None > 0), Python 3
    no longer tolerates this and considers it to be an error.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    f6ab9f7 View commit details
    Browse the repository at this point in the history
  48. Make version comparison Python 3 compatible (#1014220)

    The __cmp__() function is no longer available in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    09ce25c View commit details
    Browse the repository at this point in the history
  49. Python 3 compatible sorting fixes (#1014220)

    Wrap compare functions and make them into key functions
    or forward port the cmp function.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    064e2d8 View commit details
    Browse the repository at this point in the history
  50. Make sure the column number in TUI is an integer (#1141242)

    Division ( / ) returns floating point numbers in Python 3,
    so use floor division ( // ) to always get an int.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    2ea40f9 View commit details
    Browse the repository at this point in the history
  51. Make sure set_system_time() gets an integer (#1014220)

    Division always returns a float in Python 3, so it is more
    likely a float might end in set_system_time(). So wrap the
    value with int() before calling the function.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    ac8f346 View commit details
    Browse the repository at this point in the history
  52. Only warn about missing yum-utils (#1014220)

    Make it possible to run makeupdates without the yum-utils Python module
    being available. We are now running makeupdates with Python 3 but yum
    is Python 2 only, so the yum-utils package will never be available.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    1117df6 View commit details
    Browse the repository at this point in the history
  53. Make sure directory size is returned as int (#1014220)

    Division always returns a float in Python 3.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    d5d75fe View commit details
    Browse the repository at this point in the history
  54. Don't use the _safechars private property (#1014220)

    Don't use the (deprecated in Python 3) _safechars private property
    of the pipes module. Generate the set of safe characters locally
    instead.
    M4rtinK committed Jun 1, 2015
    Copy the full SHA
    b72c1bf View commit details
    Browse the repository at this point in the history