{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":2107916,"defaultBranch":"master","name":"biopython","ownerLogin":"DavidCain","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2011-07-26T16:19:26.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/901169?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1715616123.0","currentOid":""},"activityList":{"items":[{"before":"a032bd2bb847a1d538441d824bf1014eaa79cfd1","after":null,"ref":"refs/heads/dcain-bgzf-writer","pushedAt":"2024-05-13T16:02:03.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"DavidCain","name":"David Cain","path":"/DavidCain","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/901169?s=80&v=4"}},{"before":"a543ca53bda72ec70a4495b0412ed65cdd0c5f6d","after":"a032bd2bb847a1d538441d824bf1014eaa79cfd1","ref":"refs/heads/dcain-bgzf-writer","pushedAt":"2024-05-10T18:05:59.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"DavidCain","name":"David Cain","path":"/DavidCain","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/901169?s=80&v=4"},"commit":{"message":"Summary change, add myself to NEWS.rst","shortMessageHtmlLink":"Summary change, add myself to NEWS.rst"}},{"before":"93694795e2e62f2e4b211d0d0d7605b2cea5c524","after":"a543ca53bda72ec70a4495b0412ed65cdd0c5f6d","ref":"refs/heads/dcain-bgzf-writer","pushedAt":"2024-05-10T02:40:50.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"DavidCain","name":"David Cain","path":"/DavidCain","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/901169?s=80&v=4"},"commit":{"message":"Fix byte mode detection on `BgzfWriter`\n\nIn commit c4a47ffff7f3e7de32ab3d8846983d3531ea63b4, there was an\nattempt to detect handles which are not in binary mode. However, there's\na core problem here in that most handles open in write mode *cannot* be\nread from. For example:\n\n```python\n>>> handle = open('/tmp/demo.txt', 'wb')\n>>> handle.read(0)\nTraceback (most recent call last):\n File \"\", line 1, in \nio.UnsupportedOperation: read\n```\n\nThis means that one cannot pass a plain writeable file object to\n`BgzfWriter`:\n\n```python\n>>> Bio.__version__\n'1.83'\n>>> Bio.bgzf\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: module 'Bio' has no attribute 'bgzf'\n>>> from Bio import bgzf\n>>> with open('/tmp/demo.txt', 'wb') as handle:\n... bgzf.BgzfWriter(fileobj=handle)\n...\n if fileobj.read(0) != b\"\":\n ^^^^^^^^^^^^^^^\nio.UnsupportedOperation: read\n```\n\nIf eager detection of the handle's mode is desired, one can check\n`handle.mode` as was done before -- I opt here to just hardcode handling\nof `io.StringIO`. The simplest option in my opinion is to just rely on\nducktyping -- the `_write_block()` method will try to write the data --\neither the handle accepts `bytes` and all is well, or it fails.","shortMessageHtmlLink":"Fix byte mode detection on BgzfWriter"}},{"before":"3a87ede8a436572ad6d92fa8cd3d58bd111dd0bf","after":"93694795e2e62f2e4b211d0d0d7605b2cea5c524","ref":"refs/heads/dcain-bgzf-writer","pushedAt":"2024-05-10T01:36:29.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"DavidCain","name":"David Cain","path":"/DavidCain","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/901169?s=80&v=4"},"commit":{"message":"Fix byte mode detection on `BgzfWriter`\n\nIn commit c4a47ffff7f3e7de32ab3d8846983d3531ea63b4, there was an\nattempt to detect handles which are not in binary mode. However, there's\na core problem here in that most handles open in write mode *cannot* be\nread from. For example:\n\n```python\n>>> handle = open('/tmp/demo.txt', 'wb')\n>>> handle.read(0)\nTraceback (most recent call last):\n File \"\", line 1, in \nio.UnsupportedOperation: read\n```\n\nThis means that one cannot pass a plain writeable file object to\n`BgzfWriter`:\n\n```python\n>>> Bio.__version__\n'1.83'\n>>> Bio.bgzf\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: module 'Bio' has no attribute 'bgzf'\n>>> from Bio import bgzf\n>>> with open('/tmp/demo.txt', 'wb') as handle:\n... bgzf.BgzfWriter(fileobj=handle)\n...\n if fileobj.read(0) != b\"\":\n ^^^^^^^^^^^^^^^\nio.UnsupportedOperation: read\n```\n\nIf eager detection of the handle's mode is desired, one can check\n`handle.mode` as was done before -- I opt here to just hardcode handling\nof `io.StringIO`. The simplest option in my opinion is to just rely on\nducktyping -- the `_write_block()` method will try to write the data --\neither the handle accepts `bytes` and all is well, or it fails.","shortMessageHtmlLink":"Fix byte mode detection on BgzfWriter"}},{"before":null,"after":"3a87ede8a436572ad6d92fa8cd3d58bd111dd0bf","ref":"refs/heads/dcain-bgzf-writer","pushedAt":"2024-05-09T21:17:07.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"DavidCain","name":"David Cain","path":"/DavidCain","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/901169?s=80&v=4"},"commit":{"message":"Fix byte mode detection on `BgzfWriter`\n\nIn commit c4a47ffff7f3e7de32ab3d8846983d3531ea63b4, there was an\nattempt to detect handles which are not in binary mode. However, there's\na core problem here in that most handles open in write mode *cannot* be\nread from. For example:\n\n```python\n>>> handle = open('/tmp/demo.txt', 'wb')\n>>> handle.read(0)\nTraceback (most recent call last):\n File \"\", line 1, in \nio.UnsupportedOperation: read\n```\n\nThis means that one cannot pass a plain writeable file object to\n`BgzfWriter`:\n\n```python\n>>> Bio.__version__\n'1.83'\n>>> Bio.bgzf\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: module 'Bio' has no attribute 'bgzf'\n>>> from Bio import bgzf\n>>> with open('/tmp/demo.txt', 'wb') as handle:\n... bgzf.BgzfWriter(fileobj=handle)\n...\n if fileobj.read(0) != b\"\":\n ^^^^^^^^^^^^^^^\nio.UnsupportedOperation: read\n```\n\nIf eager detection of the handle's mode is desired, one can check\n`handle.mode` as was done before -- I opt here to just hardcode handling\nof `io.StringIO`. The simplest option in my opinion is to just rely on\nducktyping -- the `_write_block()` method will try to write the data --\neither the handle accepts `bytes` and all is well, or it fails.","shortMessageHtmlLink":"Fix byte mode detection on BgzfWriter"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wNS0xM1QxNjowMjowMy4wMDAwMDBazwAAAARImJki","endCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wNS0wOVQyMToxNzowNy4wMDAwMDBazwAAAARGA8zH"}},"title":"Activity ยท DavidCain/biopython"}