New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent change to support bytes and python3 is breaking Windows build #106
Comments
Can you please test on Windows if the Python 3 built-in Path object works as expected? See #53 (comment) I didn't understand the problem fully and I have no test case to verify anything, so this using Pathlib was just a general suggestion. I do understand your viewpoint on reverting the merge, but as stated in the last paragraph of #53 (comment) Eric finds it easier to have this on master and then clean up and fix from there, so we will go with that as Eric wrote the Python 3 migration. We could revert though if Eric finds that fixing does not work out. In the mean time, getting a CI in place is a big priority and we are currently working on both Travis-CI (me) and Appveyor (you). Related issues and PRs (just for reminder): #48, #105, #94, #96. |
I still trying to figure out the extend of this problem my self. Long story short, is bytes are not working well on Windows. On the same system, different version of python will return different bytes representation of the same files ! The point of using bytes, at least on Linux, was to take the unaltered version of the paths regardless of the encoding defined by the user (LANG environment variable). But on Windows it seams more difficult. NTFS is UTF-16, but python is reporting something different depending of the version used. Python 3.7
Python 3.5
Compared to Python 2.7
I found the relevant PEP (https://www.python.org/dev/peps/pep-0529/) that explain the switch to UTF-8 for Python 3.6. It put rdiff-backup in a bad position in regards to how path are managed on Linux vs Windows. My thinking is as follow:
My recommendation is to use
Should we get the CI merged even if the build is broken ? At this point I would say yes. And our goal should be to make is pass ASAP. |
Adding to the complexity of the discussion, I'm not sure what happens if we consider cross-OS communication, e.g. back-up from Windows to Linux Server and vice-versa. |
If we keep msbc encoding. It gonna work like before. Nothing change.
…On Sun, Aug 25, 2019, 1:12 PM Eric L., ***@***.***> wrote:
Adding to the complexity of the discussion, I'm not sure what happens if
we consider cross-OS communication, e.g. back-up from Windows to Linux
Server and vice-versa.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AAHA5I4K5FCVHB4ZQEU7PBTQGK4P7A5CNFSM4IPIT6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CXSKQ#issuecomment-524646698>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHA5I5WOWNU6WJ4LP7XSMLQGK4P7ANCNFSM4IPIT6EQ>
.
|
I'm not sure this is that easy, the code was a pretty mess in terms of unicode on and off, but the fact that everything was a string was hiding a lot of the complexity, but we can try. I would like to push this topic after having cleaned the code in regard to PEP8 before though (editing files currently is a mess in Vim, and the tox tests are failing on flake8). |
We clearly have different priorities in that regards. Having a working version in master branch has a higher priority on my list then making the code PEP8 compliant. |
I would create myself a clean windows VM to understand what's going on, but I need help as I haven't touched windows for years and never for Python development. Could you describe how to create a Dev and test environment on Windows? Adding a chapter or two to DEVELOP.adoc would make it useful for others than me. |
To say the truth, I don't have a development environment for Windows. I'm
using appveyor.
You need visual studio, msys64, python.
You may take a look at my appyevor branch.
…--
Patrik Dufresne
On Wed, Aug 28, 2019 at 2:26 AM Eric L. ***@***.***> wrote:
I would create myself a clean windows VM to understand what's going on,
but I need help as I haven't touched windows for years and never for Python
development.
Could you describe how to create a Dev and test environment on Windows?
Adding a chapter or two to DEVELOP.adoc would make it useful for others
than me.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AAHA5I5GP6OTPTDOM3QXHPTQGYLCTA5CNFSM4IPIT6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5KA6ZQ#issuecomment-525602662>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHA5I3FFR4MIR32CYFOGZLQGYLCTANCNFSM4IPIT6EQ>
.
|
Not sure it helps when you want to try things interactively, but I'll look into it in due time. |
Looking into this bug, few questions:
Anyway, I've got currently python3.7.4 running, all modules installed. Need now to get librsync compiled. |
So that we're aligned, some more information about versions:
|
Hi Eric, will try to give all this information tommorow. Quickly. On
windows, many of the os.* function will simply fail complaining about first
argument only accepting str, not bytes.
I follow your idea to support only the latest python 3.7.
If we want rdiff-backup to be backward compatible with previous repo, will
need to take special care here, to use msbc encoding for path.
For librsync, take a look at my appveyor branch.
https://github.com/ikus060/rdiff-backup/blob/develop/patrik/appveyor/dist/makeexe
…On Sat, Sep 21, 2019, 2:33 AM Eric L., ***@***.***> wrote:
So that we're aligned, some more information about versions:
- Windows 10
- Python 3.7.4
- py2exe 0.9.2.2
- pywin32 224
- VisualStudio 2017 - MSBuild 15.9.21.664
- as written in another thread, I'll most probably use librsync in a
more recent version than 0.9.7 - I'm hesitating between the version on
Fedora (2.0.2), which I know should work, and the latest available at
https://github.com/librsync/librsync/releases i.e. 2.1.0
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#106?email_source=notifications&email_token=AAHA5IZJOXTPAGLTCUSHI7LQKW537A5CNFSM4IPIT6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ILU3I#issuecomment-533772909>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHA5I3JAU3OS2YUMRLKTULQKW537ANCNFSM4IPIT6EQ>
.
|
- use fsdecode on bytes paths when using win32 functions - ignore rdiff-backup.spec created by Windows build - use bytes instead of strings for win_acls - replace os.path.join and os.getcwdb with own RORPath methods to make sure slashes are used under Windows. - try to make life of a Windows developer on Linux easier: - add 7zip to Windows build to be able to compress/uncompress - try to add broken cygwin chocolatey package and comment it - create helper script for debugging rdiff-backup from build - fetch automatically the rdiff-backup.exe binary rdiff-backup can backup, increment and restore backups with this commit. More tests should follow but for now it closes issue #106
- use fsdecode on bytes paths when using win32 functions - ignore rdiff-backup.spec created by Windows build - use bytes instead of strings for win_acls - replace os.path.join and os.getcwdb with own RORPath methods to make sure slashes are used under Windows. - try to make life of a Windows developer on Linux easier: - add 7zip to Windows build to be able to compress/uncompress - try to add broken cygwin chocolatey package and comment it - create helper script for debugging rdiff-backup from build - fetch automatically the rdiff-backup.exe binary rdiff-backup can backup, increment and restore backups with this commit. More tests should follow but for now it closes issue #106
Closing this bug based on PR #141 - just open a new one with specific error messages when discovering new issues with the resulting build. |
Related to #105, the recent pull request to support python3 and make uses of bytes completely broke the Windows build.
All the function os.* on windows platform are only supporting str, not bytes.
All the function from pywin32 are only supporting str, not bytes.
@ericzolf As this point, I'm not sure what to do with the Path. Bytes or Str make it a problem. On Linux Path are clearly manage as bytes, on Windows.
If I was managing this project, I would revert back the py2to3 pull request and work on it again and make sure to make the unittest working on all the platform: Linux, Windows And OSx. Basically, the recent changes broke the build.
The text was updated successfully, but these errors were encountered: