msg18734 - (view) |
Author: Jeremy Hylton (jhylton) |
Date: 2003-10-22 19:30 |
The generated MANIFEST file has Windows slashes
separating path components. If you use this MANIFEST
on Unix, it will bomb complaining the the files are not
"regular files." If you generate a MANIFEST on Unix,
it will work on Windows.
Presumably the solution is to replace \ with / on Windows.
|
msg111045 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2010-07-21 13:03 |
Thanks for the report, and sorry noone replied earlier. Could you perhaps make a diff against test_sdist.py to confirm this bug?
|
msg117680 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2010-09-30 00:36 |
Adding the “easy” keyword to encourage someone to write a test.
|
msg133779 - (view) |
Author: higery (higery) |
Date: 2011-04-15 04:06 |
I will join GSOC2011 and I find this bug is a good test for me to submit my patch as a scoring judgment.
I have created a diff file to confirm this bug, but setuptools may have already fix it, because when using 'python setup.py sdist' to create the source distribution, file paths in SOURCES.txt are correctly with '/' as separator. However, when running the test_sdist.py tests, the problem Jeremy raised exists.
So, it means that distutils still has this problem, but setuptools fix it.
|
msg133829 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-04-15 14:57 |
setuptools sdist uses a wholly different machinery than distutils, so it’s a red herring.
Have you tested that your patch does reproduce the bug? From the diff header, I see that you’ve patched your installed Python instead of using a developpers’ environment. The guide at docs.python.org/devguide should help you get set up.
If the patch does reproduce the bug, can you also fix it?
|
msg133840 - (view) |
Author: higery (higery) |
Date: 2011-04-15 15:33 |
Yes, the test fails and the output msg is:
AssertionError: '\\' unexpectedly found in '# file GENERATED by distutils, do NOT edit\nREADME\nsetup.py\nsomecode\\__init__.py\n'
It means that distutils generates MANIFEST with '\' as file path separator.
OK, I'll try to make the diff and patch against the dev environment to fix this bug ASAP.
|
msg133841 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-04-15 15:34 |
Thanks! I would also like it if you could use a more specific test, comparing a line with a path instead of using the overly broad assertIn, to make the intent of the test clearer.
|
msg133842 - (view) |
Author: higery (higery) |
Date: 2011-04-15 15:44 |
OK. I used this method just because I thought '\' is a special character and if it's in a file path line, then it must be the separator.
As you say, it may be not that clear for others to know what does this test do.
|
msg133920 - (view) |
Author: higery (higery) |
Date: 2011-04-17 05:25 |
It may be just necessary to hack the write_manifest funtion in sdist.py- replace all '\' in MANIFEST with '/', thus it will not have other bad side effects, for instance, it would not change the content of self.filelist and people can also use '/' in MANIFEST template file on windows as usual.
|
msg133985 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-04-18 17:25 |
Thanks for the patch. Follow the “review” link above to find my review.
+1 on making the smallest possible change. The paths inside the Filelist/Manifest objects can continue to use os.sep, we only care about write_file for this bug. Oh, and also read_file: can you add tests for MANIFEST reading? It will be a bit more complicated: write a MANIFEST file with /-separated paths, set os.sep to \\, check that sdist works. You should learn a lot about our tests helpers (mostly TempdirManager).
|
msg134076 - (view) |
Author: higery (higery) |
Date: 2011-04-19 16:49 |
I'm not sure it is necessary to use TempdirManager here to write tests for MANIFEST reading.
The attachment is the test diff file against my last patch with the latest version.
Detail:
Step 1: Write sample MANIFEST strings to the MANIFEST file with '/' as separator and get the filelist of this file(actually just created from the sample strings)
Step 2: Change the os.sep to '\' and then run the sdist command, and a FileList will be generated. Bad effect is MANIFEST file will be re-written: write_manifest function called(method calling route: run->get_file_list->write_manifest). Because the content in MANIFEST has already been changed, we can just use the FileList object to get the filelist, instead of construct it from reading MANIFEST file again as other tests do.
Step 3: Compare filelist_1 generated in Step1 with filelist_2 in Step2, making sure that we have replace '\' with '/' for filelist_2. Yes, we just compare the content to make sure that we has done right thing and reading MANIFEST file with '/' as separator on the platform which os.sep is '\' is ok.
That's all.
|
msg134078 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-04-19 16:53 |
> I'm not sure it is necessary to use TempdirManager here to write tests
> for MANIFEST reading.
Well, the sdist command has to run on some directory where some files exist, right? So it’s better to do it in a temp dir that will automatically get cleaned up.
> Bad effect is MANIFEST file will be re-written:
You should read the docs for MANIFEST and sdist: a MANIFEST without the magic comment will not get overwritten (unless there’s a bug :)
|
msg134128 - (view) |
Author: higery (higery) |
Date: 2011-04-20 07:48 |
>> I'm not sure it is necessary to use TempdirManager here to write tests
>> for MANIFEST reading.
>Well, the sdist command has to run on some directory where some files >exist, right? So it’s better to do it in a temp dir that will automatically get >cleaned up.
Because the MANIFEST file finally will be filled with file-paths which takes '/' as path separator and that's what we can make sure if we already hacked the write_manifest function in sdist.py, so we can just write the imitated paths strings into the MANIFEST file , not needing to really create these files at first. As a test, it makes sense. So, I think we maynot need to use TempdirManager here.
>> Bad effect is MANIFEST file will be re-written:
>You should read the docs for MANIFEST and sdist: a MANIFEST without >the magic comment will not get overwritten (unless there’s a bug :)
Oh, you are right. Thus this bad effect would not exist for this test. But future discussing is still needed.
|
msg137974 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-06-09 14:41 |
I wanted to review the patch but it cannot be applied. It looks like your third patch applies on top of the second. Can you generate a full patch?
|
msg138151 - (view) |
Author: higery (higery) |
Date: 2011-06-11 02:57 |
I just recreated this patch against version 2.7, so I'm not sure it can be applied to all the listed versions.
Note: there still are two pathes, one for sdist.py and another for test_sdist.py
|
msg138176 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-06-11 18:04 |
> I just recreated this patch against version 2.7, so I'm not sure it
> can be applied to all the listed versions.
It’s okay, distutils in 2.7 and 3.x is very similar, I can port.
> Note: there still are two pathes, one for sdist.py and another for
> test_sdist.py
Why? hg diff can create one patch for many files. It’s a bit easier if you upload just one patch. Anyway, it’s not an issue, just upload the missing patch for sdist.py.
|
msg138194 - (view) |
Author: higery (higery) |
Date: 2011-06-12 01:44 |
OK. I recreated a full version patch. I'll remove old patches.
|
msg138204 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-06-12 10:55 |
I have changed some things in your patch. There are still two issues:
1) setting os.sep to \ in the tests is not enough to trigger the bug. This means that the tests really test something only on Windows. I’ll edit them to mock the OS layer and return paths with \, so that we can check that manifest or sdist does the conversion.
2) I am not sure we can actually change this in distutils, because of the compatibility policy. The documentation does not say that the MANIFEST file should be portable, so I’ll ask on distutils-sig for feedback.
|
msg144083 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-09-15 16:03 |
I’ve just found another problem with MANIFEST files created in Windows: they use CRLF.
|
msg144380 - (view) |
Author: higery (higery) |
Date: 2011-09-21 14:39 |
>>I’ve just found another problem with MANIFEST files created in Windows: they use CRLF.
One cann't let Python generate MANIFEST files taking Unix-style LF as newline endings On Windows, I think.
So, does it mean even though we have already made much effort for this bug, it still cann't make MANIFEST file on different platforms cross-platform?
|
msg144381 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2011-09-21 14:42 |
> One cann't let Python generate MANIFEST files taking Unix-style LF as newline
> endings On Windows, I think.
Why? Python can open it fine, and it’s not meant for human edition, so the stupidity of notepad.exe is not a problem <wink>.
> So, does it mean even though we have already made much effort for this bug, it
> still cann't make MANIFEST file on different platforms cross-platform?
The problem is that the docs never say that MANIFEST is cross-platform, so I’m not sure changing this qualify for a bug fix. I have to find time to ask distutils-sig.
See also my point 1) in my previous message: the tests don’t test anything on non-Windows.
For d2 however we can change the MANIFEST format as we like.
|
msg221819 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2014-06-28 22:29 |
@Éric did you ever ask on distutils-sig if MANIFEST is meant to be cross-platform?
|
msg386305 - (view) |
Author: Steve Dower (steve.dower) * |
Date: 2021-02-03 18:16 |
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.
If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:00 | admin | set | github: 39447 |
2021-02-03 18:16:22 | steve.dower | set | status: open -> closed
nosy:
+ steve.dower messages:
+ msg386305
resolution: out of date stage: patch review -> resolved |
2019-03-16 00:04:08 | BreamoreBoy | set | nosy:
- BreamoreBoy
|
2014-06-28 22:29:50 | BreamoreBoy | set | versions:
+ Python 3.4, Python 3.5, - 3rd party, Python 3.2, Python 3.3 nosy:
+ dstufft, BreamoreBoy
messages:
+ msg221819
components:
- Windows, Distutils2 |
2011-09-21 14:42:55 | eric.araujo | set | messages:
+ msg144381 |
2011-09-21 14:39:15 | higery | set | messages:
+ msg144380 |
2011-09-15 16:03:53 | eric.araujo | set | messages:
+ msg144083 |
2011-06-30 17:08:24 | thomas.holmes | set | nosy:
+ thomas.holmes
|
2011-06-12 10:55:35 | eric.araujo | set | files:
+ manifest-sep.diff resolution: accepted -> (no value) messages:
+ msg138204
|
2011-06-12 01:46:23 | higery | set | files:
- test_manifest_reading_sdist.diff |
2011-06-12 01:46:15 | higery | set | files:
- change_path_separator_in_MANIFEST.patch |
2011-06-12 01:44:35 | higery | set | files:
+ change_path_separator_fullversion.patch
messages:
+ msg138194 |
2011-06-11 18:04:19 | eric.araujo | set | messages:
+ msg138176 |
2011-06-11 02:57:48 | higery | set | files:
+ test_manifest_reading_sdist.diff
messages:
+ msg138151 |
2011-06-11 02:43:15 | higery | set | files:
- test_manifest_reading_sdist_v2.diff |
2011-06-11 02:43:07 | higery | set | files:
- test_manifest_reading_sdist.diff |
2011-06-09 14:41:33 | eric.araujo | set | status: pending -> open
messages:
+ msg137974 versions:
- Python 3.1 |
2011-04-29 16:00:44 | eric.araujo | set | status: open -> pending resolution: accepted stage: test needed -> patch review |
2011-04-24 14:54:21 | higery | set | files:
+ test_manifest_reading_sdist_v2.diff |
2011-04-20 07:48:29 | higery | set | messages:
+ msg134128 |
2011-04-19 16:53:43 | eric.araujo | set | messages:
+ msg134078 |
2011-04-19 16:49:18 | higery | set | files:
+ test_manifest_reading_sdist.diff
messages:
+ msg134076 |
2011-04-19 08:30:43 | higery | set | files:
+ change_path_separator_in_MANIFEST.patch |
2011-04-19 08:30:17 | higery | set | files:
- change_path_separator_in_MANIFEST.patch |
2011-04-18 17:25:22 | eric.araujo | set | messages:
+ msg133985 |
2011-04-17 15:35:46 | higery | set | files:
+ change_path_separator_in_MANIFEST.patch |
2011-04-17 15:34:38 | higery | set | files:
- change_path_separator_in_MANIFEST.patch |
2011-04-17 05:25:19 | higery | set | files:
+ change_path_separator_in_MANIFEST.patch
messages:
+ msg133920 |
2011-04-17 05:19:12 | higery | set | files:
- test_sdist.diff |
2011-04-15 17:30:58 | santoso.wijaya | set | nosy:
+ santoso.wijaya
|
2011-04-15 15:44:39 | higery | set | messages:
+ msg133842 |
2011-04-15 15:34:58 | eric.araujo | set | assignee: tarek -> eric.araujo messages:
+ msg133841 |
2011-04-15 15:33:29 | higery | set | messages:
+ msg133840 |
2011-04-15 14:57:10 | eric.araujo | set | messages:
+ msg133829 versions:
+ Python 3.3 |
2011-04-15 04:06:04 | higery | set | files:
+ test_sdist.diff
nosy:
+ higery messages:
+ msg133779
keywords:
+ patch |
2010-09-30 00:36:01 | eric.araujo | set | keywords:
+ easy
messages:
+ msg117680 versions:
+ 3rd party |
2010-08-18 22:57:01 | BreamoreBoy | set | type: behavior versions:
+ Python 3.1, Python 2.7, Python 3.2, - Python 2.6, Python 2.5 |
2010-07-21 13:03:29 | eric.araujo | set | nosy:
+ eric.araujo messages:
+ msg111045
components:
+ Distutils2 stage: test needed |
2009-02-11 02:52:32 | ajaksu2 | set | assignee: tarek nosy:
+ tarek |
2008-01-05 18:02:19 | christian.heimes | set | components:
+ Windows versions:
+ Python 2.6, Python 2.5 |
2003-10-22 19:30:46 | jhylton | create | |