René's URL Explorer Experiment


Title: stacktrace; `pump stream` fails when commit diff is on a file with a colon in the name · Issue #1210 · gitpython-developers/GitPython · GitHub

Open Graph Title: stacktrace; `pump stream` fails when commit diff is on a file with a colon in the name · Issue #1210 · gitpython-developers/GitPython

X Title: stacktrace; `pump stream` fails when commit diff is on a file with a colon in the name · Issue #1210 · gitpython-developers/GitPython

Description: Hi We use this code to check whether a git repo contains only "new" files or whether a file was modified: def git_check_added_only(repo: Repo): prev_commit = repo.commit("HEAD~1") head_commit = repo.head.commit modified_files = list(prev...

Open Graph Description: Hi We use this code to check whether a git repo contains only "new" files or whether a file was modified: def git_check_added_only(repo: Repo): prev_commit = repo.commit("HEAD~1") head_commit = rep...

X Description: Hi We use this code to check whether a git repo contains only "new" files or whether a file was modified: def git_check_added_only(repo: Repo): prev_commit = repo.commit("HEAD~1"...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1210

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stacktrace; `pump stream` fails when commit diff is on a file with a colon in the name","articleBody":"Hi\r\n\r\nWe use this code to check whether a git repo contains only \"new\" files or whether a file was modified:\r\n```\r\ndef git_check_added_only(repo: Repo):\r\n    prev_commit = repo.commit(\"HEAD~1\")\r\n    head_commit = repo.head.commit\r\n    modified_files = list(prev_commit.diff(head_commit).iter_change_type(\"M\"))\r\n    if len(modified_files) \u003e 0:\r\n        ...\r\n```\r\n\r\nWhen running this on repos with only csv data, it's fine. \r\n\r\nHowever when running this on repos with binary files in it, like `.xlxs`, we blow in  a stack trace like this; but because it's threaded I am not sure which exact line above is internally causing this \"pump\"\r\n\r\n```\r\nb\"ERROR:git.cmd:Pumping 'stdout' of cmd(['git', 'diff-tree', '8fd339d63f824428d215be363817d637ffae3430', 'ca2fecd4f638c81af31ef7e1a22d48b68a55d746', '-r', '--abbrev=40', '--full-index', '-M', '--raw', '-z', '--no-color']) failed due to: ValueError('not enough values to unpack (expected 5, got 4)')\\n\"\r\nb'Exception in thread Thread-25:\\n'\r\nb'Traceback (most recent call last):\\n'\r\nb'  File \"/home/mypackage/.local/lib/python3.7/site-packages/git/cmd.py\", line 83, in pump_stream\\n'\r\nb'    handler(line)\\n'\r\nb'  File \"/home/mypackage/.local/lib/python3.7/site-packages/git/diff.py\", line 488, in handle_diff_line\\n'\r\nb'    old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4)\\n'\r\nb'ValueError: not enough values to unpack (expected 5, got 4)\\n'\r\nb'\\n'\r\nb'The above exception was the direct cause of the following exception:\\n'\r\nb'\\n'\r\nb'Traceback (most recent call last):\\n'\r\nb'  File \"/usr/local/lib/python3.7/threading.py\", line 926, in _bootstrap_inner\\n'\r\nb'    self.run()\\n'\r\nb'  File \"/usr/local/lib/python3.7/threading.py\", line 870, in run\\n'\r\nb'    self._target(*self._args, **self._kwargs)\\n'\r\nb'  File \"/home/mypackage/.local/lib/python3.7/site-packages/git/cmd.py\", line 86, in pump_stream\\n'\r\nb\"    raise CommandError(['\u003c%s-pump\u003e' % name] + cmdline, ex) from ex\\n\"\r\nb\"git.exc.CommandError: Cmd('\u003cstdout-pump\u003e') failed due to: ValueError('not enough values to unpack (expected 5, got 4)')\\n\"\r\nb'  cmdline: \u003cstdout-pump\u003e git diff-tree 8fd339d63f824428d215be363817d637ffae3430 ca2fecd4f638c81af31ef7e1a22d48b68a55d746 -r --abbrev=40 --full-index -M --raw -z --no-color\\n'\r\nb'\\n'\r\n```\r\n\r\nNear that line of code I see https://github.com/gitpython-developers/GitPython/blob/main/git/diff.py#L498\r\n\r\n```\r\n        # handles\r\n        # :100644 100644 687099101... 37c5e30c8... M    .gitignore\r\n```\r\n\r\nI do not know how to get to this output on my git terminal. I was going to try to make a test case here seeing if this looks different for binary files (basically make a PDF or an excel file, then edit it, then commit it; but reading the log doesnt show such a format)\r\n\r\nWe do not pin the version of `gitpython` and we rebuild this docker container fairly often so this should be running with the latest version in pypi (488 on your master branch does not coorespond to that line of code; however you've had commits to master since the pypi release)","author":{"url":"https://github.com/tommyjcarpenter","@type":"Person","name":"tommyjcarpenter"},"datePublished":"2021-04-12T18:43:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/1210/GitPython/issues/1210"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1425d982-763d-0d33-b66a-3660f8065fe7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB072:3A8466:570F2F:787CEC:6A57D335
html-safe-nonceb1b81888c9f9ffe7372328b73a863849bc439820c459aa9332940adf7fe5e5f3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDcyOjNBODQ2Njo1NzBGMkY6Nzg3Q0VDOjZBNTdEMzM1IiwidmlzaXRvcl9pZCI6IjI2NDgxMzk2ODUzMDcwNzc0MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfb042b1e65d8c58bca05e737287643c6c310b96109259d2d91bbbd7629935915
hovercard-subject-tagissue:856246067
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/gitpython-developers/GitPython/1210/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a2a24bdde0f3ec32402f9f4aae17e3146af4ea62f99419d164d9ecd925d68157/gitpython-developers/GitPython/issues/1210
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a2a24bdde0f3ec32402f9f4aae17e3146af4ea62f99419d164d9ecd925d68157/gitpython-developers/GitPython/issues/1210
og:image:altHi We use this code to check whether a git repo contains only "new" files or whether a file was modified: def git_check_added_only(repo: Repo): prev_commit = repo.commit("HEAD~1") head_commit = rep...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametommyjcarpenter
hostnamegithub.com
expected-hostnamegithub.com
None837767abbd14b05f219fd812ef2842c659968b63619e1b966dded83972ab5bca
turbo-cache-controlno-preview
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
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
release9044d0f867aa9892268d1f430238ff123e11ee91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/1210#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1210
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1210
Sign up https://github.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=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1210
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1210
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1210
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1210
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1210
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 981 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5.1k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 165 https://github.com/gitpython-developers/GitPython/issues
Pull requests 11 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security and quality 11 https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security and quality https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
stacktrace; pump stream fails when commit diff is on a file with a colon in the namehttps://github.com/gitpython-developers/GitPython/issues/1210#top
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/tommyjcarpenter
tommyjcarpenterhttps://github.com/tommyjcarpenter
on Apr 12, 2021https://github.com/gitpython-developers/GitPython/issues/1210#issue-856246067
https://github.com/gitpython-developers/GitPython/blob/main/git/diff.py#L498https://github.com/gitpython-developers/GitPython/blob/main/git/diff.py#L498
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
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.