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

pprint doesn't work on Windows? #506

Open
1 task
simon-20 opened this issue Jun 16, 2023 · 1 comment
Open
1 task

pprint doesn't work on Windows? #506

simon-20 opened this issue Jun 16, 2023 · 1 comment

Comments

@simon-20
Copy link

Describe the bug
scholarly.pprint does not pretty print search results on Windows

To Reproduce
I can reproduce in the following way:

  • create new python virtual environment
  • install scholarly
  • activate venv
  • run python, then:
>>> from scholarly import scholarly >>> search_query = scholarly.search_author('Marty Banks, Berkeley') >>> item = next(search_query) >>> item {'container_type': 'Author', 'filled': [], 'source': , 'scholar_id': 'Smr99uEAAAAJ', 'url_picture': 'https://scholar.google.com/citations?view_op=medium_photo&user=Smr99uEAAAAJ', 'name': 'Martin Banks', 'affiliation': 'Professor of Vision Science, UC Berkeley', 'email_domain': '@berkeley.edu', 'interests': ['vision science', 'psychology', 'human factors', 'neuroscience'], 'citedby': 24392} >>> scholarly.pprint(item) b"{'affiliation': 'Professor of Vision Science, UC Berkeley',\n 'citedby': 24392,\n 'email_domain': '@berkeley.edu',\n 'filled': False,\n 'interests': ['vision science', 'psychology', 'human factors', 'neuroscience'],\n 'name': 'Martin Banks',\n 'scholar_id': 'Smr99uEAAAAJ',\n 'source': 'SEARCH_AUTHOR_SNIPPETS',\n 'url_picture': 'https://scholar.google.com/citations?view_op=medium_photo&user=Smr99uEAAAAJ'}"

Expected behavior
For the above, expected output:

{'affiliation': 'Professor of Vision Science, UC Berkeley',
'citedby': 21074,
'email_domain': '@berkeley.edu',
'filled': False,
'interests': ['vision science', 'psychology', 'human factors', 'neuroscience'],
'name': 'Martin Banks',
'scholar_id': 'Smr99uEAAAAJ',
'source': 'SEARCH_AUTHOR_SNIPPETS',
'url_picture': 'https://scholar.google.com/citations?view_op=medium_photo&user=Smr99uEAAAAJ'}

This happens when running interactively with python, ipython, using either CMD or Powershell (5.1.19041.3031), as well as when running from my own program which imports scholarly.

Desktop (please complete the following information):

  • python version: Python 3.11.3
  • OS: Windows 10

Do you plan on contributing?
Your response below will clarify whether the maintainers can expect you to fix the bug you reported.

  • Possibly.

Additional context
Add any other context about the problem here.

@arunkannawadi
Copy link
Collaborator

The encoding doesn't work the same way in Windows as it does in Linux and macOS. This is known from trying to run on Github Actions, but having no Windows environment to work on, I'd need some help from those who have to fix this issue.

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

No branches or pull requests

2 participants