René's URL Explorer Experiment


Title: Inappropriate use of `print` · Issue #57 · Smartling/api-sdk-python · GitHub

Open Graph Title: Inappropriate use of `print` · Issue #57 · Smartling/api-sdk-python

X Title: Inappropriate use of `print` · Issue #57 · Smartling/api-sdk-python

Description: In multiple places in your SDK, you're using print outside the examples: $ fd --exclude 'example' -X rg print ./HttpClient.py 95: print("Non 200 response:%s RequestId:%s URL:%s response:%s" % ./ObsoleteSmartlingFileApi.py 34: for k,v in ...

Open Graph Description: In multiple places in your SDK, you're using print outside the examples: $ fd --exclude 'example' -X rg print ./HttpClient.py 95: print("Non 200 response:%s RequestId:%s URL:%s response:%s" % ./Obs...

X Description: In multiple places in your SDK, you're using print outside the examples: $ fd --exclude 'example' -X rg print ./HttpClient.py 95: print("Non 200 response:%s RequestId:%s URL:%s res...

Opengraph URL: https://github.com/Smartling/api-sdk-python/issues/57

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inappropriate use of `print`","articleBody":"In multiple places in your SDK, you're using `print` outside the examples:\r\n```\r\n$ fd --exclude 'example' -X rg print\r\n./HttpClient.py\r\n95:            print(\"Non 200 response:%s   RequestId:%s   URL:%s   response:%s\" %\r\n\r\n./ObsoleteSmartlingFileApi.py\r\n34:        for k,v in response.items(): print k, ':' ,v\r\n\r\n./MultipartPostHandler.py\r\n78:                    print(\"Replacing %s with %s\" % (request.get_header('content-type'), 'multipart/form-data'))\r\n\r\n./SmartlingProjectsApiV2.py\r\n32:        for k,v in response.items(): print k, ':' ,v\r\n\r\n./SmartlingFileApiV2.py\r\n33:        for k,v in response.items(): print k, ':' ,v\r\n\r\n./AuthClient.py\r\n53:            print(e)\r\n\r\n./FileApiBase.py\r\n98:            print (\"code:%d RequestId:%s jsonBody=%s\" % (code, rId, jsonBody))\r\n```\r\n\r\ne.g.\r\nhttps://github.com/Smartling/api-sdk-python/blob/f65d52b2361dbc29730ad82c85e7bbe7df644043/smartlingApiSdk/HttpClient.py#L95-L97\r\n\r\nThat leads to unexpected results for the users (myself included):\r\n```python\r\nIn [18]: resp, status = jobs_api.getJobDetails('foo')\r\nNon 200 response:404   RequestId:Unknown   URL:https://api.smartling.com/jobs-api/v3/projects/3bea86d16/jobs/foo   response:b'{\"response\":{\"code\":\"NOT_FOUND_ERROR\",\"errors\":[{\"key\":\"not.found\",\"message\":\"Translation job is not found\",\"details\":null}]}}'\r\n```\r\n\r\nNote that the error is printed to the standard output. This is unexpected because in the app I'm integrating Smartling into, I would check for `status` and then log `resp.errors` or raise an exception. That print would be a redundant noise injected into the app normal output (logs and warnings, primarily).\r\n\r\nI think you should consider either removing those `print`s (if those are accidental debug prints) or replacing them with (debug-level?) `logging` (which I know you're already configured and use in other places)—depending on each case, I believe.","author":{"url":"https://github.com/Toreno96","@type":"Person","name":"Toreno96"},"datePublished":"2023-10-12T13:20:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/57/api-sdk-python/issues/57"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ab98e398-d024-2af8-403c-8daae36435a7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8992:10046D:38CF11D:4958A6B:6974C53C
html-safe-nonce5a240a90c21452742b3e00bf37602eba22dc03b5c83a60fb2164654109f9ad9a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTkyOjEwMDQ2RDozOENGMTFEOjQ5NThBNkI6Njk3NEM1M0MiLCJ2aXNpdG9yX2lkIjoiNjcyNTkxMDI1NjI0MzY4NDQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3eff6a829b97db303b64124b46bc63e91d24c8c4486b5a9d0befac43ac2d43c3
hovercard-subject-tagissue:1939992432
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Smartling/api-sdk-python/57/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f0e25b0ff983a24854e1ab4f0a227ece7a62dd2ce51671a4ed7ab3c0584fc8ba/Smartling/api-sdk-python/issues/57
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f0e25b0ff983a24854e1ab4f0a227ece7a62dd2ce51671a4ed7ab3c0584fc8ba/Smartling/api-sdk-python/issues/57
og:image:altIn multiple places in your SDK, you're using print outside the examples: $ fd --exclude 'example' -X rg print ./HttpClient.py 95: print("Non 200 response:%s RequestId:%s URL:%s response:%s" % ./Obs...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameToreno96
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/Smartling/api-sdk-python git https://github.com/Smartling/api-sdk-python.git
octolytics-dimension-user_id1492945
octolytics-dimension-user_loginSmartling
octolytics-dimension-repository_id3796345
octolytics-dimension-repository_nwoSmartling/api-sdk-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3796345
octolytics-dimension-repository_network_root_nwoSmartling/api-sdk-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/57#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSmartling%2Fapi-sdk-python%2Fissues%2F57
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSmartling%2Fapi-sdk-python%2Fissues%2F57
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Smartling%2Fapi-sdk-python
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/57
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/57
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/57
Smartling https://patch-diff.githubusercontent.com/Smartling
api-sdk-pythonhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Fork 17 https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Star 14 https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Code https://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Issues 3 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues
Pull requests 2 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulls
Actions https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/actions
Projects 0 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/projects
Security 0 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/security
Insights https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulse
Code https://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Issues https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues
Pull requests https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulls
Actions https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/actions
Projects https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/projects
Security https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/security
Insights https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Smartling/api-sdk-python/issues/57
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Smartling/api-sdk-python/issues/57
Inappropriate use of printhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/57#top
https://patch-diff.githubusercontent.com/anatolija
https://github.com/Toreno96
https://github.com/Toreno96
Toreno96https://github.com/Toreno96
on Oct 12, 2023https://github.com/Smartling/api-sdk-python/issues/57#issue-1939992432
api-sdk-python/smartlingApiSdk/HttpClient.pyhttps://github.com/Smartling/api-sdk-python/blob/f65d52b2361dbc29730ad82c85e7bbe7df644043/smartlingApiSdk/HttpClient.py#L95-L97
f65d52bhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/commit/f65d52b2361dbc29730ad82c85e7bbe7df644043
anatolijahttps://patch-diff.githubusercontent.com/anatolija
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.