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 2: %s formatting a greenlet results in a unicode object instead of a str #218

Closed
jamadden opened this issue Nov 21, 2020 · 0 comments · Fixed by #219
Closed

Python 2: %s formatting a greenlet results in a unicode object instead of a str #218

jamadden opened this issue Nov 21, 2020 · 0 comments · Fixed by #219

Comments

@jamadden
Copy link
Contributor

Because tp_repr is using PyUnicode_Format; directly calling repr or str converts the result to a str, but for some reason %s formatting does not.

>>> import sys
>>> print(sys.version)
2.7.18 (default, Sep  7 2020, 05:51:03)
[GCC Apple LLVM 12.0.0 (clang-1200.0.31.1)]
None
>>> import greenlet
>>> '%s' % (greenlet.getcurrent(),)
u'<greenlet.greenlet object at 0x10694b910 (otid=0x106bd1950) current active started main>'
jamadden added a commit to gevent/gevent that referenced this issue Nov 21, 2020
jamadden added a commit that referenced this issue Nov 23, 2020
clrpackages pushed a commit to clearlinux-pkgs/gevent that referenced this issue Jan 5, 2021
…0.12.1

Arnon Yaari (1):
      minor doc fix

Jason Madden (104):
      Back to development: 20.9.1
      Update tested PyPy versions to 7.3.2.
      Revert to PyPy 7.3.1.
      Disable two certificate tests on 3.5 that still don't pass.
      Add a doc note about #1701 [skip ci]
      Updates to work with greenlet 1.0a1
      Workaround python-greenlet/greenlet#218
      Add initial github actions workflow [travis skip][appveyor skip]
      Add lint step to GHA
      Moving env around.
      need test deps to run pylint.
      Hmm, comment out lint. Why is the default 'build' step not running?
      Ahh, need to handle os as part of the matrix.
      Run lint in the same job to speed up.
      Trim matrix and try to enable pip caching.
      Move caching to a useful location.
      Tweak to CFLAGS.
      No fallback without CFLAGS.
      Another try with caching.
      Attempt enabling ccache.
      Tweak name again.
      macos brew doesn't like sudo
      Need a distinct cache key for ccache as well.
      Add more to the test matrix.
      Needed a run in a step.
      Coverage argument in correct place.
      Try another way to get the subprocess tests to fix coverage.
      more on coveralls.
      indentation.
      Use newer coverage.
      Try using https://github.com/AndreMiras/coveralls-python-action
      rename job
      coverage tweaks.
      More coverage and retries.
      Enable relative_files again, now that we have an editable install.
      Add a step that saves the built wheel.
      Add a job to test without embeds
      Tweak environment variables for non-embedded.
      configure scripts need an absolute path for the prefix argument.
      LDFLAGS also needs to be absolute.
      Hmm, GHA must have a version of realpath that requires paths to exist by default.
      Another go with paths
      Another go with paths
      Try to canonicalize LD_LIBRARY_PATH as well
      Try running our docker build.
      Use more recent pip
      Try to avoid 'input device not a TTY'. Thanks, GHA.
      Try building with manylinux2014 due to pypa/manylinux#836
      More on caching.
      Show env
      Back to the 2010 image. Also try enabling the Arm builds.
      Fix #1079.
      Dont install ccache on the arm docker image.
      Try speeding up the aarch64 builds.
      Reduce output again.
      Restore pip cache ownership after running the manylinux script so it can be stored
      Move a manylinux to the top.
      More tweaks. It took at least 33 minutes to build gevent on arm/python35. Enable some output to try to figure out why.
      Remove references to Travis, and enable pypa/gh-action-pypi-publish to upload built wheels on tagged releases.
      Disable c-ares when building on arm github actions.
      Installing the EPEL RPM gives us access to ccache for the 2014 image.
      Avoid printing a TypeError traceback on certain types of invalid client requests.
      Remove mysphinxext.py. It seemed unused.
      Minor doc reorganization.
      Python 2, subprocess: Let unbuffered binary writes to popen.stdin loop to write all the data.
      Tweak some timing asserts in test__threadpool.py
      Add comments about the state of SCRIPT_NAME.
      More gracefully handle errors pickling a traceback.
      Rework the way Semaphore handles cross-thread locking.
      Handle more cases, and be more careful with hubs.
      Better handle multi-threaded case when a greenlet from a different thread is already waiting.
      Correct the link flags to work on both manylinux images
      Re-enable the RLock threading tests on Python2.
      PyPy/Win is flaky. Cant reproduce on any other PyPy
      testDup is flaky on Py2/Win.
      Fix #1663 by more gracefully handling non-type arguments.
      Semaphore: Dont try to notify if the links have vanished.
      Add --second-chance to the testrunner, and use it on CI.
      Install thread profiling/tracing hooks in ThreadPool worker threads while the task runs.
      Looks like a memory-fence type issue on PyPy on Win.
      Try new names for pypy on github actions.
      Try to avoid a Fatal Python Error by reducing the Python-level recursion limit.
      Try to avoid a Fatal Python Error by reducing the Python-level recursion limit more.
      Try to avoid a Fatal Python Error by reducing the Python-level recursion limit more.
      Skip on CI
      Forgot to run the teardown. This should fix the leaktest.
      Print a list of rerun tests. [skip ci]
      Make gevent.pywsgi stop dealing with chunks when the connection is being upgraded.
      Move socket objects fully to __slots__.
      Add change note to docs. [skip ci]
      Refactor _socket2/_socket3 to move more truly common methods into SocketMixin.
      Make loops automatically break when their owning hub is destroyed.
      Add some extra details to .github/ISSUE_TEMPLATE.md [skip ci]
      Tweak wording about Fedora package managers in docs/development/installing_from_source.rst. [skip ci]
      Tweak comment to add reason whe we must destroy the hub first. [skip ci]
      Document existence of aarch64 wheels in 20.12.0
      Preparing release 20.12.0
      Minor CHANGES.rst cleanups. [skip ci]
      Back to development: 20.12.1
      Add Python 3.9 to the local mac build script
      Make Greenlets context managers to handle their lifetime.
      Use Python objects instead of C long for Semaphore._multithreaded
      Try to fix mac wheel uploads.
      Preparing release 20.12.1

Tim Gates (1):
      docs: fix simple typo, empoyed -> employed
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 a pull request may close this issue.

1 participant