Skip to content
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

[PartDesign] [Hole] Fixed hole error caused by special characters in windows username #7383

Closed
wants to merge 3 commits into from

Conversation

howie-j
Copy link
Contributor

@howie-j howie-j commented Aug 20, 2022

I am not a c++ developer, please check/fix before merging..

The PartDesign::Hole tool fails to read all "Mod/PartDesign/Resources/Hole/xxxxx.json" files if your windows username contains special characters.

Forum thread: Hole tool fails with special characters in the username

@wwmayer fixed a similar issue in techdraw with this commit,
so i attempted to fix this issue for the hole tool with the info from this post.

Compiles and works on linux, but not tested on windows.


Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the FreeCAD forum!

  • Your pull request is confined strictly to a single module. That is, all the files changed by your pull request are either in App, Base, Gui or one of the Mod subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next ones
  • In case your pull request does more than just fixing small bugs, make sure you discussed your ideas with other developers on the FreeCAD forum
  • Your branch is rebased on latest master git pull --rebase upstream master
  • All FreeCAD unit tests are confirmed to pass by running ./bin/FreeCAD --run-test 0
  • All commit messages are well-written ex: Fixes typo in Draft Move command text
  • Your pull request is well written and has a good description, and its title starts with the module name, ex: Draft: Fixed typos
  • Commit messages include issue #<id> or fixes #<id> where <id> is the issue ID number from our Issues database in case a particular commit solves or is related to an existing issue. Ex: Draft: fix typos - fixes #4805

And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.20 Changelog Forum Thread.


@github-actions github-actions bot added the WB Part Design Related to the Part Design Workbench label Aug 20, 2022
@@ -2295,7 +2297,8 @@ void Hole::readCutDefinitions()
for (const auto& f : files) {
if (f.extension() == "json") {
try {
std::ifstream input(f.filePath());
Base::FileInfo fi(f.filePath());
Copy link
Contributor

Choose a reason for hiding this comment

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

f already is a FileInfo object. So, no need to create a tmp. object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, 74f7154 is this correct now?

@wwmayer
Copy link
Contributor

wwmayer commented Aug 21, 2022

Merged.

@wwmayer wwmayer closed this Aug 21, 2022
@luzpaz luzpaz changed the title [REVIEW BEFORE MERGING] [PartDesign] [Hole] Fixed hole error caused by special characters in windows username [PartDesign] [Hole] Fixed hole error caused by special characters in windows username Aug 21, 2022
@luzpaz
Copy link
Contributor

luzpaz commented Aug 21, 2022

Congrats @howie-j on your 1st PR and successful merge. As always, thanks again wmayer!

@howie-j howie-j deleted the special_character_bugs branch August 21, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB Part Design Related to the Part Design Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants