Skip to content

Seperate client and server of FTP #1106

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

Merged
merged 21 commits into from
Aug 7, 2019
Merged

Conversation

AlexDvorak
Copy link
Contributor

fixes issues found in PR#1044 @cclauss

@AlexDvorak
Copy link
Contributor Author

TravisCI is hanging on pytest probably due to the server running an infinite loop, should we add it to the ignore in the pytest command, or should I make it so it only accepts one connection? @cclauss

============================= test session starts ==============================

platform linux -- Python 3.7.1, pytest-4.3.1, py-1.7.0, pluggy-0.8.0

rootdir: /home/travis/build/TheAlgorithms/Python, inifile:

collecting 22 items                                                            

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

The build has been terminated

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please close the server after one transfer but put comments in the code that describes that carefully. For extra credit, add a ONE_CONNECTION_ONLY = True constant to make the code easier to reconfigure.

@cclauss
Copy link
Member

cclauss commented Aug 6, 2019

Also please remove this line and make sure the Travis test passes.
https://github.com/TheAlgorithms/Python/blob/master/.travis.yml#L41

@AlexDvorak
Copy link
Contributor Author

(this is a seperate issue, but the actual FTP protocol does not operate as it does in client.py and server.py)

@cclauss
Copy link
Member

cclauss commented Aug 7, 2019

@cclauss
Copy link
Member

cclauss commented Aug 7, 2019

It seems to be hanging our pytest discovery process. Perhaps put the code under an ìf name == "main":` block so that is not executed each time that pytest imports the file.

@AlexDvorak
Copy link
Contributor Author

AlexDvorak commented Aug 7, 2019

the entirity of client.py and server.py should be under the ìf name == "main":?

@AlexDvorak
Copy link
Contributor Author

AlexDvorak commented Aug 7, 2019

what should we do about this?
ERROR: file not found: pytest
That file is very much not working, but is that out of scope for this PR?

@cclauss
Copy link
Member

cclauss commented Aug 7, 2019

Landed!! Well done!

@cclauss cclauss merged commit 9456e81 into TheAlgorithms:master Aug 7, 2019
@AlexDvorak AlexDvorak deleted the fix_ftp branch August 7, 2019 16:09
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* added sample file to transfer

* split client and server into separate files

* client and server now work in python2

* server works on python3

* client works on python3

* allow configurable ONE_CONNECTION_ONLY for testing server

* allow testing of ftp server + client

* use f-strings

* removed single letter vars

* fixed bad quote marks

* clearer file handler names

* 'with open() as' syntax

* unicode and emojis in the test data

* s -> sock

* consistent comment spacing

* remove closing formalities

* swap in and out_file

* f-string

* if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants