Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue16965

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:2to3 should rewrite execfile() to open in 'rb' mode
Type:behaviorStage:resolved
Components:2to3 (2.x to 3.x conversion tool)Versions:Python 3.8
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: ZackerySpytz, barry, benjamin.peterson, miss-islington, serhiy.storchaka, tshepang
Priority:normalKeywords:patch

Created on2013-01-14 18:24 bybarry, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 8569mergedZackerySpytz,2018-07-30 18:23
PR 9838mergedmiss-islington,2018-10-13 09:27
PR 9839mergedmiss-islington,2018-10-13 09:27
PR 9890mergedZackerySpytz,2018-10-15 11:25
Messages (7)
msg179964 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2013-01-14 18:24
In this distribute bug I describe a problem when pip installing mimeparse, which has a setup.py with a BOM.  distribute uses execfile() which gets fixed in Python 3 to use a combination of compile(open()) as the fixer.https://bitbucket.org/tarek/distribute/issue/349/dont-rely-on-2to3-to-properly-rewriteI think the problem is that the fixer opens the file in text mode, which leaves the BOM as a bogus first character, causing the SyntaxError.  Instead, if the fixer opened the file in binary mode, then the BOM would be handled correctly by compile().
msg223226 -(view)Author: Mark Lawrence (BreamoreBoy)*Date: 2014-07-16 15:52
Can we have a response to this please.
msg327567 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-12 07:18
`exec(compile(open("fn", "rb").read(), "fn", 'exec'))` will emit a resource warning because the open file is not closed explicitly.But this is a different issue.
msg327645 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-13 09:27
New changesetd4d60134b29290049e28df54f23493de4f1824b6 by Serhiy Storchaka (Zackery Spytz) in branch 'master':bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)https://github.com/python/cpython/commit/d4d60134b29290049e28df54f23493de4f1824b6
msg327646 -(view)Author: miss-islington (miss-islington)Date: 2018-10-13 09:48
New changeset22381394ad1541db0b652eed802601f62510d22f by Miss Islington (bot) in branch '3.7':bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)https://github.com/python/cpython/commit/22381394ad1541db0b652eed802601f62510d22f
msg327647 -(view)Author: miss-islington (miss-islington)Date: 2018-10-13 09:51
New changeset950fa40eee483f7507cd825b574a018b957dd253 by Miss Islington (bot) in branch '3.6':bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)https://github.com/python/cpython/commit/950fa40eee483f7507cd825b574a018b957dd253
msg327809 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2018-10-16 05:46
New changesetf5e00f490ab5abfcf5e38e58bf969c7b5dcb4818 by Serhiy Storchaka (Zackery Spytz) in branch '2.7':[2.7]bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) (GH-9890)https://github.com/python/cpython/commit/f5e00f490ab5abfcf5e38e58bf969c7b5dcb4818
History
DateUserActionArgs
2022-04-11 14:57:40adminsetgithub: 61169
2018-10-16 05:47:18serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-16 05:46:40serhiy.storchakasetmessages: +msg327809
2018-10-15 11:25:37ZackerySpytzsetpull_requests: +pull_request9253
2018-10-13 09:51:39miss-islingtonsetmessages: +msg327647
2018-10-13 09:48:22miss-islingtonsetnosy: +miss-islington
messages: +msg327646
2018-10-13 09:27:50miss-islingtonsetpull_requests: +pull_request9213
2018-10-13 09:27:43miss-islingtonsetpull_requests: +pull_request9212
2018-10-13 09:27:35serhiy.storchakasetmessages: +msg327645
2018-10-12 07:18:26serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg327567
2018-07-31 05:24:32BreamoreBoysetnosy: -BreamoreBoy
2018-07-30 18:24:15ZackerySpytzsetnosy: +ZackerySpytz

versions: + Python 3.8, - Python 3.4, Python 3.5
2018-07-30 18:23:35ZackerySpytzsetkeywords: +patch
stage: patch review
pull_requests: +pull_request8081
2014-07-16 15:52:13BreamoreBoysetversions: + Python 3.5, - Python 3.2, Python 3.3
nosy: +BreamoreBoy,benjamin.peterson

messages: +msg223226

type: behavior
2013-01-18 19:27:03tshepangsetnosy: +tshepang
2013-01-14 18:24:06barrycreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp